Skip to content

Safety

The software E-stop, per-variable correction limits and the override for calibration work.

Usage

# Emergency stop (software-level, NOT safety-rated)
api.safety.stop()
api.safety.is_stopped()          # True

# Reset E-stop
api.safety.reset()

# Configure correction limits
api.safety.set_limit("RKorr.X", -50.0, 50.0)
api.safety.set_limit("AKorr.A1", -10.0, 10.0)

# View all limits
limits = api.safety.get_limits()
for var, (lo, hi) in limits.items():
    print(f"{var}: [{lo}, {hi}]")

# Full status
status = api.safety.status()
# {"emergency_stop": False, "safety_override": False, "limits": {...}}

# Override limits (use with extreme caution)
api.safety.override(True)
# ... calibration work ...
api.safety.override(False)

Reference

SafetyAPI

SafetyAPI(client: RSIClient)

Safety management interface for KUKA RSI robot control.

Provides emergency stop control, limit configuration, and safety status monitoring. Limits are enforced at two points: write-time validation in this process (raises on violation) and send-time clamping in the network process (clamps values that reach receive_variables by any other route).

Initialize SafetyAPI namespace.

Parameters:

Name Type Description Default
client RSIClient

RSIClient instance for accessing safety manager

required

stop

stop() -> None

Trigger emergency stop.

Activates the safety manager's E-stop flag, blocking all motion commands until reset() is called. This is a software-level safety mechanism.

Note

This is NOT a hardware E-stop and should not be relied upon for safety-critical applications. Always use proper hardware E-stops.

reset

reset() -> None

Reset emergency stop and resume normal operation.

Clears the E-stop flag, allowing motion commands to proceed again. Use with caution after ensuring the robot workspace is safe.

status

status() -> Dict[str, Any]

Get comprehensive safety status information.

Returns:

Type Description
Dictionary containing
- emergency_stop (bool): Whether E-stop is active
- safety_override (bool): Whether safety checks are bypassed
- limits `(Dict[str, Tuple[float, float]]):` Configured limits
Example

status = api.safety.status() print(status['emergency_stop']) False print(status['limits']['RKorr.X']) (-100.0, 100.0)

set_limit

set_limit(variable: str, lower: float, upper: float) -> None

Set or update safety limit bounds for a specific variable.

Parameters:

Name Type Description Default
variable str

Variable path (e.g., 'RKorr.X', 'AKorr.A1')

required
lower float

Minimum allowed value

required
upper float

Maximum allowed value

required

Raises:

Type Description
ValueError

If lower >= upper

Example

api.safety.set_limit('RKorr.X', -50.0, 50.0) api.safety.set_limit('AKorr.A1', -10.0, 10.0)

get_limits

get_limits() -> Dict[str, tuple[float, float]]

Get all configured safety limits.

Returns:

Type Description
Dict[str, tuple[float, float]]

Dictionary mapping variable paths to (lower, upper) limit tuples

Example

limits = api.safety.get_limits() for var, (lower, upper) in limits.items(): ... print(f"{var}: [{lower}, {upper}]")

override

override(enable: bool) -> None

Enable or disable safety limit override.

WARNING: Use with EXTREME CAUTION. When enabled, all safety limit validation is bypassed, allowing potentially dangerous motion commands.

Parameters:

Name Type Description Default
enable bool

True to bypass safety checks, False to re-enable

required
Example
Temporarily disable limits for calibration

api.safety.override(True)

... perform calibration ...

api.safety.override(False) # Re-enable safety

is_stopped

is_stopped() -> bool

Check if emergency stop is currently active.

Returns:

Type Description
bool

True if E-stop is active, blocking all motion

is_overridden

is_overridden() -> bool

Check if safety limit validation is currently bypassed.

Returns:

Type Description
bool

True if safety checks are disabled