Safety
This module contains the functions and decorator for implementing safety measures in the robot. The decorator function is used to create guardrails for functions and functions, especially involving movement. The module also contains functions to set and reset the safety level for the safety measures.
ATTRIBUTE | DESCRIPTION |
---|---|
DEBUG |
Safety mode that logs the function call
TYPE:
|
DELAY |
Safety mode that waits for a few seconds before executing. Defaults to 3.
TYPE:
|
SUPERVISED |
Safety mode that requires user input before executing
TYPE:
|
safety_mode |
Safety mode for the safety measures
TYPE:
|
FUNCTION | DESCRIPTION |
---|---|
guard |
Decorator for creating guardrails for functions and functions, especially involving movement |
set_level |
Set the safety level for the safety measures |
reset_level |
Reset the safety level to None |
Documentation last updated: 2025-06-11
DELAY
module-attribute
Safety mode that waits for a few seconds before executing. Defaults to 3.
guard
guard(mode: int = DEBUG) -> Callable
Decorator for creating guardrails for functions and functions, especially involving movement
PARAMETER | DESCRIPTION |
---|---|
mode
|
mode for implementing safety measure. Defaults to DEBUG. - DEBUG (0): logs the function call - DELAY (>=1): waits for a few seconds before executing. Defaults to 3. - SUPERVISED (-10): requires user input before executing
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Callable
|
wrapped function
TYPE:
|