Comments (7)
Happy to check for sure.
@KenYN thank you in the meantime for the testing you are doing on this, it is unvaluable :)
from rosbag2.
There seems to be the possibility to add a callback.
https://roboticsbackend.com/ros2-rclcpp-parameter-callback/
Yes there are callbacks, though I will point out that the advice in that particular link is incorrect.
In particular, you should never make state changes based on the "on_set_parameters_callback". The purpose of that callback is to validate that the parameters are valid, not to make state changes. This is important because there can be an arbitrary chain of parameter validation callbacks, so if you were to make state changes, and a callback further down the line rejected the set, your state would be out of sync with what the parameter database shows.
As of Iron, we have a callback specifically for this purpose called post_set_parameters_callback
that should be used instead. See http://docs.ros.org/en/rolling/Concepts/Basic/About-Parameters.html#parameter-callbacks for some more information, and https://github.com/ros2/demos/blob/a29e65623e8ace15b8253ab33f19f3d8165c3cfe/demo_nodes_cpp/src/parameters/set_parameters_callback.cpp for an example.
from rosbag2.
@roncapat Any ideas why ros2 param set /bag_player uri "/path/to/file2"
doesn't work as expected?
from rosbag2.
Well, my first thought is that we are not handling any parameter update IMHO. Parameters are just parse one time at the beginning and stop.
Example:
storage_options.uri = node.declare_parameter<std::string>("uri", "");
after this line, storage_options.uri
is not bound to any rclcpp::ParameterValue
. It is a simple std::string
. And nothing is done currently to support updated on the fly.
I will think a bit about how this could be done.
from rosbag2.
I believe that a big shift of paradigm would be needed here to implement this.
Currently, we have player_options
and storage_options
structures being a collection of parameter values, not rclcpp::ParameterValue
s. To do what you are asking, we should either inject in the already quite intricate architecture the concept of rclcpp::ParameterValue
, down to classes like Reader
or Writer
. To avoid so, another option would be to inject instead explicit "setters" wherever needed to flow down any change of parameter (Assuming we can get notified by something that a parameter has changed).
This is just a preliminary analysis of course, feel free to add your point of view :)
An example:
Reader
has no way to change opened file. You need to close a Reader
and open it again. And this can only happen for example when Player
is stopped. Multiply this by a huge number of potentially run-time modifyable params and you get a big headache. I agree with you however that this would become more user-firendly instead of unloading/loading again a Player
component.
from rosbag2.
@KenYN @roncapat I think we will close this issue as unsupported by design.
@roncapat BTW as regards
(Assuming we can get notified by something that a parameter has changed).
Do you have ideas on how we can potentially get notified when the parameter got changed?
from rosbag2.
There seems to be the possibility to add a callback.
https://roboticsbackend.com/ros2-rclcpp-parameter-callback/
from rosbag2.
Related Issues (20)
- Size per topic in a mcap file HOT 1
- Composition documentation
- Play folder of ROS2 bags in sequential order or let them be fed as input arguments. HOT 3
- All bags being opened when playing back multiple bag files. HOT 4
- Find typesupport libraries in LD_LIBRARY_PATH HOT 1
- TimeControllerClock::sleep_until(some_time_in_the_past) sleeps too long HOT 5
- Can't play bags with v9 metadata HOT 2
- Qos question HOT 2
- Capture implicit message definitions for action feedback messages HOT 1
- `Recording stopped` message is duplicated when stop recording HOT 2
- How to read a mcap file and publish data using cpp? HOT 4
- Use mcap storage compression when compression is requested HOT 8
- Early (incorrect) exit in certain situations with mcap logging HOT 19
- rosbag2_transport::Recorder duration 0 HOT 2
- [FEA] Support distributed recording to get ultra high performance. HOT 3
- Subscribers to topics don't record data. HOT 2
- Use topic_id instead of topic_name in inner rosbag2 buffers and data structures HOT 9
- Add play --exclude option for humble HOT 2
- ros-humble-zstd-vendor have old version for libzstd library and this is used by systemd HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rosbag2.