-
Notifications
You must be signed in to change notification settings - Fork 41
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
Detail on replicating Safety functions #7
Comments
I think we should add this dynamic (overrideable), usually we send an empty packet to the dog, this will return the SN of the dog and then we know the type: AlienGo, Go1, A1 , so based on this we can tell the sdk to not go over the said safety values instead of having the user to code it hard into the usage of the sdk. |
I have tried to implement something similar: i tried to detect low level and high level modes by sending something "empty". In practice this causes interference of high and low level locomotion. Also do we really need to support go1? Also power protect doesn't depend on model, so no detection is needed. Position protect is weird, since it requires perfect initial calibration and better to solve on higher level anyway. |
position safety seems simple enough, not really sure what is the calculation they are doing for the power safety over there. |
For anyone that wishes to try to implement them on their own (before we can) here are some notes.
https://github.com/unitreerobotics/unitree_legged_sdk/blob/master/include/unitree_legged_sdk/safety.h
Start here: unitreerobotics/unitree_legged_sdk#65
Long story short we can simply make use of https://github.com/Bin4ry/free-dog-sdk/blob/main/ucl/lowState.py#L58
return motorState(mode, q, dq, ddq, tauEst, q_raw, dq_raw, ddq_raw, temperature, reserve)
Looks to me like in order to add safety support, we need to utilize the above MotorState. Seemingly all "Safety()" does is check the static values depicted in the disassembled code attached for each joint vs the motor state.
The text was updated successfully, but these errors were encountered: