Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Race condition when spawning turtlebot in gazebo

I'm trying to simulate a turtlebot in Gazebo using the turtlebot_gazebo package in turtlebot_simulator v1.0.1 in ROS Fuerte. When I roslaunch turtlebot_empty_world.launch, the turtlebot spawns just fine in Gazebo.

However, if I remove the robot.launch include line from the launchfile, and then launch robot.launch after gazebo has had sufficient time to start, the turtlebot does not spawn completely. All I see are the left and right wheels in the Gazebo GUI. The rest of the robot is non-existent.

Below is the xml for turtlebot_empty_world.launch:

<launch>
  <!-- start gazebo with an empty plane -->
  <param name="/use_sim_time" value="true" />

  <node name="gazebo" pkg="gazebo" type="gazebo"
        args="-u $(find turtlebot_gazebo)/worlds/empty.world" respawn="false" output="screen"/>
  <node name="gazebo_gui" pkg="gazebo" type="gui" />

  <include file="$(find turtlebot_gazebo)/launch/robot.launch"/>
</launch>

Has anyone had issues spawning a turtlebot in an already existing Gazebo environment? If so, did you have to do any sort of workaround to ensure that the turtlebot spawned correctly?

Thank you for your help.

Race condition when spawning turtlebot in gazebo

I'm trying to simulate a turtlebot in Gazebo using the turtlebot_gazebo package in turtlebot_simulator v1.0.1 in ROS Fuerte. When I roslaunch turtlebot_empty_world.launch, the turtlebot spawns just fine in Gazebo.

However, if I remove the robot.launch include line from the launchfile, and then launch robot.launch after gazebo has had sufficient time to start, the turtlebot does not spawn completely. All I see are the left and right wheels in the Gazebo GUI. The rest of the robot is non-existent.

Below is the xml for turtlebot_empty_world.launch:

<launch>
  <!-- start gazebo with an empty plane -->
  <param name="/use_sim_time" value="true" />

  <node name="gazebo" pkg="gazebo" type="gazebo"
        args="-u $(find turtlebot_gazebo)/worlds/empty.world" turtlebot_gazebo)/worlds/empty.world"
        respawn="false" output="screen"/>
  <node name="gazebo_gui" pkg="gazebo" type="gui" />

  <include file="$(find turtlebot_gazebo)/launch/robot.launch"/>
</launch>

Has anyone had issues spawning a turtlebot in an already existing Gazebo environment? If so, did you have to do any sort of workaround to ensure that the turtlebot spawned correctly?

Thank you for your help.