-
Notifications
You must be signed in to change notification settings - Fork 323
[Design] Add design doc for actions recording and replay #1928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
MichaelOrlov
merged 6 commits into
ros2:rolling
from
Barry-Xu-2018:review/topic-add-design-for-record-replay-action
Mar 18, 2025
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ea9bd92
[Design] Add design on recording and replay action
Barry-Xu-2018 d8246df
Fix a typo
Barry-Xu-2018 f989395
Address some of review comments
Barry-Xu-2018 52f39c7
Update to avoid display issue
Barry-Xu-2018 437e784
Use "--send-actions-as-client" instead of "--send-action-goal"
Barry-Xu-2018 3f1ead3
Add note to the description of argument "--send-actions-as-client"
Barry-Xu-2018 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| # Rosbag2 record and replay action | ||
|
|
||
| ## Context | ||
|
|
||
| This design describes how to implement this feature based on current architecture and how to extend current command parameter. | ||
|
|
||
| ## How to record action message | ||
|
|
||
| The implementation of the action uses three services and two topics. For the services, when service introspection is enabled, rosbag2 can record service data through the service event topic (refer to [rosbag2_record_replay_service.md](./rosbag2_record_replay_service.md)). So all data related to the action can be recorded. | ||
|
|
||
|
|
||
| ## Which topics should be focused on for an action | ||
|
|
||
| - goal service | ||
|
|
||
| [NameSpace/]ActionName/_action/send_goal (Service Event Topic: [NameSpace/]ActionName/_action/send_goal/_service_event) | ||
|
|
||
| - result service | ||
|
|
||
| [NameSpace/]ActionName/_action/get_result (Service Event Topic: [NameSpace/]ActionName/_action/get_result/_service_event) | ||
|
|
||
| - cancel service | ||
|
|
||
| [NameSpace/]ActionName/_action/cancel_goal (Service Event Topic: [NameSpace/]ActionName/_action/cancel_goal/_service_event) | ||
|
|
||
| - status topic | ||
|
|
||
| [NameSpace/]ActionName/_action/status | ||
|
|
||
| - feedback topic | ||
|
|
||
| [NameSpace/]ActionName/_action/feedback | ||
|
Barry-Xu-2018 marked this conversation as resolved.
|
||
|
|
||
| For an action, five related topics will be recorded. | ||
|
|
||
| ### Expand the 'record' command | ||
|
|
||
| Newly added arguments: | ||
|
|
||
| | Argument Name | Description | | ||
| | :-- | :-- | | ||
| | --actions ActionName [ActionName ...] | Space-delimited list of actions to record. | | ||
| | --all-actions | Record all actions via service event topics and hidden action topics. | | ||
| | --exclude-actions ActionName [ActionName ...] | Space-delimited list of actions not being recorded. Works on top of --all, --all-actions, --actions or --regex. | | ||
|
|
||
| Updated arguments: | ||
|
|
||
| | Argument Name | Description | | ||
| | :-- | :-- | | ||
| | -a, --all | Record all topics, services and **actions** (Exclude hidden topic). | | ||
| | -e REGEX, --regex REGEX | Record only topics, services and **actions** containing provided regular expression. Note: --all, --all-topics, --all-services or **--all-actions** will override --regex. | | ||
| | --exclude-regex EXCLUDE_REGEX | Exclude topics, services and actions containing provided regular expression. Works on top of --all, --all-topics, --all-services, **--all-actions**, --topics, --services, **--actions** or --regex. | | ||
|
|
||
| ### Change output of 'Info' command | ||
|
|
||
| Add action part. | ||
|
|
||
| Without `-v` or `--verbose` parameter, info command shows as below example. | ||
| ``` | ||
| Files: <bag_name>.mcap | ||
| Bag size: 39.9 KiB | ||
| Storage id: mcap | ||
| ROS Distro: rolling | ||
| Duration: 4.835s | ||
| Start: Mar 18 2024 16:42:14.323 (1710805334.323) | ||
| End: Mar 18 2024 16:42:19.159 (1710805339.159) | ||
| Messages: 39 | ||
| Topic information: Topic: /events/write_split | Type: rosbag2_interfaces/msg/WriteSplitEvent | Count: 0 | Serialization Format: cdr | ||
| Topic: /parameter_events | Type: rcl_interfaces/msg/ParameterEvent | Count: 0 | Serialization Format: cdr | ||
| Topic: /rosout | Type: rcl_interfaces/msg/Log | Count: 39 | Serialization Format: cdr | ||
| Service: 1 | ||
|
Barry-Xu-2018 marked this conversation as resolved.
Outdated
|
||
| Service information: Service: /add_two_ints | Type: example_interfaces/srv/AddTwoInts | Event Count: 42 | Serialization Format: cdr | ||
| Action: 2 | ||
|
Barry-Xu-2018 marked this conversation as resolved.
Outdated
|
||
| Action information: | ||
| Action: /fibonacci | Type: action_tutorials_interfaces/action/Fibonacci | Topics: 2 | Services: 3 | Serialization Format: cdr | ||
| Topic: feedback | Count: 1 | ||
| Topic: status | Count: 10 | ||
| Service: send_goal | Event Count: 20 | ||
| Service: cancel_goal | Event Count: 2 | ||
| Service: get_result | Event Count: 9 | ||
| Action: /other | Type: other_action_interfaces/action/Other | Topics: 2 | Services: 3 | Serialization Format: cdr | ||
| Topic: feedback | Count: 2 | ||
| Topic: status | Count: 20 | ||
| Service: send_goal | Event Count: 40 | ||
| Service: cancel_goal | Event Count: 4 | ||
| Service: get_result | Event Count: 9 | ||
| ``` | ||
|
|
||
| With `-v` or `--verbose` parameter, info command shows as below example. | ||
| ``` | ||
| Files: <bag_name>.mcap | ||
| Bag size: 39.9 KiB | ||
| Storage id: mcap | ||
| ROS Distro: rolling | ||
| Duration: 4.835s | ||
| Start: Mar 18 2024 16:42:14.323 (1710805334.323) | ||
| End: Mar 18 2024 16:42:19.159 (1710805339.159) | ||
| Messages: 39 | ||
| Topic information: Topic: /events/write_split | Type: rosbag2_interfaces/msg/WriteSplitEvent | Count: 0 | Serialization Format: cdr | ||
| Topic: /parameter_events | Type: rcl_interfaces/msg/ParameterEvent | Count: 0 | Serialization Format: cdr | ||
| Topic: /rosout | Type: rcl_interfaces/msg/Log | Count: 39 | Serialization Format: cdr | ||
| Service: 1 | ||
|
Barry-Xu-2018 marked this conversation as resolved.
Outdated
|
||
| Service information: Service: /add_two_ints | Type: example_interfaces/srv/AddTwoInts | Request Count: 20 | Response Count: 22 | Serialization Format: cdr | ||
| Action: 2 | ||
|
Barry-Xu-2018 marked this conversation as resolved.
Outdated
|
||
| Action information: | ||
| Action: /fibonacci | Type: action_tutorials_interfaces/action/Fibonacci | Topics: 2 | Services: 3 | Serialization Format: cdr | ||
| Topic: feedback | Count: 1 | ||
| Topic: status | Count: 10 | ||
| Service: send_goal | Request Count: 10 | Response Count: 10 | ||
| Service: cancel_goal | Request Count: 1 | Response Count: 1 | ||
| Service: get_result | Request Count: 5 | Response Count: 4 | ||
| Action: /other | Type: other_action_interfaces/action/Other | Topics: 2 | Services: 3 | Serialization Format: cdr | ||
| Topic: feedback | Count: 2 | ||
| Topic: status | Count: 20 | ||
| Service: send_goal | Request Count: 20 | Response Count: 20 | ||
| Service: cancel_goal | Request Count: 2 | Response Count: 2 | ||
| Service: get_result | Request Count: 5 | Response Count: 4 | ||
| ``` | ||
|
|
||
| ### Expand the 'play' command | ||
|
|
||
| Newly added arguments: | ||
|
|
||
| | Argument Name | Description | | ||
| | :-- | :-- | | ||
| | --actions action [action ...] | Space-delimited list of actions to play. | | ||
| | --exclude-actions action [action ...] | Space-delimited list of actions not to play. | | ||
| | --send-action-goal | Send recorded action goal instead of recorded service events and action internal topics. | | ||
|
fujitatomoya marked this conversation as resolved.
Outdated
|
||
|
|
||
| Updated arguments: | ||
|
|
||
| | Argument Name | Description | | ||
| | :-- | :-- | | ||
| | -e REGEX, --regex REGEX | Play only topics, services and **actions** matches with regular expression. | | ||
| | -x EXCLUDE_REGEX, --exclude-regex EXCLUDE_REGEX | regular expressions to exclude topics, services and **actions** from replay. | | ||
| | --service-requests-source {service_introspection,client_introspection} | Determine the source of the service requests to be replayed. This option only makes sense if the "--publish-service-requests" or **"--send-action-goal"** option is set. By default, the service requests replaying from recorded service introspection message. | | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.