Problems spawning PR2
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.
Asked by elias on 2014-07-18 06:11:00 UTC
Answers
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
I have no idea about the second failure but it seems like one file is containing more that one line declaring the gui argument...
Asked by evilBiber on 2014-07-21 02:31:38 UTC
Comments
Thanks. Now I have a PR2 in a gas-station. :)
I am still confused with the second problem. But thanks for the advise.
Asked by elias on 2014-07-21 06:46:44 UTC
Thanks. Now I have a PR2 in a gas-station. :)
Asked by elias on 2014-07-21 06:46:46 UTC
Comments