mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
paramsd process replay test (#2118)
* paramsd process replay test * cleanup old-commit-hash: 1e5a935ff00916efe65046f50d46a77d091c2e29
This commit is contained in:
@@ -19,6 +19,9 @@ from common.params import Params
|
|||||||
from cereal.services import service_list
|
from cereal.services import service_list
|
||||||
from collections import namedtuple
|
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'])
|
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):
|
def calibration_rcv_callback(msg, CP, cfg, fsm):
|
||||||
# calibrationd publishes 1 calibrationData every 5 cameraOdometry packets.
|
# calibrationd publishes 1 calibrationData every 5 cameraOdometry packets.
|
||||||
# should_recv always true to increment frame
|
# should_recv always true to increment frame
|
||||||
if msg.which() == 'carState':
|
recv_socks = []
|
||||||
if ((fsm.frame + 1) % 25) == 0:
|
if msg.which() == 'carState' and ((fsm.frame + 1) % 25) == 0:
|
||||||
recv_socks = ["liveCalibration"]
|
recv_socks = ["liveCalibration"]
|
||||||
else:
|
return recv_socks, msg.which() == 'carState'
|
||||||
recv_socks = []
|
|
||||||
return recv_socks, True
|
def paramsd_rcv_callback(msg, CP, cfg, fsm):
|
||||||
else:
|
recv_socks = []
|
||||||
return [], False
|
if msg.which() == 'carState' and ((fsm.frame + 2) % 5) == 0:
|
||||||
|
recv_socks = ["liveParameters"]
|
||||||
|
return recv_socks, msg.which() == 'carState'
|
||||||
|
|
||||||
|
|
||||||
CONFIGS = [
|
CONFIGS = [
|
||||||
@@ -262,7 +267,7 @@ CONFIGS = [
|
|||||||
ignore=["logMonoTime", "valid"],
|
ignore=["logMonoTime", "valid"],
|
||||||
init_callback=get_car_params,
|
init_callback=get_car_params,
|
||||||
should_recv_callback=None,
|
should_recv_callback=None,
|
||||||
tolerance=1e-7,
|
tolerance=NUMPY_TOLERANCE,
|
||||||
),
|
),
|
||||||
ProcessConfig(
|
ProcessConfig(
|
||||||
proc_name="locationd",
|
proc_name="locationd",
|
||||||
@@ -273,9 +278,19 @@ CONFIGS = [
|
|||||||
ignore=["logMonoTime", "valid"],
|
ignore=["logMonoTime", "valid"],
|
||||||
init_callback=get_car_params,
|
init_callback=get_car_params,
|
||||||
should_recv_callback=None,
|
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):
|
def replay_process(cfg, lr):
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
158743f002e82b62a67c6b91308db01d715f1643
|
eac7f0ebb37c2a8a0cf70d3d25d32ecd160d6cac
|
||||||
@@ -6,8 +6,7 @@ from typing import Any
|
|||||||
|
|
||||||
from selfdrive.car.car_helpers import interface_names
|
from selfdrive.car.car_helpers import interface_names
|
||||||
from selfdrive.test.process_replay.compare_logs import compare_logs
|
from selfdrive.test.process_replay.compare_logs import compare_logs
|
||||||
from selfdrive.test.process_replay.process_replay import (CONFIGS,
|
from selfdrive.test.process_replay.process_replay import CONFIGS, replay_process
|
||||||
replay_process)
|
|
||||||
from tools.lib.logreader import LogReader
|
from tools.lib.logreader import LogReader
|
||||||
|
|
||||||
INJECT_MODEL = 0
|
INJECT_MODEL = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user