mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-10-01 03:43:51 +08:00
remove old model packet (#19769)
* remove publisher
* move to V2
* radard new model
* fix plant
* change packety
* need hack here too
* change to new
* this has been wrong all along
* no more model msg
* subscribe to new model
* not needed anymore
* make work
* need to ignore that too
* should pass tests, needs car test
* fix process replay
* no more poly
* update refs
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 124100d0fa
This commit is contained in:
@@ -8,7 +8,7 @@ import numpy as np
|
||||
|
||||
from opendbc import DBC_PATH
|
||||
|
||||
from cereal import car
|
||||
from cereal import car, log
|
||||
from common.realtime import Ratekeeper
|
||||
from selfdrive.config import Conversions as CV
|
||||
import cereal.messaging as messaging
|
||||
@@ -111,10 +111,10 @@ class Plant():
|
||||
|
||||
if not Plant.messaging_initialized:
|
||||
|
||||
Plant.pm = messaging.PubMaster(['frame', 'frontFrame', 'ubloxRaw', 'modelV2'])
|
||||
Plant.pm = messaging.PubMaster(['frame', 'frontFrame', 'ubloxRaw'])
|
||||
Plant.logcan = messaging.pub_sock('can')
|
||||
Plant.sendcan = messaging.sub_sock('sendcan')
|
||||
Plant.model = messaging.pub_sock('model')
|
||||
Plant.model = messaging.pub_sock('modelV2')
|
||||
Plant.live_params = messaging.pub_sock('liveParameters')
|
||||
Plant.live_location_kalman = messaging.pub_sock('liveLocationKalman')
|
||||
Plant.health = messaging.pub_sock('health')
|
||||
@@ -392,13 +392,9 @@ class Plant():
|
||||
# ******** publish a fake model going straight and fake calibration ********
|
||||
# note that this is worst case for MPC, since model will delay long mpc by one time step
|
||||
if publish_model and self.frame % 5 == 0:
|
||||
md = messaging.new_message('model')
|
||||
md = messaging.new_message('modelV2')
|
||||
cal = messaging.new_message('liveCalibration')
|
||||
md.model.frameId = 0
|
||||
for x in [md.model.path, md.model.leftLane, md.model.rightLane]:
|
||||
x.points = [0.0]*50
|
||||
x.prob = 1.0
|
||||
x.std = 1.0
|
||||
md.modelV2.frameId = 0
|
||||
|
||||
if self.lead_relevancy:
|
||||
d_rel = np.maximum(0., distance_lead - distance)
|
||||
@@ -409,15 +405,11 @@ class Plant():
|
||||
v_rel = 0.
|
||||
prob = 0.0
|
||||
|
||||
md.model.lead.dist = float(d_rel)
|
||||
md.model.lead.prob = prob
|
||||
md.model.lead.relY = 0.0
|
||||
md.model.lead.relYStd = 1.
|
||||
md.model.lead.relVel = float(v_rel)
|
||||
md.model.lead.relVelStd = 1.
|
||||
md.model.lead.relA = 0.0
|
||||
md.model.lead.relAStd = 10.
|
||||
md.model.lead.std = 1.0
|
||||
lead = log.ModelDataV2.LeadDataV2.new_message()
|
||||
lead.xyva = [float(d_rel), 0.0, float(v_rel), 0.0]
|
||||
lead.xyvaStd = [1.0, 1.0, 1.0, 1.0]
|
||||
lead.prob = prob
|
||||
md.modelV2.leads = [lead, lead]
|
||||
|
||||
cal.liveCalibration.calStatus = 1
|
||||
cal.liveCalibration.calPerc = 100
|
||||
|
||||
@@ -35,7 +35,7 @@ def camera_replay(lr, fr, desire=None, calib=None):
|
||||
spinner.update("starting model replay")
|
||||
|
||||
pm = messaging.PubMaster(['frame', 'liveCalibration', 'pathPlan'])
|
||||
sm = messaging.SubMaster(['model', 'modelV2'])
|
||||
sm = messaging.SubMaster(['modelV2'])
|
||||
|
||||
# TODO: add dmonitoringmodeld
|
||||
print("preparing procs")
|
||||
@@ -74,7 +74,6 @@ def camera_replay(lr, fr, desire=None, calib=None):
|
||||
|
||||
pm.send(msg.which(), f)
|
||||
with Timeout(seconds=15):
|
||||
log_msgs.append(messaging.recv_one(sm.sock['model']))
|
||||
log_msgs.append(messaging.recv_one(sm.sock['modelV2']))
|
||||
|
||||
spinner.update("modeld replay %d/%d" % (frame_idx, fr.frame_count))
|
||||
@@ -109,8 +108,9 @@ if __name__ == "__main__":
|
||||
log_fn = "%s_%s_%s.bz2" % (TEST_ROUTE, "model", ref_commit)
|
||||
cmp_log = LogReader(BASE_URL + log_fn)
|
||||
|
||||
ignore = ['logMonoTime', 'valid', 'model.frameDropPerc', 'model.modelExecutionTime',
|
||||
'modelV2.frameDropPerc', 'modelV2.modelExecutionTime']
|
||||
ignore = ['logMonoTime', 'valid',
|
||||
'modelV2.frameDropPerc',
|
||||
'modelV2.modelExecutionTime']
|
||||
results: Any = {TEST_ROUTE: {}}
|
||||
results[TEST_ROUTE]["modeld"] = compare_logs(cmp_log, log_msgs, ignore_fields=ignore)
|
||||
diff1, diff2, failed = format_diff(results, ref_commit)
|
||||
|
||||
@@ -222,7 +222,7 @@ CONFIGS = [
|
||||
pub_sub={
|
||||
"can": ["controlsState", "carState", "carControl", "sendcan", "carEvents", "carParams"],
|
||||
"thermal": [], "health": [], "liveCalibration": [], "dMonitoringState": [], "plan": [], "pathPlan": [], "gpsLocation": [], "liveLocationKalman": [],
|
||||
"model": [], "frontFrame": [], "frame": [], "ubloxRaw": [],
|
||||
"modelV2": [], "frontFrame": [], "frame": [], "ubloxRaw": [],
|
||||
},
|
||||
ignore=["logMonoTime", "valid", "controlsState.startMonoTime", "controlsState.cumLagMs"],
|
||||
init_callback=fingerprint,
|
||||
@@ -233,7 +233,7 @@ CONFIGS = [
|
||||
proc_name="radard",
|
||||
pub_sub={
|
||||
"can": ["radarState", "liveTracks"],
|
||||
"liveParameters": [], "controlsState": [], "model": [],
|
||||
"liveParameters": [], "controlsState": [], "modelV2": [],
|
||||
},
|
||||
ignore=["logMonoTime", "valid", "radarState.cumLagMs"],
|
||||
init_callback=get_car_params,
|
||||
@@ -266,7 +266,7 @@ CONFIGS = [
|
||||
proc_name="dmonitoringd",
|
||||
pub_sub={
|
||||
"driverState": ["dMonitoringState"],
|
||||
"liveCalibration": [], "carState": [], "model": [], "controlsState": [],
|
||||
"liveCalibration": [], "carState": [], "modelV2": [], "controlsState": [],
|
||||
},
|
||||
ignore=["logMonoTime", "valid"],
|
||||
init_callback=get_car_params,
|
||||
|
||||
@@ -1 +1 @@
|
||||
3686b117b61bfe6ad49bdef435b9112869bbf7e0
|
||||
0b75e9c24662151100e77057ff7d1ffcf55d841a
|
||||
@@ -158,9 +158,6 @@ if __name__ == "__main__":
|
||||
if (procs_whitelisted and cfg.proc_name not in args.whitelist_procs) or \
|
||||
(not procs_whitelisted and cfg.proc_name in args.blacklist_procs):
|
||||
continue
|
||||
# TODO remove this hack
|
||||
if cfg.proc_name == 'plannerd' and car_brand in ["GM", "SUBARU", "VOLKSWAGEN", "NISSAN"]:
|
||||
continue
|
||||
|
||||
cmp_log_fn = os.path.join(process_replay_dir, "%s_%s_%s.bz2" % (segment, cfg.proc_name, ref_commit))
|
||||
results[segment][cfg.proc_name] = test_process(cfg, lr, cmp_log_fn, args.ignore_fields, args.ignore_msgs)
|
||||
|
||||
Reference in New Issue
Block a user