|
|
|
@ -19,6 +19,9 @@ from common.params import Params |
|
|
|
|
from cereal.services import service_list |
|
|
|
|
from collections import namedtuple |
|
|
|
|
|
|
|
|
|
# Numpy gives different results based on CPU features after version 19 |
|
|
|
|
NUMPY_TOLERANCE = 1e-7 |
|
|
|
|
|
|
|
|
|
ProcessConfig = namedtuple('ProcessConfig', ['proc_name', 'pub_sub', 'ignore', 'init_callback', 'should_recv_callback', 'tolerance']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -197,14 +200,16 @@ def radar_rcv_callback(msg, CP, cfg, fsm): |
|
|
|
|
def calibration_rcv_callback(msg, CP, cfg, fsm): |
|
|
|
|
# calibrationd publishes 1 calibrationData every 5 cameraOdometry packets. |
|
|
|
|
# should_recv always true to increment frame |
|
|
|
|
if msg.which() == 'carState': |
|
|
|
|
if ((fsm.frame + 1) % 25) == 0: |
|
|
|
|
recv_socks = ["liveCalibration"] |
|
|
|
|
else: |
|
|
|
|
recv_socks = [] |
|
|
|
|
return recv_socks, True |
|
|
|
|
else: |
|
|
|
|
return [], False |
|
|
|
|
recv_socks = [] |
|
|
|
|
if msg.which() == 'carState' and ((fsm.frame + 1) % 25) == 0: |
|
|
|
|
recv_socks = ["liveCalibration"] |
|
|
|
|
return recv_socks, msg.which() == 'carState' |
|
|
|
|
|
|
|
|
|
def paramsd_rcv_callback(msg, CP, cfg, fsm): |
|
|
|
|
recv_socks = [] |
|
|
|
|
if msg.which() == 'carState' and ((fsm.frame + 2) % 5) == 0: |
|
|
|
|
recv_socks = ["liveParameters"] |
|
|
|
|
return recv_socks, msg.which() == 'carState' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CONFIGS = [ |
|
|
|
@ -262,7 +267,7 @@ CONFIGS = [ |
|
|
|
|
ignore=["logMonoTime", "valid"], |
|
|
|
|
init_callback=get_car_params, |
|
|
|
|
should_recv_callback=None, |
|
|
|
|
tolerance=1e-7, |
|
|
|
|
tolerance=NUMPY_TOLERANCE, |
|
|
|
|
), |
|
|
|
|
ProcessConfig( |
|
|
|
|
proc_name="locationd", |
|
|
|
@ -273,9 +278,19 @@ CONFIGS = [ |
|
|
|
|
ignore=["logMonoTime", "valid"], |
|
|
|
|
init_callback=get_car_params, |
|
|
|
|
should_recv_callback=None, |
|
|
|
|
tolerance=1e-7, # Numpy gives different results based on CPU features after version 19 |
|
|
|
|
tolerance=NUMPY_TOLERANCE, |
|
|
|
|
), |
|
|
|
|
ProcessConfig( |
|
|
|
|
proc_name="paramsd", |
|
|
|
|
pub_sub={ |
|
|
|
|
"carState": ["liveParameters"], |
|
|
|
|
"liveLocationKalman": [] |
|
|
|
|
}, |
|
|
|
|
ignore=["logMonoTime", "valid"], |
|
|
|
|
init_callback=get_car_params, |
|
|
|
|
should_recv_callback=paramsd_rcv_callback, |
|
|
|
|
tolerance=NUMPY_TOLERANCE, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
def replay_process(cfg, lr): |
|
|
|
|