Files
sunnypilot/selfdrive/debug/set_car_params.py
Shane Smiskol abad7649d6 Rename experimental long (#35011)
* now alpha long

* fix

* rename param

* thought i did this

* debug

* debug

* more

* more

* moar

* Revert "moar"

This reverts commit e347106246583982e1be206485ad4d8eb944f817.

* Revert "more"

This reverts commit 0746e6d2e400ce1715614c62af84a9680c4d65c1.

* Revert "more"

This reverts commit 0db5a8792c01bb2d687f9152e6ba37fb76d4a453.

* Revert "debug"

This reverts commit 72f235b13727980e4331ff487998ddc7c7f7fb63.

* Revert "debug"

This reverts commit 7871b69f8c1bdffed386c2baac99542fcc50f7eb.
2025-04-14 17:17:59 -07:00

23 lines
662 B
Python
Executable File

#!/usr/bin/env python3
import sys
from cereal import car
from openpilot.common.params import Params
from openpilot.tools.lib.route import Route
from openpilot.tools.lib.logreader import LogReader
if __name__ == "__main__":
CP = None
if len(sys.argv) > 1:
r = Route(sys.argv[1])
cps = [m for m in LogReader(r.qlog_paths()[0]) if m.which() == 'carParams']
CP = cps[0].carParams.as_builder()
else:
CP = car.CarParams.new_message()
CP.openpilotLongitudinalControl = True
CP.alphaLongitudinalAvailable = False
cp_bytes = CP.to_bytes()
for p in ("CarParams", "CarParamsCache", "CarParamsPersistent"):
Params().put(p, cp_bytes)