ros / joint_state_publisher

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

Misleading docs for 'zeros' parameter for ROS2 #65

Closed hello-binit closed 3 years ago

hello-binit commented 3 years ago

Hello, I'm on Ubuntu 20.04, using ROS2 Galactic. Reading the joint_state_publisher README, I'd expect the 'zeros' parameter to take a dictionary, mapping strings to floats. In a ROS2 launch file, I'd expect this to be:

joint_state_publisher_gui_node = Node(
    package='joint_state_publisher_gui',
    executable='joint_state_publisher_gui',
    parameters=[{'zeros': {'joint_lift': 0.2, 'joint_wrist_yaw': 3.4}}]
)

The snippet above doesn't work. Looking at the code, 'zeros' is retrieved using the get_parameters_by_prefix method. So the following snippet works instead:

joint_state_publisher_gui_node = Node(
    package='joint_state_publisher_gui',
    executable='joint_state_publisher_gui',
    parameters=[{'zeros.joint_lift': 0.2, 'zeros.joint_wrist_yaw': 3.4}]
)

Let me know if I've misunderstood anything. If it is an issue, happy to file a PR improving the README.

clalancette commented 3 years ago

Let me know if I've misunderstood anything. If it is an issue, happy to file a PR improving the README.

You've understood it perfectly. I was trying to get this across in this sentence:

In Eloquent, pass on the command-line as '-p zeros.joint_name:=value'.

But if you think the wording could be further improved, please feel free to open a PR. I'm happy to review it.

DLu commented 3 years ago

Good to close?