Analytical IK¤
Closed-form inverse kinematics for known industrial robots. Runs entirely
in-process -no Docker, no PyBullet, no ROS- and is the fastest IK option
in compas_fab.
When to use¤
- Prototyping reachability and inverse kinematics on a supported robot.
- IK from inside Rhino, Grasshopper or any other Python host.
- Generating IK seeds for a downstream planner.
- You don't need collision checking. (If you do, see Analytical IK + PyBullet.)
Trade-offs¤
| What you get | What you give up |
|---|---|
| Closed-form IK in microseconds | Only the supported analytical robot families |
Zero setup beyond pip install compas_fab |
No collision checking |
| Works from any Python host (CAD, headless, CI) | No motion planning, IK / FK only |
Setup¤
Nothing to install beyond compas_fab itself. Analytical solvers are part
of the package.
Supported robots¤
- Universal Robots: UR3, UR3e, UR5, UR5e, UR10, UR10e, UR16e
- Staubli: TX2-60L
-
Abb
IRB 4600 40/255
See compas_fab.backends for the full list of solver classes.
First example¤
Forward kinematics on a UR5:
from compas_robots import Configuration
from compas_fab.backends import AnalyticalKinematicsPlanner
from compas_fab.backends import UR5Kinematics
from compas_fab.robots import RobotCellLibrary
from compas_fab.robots import TargetMode
# Not loading the robot's geometry because AnalyticalKinematicsPlanner does not use it for collision checking
robot_cell, robot_cell_state = RobotCellLibrary.ur5(load_geometry=False)
# The kinematics_solver must match the robot's kinematics
planner = AnalyticalKinematicsPlanner(UR5Kinematics())
# This is a simple robot cell with only the robot
planner.set_robot_cell(robot_cell)
# Configuration for FK calculation
configuration = Configuration.from_revolute_values([0.0, 4.8, 1.5, 1.1, 1.9, 3.1])
robot_cell_state.robot_configuration = configuration
# AnalyticalKinematicsPlanner.forward_kinematics(), do not support `planning_group` parameter, it must be left as None.
# The `link` option is also not supported and cannot be used.
frame_WCF = planner.forward_kinematics(robot_cell_state, TargetMode.ROBOT)
print("Robot flange frame of the default planning group in the world coordinate system:")
print(frame_WCF)
More examples¤
02_inverse_kinematics.py: IK returning 8 solutions for a UR502_inverse_kinematics with_tools.py: IK with a tool attached to the flange
For collision-aware IK and Cartesian planning, see Analytical IK + PyBullet.
API reference¤
- compas_fab.backends.AnalyticalKinematicsPlanner
- compas_fab.backends: all available solvers