Question about spawning to arbitrary pose in Gazebo.

1,421 views
Skip to first unread message

np0...@bristol.ac.uk

unread,
Mar 17, 2016, 8:17:33 AM3/17/16
to swri-ros-pkg-dev
Hi. I have been trying to simulate the UR5 in gazebo and send motion plans using moveit_commander.

One problem that I'm experiencing is that my simulated robot is spawning into gazebo in a limp flat position. 



I'm using the commands described on the ur github readme file to open the gazebo simulation.

I'm told this is a "singularity" and hence the robot can't work out how to get out what to do the motion plans it's sent?

I have had a go at editing the launch file ur_gazebo/launch/ur5.launch to change the initial spawn position. This is my contents of my file:

<?xml version="1.0"?>
<launch>
 
<arg name="limited" default="false"/>
 
<arg name="paused" default="false"/>
 
<arg name="gui" default="true"/>
 
<arg name="x" default="0.2"/>
 
<arg name="y" default="0.4"/>
 
<arg name="z" default="0.5"/>
 
<arg name="roll" default="0"/>
 
<arg name="pitch" default="0"/>
 
<arg name="yaw" default="0"/>

 
<!-- startup simulated world -->
 
<include file="$(find gazebo_ros)/launch/empty_world.launch">
   
<arg name="world_name" default="worlds/empty.world"/>
   
<arg name="paused" value="$(arg paused)"/>
   
<arg name="gui" value="$(arg gui)"/>
 
</include>

 
<!-- send robot urdf to param server -->
 
<include file="$(find ur_description)/launch/ur5_upload.launch">
   
<arg name="limited" value="$(arg limited)"/>
 
</include>

 
<!-- push robot_description to factory and spawn robot in gazebo -->
 
<node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model robot -x $(arg x) -y $(arg y) -z $(arg z)
              -R $(arg roll) -P $(arg pitch) -Y $(arg yaw)"
respawn="false" output="screen" />

 
<include file="$(find ur_gazebo)/launch/controller_utils.launch"/>

 
<rosparam file="$(find ur_gazebo)/controller/arm_controller_ur5.yaml" command="load"/>
 
<node name="arm_controller_spawner" pkg="controller_manager" type="controller_manager" args="spawn arm_controller" respawn="false" output="screen"/>

</launch>



Then when using this launch file I get the robot still in the same flat pose but with the starting mount position not at the origin; presumably in the position 0.2 0.4 0.5:




Is there a way to adapt the launch file in order to spawn the robot with a chosen pose rather than initial position?


Thanks a lot!

Nick

Auto Generated Inline Image 1
Auto Generated Inline Image 2

Miguel Prada

unread,
Mar 18, 2016, 11:00:38 AM3/18/16
to swri-ros-pkg-dev
There's an optional argument to spawn_model which is supposed to allow you to set initial joint positions 

spawn_model -J JOINT_NAME JOINT_POSITION

However, last time I tried, this method was not working in the Indigo version of gazebo.

There is an old open issue (not updated since November 2014) documenting this on gazebo_ros_pkgs but I must admit I haven't tried any of the suggestions there.


HTH

Nick Pestell

unread,
Apr 4, 2016, 4:35:06 AM4/4/16
to swri-ros-pkg-dev
Thank you!! 
Reply all
Reply to author
Forward
0 new messages