Change car controller interface from gas/brake to acceleration (#21911)

* retune civic

* seems smooth

* back to normal

* new ref

* fix conflict

* runs

* rm

* accel scale is 4

* toyota should be good

* more cleanup

* fixup

* better naming

* update ref

* deprecated

* sending brake when not enable causes a fault

* rm gas and brake

* unused

* update ref

* acura logic is no more

* wrong before

* revert tuning cleanup

* adress comments

* update ref

* already on master

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 1ac89f14aa7c45c56049e8dbb0d6c5bb83a0fc6b
This commit is contained in:
HaraldSchafer
2021-08-30 18:32:52 +02:00
committed by GitHub
parent aef4c52559
commit a73a820338
22 changed files with 103 additions and 181 deletions
+5 -3
View File
@@ -11,6 +11,7 @@ from typing import Any
import cereal.messaging as messaging
from common.params import Params
from common.numpy_fast import clip
from common.realtime import Ratekeeper, DT_DMON
from lib.can import can_function
from selfdrive.car.honda.values import CruiseButtons
@@ -295,9 +296,10 @@ def bridge(q):
if is_openpilot_engaged:
sm.update(0)
throttle_op = sm['carControl'].actuators.gas #[0,1]
brake_op = sm['carControl'].actuators.brake #[0,1]
steer_op = sm['carControl'].actuators.steeringAngleDeg
# TODO gas and brake is deprecated
throttle_op = clip(sm['carControl'].actuators.accel/4.0, 0.0, 1.0)
brake_op = clip(-sm['carControl'].actuators.accel/4.0, 0.0, 1.0)
steer_op = sm['carControl'].actuators.steeringAngleDeg
throttle_out = throttle_op
steer_out = steer_op