Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.almond.bot/llms.txt

Use this file to discover all available pages before exploring further.

Bimanual inverse kinematics using pyroki and JAX/jaxls. Loads the bundled URDF, builds a collision model, and JIT-compiles the solver during __init__ — the first call takes a few seconds; subsequent calls are fast.
from almond_axol.kinematics import KinematicsSolver, KinematicsConfig
import numpy as np
from almond_axol.kinematics import KinematicsSolver, KinematicsConfig

solver = KinematicsSolver(KinematicsConfig(pos_weight=100.0))
q = np.zeros(solver.num_joints, dtype=np.float32)

# Forward kinematics → (left_SE3, right_SE3) as jaxlie.SE3
left_se3, right_se3 = solver.fk(q)

# Inverse kinematics → new joint array
pos = np.array([0.3, 0.2, 0.4], dtype=np.float32)
rot = np.eye(3, dtype=np.float32)
q = solver.ik(q, left_pose=(pos, rot))

KinematicsSolver interface

MemberDescription
num_jointsTotal actuated joints across both arms
joint_namesJoint name strings (left arm then right)
left_indices / right_indicesIndices into the full q array for each arm
fk(q)Forward kinematics → (left_SE3, right_SE3)
ik(q, left_pose, right_pose, left_elbow_pos, right_elbow_pos)IK; pose is (pos_3, rot_3x3); elbow hints are optional (3,) arrays
set_posture_pose(q)Set the null-space attractor (home pose for joint drift prevention)

KinematicsConfig fields

FieldDefaultDescription
pos_weight50.0End-effector position tracking weight
ori_weight10.0End-effector orientation tracking weight
elbow_weight5.0Elbow hint tracking weight
rest_weight7.5Per-step damping; penalises deviation from q_current
posture_weight5.0Persistent attractor to home pose (prevents null-space drift)
manipulability_weight0.05Reward for configurations with high manipulability
limit_weight75.0Joint limit penalty weight
self_collision_margin0.1 mMinimum clearance between collision bodies
self_collision_weight75.0Self-collision penalty weight
max_iterations8Solver iterations per ik() call
cost_tolerance1e-2Convergence tolerance
max_joint_delta~0.035 radMaximum joint change per ik() call
max_reach0.8 mEE target clamped to this distance from shoulder