openpilot v0.5.5 release

pull/402/head
Vehicle Researcher 7 years ago
parent e8ae37e36e
commit 8f3539a27b
  1. 105
      README.md
  2. 6
      RELEASES.md
  3. 9
      cereal/log.capnp
  4. 10
      common/ffi_wrapper.py
  5. 0
      selfdrive/assets/sounds/Icon
  6. BIN
      selfdrive/assets/sounds/hq_disengaged.mp3
  7. BIN
      selfdrive/assets/sounds/hq_engaged.mp3
  8. BIN
      selfdrive/assets/sounds/hq_warning_0.mp3
  9. BIN
      selfdrive/assets/sounds/hq_warning_1.mp3
  10. BIN
      selfdrive/assets/sounds/hq_warning_2.mp3
  11. 3
      selfdrive/car/honda/interface.py
  12. 77
      selfdrive/car/toyota/radar_interface.py
  13. 2
      selfdrive/common/version.h
  14. 1
      selfdrive/controls/controlsd.py
  15. 1021
      selfdrive/controls/lib/alertmanager.py
  16. 11
      selfdrive/controls/lib/lateral_mpc/Makefile
  17. 9
      selfdrive/controls/lib/longitudinal_mpc/Makefile
  18. 3
      selfdrive/controls/lib/planner.py
  19. 4
      selfdrive/locationd/ubloxd.py
  20. BIN
      selfdrive/loggerd/loggerd
  21. 5
      selfdrive/registration.py
  22. BIN
      selfdrive/sensord/gpsd
  23. BIN
      selfdrive/sensord/sensord
  24. 1
      selfdrive/service_list.yaml
  25. BIN
      selfdrive/visiond/visiond

@ -1,9 +1,9 @@
[![](https://i.imgur.com/VlKV6V8.png)](#) [![](https://i.imgur.com/UetIFyH.jpg)](#)
Welcome to openpilot Welcome to openpilot
====== ======
[openpilot](http://github.com/commaai/openpilot) is an open source driving agent. Currently it performs the functions of Adaptive Cruise Control (ACC) and Lane Keeping Assist System (LKAS) for Hondas, Acuras, Toyotas, and a Chevy. It's about on par with Tesla Autopilot and GM Super Cruise, and better than [all other manufacturers](http://www.thedrive.com/tech/5707/the-war-for-autonomous-driving-part-iii-us-vs-germany-vs-japan). [openpilot](http://github.com/commaai/openpilot) is an open source driving agent. Currently it performs the functions of Adaptive Cruise Control (ACC) and Lane Keeping Assist System (LKAS) for selected Honda, Toyota, Acura, Lexus, Chevrolet, Hyundai, Kia. It's about on par with Tesla Autopilot and GM Super Cruise, and better than [all other manufacturers](http://www.thedrive.com/tech/5707/the-war-for-autonomous-driving-part-iii-us-vs-germany-vs-japan).
The openpilot codebase has been written to be concise and enable rapid prototyping. We look forward to your contributions - improving real vehicle automation has never been easier. The openpilot codebase has been written to be concise and enable rapid prototyping. We look forward to your contributions - improving real vehicle automation has never been easier.
@ -14,7 +14,7 @@ openpilot is developed by [comma.ai](https://comma.ai/) and users like you.
We have a [Twitter you should follow](https://twitter.com/comma_ai). We have a [Twitter you should follow](https://twitter.com/comma_ai).
Also, we have a 3500+ person [community on slack](https://slack.comma.ai). Also, we have a several thousand people community on [slack](https://slack.comma.ai).
<table> <table>
<tr> <tr>
@ -41,54 +41,54 @@ Install openpilot on a neo device by entering ``https://openpilot.comma.ai`` dur
Supported Cars Supported Cars
------ ------
| Make | Model | Supported Package | Lateral | Longitudinal | No Accel Below | No Steer Below | | Make | Model | Supported Package | Lateral | Longitudinal | No Accel Below | No Steer Below |
| -------------------| ----------------------| ---------------------| --------| ---------------| -----------------| ---------------| | ---------------------| ----------------------| ---------------------| --------| ---------------| -----------------| ---------------|
| Acura | ILX 2016 | AcuraWatch Plus | Yes | Yes | 25mph<sup>1</sup>| 25mph | | Acura | ILX 2016 | AcuraWatch Plus | Yes | Yes | 25mph<sup>1</sup>| 25mph |
| Acura | ILX 2017 | AcuraWatch Plus | Yes | Yes | 25mph<sup>1</sup>| 25mph | | Acura | ILX 2017 | AcuraWatch Plus | Yes | Yes | 25mph<sup>1</sup>| 25mph |
| Acura | RDX 2018 | AcuraWatch Plus | Yes | Yes | 25mph<sup>1</sup>| 12mph | | Acura | RDX 2018 | AcuraWatch Plus | Yes | Yes | 25mph<sup>1</sup>| 12mph |
| GM<sup>3</sup> | Volt 2017 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | | Chevrolet<sup>3</sup>| Volt 2017 | Adaptive Cruise | Yes | Yes | 0mph | 7mph |
| GM<sup>3</sup> | Volt 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | | Chevrolet<sup>3</sup>| Volt 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph |
| Honda | Accord 2018 | All | Yes | Stock | 0mph | 3mph | | Honda | Accord 2018 | All | Yes | Stock | 0mph | 3mph |
| Honda | Civic 2016 | Honda Sensing | Yes | Yes | 0mph | 12mph | | Honda | Civic 2016 | Honda Sensing | Yes | Yes | 0mph | 12mph |
| Honda | Civic 2017 | Honda Sensing | Yes | Yes | 0mph | 12mph | | Honda | Civic 2017 | Honda Sensing | Yes | Yes | 0mph | 12mph |
| Honda | Civic 2017 *(Hatch)* | Honda Sensing | Yes | Stock | 0mph | 12mph | | Honda | Civic 2017 *(Hatch)* | Honda Sensing | Yes | Stock | 0mph | 12mph |
| Honda | Civic 2018 | Honda Sensing | Yes | Yes | 0mph | 12mph | | Honda | Civic 2018 | Honda Sensing | Yes | Yes | 0mph | 12mph |
| Honda | Civic 2018 *(Hatch)* | Honda Sensing | Yes | Stock | 0mph | 12mph | | Honda | Civic 2018 *(Hatch)* | Honda Sensing | Yes | Stock | 0mph | 12mph |
| Honda | CR-V 2015 | Touring | Yes | Yes | 25mph<sup>1</sup>| 12mph | | Honda | CR-V 2015 | Touring | Yes | Yes | 25mph<sup>1</sup>| 12mph |
| Honda | CR-V 2016 | Touring | Yes | Yes | 25mph<sup>1</sup>| 12mph | | Honda | CR-V 2016 | Touring | Yes | Yes | 25mph<sup>1</sup>| 12mph |
| Honda | CR-V 2017 | Honda Sensing | Yes | Stock | 0mph | 12mph | | Honda | CR-V 2017 | Honda Sensing | Yes | Stock | 0mph | 12mph |
| Honda | CR-V 2018 | Honda Sensing | Yes | Stock | 0mph | 12mph | | Honda | CR-V 2018 | Honda Sensing | Yes | Stock | 0mph | 12mph |
| Honda | Odyssey 2017 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 0mph | | Honda | Odyssey 2017 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 0mph |
| Honda | Odyssey 2018 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 0mph | | Honda | Odyssey 2018 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 0mph |
| Honda | Odyssey 2019 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 0mph | | Honda | Odyssey 2019 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 0mph |
| Honda | Pilot 2017 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph | | Honda | Pilot 2017 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph |
| Honda | Pilot 2018 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph | | Honda | Pilot 2018 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph |
| Honda | Pilot 2019 | All | Yes | Yes | 25mph<sup>1</sup>| 12mph | | Honda | Pilot 2019 | All | Yes | Yes | 25mph<sup>1</sup>| 12mph |
| Honda | Ridgeline 2017 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph | | Honda | Ridgeline 2017 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph |
| Honda | Ridgeline 2018 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph | | Honda | Ridgeline 2018 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph |
| Hyundai<sup>6</sup>| Santa Fe 2019 | All | Yes | Stock | 0mph | 0mph | | Hyundai<sup>6</sup> | Santa Fe 2019 | All | Yes | Stock | 0mph | 0mph |
| Hyundai<sup>6</sup>| Elantra 2017 | SCC + LKAS | Yes | Stock | 19mph | 34mph | | Hyundai<sup>6</sup> | Elantra 2017 | SCC + LKAS | Yes | Stock | 19mph | 34mph |
| Hyundai<sup>6</sup>| Genesis 2018 | All | Yes | Stock | 19mph | 34mph | | Hyundai<sup>6</sup> | Genesis 2018 | All | Yes | Stock | 19mph | 34mph |
| Kia<sup>6</sup> | Sorento 2018 | All | Yes | Stock | 0mph | 0mph | | Kia<sup>6</sup> | Sorento 2018 | All | Yes | Stock | 0mph | 0mph |
| Kia<sup>6</sup> | Stinger 2018 | SCC + LKAS | Yes | Stock | 0mph | 0mph | | Kia<sup>6</sup> | Stinger 2018 | SCC + LKAS | Yes | Stock | 0mph | 0mph |
| Lexus | RX Hybrid 2017 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | | Lexus | RX Hybrid 2017 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph |
| Lexus | RX Hybrid 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | | Lexus | RX Hybrid 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph |
| Toyota | Camry 2018<sup>4</sup>| All | Yes | Stock | 0mph<sup>5</sup> | 0mph | | Toyota | Camry 2018<sup>4</sup>| All | Yes | Stock | 0mph<sup>5</sup> | 0mph |
| Toyota | C-HR 2018<sup>4</sup> | All | Yes | Stock | 0mph | 0mph | | Toyota | C-HR 2018<sup>4</sup> | All | Yes | Stock | 0mph | 0mph |
| Toyota | Corolla 2017 | All | Yes | Yes<sup>2</sup>| 20mph | 0mph | | Toyota | Corolla 2017 | All | Yes | Yes<sup>2</sup>| 20mph | 0mph |
| Toyota | Corolla 2018 | All | Yes | Yes<sup>2</sup>| 20mph | 0mph | | Toyota | Corolla 2018 | All | Yes | Yes<sup>2</sup>| 20mph | 0mph |
| Toyota | Highlander 2017 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | | Toyota | Highlander 2017 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph |
| Toyota | Highlander Hybrid 2018| All | Yes | Yes<sup>2</sup>| 0mph | 0mph | | Toyota | Highlander Hybrid 2018| All | Yes | Yes<sup>2</sup>| 0mph | 0mph |
| Toyota | Prius 2016 | TSS-P | Yes | Yes<sup>2</sup>| 0mph | 0mph | | Toyota | Prius 2016 | TSS-P | Yes | Yes<sup>2</sup>| 0mph | 0mph |
| Toyota | Prius 2017 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | | Toyota | Prius 2017 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph |
| Toyota | Prius 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | | Toyota | Prius 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph |
| Toyota | Prius Prime 2017 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | | Toyota | Prius Prime 2017 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph |
| Toyota | Prius Prime 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | | Toyota | Prius Prime 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph |
| Toyota | Rav4 2016 | TSS-P | Yes | Yes<sup>2</sup>| 20mph | 0mph | | Toyota | Rav4 2016 | TSS-P | Yes | Yes<sup>2</sup>| 20mph | 0mph |
| Toyota | Rav4 2017 | All | Yes | Yes<sup>2</sup>| 20mph | 0mph | | Toyota | Rav4 2017 | All | Yes | Yes<sup>2</sup>| 20mph | 0mph |
| Toyota | Rav4 2018 | All | Yes | Yes<sup>2</sup>| 20mph | 0mph | | Toyota | Rav4 2018 | All | Yes | Yes<sup>2</sup>| 20mph | 0mph |
| Toyota | Rav4 Hybrid 2017 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | | Toyota | Rav4 Hybrid 2017 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph |
| Toyota | Rav4 Hybrid 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | | Toyota | Rav4 Hybrid 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph |
<sup>1</sup>[Comma Pedal](https://community.comma.ai/wiki/index.php/Comma_Pedal) is used to provide stop-and-go capability to some of the openpilot-supported cars that don't currently support stop-and-go. Here is how to [build a Comma Pedal](https://medium.com/@jfrux/comma-pedal-building-with-macrofab-6328bea791e8). ***NOTE: The Comma Pedal is not officially supported by [comma.ai](https://comma.ai)*** <sup>1</sup>[Comma Pedal](https://community.comma.ai/wiki/index.php/Comma_Pedal) is used to provide stop-and-go capability to some of the openpilot-supported cars that don't currently support stop-and-go. Here is how to [build a Comma Pedal](https://medium.com/@jfrux/comma-pedal-building-with-macrofab-6328bea791e8). ***NOTE: The Comma Pedal is not officially supported by [comma.ai](https://comma.ai)***
<sup>2</sup>When disconnecting the Driver Support Unit (DSU), otherwise longitudinal control is stock ACC. For DSU locations, see [Toyota Wiki page](https://community.comma.ai/wiki/index.php/Toyota) <sup>2</sup>When disconnecting the Driver Support Unit (DSU), otherwise longitudinal control is stock ACC. For DSU locations, see [Toyota Wiki page](https://community.comma.ai/wiki/index.php/Toyota)
@ -103,8 +103,11 @@ Community Maintained Cars
| Make | Model | Supported Package | Lateral | Longitudinal | No Accel Below | No Steer Below | | Make | Model | Supported Package | Lateral | Longitudinal | No Accel Below | No Steer Below |
| ------- | ---------------------- | -------------------- | ------- | ------------ | -------------- | -------------- | | ------- | ---------------------- | -------------------- | ------- | ------------ | -------------- | -------------- |
| Honda | Fit 2018 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph | | Honda | Fit 2018 | Honda Sensing | Yes | Yes | 25mph<sup>1</sup>| 12mph |
| Tesla | Model S 2012 | All | Yes | Not yet | Not applicable | 0mph |
| Tesla | Model S 2013 | All | Yes | Not yet | Not applicable | 0mph |
[[Honda Fit Pull Request]](https://github.com/commaai/openpilot/pull/266). [[Honda Fit Pull Request]](https://github.com/commaai/openpilot/pull/266).
[[Tesla Model S Pull Request]](https://github.com/commaai/openpilot/pull/246)
Community Maintained Cars are not confirmed by comma.ai to meet our [safety model](https://github.com/commaai/openpilot/blob/devel/SAFETY.md). Be extra cautious using them. Community Maintained Cars are not confirmed by comma.ai to meet our [safety model](https://github.com/commaai/openpilot/blob/devel/SAFETY.md). Be extra cautious using them.

@ -1,3 +1,9 @@
Version 0.5.5 (2018-10-20)
========================
* Increase allowed Honda positive accelerations
* Fix sporadic unexpected braking when passing semi-trucks in Toyota
* Fix gear reading bug in Hyundai Elantra thanks to emmertex!
Version 0.5.4 (2018-09-25) Version 0.5.4 (2018-09-25)
======================== ========================
* New Driving Model * New Driving Model

@ -410,6 +410,7 @@ struct Live100Data {
alertStatus @38 :AlertStatus; alertStatus @38 :AlertStatus;
alertSize @39 :AlertSize; alertSize @39 :AlertSize;
alertBlinkingRate @42 :Float32; alertBlinkingRate @42 :Float32;
alertType @44 :Text;
awarenessStatus @26 :Float32; awarenessStatus @26 :Float32;
angleOffset @27 :Float32; angleOffset @27 :Float32;
gpsPlannerActive @40 :Bool; gpsPlannerActive @40 :Bool;
@ -1558,6 +1559,13 @@ struct Boot {
lastPmsg @2 :Data; lastPmsg @2 :Data;
} }
struct LiveParametersData {
valid @0 :Bool;
gyroBias @1 :Float32;
angleOffset @2 :Float32;
}
struct Event { struct Event {
# in nanoseconds? # in nanoseconds?
logMonoTime @0 :UInt64; logMonoTime @0 :UInt64;
@ -1623,5 +1631,6 @@ struct Event {
orbFeaturesSummary @58 :OrbFeaturesSummary; orbFeaturesSummary @58 :OrbFeaturesSummary;
driverMonitoring @59 :DriverMonitoring; driverMonitoring @59 :DriverMonitoring;
boot @60 :Boot; boot @60 :Boot;
liveParameters @61 :LiveParametersData;
} }
} }

@ -6,7 +6,7 @@ from cffi import FFI
TMPDIR = "/tmp/ccache" TMPDIR = "/tmp/ccache"
def ffi_wrap(name, c_code, c_header, tmpdir=TMPDIR): def ffi_wrap(name, c_code, c_header, tmpdir=TMPDIR, cflags="", libraries=[]):
cache = name + "_" + hashlib.sha1(c_code).hexdigest() cache = name + "_" + hashlib.sha1(c_code).hexdigest()
try: try:
os.mkdir(tmpdir) os.mkdir(tmpdir)
@ -21,19 +21,19 @@ def ffi_wrap(name, c_code, c_header, tmpdir=TMPDIR):
mod = __import__(cache) mod = __import__(cache)
except Exception: except Exception:
print "cache miss", cache print "cache miss", cache
compile_code(cache, c_code, c_header, tmpdir) compile_code(cache, c_code, c_header, tmpdir, cflags, libraries)
mod = __import__(cache) mod = __import__(cache)
finally: finally:
os.close(fd) os.close(fd)
return mod.ffi, mod.lib return mod.ffi, mod.lib
def compile_code(name, c_code, c_header, directory): def compile_code(name, c_code, c_header, directory, cflags="", libraries=[]):
ffibuilder = FFI() ffibuilder = FFI()
ffibuilder.set_source(name, c_code, source_extension='.cpp') ffibuilder.set_source(name, c_code, source_extension='.cpp', libraries=libraries)
ffibuilder.cdef(c_header) ffibuilder.cdef(c_header)
os.environ['OPT'] = "-fwrapv -O2 -DNDEBUG -std=c++11" os.environ['OPT'] = "-fwrapv -O2 -DNDEBUG -std=c++11"
os.environ['CFLAGS'] = "" os.environ['CFLAGS'] = cflags
ffibuilder.compile(verbose=True, debug=False, tmpdir=directory) ffibuilder.compile(verbose=True, debug=False, tmpdir=directory)
def wrap_compiled(name, directory): def wrap_compiled(name, directory):

@ -10,7 +10,6 @@ from selfdrive.controls.lib.drive_helpers import create_event, EventTypes as ET,
from selfdrive.controls.lib.vehicle_model import VehicleModel from selfdrive.controls.lib.vehicle_model import VehicleModel
from selfdrive.car.honda.carstate import CarState, get_can_parser from selfdrive.car.honda.carstate import CarState, get_can_parser
from selfdrive.car.honda.values import CruiseButtons, CM, BP, AH, CAR, HONDA_BOSCH from selfdrive.car.honda.values import CruiseButtons, CM, BP, AH, CAR, HONDA_BOSCH
from selfdrive.controls.lib.planner import A_ACC_MAX
try: try:
from selfdrive.car.honda.carcontroller import CarController from selfdrive.car.honda.carcontroller import CarController
@ -128,7 +127,7 @@ class CarInterface(object):
# accelOverride is more or less the max throttle allowed to pcm: usually set to a constant # accelOverride is more or less the max throttle allowed to pcm: usually set to a constant
# unless aTargetMax is very high and then we scale with it; this help in quicker restart # unless aTargetMax is very high and then we scale with it; this help in quicker restart
return float(max(0.714, a_target / A_ACC_MAX)) * min(speedLimiter, accelLimiter) return float(min(speedLimiter, accelLimiter))
@staticmethod @staticmethod
def get_params(candidate, fingerprint): def get_params(candidate, fingerprint):

@ -10,24 +10,30 @@ import selfdrive.messaging as messaging
from selfdrive.car.toyota.values import NO_DSU_CAR from selfdrive.car.toyota.values import NO_DSU_CAR
RADAR_MSGS = list(range(0x210, 0x220)) RADAR_A_MSGS = list(range(0x210, 0x220))
RADAR_B_MSGS = list(range(0x220, 0x230))
def _create_radard_can_parser(): def _create_radard_can_parser():
dbc_f = 'toyota_prius_2017_adas.dbc' dbc_f = 'toyota_prius_2017_adas.dbc'
msg_n = len(RADAR_MSGS)
signals = zip(['LONG_DIST'] * msg_n + ['NEW_TRACK'] * msg_n + ['LAT_DIST'] * msg_n + msg_a_n = len(RADAR_A_MSGS)
['REL_SPEED'] * msg_n + ['VALID'] * msg_n, msg_b_n = len(RADAR_B_MSGS)
RADAR_MSGS * 5,
[255] * msg_n + [1] * msg_n + [0] * msg_n + [0] * msg_n + [0] * msg_n) signals = zip(['LONG_DIST'] * msg_a_n + ['NEW_TRACK'] * msg_a_n + ['LAT_DIST'] * msg_a_n +
checks = zip(RADAR_MSGS, [20]*msg_n) ['REL_SPEED'] * msg_a_n + ['VALID'] * msg_a_n + ['SCORE'] * msg_b_n,
RADAR_A_MSGS * 5 + RADAR_B_MSGS,
[255] * msg_a_n + [1] * msg_a_n + [0] * msg_a_n + [0] * msg_a_n + [0] * msg_a_n + [0] * msg_b_n)
checks = zip(RADAR_A_MSGS + RADAR_B_MSGS, [20]*(msg_a_n + msg_b_n))
return CANParser(os.path.splitext(dbc_f)[0], signals, checks, 1) return CANParser(os.path.splitext(dbc_f)[0], signals, checks, 1)
class RadarInterface(object): class RadarInterface(object):
def __init__(self, CP): def __init__(self, CP):
# radar # radar
self.pts = {} self.pts = {}
self.validCnt = {key: 0 for key in RADAR_MSGS} self.seen_valid = {key: False for key in RADAR_A_MSGS}
self.track_id = 0 self.track_id = 0
self.delay = 0.0 # Delay of radar self.delay = 0.0 # Delay of radar
@ -52,7 +58,7 @@ class RadarInterface(object):
tm = int(sec_since_boot() * 1e9) tm = int(sec_since_boot() * 1e9)
updated_messages.update(self.rcp.update(tm, True)) updated_messages.update(self.rcp.update(tm, True))
# TODO: do not hardcode last msg # TODO: do not hardcode last msg
if 0x21f in updated_messages: if 0x22f in updated_messages:
break break
errors = [] errors = []
@ -62,32 +68,33 @@ class RadarInterface(object):
ret.canMonoTimes = canMonoTimes ret.canMonoTimes = canMonoTimes
for ii in updated_messages: for ii in updated_messages:
cpt = self.rcp.vl[ii] if ii in RADAR_A_MSGS:
cpt = self.rcp.vl[ii]
if cpt['LONG_DIST'] >=255 or cpt['NEW_TRACK']:
self.validCnt[ii] = 0 # reset counter if cpt['LONG_DIST'] >= 255 or cpt['NEW_TRACK']:
self.seen_valid[ii] = False # reset validity
if cpt['VALID'] and cpt['LONG_DIST'] < 255:
self.validCnt[ii] += 1 if cpt['LONG_DIST'] < 255 and cpt['VALID']:
else: self.seen_valid[ii] = True
self.validCnt[ii] = max(self.validCnt[ii] -1, 0)
#print ii, self.validCnt[ii], cpt['VALID'], cpt['LONG_DIST'], cpt['LAT_DIST'] score = self.rcp.vl[ii+16]['SCORE']
# print ii, score, cpt['VALID'], cpt['LONG_DIST'], cpt['LAT_DIST']
# radar point only valid if there have been enough valid measurements
if self.validCnt[ii] > 0: # radar point only valid if it's a valid measurement and score is above 50
if ii not in self.pts or cpt['NEW_TRACK']: if (cpt['VALID'] or score > 50) and cpt['LONG_DIST'] < 255 and self.seen_valid[ii]:
self.pts[ii] = car.RadarState.RadarPoint.new_message() if ii not in self.pts or cpt['NEW_TRACK']:
self.pts[ii].trackId = self.track_id self.pts[ii] = car.RadarState.RadarPoint.new_message()
self.track_id += 1 self.pts[ii].trackId = self.track_id
self.pts[ii].dRel = cpt['LONG_DIST'] # from front of car self.track_id += 1
self.pts[ii].yRel = -cpt['LAT_DIST'] # in car frame's y axis, left is positive self.pts[ii].dRel = cpt['LONG_DIST'] # from front of car
self.pts[ii].vRel = cpt['REL_SPEED'] self.pts[ii].yRel = -cpt['LAT_DIST'] # in car frame's y axis, left is positive
self.pts[ii].aRel = float('nan') self.pts[ii].vRel = cpt['REL_SPEED']
self.pts[ii].yvRel = float('nan') self.pts[ii].aRel = float('nan')
self.pts[ii].measured = bool(cpt['VALID']) self.pts[ii].yvRel = float('nan')
else: self.pts[ii].measured = bool(cpt['VALID'])
if ii in self.pts: else:
del self.pts[ii] if ii in self.pts:
del self.pts[ii]
ret.points = self.pts.values() ret.points = self.pts.values()
return ret return ret

@ -1 +1 @@
#define COMMA_VERSION "0.5.4-release" #define COMMA_VERSION "0.5.5-release"

@ -352,6 +352,7 @@ def data_send(perception_state, plan, plan_ts, CS, CI, CP, VM, state, events, ac
"alertSize": AM.alert_size, "alertSize": AM.alert_size,
"alertStatus": AM.alert_status, "alertStatus": AM.alert_status,
"alertBlinkingRate": AM.alert_rate, "alertBlinkingRate": AM.alert_rate,
"alertType": AM.alert_type,
"awarenessStatus": max(driver_status.awareness, 0.0) if isEnabled(state) else 0.0, "awarenessStatus": max(driver_status.awareness, 0.0) if isEnabled(state) else 0.0,
"driverMonitoringOn": bool(driver_status.monitor_on), "driverMonitoringOn": bool(driver_status.monitor_on),
"canMonoTimes": list(CS.canMonoTimes), "canMonoTimes": list(CS.canMonoTimes),

File diff suppressed because it is too large Load Diff

@ -4,6 +4,7 @@ CXX = clang++
PHONELIBS = ../../../../phonelibs PHONELIBS = ../../../../phonelibs
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m) UNAME_M := $(shell uname -m)
CFLAGS = -O3 -fPIC -I. CFLAGS = -O3 -fPIC -I.
@ -13,10 +14,12 @@ QPOASES_FLAGS = -I$(PHONELIBS)/qpoases -I$(PHONELIBS)/qpoases/INCLUDE -I$(PHONEL
ACADO_FLAGS = -I$(PHONELIBS)/acado/include -I$(PHONELIBS)/acado/include/acado ACADO_FLAGS = -I$(PHONELIBS)/acado/include -I$(PHONELIBS)/acado/include/acado
ifeq ($(UNAME_M),aarch64) ifeq ($(UNAME_S),Darwin)
ACADO_LIBS := -L $(PHONELIBS)/acado/aarch64/lib -l:libacado_toolkit.a -l:libacado_casadi.a -l:libacado_csparse.a ACADO_LIBS := -lacado_toolkit_s
else ifeq ($(UNAME_M),aarch64)
ACADO_LIBS := -L $(PHONELIBS)/acado/aarch64/lib -l:libacado_toolkit.a -l:libacado_casadi.a -l:libacado_csparse.a
else else
ACADO_LIBS := -L $(PHONELIBS)/acado/x64/lib -l:libacado_toolkit.a -l:libacado_casadi.a -l:libacado_csparse.a ACADO_LIBS := -L $(PHONELIBS)/acado/x64/lib -l:libacado_toolkit.a -l:libacado_casadi.a -l:libacado_csparse.a
endif endif
OBJS = \ OBJS = \
@ -67,7 +70,7 @@ lib_qp/%.o: $(PHONELIBS)/qpoases/SRC/%.cpp
-c -o '$@' '$<' -c -o '$@' '$<'
generator: generator.cpp generator: generator.cpp
$(CXX) -Wall -std=c++11 \ $(CXX) -v -Wall -std=c++11 \
generator.cpp \ generator.cpp \
-o generator \ -o generator \
$(ACADO_FLAGS) \ $(ACADO_FLAGS) \

@ -3,6 +3,7 @@ CXX = clang++
PHONELIBS = ../../../../phonelibs PHONELIBS = ../../../../phonelibs
UNAME_S := $(shell uname -s)
UNAME_M := $(shell uname -m) UNAME_M := $(shell uname -m)
CFLAGS = -O3 -fPIC -I. CFLAGS = -O3 -fPIC -I.
@ -12,10 +13,12 @@ QPOASES_FLAGS = -I$(PHONELIBS)/qpoases -I$(PHONELIBS)/qpoases/INCLUDE -I$(PHONEL
ACADO_FLAGS = -I$(PHONELIBS)/acado/include -I$(PHONELIBS)/acado/include/acado ACADO_FLAGS = -I$(PHONELIBS)/acado/include -I$(PHONELIBS)/acado/include/acado
ifeq ($(UNAME_M),aarch64) ifeq ($(UNAME_S),Darwin)
ACADO_LIBS := -L $(PHONELIBS)/acado/aarch64/lib -l:libacado_toolkit.a -l:libacado_casadi.a -l:libacado_csparse.a ACADO_LIBS := -lacado_toolkit_s
else ifeq ($(UNAME_M),aarch64)
ACADO_LIBS := -L $(PHONELIBS)/acado/aarch64/lib -l:libacado_toolkit.a -l:libacado_casadi.a -l:libacado_csparse.a
else else
ACADO_LIBS := -L $(PHONELIBS)/acado/x64/lib -l:libacado_toolkit.a -l:libacado_casadi.a -l:libacado_csparse.a ACADO_LIBS := -L $(PHONELIBS)/acado/x64/lib -l:libacado_toolkit.a -l:libacado_casadi.a -l:libacado_csparse.a
endif endif
OBJS = \ OBJS = \

@ -44,9 +44,6 @@ _A_TOTAL_MAX_BP = [0., 20., 40.]
_FCW_A_ACT_V = [-3., -2.] _FCW_A_ACT_V = [-3., -2.]
_FCW_A_ACT_BP = [0., 30.] _FCW_A_ACT_BP = [0., 30.]
# max acceleration allowed in acc, which happens in restart
A_ACC_MAX = max(_A_CRUISE_MAX_V_FOLLOWING)
def calc_cruise_accel_limits(v_ego, following): def calc_cruise_accel_limits(v_ego, following):
a_cruise_min = interp(v_ego, _A_CRUISE_MIN_BP, _A_CRUISE_MIN_V) a_cruise_min = interp(v_ego, _A_CRUISE_MIN_BP, _A_CRUISE_MIN_V)

@ -149,7 +149,9 @@ def gen_solution(msg):
'speedAccuracy': msg_data['sAcc']*1e-03, # speed accuracy in m/s 'speedAccuracy': msg_data['sAcc']*1e-03, # speed accuracy in m/s
'verticalAccuracy': msg_data['vAcc']*1e-03, # vertical accuracy in meters 'verticalAccuracy': msg_data['vAcc']*1e-03, # vertical accuracy in meters
'bearingAccuracy': msg_data['headAcc']*1e-05, # heading accuracy in degrees 'bearingAccuracy': msg_data['headAcc']*1e-05, # heading accuracy in degrees
'source': 'ublox'} 'source': 'ublox',
'flags': msg_data['flags'],
}
return log.Event.new_message(gpsLocationExternal=gps_fix) return log.Event.new_message(gpsLocationExternal=gps_fix)
def gen_nav_data(msg, nav_frame_buffer): def gen_nav_data(msg, nav_frame_buffer):

Binary file not shown.

@ -7,7 +7,10 @@ from common.api import api_get
from common.params import Params from common.params import Params
def get_imei(): def get_imei():
return subprocess.check_output(["getprop", "oem.device.imeicache"]).strip() ret = subprocess.check_output(["getprop", "oem.device.imeicache"]).strip()
if ret == "":
ret = "000000000000000"
return ret
def get_serial(): def get_serial():
return subprocess.check_output(["getprop", "ro.serialno"]).strip() return subprocess.check_output(["getprop", "ro.serialno"]).strip()

Binary file not shown.

Binary file not shown.

@ -70,6 +70,7 @@ uiLayoutState: [8060, true]
frontEncodeIdx: [8061, true] frontEncodeIdx: [8061, true]
orbFeaturesSummary: [8062, true] orbFeaturesSummary: [8062, true]
driverMonitoring: [8063, true] driverMonitoring: [8063, true]
liveParameters: [8064, true]
testModel: [8040, false] testModel: [8040, false]
testLiveLocation: [8045, false] testLiveLocation: [8045, false]

Binary file not shown.
Loading…
Cancel
Save