Gazebo | Ignition | Community
Ask Your Question
0

Problems spawning PR2

asked 2014-07-18 06:11:00 -0600

elias gravatar image

updated 2014-07-18 06:39:32 -0600

Hi,

I have a problem following the instructions given in this tutorial.

I have a plain vanilla hydro installation and followed the tutorial step by step. I ran in some problems I was able to work around. But spawning the PR2 in the newly created world with the gas-station fails and I cannot find the reason...

My pr2-gasstation.launch looks like this:

<!-- Convert an xacro and put on parameter server -->
<param name="robot_description" command="$(find xacro)/xacro.py $(find pr2_description)/robots/pr2.urdf.xacro" />

<!-- Spawn a robot into Gazebo -->
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model pr2" />

<launch>
  <!-- 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 pr2_gazebo)/worlds/pr2.world"/>
    <!-- more default parameters can be changed here -->
  </include>
</launch>

I got this error:

Invalid roslaunch XML syntax: junk after document element: line 5, column 0

I checked if the command of line 2 is working on my machine and discovered after resolving the paths by hand that the .urdf seems to be created in the console. Unfortunately line 5 seems to have still a problem...

I also checked if pr2_empty_world.launch is working and I can confirm that this launches the PR2 in an empty world. However, the other predefined scenarios which comes with the ros-hydro-pr2-common e.g. pr2_table_object.launch does not launch properly resulting in the following error:

Invalid <arg> tag: arg 'gui' has already been declared. 

Arg xml is <arg default="true" name="gui"/>

I checked all the others but the empty world is the only one which actually launches the simulator with the robot.

Any help is very appreciated. Thank you in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-07-21 02:31:38 -0600

Hi elias,

your launch file structure is wrong.

<launch>
  <!-- Convert an xacro and put on parameter server -->
  <param name="robot_description" command="$(find xacro)/xacro.py $(find pr2_description)/robotspr2.urdf.xacro" />

  <!-- Spawn a robot into Gazebo -->
  <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf-model pr2" />

  <!-- 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 pr2_gazebo)/worlds/pr2.world"/>
    <!-- more default parameters can be changed here -->
  </include>
</launch>

the launch file should always have a root element <launch/> the ros wiki contains a good description about roslaunch files...

I have no idea about the second failure but it seems like one file is containing more that one line declaring the gui argument...

edit flag offensive delete link more

Comments

Thanks. Now I have a PR2 in a gas-station. :) I am still confused with the second problem. But thanks for the advise.

elias gravatar imageelias ( 2014-07-21 06:46:44 -0600 )edit

Thanks. Now I have a PR2 in a gas-station. :)

elias gravatar imageelias ( 2014-07-21 06:46:46 -0600 )edit

Question Tools

Stats

Asked: 2014-07-18 06:11:00 -0600

Seen: 2,031 times

Last updated: Jul 21 '14