-
Notifications
You must be signed in to change notification settings - Fork 254
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
Make Player and Recorder Composable (#902) #1419
Merged
Merged
Changes from 56 commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
f50821d
Squasgh to ease rebase
roncapat a08c5d1
Remove TODO for keyboard handlers
roncapat 26ecb08
Change structure
roncapat c89ce76
Fix
roncapat 2ada177
Fix
roncapat 2c80a2a
QoS parsing
roncapat 3d7f98d
Fix
roncapat f1e0340
Uncrustify
roncapat 1899416
Draft comparison of passed vs parsed params
roncapat ee37afc
Fix shared_from_this() issue, param file & paths
roncapat 863ab6b
Fixes after rebase
roncapat 4e65cf0
Fixes to handle durations
roncapat 874d60d
Better test output
roncapat 9f31e3c
Drafting record param test
roncapat 52495f8
Fixing recorder issues
roncapat 645b985
Fixes
roncapat 6287cd6
Draft component load test
roncapat 0aa4cd5
Composition tests working
roncapat 68bfcb4
Uncrustify
roncapat 95c9d13
Cpplint
roncapat 0205966
Cpplint
roncapat edbb544
Fix play_offset bug
roncapat 490dc48
Fix storage defaults bug
roncapat 21399f2
Get rid of temporal conversion crutches using map<string, Rosbag2QoS>
MichaelOrlov 50f0755
Use const ref to node in the options getter functions
MichaelOrlov 30b1699
Cleanups in get_storage(/play/record)_options functions
MichaelOrlov cfeb0bb
Move RosBag2RecordTestFixture insight test_record_params.cpp
MichaelOrlov 571a25e
Rename overrides.yaml to the qos_profile_overrides.yaml file
MichaelOrlov 2aa2f8d
Rename params_player.yaml to the player_node_params.yaml
MichaelOrlov fa6e556
Rename params_recorder.yaml to the recorder_node_params.yaml
MichaelOrlov 2d4931c
Replace Rosbag2Duration by rclcpp::Duration
MichaelOrlov b493987
Cleanup in functions which are getting values from node parameters
MichaelOrlov e98be6e
Bugfix. Adjust min-max ranges for get_duration_from_node_param(..)
MichaelOrlov d396e3c
Initial comparisons
roncapat e588657
Move component manager in fixture
roncapat fa3eae7
Merge branch 'rolling' into patch-2
roncapat 89b6736
Uncrustify
roncapat 2c70406
Remove residual AMENT_DEPS after merge
roncapat 95ab353
Complete test_play_params
roncapat 913e49f
Finish param tests
roncapat 9756edd
Uncrustify
roncapat 0e57485
Cleanups in player/recorder parameters and load components tests
MichaelOrlov 0641884
Renames in player/recorder parameters and load components tests
MichaelOrlov 4e3f460
Namespaced parameters
roncapat 04948e3
Fix load_composable_components test
roncapat 1e1d5c3
Automatically start playback in "composable" Player constructor
MichaelOrlov 786a08c
Add integration test for composable player
MichaelOrlov a611726
Add missing dependencies to the mock_player.hpp
MichaelOrlov 37d7e29
Automatically start recording in "composable" Recorder constructor
MichaelOrlov 4da289e
Adopt existent tests for auto starting recording after composition
MichaelOrlov 6192305
Add integration test for composable recorder
MichaelOrlov e89614c
Add missed parameters prefixes after rebase
MichaelOrlov 8c283b8
Fix for failing test with wrong check for playback_until_timestamp
MichaelOrlov 0d446e4
Fix for failing tests with wrong parameters deduction
MichaelOrlov 812d9da
Close recorder before trying to delete temp files on test destruction
MichaelOrlov ee16b40
Update rosbag2_transport/test/rosbag2_transport/composition_manager_t…
roncapat db3aa34
Update rosbag2_transport/test/rosbag2_transport/test_composable_recor…
roncapat af07a04
Update rosbag2_transport/CMakeLists.txt
roncapat 6f9bbe8
Update rosbag2_transport/CMakeLists.txt
roncapat 723a7a8
Address warnings from Windows CI job in composable player and recorder
MichaelOrlov 9110f65
Update rosbag2_transport/src/rosbag2_transport/config_options_from_no…
roncapat 8737b72
Update rosbag2_transport/test/rosbag2_transport/test_composable_playe…
roncapat 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 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
This file contains 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
This file contains 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
This file contains 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
37 changes: 37 additions & 0 deletions
37
rosbag2_transport/include/rosbag2_transport/config_options_from_node_params.hpp
This file contains 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,37 @@ | ||
// Copyright 2023 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef ROSBAG2_TRANSPORT__CONFIG_OPTIONS_FROM_NODE_PARAMS_HPP_ | ||
#define ROSBAG2_TRANSPORT__CONFIG_OPTIONS_FROM_NODE_PARAMS_HPP_ | ||
|
||
#include <memory> | ||
|
||
#include "rclcpp/node.hpp" | ||
#include "rosbag2_transport/play_options.hpp" | ||
#include "rosbag2_transport/record_options.hpp" | ||
#include "rosbag2_storage/storage_options.hpp" | ||
|
||
namespace rosbag2_transport | ||
{ | ||
rosbag2_transport::PlayOptions | ||
get_play_options_from_node_params(rclcpp::Node & node); | ||
|
||
rosbag2_transport::RecordOptions | ||
get_record_options_from_node_params(rclcpp::Node & node); | ||
|
||
rosbag2_storage::StorageOptions | ||
get_storage_options_from_node_params(rclcpp::Node & node); | ||
} // namespace rosbag2_transport | ||
|
||
#endif // ROSBAG2_TRANSPORT__CONFIG_OPTIONS_FROM_NODE_PARAMS_HPP_ |
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MichaelOrlov one last thing... I believe it's better to rename the nodes, so that:
The "Rosbag2" prefix is redundant IMHO.
And I believe that for node names lowercase convention is preferred.
(Same for Recorder here below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roncapat Out of curiosity, is it possible to make it
ros2 run rosbag2 player
without renamingrosbag2_transport
to therosbag2
?Maybe using an alias for the entry point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe if can get rid of
rosbag2_transport
keyword in front. To beros2 run Rosbag2Player
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that the semantic of the
ros2 run
command is 'package_name node_name' and can't be changed. We can only act on the node name.Maybe we can then find a way to register the node under package
rosbag2
nstead of 'roabag2_transport`. But it may be very tricky.However, in the long term (I can open an Issue for later implementation) I just had a potentially nice idea: to upgrade
ros2 bag play
CLI support with a parameter for an existing container name. This way, the CLI would load the component in an existing container, start playing (and eventually unloading it at the end of the playback). This would be a neat feature IMHO. Thoughts?Summing up: simplest solution here is at least for now just to choose a simple and idiomatic node name. We may act on moving the nodes to
rosbag2
package later on.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(To register the nodes under "rosbag2" instead of "rosbag2_transport" we may need to hack the inner workings of this: https://github.com/ros2/rclcpp/blob/rolling/rclcpp_components%2Fcmake%2Frclcpp_components_register_node.cmake)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roncapat Ahh never mind. Feel free to go ahead and commit your suggestions with signoff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As regards:
Curious why it would be useful at all if we already have entry point for
ros2 bag play
andros2 bag record
?I only envision a case when we can run player or recorder and specify settings yaml file instead of the CLI parameters directly. Something like
ros2 bag play --settings playback_settings.yaml
The same questions apply to how to use
ros2 run rosbag2_transport player
in a real use case? How we will provide settings or node parameters in this case?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imagine people have already scripted their
ros2 bag play/record
commands (for example, in some launch files). With a small modification (like the addition of one CLI parameter) they will be able to "upgrade their setup" and inject player/recorder in their component containers. Increased performance with almost zero effort (if you have specified all parameters in the CLI command, you won't have to migrate to a .yaml configuration file).Like normal node parameters via YAML file. Notice that this also enables people to use
Node()
objects inLaunchConfiguration()
of launchfiles instead of the current only way to run player/recorder via launchfiles (to specify the full CLI command).In the next days I'll write some docs to push as separate PR. It may be the right context to sum up all the past, present and potentially future ways to run players/recorders if it's ok for you :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@roncapat As regards:
I don't really understand about what increased performance and benefits you are talking about there. Maybe with documentation or some real-world examples will be clear to me.
As regards:
Still unclear to me how node parameters will be settled with
ros2 run rosbag2_transport player
command. What you described seems more relevant for launch files launching composed nodes via the launcher. But it is irrelevant to theros2 run rosbag2_transport player
command as far as understand.Anyway, documentation would be very helpful and grateful to have.