Overview
The inverse kinematics module provides solvers for the robot’s parallel SCARA leg mechanism. The primary functionsolve_leg_ik_3dof() computes joint angles to reach a target position in 3D space, supporting multiple working modes for different elbow configurations.
solve_leg_ik_3dof()
Convenience function for solving 3DOF leg inverse kinematics with robot-specific parameters.Parameters
Target position
[x, y, z] in the leg’s local frame (meters). The z-axis points downward.Desired tilt angle in radians. If
None, the solver automatically computes the tilt angle based on the target’s y-coordinate.Upper link length in meters.
Lower link length in meters.
Distance between the two parallel arm bases in meters.
SCARA working mode determining elbow configuration:
1: Arm A elbow up, Arm B elbow down2: Arm A elbow down, Arm B elbow up (default)3: Both elbows up4: Both elbows down
Returns
tuple or None: Returns(tilt, shoulder_L, shoulder_R) tuple of joint angles in radians, or None if the target is unreachable.
tilt: Tilt joint angleshoulder_L: Left shoulder joint angleshoulder_R: Right shoulder joint angle
Usage Example
Pure Height Control Example
parallel_scara_ik()
Solves 2DOF parallel SCARA inverse kinematics for planar targets.Parameters
2D target position
[x, z] in the planar workspace.Upper link length in meters.
Lower link length in meters.
Distance between parallel arm bases in meters.
Elbow configuration mode (1-4). See working modes above.
Returns
tuple or None: Returns(θ1_A, θ2_A, θ1_B, θ2_B) tuple containing shoulder and elbow angles for both arms, or None if unreachable.
Usage Example
Working Modes
The parallel SCARA mechanism supports four distinct working modes that determine the elbow configuration:| Mode | Arm A Elbow | Arm B Elbow | Use Case |
|---|---|---|---|
| 1 | Up | Down | Alternative configuration |
| 2 | Down | Up | Default - most common |
| 3 | Up | Up | Extended reach upward |
| 4 | Down | Down | Compact configuration |
Reachability
The IK solver checks reachability using the triangle inequality:- Minimum reach: 0.015m (1.5cm)
- Maximum reach: 0.105m (10.5cm)
None.