Ask Your Question
0

Multi-turtlebot3-simulation

asked 2017-07-28 19:53:32 -0600

pinxian gravatar image

updated 2017-07-28 20:21:07 -0600

HI , all

I am newbie . I want to add a swarm of turtlebot3(burger or waffle) in gazebo to simulate advanced control .

I used the method as the follwing website :

[ http://turtlebot3.readthedocs.io/en/l... ]

Because turtlebot3_empty_world.launch file only spawn a turtlebot in gazebo , i tried to modify the launch file :

<launch>
<group ns="turtlebot1">
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle]"/>
<arg name="x_pos" default="0.0"/>
<arg name="y_pos" default="0.0"/>
<arg name="z_pos" default="0.0"/>


<param name="robot_description" command="$(find xacro)/xacro.py $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />

<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model turtlebot3_burger -x $(arg x_pos) -y $(arg y_pos) -z $(arg z_pos) -param robot_description" />
</group>

<group ns="turtlebot2">
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle]"/>
<arg name="x_pos" default="5.0"/>
<arg name="y_pos" default="5.0"/>
<arg name="z_pos" default="5.0"/>


 <param name="robot_description" command="$(find xacro)/xacro.py $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />

 <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model turtlebot3_burger -x $(arg x_pos) -y $(arg y_pos) -z $(arg z_pos) -param robot_description" />
  </group>

<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find turtlebot3_gazebo)/models/empty.world"/>
<arg name="paused" value="false"/>
<arg name="use_sim_time" value="true"/>
<arg name="gui" value="true"/>
<arg name="headless" value="false"/>
<arg name="debug" value="false"/>
</include>
</launch>

It dosent work !!

Dose someone have any idea?

Thanks!!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-04-05 00:49:19 -0600

Bane17 gravatar image

updated 2018-04-05 07:51:32 -0600

jayess gravatar image

I modified your launch file a little and it worked for me.

<launch>
<group ns="turtlebot1">
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle]"/>
<arg name="x_pos" default="0.0"/>
<arg name="y_pos" default="2.0"/>
<arg name="z_pos" default="0.0"/>


<param name="robot_description" command="$(find xacro)/xacro.py $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />

<node name="spawn_urdf_1" pkg="gazebo_ros" type="spawn_model" args="-urdf -model turtlebot3_burger -x $(arg x_pos) -y $(arg y_pos) -z $(arg z_pos) -param robot_description" />
</group>

<group ns="turtlebot2">
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle]"/>
<arg name="x_pos_2" default="2.0"/>
<arg name="y_pos_2" default="0.0"/>
<arg name="z_pos_2" default="0.0"/>


 <param name="robot_description_2" command="$(find xacro)/xacro.py $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />

 <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model turtlebot3_burger_2 -x $(arg x_pos_2) -y $(arg y_pos_2) -z $(arg z_pos_2) -param robot_description_2" />
  </group>

<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find turtlebot3_gazebo)/models/empty.world"/>
<arg name="paused" value="false"/>
<arg name="use_sim_time" value="true"/>
<arg name="gui" value="true"/>
<arg name="headless" value="false"/>
<arg name="debug" value="false"/>
</include>
</launch>
edit flag offensive delete link more

Comments

Can you please explain what you modified and why?

jayess gravatar imagejayess ( 2018-04-05 07:51:48 -0600 )edit

Alright, so I'm pretty new at ROS too so I'm not sure I can give you an explanation of why it worked but I modified the <arg name="" for="" all="" of="" the="" positions="" for="" the="" second="" turtlebot="" as="" well="" as="" the="" param="" name="robot_description" and="" the="" model="" name="" in="" "<node="" name="spawn_urdf" ...,<="" p="">

Bane17 gravatar imageBane17 ( 2018-04-05 10:43:52 -0600 )edit

Compare your code to what I have, there are only slight differences.

Bane17 gravatar imageBane17 ( 2018-04-05 10:44:26 -0600 )edit
-1

answered 2018-04-05 02:37:20 -0600

Darby Lim gravatar image

This launch file will help you

https://github.com/ROBOTIS-GIT/turtle...

edit flag offensive delete link more

Comments

Can you please provide a minimum working example so the answer is self-contained?

jayess gravatar imagejayess ( 2018-04-05 07:50:44 -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

1 follower

Stats

Asked: 2017-07-28 19:53:32 -0600

Seen: 699 times

Last updated: Apr 05 '18