Skip to content

Commit bfbd9bc

Browse files
authored
tf2 listener cpp tutorial: minor syntax/wording improvements (#4434)
* tf2 listener cpp tutorial: minor syntax/wording improvements * add link to tf2 concepts page
1 parent 3456aed commit bfbd9bc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

source/Tutorials/Intermediate/Tf2/Writing-A-Tf2-Listener-Cpp.rst

+8-4
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Open the file using your preferred text editor.
111111

112112
// Call on_timer function every second
113113
timer_ = this->create_wall_timer(
114-
1s, [this](){return this->on_timer();});
114+
1s, [this]() {return this->on_timer();});
115115
}
116116

117117
private:
@@ -212,7 +212,7 @@ Open the file using your preferred text editor.
212212
To understand how the service behind spawning turtle works, please refer to :doc:`writing a simple service and client (C++) <../../Beginner-Client-Libraries/Writing-A-Simple-Cpp-Service-And-Client>` tutorial.
213213

214214
Now, let's take a look at the code that is relevant to get access to frame transformations.
215-
The ``tf2_ros`` contains a ``TransformListener`` header file implementation that makes the task of receiving transforms easier.
215+
The ``tf2_ros`` contains a ``TransformListener`` class that makes the task of receiving transforms easier.
216216

217217
.. code-block:: C++
218218

@@ -235,7 +235,7 @@ We call ``lookup_transform`` method with following arguments:
235235

236236
#. The time at which we want to transform
237237

238-
Providing ``tf2::TimePointZero()`` will just get us the latest available transform.
238+
Providing ``tf2::TimePointZero`` will just get us the latest available transform.
239239
All this is wrapped in a try-catch block to handle possible exceptions.
240240

241241
.. code-block:: C++
@@ -244,6 +244,10 @@ All this is wrapped in a try-catch block to handle possible exceptions.
244244
toFrameRel, fromFrameRel,
245245
tf2::TimePointZero);
246246

247+
The resulting transformation represents the position and orientation of the target turtle relative to ``turtle2``.
248+
The angle between the turtles is then used to calculate a velocity command to follow the target turtle.
249+
For more general information about tf2 see also the :doc:`tf2 page in the Concepts section <../../../Concepts/Intermediate/About-Tf2>`.
250+
247251
1.2 CMakeLists.txt
248252
~~~~~~~~~~~~~~~~~~
249253

@@ -323,7 +327,7 @@ The resulting file should look like:
323327
),
324328
])
325329
326-
This will declare a ``target_frame`` launch argument, start a broadcaster for second turtle that we will spawn and listener that will subscribe to those transformations.
330+
This will declare a ``target_frame`` launch argument, start a broadcaster for the second turtle that we will spawn and a listener that will subscribe to those transformations.
327331

328332
3 Build
329333
^^^^^^^

0 commit comments

Comments
 (0)