mirror of https://github.com/commaai/panda.git
safety replay: set angle measurement (#1752)
set angle meas in safety replay
This commit is contained in:
parent
d070f6e7c9
commit
2ee6e36e99
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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: ...
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue