selfdrive.locationd.test package

Submodules

selfdrive.locationd.test.test_calibrationd module

class selfdrive.locationd.test.test_calibrationd.TestCalibrationd(methodName='runTest')[source]

Bases: TestCase

test_calibration_auto_reset()[source]
test_calibration_basics()[source]
test_calibration_low_speed_reject()[source]
test_calibration_speed_std_height_reject()[source]
test_calibration_speed_std_reject()[source]
test_calibration_yaw_rate_reject()[source]
test_read_saved_params()[source]
selfdrive.locationd.test.test_calibrationd.process_messages(c, cam_odo_calib, cycles, cam_odo_speed=7.7056000000000004, carstate_speed=7.7056000000000004, cam_odo_yr=0.0, cam_odo_speed_std=0.001, cam_odo_height_std=0.001)[source]

selfdrive.locationd.test.test_locationd module

class selfdrive.locationd.test.test_locationd.TestLocationdProc(methodName='runTest')[source]

Bases: TestCase

LLD_MSGS = ['gpsLocationExternal', 'cameraOdometry', 'carState', 'liveCalibration', 'accelerometer', 'gyroscope', 'magnetometer']
get_msg(name, t)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

test_params_gps()[source]

selfdrive.locationd.test.test_locationd_scenarios module

class selfdrive.locationd.test.test_locationd_scenarios.Scenario(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

ACCEL_OFF = 'accel_off'
ACCEL_SPIKE_MIDWAY = 'accel_spike_midway'
BASE = 'base'
GPS_OFF = 'gps_off'
GPS_OFF_MIDWAY = 'gps_off_midway'
GPS_ON_MIDWAY = 'gps_on_midway'
GPS_TUNNEL = 'gps_tunnel'
GYRO_OFF = 'gyro_off'
GYRO_SPIKE_MIDWAY = 'gyro_spike_midway'
class selfdrive.locationd.test.test_locationd_scenarios.TestLocationdScenarios(methodName='runTest')[source]

Bases: TestCase

Test locationd with different scenarios. In all these scenarios, we expect the following:
  • locationd kalman filter should never go unstable (we care mostly about yaw_rate, roll, gpsOK, inputsOK, sensorsOK)

  • faulty values should be ignored, with appropriate flags set

pytestmark = [Mark(name='shared_download_cache', args=(), kwargs={}), Mark(name='xdist_group', args=('test_locationd_scenarios',), kwargs={})]
classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

test_accel_off()[source]

Test: no accelerometer message for the entire segment Expected Result:

  • yaw_rate: 0

  • roll: 0

  • sensorsOK: False

test_accel_spikes()[source]

ToDo: Test: an accelerometer spike in the middle of the segment Expected Result: Right now, the kalman filter is not robust to small spikes like it is to gyroscope spikes.

test_base()[source]

Test: unchanged log Expected Result:

  • yaw_rate: unchanged

  • roll: unchanged

test_gps_off()[source]

Test: no GPS message for the entire segment Expected Result:

  • yaw_rate: unchanged

  • roll:

  • gpsOK: False

test_gps_off_midway()[source]

Test: no GPS message for the second half of the segment Expected Result:

  • yaw_rate: unchanged

  • roll:

  • gpsOK: True for the first half, False for the second half

test_gps_on_midway()[source]

Test: no GPS message for the first half of the segment Expected Result:

  • yaw_rate: unchanged

  • roll:

  • gpsOK: False for the first half, True for the second half

test_gps_tunnel()[source]

Test: no GPS message for the middle section of the segment Expected Result:

  • yaw_rate: unchanged

  • roll:

  • gpsOK: False for the middle section, True for the rest

test_gyro_off()[source]

Test: no gyroscope message for the entire segment Expected Result:

  • yaw_rate: 0

  • roll: 0

  • sensorsOK: False

test_gyro_spikes()[source]

Test: a gyroscope spike in the middle of the segment Expected Result:

  • yaw_rate: unchanged

  • roll: unchanged

  • inputsOK: False for some time after the spike, True for the rest

selfdrive.locationd.test.test_locationd_scenarios.get_select_fields_data(logs)[source]
selfdrive.locationd.test.test_locationd_scenarios.run_scenarios(scenario, logs)[source]

Module contents