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

Is it possible to publish on two topics in a single node

asked 2015-07-19 12:18:22 -0500

pretorit gravatar image

Hi there, I'm trying to publish on two topics from the same node. One of the topics is definitely working and also shows up in the rqt graph but the second one doesn't. Is it possible to do this???

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2015-07-19 14:53:45 -0500

gvdhoorn gravatar image

updated 2015-07-19 14:54:53 -0500

Is it possible to do this???

Yes this is possible. Publishing is done using ros::Publisher instances, and there is not really a limit to how many of those instances you can create in a single node (which is just a C++ / Python / X program).

One of the topics is definitely working and also shows up in the rqt graph but the second one doesn't.

There is probably a multitude of reasons for why something wouldn't work, but without more details about what you did, how you did it and what exactly is going wrong it's going to be hard to tell you anything more.

If you could add some relevant snippets of your code to your OP, that would be helpful (please use the edit button for that, and format code using the Preformatted text button on the formatting toolbar (the one with 101010 on it)).

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-07-19 12:18:22 -0500

Seen: 1,735 times

Last updated: Jul 19 '15