Skip to content

Gripper Get Model Configuration ​

SUMMARY

Get Model Configuration returns the joint configuration of the gripper's URDF model, one value per driver joint. Two companion queries return the configuration at a joint-travel fraction or a physical opening, without reading or changing the gripper.

UNITS

URDF units: radians for revolute joints, meters for prismatic joints. opening_width takes unit of "mm" or "m".

The Skill ​

python
q = gripper.get_model_configuration()
q = gripper.get_model_configuration_at_joint_travel_fraction(0.5)
q = gripper.get_model_configuration_at_opening_width(30.0, unit="mm")

The Code ​

python
"""
Demonstrates how to read the URDF joint configuration of a gripper kinematics
model for the Synapse SDK.

Supports all.

Usage:
    python get_model_configuration.py
"""

from loguru import logger

from telekinesis.synapse.tools.parallel_grippers import onrobot


def main() -> None:
    """Reads the model configuration of an OnRobot gripper, then queries other openings."""

    #===================== Create Gripper ======================================
    gripper = onrobot.OnRobotRG6()

    # ==================== Run Skill ===========================================
    q = gripper.get_model_configuration()
    logger.success(f"Model configuration (URDF units): {q}")

    # The same model queried at other openings, without changing the gripper.
    q_half = gripper.get_model_configuration_at_joint_travel_fraction(0.5)
    q_30mm = gripper.get_model_configuration_at_opening_width(30.0, unit="mm")
    logger.info(f"Halfway through joint travel: {q_half}")
    logger.info(f"At a 30 mm opening: {q_30mm}")


if __name__ == "__main__":
    main()

Running the Example ​

bash
python get_model_configuration.py

For all options:

bash
python get_model_configuration.py --help

Parameter Configuration ​

ParameterTypeDefaultDescription
fractionfloatrequiredget_model_configuration_at_joint_travel_fraction: fraction of joint travel toward open in [0.0, 1.0] (0.0 closed, 1.0 open).
opening_widthfloatrequiredget_model_configuration_at_opening_width: jaw opening in unit.
unitstrrequiredget_model_configuration_at_opening_width: "mm" or "m".

Returns ​

TypeDescription
np.ndarrayDriver-joint configuration, shape (nq,). Mimic joints are not included; they follow their driver joint.

Raises ​

ExceptionCondition
TypeErrorThe fraction, opening or unit has an invalid type
ValueErrorThe fraction is outside [0.0, 1.0], or the unit is unsupported, or the opening is outside the model's physical range
NotImplementedErrorThe gripper has no URDF model

How to Tune the Parameters ​

get_model_configuration follows the measured opening: it updates on connect and after every move, open and close. The two _at_ queries assume jaw width is linear in joint travel; calibrate the model for grippers with nonlinear linkages.

Where to Use the Skill ​

  • Visualization - Pass the configuration to Rerun or a planning scene.
  • What-if geometry - Place the fingers at an opening before commanding it.

When Not to Use the Skill ​