Pose Inverse Kinematics Library
PoseIK is a relatively simple but efficient implementation of a Jacobian-based Newton-Raphson Inverse Kinematics Solver, using native MoveIt types and algorithms (e.g. RobotState for Forward Kinematics). It works by:
- Taking random joint configurations using a deterministic sequence. The solver will always return the same solution given the same inputs.
- For each random joint configuration, measure the error to the target in Cartesian space, and do a gradient descent towards the target.
- Gradient descent is done with a damped-least-squares Jacobian inverse, with low damping. This adds some amount of robustness against singularities during the gradient descent, without taking a big hit in convergence rates.
- We avoid the computation of the full Jacobian inverse at each minimization step. Instead, we solve directly for the joint-space velocity that minimizes the Cartesian error.
- We don't enforce position joint limits during the gradient descent step. Instead, we minimize without joint limits and try to 'unwind' the solution to within the limits as a final step.
- We use an adaptive step size multiplier for the gradient descent for a faster convergence. The step multiplier becomes larger as the error to the target gets smaller.
The solver shows significant performance gains compared to KDL and TRAC_IK. In addition, it supports computing IK for multiple tips simultaneously. These are the average solve times, in milliseconds, for three common robots:
| Solve times (ms) | KDL | TRAC_IK | PoseIK |
|---|---|---|---|
| panda | 1.58 | 0.306 | 0.0421 |
| fanuc | 3.28 | 0.489 | 0.0416 |
| Kinova Gen3 | 1.073 | 0.386 | 0.0321 |
These numbers were obtained using the ik_benchmarking package on a 12th Gen Intel(R) Core(TM) i7-12700H, 2.7 GHz, with the following benchmark config:
All solvers were configured with a target tolerance of 0.001m.
Comparison with TRAC_IK
TRAC_IK was configured in Speed mode, with the following parameters:
PoseIK was configured with the same target tolerance. The rest of parameters were left to the default values.
| Kinova Gen3 | Panda | Fanuc | |
|---|---|---|---|
| Solve time |
|
|
|
| Position Error |
|
|
|
| Success Rate |
|
|
|
Success rate is 100% in all the cases. TRAC_IK exceeds the configured position/orientation tolerances in some cases, even if it's configured to stay under those thresholds. The PoseIK solver achieves much lower solve times (~10x faster), while keeping a much smaller target error.
Exposed libraries
This package exposes two libraries:
- pose_ik: This contains the actual IK solver. It depends on moveit_pro_base and path_ik (for math types and functions).
- pose_ik_plugin: This library implements MoveIt's KinematicsBase interface to integrate the solver as a MoveIt kinematics plugin.
The pose_ik library exposes a single IK free function:
This function will try to find a joint-space solution that reaches all targets. Each PoseTarget is a target pose that the solver will try to reach with a given robot link (e.g. multiple tips). seed will be used in the first gradient descent iteration, before starting taking random seeds. robot_state is used to have access to the robot Forward Kinematics. It is also modified internally while performing the search. If a solution is found, robot_state is returned as an Eigen::VectorXd, and robot_state will be updated to the solution.
MoveIt plugin
To use this solver with the MoveIt planning pipeline, update your config files (kinematics.yaml) to use this solver, e.g.:
See the Parameter Reference section below for a full list of accepted parameters and their description.
Solve modes
Two solve modes are implemented:
- first_found: In this mode the solver will return as soon as a solution is found. It won't try to optimize for any cost. Use this mode if you care about solve speed and don't have a preference on the solution.
- optimize_distance: In this mode the solver will always run for a given period of time, in order to find better solutions, even if one was found already. The solver will prefer solutions closer to the seed (initial joint configuration) in joint-space. Use this mode if your application can afford spending additional time in IK in exchange for better solutions.
The solve mode can be configured via the YAML config file used by the generate_parameters library. All the possible parameters and their description are listed in the next section.
Parameter reference
These are the parameters that can be configured in the PoseIK YAML configuration file:
Relevant headers
- pose_ik.hpp: The main header that exposes the solveIK function.
- pose_ik_plugin.hpp: The MoveIt plugin that integrates the solver with the MoveIt planning pipeline.
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.