Ask Your Question
0

How to have multi turtlebot 3 in a real environment?

asked 2018-02-07 18:53:56 -0600

carlosal24 gravatar image

Hi, I'm new to ros and I'm having some problems and I hope someone can help me.

I want to use 2 "turtlebot3 burger" at the same time in a real environment, in my nodes I have the control and at the end I have a topic "/cmd_vel" for each robot.

How can I make each robot subscribe to its respective "/cmd_vel", without conflicts?

I have read several topics about how to have several robots in a simulation environment like gaebo, and I have tried them and they work correctly, but I am not able to do the same with real robots.

Should I change something in the configuration of the robots? Should I modify my launch file to have two ns groups and include a "turtlebot3_bringup" file?

Thanks in advance and any ideas or advice will be very helpful

edit retag flag offensive close merge delete

Comments

1

Check out #q41433. Even though it's for a simulation (and old) it's still very useful.

jayess gravatar imagejayess ( 2018-02-07 22:08:14 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-02-19 17:04:57 -0600

carlosal24 gravatar image

Hello, it seems that I found a simple solution and that until now it works perfectly.

It works in turtlebot 2 and turtlebot 3, the simplest solution is that before performing the "bringup", add in the robot terminal

export ROS_NAMESPACE=Robot1

and then perform the bring up for the respective model of your robot, for example for the burger

roslaunch turtlebot3_bringup turtlebot3_robot.launch

Doing this with each one of the robots you have, you avoid conflicts in the topics. Even if you do not want to do this every time you start the robots, you can add the name in the bash of your robot.

In the robot terminal

gedit ~/.bashrc

Add the name of the robot in the window

export ROS_NAMESPACE=NAME

You save it and finally in the terminal

source ~/.bashrc

I hope that if someone has this problem, this information will be helpful

edit flag offensive delete link more

Comments

1

I think that this is ok if you're manually starting everything on your robot. If you want to use launch files remotely to start the nodes on your robot then I believe that the .bashrc is not used and you should use a separate env-loader.sh to load your environment variables.

jayess gravatar imagejayess ( 2018-02-19 18:20:57 -0600 )edit
jayess gravatar imagejayess ( 2018-02-19 18:21:36 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-02-07 18:53:56 -0600

Seen: 599 times

Last updated: Feb 19 '18