mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 19:23:56 +08:00
* dd9a502d-c8e2-4831-b365-804b0ae0739d/600 80041070-d276-4fed-bdb9-0075e5442908/420
* no elementwise op
* 9dabf0fe-2e60-44bf-8d3a-d20a74aca072/600 ae746590-0bb5-4a16-80db-15f02d314f03/300 c4663a12-b499-4c9b-90dd-b169e3948cb1/60
* explicit slice
* some copies are useful
* 1456d261-d232-4654-8885-4d9fde883894/440 c06eba55-1931-4e00-9d63-acad00161be0/700 af2eb6ba-1935-4318-aaf8-868db81a4932/425
* 154f663e-d3e9-4020-ad49-0e640588ebbe/399 badb5e69-504f-4544-a99e-ba75ed204b74/800 08330327-7663-4874-af7a-dcbd2c994ba7/800
* set steer rate cost to 1.0
* smaller temporal size
* Update model reg
* update model ref again
* This did upload somehow
* Update steer rate cost
Co-authored-by: Yassine Yousfi <yyousfi1@binghamton.edu>
old-commit-hash: 9283040d84
50 lines
1.4 KiB
Python
Executable File
50 lines
1.4 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
from cereal import car
|
|
from common.params import Params
|
|
from common.realtime import Priority, config_realtime_process
|
|
from system.swaglog import cloudlog
|
|
from selfdrive.controls.lib.longitudinal_planner import Planner
|
|
from selfdrive.controls.lib.lateral_planner import LateralPlanner
|
|
import cereal.messaging as messaging
|
|
|
|
|
|
def plannerd_thread(sm=None, pm=None):
|
|
config_realtime_process(5, Priority.CTRL_LOW)
|
|
|
|
cloudlog.info("plannerd is waiting for CarParams")
|
|
params = Params()
|
|
CP = car.CarParams.from_bytes(params.get("CarParams", block=True))
|
|
cloudlog.info("plannerd got CarParams: %s", CP.carName)
|
|
|
|
use_lanelines = False
|
|
wide_camera = params.get_bool('WideCameraOnly')
|
|
|
|
cloudlog.event("e2e mode", on=use_lanelines)
|
|
|
|
longitudinal_planner = Planner(CP)
|
|
lateral_planner = LateralPlanner(use_lanelines=use_lanelines, wide_camera=wide_camera)
|
|
|
|
if sm is None:
|
|
sm = messaging.SubMaster(['carState', 'controlsState', 'radarState', 'modelV2'],
|
|
poll=['radarState', 'modelV2'], ignore_avg_freq=['radarState'])
|
|
|
|
if pm is None:
|
|
pm = messaging.PubMaster(['longitudinalPlan', 'lateralPlan'])
|
|
|
|
while True:
|
|
sm.update()
|
|
|
|
if sm.updated['modelV2']:
|
|
lateral_planner.update(sm)
|
|
lateral_planner.publish(sm, pm)
|
|
longitudinal_planner.update(sm)
|
|
longitudinal_planner.publish(sm, pm)
|
|
|
|
|
|
def main(sm=None, pm=None):
|
|
plannerd_thread(sm, pm)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|