ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Correct "ROS" way to deal with different namespaces for nodes/topics

asked 2021-07-24 07:48:24 -0600

sameh4 gravatar image

updated 2021-07-24 07:49:31 -0600

The ros2-controlles package has a DiffDriveController node that listens to the Twist messages on "~/cmd_vel"

I followed the bring up demo repo and created my own launch file, after removing the rviz related part.

When I listed the topics I saw that the cmd_vel took the namespace of the controller node as in:

/diff_drive_controller/cmd_vel

Another package that publishes to the "cmd_vel" topic is the telepop-joy which lets you publish to cmd_vel using a PS3/PS4 joytstick.

That node publishes to "/cmd_vel" in the global namespace.

One approach I had is to remap the namespace while launching the joystick node, which had some success, but there is some quirk where the joystick output is constant, i.e only a single value is given no matter how much I move the stick.

My full launch file is here

I am curious, what is the correct way to deal with this type of thing, where two packages work great on their own, but have different namespaces. There has to be a "ros" way for this I imagine.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-03-01 02:43:39 -0600

You are already doing it correctly. I am using remapping in large projects, and they work great. The issues you have is probably caused by something else and not remapping or controller.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2021-07-24 07:48:24 -0600

Seen: 542 times

Last updated: Mar 01 '22