4
4
from selfdrive .boardd .boardd import can_list_to_can_capnp
5
5
from selfdrive .car import apply_std_steer_torque_limits
6
6
from selfdrive .car .gm import gmcan
7
- from selfdrive .car .gm .values import CAR , DBC , AccState
7
+ from selfdrive .car .gm .values import CAR , DBC
8
8
from selfdrive .can .packer import CANPacker
9
9
10
10
@@ -29,11 +29,11 @@ def __init__(self, car_fingerprint):
29
29
self .ADAS_KEEPALIVE_STEP = 10
30
30
# pedal lookups, only for Volt
31
31
MAX_GAS = 3072 # Only a safety limit
32
- self . ZERO_GAS = 2048
32
+ ZERO_GAS = 2048
33
33
MAX_BRAKE = 350 # Should be around 3.5m/s^2, including regen
34
34
self .MAX_ACC_REGEN = 1404 # ACC Regen braking is slightly less powerful than max regen paddle
35
35
self .GAS_LOOKUP_BP = [- 0.25 , 0. , 0.5 ]
36
- self .GAS_LOOKUP_V = [self .MAX_ACC_REGEN , self . ZERO_GAS , MAX_GAS ]
36
+ self .GAS_LOOKUP_V = [self .MAX_ACC_REGEN , ZERO_GAS , MAX_GAS ]
37
37
self .BRAKE_LOOKUP_BP = [- 1. , - 0.25 ]
38
38
self .BRAKE_LOOKUP_V = [MAX_BRAKE , 0 ]
39
39
@@ -83,6 +83,7 @@ def update(self, sendcan, enabled, CS, frame, actuators, \
83
83
return
84
84
85
85
P = self .params
86
+
86
87
# Send CAN commands.
87
88
can_sends = []
88
89
canbus = self .canbus
@@ -130,18 +131,12 @@ def update(self, sendcan, enabled, CS, frame, actuators, \
130
131
if (frame % 4 ) == 0 :
131
132
idx = (frame / 4 ) % 4
132
133
133
- car_stopping = apply_gas < P .ZERO_GAS
134
- standstill = CS .pcm_acc_status == AccState .STANDSTILL
135
- at_full_stop = enabled and standstill and car_stopping
136
- near_stop = enabled and (CS .v_ego < P .NEAR_STOP_BRAKE_PHASE ) and car_stopping
134
+ at_full_stop = enabled and CS .standstill
135
+ near_stop = enabled and (CS .v_ego < P .NEAR_STOP_BRAKE_PHASE )
137
136
can_sends .append (gmcan .create_friction_brake_command (self .packer_ch , canbus .chassis , apply_brake , idx , near_stop , at_full_stop ))
138
137
139
- # Auto-resume from full stop by resetting ACC control
140
- acc_enabled = enabled
141
- if standstill and not car_stopping :
142
- acc_enabled = False
143
-
144
- can_sends .append (gmcan .create_gas_regen_command (self .packer_pt , canbus .powertrain , apply_gas , idx , acc_enabled , at_full_stop ))
138
+ at_full_stop = enabled and CS .standstill
139
+ can_sends .append (gmcan .create_gas_regen_command (self .packer_pt , canbus .powertrain , apply_gas , idx , enabled , at_full_stop ))
145
140
146
141
# Send dashboard UI commands (ACC status), 25hz
147
142
if (frame % 4 ) == 0 :
0 commit comments