mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-10-01 03:53:45 +08:00
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: 1ac89f14aa
This commit is contained in:
+5
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user