ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Hi usama,

I was following your troubles myself and ran into this issue as well. If you add the following after the opening launch tag:

<arg name="use_sim_time" default="true"/>
<arg name="gui" default="true"/>

and then the following before the closing launch tag:

<group if="$(arg gui)">
    <node name="gazebo_gui pkg="gazebo" type="gui" respawn="false" output="screen"/>
</group>

You should get up and running. If you want to look into this in more detail, look into the gazebo_worlds stack and at the empty_world.launch file.

treanorj

Hi usama,

I was following your troubles myself and ran into this issue as well. If you add the following after the opening launch tag:

<arg name="use_sim_time" default="true"/>
<arg name="gui" default="true"/>

and then the following before the closing launch tag:

<group if="$(arg gui)">
    <node name="gazebo_gui pkg="gazebo" type="gui" respawn="false" output="screen"/>
</group>

You should get up and running. If you want to look into this in more detail, look into the gazebo_worlds stack and at the empty_world.launch file.

treanorj

UPDATE: Fixed mismatched quotation marks in <node ...="" &gt;<="" p="">

Hi usama,

I was following your troubles myself and ran into this issue as well. If you add the following after the opening launch tag:

<arg name="use_sim_time" default="true"/>
<arg name="gui" default="true"/>

and then the following before the closing launch tag:

<group if="$(arg gui)">
    <node name="gazebo_gui pkg="gazebo" type="gui" respawn="false" output="screen"/>
</group>

You should get up and running. If you want to look into this in more detail, look into the gazebo_worlds stack and at the empty_world.launch file.

treanorj

UPDATE: UPDATE: Fixed mismatched quotation marks in <node ...="" &gt;<="" p="">

UPDATE 2: Below are my launch files to test this with. Note my package here is called turtlebot_sim_test, I am using a world file called box.world and I call roslaunch on basic_world.launch

basic_world.launch:

<launch>
    <arg name="use_sim_time" default="true"/>
    <arg name="gui" default="true"/>

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

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

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

    <!-- start gui -->
    <group if="$(arg gui)">
        <node name="gazebo_gui" pkg="gazebo" type="gui" respawn="false" output="screen"/>
    </group> 

</launch>

robot.launch:

<launch>
    <param name="robot_description" command="$(find xacro)/xacro.py '$(find turtlebot_sim_description)/urdf/turtlebot.urdf.xacro'" />

    <node name="spawn_turtlebot_model" pkg="gazebo" type="spawn_model" args="$(optenv ROBOT_INITIAL_POSE) -unpause -urdf -param robot_description -model turtlebot" respawn="false" output="screen"/>

    <node pkg="diagnostic_aggregator" type="aggregator_node" name="diagnostic_aggregator" >
        <rosparam command="load" file="$(find turtlebot_bringup)/config/diagnostics.yaml" />
    </node>

    <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher" output="screen">
        <param name="publish_frequency" type="double" value="30.0" />
    </node>

    <!-- The odometry estimator -->

    <node pkg="robot_pose_ekf" type="robot_pose_ekf" name="robot_pose_ekf">
        <param name="freq" value="30.0"/>
        <param name="sensor_timeout" value="1.0"/>
        <param name="publish_tf" value="true"/>
        <param name="odom_used" value="true"/>
        <param name="imu_used" value="false"/>
        <param name="vo_used" value="false"/>
    </node>

    <!-- throttling -->
    <node pkg="nodelet" type="nodelet" name="pointcloud_throttle" args="load pointcloud_to_laserscan/CloudThrottle openni_manager" respawn="true">
        <param name="max_rate" value="20.0"/>
        <remap from="cloud_in" to="/camera/depth/points"/>
        <remap from="cloud_out" to="cloud_throttled"/>
    </node>

    <!-- Fake Laser -->
    <node pkg="nodelet" type="nodelet" name="kinect_laser" args="load pointcloud_to_laserscan/CloudToScan openni_manager" respawn="true">
        <param name="output_frame_id" value="/camera_depth_frame"/>
        <!-- heights are in the (optical?) frame of the kinect -->
        <param name="min_height" value="-0.15"/>
        <param name="max_height" value="0.15"/>
        <remap from="cloud" to="/cloud_throttled"/>
    </node>

    <!-- Fake Laser (narrow one, for localization -->
    <node pkg="nodelet" type="nodelet" name="kinect_laser_narrow" args="load pointcloud_to_laserscan/CloudToScan openni_manager" respawn="true">
        <param name="output_frame_id" value="/camera_depth_frame"/>
        <!-- heights are in the (optical?) frame of the kinect -->
        <param name="min_height" value="-0.025"/>
        <param name="max_height" value="0.025"/>
        <remap from="cloud" to="/cloud_throttled"/>
        <remap from="scan" to="/narrow_scan"/>
    </node>


</launch>

Hi usama,

I was following your troubles myself and ran into this issue as well. If you add the following after the opening launch tag:

<arg name="use_sim_time" default="true"/>
<arg name="gui" default="true"/>

and then the following before the closing launch tag:

<group if="$(arg gui)">
    <node name="gazebo_gui pkg="gazebo" type="gui" respawn="false" output="screen"/>
</group>

You should get up and running. If you want to look into this in more detail, look into the gazebo_worlds stack and at the empty_world.launch file.

treanorj

UPDATE: Fixed mismatched quotation marks in <node ...="" &gt;<="" p="">

UPDATE 2: Below are my launch files to test this with. Note my package here is called turtlebot_sim_test, I am using a world file called box.world and I call roslaunch on basic_world.launch

basic_world.launch:

<launch>
    <arg name="use_sim_time" default="true"/>
    <arg name="gui" default="true"/>

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

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

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

    <!-- start gui -->
    <group if="$(arg gui)">
        <node name="gazebo_gui" pkg="gazebo" type="gui" respawn="false" output="screen"/>
    </group> 

</launch>

robot.launch:

<launch>
    <param name="robot_description" command="$(find xacro)/xacro.py '$(find turtlebot_sim_description)/urdf/turtlebot.urdf.xacro'" />

    <node name="spawn_turtlebot_model" pkg="gazebo" type="spawn_model" args="$(optenv ROBOT_INITIAL_POSE) -unpause -urdf -param robot_description -model turtlebot" respawn="false" output="screen"/>

    <node pkg="diagnostic_aggregator" type="aggregator_node" name="diagnostic_aggregator" >
        <rosparam command="load" file="$(find turtlebot_bringup)/config/diagnostics.yaml" />
    </node>

    <node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher" output="screen">
        <param name="publish_frequency" type="double" value="30.0" />
    </node>

    <!-- The odometry estimator -->

    <node pkg="robot_pose_ekf" type="robot_pose_ekf" name="robot_pose_ekf">
        <param name="freq" value="30.0"/>
        <param name="sensor_timeout" value="1.0"/>
        <param name="publish_tf" value="true"/>
        <param name="odom_used" value="true"/>
        <param name="imu_used" value="false"/>
        <param name="vo_used" value="false"/>
    </node>

    <!-- throttling -->
    <node pkg="nodelet" type="nodelet" name="pointcloud_throttle" args="load pointcloud_to_laserscan/CloudThrottle openni_manager" respawn="true">
        <param name="max_rate" value="20.0"/>
        <remap from="cloud_in" to="/camera/depth/points"/>
        <remap from="cloud_out" to="cloud_throttled"/>
    </node>

    <!-- Fake Laser -->
    <node pkg="nodelet" type="nodelet" name="kinect_laser" args="load pointcloud_to_laserscan/CloudToScan openni_manager" respawn="true">
        <param name="output_frame_id" value="/camera_depth_frame"/>
        <!-- heights are in the (optical?) frame of the kinect -->
        <param name="min_height" value="-0.15"/>
        <param name="max_height" value="0.15"/>
        <remap from="cloud" to="/cloud_throttled"/>
    </node>

    <!-- Fake Laser (narrow one, for localization -->
    <node pkg="nodelet" type="nodelet" name="kinect_laser_narrow" args="load pointcloud_to_laserscan/CloudToScan openni_manager" respawn="true">
        <param name="output_frame_id" value="/camera_depth_frame"/>
        <!-- heights are in the (optical?) frame of the kinect -->
        <param name="min_height" value="-0.025"/>
        <param name="max_height" value="0.025"/>
        <remap from="cloud" to="/cloud_throttled"/>
        <remap from="scan" to="/narrow_scan"/>
    </node>


</launch>

UPDATE 4: If you haven't already done, it uncomment a section from the turtlebot_description/urdf/turtlebot_body.urdf.xacro file, below, as discussed in ROS Answers: Fuerte turtlebot simulator Ubuntu 12.04 precise

<inertial>
    <mass value="0.0001" />
    <origin xyz="0 0 0" />
    <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
         iyy="0.0001" iyz="0.0" 
         izz="0.0001" />
</inertial>