ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I now face a similar kind of problem as you did, @gpldecha. I'm trying to create a simulation for an UR5 with Robotiq_85_C2_Gripper.

First I tried to reference the Gripper inside the xacro-File of the UR5. It partly worked, but the Gripper didn't spawn fully.

Now I want to create a new xacro-File in which I combine both xacro's of the robot and gripper and call this file with a launch-file.

My code is (ur5_robotiq.xacro):

<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="ur5_robotiq_model">
<property name="pi" value="3.1415"/>
<xacro:include filename="$(find ur_description)/urdf/ur5_robot.urdf.xacro"/>
<xacro:include filename="$(find robotiq_c2_model_visualization)/urdf/robotiq_c2_model.xacro"/>

<link name="world" />

<joint name="world_joint" type="fixed">
    <parent link="world" />
    <child link = "base_foot" />
    <origin xyz="0.0 0.0 0.026" rpy="0.0 0.0 0.0" />
</joint>

<joint name="Gripper_Adapter_Fix" type="fixed">
    <parent link="fts_toolside" />
    <child link="robotiq_85_adapter_link" />
    <origin xyz="0.0 0.0 -0.0125" rpy="0.0 ${- pi / 2} 0.0" />
</joint>

</robot>

This file is loaded by (ur5_robotiq.launch):

<?xml version="1.0"?>
<launch>
<arg name="limited" default="false"/>

<param name="robot_description" command="$(find xacro)/xacro.py '$(find myrobot_description)/urdf/ur5_robotiq.xacro'" />

</launch>

The highest launch-file is:

<?xml version="1.0"?>
<launch>

<arg name="limited" default="false"/>
<arg name="paused" default="false"/>
<arg name="gui" default="true"/>



<include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find myrobot_gazebo)/worlds/myworld.world"/>
    <arg name="paused" value="$(arg paused)"/>
    <arg name="gui" value="$(arg gui)"/>
</include>

      <!-- UR5 & Robotiq Gripper -->
      <!-- load ur5 into sim -->
     <!-- send robot urdf to param server -->

     <include file="$(find myrobot_description)/launch/ur5_robotiq.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
         -z 0.0"
         respawn="false" output="screen" />

</launch>

I'm new to ROS and Gazebo. First I just want to spawn both Models in my world. The controllers are less important at the moment. When I launch the highest launch file with roslaunch, then Gazebo starts with myworld but without the models:

...
[INFO] [WallTime: 1448618278.209298] [0.245000] Calling service /gazebo/spawn_urdf_model                                                      
Error [Param.cc:181] Unable to set value [1,0471975511965976] for key[horizontal_fov]                                                         
Error [Param.cc:181] Unable to set value [0,100000001] for key[near]                                                                          
Error:   Failed to build tree: parent link [fts_toolside] of joint [Gripper_Adapter_Fix] not found.  This is not valid according to the URDF spec. Every link you refer to from a joint needs to be explicitly defined in the robot description. To fix this problem you can either remove this joint [Gripper_Adapter_Fix] from your urdf file, or add "<link name="fts_toolside" />" to your urdf file.                                 
     at line 226 in /build/buildd/urdfdom-0.2.10+dfsg/urdf_parser/src/model.cpp                                                           
Error [parser_urdf.cc:2608] Unable to call parseURDF on robot model                                                                           
Error [parser.cc:299] parse as old deprecated model file failed.                                                                              
Error [World.cc:1527] Unable to read sdf string
...

The not found links are in the Xacro-files of the robot and gripper. Could you help me, to find the mistake?

Best regard, J_Schaefer

P.S. the models of the UR5 and the gripper can be found in Github: ros-industrial Universal Robots, Robotiq