Discussion

Left ArrowBack to discussions page
antbivantbiv Posts: 1 Recruit
I need to have in ROS Gazebo and MoveIt an UR5 robot who has the Robotiq 2 Finger Gripper(85) in the simulation models. At the moment all I have is the UR5 model only for simulations. How do I add the gripper to this model

Comments

  • carlosjosergcarlosjoserg Posts: 29Tactile Sensor Beta Testers Handy
    Hi @antbiv

    So far, I haven't seen any custom implementation of the 2 Finger Gripper in Gazebo, and moreover, in the ROS-i repos, I couldn't find and URDF of the new gripper model 2f-85. So I created one that you can find it in our fork&branch: https://github.com/beta-robots/robotiq/tree/new_2_finger_models/robotiq_2f_model   (The idea is to contribute it back to the ROS-i repos after I test it more).

    If you don't need the adaptivity-mode of the gripper in simulation (which is not easy, btw), then you can use the gazebo_ros_control plugin. The plugin works better with one single instance of an URDF. So my suggestion is for you to assembly one single URDF with UR5+Robotiq 2F-85, and then add the plugin to that. Something like:
    <?xml version="1.0"?>
    <robot xmlns:xacro="http://ros.org/wiki/xacro" name="assembled_robot">
    
    	<!-- THE ROBOT -->
    	<link name="world" />
    
    	<!-- UR from ROS-i repos -->
    	<xacro:include filename="$(find ur_description)/urdf/ur10.urdf.xacro" />
    	<joint name="world_joint" type="fixed">
    		<parent link="world" />
    		<child link = "simple_arm_base_link" />
    		<origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
    	</joint>
    	<xacro:ur10_robot prefix="simple_arm_" joint_limited="false" precise_collision="false"/>
    
    	<!-- Robotiq from Beta Robots fork-->
    	<xacro:include filename="$(find robotiq_2f_model)/model/robotiq_2f_85.urdf.xacro" />
    	<xacro:robotiq_2f_85 name="simple_gripper" parent="simple_arm_tool0" precise_collision="false" adaptive_transmission="false">
    		<origin xyz="0 0 0" rpy="0 0 1.5708" />
    	</xacro:robotiq_2f_85>
    
           <!-- Plugin -->
    	<plugin name="ros_control" filename="libgazebo_ros_control.so" />
    
    </robot>

    Then you need to configure, load and start any compatible ros-controller, as you'd normally do with a real robot or UR5 you say you have. If you need further details on how to do that, let me know.

    Best,
    Carlos
  • WonchulWonchul Posts: 6 Apprentice
    edited August 10
    Thanks for your advice!
    However, since I am a beginner.... Could you explain more please?

    I downloaded robotiq_2f_85 model and tried to assembly it to the wrist_3_link of the UR3....
    But, failed....

    When i attached precise_collision="false" like the below:
      <xacro:ur3_robot prefix="" joint_limited="false" precise_collision="false" />

    Invalid parameter "precise_collision"
    XacroException('Invalid parameter "precise_collision"',)

    THis error came up, and i got this error when i added only simple_arm_ to the name of ur3_robot:
      <xacro:ur3_robot prefix="simple_arm_" joint_limited="false"  />
    Error:   Failed to build tree: child link [base_link] of joint [world_joint] not found
             at line 226 in /build/urdfdom-UJ3kd6/urdfdom-0.4.1/urdf_parser/src/model.cpp
    Error [parser_urdf.cc:3408] Unable to call parseURDF on robot model
    Error [parser.cc:340] parse as old deprecated model file failed.




    When i added this
    	<xacro:robotiq_2f_85 name="simple_gripper" parent="simple_arm_tool0" precise_collision="false" adaptive_transmission="false">

    I got error about 'can't find simple_arm_tool0'



  • WonchulWonchul Posts: 6 Apprentice
    I followed your advice and,,, got this error:
    [ERROR] [1502413570.173243633, 0.306000000]: This robot has a joint named "simple_gripper_right_driver_joint" which is not in the gazebo model.
    [FATAL] [1502413570.174087383, 0.306000000]: Could not initialize robot simulation interface


  • carlosjosergcarlosjoserg Posts: 29Tactile Sensor Beta Testers Handy
    Hi @Wonchul

    Let me try to answer point by point.

    When i attached precise_collision="false" like the below:
      <xacro:ur3_robot prefix="" joint_limited="false" precise_collision="false" />
    Invalid parameter "precise_collision"
    XacroException('Invalid parameter "precise_collision"',)
    The universal robot package in ros-industrial does not have this parameter. I added it because I think that the geometry of these robots can be fairly well approximated using cylinders, which increases considerably the speed for collision checking within motion planning, instead of the convex hull of the real mesh. I did this for the UR10 model only though, because it is the one I was using, you can check what this parameter does within the URDF model here.

    Anyway, you can omit this parameter, if time for motion planning is not an issue for you.

    <xacro:robotiq_2f_85 name="simple_gripper" parent="simple_arm_tool0" precise_collision="false" adaptive_transmission="false">
    I got error about 'can't find simple_arm_tool0'
    The parent depends on what name you used in the ur3_robot prefix parameter. That link exist in the UR3 model, as you can see here.

    [ERROR] [1502413570.173243633, 0.306000000]: This robot has a joint named "simple_gripper_right_driver_joint" which is not in the gazebo model.
    [FATAL] [1502413570.174087383, 0.306000000]: Could not initialize robot simulation interface
    Now that looks like an issue. Is there any place where I can see you launch file completely? Are you spawning the assembled URDF into gazebo? You need to have something like this for instance (note that in this line, the URDF loaded in the robot_description parameter is converted to SDF on-the-fly and pushed to the gazebo world)
    <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model $(arg robot_name)"  respawn="false" output="screen" />




  • WonchulWonchul Posts: 6 Apprentice
    Thank you for your reply!!!

    Since i am real beginner of ROS, I just downloaded your codes(universal robots and robotiq) and tried 'catkin_make'.

    However, I got this error:
    -- ==> add_subdirectory(robotiq_85_gripper-master/robotiq_85_moveit_config)
    CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
    Please set them or make sure they are set and tested correctly in the CMake files:
    MODBUS_INCLUDE_DIR (ADVANCED)
       used as include directory in directory /home/icsl/catkin_ws/src/robotiq-new_2_finger_models/robotiq_2f_hw_usb
       used as include directory in directory /home/icsl/catkin_ws/src/robotiq-new_2_finger_models/robotiq_2f_hw_usb
       used as include directory in directory /home/icsl/catkin_ws/src/robotiq-new_2_finger_models/robotiq_2f_hw_usb
       used as include directory in directory /home/icsl/catkin_ws/src/robotiq-new_2_finger_models/robotiq_2f_hw_usb
       used as include directory in directory /home/icsl/catkin_ws/src/robotiq-new_2_finger_models/robotiq_2f_hw_usb
       used as include directory in directory /home/icsl/catkin_ws/src/robotiq-new_2_finger_models/robotiq_2f_hw_usb
       used as include directory in directory /home/icsl/catkin_ws/src/robotiq-new_2_finger_models/robotiq_2f_hw_usb
       used as include directory in directory /home/icsl/catkin_ws/src/robotiq-new_2_finger_models/robotiq_2f_hw_usb
    MODBUS_LIBRARIES (ADVANCED)
        linked by target "robotiq_2f_hw_usb_node" in directory /home/icsl/catkin_ws/src/robotiq-new_2_finger_models/robotiq_2f_hw_usb

    -- Configuring incomplete, errors occurred!
    See also "/home/icsl/catkin_ws/build/CMakeFiles/CMakeOutput.log".
    See also "/home/icsl/catkin_ws/build/CMakeFiles/CMakeError.log".
    Makefile:6954: recipe for target 'cmake_check_build_system' failed
    make: *** [cmake_check_build_system] Error 1
    Invoking "make cmake_check_build_system" failed
    icsl@icsl:~/catkin_ws$


  • carofidecarofide Posts: 14 Apprentice
    Hi @Wonchul,
    I am doing the same things you mention in your post, but with a different robot. I was able to install the package. I also had the same problem as you. The solution of that problem is here http://dof.robotiq.com/discussion/comment/2838/#Comment_2838
  • WonchulWonchul Posts: 6 Apprentice
    Thanks for your advice.

    However, i got this error:
    /home/icsl/catkin_ws/src/robotiq-new_2_finger_models/robotiq_ethercat/src/ethercat_manager.cpp:10:26: fatal error: ethercattype.h: No such file or directory
    compilation terminated.
    [  5%] Built target diagnostic_msgs_generate_messages_cpp
    robotiq-new_2_finger_models/robotiq_ethercat/CMakeFiles/robotiq_ethercat.dir/build.make:62: recipe for target 'robotiq-new_2_finger_models/robotiq_ethercat/CMakeFiles/robotiq_ethercat.dir/src/ethercat_manager.cpp.o' failed
    make[2]: *** [robotiq-new_2_finger_models/robotiq_ethercat/CMakeFiles/robotiq_ethercat.dir/src/ethercat_manager.cpp.o] Error 1
    CMakeFiles/Makefile2:5503: recipe for target 'robotiq-new_2_finger_models/robotiq_ethercat/CMakeFiles/robotiq_ethercat.dir/all' failed
    make[1]: *** [robotiq-new_2_finger_models/robotiq_ethercat/CMakeFiles/robotiq_ethercat.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs....
    [  5%] Built target diagnostic_msgs_generate_messages_nodejs
    [  5%] Built target diagnostic_msgs_generate_messages_py
    [  5%] Built target camera_test
    Makefile:138: recipe for target 'all' failed
    make: *** [all] Error 2



    Even after i installed soem by 'sudo apt-get install ros-kinetic-soem'


    I googled it,,, but there was no solution...

    Could you help me ???




  • carofidecarofide Posts: 14 Apprentice
    Hi @Wonchul
    The solution of that problem is mentioned here 
    What I did was to make the following modification in this CMakeLists.txt 
    1. Change ${soem_INCLUDE_DIRS} by  ${soem_INCLUDE_DIRS}/soem

    With that, the software compiles.


  • an_10an_10 Posts: 5 Apprentice
    Hey @carlosjoserg In the first post you mentioned you can share more details regarding the controllers for the gripper plus arm in gazebo. Please can you elaborate on that. I am using a UR10 with the robotiq_s_model gripper.
  • an_10an_10 Posts: 5 Apprentice
    I currently have included the following the launch file:
    <include file="$(find ur_gazebo)/launch/controller_utils.launch"/>

     <rosparam ns="/robot" file="$(find ur_gazebo)/controller/arm_controller_ur10.yaml" command="load"/>
     <node pkg="robot_state_publisher" type="state_publisher" name="robotiq_hands_l_hand_robot_state_publisher"><param name="publish_frequency" type="double" value="50.0"/><remap from="joint_states" to="/robotiq_hands/left_hand/joint_states"/></node>

     <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
        output="screen" ns="/robot" args="arm_controller"/>

    However from the rqt_graph I can see that gazebo does not subscribe to /robot_state_publisher or /robotiq_hands/left_hand/joint_states

    Please can you help

  • WonchulWonchul Posts: 6 Apprentice
    Thank you!@carlosjoserg
    I could compile successfully.

    I have one more question.

    In robotiq-new-2-finger-models which carlosjoserg shared in github,
    there is c, c2, and s_model.... what is difference?????


    Also, could you share any example such as how to control the gripper?


  • carlosjosergcarlosjoserg Posts: 29Tactile Sensor Beta Testers Handy
    Hi @an_10

    Is your repo public anywhere so I can take a look? Usually there is a lot of confusion about namespaces of the controller manager, controller configurations and the gazebo_ros_control plugin.

    Best
  • an_10an_10 Posts: 5 Apprentice
    Hi @carlosjoserg, my repo is not public. But I can share details here.
    The launch file currently looks like this:
    <?xml version="1.0" encoding="utf-8"?>
    <launch>

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

          <param if="$(arg load_robot_description)" name="robot_description"
          command="$(find xacro)/xacro --inorder $(find bin_clearing_simulation_ur)/urdf/ur_test.urdf "/>
            <include file="$(find gazebo_ros)/launch/empty_world.launch">
                <arg name="world_name" value="worlds/empty.world"/>
                <arg name="gui" value="true"/>
                <arg name="paused" value="$(arg paused)"/>
                <arg name="use_sim_time" value="$(arg use_sim_time)"/>
              </include>

          <node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -param 'robot_description' -model robot -z 0.1" respawn="false" output="screen" />
          <include file="$(find ur_gazebo)/launch/controller_utils.launch"/>

          <rosparam ns="/robot" file="$(find ur_gazebo)/controller/arm_controller_ur10.yaml" command="load"/>
          <node pkg="robot_state_publisher" type="state_publisher" name="robotiq_hands_l_hand_robot_state_publisher"><param name="publish_frequency" type="double" value="50.0"/><remap from="joint_states" to="/robotiq_hands/left_hand/joint_states"/></node>

          <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
        output="screen" ns="/robot" args="arm_controller"/>

    </launch>

    --------------------------------------------------ur_test.urdf----------------------------------------

    <?xml version="1.0"?>
    <robot xmlns:xacro="http://ros.org/wiki/xacro" name="assembled_robot">

        <!-- THE ROBOT -->
        <link name="world" />

        <!-- UR from ROS-i repos -->
        <xacro:include filename="$(find ur_description)/urdf/ur10.urdf.xacro" />
        <joint name="world_joint" type="fixed">
            <parent link="world" />
            <child link = "base_link" />
            <origin xyz="0.0 0.0 0.0" rpy="0.0 0.0 0.0" />
        </joint>
        <xacro:ur10_robot prefix="" joint_limited="false" />

        <!-- Robotiq from Beta Robots fork-->
        <xacro:include filename="$(find robotiq_s_model_visualization)/cfg/robotiq_hand_macro.urdf.xacro" />
        <xacro:robotiq_hand prefix="simple_gripper" parent="tool0" reflect="" >
            <origin xyz="0 0 0" rpy="${pi/2} 0 0" />
        </xacro:robotiq_hand>

           <!-- Plugin -->
        <gazebo>
          <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
            <robotNamespace>/robot</robotNamespace>
          </plugin>
        </gazebo>

    </robot>
    -----------------------------------------------------
    rosservice list | grep controller_manager on terminal gives me this:
    /robot/controller_manager/list_controller_types
    /robot/controller_manager/list_controllers
    /robot/controller_manager/load_controller
    /robot/controller_manager/reload_controller_libraries
    /robot/controller_manager/switch_controller
    /robot/controller_manager/unload_controller

    -----------------------------------------------------------
    So my arm controller has topic /robot/arm_controller/command, which is subscribed by gazebo. But for the robotiq gripper  /robotiq_hands/left_hand/joint_states this topic is not subscibed by gazebo. Main issue is how to control the gripper?







  • an_10an_10 Posts: 5 Apprentice
    I have included the following in my ur_test.urdf file:
        <gazebo>
          <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
            <robotNamespace>/robot</robotNamespace>
          </plugin>
          <plugin name="RobotiqHandPlugin" filename="libRobotiqHandPlugin.so">
          </plugin>
        </gazebo>


  • an_10an_10 Posts: 5 Apprentice
    When I try yo visualize in rqt, it does not show the gripper controller. It only shows the arm controller till wrist_3

Sign In or Register to comment.
Left ArrowBack to discussions page