-
Notifications
You must be signed in to change notification settings - Fork 171
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
ros2 param dump: null
breaks round-trip numerical parameters
#965
Comments
@b-adkins thanks for creating issue. there are a few things i want to confirm.
then what value did you set?
for if we have dynamic typing parameter without default value, that is going to be dumped as /param_demo_cpp:
ros__parameters:
param_2_cpp: null
qos_overrides:
/parameter_events:
publisher:
depth: 1000
durability: volatile
history: keep_last
reliability: reliable
start_type_description_service: true
use_sim_time: false /param_demo_py:
ros__parameters:
param_2_py: null
start_type_description_service: true
use_sim_time: false this seems to be okay as yaml, yaml converts the ### ros2 run prover_rclpy ros2cli_965 --ros-args --params-file ./test_param_py.yaml
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param dump /param_demo_py
/param_demo_py:
ros__parameters:
param_2_py: 'null'
start_type_description_service: true
use_sim_time: false
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param describe /param_demo_py param_2_py
Parameter name: param_2_py
Type: string
Constraints:
### ros2 run prover_rclcpp ros2cli_965 --ros-args --params-file ./test_param_cpp.yaml
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param dump /param_demo_cpp
/param_demo_cpp:
ros__parameters:
param_2_cpp: 'null'
qos_overrides:
/parameter_events:
publisher:
depth: 1000
durability: volatile
history: keep_last
reliability: reliable
start_type_description_service: true
use_sim_time: false
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 param describe /param_demo_cpp param_2_cpp
Parameter name: param_2_cpp
Type: string
Constraints: i think dump should save the all declared parameters even those have null values with dynamic typing (this is still useful for the user to see the all parameters without reloading), that said dump process works okay. |
ros2/ros2cli#965 Signed-off-by: Tomoya Fujita <[email protected]>
@b-adkins could you please follow up on @fujitatomoya's feedback? |
Yes, it's a rclcpp node.
I use: rclcpp::NodeOptions().
allow_undeclared_parameters(true).
automatically_declare_parameters_from_overrides(true) In my experience, this is required for MoveIt to load all of the config yaml files in your
I modified the file joint_limits:
joint_1:
has_velocity_limits: true
max_velocity: 1.5
has_acceleration_limits: false
max_acceleration: 0
joint_2:
has_velocity_limits: true
max_velocity: 1.0
has_acceleration_limits: true
max_acceleration: 9.81 MoveIt's config builder loads that into name spaces for the
To readers not familiar with MoveIt: These configs can contain literally hundreds of keys and values. To get an idea of the scope, look at https://github.com/moveit/panda_moveit_config/blob/rolling-devel/config/ompl_planning.yaml . MoveIt is an old ROS 1 library, from before there were static types and when the param server was global. Due to it having a plugin architecture, I don't know if they can ever do static types. I believe this is the part of the code that, thanks to those node options, by asking for the values, causes them to be declared.
$ ros2 param describe /my_moveit_node robot_description_planning.joint_limits.joint_1.max_position
Parameter name: robot_description_planning.joint_limits.p1_left/j1_motion_table_x.max_position
Type: double
Constraints:
$ ros2 param describe /my_moveit_node robot_description_planning.joint_limits.joint_1.has_jerk_limits
Parameter name: robot_description_planning.joint_limits.p1_left/j1_motion_table_x.has_jerk_limits
Type: boolean
Constraints: |
Summary
ros2 param dump sometimes produces invalid YAML for a ros2 run. I would think that round-trip ROS params are a desirable feature. (Named after round-trip YAML.)
User Story
My user story is that I wish to use my IDE to debug a ROS node with insanely complex params - a full MoveIt config (462 lines long).
This is not specific to MoveIt, but is instead an example of ros2 param at scale. It is not feasible to manually convert every key to a command line arg or to
ros2 param set
them individually.What I've been doing is:
Expected behavior
It loads as is and I only have to regenerate the YAML file when the ros2 launch config changes.
Actual behavior
Sometimes, the node halts.
The YAML file contains
I didn't set the null values. I have never even seen these keys. I am guessing they were filled in automatically by some declaration magic.
Requested behavior
Support round-trip params.
ros2 param dump
, do not fill in unset param values withnull
.null
, make it toggleable with a command-line flag.Suggested Workaround
Use bash-fu on your params file to delete any line containing the text
null
(You could also use grep -v, but I find this shorter)
Environment
Ubuntu 22.04
ROS2 humble
The text was updated successfully, but these errors were encountered: