mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-03 08:41:32 +08:00
f
This commit is contained in:
Binary file not shown.
@@ -390,6 +390,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
|
||||
{"OneLaneChange", {PERSISTENT, BOOL, "1", "0", 2}},
|
||||
{"OnroadDistanceButton", {PERSISTENT, BOOL, "0", "0", 0}},
|
||||
{"OnroadDistanceButtonPressed", {CLEAR_ON_MANAGER_START, BOOL, "0", "0"}},
|
||||
{"WheelButtonBookmarkCounter", {CLEAR_ON_MANAGER_START, INT, "0", "0"}},
|
||||
{"openpilotMinutes", {PERSISTENT, INT, "0", "0", 0}},
|
||||
{"OverpassRequests", {PERSISTENT, JSON, "{}", "{}"}},
|
||||
{"PathColor", {PERSISTENT, STRING, "", "", 2}},
|
||||
|
||||
Binary file not shown.
@@ -395,14 +395,15 @@ class CarState(CarStateBase):
|
||||
if CP.enableBsm:
|
||||
pt_messages.append(("BCMBlindSpotMonitor", 10))
|
||||
|
||||
if CP.flags & GMFlags.NO_ACCELERATOR_POS_MSG.value:
|
||||
if ("ECMAcceleratorPos", 80) in pt_messages:
|
||||
pt_messages.remove(("ECMAcceleratorPos", 80))
|
||||
pt_messages.append(("EBCMBrakePedalPosition", 100))
|
||||
|
||||
if CP.networkLocation == NetworkLocation.fwdCamera:
|
||||
pt_messages += [
|
||||
("ASCMLKASteeringCmd", 0),
|
||||
]
|
||||
if CP.flags & GMFlags.NO_ACCELERATOR_POS_MSG.value:
|
||||
if ("ECMAcceleratorPos", 80) in pt_messages:
|
||||
pt_messages.remove(("ECMAcceleratorPos", 80))
|
||||
pt_messages.append(("EBCMBrakePedalPosition", 100))
|
||||
|
||||
if CP.transmissionType == TransmissionType.direct:
|
||||
regen_paddle_rate = 50 if CP.carFingerprint in kaofui_state_cars else 40
|
||||
|
||||
@@ -94,6 +94,20 @@ class TestGMInterface:
|
||||
assert car_params.flags & GMFlags.NO_CAMERA.value
|
||||
assert car_params.safetyConfigs[0].safetyParam & GMSafetyFlags.FLAG_GM_NO_CAMERA.value
|
||||
|
||||
def test_volt_gateway_without_accel_pos_uses_brake_pedal_message(self):
|
||||
CarInterface = interfaces[CAR.CHEVROLET_VOLT]
|
||||
fingerprint = _empty_fingerprint()
|
||||
fingerprint[0][0xF1] = 6
|
||||
|
||||
car_params = CarInterface.get_params(CAR.CHEVROLET_VOLT, fingerprint, [], alpha_long=False, is_release=False, docs=False,
|
||||
starpilot_toggles=_test_starpilot_toggles())
|
||||
|
||||
assert car_params.flags & GMFlags.NO_ACCELERATOR_POS_MSG.value
|
||||
|
||||
pt_parser = CarInterface.CarState.get_can_parsers(car_params)[Bus.pt]
|
||||
assert "ECMAcceleratorPos" not in pt_parser.vl
|
||||
assert "EBCMBrakePedalPosition" in pt_parser.vl
|
||||
|
||||
|
||||
class TestGMCarController:
|
||||
def test_dash_speed_spoof_respects_live_stock_acc_toggles(self):
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
||||
extern const uint8_t gitversion[19];
|
||||
const uint8_t gitversion[19] = "DEV-1c85fed7-DEBUG";
|
||||
const uint8_t gitversion[19] = "DEV-41023b71-DEBUG";
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
DEV-1c85fed7-DEBUG
|
||||
DEV-41023b71-DEBUG
|
||||
Binary file not shown.
@@ -11,16 +11,18 @@ ButtonType = car.CarState.ButtonEvent.Type
|
||||
|
||||
def main():
|
||||
params = Params()
|
||||
params_memory = Params(memory=True)
|
||||
pm = messaging.PubMaster(['userBookmark', 'audioFeedback'])
|
||||
sm = messaging.SubMaster(['rawAudioData', 'bookmarkButton', 'carState'])
|
||||
should_record_audio = False
|
||||
block_num = 0
|
||||
waiting_for_release = False
|
||||
early_stop_triggered = False
|
||||
last_wheel_bookmark_counter = params_memory.get_int("WheelButtonBookmarkCounter")
|
||||
|
||||
while True:
|
||||
sm.update()
|
||||
should_send_bookmark = False
|
||||
bookmark_requests = 0
|
||||
|
||||
# TODO: https://github.com/commaai/openpilot/issues/36015
|
||||
if False and sm.updated['carState'] and sm['carState'].canValid:
|
||||
@@ -35,7 +37,7 @@ def main():
|
||||
early_stop_triggered = False
|
||||
cloudlog.info("LKAS button pressed - starting 10-second audio feedback")
|
||||
else:
|
||||
should_send_bookmark = True # immediately send bookmark if toggle false
|
||||
bookmark_requests += 1 # immediately send bookmark if toggle false
|
||||
cloudlog.info("LKAS button pressed - bookmarking")
|
||||
elif should_record_audio and not waiting_for_release: # Wait for release of second press to stop recording early
|
||||
waiting_for_release = True
|
||||
@@ -52,7 +54,7 @@ def main():
|
||||
msg.audioFeedback.blockNum = block_num
|
||||
block_num += 1
|
||||
if (block_num * SAMPLE_BUFFER / SAMPLE_RATE) >= FEEDBACK_MAX_DURATION or early_stop_triggered: # Check for timeout or early stop
|
||||
should_send_bookmark = True # send bookmark at end of audio segment
|
||||
bookmark_requests += 1 # send bookmark at end of audio segment
|
||||
should_record_audio = False
|
||||
early_stop_triggered = False
|
||||
cloudlog.info("10-second recording completed or second button press - stopping audio feedback")
|
||||
@@ -60,9 +62,15 @@ def main():
|
||||
|
||||
if sm.updated['bookmarkButton']:
|
||||
cloudlog.info("Bookmark button pressed!")
|
||||
should_send_bookmark = True
|
||||
bookmark_requests += 1
|
||||
|
||||
if should_send_bookmark:
|
||||
wheel_bookmark_counter = params_memory.get_int("WheelButtonBookmarkCounter")
|
||||
if wheel_bookmark_counter > last_wheel_bookmark_counter:
|
||||
bookmark_requests += wheel_bookmark_counter - last_wheel_bookmark_counter
|
||||
last_wheel_bookmark_counter = wheel_bookmark_counter
|
||||
cloudlog.info("Wheel button bookmark requested!")
|
||||
|
||||
for _ in range(bookmark_requests):
|
||||
msg = messaging.new_message('userBookmark', valid=True)
|
||||
pm.send('userBookmark', msg)
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,6 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
import cereal.messaging as messaging
|
||||
|
||||
from opendbc.safety import ALTERNATIVE_EXPERIENCE
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.selfdrive.car.cruise import CRUISE_LONG_PRESS, ButtonType
|
||||
@@ -20,7 +18,6 @@ class StarPilotCard:
|
||||
|
||||
self.params = Params(return_defaults=True)
|
||||
self.params_memory = Params(memory=True)
|
||||
self.pm = messaging.PubMaster(["userBookmark"])
|
||||
|
||||
self.accel_pressed = False
|
||||
self.always_on_lateral_allowed = False
|
||||
@@ -66,8 +63,8 @@ class StarPilotCard:
|
||||
self.traffic_mode_enabled = not self.traffic_mode_enabled
|
||||
|
||||
def handle_bookmark(self):
|
||||
msg = messaging.new_message("userBookmark", valid=True)
|
||||
self.pm.send("userBookmark", msg)
|
||||
counter = self.params_memory.get_int("WheelButtonBookmarkCounter")
|
||||
self.params_memory.put_int("WheelButtonBookmarkCounter", counter + 1)
|
||||
|
||||
def handle_experimental_mode(self, sm, starpilot_toggles):
|
||||
if getattr(starpilot_toggles, "safe_mode", False):
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user