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

Revision history [back]

I am able to answer my own question. I was loading a robot I had accidentally saved in my .world file instead of spawning a new robot from my xacro file.

my launch file now looks like this:


    <!-- these are the arguments you can pass this launch file, for example paused:=true -->
    <arg name="paused" default="false"/>
    <arg name="use_sim_time" default="true"/>
    <arg name="gui" default="true"/>
    <arg name="headless" default="false"/>
    <arg name="debug" default="false"/>
    <!--arg name="model" default="$(find bender_model)/model.urdf.xacro"/-->
    <!-- Robot pose -->
    <arg name="x" default="0.1"/>
    <arg name="y" default="0.5"/>
    <arg name="z" default="0"/>
    <arg name="roll" default="0"/>
    <arg name="pitch" default="0"/>
    <arg name="yaw" default="0"/>

  <!-- We resume the logic in empty_world.launch, changing only the name of the world to be launched -->
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" value="$(find bender_model)/bender_worlds/"/>
        <arg name="debug" value="$(arg debug)" />
        <arg name="gui" value="$(arg gui)" />
        <arg name="paused" value="$(arg paused)"/>
        <arg name="use_sim_time" value="$(arg use_sim_time)"/>
        <arg name="headless" value="$(arg headless)"/>

    <param name="robot_description" command="$(find xacro)/ '$(find bender_model)/model.urdf.xacro'" />

    <!-- push robot_description to factory and spawn robot in gazebo -->
    <!--node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        args="-z 1.0 -unpause -urdf -model robot -param robot_description" respawn="false" output="screen" /-->

    <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model bender
                -x $(arg x) -y $(arg y) -z $(arg z)
                -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)" />

    <node pkg="robot_state_publisher" type="robot_state_publisher"  name="robot_state_publisher">
        <param name="publish_frequency" type="double" value="10.0" />