0
$\begingroup$

Rosanswers logo

Hello,

I would like to use the nao_driver ros stack to control multiple NAO robots at the same time. Does anyone have any experience with this?

The nao_driver stack is run locally on a computer using a roscore instance on the same computer.

When launching nao_driver it uses an environment variable of the NAO robots IP which it then connects to. Ros topics are then available to publish commands to the NAO.

My guess is that if I launch multiple instances of the nao_driver (on the same computer) the ros topics will collide, i.e two topics "/cmd_vel" would be subscribed.

My idea for a solution is to modify the nao_driver stack so that it uses different topic names, for example specified by a launch file. I could then publish commands to for example "nao1/cmd_vel" or "nao2/cmd_vel" on order to make both nao1 and nao2 walk.

Is there a simpler/nicer way to do this?

Did I miss some basic ROS functionality for handling issues like this?

Thanks, Isak Tjernberg


Originally posted by I.T on ROS Answers with karma: 67 on 2013-02-20

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

That is what namespaces are for. Either set the ROS_NAMESPACE environment variable before using rosrun or make a launchfile that contains a tag for each robot. There you can define the parameter with the IP and, if the driver nodes work properly (i.e. subscribing to "cmd_vel" and not "/cmd_vel", the topics should now read like /naoX/cmd_vel and so on.

If you want to use tf, you should also set the tf_prefix param and be sure that all software you use (and especially the one you develop) uses the tf methods to resolve frame_ids with the tf_prefix. Look for tf_prefix in the ros wiki.


Originally posted by Achim with karma: 390 on 2013-02-20

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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