mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-08-21 08:03:42 +08:00
Reduce paramsd and calibrationd CPU usage (#2119)
* reduce paramsd cpu * reduce calibrationd cpu usage * calibration_helpers was mostly unused * more calibration cleanup * update refs * fix thresholds in CPU test
This commit is contained in:
@@ -201,16 +201,10 @@ def calibration_rcv_callback(msg, CP, cfg, fsm):
|
||||
# calibrationd publishes 1 calibrationData every 5 cameraOdometry packets.
|
||||
# should_recv always true to increment frame
|
||||
recv_socks = []
|
||||
if msg.which() == 'carState' and ((fsm.frame + 1) % 25) == 0:
|
||||
frame = fsm.frame + 1 # incrementing hasn't happened yet in SubMaster
|
||||
if frame == 0 or (msg.which() == 'cameraOdometry' and (frame % 5) == 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'
|
||||
|
||||
return recv_socks, fsm.frame == 0 or msg.which() == 'cameraOdometry'
|
||||
|
||||
CONFIGS = [
|
||||
ProcessConfig(
|
||||
@@ -283,12 +277,12 @@ CONFIGS = [
|
||||
ProcessConfig(
|
||||
proc_name="paramsd",
|
||||
pub_sub={
|
||||
"carState": ["liveParameters"],
|
||||
"liveLocationKalman": []
|
||||
"liveLocationKalman": ["liveParameters"],
|
||||
"carState": []
|
||||
},
|
||||
ignore=["logMonoTime", "valid"],
|
||||
init_callback=get_car_params,
|
||||
should_recv_callback=paramsd_rcv_callback,
|
||||
should_recv_callback=None,
|
||||
tolerance=NUMPY_TOLERANCE,
|
||||
),
|
||||
]
|
||||
|
||||
@@ -1 +1 @@
|
||||
b47257005e7408737c66463c45f5db36153a849d
|
||||
5c2c99c4572d68f17ffa3a33acf8e4e205ca94c2
|
||||
Reference in New Issue
Block a user