multiple turtlebots simulation in gazebo and visualization in rviz
Hi, I need to simulate multiple turtlebots in gazebo and visualize them in rviz and finally I succeed to add two robots into gazebo and rviz according to this but there are a few problems.
1.if I teleop one of the robot, even just rotate in place, the turtlebot will drift.
I checked this however when I look into the source file of gazebo_ros_kobuki.cpp(kobuki_gazebo_plugins) I find that this module is using the non-holonomic robot model. I am not sure what is the problem.
2.When I drive one robot toward the other and let these two robot collide, in the gazebo everything is ok but in rviz the moving robot just drive into the other one and pass through it, like the other one never exists. And also there is no output of bump cloud.
3.As you can see in the teleop launch file, I only publish velocity commands to one robot. But the actual result is that that turtlebot in gazebo works fine but in rviz both turtlebots react to the angular velocity. That means if I drive the robot, say robot1, linearly then only robot1 moves in rviz but when I sent angular velocity through keyboard then both robots will rotate in rviz.[this one is solved by change sensor names]
So I check the velocity topics related to both robots, it shows that only /robot1/command/velocity receives messages other velocity related topics have no message received. But still both robots rotate.
Here are related files: Gazebo related files Main launch file:
<launch>
<!-- gazebo world start -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="use_sim_time" value="true"/>
<arg name="debug" value="false"/>
<arg name="world_name" value="$(find agents_gazebo)/worlds/empty.world"/>
<arg name="gui" value="true"/>
</include>
<!-- Map server -->
<arg name="map_file" default="$(find agents_gazebo)/maps/willow-2010-02-18-0.10.yaml"/>
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" >
<param name="frame_id" value="/map"/>
</node>
<!-- include robots -->
<include file="$(find agents_gazebo)/launch/includes/agents.launch.xml"/>
</launch>
agents.launch.xml for multiple robots launch
<launch>
<arg name="base" value="$(optenv TURTLEBOT_BASE kobuki)"/>
<arg name="battery" value="$(optenv TURTLEBOT_BATTERY /proc/acpi/battery/BAT0)"/>
<arg name="stacks" value="$(optenv TURTLEBOT_STACKS hexagons)"/>
<arg name="3d_sensor" value="$(optenv TURTLEBOT_3D_SENSOR kinect)"/>
<arg name="urdf_file" default="$(find xacro)/xacro.py '$(find turtlebot_description)/robots/$(arg base)_$(arg stacks)_$(arg 3d_sensor).urdf.xacro'" />
<param name="robot_description" command="$(arg urdf_file)" />
<!-- BEGIN ROBOT 1-->
<group ns="robot1">
<arg name="robot_name" value="robot1"/>
<include file="$(find agents_gazebo)/launch/includes/agent.launch.xml" >
<arg name="initial_pose_x" value="0" />
<arg name="initial_pose_y" value="0" />
<arg name="initial_pose_z" value="0" />
<arg name="initial_pose_yaw" value="0" />
<arg name="robot_name" value="$(arg robot_name)"/>
</include>
</group>
<!-- BEGIN ROBOT 2-->
<group ns="robot2">
<arg name="robot_name" value="robot2"/>
<include file="$(find agents_gazebo)/launch/includes/agent.launch.xml" >
<arg name="initial_pose_x" value="1" />
<arg name="initial_pose_y" value="0" />
<arg name="initial_pose_z" value="0" />
<arg name="initial_pose_yaw" value="3.1415926" />
<arg name="robot_name" value="$(arg robot_name)"/>
</include>
</group>
</launch>
agent ...
Hi can you please share the rviz file for multiple robots, i have it for one robot but i don't know what should i add or how to modify it. Thank you
to run multiple robots you need to revise several files if it is ok i can send you some patch files to you but you have to give me your email address
@hjh I'm facing problems running controller manager in different namespaces for multi-robot simulation. Could you provide me with your patch files. It might help or give me some idea. You can send the files to webvenky@gmail.com
@hjh It would be the community's greatest benefit if you could share your files somewhere public (eg. adding their contents in your answer, or sharing the link to your repository).
Sorry for the late reply I have uploaded my solution to github please visit https://github.com/applyhhj/ros_multi...
@hjh Thanks.