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

Can I subcribe to multiple messages from a topic?

asked 2023-03-22 20:59:04 -0500

buckit_hed gravatar image

Maybe I am doing this wrong. Should I have one topic per message? I have multiple joints in one node. The node is publishing the joints as joint1 and joint2 to the "joint" topic. I can only find how to create a callback for a topic. I don't see anything about getting the different joint messages from the joint topic.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-03-24 05:57:47 -0500

nils_iseke gravatar image

You can publish a JointState Message to the topic (http://docs.ros.org/en/melodic/api/se...) containing the joint states of both joints. Subscriptions are always related to a topic not to a message. Maybe it is worth going through the tutorials, espiacally:Understanding topics.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2023-03-22 20:59:04 -0500

Seen: 228 times

Last updated: Mar 24 '23