0
$\begingroup$

Rosanswers logo

I have n number of robots, and I want to gather each of their positions. Each robot is under a different namespace so I have the topics:

/robot1/pose
/robot2/pose
/robotn/pose

If the namespace follows the same convention, is it better to:

  1. Create a subscriber for each robot?
  2. Create a service-client for each robot?

And given a subscriber or service, what is the proper way to dynamically find the services/topics to subscribe to?

Thoughts:

  1. Use the parameter server with the number of robots. Works for both subscribers and services. Use the same callback for each robot.
  2. Have each robot republish their pose onto a joint /pose_all topic and use one subscriber. Can differentiate between robots using PoseStamped. Simplest seeming solution (no parameters to remember to update...), but is it hacky?
  3. Some better method using service calls?

Originally posted by curranw on ROS Answers with karma: 211 on 2016-07-06

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

See if my answer to a similar question is helpful as an alternative. Upon re-reading my answer, I realize I wasn't as clear as I could have been; apologies in advance.

Perhaps you're aware of this already, but a note/warning: be careful with service calls. They block, and may cause a performance hit, especially if you have a proliferating number them (as you seem to be suggesting).


Originally posted by kramer with karma: 1470 on 2016-07-07

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.