ros / joint_state_publisher

http://wiki.ros.org/joint_state_publisher
50 stars 81 forks source link

[ROS2] Use declare_parameter to set initial parameter values and types #23

Closed schornakj closed 4 years ago

schornakj commented 5 years ago

This continues from #16.

The main addition is to add a declare_parameter for each parameter used by the node, which is required for compatibility with Dashing.

A change compared to @cottsay 's work in #16 is that the initial values and types of the parameters are set in by declare_parameter instead of through the node's parameter_overrides field. When running this node through a launch file I was not able to get parameter values set in the launch file to take precedence over the values set in parameter_overrides. Discussion on Discourse indicates that declare_parameter is the preferred way to initialize parameters with metadata.

clalancette commented 4 years ago

Sorry for the long delay here. While this isn't quite enough (I think we also need to set allow_undeclared_parameters on the node), this is an improvement. I'll merge this as-is, merge some other PRs, and then iterate on this code. Thanks for the contribution!