Skip to content

Commit 870cdea

Browse files
mergify[bot]Nils-ChristianIsekechristophebedard
authored
Add $ to Demos (backport #5352) (#5392)
Signed-off-by: Nils-Christian Iseke <[email protected]> Signed-off-by: Nils-Christian Iseke <[email protected]> Signed-off-by: Christophe Bedard <[email protected]> Co-authored-by: Christophe Bedard <[email protected]> (cherry picked from commit 8d1b99d) Signed-off-by: Christophe Bedard <[email protected]> Co-authored-by: Nils-Christian Iseke <[email protected]> Co-authored-by: Christophe Bedard <[email protected]>
1 parent 75ddec1 commit 870cdea

7 files changed

+246
-219
lines changed

source/Tutorials/Demos/Content-Filtering-Subscription.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ The ``ContentFilteringPublisher`` node publishes simulated temperature data star
132132

133133
We can run the demo by running the ``ros2 run demo_nodes_cpp content_filtering_publisher`` executable (don't forget to source the setup file first):
134134

135-
.. code-block:: bash
135+
.. code-block:: console
136136
137137
$ ros2 run demo_nodes_cpp content_filtering_publisher
138138
[INFO] [1651094594.822753479] [content_filtering_publisher]: Publishing: '-100.000000'
@@ -248,7 +248,7 @@ Applications can use the ``is_cft_enabled`` method to check if content filtering
248248

249249
To test content filtering subscription, let's run it:
250250

251-
.. code-block:: bash
251+
.. code-block:: console
252252
253253
$ ros2 run demo_nodes_cpp content_filtering_subscriber
254254
[INFO] [1651094590.682660703] [content_filtering_subscriber]: subscribed to topic "/temperature" with content filter options "data < %0 OR data > %1, {-30.000000, 100.000000}"
@@ -277,7 +277,7 @@ You should see a message showing the content filtering options used and logs for
277277
If content filtering is not supported by the RMW implementation, the subscription will still be created without content filtering enabled.
278278
We can try that by executing ``RMW_IMPLEMENTATION=rmw_cyclonedds_cpp ros2 run demo_nodes_cpp content_filtering_publisher``.
279279

280-
.. code-block:: bash
280+
.. code-block:: console
281281
282282
$ RMW_IMPLEMENTATION=rmw_cyclonedds_cpp ros2 run demo_nodes_cpp content_filtering_subscriber
283283
[WARN] [1651096637.893842072] [content_filtering_subscriber]: Content filter is not enabled since it is not supported

source/Tutorials/Demos/Intra-Process-Communication.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ This demonstrates that intra process communication is indeed working and unneces
135135

136136
Let's run the demo by executing ``ros2 run intra_process_demo two_node_pipeline`` executable (don't forget to source the setup file first):
137137

138-
.. code-block:: bash
138+
.. code-block:: console
139139
140140
$ ros2 run intra_process_demo two_node_pipeline
141141
Published message with value: 0, and address: 0x7fb02303faf0
@@ -263,7 +263,7 @@ Because the message is being published and subscribed to as a ``unique_ptr`` the
263263

264264
To test those expectations, let's run it:
265265

266-
.. code-block:: bash
266+
.. code-block:: console
267267
268268
$ ros2 run intra_process_demo cyclic_pipeline
269269
Published first message with value: 42, and address: 0x7fd2ce0a2bc0
@@ -302,7 +302,7 @@ In this demo we'll use OpenCV to capture, annotate, and then view images.
302302

303303
If you are on macOS and these examples do not work or you receive an error like ``ddsi_conn_write failed -1``, then you'll need to increase your system wide UDP packet size:
304304

305-
.. code-block:: bash
305+
.. code-block:: console
306306
307307
$ sudo sysctl -w net.inet.udp.recvspace=209715
308308
$ sudo sysctl -w net.inet.udp.maxdgram=65500
@@ -329,9 +329,9 @@ The watermark and image view nodes are designed to modify the image without copy
329329

330330
Let's run the demo by executing the following executable:
331331

332-
.. code-block:: bash
332+
.. code-block:: console
333333
334-
ros2 run intra_process_demo image_pipeline_all_in_one
334+
$ ros2 run intra_process_demo image_pipeline_all_in_one
335335
336336
You should see something like this:
337337

@@ -352,9 +352,9 @@ All the nodes are still in the same process, but now two image view windows shou
352352
(Note for macOS users: your image view windows might be on top of each other).
353353
Let's run it with the command:
354354

355-
.. code-block:: bash
355+
.. code-block:: console
356356
357-
ros2 run intra_process_demo image_pipeline_with_two_image_view
357+
$ ros2 run intra_process_demo image_pipeline_with_two_image_view
358358
359359
360360
.. image:: images/intra-process-demo-pipeline-two-windows-copy.png

source/Tutorials/Demos/Logging-and-logger-configuration.rst

+68-68
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ In this `demo <https://github.com/ros2/demos/tree/{REPOS_FILE_BRANCH}/logging_de
147147

148148
Start the demo with:
149149

150-
.. code-block:: bash
150+
.. code-block:: console
151151
152-
ros2 run logging_demo logging_demo_main
152+
$ ros2 run logging_demo logging_demo_main
153153
154154
Over time you will see output from various log calls with different properties.
155155
To start with you will only see output from log calls with severity ``INFO`` and above (``WARN``, ``ERROR``, ``FATAL``).
@@ -170,24 +170,24 @@ For example, to set the logging directory to ``~/my_logs``:
170170

171171
.. group-tab:: Linux
172172

173-
.. code-block:: bash
173+
.. code-block:: console
174174
175-
export ROS_LOG_DIR=~/my_logs
176-
ros2 run logging_demo logging_demo_main
175+
$ export ROS_LOG_DIR=~/my_logs
176+
$ ros2 run logging_demo logging_demo_main
177177
178178
.. group-tab:: macOS
179179

180-
.. code-block:: bash
180+
.. code-block:: console
181181
182-
export ROS_LOG_DIR=~/my_logs
183-
ros2 run logging_demo logging_demo_main
182+
$ export ROS_LOG_DIR=~/my_logs
183+
$ ros2 run logging_demo logging_demo_main
184184
185185
.. group-tab:: Windows
186186

187-
.. code-block:: bash
187+
.. code-block:: console
188188
189-
set "ROS_LOG_DIR=~/my_logs"
190-
ros2 run logging_demo logging_demo_main
189+
$ set "ROS_LOG_DIR=~/my_logs"
190+
$ ros2 run logging_demo logging_demo_main
191191
192192
You will then find the logs under ``~/my_logs/``.
193193

@@ -200,24 +200,24 @@ For example, with ``ROS_HOME`` set to ``~/my_ros_home``:
200200

201201
.. group-tab:: Linux
202202

203-
.. code-block:: bash
203+
.. code-block:: console
204204
205-
export ROS_HOME=~/my_ros_home
206-
ros2 run logging_demo logging_demo_main
205+
$ export ROS_HOME=~/my_ros_home
206+
$ ros2 run logging_demo logging_demo_main
207207
208208
.. group-tab:: macOS
209209

210-
.. code-block:: bash
210+
.. code-block:: console
211211
212-
export ROS_HOME=~/my_ros_home
213-
ros2 run logging_demo logging_demo_main
212+
$ export ROS_HOME=~/my_ros_home
213+
$ ros2 run logging_demo logging_demo_main
214214
215215
.. group-tab:: Windows
216216

217-
.. code-block:: bash
217+
.. code-block:: console
218218
219-
set "ROS_HOME=~/my_ros_home"
220-
ros2 run logging_demo logging_demo_main
219+
$ set "ROS_HOME=~/my_ros_home"
220+
$ ros2 run logging_demo logging_demo_main
221221
222222
You will then find the logs under ``~/my_ros_home/log/``.
223223

@@ -239,17 +239,17 @@ In the meantime, this demo provides an **example** service that can be called ex
239239
The demo previously started is already running this example service.
240240
To set the level of the demo's logger back to ``INFO``\ , call the service with:
241241

242-
.. code-block:: bash
242+
.. code-block:: console
243243
244-
ros2 service call /config_logger logging_demo/srv/ConfigLogger "{logger_name: 'logger_usage_demo', level: INFO}"
244+
$ ros2 service call /config_logger logging_demo/srv/ConfigLogger "{logger_name: 'logger_usage_demo', level: INFO}"
245245
246246
This service call will work on any logger that is running in the process provided that you know its name.
247247
This includes the loggers in the ROS 2 core, such as ``rcl`` (the common client library package).
248248
To enable debug logging for ``rcl``, call:
249249

250-
.. code-block:: bash
250+
.. code-block:: console
251251
252-
ros2 service call /config_logger logging_demo/srv/ConfigLogger "{logger_name: 'rcl', level: DEBUG}"
252+
$ ros2 service call /config_logger logging_demo/srv/ConfigLogger "{logger_name: 'rcl', level: DEBUG}"
253253
254254
You should see debug output from ``rcl`` start to show.
255255

@@ -263,32 +263,32 @@ As an example, if you want to debug the ``composition::Talker`` demo, you can st
263263

264264
Shell 1:
265265

266-
.. code-block:: bash
266+
.. code-block:: console
267267
268-
ros2 run rclcpp_components component_container
268+
$ ros2 run rclcpp_components component_container
269269
270270
Shell 2:
271271

272-
.. code-block:: bash
272+
.. code-block:: console
273273
274-
ros2 component load /ComponentManager composition composition::Talker
274+
$ ros2 component load /ComponentManager composition composition::Talker
275275
276276
And then when you want to enable debug logging, load the ``LoggerConfig`` component with:
277277

278278
Shell 2
279279

280-
.. code-block:: bash
280+
.. code-block:: console
281281
282-
ros2 component load /ComponentManager logging_demo logging_demo::LoggerConfig
282+
$ ros2 component load /ComponentManager logging_demo logging_demo::LoggerConfig
283283
284284
And finally, configure all unset loggers to the debug severity by addressing the empty-named logger.
285285
Note that loggers that have been specifically configured to use a particular severity will not be affected by this call.
286286

287287
Shell 2:
288288

289-
.. code-block:: bash
289+
.. code-block:: console
290290
291-
ros2 service call /config_logger logging_demo/srv/ConfigLogger "{logger_name: '', level: DEBUG}"
291+
$ ros2 service call /config_logger logging_demo/srv/ConfigLogger "{logger_name: '', level: DEBUG}"
292292
293293
You should see debug output from any previously unset loggers in the process start to appear, including from the ROS 2 core.
294294

@@ -299,9 +299,9 @@ As of the Bouncy ROS 2 release, the severity level for loggers that have not had
299299
Restart the demo including the following command line argument:
300300

301301

302-
.. code-block:: bash
302+
.. code-block:: console
303303
304-
ros2 run logging_demo logging_demo_main --ros-args --log-level debug
304+
$ ros2 run logging_demo logging_demo_main --ros-args --log-level debug
305305
306306
This configures the default severity for any unset logger to the debug severity level.
307307
You should see debug output from loggers from the demo itself and from the ROS 2 core.
@@ -313,9 +313,9 @@ Restart the demo including the following command line arguments:
313313

314314
.. group-tab:: Galactic and newer
315315

316-
.. code-block:: bash
316+
.. code-block:: console
317317
318-
ros2 run logging_demo logging_demo_main --ros-args --log-level logger_usage_demo:=debug
318+
$ ros2 run logging_demo logging_demo_main --ros-args --log-level logger_usage_demo:=debug
319319
320320
321321
Console output formatting
@@ -328,24 +328,24 @@ For example, to additionally get the timestamp and location of the log calls, st
328328

329329
.. group-tab:: Linux
330330

331-
.. code-block:: bash
331+
.. code-block:: console
332332
333-
export RCUTILS_CONSOLE_OUTPUT_FORMAT="[{severity} {time}] [{name}]: {message} ({function_name}() at {file_name}:{line_number})"
334-
ros2 run logging_demo logging_demo_main
333+
$ export RCUTILS_CONSOLE_OUTPUT_FORMAT="[{severity} {time}] [{name}]: {message} ({function_name}() at {file_name}:{line_number})"
334+
$ ros2 run logging_demo logging_demo_main
335335
336336
.. group-tab:: macOS
337337

338-
.. code-block:: bash
338+
.. code-block:: console
339339
340-
export RCUTILS_CONSOLE_OUTPUT_FORMAT="[{severity} {time}] [{name}]: {message} ({function_name}() at {file_name}:{line_number})"
341-
ros2 run logging_demo logging_demo_main
340+
$ export RCUTILS_CONSOLE_OUTPUT_FORMAT="[{severity} {time}] [{name}]: {message} ({function_name}() at {file_name}:{line_number})"
341+
$ ros2 run logging_demo logging_demo_main
342342
343343
.. group-tab:: Windows
344344

345-
.. code-block:: bash
345+
.. code-block:: console
346346
347-
set "RCUTILS_CONSOLE_OUTPUT_FORMAT=[{severity} {time}] [{name}]: {message} ({function_name}() at {file_name}:{line_number})"
348-
ros2 run logging_demo logging_demo_main
347+
$ set "RCUTILS_CONSOLE_OUTPUT_FORMAT=[{severity} {time}] [{name}]: {message} ({function_name}() at {file_name}:{line_number})"
348+
$ ros2 run logging_demo logging_demo_main
349349
350350
You should see the timestamp in seconds and the function name, filename and line number additionally printed with each message.
351351
*The ``time`` option is only supported as of the ROS 2 Bouncy release.*
@@ -361,24 +361,24 @@ For example:
361361

362362
.. group-tab:: Linux
363363

364-
.. code-block:: bash
364+
.. code-block:: console
365365
366-
export RCUTILS_COLORIZED_OUTPUT=0 # 1 for forcing it
367-
ros2 run logging_demo logging_demo_main
366+
$ export RCUTILS_COLORIZED_OUTPUT=0 # 1 for forcing it
367+
$ ros2 run logging_demo logging_demo_main
368368
369369
.. group-tab:: macOS
370370

371-
.. code-block:: bash
371+
.. code-block:: console
372372
373-
export RCUTILS_COLORIZED_OUTPUT=0 # 1 for forcing it
374-
ros2 run logging_demo logging_demo_main
373+
$ export RCUTILS_COLORIZED_OUTPUT=0 # 1 for forcing it
374+
$ ros2 run logging_demo logging_demo_main
375375
376376
.. group-tab:: Windows
377377

378-
.. code-block:: bash
378+
.. code-block:: console
379379
380-
set "RCUTILS_COLORIZED_OUTPUT=0" :: 1 for forcing it
381-
ros2 run logging_demo logging_demo_main
380+
$ set "RCUTILS_COLORIZED_OUTPUT=0" :: 1 for forcing it
381+
$ ros2 run logging_demo logging_demo_main
382382
383383
You should see that debug, warn, error and fatal logs aren't colorized now.
384384

@@ -400,21 +400,21 @@ For example:
400400

401401
.. group-tab:: Linux
402402

403-
.. code-block:: bash
403+
.. code-block:: console
404404
405-
export RCUTILS_LOGGING_USE_STDOUT=1
405+
$ export RCUTILS_LOGGING_USE_STDOUT=1
406406
407407
.. group-tab:: macOS
408408

409-
.. code-block:: bash
409+
.. code-block:: console
410410
411-
export RCUTILS_LOGGING_USE_STDOUT=1
411+
$ export RCUTILS_LOGGING_USE_STDOUT=1
412412
413413
.. group-tab:: Windows
414414

415-
.. code-block:: bash
415+
.. code-block:: console
416416
417-
set "RCUTILS_LOGGING_USE_STDOUT=1"
417+
$ set "RCUTILS_LOGGING_USE_STDOUT=1"
418418
419419
420420
Line buffered console output
@@ -429,24 +429,24 @@ For example:
429429

430430
.. group-tab:: Linux
431431

432-
.. code-block:: bash
432+
.. code-block:: console
433433
434-
export RCUTILS_LOGGING_BUFFERED_STREAM=1
434+
$ export RCUTILS_LOGGING_BUFFERED_STREAM=1
435435
436436
.. group-tab:: macOS
437437

438-
.. code-block:: bash
438+
.. code-block:: console
439439
440-
export RCUTILS_LOGGING_BUFFERED_STREAM=1
440+
$ export RCUTILS_LOGGING_BUFFERED_STREAM=1
441441
442442
.. group-tab:: Windows
443443

444-
.. code-block:: bash
444+
.. code-block:: console
445445
446-
set "RCUTILS_LOGGING_BUFFERED_STREAM=1"
446+
$ set "RCUTILS_LOGGING_BUFFERED_STREAM=1"
447447
448448
Then run:
449449

450-
.. code-block:: bash
450+
.. code-block:: console
451451
452-
ros2 run logging_demo logging_demo_main
452+
$ ros2 run logging_demo logging_demo_main

0 commit comments

Comments
 (0)