Author: Alessandro Di Fava < firstname.lastname@example.org >
|Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.|
Planning in cartesian space with TRAC-IKDescription: Use TRAC-IK in MoveIt! to plan a joint trajectory in order to reach a given pose in cartesian space
Keywords: Motion planning, cartesian space, inverse kinematics, TRAC-IK
Tutorial Level: INTERMEDIATE
Next Tutorial: Planning with Octomap
First make sure that the tutorials are properly installed along with the TIAGo simulation, as shown in the Tutorials Installation Section.
Install TRAC-IK plugin
sudo apt-get install ros-indigo-trac-ik-kinematics-plugin
The command adds the trac-ik-kinematics-plugin and trac_ik_lib to your workspace.
First open two consoles and source the public simulation workspace as follows:
cd ~/tiago_public_ws source ./devel/setup.bash
Launching the simulation
In the first console launch the following simulation
IK_SOLVER=trac_ik roslaunch tiago_gazebo tiago_gazebo.launch public_sim:=true robot:=steel
Gazebo will show up with TIAGo.
Wait until TIAGo has tucked its arm. Then you may proceed with the next steps.
The IK_SOLVER=trac_ik environment variable is used to set TRAC_IK solver as the solver to use in MoveIt! Without this variable, the default solver is the KDL one. The configuration file tiago_moveit_config/config/kinematics_trac_ik.yaml referred to TRAC_IK solver is shown:
arm_torso: kinematics_solver: trac_ik_kinematics_plugin/TRAC_IKKinematicsPlugin kinematics_solver_timeout: 0.005 solve_type: Speed position_only_ik: false arm: kinematics_solver: trac_ik_kinematics_plugin/TRAC_IKKinematicsPlugin kinematics_solver_timeout: 0.005 solve_type: Speed position_only_ik: false
See https://bitbucket.org/traclabs/trac_ik/src/HEAD/trac_ik_kinematics_plugin for details about the parameters.
Launching the nodes
Now we are going to run the example of the previous tutorial (see http://wiki.ros.org/Robots/TIAGo/Tutorials/MoveIt/Planning_cartesian_space for details) that will bring TIAGo's end-effector frame, i.e. arm_tool_link, to the following cartesian space configuration with respect to /base_footprint:
x: 0.4 y: -0.3 z: 0.26 Roll: -0.011 Pitch: 1.57 Yaw: 0.037
In order to safely reach such a cartesian goal the node plan_arm_torso_ik included in tiago_moveit_tutorial package has to be called as follows
rosrun tiago_moveit_tutorial plan_arm_torso_ik 0.4 -0.3 0.26 -0.011, 1.57, 0.037
An example of plan executed by the node is depicted in the following sequence of images:
Note that the final pose of /arm_tool_link is the same of the previous tutorial, but the joints configuration of the arm is different. It depends on MoveIt! planner but it's also due to the using of a different IK solver.