ros / joint_state_publisher

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

namespace support for robot_description subscriber #32

Closed mganglb closed 4 years ago

mganglb commented 4 years ago

Hello, i a added on my fork support for the node-namespace.

The changes are minimal. around line 220.

regards

clalancette commented 4 years ago

This shouldn't be necessary; all ROS nodes can be namespaced on the command-line. See https://index.ros.org/doc/ros2/Tutorials/Node-arguments/ for examples. I'm going to close this out, but feel free to re-open or keep commenting if you think this is still a problem for you.

mganglb commented 4 years ago

Well, then it seems to be a general Problem in ROS2, that the subscriber dont get correctly namespaced. ty for your respond. image

clalancette commented 4 years ago

I see. It was actually a bug in the ros2-devel branch where I was putting a / on the front of the topic. Sorry about that, it should be fixed now.

sloretz commented 4 years ago

@mganglb Since /robot_description begins with a slash it's considered a global topic.

https://github.com/ros/joint_state_publisher/blob/475e12f1d0f210fa28610434f9f3a9dbb5024ef0/joint_state_publisher/joint_state_publisher.py#L220

If you would like the namespace to apply to it, then first remap it to a relative topic robot_description.

ros2 run joint_state_publisher joint_state_publisher --ros-args -r __ns:=/foo/bar -r /robot_description:=robot_description
mganglb commented 4 years ago

@clalancette this did the trick @sloretz ty for the additional information