ros2 param dump: `null` breaks round-trip numerical parameters
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start at the ros2 param dump entry point and reproduce the issue using the provided dump and params-file commands. Trace how unset values become YAML null; done means the dumped file can be loaded by ros2 run without numerical parameters being interpreted as strings or rejected.
Written by the indexing model from the issue text.
Description
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:
- ros2 launch the node (using the moveit config builder)
- Get all its params:
ros2 param dump /my_moveit_node > params.yaml - In the IDE, load the params from the YAML file:
ros2 run my_pkg my_moveit_node --ros-args --params-file params.yaml
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.
terminate called after throwing an instance of 'rclcpp::exceptions::InvalidParameterTypeException'
what(): parameter 'robot_description_planning.joint_limits.joint_1.max_position' has invalid type: expected [double] got [string]
The YAML file contains
/my_moveit_node:
ros__parameters:
robot_description_planning:
joint_limits:
joint_1:
has_acceleration_limits: false
has_jerk_limits: null
has_velocity_limits: true
max_acceleration: 0
max_position: null
max_velocity: 1.5
min_position: null
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.
- During
ros2 param dump, do not fill in unset param values withnull. - If there is a good reason to dump
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
sed -i '/null/d' params.yaml
(You could also use grep -v, but I find this shorter)
Environment
Ubuntu 22.04
ROS2 humble
- Dominant language
- Python
- Stars
- 274
- Forks
- 246
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 12
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ros2/ros2cli
-
ros2 CLI prints BrokenPipeError traceback when output is piped to a command that exits early (e.g. head)May be free again @akshat-lakhera claimed this 38 days ago, and no pull request is open. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
ros2/ros2cli#1342 · 2 comments ·
Maintainers usually reply within 1 day
-
Add --timeout alias to ros2 topic pub and ros2 param listPossibly taken @1cbyc claimed this 63 days ago. Opengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
ros2/ros2cli#1305 · 2 comments ·
Maintainers usually reply within 1 day
-
ros2doctor: UserWarning: Fail to call PackageReport/RosdistroReport class functions.Possibly taken @sujanchalla0510 claimed this 13 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 20/100
Maintainers usually reply within 1 day
-
Add --all alias to commands that include hidden nodes, topics, or servicesPossibly taken @Rajat-Arora claimed this 62 days ago. Opengood first issue
Difficulty 3/5 1-2 days Newbie friendliness 78/100
ros2/ros2cli#1302 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
ros2run python script without extension .py fails on windows + pixiMay be free again A pull request for this issue was closed without being merged. Openbug more-information-needed
Difficulty 3/5 1-2 days Newbie friendliness 68/100
ros2/ros2cli#1301 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
hive size:simple
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
backend enhancement priority:P3
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
geolens-io/geolens#4161 ·
Maintainers usually reply within 1 day