You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/Tutorials/Beginner-CLI-Tools/Recording-And-Playing-Back-Data/Recording-And-Playing-Back-Data.rst
+222-8Lines changed: 222 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,11 @@
7
7
Recording and playing back data
8
8
===============================
9
9
10
-
**Goal:** Record data published on a topic and a service so you can replay and examine it any time.
10
+
**Goal:** Record data published on a topic, a service and an action so you can replay and examine it any time.
11
11
12
12
**Tutorial level:** Beginner
13
13
14
-
**Time:** 15 minutes
14
+
**Time:** 20 minutes
15
15
16
16
.. contents:: Contents
17
17
:depth: 2
@@ -20,10 +20,10 @@ Recording and playing back data
20
20
Background
21
21
----------
22
22
23
-
``ros2 bag`` is a command line tool for recording data published on topicsand services in your ROS 2 system.
24
-
It accumulates the data passed on any number of topicsand services, then saves it in a database.
23
+
``ros2 bag`` is a command line tool for recording data published on topics, services and actions in your ROS 2 system.
24
+
It accumulates the data passed on any number of topics, services and actions, then saves it in a database.
25
25
You can then replay the data to reproduce the results of your tests and experiments.
26
-
Recording topicsand services is also a great way to share your work and allow others to recreate it.
26
+
Recording topics, services and actions is also a great way to share your work and allow others to recreate it.
27
27
28
28
29
29
Prerequisites
@@ -33,8 +33,8 @@ You should have ``ros2 bag`` installed as a part of your regular ROS 2 setup.
33
33
34
34
If you need to install ROS 2, see the :doc:`Installation instructions <../../../Installation>`.
35
35
36
-
This tutorial talks about concepts covered in previous tutorials, like :doc:`nodes <../Understanding-ROS2-Nodes/Understanding-ROS2-Nodes>`, :doc:`topics <../Understanding-ROS2-Topics/Understanding-ROS2-Topics>` and :doc:`services <../Understanding-ROS2-Services/Understanding-ROS2-Services>`.
37
-
It also uses the :doc:`turtlesim package <../Introducing-Turtlesim/Introducing-Turtlesim>` and :doc:`Service Introspection Demo <../../Demos/Service-Introspection>`.
36
+
This tutorial talks about concepts covered in previous tutorials, like :doc:`nodes <../Understanding-ROS2-Nodes/Understanding-ROS2-Nodes>`, :doc:`topics <../Understanding-ROS2-Topics/Understanding-ROS2-Topics>`, :doc:`services <../Understanding-ROS2-Services/Understanding-ROS2-Services>` and :doc:`actions <../Understanding-ROS2-Actions/Understanding-ROS2-Actions>`.
37
+
It also uses the :doc:`turtlesim package <../Introducing-Turtlesim/Introducing-Turtlesim>`, :doc:`Service Introspection Demo <../../Demos/Service-Introspection>` and :doc:`Action Introspection Demo <../../Demos/Action-Introspection>`.
38
38
39
39
As always, don't forget to source ROS 2 in :doc:`every new terminal you open <../Configuring-ROS2-Environment>`.
40
40
@@ -427,10 +427,223 @@ You can see the service request from the bag file and the service response from
427
427
request: []
428
428
response: [{sum: 5}]
429
429
430
+
Managing Action Data
431
+
--------------------
432
+
433
+
1 Setup
434
+
^^^^^^^
435
+
436
+
You'll be recording action data between ``fibonacci_action_client`` and ``fibonacci_action_server``, then display and replay that same data later on.
437
+
To record action data between action client and server, ``Action Introspection`` must be enabled on the nodes.
438
+
439
+
Let's start ``fibonacci_action_client`` and ``fibonacci_action_server`` nodes and enable ``Action Introspection``.
440
+
You can see more details for :doc:`Action Introspection Demo <../../Demos/Action-Introspection>`.
441
+
442
+
Open a new terminal and run ``fibonacci_action_server``, enabling ``Action Introspection``:
443
+
444
+
.. code-block:: bash
445
+
446
+
ros2 run action_tutorials_py fibonacci_action_server --ros-args -p action_server_configure_introspection:=contents
447
+
448
+
Open another terminal and run ``fibonacci_action_client``, enabling ``Action Introspection``:
449
+
450
+
.. code-block:: bash
451
+
452
+
ros2 run action_tutorials_cpp fibonacci_action_client --ros-args -p action_client_configure_introspection:=contents
453
+
454
+
2 Check action availability
455
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
456
+
457
+
``ros2 bag`` can only record data from available actions.
458
+
To see the list of your system's actions, open a new terminal and run the command:
459
+
460
+
.. code-block:: console
461
+
462
+
$ ros2 action list
463
+
/fibonacci
464
+
465
+
To check if ``Action Introspection`` is enabled on the action, run the command:
You can record data passed on topicsand services in your ROS 2 system using the ``ros2 bag`` command.
646
+
You can record data passed on topics, services and actions in your ROS 2 system using the ``ros2 bag`` command.
434
647
Whether you're sharing your work with others or introspecting your own experiments, it's a great tool to know about.
435
648
436
649
Next steps
@@ -444,4 +657,5 @@ Related content
444
657
445
658
A more thorough explanation of ``ros2 bag`` can be found in the README `here <https://github.com/ros2/rosbag2>`__.
446
659
For more information on service recording and playback can be found in the design document `here <https://github.com/ros2/rosbag2/blob/{DISTRO}/docs/design/rosbag2_record_replay_service.md>`__.
660
+
For more information on action recording and playback can be found in the design document `here <https://github.com/ros2/rosbag2/blob/{DISTRO}/docs/design/rosbag2_record_replay_action.md>`__.
447
661
For more information on QoS compatibility and ``ros2 bag``, see :doc:`../../../How-To-Guides/Overriding-QoS-Policies-For-Recording-And-Playback`.
0 commit comments