ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can create your own launch file to spawn the robot. For example:
<!-- spawn_robot.launch -->
<launch>
<!-- Robot pose -->
<arg name="x" default="0"/>
<arg name="y" default="0"/>
<arg name="z" default="0"/>
<arg name="roll" default="0"/>
<arg name="pitch" default="0"/>
<arg name="yaw" default="0"/>
<param name="robot_description"
command="$(find xacro)/xacro.py $(find myrobot_description)/urdf/myrobot.urdf.xacro"/>
<node name="spawn_robot" pkg="gazebo" type="spawn_model"
args="-urdf -param robot_description -model myrobot
-x $(arg x) -y $(arg y) -z $(arg z)
-R $(arg roll) -P $(arg pitch) -Y $(arg yaw)"/>
</launch>
Then you change <include file="$(find pr2_gazebo)/launch/pr2.launch"/>
to:
<include file="$(find myrobot_description)/launch/spawn_robot.launch">
<arg name="x" value="1.0"/>
<arg name="y" value="1.0"/>
</include>