Skip to content

Add Safety README #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

JerryGu-leiting
Copy link

Create a README for the safety module. Others can learn how to integrate the safety module into the actuators code.

Copy link
Member

@senthurayyappan senthurayyappan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a with context manager to the safety module?

The rest of the documentation looks good!


For example:

```python
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing indentation

### Safety Execption Classes

- **`ThermalLimitException`**: Raised when software thermal limits are exceeded
- **`I2tLimitException`**: Raised when Dephy ActPack I²t (current-time) limits are exceeded
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This I2tlimitException is not limited to Dephy Actpacks


### [DephyActuator](./dephy.py) Safety Support

#### Built-in Safety Features
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sub-section seems out of place and is not true

- Thermal scaling factor calculation
- Integrated exception handling in `update()` method

#### Known Issues
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, this does not belong in safety modules doc


### Best Practices

1. **Always use context managers** (`with` statements) when working with actuators
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This point outlines general safety but does not relate to our safety module implementation

"""
return SafetyManager.SafetyDisableContext(self)

class SafetyDisableContext:
Copy link
Member

@VarunSatyadevShetty VarunSatyadevShetty Jun 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a context manager to temporarily disable safety checks, I think it would be more useful to add the with context manager, where the enter(): function will call the safety manager start function and the exit(): function will execute the safety manager stop and exit conditions.
This will help us to use the safety manager with "with" similar to actuators.

Overall, the safety documentation looks good! great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants