mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-26 00:12:05 +08:00
Merge branch 'devel-en' into devel-zht
This commit is contained in:
@@ -81,7 +81,14 @@ def get_lead(v_ego, ready, clusters, lead_msg, low_speed_override=True):
|
||||
class RadarD():
|
||||
def __init__(self, mocked, delay=0):
|
||||
self.current_time = 0
|
||||
self.mocked = mocked
|
||||
# dragonpilot
|
||||
# add mock radar support to bosch
|
||||
# https://github.com/kegman/openpilot/commit/53c945c5cd6716e3953a9baae1431c9a8d984e83
|
||||
CP = car.CarParams.from_bytes(Params().get("CarParams", block=True))
|
||||
if CP.radarOffCan:
|
||||
self.mocked = True
|
||||
else:
|
||||
self.mocked = mocked
|
||||
|
||||
self.tracks = defaultdict(dict)
|
||||
|
||||
@@ -179,7 +186,11 @@ def radard_thread(sm=None, pm=None, can_sock=None):
|
||||
# wait for stats about the car to come in from controls
|
||||
cloudlog.info("radard is waiting for CarParams")
|
||||
CP = car.CarParams.from_bytes(Params().get("CarParams", block=True))
|
||||
mocked = CP.carName == "mock"
|
||||
# dragonpilot
|
||||
if CP.radarOffCan:
|
||||
mocked = True
|
||||
else:
|
||||
mocked = CP.carName == "mock"
|
||||
cloudlog.info("radard got CarParams")
|
||||
|
||||
# import the radar from the fingerprint
|
||||
@@ -201,7 +212,7 @@ def radard_thread(sm=None, pm=None, can_sock=None):
|
||||
rk = Ratekeeper(1.0 / DT_RDR, print_delay_threshold=None)
|
||||
RD = RadarD(mocked, RI.delay)
|
||||
|
||||
has_radar = not CP.radarOffCan
|
||||
has_radar = True
|
||||
|
||||
while 1:
|
||||
can_strings = messaging.drain_sock_raw(can_sock, wait_for_one=True)
|
||||
|
||||
Reference in New Issue
Block a user