Skip to content

Parameter list missing in reconfigure/dynamic if any parameter was declared without a default value under ROS2 #142

@EwingKang

Description

@EwingKang

System: Ubuntu 22.04
Version: ROS 2 Iron Irwini - Patch Release 4

Following the parameter tutorial on the ROS2 docs, I can see the following result in rqt/ rqt_reconfigure
image

However, if I add a parameter without default value using the type-specifying version of the declare_parameter() API, the entire parameter list for the node will disappear without any error message:

this->declare_parameter("an_int_param", 0); // The original demo
this->declare_parameter("an_int_param_without_val", rclcpp::PARAMETER_INTEGER);  // THIS CAUSE PROBLEMS

image

This problem disappears if that specific parameter is supplied with the command line:

ros2 run cpp_parameter_event_handler parameter_event_handler --ros-args -p an_int_param_without_val:=22

image

I should add that all other ros2 param and ros2 service command line tools are fine as far as I've tested.
This behavior is not mentioned anywhere in the documentation and I also couldn't find any similar problems on the internet. It took me a few hours of trial-and-error to figure-out the pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions