Creating the MoveIt! IKFast plugin

Creating a MoveIt! IKFast plugin is quite easy. There is no need to write code; everything can be generated using some tools. The only thing we need to do is to create an empty ROS package. The following is the procedure to create a plugin:

  1. Create an empty package in which the name should contain the robot name and model number. This package is going to convert into the final plugin package, using the plugin generation tool:
$ catkin_create_pkg abb_irb6640_moveit_plugins
  1. Then, build the workspace by using the catkin_make command. You can also download the ROS package from here:
$ git clone https://github.com/jocacace/abb_irb6640_moveit_plugins.git
  1. After building the workspace, copy ikfast.h to abb_irb6640_moveit_plugins/include.
  2. Copy the switch ikfast61.cpp previously created in the package folder, renaming it abb_irb6640_manipulator_ikfast_solver.cpp. This filename consists of the robot name, model number, type of robot, and so on. This kind of naming is necessary for the generating tool.

After performing these steps, open two terminals in the current path where the IK solver CPP file exists. In one terminal, start the roscore command. In the next terminal, move in to the create package and enter the plugin creation command, as follows:

$ rosrun moveit_kinematics create_ikfast_moveit_plugin.py abb_irb6640 manipulator abb_irb6640_moveit_plugins abb_irb6640_manipulator_ikfast_solver.cpp  

This command could fail due to a mismatch of the robot name specified into the URDF and SRDF files. To work around this error, we need to change the name of the robot in the SRDF file, placed into the abb_irb6640_mveit_config/config folder. You change line seven of this file from <robot name="abb_irb6640_185_280"> to <robot name="abb_irb6640">. Or simply replace this file with the one contained in the ikfast_demo folder.

The moveit_ikfast ROS package includes the create_ikfast_moveit_plugin.py script for the plugin generation. The first parameter is the robot name with the model number, the second argument is the type of robot, the third argument is the package name we created earlier, and the fourth argument is the name of the IK solver CPP file. This tool needs the abb_irb6640_moveit_config package in order to work. It will search this package using the given name of the robot. So, if the name of the robot is wrong, the tool for raising an error will say that it couldn't find the robot moveit package.

If the creation is successful, the following messages will be displayed on the Terminal:

Figure 17: Terminal messages of successful creation of IKFast plugin for MoveIt!

As you can see from these messages, after creating the plugin, the abb_irb6640_moveit_config/config/kinematics.yaml file has been updated, specifying abb_irb6640_manipulator_kinematics/IKFastKinematicsPlugin as the kinematics solver. The updated version of the file is shown in the following code:

manipulator: 
  kinematics_solver:     abb_irb6640_manipulator_kinematics/IKFastKinematicsPlugin 
  kinematics_solver_search_resolution: 0.005 
  kinematics_solver_timeout: 0.005 
  kinematics_solver_attempts: 3 
 

Now you can build the workspace again in order to install the plugin and start to operate with the robot and the new IKFast plugin, launching the demo scene:

$ roslaunch abb_irb6640_moveit_config demo.launch
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.180.71