Skip to content

Commit fefc489

Browse files
authored
Port TRAC-IK tutorial to ROS 2 (#786)
1 parent 7a0c429 commit fefc489

File tree

5 files changed

+48
-37
lines changed

5 files changed

+48
-37
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*~
22
*.pyc
3+
doc/api/python_api/_autosummary/
34
doc/manifest.yaml
45
doc/html
56
build

doc/examples/examples.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ Before attempting to integrate a new robot with MoveIt 2, check whether your rob
6262
perception_pipeline/perception_pipeline_tutorial
6363
hand_eye_calibration/hand_eye_calibration_tutorial
6464
ikfast/ikfast_tutorial
65-
trac_ik/trac_ik_tutorial
6665

6766
Configuration
6867
-------------

doc/examples/trac_ik/trac_ik_tutorial.rst

Lines changed: 0 additions & 36 deletions
This file was deleted.

doc/how_to_guides/how_to_guides.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Configuring and Using MoveIt
2222
persistent_scenes_and_states/persistent_scenes_and_states
2323
isaac_panda/isaac_panda_tutorial
2424
pick_ik/pick_ik_tutorial
25+
trac_ik/trac_ik_tutorial
2526
benchmarking/benchmarking_tutorial
2627

2728
Developing and Documenting MoveIt
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
TRAC-IK Kinematics Solver
2+
=========================
3+
4+
`TRAC-IK <https://bitbucket.org/traclabs/trac_ik>`_ is an inverse kinematics solver developed by TRACLabs that combines two IK implementations via threading to achieve more reliable solutions than common available open source IK solvers.
5+
From their documentation:
6+
7+
(TRAC-IK) provides an alternative Inverse Kinematics solver to the popular inverse Jacobian methods in KDL.
8+
Specifically, KDL's convergence algorithms are based on Newton's method, which does not work well in the presence of joint limits --- common for many robotic platforms.
9+
TRAC-IK concurrently runs two IK implementations.
10+
One is a simple extension to KDL's Newton-based convergence algorithm that detects and mitigates local minima due to joint limits by random jumps.
11+
The second is an SQP (Sequential Quadratic Programming) nonlinear optimization approach which uses quasi-Newton methods that better handle joint limits.
12+
By default, the IK search returns immediately when either of these algorithms converges to an answer.
13+
Secondary constraints of distance and manipulability are also provided in order to receive back the "best" IK solution.
14+
15+
The package `trac_ik_kinematics_plugin <https://bitbucket.org/traclabs/trac_ik/src/rolling-devel/trac_ik_kinematics_plugin/>`_ provides a ``KinematicsBase`` MoveIt interface that can replace the default KDL solver.
16+
Currently, mimic joints are *not* supported.
17+
18+
Install
19+
-------
20+
21+
The ``rolling-devel`` branch of the TRAC-IK repository has the latest ROS 2 implementation.
22+
For now, the repository must be built from source in your ROS 2 workspace, for example ``~/moveit2_ws``. ::
23+
24+
cd ~/moveit2_ws/src
25+
git clone -b rolling-devel https://bitbucket.org/traclabs/trac_ik.git
26+
27+
Usage
28+
-----
29+
30+
- Find the MoveIt :doc:`kinematics.yaml </doc/examples/kinematics_configuration/kinematics_configuration_tutorial>` file created for your robot.
31+
- Replace ``kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin`` (or similar) with ``kinematics_solver: trac_ik_kinematics_plugin/TRAC_IKKinematicsPlugin``
32+
- Make sure you add a ``<depend>trac_ik_kinematics_plugin</depend>`` tag to your package's corresponding ``package.xml`` file.
33+
- Set parameters as desired:
34+
35+
- **kinematics\_solver\_timeout** (timeout in seconds, e.g., ``0.005``) and **position\_only\_ik** **ARE** supported.
36+
- **solve\_type** can be ``Speed``, ``Distance``, ``Manip1``, ``Manip2`` (see below for details). Defaults to ``Speed``.
37+
- **epsilon** is the Cartesian error distance used to determine a valid solution. Defaults to ``1e-5``.
38+
- **kinematics\_solver\_attempts** parameter is unneeded: unlike KDL, TRAC-IK solver already restarts when it gets stuck.
39+
- **kinematics\_solver\_search\_resolution** is not applicable here.
40+
41+
From the `trac_ik_lib <https://bitbucket.org/traclabs/trac_ik/src/rolling-devel/trac_ik_lib/>`_ package documentation (slightly modified), here is some information about the solve type parameter:
42+
43+
- ``Speed``: returns very quickly the first solution found.
44+
- ``Distance``: runs for the full timeout, then returns the solution that minimizes sum of squares error (SSE) from the seed.
45+
- ``Manip1``: runs for full timeout, returns solution that maximizes ``sqrt(det(J*J^T))`` (the product of the singular values of the Jacobian).
46+
- ``Manip2``: runs for full timeout, returns solution that minimizes the ratio of min to max singular values of the Jacobian.

0 commit comments

Comments
 (0)