safety replay: set angle measurement (#1752)

set angle meas in safety replay
This commit is contained in:
Shane Smiskol 2023-11-30 01:04:14 -06:00 committed by GitHub
parent d070f6e7c9
commit 2ee6e36e99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View File

@ -149,6 +149,11 @@ int get_desired_angle_last(void){
return desired_angle_last;
}
void set_angle_meas(int min, int max){
angle_meas.min = min;
angle_meas.max = max;
}
int get_angle_meas_min(void){
return angle_meas.min;
}

View File

@ -32,6 +32,7 @@ def setup_safety_helpers(ffi):
void set_rt_torque_last(int t);
void set_desired_angle_last(int t);
int get_desired_angle_last();
void set_angle_meas(int min, int max);
int get_angle_meas_min(void);
int get_angle_meas_max(void);
@ -83,6 +84,7 @@ class PandaSafety(Protocol):
def set_rt_torque_last(self, t: int) -> None: ...
def set_desired_angle_last(self, t: int) -> None: ...
def get_desired_angle_last(self) -> int: ...
def set_angle_meas(self, min: int, max: int) -> None: ... # noqa: A002
def get_angle_meas_min(self) -> int: ...
def get_angle_meas_max(self) -> int: ...

View File

@ -71,4 +71,5 @@ def init_segment(safety, lr, mode, param):
elif angle != 0:
safety.set_controls_allowed(1)
safety.set_desired_angle_last(angle)
safety.set_angle_meas(angle, angle)
assert safety.safety_tx_hook(to_send), "failed to initialize panda safety for segment"