Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Creating my custom launch file

Can anyone please help me understand why the node for spawning my robot from my launch file is not taking effect AND why my DEM causes gazebo to instantly crash?

I've been learning ROS and in that process I have 2 packages, r2d2_description and r2d2_gazebo, which I am trying to launch via a launch file.

The world_name argument causes gazebo to fail immediately it starts up. Commenting it out allows gazebo to start successfully.

With the world_name argument commented out ...

In 3 different terminals, I can execute roscore, initiate gazebo using rosrun gazebo_ros gazebo, and from the r2d2_gazebo base directory I can place my robot URDF in the initialised gazebo using the following command: rosrun gazebo_ros spawn_model -file urdf/r2d2.urdf -urdf -x 0 -y 0 -z 1 -model r2d2

What I'm trying to accomplish is creating a launch file while will accomplish all 3 commands above. The following is my attempt:

<launch>
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
  <arg name="world_name" value="worlds/r2d2.world"/>
  <node pkg="r2d2_description" type="r2d2" respawn="false" name="r2d2" output="screen">
    <rosparam file="urdf/r2d2.urdf" command="load" ns="global_costmap" />
  </node>
  </include>
</launch>

My problem is Gazebo launches but my robot is nowhere to be found.

Creating my custom launch file

Can anyone please help me understand why the node for spawning my robot from my launch file is not taking effect AND why my DEM causes gazebo to instantly crash?

I've been learning ROS and in that process I have 2 packages, r2d2_description and r2d2_gazebo, which I am trying to launch via a launch file.

The world_name argument causes gazebo to fail immediately it starts up. Commenting it out allows gazebo to start successfully.

With the world_name argument commented out ...

In 3 different terminals, I can execute roscore, initiate gazebo using rosrun gazebo_ros gazebo, and from the r2d2_gazebo base directory I can place my robot URDF in the initialised gazebo using the following command: rosrun gazebo_ros spawn_model -file urdf/r2d2.urdf -urdf -x 0 -y 0 -z 1 -model r2d2

What I'm trying to accomplish is creating a launch file while will accomplish all 3 commands above. The following is my attempt:

<launch>
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
  <arg name="world_name" value="worlds/r2d2.world"/>
  <node pkg="r2d2_description" type="r2d2" respawn="false" name="r2d2" output="screen">
    <rosparam file="urdf/r2d2.urdf" command="load" ns="global_costmap" />
  </node>
  </include>
</launch>

My problem is Gazebo launches but my robot is nowhere to be found.

Creating my custom launch fileLaunch file DEM issues

Can anyone please help me understand why the node for spawning my robot from my launch file is not taking effect AND why my DEM causes gazebo to instantly crash?

I've been learning ROS and in that process I have 2 packages, r2d2_description and r2d2_gazebo, which I am trying to launch via a launch file.

The world_name argument causes gazebo to fail immediately it starts up. Commenting it out allows gazebo to start successfully.

With the world_name argument commented out ...

In 3 different terminals, I can execute roscore, initiate gazebo using rosrun gazebo_ros gazebo, and from the r2d2_gazebo base directory I can place my robot URDF in the initialised gazebo using the following command: rosrun gazebo_ros spawn_model -file urdf/r2d2.urdf -urdf -x 0 -y 0 -z 1 -model r2d2

What I'm trying to accomplish is creating a launch file while will accomplish all 3 commands above. The following is my attempt:code:

<launch>
  <include file="$(find gazebo_ros)/launch/empty_world.launch">
   <arg name="world_name" value="worlds/r2d2.world"/>
  <node pkg="r2d2_description" type="r2d2" respawn="false" name="r2d2" output="screen">
</include>

 <rosparam file="urdf/r2d2.urdf" command="load" ns="global_costmap" />
<node name="r2d2" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
 </node>
 </include>
args="-file $(find r2d2_description)/urdf/r2d2.urdf -urdf -x 0 -y 0 -z 0 -model r2d2"/>

</launch>

My problem is Gazebo launches but my robot is nowhere to be found.