Open tylerjw opened 3 years ago
What is the advantage to using parameters, as opposed to using the existing infrastructure of published topics?
What is the advantage to using parameters, as opposed to using the existing infrastructure of published topics?
At the least, you would need guaranteed processing order between the description topic and your published joint states. Otherwise you receive values for joints you don't know about. It's probably possible in DDS, but I don't think this is the default in ROS2, is it? With the service calls you can at least in theory ensure that no modified joint state message is published before the receiver updated its description.
It's far from trivial either way to set this up though.
Oh, one more upside of using a topic is that it can be easily logged to rosbags! I don't know whether this is already supported in rosbag2 in some other way though.
In ROS 1 we used the global parameter server for one view of the robot_description parameter. One downside to this is it was immutable and never changed. In ROS 1 dynamic parameters were per-node, similar to ROS 2 but this was never used for robot_description.
For MoveIt2 we are currently loading that parameter into each node (via python launch files) that needs it to use a similar parameter interface for reading the robot_description in each node. This exposed an issue where the rviz plugins were each declaring the parameter before they would get it and it is an error to declare a parameter twice. This race condition prompted this workaround by @JafarAbdi: https://github.com/ros-planning/moveit2/pull/525
Some proposed solutions to this:
(me) instead of declaring the parameter in each node it should be declared for just the node with the PlanningSceneMonitor. Then other nodes should use the get_parameter service that is started by every ros2 node to read that parameter from the node with the PlanningSceneMonitor. This would more closely resemble the behavior is ROS 1 by treating whatever node is running the PSM as a global parameter server. This would require a new drop-down in rviz plugins to specify the node running the PSM that it could get the robot_description from.
(@henningkayser) Create an action server in the PSM for the robot_description that other nodes could connect to. Then the feedback messages could update that node of changes in the robot_description and a result would signify that the PSM is shutting down.
(@JafarAbdi ) expanding on my suggestion use the AsyncParameterClient to subscribe to updates to the robot_description parameter from the PSM node.