Merge remote-tracking branch 'upstream/master' into person-changing

pull/31792/head
Shane Smiskol 1 year ago
commit 6af3f79bf4
  1. 2
      cereal
  2. 2
      selfdrive/car/ford/carcontroller.py
  3. 5
      selfdrive/car/gm/carstate.py
  4. 8
      selfdrive/car/gm/interface.py
  5. 2
      selfdrive/ui/ui.py
  6. 7
      system/qcomgpsd/cgpsd.py

@ -1 +1 @@
Subproject commit cf7bb3e74974879abef94286fab4d39398fe402b
Subproject commit 93d3df3210a8c4f4c7e6f45950f73dc8a2f09a2c

@ -73,7 +73,7 @@ class CarController(CarControllerBase):
if self.CP.flags & FordFlags.CANFD:
# TODO: extended mode
mode = 1 if CC.latActive else 0
counter = (self.frame // CarControllerParams.STEER_STEP) % 0xF
counter = (self.frame // CarControllerParams.STEER_STEP) % 0x10
can_sends.append(fordcan.create_lat_ctl2_msg(self.packer, self.CAN, mode, 0., 0., -apply_curvature, 0., counter))
else:
can_sends.append(fordcan.create_lat_ctl_msg(self.packer, self.CAN, CC.latActive, 0., 0., -apply_curvature, 0.))

@ -26,11 +26,16 @@ class CarState(CarStateBase):
self.cam_lka_steering_cmd_counter = 0
self.buttons_counter = 0
self.prev_distance_button = 0
self.distance_button = 0
def update(self, pt_cp, cam_cp, loopback_cp):
ret = car.CarState.new_message()
self.prev_cruise_buttons = self.cruise_buttons
self.prev_distance_button = self.distance_button
self.cruise_buttons = pt_cp.vl["ASCMSteeringButton"]["ACCButtons"]
self.distance_button = pt_cp.vl["ASCMSteeringButton"]["DistanceButton"]
self.buttons_counter = pt_cp.vl["ASCMSteeringButton"]["RollingCounter"]
self.pscm_status = copy.copy(pt_cp.vl["PSCMStatus"])
# This is to avoid a fault where you engage while still moving backwards after shifting to D.

@ -208,8 +208,12 @@ class CarInterface(CarInterfaceBase):
# Don't add event if transitioning from INIT, unless it's to an actual button
if self.CS.cruise_buttons != CruiseButtons.UNPRESS or self.CS.prev_cruise_buttons != CruiseButtons.INIT:
ret.buttonEvents = create_button_events(self.CS.cruise_buttons, self.CS.prev_cruise_buttons, BUTTONS_DICT,
unpressed_btn=CruiseButtons.UNPRESS)
ret.buttonEvents = [
*create_button_events(self.CS.cruise_buttons, self.CS.prev_cruise_buttons, BUTTONS_DICT,
unpressed_btn=CruiseButtons.UNPRESS),
*create_button_events(self.CS.distance_button, self.CS.prev_distance_button,
{1: ButtonType.gapAdjustCruise})
]
# The ECM allows enabling on falling edge of set, but only rising edge of resume
events = self.create_common_events(ret, extra_gears=[GearShifter.sport, GearShifter.low,

@ -52,7 +52,7 @@ if __name__ == "__main__":
onroad = sm.all_checks(['deviceState']) and sm['deviceState'].started
if onroad:
cs = sm['controlsState']
color = ("grey" if str(cs.status) in ("overriding", "preEnabled") else "green") if cs.enabled else "blue"
color = ("grey" if str(cs.state) in ("overriding", "preEnabled") else "green") if cs.enabled else "blue"
bg.setText("\U0001F44D" if cs.engageable else "\U0001F6D1")
bg.setStyleSheet(f"font-size: 100px; background-color: {color};")
bg.show()

@ -57,6 +57,10 @@ def main():
# TODO: read from streaming AT port instead of polling
out = at_cmd("AT+CGPS?")
if '+CGPS: 1' not in out:
for c in cmds:
at_cmd(c)
sentences = out.split("'")[1].splitlines()
new = {l.split(',')[0]: l.split(',') for l in sentences if l.startswith('$G')}
nmea.update(new)
@ -85,8 +89,7 @@ def main():
gps.hasFix = gnrmc[1] == 'A'
# TODO: make our own source
gps.source = log.GpsLocationData.SensorSource.qcomdiag
gps.source = log.GpsLocationData.SensorSource.unicore
gps.speed = sfloat(gnrmc[7])
gps.bearingDeg = sfloat(gnrmc[8])

Loading…
Cancel
Save