@@ -93,9 +93,6 @@ The files already exist, we just need to modify them as follows
93
93
In :file: `CMakeLists.txt ` we have a sequence of four blocks. These are all directly related to ROS2 and although in
94
94
this tutorial I define a best practice, this is not particular to ``sas ``.
95
95
96
-
97
-
98
-
99
96
Making your own ``sas `` robot drivers
100
97
-------------------------------------
101
98
@@ -179,7 +176,6 @@ added or removed.
179
176
180
177
.. literalinclude :: ../../../sas_tutorial_workspace/src/sas_robot_driver_myrobot/include/sas_robot_driver_myrobot/sas_robot_driver_myrobot.hpp
181
178
:language: cpp
182
- :linenos:
183
179
:lines: 36-40
184
180
185
181
Second, we rely on the `PIMPL idiom <https://en.cppreference.com/w/cpp/language/pimpl >`_. This idiom is important to
@@ -189,7 +185,6 @@ is an important design aspect and should not be confused simply with aesthetics
189
185
190
186
.. literalinclude :: ../../../sas_tutorial_workspace/src/sas_robot_driver_myrobot/include/sas_robot_driver_myrobot/sas_robot_driver_myrobot.hpp
191
187
:language: cpp
192
- :linenos:
193
188
:lines: 47-49
194
189
195
190
When using the `PIMPL idiom <https://en.cppreference.com/w/cpp/language/pimpl >`_ it is important not to forget that the
@@ -198,7 +193,6 @@ this will depend heavily on the robot drivers.
198
193
199
194
.. literalinclude :: ../../../sas_tutorial_workspace/src/sas_robot_driver_myrobot/src/sas_robot_driver_myrobot.cpp
200
195
:language: cpp
201
- :linenos:
202
196
:lines: 36-51
203
197
204
198
Writing the ROS2 Node
@@ -261,19 +255,19 @@ The launch file will be like so.
261
255
:linenos:
262
256
:lines: 5-
263
257
264
- The parameters should be no surprise defined as follows.
258
+ The parameters should be no surprise defined as follows. The only one that was not defined by our struct
259
+ ``RobotDriverMyrobotConfiguration ``, namely ``thread_sampling_time_sec ``, is a parameter of ``sas::RobotDriverROSConfiguration ``
260
+ that defines the sampling time of the ROS2 loop.
265
261
266
262
.. literalinclude :: ../../../sas_tutorial_workspace/src/sas_robot_driver_myrobot/launch/real_robot_launch.py
267
263
:language: python
268
- :linenos:
269
264
:lines: 18-23
270
265
271
266
The most memorable aspect with respect to ``sas `` is that the ``name `` will define the topic prefixes. This is important
272
267
to match other elements of ``sas ``.
273
268
274
269
.. literalinclude :: ../../../sas_tutorial_workspace/src/sas_robot_driver_myrobot/launch/real_robot_launch.py
275
270
:language: python
276
- :linenos:
277
271
:lines: 17
278
272
279
273
Running the launch file
0 commit comments