ros2 / ros2/ros2cli

'ros2 param load' fails when double parameter in parameter file is in scientific notation

Open
#834 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

more-information-needed
Dominant language
Python
Stars
262
Forks
228
Avg merge
23h 15m
Merged PRs (30d)
12

Description

Bug report

Required Info:

  • Operating System:
    • Ubuntu 22.04
  • Installation type:
    • binaries
  • Version or commit hash:
    • latest rolling release
  • DDS implementation:
    • N/A
  • Client library (if applicable):
    • ros2cli
Steps to reproduce issue
  1. Run an application that loads parameters from a parameter file, that includes a parameter specified using scientfic notation 5e-06, using
ros2 run parameter_test parameter_test --ros-args --params-file parameter_test/config/params.yaml
  1. Load parameters again from the same parameter file using
ros2 param load param_test parameter_test/config/params.yaml
Expected behavior

Parameters are loaded properly in step 1
Parameters are loaded properly in step 2

Actual behavior

Parameters are loaded properly in step 1
However, in step 2, it results in following error:

Set parameter test_double failed: Wrong parameter type, parameter {test_double} is of type {double}, setting it to {string} is not allowed.
Additional information

Attached is package that was used for test
parameter_test.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with parameter_test/config/params.yaml using both the application command and ros2 param load command shown in the issue. Compare how the scientific-notation value is interpreted in each path, then verify that test_double remains a double when loaded through ros2 param load.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.