Skip to content

Forward Kinematics

SUMMARY

Forward Kinematics computes the robot tool pose from a given joint configuration.

This skill is used to validate robot poses, generate Cartesian outputs from joint states, and support downstream planning and control tasks.

UNITS

The input joint positions q must be in degrees. The returned TCP pose is in meters for translation and Euler XYZ degrees for orientation.

The Skill

python
tcp_pose = robot.forward_kinematics(q=q)
A UR10e manipulator with its tool0 pose computed via forward kinematics

The Code

Pass frame_name to compute FK for any configured frame (default TCP, flange, tool, etc.).

python
"""
Compute forward kinematics for a fixed joint configuration.

Supports Universal Robots (UR), Epson, and virtual.

Usage:
    python forward_kinematics.py
"""

from telekinesis.synapse.robots.manipulators import universal_robots


def main():
    """Compute forward kinematics for a fixed joint configuration and visualize the result."""

    #===================== Create Robot ==========================================
    robot = universal_robots.UniversalRobotsUR10E(name='UR10e')

    # ==================== Run Skill ============================================
    q = [0, -90, 90, 0, 90, 0]
    tcp_pose = robot.forward_kinematics(q=q)
    print("TCP pose: ", tcp_pose)

    # ==================== Visualization (Optional) =============================
    robot.set_joint_positions(joint_positions=q)
    robot.visualize_rerun(live=False)


if __name__ == "__main__":
    main()

Parameter Configuration

ParameterTypeDefaultDescription
qlist[float] | np.ndarray-1D joint configuration vector in degrees. Length must match the robot's DOF count.
frame_namestr | NoneNoneName of the TCP frame whose pose should be returned. None selects the currently active TCP (robot.active_tcp).
verboseboolFalseIf True, log diagnostic information when q is outside the configured joint limits.

Returns

TypeDescription
np.ndarrayPose [x, y, z, rx, ry, rz] of the requested (or active) TCP frame. Translation in meters, orientation as Euler XYZ in degrees.

Raises

ExceptionCondition
TypeErrorq is not a list/np.ndarray, or contains a non-numeric element
ValueErrorq is outside the configured joint limits, or frame_name does not match any configured TCP frame

How to Tune the Parameters

Pass frame_name to evaluate FK for any configured frame (default TCP, flange, tool tip, or a custom TCP added via Add TCP) instead of switching robot.active_tcp for a one-off pose. Set verbose=True while developing a trajectory so an out-of-limits q logs which joint(s) are the problem before the ValueError is raised; leave it False in production to avoid log noise on every call.

Where to Use the Skill

Forward Kinematics is commonly used in the following scenarios:

  • Pose validation - Confirm that a planned joint configuration reaches the intended Cartesian target before issuing a motion command
  • State logging and analysis - Convert recorded joint trajectories to Cartesian paths for visualization or post-processing
  • Simulation cross-checking - Verify that the kinematic model matches expected end-effector positions during development

When Not to Use the Skill

Do not use Forward Kinematics when:

  • You need the live end-effector pose during execution - read it directly from Get Cartesian Pose rather than computing FK on every cycle
  • The joint values are outside the configured joint limits - forward_kinematics raises ValueError. Use In Joint Limits to validate beforehand.