Skip to content

Is Pose Within Safety Limits

SUMMARY

Is Pose Within Safety Limits checks a given Cartesian pose [x, y, z, rx, ry, rz] against the robot's active safety configuration and returns True if the pose is reachable within the safety boundaries.

UNITS

Input pose is [x, y, z, rx, ry, rz] in meters and Euler XYZ degrees. Returns a boolean.

The Skill

python
within_limits = robot.is_pose_within_safety_limits(pose)

The Code

Example: Check Whether a Target Pose Is Within Safety Limits

Verify that a target pose is safe before commanding motion.

python
"""
Checks safety plane limits, TCP orientation deviation limits, and reachability for a Cartesian pose.

Supports Universal Robots (UR).

Usage:
    python is_pose_within_safety_limits.py [--ip <ROBOT_IP>]
"""

import argparse

from loguru import logger

from telekinesis.synapse.robots.manipulators import universal_robots


def main(ip: str | None) -> None:
    """Check the robot's current TCP pose against the controller's safety limits."""

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

    try:
        #===================== Connect Robot ==========================================
        if ip:
            robot.connect(ip=ip)

        # ==================== Run Skill ============================================
        current_cartesian_pose = robot.get_cartesian_pose()
        logger.success(
            f"is_pose_within_safety_limits({current_cartesian_pose}): "
            f"{robot.is_pose_within_safety_limits(current_cartesian_pose)}"
        )
    except (ConnectionError, OSError) as e:
        logger.error(f"Error occurred: {e}")
    finally:
        robot.disconnect()
        robot.shutdown()


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Check pose against safety limits Synapse example")
    parser.add_argument("--ip", type=str, default=None,
                         help="UR robot IP address for real hardware, e.g. 192.168.1.100")
    args = parser.parse_args()

    main(ip=args.ip)

Running the Example

bash
python is_pose_within_safety_limits.py --ip 192.168.1.100

For all options:

bash
python is_pose_within_safety_limits.py --help

Parameter Configuration

ParameterTypeDefaultDescription
poselist[float]-Target pose [x, y, z, rx, ry, rz] to check. Position in meters, orientation in degrees.

Returns

FieldTypeDescription
within_limitsboolTrue if the pose is within safety limits, False otherwise.

Raises

ExceptionCondition
RuntimeErrorThe robot is not connected.
TypeErrorpose is not a list or numpy.ndarray.
ValueErrorpose does not have exactly 6 elements.

Where to Use the Skill

  • Pre-motion validation for dynamically computed targets (e.g., vision-guided grasps) to catch unsafe poses before issuing the move command.

When Not to Use the Skill

Use a different skill when: