mirror of https://github.com/commaai/panda.git
angle safety tests: more clear helper function name
here too
This commit is contained in:
parent
001f9917ef
commit
99809f7071
|
@ -532,7 +532,7 @@ class AngleSteeringSafetyTest(PandaSafetyTestBase):
|
|||
t = int(t * self.DEG_TO_CAN)
|
||||
self.safety.set_desired_angle_last(t)
|
||||
|
||||
def _angle_meas_msg_array(self, angle):
|
||||
def _reset_angle_measurement(self, angle):
|
||||
for _ in range(6):
|
||||
self._rx(self._angle_meas_msg(angle))
|
||||
|
||||
|
@ -546,7 +546,7 @@ class AngleSteeringSafetyTest(PandaSafetyTestBase):
|
|||
max_delta_down = np.interp(s, self.ANGLE_DELTA_BP, self.ANGLE_DELTA_VU)
|
||||
|
||||
# first test against false positives
|
||||
self._angle_meas_msg_array(a)
|
||||
self._reset_angle_measurement(a)
|
||||
self._rx(self._speed_msg(s)) # pylint: disable=no-member
|
||||
|
||||
self._set_prev_desired_angle(a)
|
||||
|
@ -591,7 +591,7 @@ class AngleSteeringSafetyTest(PandaSafetyTestBase):
|
|||
|
||||
for steer_control_enabled in (True, False):
|
||||
for angle_meas in np.arange(-90, 91, 10):
|
||||
self._angle_meas_msg_array(angle_meas)
|
||||
self._reset_angle_measurement(angle_meas)
|
||||
|
||||
for angle_cmd in np.arange(-90, 91, 10):
|
||||
self._set_prev_desired_angle(angle_cmd)
|
||||
|
|
|
@ -92,7 +92,7 @@ class TestFordSafety(common.PandaSafetyTest):
|
|||
self.safety.set_safety_hooks(Panda.SAFETY_FORD, 0)
|
||||
self.safety.init_tests()
|
||||
|
||||
def _reset_curvature_measurements(self, curvature, speed):
|
||||
def _reset_curvature_measurement(self, curvature, speed):
|
||||
self._rx(self._speed_msg(speed))
|
||||
for _ in range(6):
|
||||
self._rx(self._yaw_rate_msg(curvature, speed))
|
||||
|
@ -244,7 +244,7 @@ class TestFordSafety(common.PandaSafetyTest):
|
|||
for steer_control_enabled in (True, False):
|
||||
for speed in np.linspace(0, 50, 11):
|
||||
for initial_curvature in np.linspace(-self.MAX_CURVATURE, self.MAX_CURVATURE, 21):
|
||||
self._reset_curvature_measurements(initial_curvature, speed)
|
||||
self._reset_curvature_measurement(initial_curvature, speed)
|
||||
|
||||
limit_command = speed > self.CURVATURE_DELTA_LIMIT_SPEED
|
||||
for new_curvature in np.linspace(-self.MAX_CURVATURE, self.MAX_CURVATURE, 41):
|
||||
|
|
Loading…
Reference in New Issue