Skip to content

tuto prep part1

GuiHome edited this page May 3, 2017 · 26 revisions

Tutorial 1 : Preparing a dexterous planning environment

Prerequisite

A workspace must be setup as indicated on the home page

Introduction

This tutorial shows how to setup a planning environment for a multi-fingered hand or an advanced gripper. Since fingers are mini-serial manipulator, MoveIt! can be used to plan their movements. Specific settings are needed to generate a MoveIt! config for such complex robots and will be detailed.

Part 1 : Setting the environment for the shadow hand

Understanding the robot description (URDF)

  • The Shadow robot hand exist in various versions.
  • Motor or Muscle driven
  • Equipped with standard, biotac or ellipsoid fingertips
  • With 1 to 5 fingers
  • Left or right handed
  • To keep the description modular, the URDF files are generated through XACRO, an XML macro language.
  • Each element of the hand is in a different xacro file
  • Parameters are used in the xacro macros to set the various possibility
  • The macros are called by wrappers in a hierarchical manner; finger phalanxes compose a finger which compose the hand along with a palm, a wrist and a forearm.
  • To provide IK for the fingers, tip links must exist where the tip is located in each finger.

  • URDF structure of the motor variation of the shadow hand

  • A collision model for the hand is required for planning to handle self-collision or collision with external objects.

  • Collision elements should preferably be composed of primitives to accelerate collision checking, if mesh must be used, they should remain with the least possible amount of vertices.

  • Collision elements should not be separated by large spaces. Fingers might intersect at these spaces.

  • Starting with ROS hydro, collision model can be composed of several primitives

  • Visual, new and old collision model for comparison

  • Note: MoveIt! can read xacro files but if you need to create a urdf from a xacro.urdf manually use the following command (choose a version of shadow hand)

`rospack find xacro`/xacro.py `rospack find sr_description`/robots/<replace-me>.urdf.xacro > <replace-me>.urdf

Creating the semantic description (SRDF)

  1. In your workspace, create a new folder called moveit_hand_config (do not call it moveit alone, because moveit package exists) in src. Packages files (package.xml and CMakeLists.txt) will be generated by the setup assistant.

  2. Launch MoveIt! setup assistant

    roslaunch moveit_setup_assistant setup_assistant.launch 
    
  3. Click the Create New Moveit Configuration Package button and load the URDF file of the shadow motor hand

    • The file can be found in
    /your/workspace/src/sr_common/sr_description/robots/shadowhand_motor.urdf.xacro
    

    • You should see the Shadow hand displayed
  4. Generate the self-collision matrix

    • Set a medium-low density and click Regenerate Default Collision Matrix
    • The automatic checking is usually not sufficient, one should re-verify each link pair, especially activating the Show Non-disabled Link Pairs to add more pairs and simplify collision checking. The matrix view is very practical, activate it. In the Shadow hand, xxknuckle and thbase|hub are inner joints and should never be tested for collision. Due to the knuckles, some joints that are really adjacent (palm-xxproximal) are not automatically considered as adjacent. Hence, one usually also manually disable the collision between these pairs.
  5. Virtual Joints

    • Create one virtual joint for the base
  6. Planning groups

    • Create a planning group with Add Group for the whole hand (including all the fingers) using the Add Joint method but with Kinematic Solver set to None
    • Create one group per finger using the Add Kin.Chain method (palm to xxtip link) and set Kinematic Solver set to standard solver kdl_kinematics_plugin/KDLKinematicsPlugin
  7. Robot Poses

    • Add default poses if you like
  8. End-effectors

    • Defining an end-effector will allow for interactively defining start and goal poses in rviz. To this end, an interactive marker will be created at the location of the specified parent link.
    • Additionally, the links of the end-effector group will be considered for collision checking.
    • Usually an end-effector is defined as the hand/gripper at the end of an arm. In this case, the end-effector group (hand) and the parent group (arm) do not share any joints or links.
    • Here, we want to define an end-effector for each fingertip to allow for interactive finger positioning. We will use the finger as the end-effector group and the whole hand as the parent group. In this case, both groups have some common joints and links. Note, that the parent link needs to be part of the parent group.
    • Thus, create an end-effector for the first finger called fftip_ee, with first_finger as end-effector group, fftip as parent_link (the tip is the end-effector of the finger), and shadow_hand for the parent group
    • Do the same for the other fingers. You might also create one for the palm.
  9. Generate the MoveIt! configuration files

    • No passive joints are needed
    • Indicate the folder moveit_hand_config in your workspace as the output path.
    • Click Generate Package

Testing the planning environment

  1. Sourcing the MoveIt! config
    • In your workspace root
    source devel/setup.bash
    
  2. Starting MoveIt! demo
    • Launch the MoveIt! demo for the Shadow Hand
    roslaunch moveit_hand_config demo.launch
    
    • RVIZ should launch and you should get a similar view
    • otherwise change the display/plugin settings to get this view
    • In the Planning Request panel, change planning group to first_finger
    • Activate the Interact tool of RVIZ to see the marker at the fingertip. If the tool is not there, add it using the + button
  3. Planning a movement of the first finger
    • In The Planning Request panel, activate the Query Start State
    • Using the mouse, try move the marker at the tip. THE FINGER DOES NOT FOLLOW !
    • The generic KDL IK solves 6D IK by default but the fingers only have 3DOF. A not well advertized option permits to handle position only IK (3D IK) by adding an option in config/kinematics.yaml position_only_ik: True
    • This option does not solve the coupling issues in the last two finger joints (note: biotac hand has no coupling)

A solution is to write our own IK for the fingers.

This is done in the second part of the tutorial


Next see Tutorial 1 part 2 to handle the creation of a special IK plugin to solve kinematics for coupled joints of the Shadow Hand (note: Shadow hands equipped with biotac sensor have no link XFJ1 so no coupling solver needed there).