This commit is contained in:
Maxime Desroches 2024-10-02 17:22:23 -07:00
parent 4355934ff0
commit 3c7672c31a
3 changed files with 5 additions and 6 deletions

View File

@ -158,11 +158,10 @@ int get_angle_meas_max(void){
return angle_meas.max;
}
int get_angle_meas(int pos){
return angle_meas.values[pos];
int get_angle_meas_last(void){
return angle_meas.values[0];
}
// ***** car specific helpers *****
void set_honda_alt_brake_msg(bool c){

View File

@ -34,7 +34,7 @@ def setup_safety_helpers(ffi):
void set_angle_meas(int min, int max);
int get_angle_meas_min(void);
int get_angle_meas_max(void);
int get_angle_meas(int pos);
int get_angle_meas_last(void);
bool get_cruise_engaged_prev(void);
void set_cruise_engaged_prev(bool engaged);

View File

@ -108,10 +108,10 @@ class TestSubaruSafetyBase(common.PandaCarSafetyTest):
def test_angle_meas(self):
self.assertTrue(self._rx(self._angle_meas_msg(0)))
self.assertEqual(self.safety.get_angle_meas(0), 0)
self.assertEqual(self.safety.get_angle_meas_last(), 0)
self.assertTrue(self._rx(self._angle_meas_msg(1)))
self.assertEqual(self.safety.get_angle_meas(0), 100)
self.assertEqual(self.safety.get_angle_meas_last(), 100)
def test_vehicle_speed(self):
self.assertTrue(self._rx(self._speed_msg(0)))