this->declare_parameter("an_int_param", 0); // The original demo
this->declare_parameter("an_int_param_without_val", rclcpp::PARAMETER_INTEGER); // THIS CAUSE PROBLEMS
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
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.
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
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 problem disappears if that specific parameter is supplied with the command line:
I should add that all other
ros2 param
andros2 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.