Skip to content

forge3d.robot

Robot arm loading, FK, IK, and Jacobian.

Robot

Kinematic robot arm.

Holds joint angles, computes FK, and exposes link poses for rendering. Physics (dynamics) is NOT simulated — the arm is kinematically controlled.

Parameters

model : RigidBodyModel (n revolute joints, serial chain). link_radii : Visual cylinder radius per link (m). Default: 0.04 m. name : Display name. material : Snapshot material ID for link boxes. base_position : World-frame position of the robot base.

q property writable

q: ndarray

Current joint angles (rad), shape (n,).

set_joint

set_joint(idx: int, angle: float) -> None

Set joint idx to angle (radians).

set_joints

set_joints(q: Any) -> None

Set all joint angles at once.

link_world_poses() -> list[tuple[np.ndarray, np.ndarray]]

FK for all links.

List of (pos, R) pairs (one per link), world frame. pos : (3,) float64 — joint origin position. R : (3,3) float64 — link frame orientation.

ee_pose

ee_pose() -> tuple[np.ndarray, np.ndarray]

End-effector pose (last link): (pos, R) in world frame.

link_visual_boxes() -> list[tuple[np.ndarray, np.ndarray, np.ndarray]]

Compute (center, R, half_extents) for each link visual box.

Each box connects the joint-i origin to the joint-(i+1) origin. Box z-axis is aligned along the segment direction.

List of (center, R, half_extents) tuples.


Loading a preset

import forge3d.robot as f3r

arm = f3r.load("ur5", base_position=(0, 0, 0))

Available presets: "ur5" (UR5 6-DOF)