Compare commits

...

1105 Commits

Author SHA1 Message Date
Rick Lan
9f83a79b4b update ota/recovery url 2020-11-10 14:01:42 +10:00
Rick Lan
d7cdacb5c8 re-add apks 2020-04-07 19:32:16 +10:00
Rick Lan
c7ef64f60b re-add apks 2020-04-07 19:05:22 +10:00
Rick Lan
846461f699 Merge branch '0.7.0-en' of https://github.com/dragonpilot-community/dragonpilot into 0.7.0-en 2020-04-07 17:55:00 +10:00
Rick Lan
94518f7761 0.7.0-en 2020-03-31 17:01:49 +10:00
dragonpilot
379fed7f58 fix issue that may install apks every time 2019-12-31 18:11:46 +10:00
Rick Lan
b0c0357eb0 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-12-29 21:17:25 +10:00
Rick Lan
9d5db97d1c Move ALCs min speed / timer to variables. 2019-12-29 21:13:22 +10:00
rbiasini
cccafa7b64 Honda fwd fixes (#5)
- fix chime forwarding
- forward radar hud msg from stock
- no EON chime during stock fcw
2019-12-25 21:38:00 -08:00
dragonpilot
8317227583 increase min speed to use assist lc / auto lc 2019-12-18 14:34:12 +10:00
dragonpilot
6447f53d58 remove 2017 Civic Hatchback LX fingerprint because it will cause issue with others. 2019-12-18 14:30:55 +10:00
dragonpilot
695d5746fe update auto_lc logic, fix incorrect auto_lc alert. 2019-12-18 11:57:11 +10:00
Riccardo
43f2402e90 README update with FCA harness support 2019-12-16 18:33:21 -08:00
dragonpilot
2862f3006c auto lane change send alerts 2019-12-17 11:02:36 +10:00
dragonpilot
27c2af7e42 Merge pull request #8 from eFiniLan/dp-devel-en
Auto LC
2019-12-17 10:06:22 +10:00
dragonpilot
e5d748d15e Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-12-17 10:03:28 +10:00
dragonpilot
6a6b1509e9 fix langauge issue 2019-12-17 10:02:02 +10:00
rbiasini
8abdb9f9c5 Honda Nidec: fix missing signals from dbc files (#919) 2019-12-16 20:27:01 +01:00
Rick Lan
09be37c457 update apks, fix up ALC logic 2019-12-17 01:18:45 +10:00
dragonpilot
b7574d3a55 migrate to 0.7 2019-12-16 17:13:44 +10:00
dragonpilot
c62d0f63f2 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-12-16 11:23:05 +10:00
Willem Melching
f798009e3d add common/kalman/.gitignore 2019-12-14 12:47:28 -08:00
Riccardo
fd4a8b2f9f Allow more time for snapshots and increase alert priority for disallowed community feature 2019-12-14 10:36:39 -08:00
Vehicle Researcher
36282d9752 openpilot v0.7 release 2019-12-13 13:03:08 -08:00
Vehicle Researcher
37134796c0 Merge opendbc subtree 2019-12-13 13:02:48 -08:00
Vehicle Researcher
9bfdab095f Merge panda subtree 2019-12-13 13:02:46 -08:00
Vehicle Researcher
bc7b9b38ae Squashed 'panda/' changes from 256d274e..a648ccae
a648ccae Add os import
042562dd Extracted wifi connect from test helpers
ac0fd5dd query fw versions example - use extended diagnostic session
4e9d788a Remove not-needed cadillac-init
f0a5d154 typo
c093286b Add bootkick after re-enabling phone power (#401)
eadb0dbb security upgrades (#397)
7c13bec0 Command to get signature (#399)
dad439a4 static assert on size of health packet (#398)
da9da466 Fix VERSION
df4159c8 Revert "Revert "Register readback on most modules. Still need to convert the other ones (#396)""
56ec2150 Revert "Register readback on most modules. Still need to convert the other ones (#396)"
893e4861 Register readback on most modules. Still need to convert the other ones (#396)
6bbae7be VW safety: allow cancel spam on both buses to be compatible with camera and gateway integration
d5f7a287 bump panda
1bcc351f ignition_can: set it to False after 2s of not seeing CAN msgs
96137f1a VW can based ignition not needed. it has ignition line at camera as well.
1b004a18 Same flake8 version as the one in openpilot
e82ba5f2 Same pylint version as the one in openpilot
656f99b0 Interrupt refactor (NVIC_SM_1: #334) and Fault handling (#377) (PR #373)
000282e5 Fix can_logger.py to run correctly on python3 (#392)
7f9b4a59 Fix USB device enumeration on Windows 8.1 and Windows 10 (#393)
dec565c7 Update Misra test coverage, which now includes rule 2.7
fb6bc3ba Fix Misra
878dd00a solve race condition is relay_malfunction right after changing the relay status by adding a counter
2d4cb05c add a safety mode counter
a6797a21 Implement USB power mode on uno
670f90cc Merge branch 'master' of github.com:commaai/panda
ca39a5d8 Added faults integer to health packet
e1c34a1a Panda Jungle testing (#394)
2a093a39 Added heartbeat to echo test
22464356 Fixed health struct size. We should really get an automated test for this
f458d67a Add uptime counter to the health packet (#391)
16624811 enable CAN transcievers outside the set_safety_mode function, which is not related
a7c98744 bump panda ver
1192d934 Power saving refactor (#389)
d58d08fb Fix Misra 17.8: can't mod function params
bc685ac9 Minor indent
a54b86c4 Failure of set_safety_mode falls back to SILENT. Failure to set silent results in hanging
597436d3 NOOUTPUT safety mode is now SILENT. NOOUTPUT still exists but keeps C… (#388)
d229f8dc ESP forced off in EON build. this prevents ESP to be turned on when e… (#387)
8a044b34 forgot Hyundai: now also using make_msg
4f9c8796 remove abunch of lines from safety regression tests by using common make_msg function
fb814143 mispelled word
57f5ef8c Fix misra: addr can't be more than 29 bits anyway
68ff5012 typo
d5c772b0 Fixe Toyota message white-list
48197a92 Better masking for ELM mode
b8fe78c3 VW is also tested for safety replay
212d336b Safety Chrysler: Added cancel spam button check
d44b5621 fix print in example
02d579a5 functional addr handling
6249a183 tx_hook shall have a white-list of messages (#381)
8138fc14 uds: handle function addrs and fw version query example
6626a542 Fixed python health api
b9b79e8b uds zero second timeout
e0de1a4f define ALLOW_DEBUG in safety tests
86dec4b8 Safety modes that violate ISO26262 requirements are not compiled in RELEASE build
e74ed936 safety tests a bit more simplified
2027765b relay malfunction test centralized
8af1a01a clean up safety tests
e8f7a3b2 upd panda
cfcce8f0 WIP: Relay malfunction (#384)
69d9d610 No tabs in mazda safety
a86418c1 insignificant changes
f239b996 single addr was better
d063a188 Hyundai safety: re-enable button spam safety check
4d1edc06 skip tx_hook if a message is forwarded (#379)
df2ff045 bump version
168461d5 added fault state to health packet
b3e1a133 uds: better debug prints
68c39fb3 uds: no need for threads if you always drain rx
91b7c5bb bump Panda Ver
26cb4dc4 Fixed pylint error
32725cc3 Fixed misra compliance
e33b4bea Added echo script
312ba62d minor comment cleanupo
e90897a8 Fix board detection on white
0e72c183 always stop executing if safety mode fails to be set (suggested by jyoung8607)
e8d7ed1d Rename function name to not confuse safety_set_mode and set_safety_mode
ff86db65 improve uds message processing
512ab3f2 except Exception
37ce507a py3 all
bac4d854 dos and python3
501db8d1 uds drain before send and use has_obd()
f2cbec16 Added has_obd() to python library
48e5b182 Add SDK downloading to the build step (#314)
e0762c2e Add Python & USB API for controlling phone power (#313)
ba9fb69f New health packet struct also in the python libs

git-subtree-dir: panda
git-subtree-split: a648ccae4b3661ca6de7a4ac199cc44a41442b74
2019-12-13 13:02:46 -08:00
Vehicle Researcher
0cf43202d7 Merge cereal subtree 2019-12-13 13:02:45 -08:00
Vehicle Researcher
e3b21173a5 Squashed 'cereal/' changes from 90e48c54..b8382bbb
b8382bbb steerLimitTimer should be car dependent
9a229687 add pa0 temp to ThermalData
f6f0f60e Add stock Fcw to carState
b608683f no l/r distinction for LDW
555f48d6 Add ldw alert
8e8b4a4a Remove plusFrame socket in favor of UiLayoutState
3410325c log stock AEB events
2219f2bd Add warning about not using cython version of sec_since_boot
8f1a5122 for legacy-testing reasons, better to define the used percent instead of avail
e86d9545 adding low memory event
ad238340 remove TODO
d0962b34 log mem available and cpu perc in thermald
3b753be9 Implement error handling and exceptions (#18)
a7d5bb76 add explicit dependencies on services.h
1ba64677 fix linter
c7d215b6 Added communityFeatureDisallowed event
492140a5 Added communityFeature bit detection to CarParams
266a5fed log Panda fault types
347a8661 Switch from polling on FIFOs to signal (#12)
e25bba77 no need to double build the objects
fe43a994 20Hz for radar time step is very standard
2aabf1ee Added radar time step to car params
e8ae9086 Generate capnp for java
57126a23 cereal_shared
da655cd3 Add uptime to health
f6a8e394 add test with multiple subscribers
84b3af53 comment out the debugging
4b9c942a added power save state to health packet
66be3708 run python unittest in ci
52c6db87 Run scons in CI (#14)
9414615b do need it, but only for arm
2856c37c remove gnustl_shared
7f05ee64 fix apks
e3a6bded Revert "no more makefiles"
487fbd06 don't rely on BASEDIR, and add zmq library
223e37a5 no more makefiles
da2ed115 don't link the wrong one
fe9fe2a2 scons builds the python lib now
2f81135e err, it can't build services.h
57b03f8b now we shouldn't need that yaml crap everywhere
f8e53277 bridge builds with services.h
2b0cb608 noOutput safety mode is now called silent
83880d51 add msgq tests
bcad1848 msgq: dont block when fifo does not exists
b4b26782 Default to zmq
473e2912 fix compilation in docker
30aaaddc msgq: try again when no timeout on poll but also no message
c4f2ad53 msgq: make sure read_fifos is initalized so we dont close random fds
4e513a85 msgq: dont clean up uninitialized sockerts
c008b630 also remove the fifo from disk
ef64eb27 MSGQ stability improvements when opening and closing lots of queues
e147abcc Revert "Revert "deprecate irpwr""
932dc32e Revert "deprecate irpwr"
a6844150 disengage
ec27e18c capnpc also generated the header files
ee52ab9e deprecate irpwr
301c74c8 Merge branch 'master' of github.com:commaai/cereal
6da7d55a add front frame
a5944eb4 add conflate parameter for SubSocket::create
ca8df170 Add fault status to health
ef4ded06 add conflate support in SubSocket constructor
7fd314af update scons build file
93d814e4 add saturated flags to indi and lqr logs
50302fee add steeringRateLimited to car.capnp
05e3513d add msgq readme
a6759a95 faster make
94b73778 Add struct to log FW version
64ce0b5f add scons build
dc9ad18a add debug print statement on SIGINT
4a612698 Merge pull request #10 from commaai/msgq
4873449a use recv one or none after poll
a054864b default to msgq
fbc4a4cf oops bad number
5067cf4c add meta
cbd02865 fix export prefix and make shared library world readable
c2730541 add c exports for jni usage
e77f41ef zmq already sets the errno correctly
3196cf69 Fix service list path in bridge
d35515a2 add all msgq files, but dont use as default
a68a38fa Don't delete context from python side only
bd46c225 Revert "zmq_ctx_term is blocking"
a1fc26b8 zmq_ctx_term is blocking
09021820 remote address support
21a35361 only delete subsocket when created by same object
34df7351 remove extra underscore from __dealloc__
c8748f86 fix internal refs
79b2fbf7 fixups
23ad2563 import messaging and services

git-subtree-dir: cereal
git-subtree-split: b8382bbb2b8156f2f1d7e1c1b42b46c54d85761f
2019-12-13 13:02:45 -08:00
rbiasini
9b0db32efc Update README.md and SAFETY.md (#907)
* Update README.md and SAFETY.md
2019-12-10 19:36:06 -08:00
dragonpilot
cc3dd034ee Merge branch 'devel-unsupported-cars' into devel-en 2019-12-10 16:26:15 +10:00
dragonpilot
88a2a7e175 remove duplicated fp 2019-12-10 16:25:36 +10:00
dragonpilot
7fc6536940 Merge branch 'devel-unsupported-cars' into devel-en 2019-12-10 16:24:46 +10:00
dragonpilot
9ba4721162 add 2 more fingerprints from shell 2019-12-10 16:24:21 +10:00
dragonpilot
d2a0d11c59 Merge branch 'devel-unsupported-cars' into devel-en 2019-12-10 16:12:25 +10:00
dragonpilot
b061cbef90 add 17' Civic Hatchback LX fingerprint from CFranHonda 2019-12-10 16:12:05 +10:00
dragonpilot
df67387ca9 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-12-10 16:08:43 +10:00
dragonpilot
9a1e4ff917 add waze mode 2019-12-10 11:24:49 +10:00
Arne Schwarck
5bf610ddf2 Battery protection (#888)
* Battery protection

If your car battery voltage is lower than 0% switch off charging to stop the Eon from damaging the 12v car battery. Leaving you with a car that can not start but has a fully charged eon ;-)

* add rbiasini comment && !ignition

* Update Offroad_ChargeDisabled with voltage low

* simplify alert

* non-temporal hysteresis from @rbiasini

And up the start charge limit to 12v. i.e. 50% car battery voltage

* once battery power recovers to 11.500 volts charge

This leaves 1v inbetween for any fluctuations that could occur.

* fix indent

* Fix indent of whole block

It looks like sometimes when you copy and paste into the github web interface some white spacing gets added or removed. BE AWARE!
2019-12-04 11:46:39 -08:00
dragonpilot
ad2e92f057 add china 2019 corolla 2019-11-28 14:38:12 +10:00
dragonpilot
b54a0ccb95 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-11-28 14:37:24 +10:00
dragonpilot
29ab7b80d8 add ability to disable steering ratio learner 2019-11-27 10:09:41 +10:00
Shane Smiskol
f559477ab1 Fix typo (#891) 2019-11-25 21:40:51 -08:00
dragonpilot
31fc2a50fb update APK, allow use of lead car moving alert without enable OP 2019-11-21 09:21:58 +10:00
dragonpilot
9c7e80ebe2 update APK 2019-11-19 16:03:42 +10:00
dragonpilot
65d57ff9e5 update APK 2019-11-19 10:10:00 +10:00
dragonpilot
27f8443b9e update APK 2019-11-18 08:02:07 +10:00
dragonpilot
2f28bdad81 bug fix 2019-11-15 18:28:59 +10:00
dragonpilot
ce44aa7696 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-11-15 09:25:54 +10:00
dragonpilot
bdea69d89b update batt ctrl logic, update APK 2019-11-15 09:10:53 +10:00
Willem Melching
abd3c6b5dc Update driving model (#880) 2019-11-14 13:51:35 -08:00
dragonpilot
f700370a8e update APK 2019-11-13 13:13:07 +10:00
dragonpilot
f462f640f8 only check hw type once in thermald automatically 2019-11-13 11:35:10 +10:00
Jason Young
75618d6ce7 Fixes for various merge and refactoring fallout, typo fixes. (#878)
* Fixes for various merge and refactoring fallout, typo fixes.

* Tab->Spaces
2019-11-12 17:19:34 -08:00
dragonpilot
c25b3def82 add dragon_is_eon param 2019-11-12 11:00:19 +10:00
dragonpilot
1c75d7fb14 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-11-11 10:48:03 +10:00
dragonpilot
faf9a36067 update APKs, add lead car detected alert 2019-11-11 10:16:43 +10:00
Alex Wang
50eae23440 Add fingerprint (#875) 2019-11-08 23:34:19 -08:00
Willem Melching
14fc0424b8 Make DBC preprocessing deterministic 2019-11-08 17:26:48 -08:00
Willem Melching
7998cf08d3 Make visiond compile on pc (#874) 2019-11-08 12:49:30 -08:00
dragonpilot
0c0ba60ce4 fix GSH issue 2019-11-08 13:10:44 +10:00
Willem Melching
926e5f397f Fix unicode bug in DoUninstall reading 2019-11-07 13:53:42 -08:00
Willem Melching
1d328da675 Fix fan control when not plugged into panda 2019-11-07 11:28:35 -08:00
dragonpilot
39ee5ba5ad update APK 2019-11-07 11:53:09 +10:00
dragonpilot
7983bbd3bd update APK 2019-11-07 11:42:17 +10:00
dragonpilot
dc15b9cae9 Add mock radar for Bosch 53c945c5cd 2019-11-06 16:44:43 +10:00
dragonpilot
7750dc7784 fix appd/dashcamd error due to changes in messaging 2019-11-06 16:34:14 +10:00
dragonpilot
ad40d8f66d disable update prompt 2019-11-06 15:21:46 +10:00
dragonpilot
4f0fb2ce5d add tw.com.ainvest.outpack to android_packages 2019-11-06 14:57:47 +10:00
dragonpilot
7500d48861 delete signed firmware 2019-11-06 14:50:53 +10:00
dragonpilot
4ed8a032d4 update APK 2019-11-06 12:25:39 +10:00
dragonpilot
a49dc4be02 Merge branch 'devel-unsupported-cars' into devel-en 2019-11-06 12:15:05 +10:00
dragonpilot
3b2e7c208a Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-11-06 12:00:30 +10:00
dragonpilot
c8ccddcb8d fix GSH issue, ISH use better steer angle sensor 2019-11-06 11:57:08 +10:00
dragonpilot
eaff7b4bb4 Merge branch 'devel-unsupported-cars' into devel-en 2019-11-05 13:44:57 +10:00
Riccardo
1ceb7ddf0e Decrease build time for dbc files 2019-11-04 19:23:02 -08:00
dragonpilot
3c0be0b4cd add 2017 Lexus GS450H 2019-11-05 12:08:24 +10:00
Vehicle Researcher
5ed475b25e openpilot v0.6.6 release 2019-11-04 15:13:52 -08:00
dragonpilot
64dbc96480 add aegis speed camera app 2019-11-04 16:43:40 +10:00
dragonpilot
58ca42e7ef update APK 2019-11-01 13:39:11 +10:00
dragonpilot
5ede6a346a remove miui fonts to reduce package size 2019-11-01 13:34:28 +10:00
dragonpilot
5cacbbab13 update offroad to multilangual version 2019-11-01 11:10:54 +10:00
Vehicle Researcher
043e83a160 Merge opendbc subtree 2019-10-31 17:02:32 -07:00
Vehicle Researcher
22023ebd58 Squashed 'panda/' changes from 30c7ca8a5..256d274e7
256d274e7 Fix Mac installation instruction per: https://github.com/commaai/panda/pull/308/files
bfd8ff1b1 Update cppcheck commit with more coverage
b143a1cf9 Fixed Misra complaint
606f1d913 Fixed RTC on non-uno boards, second try. Cannot work when there is no xtal.
933c75770 Fix RTC on non-uno boards (#311)
48d0d0c78 VW button spam: fix safety and add tests (#306)
6cccf969a Fan and IR at 0 when in power savings mode (#309)
05373282a board get_sdk scripts were left on python2
de18a7ef1 bump version after uno merge
1965817d3 Changed default values for testing
a12a148d5 Uno (#274)
7d29dc5a2 bump panda version. We really need a better way
40075321d VW: stricter limits to comply with comma safety policy
e2e2be92c add safety mode to health packet
101238c7f turned on VW ignition based CAN logic
a0d8d5dae fix misra 5.3: check_ignition is intended as check_started and can't be used twice
ea636de61 made check_ignition function to both look at ignition_line and ignition_can
1102e6965 make ignition logic common for all cars (#303)
3a110c6f6 bump version after CMSIS core upgrade
55dfa5230 Update core to CMSIS 5.6 release  (#251)
ee864907c fix linter 2
f410b110d fix linter
55957d6e4 proper python3 exception inheritance
6ba0f47b5 fix linter errors
5c49fe050 Merge pull request #145 from gregjhogan/uds
0f361999b timeout is float
396d6aad5 safety_replay only installs few extra requirements
25af7d301 Misra also need python 3 env
7434c5ce2 centralize requirements for tests
a0c37c70a coverage not needed in linter reqs
fce38a91d Linter python (#299)
62e2f5caa update cppcheck commit
711810d2f more uds debug
4454e3a6b better CAN comm abstraction
6b1f28f57 fix more encoding and some bytes cleanup (#300)
43adad311 fix WARNING_INDICATOR_REQUESTED name
9c857da37 0x
b64d6fa5d typing
768fdf7e1 bytes() > chr().encode()
1be15ea93 custom errors from thread
68da8315f more python3
eb358e81c uds lib example
4f288586d updates for python3
932745f62 support tx flow control for chunked messages
b1c371292 add timeout param
cdf2f626b bug fixes
b1a319577 fix rx message filtering bug
80fb6a6fa convert uds lib to class
59cd2b47f handle separation time in microseconds
4429600d8 fix separation time parsing
c641e66f7 fix typo
48b8dcc6f fix flow control delay scale
78f413d88 flow control delay
33a5167d9 bug fixes
8ee89a091 multi-frame tx
5e89a9c72 clear rx buffer and numeric error ids
966230063 fix remaining size calculation
01ef1fae3 zero pad messages before sending
1ddc9735d uds can communication
dca176e71 syntax errors
95be4811e SERVICE_TYPE enum
98e73b51d more UDS message type implementation
c1c5b0356 uds lib
162f4853d fix chr to bytes conversions (#298)
4972376de Update VW regression test to follow Comma safety index refactoring (#296)
f9053f5df more Python 3 fixes, attempting to fix jenkins wifi regresison test (#295)
2f9e07628 Panda safety code for Volkswagen, Audi, SEAT, and Škoda (#293)

git-subtree-dir: panda
git-subtree-split: 256d274e760ce00d4e5ff5e0d9b86d0fb5924568
2019-10-31 17:02:31 -07:00
Vehicle Researcher
a08e586783 Merge panda subtree 2019-10-31 17:02:31 -07:00
Vehicle Researcher
047924cb35 Squashed 'cereal/' changes from 3d90c7877..90e48c549
90e48c549 add ir pwr field
101facee1 added safety model to health packet
fe09e4c07 distinguish between ignition_line and ignition_can

git-subtree-dir: cereal
git-subtree-split: 90e48c549c505383a7242cfddd32984cd5c268b8
2019-10-31 17:02:27 -07:00
Vehicle Researcher
f85f3b36bc Merge cereal subtree 2019-10-31 17:02:27 -07:00
dragonpilot
5af4d3aeed Merge branch 'devel-unsupported-cars' into devel-en 2019-10-31 11:24:09 +10:00
dragonpilot
06f8fd53ec fix merge conflict 2019-10-31 11:23:50 +10:00
dragonpilot
d9877e694c Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-31 11:22:02 +10:00
Riccardo
d603d5c9b8 Update README with now supported Subaru Harness 2019-10-30 15:15:05 -07:00
Ted Slesinski
8ad2640c11 Adds 2019 Lexus ES (non hybrid) (#866)
* Adds 2019 Lexus ES (non hybrid)

* Updated test route
2019-10-30 10:38:10 -07:00
dragonpilot
2b721f7fc8 update carcontroller.py for honda 2019-10-30 11:56:17 +10:00
dragonpilot
2a29774272 update safety_honda 2019-10-30 10:37:32 +10:00
dragonpilot
4f41bfcd9e fix allow_gas for honda and slightly adjust lead car moving alert value 2019-10-30 09:31:51 +10:00
xBJx
5219d3c023 Added fingerprint from Sienna XLE AWD (#848)
* Added fingerprint from Sienna XLE AWD

* Update driver_monitor.py

* Update driver_monitor.py

* Update driver_monitor.py
2019-10-28 19:26:50 -07:00
dragonpilot
7c0d01a96c add SnG Mod support 2019-10-29 10:02:46 +10:00
dekerr
ee752d5669 remove unnecessary comprehensions (#863) 2019-10-28 15:16:37 -07:00
dragonpilot
88af74a3da Adjust dragon_allow_gas logic 2019-10-28 14:12:50 +10:00
dragonpilot
2393c2264c Merge branch 'devel-unsupported-cars' into devel-en 2019-10-28 12:33:51 +10:00
dragonpilot
44bab52730 remove fp 2019-10-28 12:33:27 +10:00
dragonpilot
4ad87130f9 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-28 12:33:16 +10:00
dragonpilot
c270f64a07 do not send canError if dragon_toyota_stock_dsu is on 2019-10-28 12:30:04 +10:00
dragonpilot
f17f264c1f rename variable 2019-10-28 11:13:27 +10:00
dragonpilot
8ca719e75a Revert "remove gas/brake value modification when allow_gas is enabled"
This reverts commit d3b7d741af.
2019-10-27 09:50:24 +10:00
u8511049
e36a14f1de Add supported car for 2019 Toyota Altis Hybrid (#859)
* add supported car for 2019 Toyota Altis Hybird / Corolla hybrid 2020 (US market)
2019-10-25 10:28:06 -07:00
dragonpilot
6e8ff99781 update lead car alert logic 2019-10-25 09:17:54 +10:00
dragonpilot
9e26bd8a89 remove canbus freq checking 2019-10-24 13:44:03 +10:00
dragonpilot
0df2160823 remove chmod bs 2019-10-22 16:53:36 +10:00
dragonpilot
1ad2ce8b2a slightly adjust es_tss2 port 2019-10-22 11:22:02 +10:00
dragonpilot
61663c77ff ES_TSS2 should be stop_and_go = True 2019-10-21 19:56:32 +10:00
dragonpilot
e5431eab5d completely remove params.put for connectivity check for performance purpose 2019-10-21 19:04:27 +10:00
dragonpilot
09e9f25c29 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-21 16:20:46 +10:00
dragonpilot
344dfa9bca add 2019 Lexus ES200 port from Shell 2019-10-21 16:20:04 +10:00
dragonpilot
d3b7d741af remove gas/brake value modification when allow_gas is enabled 2019-10-21 11:18:17 +10:00
dragonpilot
ce54902f69 disable internet connection checking 2019-10-21 11:11:51 +10:00
Riccardo
4fd5034aff Remove unneded use of replace, causing json to fail loading the alert 2019-10-18 11:29:59 -07:00
dragonpilot
4b962fef63 Add Lead Car Moving Alert 2019-10-18 17:58:12 +10:00
dragonpilot
c61ee95eec Make sure always use unsigned panda firmware 2019-10-18 09:47:14 +10:00
dragonpilot
b5fb96455d adjust STEER_ANGLE to 0.0573 instead of 0.573 2019-10-18 09:41:09 +10:00
dragonpilot
e8c31261c8 Merge branch 'devel-unsupported-cars' into devel-en 2019-10-18 09:39:33 +10:00
dragonpilot
608c8e46fd Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-10-18 09:39:19 +10:00
dragonpilot
0f8cf424ce Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-18 09:38:09 +10:00
Riccardo
9e20d79455 Update ref to process_replay regression test 2019-10-17 14:47:38 -07:00
Jason Young
da1161d7d8 Add core OP support for CRC validation, with extra support for Volkswagen MQB (#836)
* Generalized core OP CRC support plus extra bits for Volkswagen MQB.
2019-10-17 13:58:32 -07:00
Riccardo
62d14b8122 Revert to using the sum of the lane line probabilities instead of the the product 2019-10-17 13:31:28 -07:00
dragonpilot
1608739cf7 Add slow on curve toggle 2019-10-17 14:22:28 +10:00
dragonpilot
3db7389eb8 fix unable to display release note issue 2019-10-17 13:35:10 +10:00
dragonpilot
7c8f42c07e update APK 2019-10-17 10:30:50 +10:00
dragonpilot
84fc30a84b Fix STEER_ANGLE in STEER_TORQUE_SENSOR factor to 0.573 (was 0.056) 2019-10-17 10:21:00 +10:00
dragonpilot
fbbf03bb73 Merge branch 'devel-unsupported-cars' into devel-en 2019-10-17 10:19:50 +10:00
dragonpilot
f096912cb5 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-17 10:19:13 +10:00
dragonpilot
270702f54c Fix charging_ctrl max/min value param reader 2019-10-17 09:59:13 +10:00
dragonpilot
601d0b8f1e Add DragonCarModel/DragonCarVIN params 2019-10-17 09:58:47 +10:00
dragonpilot
5416f2008e delete bs (branch switcher) 2019-10-16 17:22:21 +10:00
dragonpilot
4d8444a4aa upgrade autonavi app to v4.3.0 2019-10-16 16:10:01 +10:00
dragonpilot
4730da4911 Add no-cache header when download changelog 2019-10-16 11:57:49 +10:00
dragonpilot
24ed87e568 Add reboot to flash panda script 2019-10-16 10:36:17 +10:00
dragonpilot
3c658f93c0 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-10-15 11:57:02 +10:00
dragonpilot
f82539ddd4 Update APK 2019-10-14 17:12:13 +10:00
dragonpilot
cdfab1efeb Update APK 2019-10-14 16:59:49 +10:00
dragonpilot
d8501656f0 fix reset_update.sh script again 2019-10-14 16:56:08 +10:00
dragonpilot
5eea31af91 Fix update_panda_firmware.sh 2019-10-14 16:29:13 +10:00
dragonpilot
3caa71ef1b add a script for update panda firmware 2019-10-14 16:03:44 +10:00
dragonpilot
ef33ef60a8 fix reset_update script 2019-10-14 16:03:31 +10:00
dragonpilot
d9ac0507a3 update APK 2019-10-14 13:59:20 +10:00
dragonpilot
3cd0270878 Create a custom script for update feature 2019-10-14 13:44:06 +10:00
dragonpilot
1c03ea3b39 update APK 2019-10-14 12:32:01 +10:00
dragonpilot
7a8f3e1df3 fix charging ctrl toggle 2019-10-14 12:27:39 +10:00
rbiasini
2ea17f00cf Force subaru to assume the stock camera is connected (#849) 2019-10-13 18:25:09 -07:00
dragonpilot
3adf752f1a Display dp's changelog instead of dp's release notes 2019-10-14 11:02:12 +10:00
dragonpilot
8803683a0c remove deprecated dragon params 2019-10-13 10:58:03 +10:00
dragonpilot
c37dd3ec37 re-enable updated 2019-10-13 10:36:21 +10:00
dragonpilot
30f707cf7a Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-10-13 10:17:34 +10:00
rbiasini
77aaead924 Allow to lock safety mode to keep gm/tesla cars supported (#844) 2019-10-11 17:35:07 -07:00
illumiN8i
8e329e1e3a 2019 Highlander Hybrid Limited Platinum (#843)
fingerprint from ogdragonzypher on Discord
2019-10-11 13:46:48 -07:00
dekerr
7ad5f4292e simplify encode/decode in dbc (#840)
* simplify encode/decode
2019-10-11 13:22:16 -07:00
dekerr
a7bfa413ae use list comprehension (#839)
* use list comprehension

* oops index range fix
2019-10-11 00:09:59 -07:00
eFini
b773d54460 Increase LEXUS_IS safetyParam to 77 (#841) 2019-10-10 23:31:05 -07:00
dragonpilot
7f3f07e04e Merge branch 'devel-unsupported-cars' into devel-en 2019-10-11 14:24:04 +10:00
dragonpilot
a1abe13da0 Add Taiwan 2019 RAV4 FP from Max Duan / CloudJ 2019-10-11 14:23:43 +10:00
dragonpilot
e55fd7ae4b Merge branch 'devel-unsupported-cars' into devel-en 2019-10-11 14:17:06 +10:00
dragonpilot
d855a70690 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-11 14:14:35 +10:00
dragonpilot
400889ce65 Fix fp cache issue 2019-10-11 13:44:16 +10:00
dragonpilot
2b706c4335 Fix FP cache 2019-10-11 12:16:18 +10:00
dragonpilot
62cbbb2845 Revert "Fixing up fp cache"
This reverts commit 6b103dac74.
2019-10-11 10:23:37 +10:00
dragonpilot
fa5e8de64d Improve honda dp_allow_gas logic 2019-10-11 09:57:07 +10:00
dragonpilot
6b103dac74 Fixing up fp cache 2019-10-11 09:47:26 +10:00
dragonpilot
07b8c4b0a0 Fix python3 params.get issue in appd 2019-10-10 22:07:05 +10:00
dragonpilot
0f61fe3a44 Fix python3 params.get issue 2019-10-10 21:43:55 +10:00
dragonpilot
3efa000221 use dp spinner 2019-10-10 15:08:01 +10:00
dragonpilot
83c6eca4a1 Fix unavailable variable issue 2019-10-10 14:34:18 +10:00
dragonpilot
d130c6c9a2 Fix unable to display ip address issue 2019-10-10 14:09:09 +10:00
dragonpilot
9798b12384 Update APK 2019-10-10 13:58:03 +10:00
dragonpilot
b67715b480 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-10-10 10:44:43 +10:00
Vehicle Researcher
eec9bb71c4 openpilot v0.6.5 release 2019-10-09 18:43:53 +00:00
Vehicle Researcher
703f51ed56 Merge opendbc subtree 2019-10-09 18:31:57 +00:00
Vehicle Researcher
38faf7f8a4 Squashed 'panda/' changes from 9881e6118..30c7ca8a5
30c7ca8a5 bump version to 1.5.3
9403dbebe Need to fix wifi test before re-enabling.
0812362b5 GPS UART fix until boardd is refactored (#294)
ffbdb87a8 python2 -> 3 fixes to pedal flasher (#292)
78b75ef59 Added build type to release version strings
736c2cbf7 Fixed sending of bytes over PandaSerial
0894b28f1 Fixed USB power mode on black (#291)
4b3358c92 patch to be able to switch from EON to PC with a Panda that has EON b… (#290)
a95c44a71 Made setting of NOOUTPUT on no heartbeat more efficient (#287)
948683688 UART instability fix with high interrupt load (#283)
9a9e9d47b Fix usb_power_mode missing initialization (#289)
af0960ad3 DFU fix (#288)
70219d7bb match safety enum in cereal (#285)
a338d3932 Fix build for jenkins test
78ef4a6eb Stop charge (#284)
5266a4028 Fix typo (#286)
f4787ec5a Revert "turn on CDP when ignition switches on (#281)"
d37daee97 Revert "NONE and CLIENT should be the same thing in white/grey pandas"
e97b283e7 NONE and CLIENT should be the same thing in white/grey pandas
8c1df559f turn on CDP when ignition switches on (#281)
847a35d42 Fix bullet points
fac027716 Misra update (#280)
5a04df6b1 Added description of regression tests to README
c4aabae59 Fixed some python3 bugs in the test scripts and PandaSerial
9af0cb353 Bump version
c4ac3d63b Disable GPS load switching on black pandas
078ee588c This is the correct table, actually
578b95ee3 Misra table of coverage added
d383a2625 bump panda
b98ca010d fix sdk build in python3 env (#279)
63d3dc7d3 Set python3 env before runnign get_sdk, so we know if it fails
e951d79c0 legacy code we don't control can remain python2
11b715118 Merge pull request #276 from commaai/python3
9893a842a Merge pull request #277 from zorrobyte/patch-1
d3268690c Revert "revert back esptool to python2 and force to build esptools with python2"
875e76012 revert back esptool to python2 and force to build esptools with python2
9c40e6240 needed to install python3
ed2ac87cf Also moved safety tests to python3
6842b2d2c move esptool sdk installation before python3 env is set. Kind of a cheat
b5a2cabcd this hopefully fixes build test
628050955 Fixes safety replay
2c220b623 this fixes language regr test
fdbe789b8 use python 3 in Docker container
ee1ae4f86 Better hash print
0de9ef73c Revert "Final 2to3 on the whole repo"
c92fd3bc9 Final 2to3 on the whole repo
5f2bc4460 better
b2a30fdbd make works!
b74005d10 fix sign.py
fe727706b read file as byte and no tab before sleep
32a344ef6 Update README.md
2dc34096a 2to3 applied
ffa68ef71 undo unnecessary brackets for print
dbc248027 Fix all the prints with 2to3, some need to be undo
5a7aeba0f xrange is gone
982c4c928 one more python3 env
1e2412a29 env python -> env python3

git-subtree-dir: panda
git-subtree-split: 30c7ca8a53a3adb05d23d7cfe64fb716a656ef1a
2019-10-09 18:31:56 +00:00
Vehicle Researcher
a78baac2e3 Merge panda subtree 2019-10-09 18:31:56 +00:00
Vehicle Researcher
f66527d0b1 Squashed 'cereal/' changes from ea14abe4b..3d90c7877
3d90c7877 Fix wrong event enum
f4c92cf4e add none/invalid usb power mode
12bc18965 Add fields and states required for robust Volkswagen safety compliance (#8)
16b5850f1 let's spell wolkswagen
6243622e6 Safety cereal (#9)
5cf3c2c76 change order of UsbPowerMode to preserve panda lib behavior
18a291779 usbPowerMode is more useful to log and it comes from panda
152678429 add ldw to visual hud alerts (#5)
24f6fa78c merge https://github.com/commaai/cereal/pull/3 after fixing conflicts
4d5862c54 added event about internet connection
ca070f9fd Added usbPowerOn to health
e2eaa762b add HW type for UNO
e528a2041 Read RPM from fan connected to Panda
8472175d6 Added invalidGiraffeToyota event
71be97053 placeholders for mazda, nissan and vw safety models

git-subtree-dir: cereal
git-subtree-split: 3d90c7877f9ef9269735b074c0cb23f5eb6d2b47
2019-10-09 18:31:55 +00:00
Vehicle Researcher
96bdc0a043 Merge cereal subtree 2019-10-09 18:31:55 +00:00
dragonpilot
d895bd6813 Merge branch 'devel-unsupported-cars' into devel-en 2019-10-09 14:46:13 +10:00
dragonpilot
55fb019272 Revert "Move Max's FP to TSS RAV4H instead of TSS2 variant"
This reverts commit fc3a9adf29.
2019-10-09 14:45:13 +10:00
dragonpilot
a8da7e753c Add warning when LatCtrl is off 2019-10-09 14:43:24 +10:00
dragonpilot
1305ea2483 Add branch switch tool 2019-10-08 14:43:12 +10:00
dragonpilot
050994f673 Update APK 2019-10-08 10:49:49 +10:00
dragonpilot
79bd9d42eb Merge branch 'devel-unsupported-cars' into devel-en 2019-10-08 10:25:37 +10:00
dragonpilot
fc3a9adf29 Move Max's FP to TSS RAV4H instead of TSS2 variant 2019-10-08 10:25:11 +10:00
dragonpilot
7d256852c3 Merge branch 'devel-unsupported-cars' of https://github.com/dragonpilot-community/dragonpilot into devel-unsupported-cars 2019-10-08 10:24:08 +10:00
dragonpilot
6a95cb2b06 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-08 10:23:31 +10:00
dragonpilot
74a2d08430 Remove checks = [] from devel-unsupported-cars branch 2019-10-07 21:11:20 +10:00
dragonpilot
da9fddeaae Merge branch 'devel-unsupported-cars' into devel-en 2019-10-07 21:10:21 +10:00
dragonpilot
860fe53c35 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-07 21:09:11 +10:00
dragonpilot
a5fe383928 move new rav4h fp to tss2 2019-10-07 21:06:11 +10:00
dragonpilot
6c87ac182c Add Taiwan RAV4H FP 2019-10-06 21:44:50 +10:00
dragonpilot
f7c925871a Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-10-06 20:16:21 +10:00
dragonpilot
8f77246fcb Remove zorrobyte's curvature learner, it decreases turning ability 2019-10-06 20:15:21 +10:00
Chris Souers
ee3aedaaea Add 2018 Civic Hatchback 1.0l CVT (European) support (#823)
* Add 2018 Civic Hatchback 1.0l CVT support

test_fingerprints returns fine
2019-10-03 14:18:30 -07:00
dragonpilot
73cc0f1283 Merge branch 'devel-unsupported-cars' into devel-en 2019-10-01 12:16:40 +10:00
dragonpilot
935191e724 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-10-01 12:16:20 +10:00
dragonpilot
bfef97c7b8 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-10-01 12:15:16 +10:00
illumiN8i
3e4f64cc78 Add 2020 Corolla XSE AFS option (#821)
Frank McTank on Discord has XSE with Connectivity Package with Adaptive Front Lighting System option
2019-09-30 13:39:27 -07:00
Kishan Karunaratne
59440ba5b7 Update thermald to set ignition_seen back to False if Panda disconnected (#820) 2019-09-30 13:06:38 -07:00
dragonpilot
a57a05b99d Fix missing curvature_factor val 2019-09-30 12:47:25 +10:00
dragonpilot
a944f7d9ed re-activate curvature learner and upgrade it to v4 2019-09-30 11:44:20 +10:00
dragonpilot
c9d8833dfe ISH to use better steer angle sensor 2019-09-30 11:42:06 +10:00
dragonpilot
1d2ea64938 Disable curvature learner 2019-09-28 16:36:39 +10:00
dragonpilot
73d6d1537a ISH to use better angle sensor 2019-09-28 16:35:04 +10:00
dragonpilot
09162309d1 Add zorrobyte's curvature learner 2019-09-27 15:11:29 +10:00
dragonpilot
d927d61f85 Add ability to toggle driver monitoring 2019-09-27 15:03:22 +10:00
dragonpilot
fc7bb4ea1f disable cut steering for 2s after fault 2019-09-27 14:46:12 +10:00
dragonpilot
185887db37 Make steering wheel transparent 2019-09-27 14:32:35 +10:00
dragonpilot
863d0e1c2c Better way to fix loggerd crash issue 2019-09-26 16:59:09 +10:00
dragonpilot
2c4d7a2cd4 fix boot issue if DragonEnableLogger is disabled 2019-09-26 16:50:41 +10:00
dragonpilot
e22b687197 Update APK 2019-09-25 10:29:33 +10:00
dragonpilot
ea472e00c3 Add blinker ui/param 2019-09-24 16:29:50 +10:00
dragonpilot
9f33903798 Make steering wheel transparent 2019-09-24 16:21:30 +10:00
dragonpilot
8cb4ff08c7 Add params to turn on/off ui lead/path/lane 2019-09-24 14:56:14 +10:00
dragonpilot
9c220ebf44 Reduce var checking to 5 secs 2019-09-23 14:52:57 +10:00
dragonpilot
4197340812 Move ip mod back to it's old location 2019-09-23 14:44:16 +10:00
dragonpilot
1880e7ebdc Update APK 2019-09-23 14:12:02 +10:00
dragonpilot
b9a32d6f61 Add toyota lane departure warning toggle 2019-09-23 13:34:31 +10:00
dragonpilot
ca26fe3087 Fix charging ctrl logic 2019-09-23 13:23:40 +10:00
dragonpilot
d189446b68 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-23 12:36:16 +10:00
dragonpilot
bb273acc28 Add Taiwan Prius 4.5 FP, by Lin Hsin Hung 2019-09-23 12:35:44 +10:00
dragonpilot
13280acb12 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-09-23 12:30:45 +10:00
dragonpilot
8d5ef40e8b Fix battery ctrl logic 2019-09-23 12:29:51 +10:00
dragonpilot
246e687ef9 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-09-20 15:50:21 +10:00
dragonpilot
ced9202c46 Add charging control 2019-09-20 15:49:58 +10:00
dragonpilot
11555e198e Create a new service to handle greypanda gps mode 2019-09-20 15:24:33 +10:00
illumiN8i
a5ebac6ede 2020 Toyota Prius Prime Limited (#813)
* 2020 Prius Prime Limited

Fingerprint for 2020 Prius Prime Limited from garglo. 86a0adcb192c9424

* Update README.md

2020 supported
2019-09-19 12:08:23 -07:00
dragonpilot
d5aba9035b Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-09-19 16:39:35 +10:00
dragonpilot
aa09e16a60 Remove greypanda mode GPS signal adjustment 2019-09-19 16:39:23 +10:00
Willem Melching
3df522b4d1 Add spinner source files (#812) 2019-09-17 12:47:30 -07:00
Riccardo
987ed000b4 Mistakenly removed Honda Fit support from README.md 2019-09-17 11:15:34 -07:00
dragonpilot
eeaa355c77 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-16 14:17:22 +10:00
dragonpilot
a6273f1a36 Merge branch 'devel-unsupported-cars' of https://github.com/dragonpilot-community/dragonpilot into devel-unsupported-cars 2019-09-16 14:16:04 +10:00
dragonpilot
bbc3507854 Taiwan CT200h FP from CloudJ, CT200h port from thomaspich 2019-09-16 14:14:53 +10:00
dragonpilot
b797a10b6e Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-09-16 13:56:56 +10:00
dragonpilot
068a481769 Fix incorrect light_stalk assignment 2019-09-14 18:16:45 +10:00
dragonpilot
9520c20c6b Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-09-14 18:15:41 +10:00
Willem Melching
508dc5742c Revert dPoly computation to 0.6.3 behavior (#809)
* Revert dPoly computation to 0.6.3 behavior

* update test reference
2019-09-13 17:01:54 -07:00
dragonpilot
fe2a3caf51 Fix ISH error 2019-09-13 22:31:20 +10:00
dragonpilot
364aa99ccf kernel call optimization 2019-09-13 16:34:18 +10:00
dragonpilot
08bb061647 Update APK 2019-09-13 15:04:24 +10:00
dragonpilot
d18f5a0b17 update UI to adapt dragon_driving_ui switch 2019-09-13 14:50:11 +10:00
dragonpilot
8452cb5d58 Add missing init value 2019-09-13 13:02:10 +10:00
dragonpilot
0a398a474e Add ability to display/hide speed in UI 2019-09-13 12:58:09 +10:00
dragonpilot
96b8b66a5a Update APK 2019-09-13 12:50:48 +10:00
dragonpilot
1d75585593 Still allow header to be displayed when dragon_driving_ui is disabled 2019-09-13 12:48:39 +10:00
dragonpilot
2fa7df9c22 Update logic so if DragonSteeringMonitorTimer set to <= 0, it will disable steering monitor by increase the value to 86400 (a day) 2019-09-13 12:35:50 +10:00
dragonpilot
e932e5d0dc Update APK 2019-09-13 12:34:39 +10:00
dragonpilot
205a1f8121 Add ability to disable steering limit alert 2019-09-13 11:51:58 +10:00
dragonpilot
8b68e26b36 Update shutdownd logic - reported by loveloveses@wechat 2019-09-13 11:31:48 +10:00
dragonpilot
d49bd6ac02 clean up and fix a couple errors that stop honda cars running 2019-09-13 10:05:11 +10:00
dragonpilot
ebea7ebd2c Fix ISH light_stalk message location 2019-09-13 09:15:23 +10:00
dragonpilot
e7c53b1a4e Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-09-12 23:02:02 +10:00
dragonpilot
7abf659b90 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-12 22:59:57 +10:00
dragonpilot
11824f2756 Add back Shell's odyssey 2019-09-12 22:58:43 +10:00
Comma Device
e815923bb7 ish confirmed working 2019-09-12 21:51:53 +10:00
dragonpilot
88442f0819 supercharge ish 2019-09-12 16:19:05 +10:00
dragonpilot
1e1c3b62f5 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-12 16:14:32 +10:00
dragonpilot
97c5965c65 Add ISH into interface.py 2019-09-12 16:13:56 +10:00
dragonpilot
98444c7783 Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-09-12 15:54:16 +10:00
dragonpilot
b8b2ca7759 Fix up driver_monitor mod so change requires restart (less query to kernel) 2019-09-12 15:54:07 +10:00
dragonpilot
d96f8b17b4 Fix up driver_monitor mod so change requires restart (less query to kernel) 2019-09-12 15:48:56 +10:00
dragonpilot
beb11b88a1 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-12 15:32:57 +10:00
dragonpilot
b84cef9d95 Keep ISH dbc for future reference 2019-09-12 15:32:34 +10:00
dragonpilot
762115f7f8 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-12 15:27:07 +10:00
dragonpilot
db820d39d1 Update 2017 Lexus IS300h port 2019-09-12 15:26:41 +10:00
dragonpilot
6b79d5bc07 Fix up dragon_enable_driver_safety_check mod 2019-09-12 11:43:09 +10:00
dragonpilot
c62aa79af7 Remove matched fingerprint logs 2019-09-11 16:20:37 +10:00
dragonpilot
089165d1b9 Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-09-11 16:14:19 +10:00
dragonpilot
ec73591c7a Fix local variable "dragon_lat_control" error 2019-09-11 16:13:30 +10:00
dragonpilot
192fc94fe5 Fix local variable error 2019-09-11 16:12:55 +10:00
dragonpilot
98f6903eda DP spinner 2019-09-11 12:21:34 +10:00
dragonpilot
4d95c008c5 Add unsupported cars 2019-09-11 12:00:09 +10:00
dragonpilot
0d8dbd73a6 use put_nonblocking instead of params.put 2019-09-11 11:46:31 +10:00
dragonpilot
a5518a2330 更新APK 2019-09-11 11:25:19 +10:00
dragonpilot
bbdcb46dc1 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-11 11:17:03 +10:00
dragonpilot
d06bd5953b Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars
# Conflicts:
#	opendbc/generator/toyota/lexus_is_hybrid_2017_pt.dbc
#	opendbc/lexus_is_hybrid_2017_pt_generated.dbc
#	selfdrive/car/toyota/carstate.py
#	selfdrive/car/toyota/interface.py
#	selfdrive/car/toyota/values.py
2019-09-11 11:16:41 +10:00
dragonpilot
df694ca719 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en
# Conflicts:
#	apk/ai.comma.plus.offroad.apk
#	cereal/car.capnp
#	opendbc/generator/toyota/lexus_is_hybrid_2017_pt.dbc
#	opendbc/lexus_is_hybrid_2017_pt_generated.dbc
#	panda/board/safety/safety_honda.h
#	selfdrive/car/car_helpers.py
#	selfdrive/car/honda/values.py
#	selfdrive/car/toyota/carstate.py
#	selfdrive/car/toyota/interface.py
#	selfdrive/car/toyota/values.py
#	selfdrive/controls/lib/driver_monitor.py
#	selfdrive/controls/lib/lane_planner.py
#	selfdrive/locationd/paramsd.cc
#	selfdrive/ui/ui.c
2019-09-11 11:08:35 +10:00
Willem Melching
a64d4f7cca Driver monitoring fix when face is visible briefly during nighttime (#806) 2019-09-10 17:35:40 -07:00
dragonpilot
aee19a87eb Add ability to disable driving UI 2019-09-11 10:33:52 +10:00
Vehicle Researcher
57b54d6a8a openpilot v0.6.4 release 2019-09-09 23:03:02 +00:00
Vehicle Researcher
797644ded1 Merge opendbc subtree 2019-09-09 23:00:24 +00:00
Vehicle Researcher
876256a268 Squashed 'panda/' changes from 8843af7de..9881e6118
9881e6118 Panda for Mazda (#165)
9a15d2f5b fix version newline
a8ed7d219 add subaru outback/legacy to subaru safety (#259)
bdeb1c953 mazda is #12
14ea4d2e0 merge safety gm in a single file
bf1ef875e Add GM passive safety mode (#266)
c131fffae fix canflash for pedal (#267)
3397b1527 only allow bootloader entry on debug builds
d68356b92 Honda Nidec: fwd stock AEB (#257)
6f532c6d5 Black panda Jenkins (#256)
d68508c79 Gpio race condition fix (#263)
d69d05fc0 Fixed pedal not initializing (#262)
36067e01c Honda safety: fixed incorrect brake decoding. Due to the specific limit of 255, this change does not affect the safety behavior

git-subtree-dir: panda
git-subtree-split: 9881e61184ad0417e9e080767f09585a9c777621
2019-09-09 23:00:23 +00:00
Vehicle Researcher
b358137f1d Merge panda subtree 2019-09-09 23:00:23 +00:00
Vehicle Researcher
cbf2c4e08a Merge cereal subtree 2019-09-09 23:00:20 +00:00
Vehicle Researcher
df46400d6d Squashed 'cereal/' changes from bb94ed98a..ea14abe4b
ea14abe4b add gm passive safety model
78d3e3123 allow to specify a passive safety model in CarParams
8a4f891b6 Add lane change events
44ee5a949 Add lane change states to pathPlan
39e31397a Add dashcamOnly flag
32685f4b2 angleModelBias is deprecated
be719979c move desire to pathplan
82cd0ed1b add desire to controlsState
5b40840a6 add lqr output to LQRState
5a5b9ac28 addtimes

git-subtree-dir: cereal
git-subtree-split: ea14abe4bd57563b8a15419ec0bc1c1de711063f
2019-09-09 23:00:19 +00:00
dragonpilot
67fde00df2 Fix GreyPandaMode logic 2019-09-09 14:25:07 +10:00
dragonpilot
2385b2c981 Add DragonGreyPandaMode logic 2019-09-09 14:17:24 +10:00
dragonpilot
3986b37de0 更新APK 2019-09-09 12:56:48 +10:00
dragonpilot
5ffacb58ae 加入 GreyPandaMode 2019-09-05 15:33:12 +10:00
dragonpilot
0c1f24d48b Merge branch 'devel-unsupported-cars' into devel-en
# Conflicts:
#	selfdrive/car/honda/values.py
2019-09-05 11:16:11 +10:00
dragonpilot
420141f46c 加入 Honda Accord Hybrid China 2019-09-05 11:15:07 +10:00
dragonpilot
0bc81f9ace Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-09-05 11:12:00 +10:00
dragonpilot
93e3c9d725 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-09-05 11:11:39 +10:00
dragonpilot
1bbe8389db 加入 Honda Inspire Hybrid 2019-09-05 11:09:38 +10:00
heitikender
0b0968dc38 Update values.py (#797)
changed Lexus ES DBC scheme to hybrid_tss2, since this is the correct one. Tested on car, works.
2019-09-04 13:38:52 -07:00
dragonpilot
79d38db009 打開 GPS 高精確度定位模式 2019-09-04 15:37:40 +10:00
dragonpilot
85a70c096a Merge branch 'devel-unsupported-cars' into devel-en 2019-09-04 14:40:13 +10:00
dragonpilot
d13c6cc6b3 加入 2019 Taiwan Altis Hybrid (需確認) 2019-09-04 14:39:52 +10:00
dragonpilot
d9f9d439b4 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-04 14:28:51 +10:00
dragonpilot
983ab3001c use PR values 2019-09-04 14:28:14 +10:00
dragonpilot
f1329f043e restore files deleted accidentally 2019-09-04 14:26:39 +10:00
dragonpilot
e9df97064d Merge branch 'devel-lexus-ish-ave30r' of https://github.com/efinilan/openpilot into devel-unsupported-cars
# Conflicts:
#	selfdrive/car/toyota/values.py
2019-09-04 14:22:11 +10:00
dragonpilot
25a76581e6 Merge branch 'devel-unsupported-cars' into devel-en 2019-09-04 14:17:59 +10:00
dragonpilot
deb7e30b6f 加入台灣 2019 Altis 指紋 2019-09-04 14:16:56 +10:00
dragonpilot
720ceff07e Merge branch 'devel' of https://github.com/commaai/openpilot into devel-unsupported-cars 2019-09-04 14:09:33 +10:00
dragonpilot
18064840c4 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-09-04 12:23:21 +10:00
dragonpilot
f9a9b1ddf9 increase sensor_data_age and posenet_invalid_count in paramsd.cc to reduce errors (perhaps caused by additional loads?) 2019-09-02 15:35:01 +10:00
dragonpilot
03a00ccf45 修正 logic 2019-09-02 14:45:25 +10:00
dragonpilot
734b0b295a 加入延遲開啟/關閉 APP 2019-09-02 13:24:07 +10:00
dragonpilot
972e0a7de1 顯示WIFI IP 位置 2019-09-02 11:47:57 +10:00
dragonpilot
1003213bd1 優化 2019-08-30 17:20:07 +10:00
dragonpilot
0573aa7cea Revert "加入電池充電保護"
This reverts commit 4151d152
2019-08-30 15:17:45 +10:00
dragonpilot
5992179d68 Revert "更新APK"
This reverts commit 80a88170
2019-08-30 15:17:34 +10:00
dragonpilot
a139677386 Revert "修正"
This reverts commit 80e24f20
2019-08-30 15:17:27 +10:00
dragonpilot
db45c6c91b Revert "update logic"
This reverts commit d45a88d5
2019-08-30 15:17:17 +10:00
dragonpilot
e081975298 update logic 2019-08-30 14:13:52 +10:00
dragonpilot
dd0b95689d 修正 2019-08-30 13:56:36 +10:00
dragonpilot
e3d3c20ebb 更新APK 2019-08-30 13:35:34 +10:00
dragonpilot
0df46ccd55 加入電池充電保護 2019-08-30 13:24:07 +10:00
dragonpilot
d66a01fc98 更新APK 2019-08-30 12:01:17 +10:00
dragonpilot
afc7f88566 優化服務 2019-08-30 12:00:36 +10:00
Ted Slesinski
25d90b69dc Update README.md (#795)
Honda Fit can be removed from community-maintained branches now.
2019-08-28 12:51:31 -07:00
dragonpilot
c1a78bd98b 更新APK 2019-08-28 16:19:35 +10:00
dragonpilot
f23adbffed 修正錯誤 2019-08-28 16:08:21 +10:00
dragonpilot
caec02ac5e 修正錯誤 2019-08-28 16:04:49 +10:00
dragonpilot
7ca22104d8 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-08-28 11:15:42 +10:00
dragonpilot
79e031b0f5 Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en
# Conflicts:
#	selfdrive/ui/ui.c
2019-08-28 11:15:33 +10:00
dragonpilot
4f98316c45 修改音量調整 logic 2019-08-28 11:10:47 +10:00
dragonpilot
c03ed0e02c 修改音量調整 logic 2019-08-28 09:50:16 +10:00
Ted Slesinski
9e3ff30c0c Adds 2018 Honda Fit support (#266)
* Fit rebased on latest devel

* Added new objects for fit to values.py

* Update readme

* Updated formatting of fingerprint to match others

* Update cargo variable

Co-Authored-By: Pramuditha Aravinda <pramudithaa@zone24x7.com>

* Added tire stiffness, renamed PID kp/ki variables

Co-Authored-By: Pramuditha Aravinda <pramudithaa@zone24x7.com>

* Renamed longitudinal KpBP

Co-Authored-By: Pramuditha Aravinda <pramudithaa@zone24x7.com>

* Renamed longitudinal kpV

Co-Authored-By: Pramuditha Aravinda <pramudithaa@zone24x7.com>

* Renamed longitudinal KiBP variable

Co-Authored-By: Pramuditha Aravinda <pramudithaa@zone24x7.com>

* Renamed longitudinal KiV

Co-Authored-By: Pramuditha Aravinda <pramudithaa@zone24x7.com>

* Set more realistic value for tire stiffness

* CR-V Hybrid doc duplicate
2019-08-27 15:19:25 -07:00
dragonpilot
0e6c5775e4 修正錯誤 2019-08-27 17:24:48 +10:00
dragonpilot
b35cd304b0 修正錯誤 2019-08-27 17:21:45 +10:00
dragonpilot
70b2222ede 加入可調警示音量 2019-08-27 17:13:12 +10:00
dragonpilot
96330c25ce 自動關機改為可調時長 2019-08-27 11:49:00 +10:00
Rick Lan
9fa2a47525 Adjust SafetyParam to 100 as it can do 130 2019-08-26 13:47:02 +10:00
Rick Lan
106f43287e Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/car/toyota/carstate.py
#	selfdrive/car/toyota/interface.py
#	selfdrive/car/toyota/values.py
2019-08-26 13:42:00 +10:00
dragonpilot
6009c36423 Revert "Add support to 2017 Lexus is300h (AVE30R)"
This reverts commit c187ea59
2019-08-26 13:34:46 +10:00
dragonpilot
8621334d76 Add support to 2017 Lexus is300h (AVE30R) 2019-08-26 13:33:30 +10:00
wocsor
d4651fcc79 Update Readme - Avalon and Sienna are now supported (#789)
and 2020 CorollaH and 2020Rav4H are on the way with VINPrinting!
2019-08-22 08:49:38 -07:00
dragonpilot
1b75ac55ac permission 2019-08-23 01:25:31 +10:00
dragonpilot
891d417f7c 修正 appd 2019-08-23 01:22:18 +10:00
dragonpilot
57411524ff 修正permission 2019-08-23 01:10:07 +10:00
dragonpilot
e509158e18 優化appd 2019-08-23 00:59:57 +10:00
dragonpilot
b2b06e8a48 優化appd 2019-08-23 00:55:49 +10:00
dragonpilot
cb5883d57b 更新APK 2019-08-23 00:36:55 +10:00
dragonpilot
f6868275d2 調整camera_offset 單位 2019-08-22 18:05:16 +10:00
dragonpilot
05479c4b7d 加入調整相機偏移距離 2019-08-22 16:25:23 +10:00
dragonpilot
06f47c1352 更新APK 2019-08-22 15:56:00 +10:00
dragonpilot
5c8114ef73 調整appd logic 2019-08-21 23:57:29 +10:00
dragonpilot
3bb4af65ae 調整appd logic 2019-08-21 23:30:53 +10:00
dragonpilot
d022449502 更新3rd Party APP 管理 2019-08-21 17:42:40 +10:00
dragonpilot
46f4e0ac0a 讓第三方APK 不要每次開機都重新安裝 2019-08-21 13:01:27 +10:00
dragonpilot
1fdf2d59b7 更新APK 2019-08-21 12:35:38 +10:00
dragonpilot
a1e0ba73c9 車子啟動後強迫關閉 mixplorer 2019-08-21 12:32:42 +10:00
dragonpilot
8f4281a10f 加入 mixplorer 2019-08-21 12:18:17 +10:00
dragonpilot
b6e97ad135 修正DragonSteeringMonitorTimer 錯誤 2019-08-20 16:21:17 +10:00
dragonpilot
f07e24cba4 修正DragonSteeringMonitorTimer 錯誤 2019-08-20 15:56:06 +10:00
dragonpilot
a3e914ec7a Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-08-20 15:53:51 +10:00
dragonpilot
1d498095aa 加入可設定的 steering monitor timer 2019-08-20 12:46:07 +10:00
dragonpilot
249c6512bb 駕駛監控改至30 分鐘 2019-08-19 21:30:42 +10:00
dragonpilot
c094c53b30 阻止tomtom/autonavi 過熱時使用 2019-08-19 16:45:12 +10:00
dragonpilot
bd2c65ea6d 讓tomtom/autonavi 在起動時自動啟動,熄火時自動關閉 2019-08-19 15:26:21 +10:00
dragonpilot
81836bba3f 修正 honda lat ctrl 關閉時會 trigger steerSaturated 錯誤 2019-08-19 14:26:03 +10:00
dragonpilot
99eec0aa47 semibold 字型改 medium 2019-08-19 12:48:49 +10:00
dragonpilot
47a0a48f0c semibold 字型改 medium 2019-08-19 12:48:32 +10:00
dragonpilot
6b0701c5f9 把loading dragonpilot 改成網址 2019-08-19 12:25:34 +10:00
dragonpilot
197143d3b7 revert 刪除字型 2019-08-19 12:11:38 +10:00
dragonpilot
816bc9d4ca UI 移除MIUI 字型 2019-08-19 12:09:39 +10:00
dragonpilot
16992bfb15 更新APK 2019-08-19 11:49:48 +10:00
dragonpilot
862c5507a1 spinner 改用 dp 圖示 2019-08-19 11:20:47 +10:00
dragonpilot
c209d38d92 關閉 tooDistracted 錯誤,以防 dp 無法啟動 2019-08-19 10:30:03 +10:00
dragonpilot
d900c8e9b2 行車介面改用NotoSansCJK 字型 2019-08-15 17:15:51 +10:00
dragonpilot
52bfd679ad BBUI 轉向顯示至小數點第一位 2019-08-15 15:55:00 +10:00
dragonpilot
d31713a4a8 加入 persist.sys.local 設置 2019-08-15 15:37:39 +10:00
dragonpilot
7b8a2043b9 每次開機後都會把 locale 設定成指定的語系 2019-08-15 15:15:09 +10:00
dragonpilot
c58f2a817c Revert "加入特斯拉音效"
This reverts commit 5772b681
2019-08-14 13:57:54 +10:00
dragonpilot
c4765f9aef 修正開機啟動 autonavi 的錯誤 2019-08-14 12:06:42 +10:00
dragonpilot
255505e532 在 frame 之後再開啟 tomtom/autonavi 2019-08-14 12:03:45 +10:00
dragonpilot
675801948e 加入開機啟動TOMTOM/AUTONAVI 功能 2019-08-14 11:53:59 +10:00
dragonpilot
25634cc2a0 關閉 updated 2019-08-14 11:14:59 +10:00
dragonpilot
1e0f989d3f 延遲 params check 至3秒以減少 kernel calls 2019-08-14 10:31:51 +10:00
dragonpilot
1c43aefada 調整 DragonEnableDriverSafetyCheck Logic 2019-08-14 10:28:58 +10:00
dragonpilot
afbe7830a3 加入特斯拉音效 2019-08-14 10:26:50 +10:00
dragonpilot
02f04dd953 更新APK 2019-08-13 16:56:26 +10:00
dragonpilot
2156e48aa9 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en
# Conflicts:
#	apk/ai.comma.plus.offroad.apk
#	cereal/car.capnp
#	selfdrive/car/honda/carcontroller.py
#	selfdrive/car/honda/hondacan.py
#	selfdrive/car/toyota/carcontroller.py
#	selfdrive/controls/lib/driver_monitor.py
#	selfdrive/controls/lib/model_parser.py
#	selfdrive/ui/ui.c
2019-08-13 14:15:05 +10:00
Vehicle Researcher
dac25e5a14 openpilot v0.6.3 release 2019-08-13 01:36:45 +00:00
Vehicle Researcher
13e3783327 Merge opendbc subtree 2019-08-13 01:34:24 +00:00
Vehicle Researcher
9955b3c806 Squashed 'panda/' changes from 519e39e4..8843af7d
8843af7d bump panda version
6da979e0 remove chffr link

git-subtree-dir: panda
git-subtree-split: 8843af7de9b39c430147dd08b79dd33ea2879a93
2019-08-13 01:34:23 +00:00
Vehicle Researcher
80eb52d1dd Merge panda subtree 2019-08-13 01:34:23 +00:00
Vehicle Researcher
a1ec1c089e Squashed 'cereal/' changes from 748002c1..bb94ed98
bb94ed98 add eps torque to carstate
291319a6 add soundsUnavailable event
9b0b0ee4 add blink msg
072b2e21 use enum for alert sounds

git-subtree-dir: cereal
git-subtree-split: bb94ed98ac9cb5c3448117e28b4fea000e8225ee
2019-08-13 01:34:22 +00:00
Vehicle Researcher
96442bc9e1 Merge cereal subtree 2019-08-13 01:34:22 +00:00
dragonpilot
d56f690432 更新 APK 2019-08-12 22:58:08 +10:00
dragonpilot
b6a6fea700 加入導航 2019-08-12 22:00:05 +10:00
dragonpilot
88a47b0a96 Merge branch 'devel-en' into devel-en-unsupported-cars 2019-08-11 02:01:13 +10:00
dragonpilot
a6088fd3e9 加入新的指紋 2019-08-11 01:58:11 +10:00
dragonpilot
a22b600496 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-08-06 15:43:06 +10:00
Dragonpilot
06a4ca837e 回傳指紋到 sentry.io 2019-08-02 09:18:07 +10:00
Dragonpilot
a0e5e385d7 修改指紋暫存 logic 2019-08-02 09:17:14 +10:00
Dragonpilot
51069dc41e 嘗試更新指紋暫存 2019-08-02 08:53:24 +10:00
Riccardo
f72db32d6e Revert "Revert "Update hyundaican for Correct Message ID on LKAS11 (#746)" (#775)"
This reverts commit 5d1e7ddbc2.
2019-08-01 12:44:41 -07:00
TK211X
97bfc183ef Correct Message ID on LKAS11 under Openpilot .dbc (#747)
https://github.com/commaai/opendbc/pull/172
2019-08-01 12:43:49 -07:00
rbiasini
5d1e7ddbc2 Revert "Update hyundaican for Correct Message ID on LKAS11 (#746)" (#775)
This reverts commit 958f69608c.
2019-08-01 12:35:24 -07:00
TK211X
958f69608c Update hyundaican for Correct Message ID on LKAS11 (#746)
This is the only trace of CF_Lkas_Icon found under /car/hyundai relative to open .dbc

https://github.com/commaai/opendbc/pull/172
2019-08-01 12:34:19 -07:00
Dragonpilot
b83d573701 Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-08-01 11:30:03 +10:00
Dragonpilot
e67b0094b0 更新 APK 2019-08-01 11:29:38 +10:00
Dragonpilot
11f1f9e5a7 加入 UI 設定 2019-08-01 11:28:59 +10:00
Willem Melching
81a1601f3c Fix timeout in longitudinal test (#772)
* Fix timeout in longitudinal test
2019-07-31 18:17:19 -07:00
Dragonpilot
2fafc81e06 加回指紋暫存 2019-08-01 09:25:46 +10:00
Dragonpilot
a31e196205 Revert "移除指紋暫存"
This reverts commit 89574f5c7a.

Conflicts:
	apk/ai.comma.plus.offroad.apk
2019-08-01 09:14:19 +10:00
dragonpilot
02644ab02a dragon_toyota_stock_dsu 模式下只在適當的情況下 pcm_acc_active 才設成 True 2019-07-31 22:34:29 +10:00
dragonpilot
3bad9f3136 原廠 LKAS 只在關閉下觸發,不然會有 steering error 2019-07-31 22:31:52 +10:00
Dragonpilot
534fb98c35 更新 APK 2019-07-31 15:44:27 +10:00
Dragonpilot
624ac8bd8c 加入 Lat 控制開關,Toyota/Lexus 原廠 LKAS 模式 2019-07-31 15:27:16 +10:00
Dragonpilot
7e8a0d2413 更新 APK 2019-07-31 11:25:35 +10:00
Dragonpilot
89574f5c7a 移除指紋暫存 2019-07-31 11:25:15 +10:00
Dragonpilot
0a90614301 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en
# Conflicts:
#	apk/ai.comma.plus.offroad.apk
#	selfdrive/car/car_helpers.py
2019-07-31 11:02:42 +10:00
Vehicle Researcher
9e22d17b0e openpilot v0.6.2 release 2019-07-30 02:27:48 +00:00
Vehicle Researcher
9b898a9365 Merge opendbc subtree 2019-07-30 02:25:29 +00:00
Vehicle Researcher
30bb73d527 Squashed 'panda/' changes from 45d0d286f..519e39e49
519e39e49 Changed heartbeat timeout to be 2 seconds on no ignition
996dc4049 Added heartbeat to black loopback testing
79b44cb7e bump version
59f581317 Black (#254)
096486693 no need to store safety only misra output anymore

git-subtree-dir: panda
git-subtree-split: 519e39e494c0b3dd0cf38581302788b779a03c7b
2019-07-30 02:25:28 +00:00
Vehicle Researcher
346fa152f9 Merge panda subtree 2019-07-30 02:25:28 +00:00
Vehicle Researcher
ad29964e18 Merge cereal subtree 2019-07-30 02:25:27 +00:00
Vehicle Researcher
4808de10d6 Squashed 'cereal/' changes from 4ea03bacb..748002c19
748002c19 angle calib desc
27db4a74e add camera rpy angle msg
a71c4fa7f deprecate old dm model output
6c6ab965f remove hwType from ThermalData. Decided to have health at higher freq instead. This will make last 24H of collected data unreadable. Sorry.
f27249ea9 Add fields for LQR lateral control
654860c8b add decelForModel
995b558d4 add longitudinal plan source
222f2de17 add eye stuff
eebf268ea hasGps is a better name than hasGpsAntenna
12da45fda Blackpanda (#4)

git-subtree-dir: cereal
git-subtree-split: 748002c1900700a3df93edf26071510225038ee6
2019-07-30 02:25:26 +00:00
Chris Souers
53b0e3b6ac Update README.md (#766) 2019-07-29 15:06:34 -07:00
Dragonpilot
d6898b1245 優化 params.get 讀取次數,最快每秒讀一次 2019-07-29 15:03:53 +10:00
Dragonpilot
2014a651f5 fix logic 2019-07-29 14:09:39 +10:00
Dragonpilot
c73cbdd69e 更新 APK 2019-07-29 13:57:30 +10:00
Dragonpilot
4b54ecdf2f 加入 Toyota/Lexus 原廠 DSU 模式 2019-07-29 13:26:30 +10:00
Dragonpilot
bfda984aa1 Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-07-29 10:39:19 +10:00
Dragonpilot
5a7da65049 更新 crash.py 讓它能回傳更多訊息 2019-07-29 10:39:06 +10:00
dragonpilot
d12b26a2ed Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-07-28 10:22:20 +10:00
Rick Lan
2e766dd0db comment out unused var (causing panda flash error?) 2019-07-28 10:17:31 +10:00
Dragonpilot
3e30f8eb36 更新 APK 2019-07-26 15:02:00 +10:00
Dragonpilot
7bf0e245c6 更新變數名 2019-07-26 14:50:45 +10:00
Dragonpilot
cf43256b1d Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into devel-en 2019-07-26 12:01:48 +10:00
Dragonpilot
52e564a4d4 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-07-26 12:01:06 +10:00
Gernby
15562775d8 Remove offset from curvature (#761) 2019-07-25 15:00:50 -07:00
dragonpilot
34f2b3404f 更新 APK 2019-07-25 22:22:06 +10:00
dragonpilot
7984d3dc8c 更新 APK 2019-07-25 21:59:11 +10:00
dragonpilot
a4031262d9 Merge pull request #7 from eFiniLan/dp-bbui
加入 BBUI
2019-07-25 21:40:59 +10:00
Rick Lan
61d2b7d151 Merge branch 'devel-en' of https://github.com/dragonpilot-community/dragonpilot into dp-bbui
# Conflicts:
#	common/params.py
#	selfdrive/dragonpilot/dragonconf/__init__.py
2019-07-25 21:13:59 +10:00
Rick Lan
34beaeecd3 finalise BBUI 2019-07-25 21:03:47 +10:00
Rick Lan
747bb5a5e0 bbui mod 2019-07-25 17:27:58 +10:00
Arne Schwarck
0051c8a6f7 self.poller not used (#759)
I do not see the need for zmq and the poller being initialized and not used.
2019-07-24 11:45:53 -07:00
dragonpilot
bf5d68dae6 Make it always write new cache fp 2019-07-24 00:28:31 +10:00
Dragonpilot
95abf32e32 加入 DragonAllowGas 功能 2019-07-23 15:51:45 +10:00
Dragonpilot
e8acd2a969 加入 DragonAllowGas 功能 2019-07-23 15:40:30 +10:00
Dragonpilot
b15a4c7435 取消自動更新 2019-07-23 12:10:46 +10:00
Dragonpilot
7d795f4dca 更新 APK 2019-07-23 12:07:34 +10:00
Dragonpilot
e764548702 更新 APK 2019-07-23 10:56:10 +10:00
Dragonpilot
e3bb1a9f05 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en
# Conflicts:
#	apk/ai.comma.plus.offroad.apk
#	cereal/car.capnp
#	selfdrive/car/car_helpers.py
#	selfdrive/car/toyota/interface.py
#	selfdrive/controls/lib/driver_monitor.py
#	selfdrive/manager.py
2019-07-23 10:55:28 +10:00
Vehicle Researcher
e3a266863d openpilot v0.6.1 release 2019-07-22 19:17:47 +00:00
Vehicle Researcher
11f0915771 Merge opendbc subtree 2019-07-22 19:15:28 +00:00
Vehicle Researcher
1ff59baea7 Squashed 'panda/' changes from ae816c104..45d0d286f
45d0d286f remove whitespace (#255)
e49d0dbbd Pedal: use avg between tracks (#253)
c597dcc89 VERSION update after health packet changes and minor misra test change
01072bec0 Misra 11.x: pointer usage. (#250)
fd68c26ab Propagate can_push errors (#249)
ce1daf206 Misra check only done for EON config
70d4fd7f6 cleanup docker container on failure
04756a037 Turning back Misra check: unvoluntarily change
fcb1208e1 fix weird code in USB_ReadPacket
b983cc8fe Re-wrote test_misra.sh
0b1920636 Misra 17.7: The value returned by a function having non-void return type shall be used. We should hang on initial failed safety_set_mode
06ee8bd2d Ignore Misra 5.4 until cppcheck bug (?) is fixed
4be858224 Update cppcheck commit and pass predefined params to avoid impossible combinations of configs
f45dd04c6 cppcheck: ignore redundantAssignment and selfAssignment for registers in llcan.h
9ce631155 Misra 12.1 (operator order) and 10.4 (incompatible essential types) fixes, arised after properly checking UID_BASE config
1cd34e564 Explicitly set the define and undefine for unknown configs in misra checks
5a024999d remove esp flash from run_automated_tests.sh
23e3684d7 Cppcheck unused functions (#247)
c97d60be6 Removed bad language
b031480a7 Missed adding Dockerfile
91ff6bb21 Run language checker in CI
205ec342a Improved language checker
f7bbab072 Language checker test
d9d0a62f2 Misra 5.5: missed this change from previous PR
85fa3c02a Misra 5.5: Identifiers shall be distinct from macro names (#246)
190d604a0 Pedal: 2 minor fixes to Misra 15.7 (else needed) and 17.7 (non-void output must be used)
8ea01ff12 Pedal: no built-in functions to avoid puts and putc re-definitions
1f40d1e6a Misra pedal (#245)
a4554e3e6 Ignore advisory Misra 19.2: the union keyword should not be used
e6dc4172b Minor indent error
247e128b4 Fix strict compiler on bootstub build
ba6856921 Removed build strict test and enabled -Werror flag
da11f0fa0 safety replay: update openpilot-tools after logreader fix
fc8b9e49b Cppcheck: also check pedal
f7bd2c2f3 Misra 10.4: fix last 2 violations (#242)
9be5fdead finished misra 17.8 (#241)
3c3aba3db Misra 10.4: Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category (#240)
f2a3a177b Misra 15_7: fix what seems to be a false positive of cppcheck
812ace538 Misra 15_7: if … else if constructs should be terminated with an else clause (#230)
79e9735ae rename 5_wifi_udp.py
3c3ff0c03 Update Jenkinsfile (#239)
1bd928437 Misra 17.7: the value returned by a function having non-void return shall be used (#237)
18c9e88bc Merge pull request #238 from commaai/misra_17_8
7ac321de4 Merge pull request #235 from commaai/memxxx
004e543cc Jenkins: run EON test first
4bff28620 Merge branch 'memxxx' of github.com:commaai/panda into memxxx
7cd80de23 typo
385e33b32 12.1 regression
955842bae WIP
ea908cbb7 10_1 violations: Operands shall not be of an inappropriate essential type (#233)
fa3303805 Fix Misra 5.3: An identifier declared in an inner scope shall not hide an identifier declared in an outer scope (#236)
ebfe1c512 Merge branch 'master' of github.com:commaai/panda into memxxx
8c11470ef Fix EON test case
64e18e841 fix inverted logic to differentiate between dev and EON panda builds
36755a0fd Merge branch 'master' of github.com:commaai/panda into memxxx
e2981d612 skip wifi tests for EON panda build
db2eec98c Merge branch 'master' of github.com:commaai/panda into memxxx
11257e79a Ignore test 5_wifi_udp.py_ignore: too unreliable for now
6973c2a81 fix wifi tests
cf6985ad1 memxxx function changes to be Misra compliant
3a6cd2930 wifi threshold perc back to 20%. Problem wasn't this.
d92a03528 faster docker build for safety replay
3e9469b3e Fixing tests after min->MIN  change
ecb9b6c01 Revert "Misra 10 1: Operands shall not be of an inappropriate essential type (#232)"
8732e4faf Misra 10 1: Operands shall not be of an inappropriate essential type (#232)

git-subtree-dir: panda
git-subtree-split: 45d0d286f4b5c893590a98ec1438b8a143b9605d
2019-07-22 19:15:27 +00:00
Vehicle Researcher
ef8305d13d Merge panda subtree 2019-07-22 19:15:27 +00:00
Vehicle Researcher
813d5b9982 Squashed 'cereal/' changes from 9f2076eef..4ea03bacb
4ea03bacb add speed
2198ad240 add alert for invalid posenet
9c18b3b21 rename to posenetValid
42669a812 add posenet debug fields to LiveParameters
852846f17 add whether point is detected by radar
1684698e5 add model prob
fb87dba0b added HW type to support various panda versions
820bf7b4c added tooDistracted event
1105dc1e8 different name
45c424989 add second model lead
f8c557fa3 Log can errors from panda
04f105a22 back
ff9332035 add lead stuff

git-subtree-dir: cereal
git-subtree-split: 4ea03bacbfad1f086caa458de7788771b0c7c515
2019-07-22 19:15:25 +00:00
Vehicle Researcher
86063b41dd Merge cereal subtree 2019-07-22 19:15:25 +00:00
Dragonpilot
18125068e3 fix missing variables 2019-07-22 16:37:41 +10:00
Dragonpilot
6a284fc24c Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en 2019-07-22 16:10:24 +10:00
Dragonpilot
62afb42240 更新 APK 2019-07-22 16:10:06 +10:00
Dragonpilot
99b5ec04d2 Merge branch 'devel-disable-uploader' into devel-en 2019-07-22 15:39:01 +10:00
Dragonpilot
17effeff51 加入取消上傳comma ai記錄功能 2019-07-22 15:28:43 +10:00
rbiasini
4419fdc0df Use standard steer angle sensor in DSU-less pre-TSS2 Toyota. (#751) 2019-07-20 23:21:50 -07:00
Dragonpilot
80a5544bf2 Revert "把accordh 的指紋往上移"
This reverts commit 6c23abac48.
2019-07-16 15:43:35 +10:00
Dragonpilot
6c23abac48 把accordh 的指紋往上移 2019-07-16 15:22:52 +10:00
Dragonpilot
52adf9d190 更新 ACCORDH 指紋,支援 2019 版 2019-07-16 14:28:20 +10:00
Dragonpilot
2ee5cb849a 移除 safeguardd 服務 2019-07-16 11:26:59 +10:00
ErichMoraga
afd2b9f6d9 Added 2019 Toyota Highlander (#739)
Tested latest commit on ICE version, and it worked flawlessly out of box.  Fantastic experience.
2019-07-15 09:55:51 -07:00
Dragonpilot
c21ff40343 更新 APK 2019-07-15 11:42:24 +10:00
Dragonpilot
904ef92505 Merge branch 'devel-en' of https://github.com/dragonpilot/dragonpilot-dev into devel-en
# Conflicts:
#	apk/ai.comma.plus.offroad.apk
2019-07-15 11:18:37 +10:00
Dragonpilot
5922f488d7 更新 APK 2019-07-15 11:17:23 +10:00
dragonpilot
1253f1eebb 加入 pickle.loads 讀取暫存資料 2019-07-13 22:45:34 +10:00
dragonpilot
99be18e32f Merge branch 'devel' of https://github.com/commaai/openpilot into devel-en
# Conflicts:
#	selfdrive/controls/lib/model_parser.py
2019-07-13 22:37:57 +10:00
Riccardo
a94ef2cacd Improve Toyota Highlander tuning from https://github.com/commaai/openpilot/pull/690 2019-07-12 19:24:35 -07:00
eFini
d7878df3da add loggered, gpsd, sensord to gitignore (#735) 2019-07-12 11:02:23 -07:00
Gernby
7ad0d8ca45 Fix lane centering with single lane line (#737) 2019-07-12 10:55:34 -07:00
dragonpilot
4b5b49756d 更新APK 2019-07-12 20:56:17 +10:00
dragonpilot
c4159ba7a0 修正暫存指紋錯誤 2019-07-12 20:22:23 +10:00
eFini
4db632d669 fix spacing in toyota/carstate.py (#736) 2019-07-11 21:22:02 -07:00
Dragonpilot
3d7c8e5795 更新 APK 2019-07-12 13:54:24 +10:00
Dragonpilot
26cbf76312 更新 APK 2019-07-12 13:22:59 +10:00
Dragonpilot
92fc4c8aa1 方向燈取消方向盤控制開啟時顯示提示訊息 2019-07-12 12:08:16 +10:00
dragonpilot
4bde16547e Merge pull request #5 from eFiniLan/dragonpilot-cache-fp
加入暫存指紋功能
2019-07-12 09:47:38 +10:00
dragonpilot
0cee9d388a Merge pull request #4 from eFiniLan/dragonpilot-dev-lkmod
加入 honda 的 Lane Keeping 模式開關
2019-07-12 09:47:07 +10:00
Rick Lan
eef175d247 更新參數名 2019-07-12 09:35:05 +10:00
Rick Lan
2b44c2fe3d 將數值分開儲存 2019-07-12 09:16:49 +10:00
Rick Lan
ff3145215e use pickle instead of repr 2019-07-11 16:30:06 +10:00
Rick Lan
03cbdb3fae Merge branch 'dragonpilot-dev-en' of https://github.com/dragonpilot/dragonpilot into dragonpilot-cache-fp
# Conflicts:
#	common/params.py
#	selfdrive/dragonpilot/dragonconf/__init__.py
2019-07-11 16:28:52 +10:00
Rick Lan
d91c191854 make car fingerprint cacheable 2019-07-11 15:40:12 +10:00
Rick Lan
5ab145d968 remove unnecessary changes 2019-07-11 11:21:46 +10:00
Dragonpilot
a8ac2023d5 Merge branch 'devel' into dragonpilot-dev-en 2019-07-11 10:52:24 +10:00
Rick Lan
b35e861262 add alerts for lkmode 2019-07-11 10:16:46 +10:00
Rick Lan
e355fde8bf add alerts for lkmode 2019-07-11 10:11:16 +10:00
Rick Lan
9006734293 Merge branch 'dragonpilot-dev' of https://github.com/dragonpilot/dragonpilot into dragonpilot-dev-lkmod 2019-07-11 09:35:00 +10:00
Rick Lan
cc85c30c4f 修正打方向燈取消方向盤控制結束後產生的錯誤 2019-07-11 09:14:26 +10:00
Rick Lan
b41741136d 更新 APK 2019-07-10 16:26:35 +10:00
Rick Lan
b356d39779 修正Noctua模式 2019-07-10 15:26:14 +10:00
Rick Lan
ffba451dce 修正Noctua模式 2019-07-10 15:22:25 +10:00
Rick Lan
c283b71b42 加入Noctua模式 2019-07-10 15:11:09 +10:00
Rick Lan
5016d5bd58 修正關閉記錄功能 2019-07-10 14:10:53 +10:00
Rick Lan
454cfc929b 加入關閉記錄選項 2019-07-10 11:25:44 +10:00
Rick Lan
72bfd147f3 fix issue after merge 2019-07-10 09:59:51 +10:00
Rick Lan
74cbb6fde3 update to 0.6 2019-07-10 09:51:52 +10:00
Nick Brown
99a96a99bc 2019 Rav4 Limited AWD (#732)
* Fingerprint

* Merge Limited and XLE fingerprint because they're the same
2019-07-08 17:02:59 -07:00
dekerr
affbdfafcd Refactor default Civic params (#720)
* move civic params out

* fix variable name

* simplify ford scaling

* cleanup

* remove import dependency

* requested changes

* keep hyundai
2019-07-08 16:59:32 -07:00
Rick Lan
87de29ee47 lkmod from honda 2019-07-04 15:02:27 +10:00
Willem Melching
28419d09da Fix run_docker_tests.sh (#730) 2019-07-03 15:53:49 -07:00
Willem Melching
c1e2a1e9be Make build deterministic and do not rebuild on release2 (#729)
* sort dbc files to make linking deterministic

* touch all files on release2 checkout to prevent rebuild
2019-07-03 12:25:35 -07:00
Rick Lan
86425f095b Merge branch 'dragonpilot-dev' of https://github.com/dragonpilot/dragonpilot into dragonpilot-dev 2019-07-03 15:21:35 +10:00
dragonpilot
41a95a64f0 Merge pull request #1 from eFiniLan/dragonpilot-dev
Dragonpilot 客制功能
2019-07-03 14:04:24 +10:00
Rick Lan
e60fa6453c 啟動畫面文字改為 dragonpilot 2019-07-03 13:50:00 +10:00
Rick Lan
15c9e398f1 Revert "啟動畫面文字改成 dragonpilot"
This reverts commit 0992311f
2019-07-03 13:49:18 +10:00
Rick Lan
7e560cef77 啟動畫面文字改成 dragonpilot 2019-07-03 13:48:32 +10:00
Rick Lan
31a83f69a6 調整UI 顯示 N/A 時使用的字數 2019-07-03 13:44:07 +10:00
Rick Lan
8783c5fd71 加入 dragonpilot offroad apk 2019-07-03 13:41:43 +10:00
Rick Lan
bd6c37dcaa 修正錯誤 2019-07-03 13:35:08 +10:00
Rick Lan
d8d4dcbda0 當轉向燈暫停方向控制功能開啟時,我們在方向燈關閉後一秒取回控制 2019-07-03 13:27:37 +10:00
Rick Lan
04863474d2 Merge branch 'dragonpilot-dev' of https://github.com/eFiniLan/openpilot into dragonpilot-dev 2019-07-03 12:43:21 +10:00
Rick Lan
f41a49132f 修正 dashcamd 和 safetyguard 邏輯 2019-07-03 12:41:53 +10:00
Riccardo
6afa454543 Chrysler Pacifica 2018 Hybrid: fix fingerprint 2019-07-02 15:24:51 -07:00
Riccardo
500c8ad2af Chrysler Pacifica 2018 Hybrid: add fingerprint 2019-07-02 11:45:24 -07:00
Rick Lan
47294b083f 修正 dashcamd 和 safeguardd 無法啟動的錯誤 2019-07-02 22:50:24 +10:00
Rick Lan
ac443ea42f 更改 safetycheck 預設值 2019-07-02 16:25:46 +10:00
Rick Lan
c21c824010 dragonconf 改至 apk 2019-07-02 16:19:22 +10:00
Rick Lan
7b3cab409a 修正參數名,將自動關機設定單位換成分鐘,修正dragonconf logic 2019-07-02 16:17:01 +10:00
Rick Lan
c9bf25b937 重新命名變數,apk 不支援 underscore 2019-07-02 12:57:22 +10:00
Rick Lan
54da0f0fb9 remove unneeded changes 2019-07-02 11:21:56 +10:00
Rick Lan
d5d7a46d45 remove unneeded changes 2019-07-02 11:18:21 +10:00
Rick Lan
8e6f4e5200 remove unneeded changes 2019-07-02 11:15:51 +10:00
Rick Lan
4e1518c90a revert safety_toyota.h change 2019-07-02 11:11:37 +10:00
Rick Lan
d55c7ef173 移除油門不取消 OP 選項 2019-07-02 11:04:36 +10:00
Rick Lan
d8665f682b Merge branch 'devel' of https://github.com/commaai/openpilot into dragonpilot-dev
# Conflicts:
#	panda/board/safety/safety_toyota.h
#	selfdrive/car/honda/interface.py
#	selfdrive/controls/lib/model_parser.py
#	selfdrive/ui/ui.c
2019-07-02 10:13:33 +10:00
Rick Lan
d79c10c022 修正 toyota d_allowGasOnOP,移除 panda 檢測 gas/brake 2019-07-02 10:02:52 +10:00
George Hotz
5077378c1c Merge pull request #716 from dekerr/readme
Update README
2019-07-01 14:15:34 -07:00
Willem Melching
7265e635b9 Exclude tools from linter (#718)
* exclude tools from linter

* Exclude tools from pylint too
2019-07-01 13:14:16 -07:00
Willem Melching
76dde174d8 Install fastcluster in CI for controls tests 2019-07-01 12:16:16 -07:00
Vehicle Researcher
7b469bc8be openpilot v0.6 release 2019-06-28 21:11:30 +00:00
Vehicle Researcher
bbc7de2cbd Merge pyextra subtree 2019-06-28 21:09:14 +00:00
Vehicle Researcher
78e4e4ea23 Squashed 'pyextra/' changes from 4348db7e8..d54ef825d
d54ef825d Merge pull request #1 from commaai/new-usr
e3e0520e4 put back logentries and overpy
c3ad0b3dd remove everything

git-subtree-dir: pyextra
git-subtree-split: d54ef825db8d96de8c960ac57a33ac11fa7728bf
2019-06-28 21:09:14 +00:00
Vehicle Researcher
23c0cd841a Merge opendbc subtree 2019-06-28 21:09:13 +00:00
Vehicle Researcher
dba8e01e54 Squashed 'panda/' content from commit ae816c104
git-subtree-dir: panda
git-subtree-split: ae816c104a99a8cd4d508ccd6abdc7b93053529c
2019-06-28 21:09:12 +00:00
Vehicle Researcher
bf26f737fd Merge commit 'dba8e01e540f8b6b231be082ee6d36304aa1997d' as 'panda' 2019-06-28 21:09:12 +00:00
Vehicle Researcher
838bcaa843 Remove old panda subtree 2019-06-28 21:09:11 +00:00
Vehicle Researcher
24e096d9f0 Squashed 'cereal/' content from commit 9f2076eef
git-subtree-dir: cereal
git-subtree-split: 9f2076eefd6f71c9b640d26d29ed33a6bbcbf4ca
2019-06-28 21:09:10 +00:00
Vehicle Researcher
b255a0d55a Merge commit '24e096d9f0f424c22b616b43957a5fd310f4ee83' as 'cereal' 2019-06-28 21:09:10 +00:00
Vehicle Researcher
bbf513839a Remove old cereal subtree 2019-06-28 21:09:09 +00:00
Rick Lan
b079fa23a6 將 dragonconf 移至系統的 params, 方便將來移植到 APK 2019-06-28 15:22:34 +10:00
Rick Lan
81fbea44e4 加入油門不取消 OP 選項 2019-06-27 15:11:18 +10:00
Rick Lan
afb3405654 加入轉向燈暫時取消 OP 方向盤控制選項 2019-06-27 15:11:18 +10:00
Rick Lan
ef079957aa 加入 minimal UI 2019-06-27 15:11:18 +10:00
Rick Lan
db500be81d 加入斷電自動關機功能 2019-06-27 15:11:18 +10:00
Rick Lan
71602b28de 加入安全檢測功能 (提示駕駛以防止 OP 在使用中突然斷開 USB) 2019-06-27 15:11:18 +10:00
Rick Lan
9a496c5a6a 加入 mediaplayer (播放音效) 2019-06-27 15:11:18 +10:00
Rick Lan
8d7f18dea9 加入完全取消駕駛監控選項 2019-06-27 15:11:18 +10:00
Rick Lan
8cd5abd0e1 調降模型路寬至 3.5m 2019-06-27 13:33:15 +10:00
Rick Lan
3580a36be3 加入 dashcam (行車記錄) 2019-06-27 13:30:33 +10:00
Rick Lan
65f19b01fa 加入 dragonconf 讀取 /data/dragonpilot.json 設定 2019-06-27 13:27:58 +10:00
Rick Lan
42effa5f4e 讓 UI 能夠顯示中文 2019-06-27 12:00:52 +10:00
Rick Lan
4b4f541455 自動安裝中文字型 2019-06-27 11:56:49 +10:00
Rick Lan
327a5d426b 修改 sentry.io 相關程式碼
* 提供更多的資訊
* 將錯誤轉發至 dragonpilot 帳號
2019-06-27 11:36:32 +10:00
dekerr
0bf3fa6bf8 remove 17 odyssey 2019-06-26 15:20:11 -04:00
eFini
402e07827c Updating existing fingerprint to support both China 2017 & 2019 CRV-H (#689)
* Fingerprint works on both China 2017 & 2019 CRV-H

* update readme
2019-06-25 14:15:38 -07:00
TrackZero
56aba899df Added fingerprint for 2019 Toyota Prius LE (#694)
* Adding fingerprint for 2019 Prius LE
2019-06-25 14:04:39 -07:00
Rick Lan
979d1e9fb4 Merge branch 'devel' of https://github.com/eFiniLan/openpilot into devel-lexus-ish-ave30r 2019-06-25 13:44:06 +10:00
Rick Lan
9f1dc4194e Merge branch 'devel' of https://github.com/eFiniLan/openpilot into devel-lexus-ish-ave30r 2019-06-25 13:42:38 +10:00
Rick Lan
e8d2b3232e Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-06-24 16:24:32 +10:00
dekerr
8794ebc92f update vals (#705) 2019-06-20 12:22:30 -07:00
Willem Melching
d0d631285b Deterministic boardd build (#702) 2019-06-17 15:23:03 -07:00
rbiasini
c5ce0dcddd Reconcile panda pedal cancel logic for Toyota with controls (#698) 2019-06-13 17:51:12 -07:00
rbiasini
609a80ba0e Subaru re-added to the list of supported cars with with DIY giraffe (#691)
* Subaru re-added to the list of supported cars with with DIY giraffe

* Minor line break fixes
2019-06-07 18:09:29 -07:00
George Hotz
d30f8e5c75 Merge pull request #679 from njbrown09/entunehotspot
Add Toyota Entune Wifi hotspot to hotspot check.
2019-06-06 23:11:43 -07:00
Rick Lan
cacc7f082f Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-06-07 08:11:31 +10:00
Rick Lan
f60d3290c5 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-06-07 08:10:39 +10:00
Vehicle Researcher
deaad0f8fd openpilot v0.5.13 release 2019-06-06 04:38:45 +00:00
Vehicle Researcher
7ccae06bce Squashed 'pyextra/' changes from 4242801..4348db7
4348db7 add PyJWT we use in backend

git-subtree-dir: pyextra
git-subtree-split: 4348db7e867dafbbcb7ec0302b5528688d1102c6
2019-06-06 04:31:54 +00:00
Vehicle Researcher
c250fb9e0d Merge pyextra subtree 2019-06-06 04:31:54 +00:00
Vehicle Researcher
8373f5bfce Merge opendbc subtree 2019-06-06 04:31:49 +00:00
Vehicle Researcher
72f242319d Merge panda subtree 2019-06-06 04:31:46 +00:00
Vehicle Researcher
9a143c5ab2 Squashed 'panda/' changes from 3e199cb..7f8babb
7f8babb Much more thorough limit safety tests on Honda, also switching long_controls_allowed
71099ef AddedToyota safety test around long_controls_allowed logic and fixed a bug
07fd31e added long_controls_allowed tests in GM
6ce580a added function to get/set long_controls_allowed
a2f93d4 update VERSION
380b7c7 Long allowed (#202)
09714e3 Toyota gas cancellation (#200)
436b203 Honda safety: fixed bug and properly abstracted gas_interceptor_detected variable
220cc8f Honda safety: this concludes the proper re-naming
a00a50c Honda safety: better naming
95b0109 Toyota: fixed regression safety tests
192fd05 Toyota safety: fixed rounding logic
0c5b220 Merge pull request #194 from commaai/refactor
b35f6ff legacy build is no longer supported
a06af9f always LIVE on EON
dc5979f LIVE on EON
0b26645 no EON by default
1906a4b panda now draws below 100mw in power save mode
e70b44a move that to main.c
dfce5f6 minor fixes, and no more autobaud
7f303e8 bump version to 1.3.0
96a7e31 a soothing blue in power save mode
a74f001 refactor power savings to depend on car started bit
386d5df can wake from sleep is removed, didn't work in the first place
881b1f4 not on pedal chip
0a9f8eb remove many ifdef PANDA
5069005 remove nested includes and include guards
3810452 WTF WHY WAS THIS SHIT PUT EVERYWHERE
3cf8db9 can.h always has CAN3
1f97c21 refactor pedal bootstub to use llcan
58ec63b oops, backward
6255097 new style power savings
6b282f1 tesla doesn't need a special LIN hook
1d24677 refactor #ifdef EON
d9306c5 NEO are no longer supported
4af036e fixup puts
2c1e5f6 the refactor continues
7517f2c remove ifdef PANDA from main
aec40ae remove fan, as it was only for NEO board
605bb27 fix bootstub build
c0f1f6e move things around for simplicity
f32f039 factor out clear_send
8221927 this is probably broken. refactor out llcan and clock
1114cb1 ELM327 safety mode: re use existing functions
cd104e2 Vin query msg is 0x7df
223323a Examples: fixed import bug
533d239 update price
4396fb9 Update jenkinsfile (#193)
1aa00c9 Misra c2012 (#192)
047bd72 fix tests and remove rev b support

git-subtree-dir: panda
git-subtree-split: 7f8babb8adf6e9c10bf3aecbe8c8eac0b155d066
2019-06-06 04:31:45 +00:00
Nick Brown
e0cf685e45 Camry Fingerprint (#647) 2019-06-05 17:56:21 -07:00
CAmaninacan1
2be290d146 Update values.py (#687)
Added fingerprint for 2019 Highlander XLE
2019-06-05 16:35:48 -07:00
Rick Lan
1a8a5dbee2 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-06-05 16:31:13 +10:00
Nick Brown
987fd0ade3 Detect toyota connected car wifi as a hotspot and not a normal home wifi network. 2019-06-02 00:18:00 -04:00
Joel Natividad
e592f889c1 Correct typos (#677)
“thansk” to “thanks”
2019-06-01 17:03:10 -07:00
Willem Melching
86fb709c81 Revert "Fix registration's params get_git_remote()" (#674) 2019-05-31 17:32:43 -07:00
ChaseCares
28e4960780 Add 2019 RAV4 XLE fingerprints (#671)
* Add 2019 RAV4 XLE fingerprints
2019-05-31 16:47:07 -07:00
George Hotz
9775aa165f Merge pull request #673 from rafcabezas/devel
Fix registration's params get_git_remote()
2019-05-31 16:44:08 -07:00
Willem Melching
a80b506f96 Merge pull request #669 from martinl/feature_subaru_lane_lines
Add lane lines visible indicators to Subaru dash display
2019-05-31 14:06:34 -07:00
raf
e76c9b8082 Fix registration's params get_git_remote() 2019-05-31 12:10:37 -04:00
Riccardo
0f78c98629 Fingeprint script: better instructions 2019-05-28 17:12:49 -07:00
Arne Schwarck
15c3793dab Update mapd.py (#672) 2019-05-28 16:16:32 -07:00
Martin Lillepuu
0592c72ab3 Add subaru dash lane lines 2019-05-26 11:13:39 +03:00
Martin Lillepuu
744a3566d6 add Openpilot lane line indicators to Subaru LKAS HUD 2019-05-26 11:08:17 +03:00
Rick Lan
6d8e8c7661 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-05-22 20:01:38 +10:00
Chris Souers
fc7e2dd630 add 19 crv to readme (#657) 2019-05-21 22:41:06 -07:00
Rick Lan
7c573c684f Fix values.py 2019-05-22 10:09:01 +10:00
Rick Lan
bf70f4636b Update variable name 2019-05-22 10:07:31 +10:00
Rick Lan
ce20724121 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/car/toyota/interface.py
#	selfdrive/car/toyota/values.py
2019-05-21 10:30:42 +10:00
Rick Lan
9265671d25 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-05-21 10:16:31 +10:00
Rick Lan
f144e4c383 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-05-17 22:11:58 +10:00
Vehicle Researcher
9c68a385ff openpilot v0.5.12 release 2019-05-16 13:20:29 -07:00
Vehicle Researcher
530b637d27 Squashed 'panda/' changes from 1282e8f5..3e199cb9
3e199cb9 Subaru safety: ES_LKAS message should not be forwarded
252dec22 Change docker tags in jenkins to use git commit instead of build_id
4a3b587c generate dependencies and clean (#184)
005e1310 Toyota Safety: cleaned up logic for TSSP2.0 cars
b53fb271 add ACCEL_CMD to filtering for TSSP2.0 cars (#185)
18c2e69e Fix query_vin_and_status.py require python 3.7
3b351b70 Minor fix to current type

git-subtree-dir: panda
git-subtree-split: 3e199cb914dd383fbc6dad964b31712860be04d7
2019-05-16 13:13:38 -07:00
Vehicle Researcher
e11a646657 Merge opendbc subtree 2019-05-16 13:13:38 -07:00
Vehicle Researcher
adb82cae81 Merge panda subtree 2019-05-16 13:13:38 -07:00
Rick Lan
d961b41607 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-05-16 15:05:10 +10:00
Arne Schwarck
764a4034a2 1263: 8 for highlander hybrid (#642) 2019-05-14 00:26:16 -07:00
Rick Lan
facd216835 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-05-14 12:30:46 +10:00
Nigel Armstrong
03e64e043b Add changes to 0.5.11 release notes 2019-05-09 16:42:14 -07:00
Willem Melching
d29b51561b Cleanup Toyota LDW 2019-05-07 22:42:04 -07:00
Willem Melching
2548f41be8 Install newer pip version in CI (#627)
* Update pip in CI

* Longer timeout for docker build

* Increase travis timeout

* revert changes to travis file
2019-05-07 21:56:45 +02:00
Rick Lan
4c4736f99b Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-05-07 10:39:21 +10:00
Willem Melching
aa482a199a add minimum score to consider a way valid (#292) 2019-05-06 13:21:34 -07:00
Arne Schwarck
c04ca640bf Add lane departure warning on dashboard for Toyota (#605)
* Add lane departure alert in controlsd

* Need init values for LDA

* Add lane departure in interface.py

* Include LDA in CarControler

* Add logic for LDA in toyotacan

* Add speed condition and comments for LDA

* Correct right CS.vEgo

* Correct rPoly spelling

* Add left and rightLaneDepart to HUDControl in car.capnp

* Add left and rightLane_Depart in UI function

* set controlsd priority

* revert

* There must be a line to depart from

* Include changes from @pd0wm

* Remove redundant False allocation

leftLaneDepart and rightLaneDepart as False by default according to @pd0wm

* Modify variable names

right_lane_depart and left_lane_depart to conform with python naming convention

* Modify variable names

right_lane_depart and left_lane_depart to conform with python naming convention

* Wrap lane departure warning in one bool
2019-05-06 22:19:00 +02:00
ErichMoraga
1c730c0622 Updated Prius & Prius Prime to include 2019 (#629) 2019-05-05 20:32:05 -07:00
marcbou
e1c3b01f68 correct some spelling errors (#628) 2019-05-05 03:23:32 -07:00
Riccardo
bf1b47be1a Maintain Python 2-3 compatibility but use six.iteritems(). 2019-05-04 19:01:46 -07:00
Rick Lan
7dd8f9f481 revert unneeded change 2019-05-04 11:40:41 +10:00
Rick Lan
a63162f5a7 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-05-04 11:36:50 +10:00
Drew Hintz
c714d9c9e9 getting ready for Python 3 (#619)
* tabs to spaces
python 2 to 3: https://portingguide.readthedocs.io/en/latest/syntax.html#tabs-and-spaces

* use the new except syntax
python 2 to 3: https://portingguide.readthedocs.io/en/latest/exceptions.html#the-new-except-syntax

* make relative imports absolute
python 2 to 3: https://portingguide.readthedocs.io/en/latest/imports.html#absolute-imports

* Queue renamed to queue in python 3
Use the six compatibility library to support both python 2 and 3: https://portingguide.readthedocs.io/en/latest/stdlib-reorg.html#renamed-modules

* replace dict.has_key() with in
python 2 to 3: https://portingguide.readthedocs.io/en/latest/dicts.html#removed-dict-has-key

* make dict views compatible with python 3
python 2 to 3: https://portingguide.readthedocs.io/en/latest/dicts.html#dict-views-and-iterators
Where needed, wrapping things that will be a view in python 3 with a list(). For example, if it's accessed with []
Python 3 has no iter*() methods, so just using the values() instead of itervalues() as long as it's not too performance intensive. Note that any minor performance hit of using a list instead of a view will go away when switching to python 3. If it is intensive, we could use the six version.

* Explicitly use truncating division
python 2 to 3: https://portingguide.readthedocs.io/en/latest/numbers.html#division
python 3 treats / as float division. When we want the result to be an integer, use //

* replace map() with list comprehension where a list result is needed.
In python 3, map() returns an iterator.
python 2 to 3: https://portingguide.readthedocs.io/en/latest/iterators.html#new-behavior-of-map-and-filter

* replace filter() with list comprehension
In python 3, filter() returns an interatoooooooooooor.
python 2 to 3: https://portingguide.readthedocs.io/en/latest/iterators.html#new-behavior-of-map-and-filter

* wrap zip() in list() where we need the result to be a list
python 2 to 3: https://portingguide.readthedocs.io/en/latest/iterators.html#new-behavior-of-zip

* clean out some lint
Removes these pylint warnings:
************* Module selfdrive.car.chrysler.chryslercan
W: 15, 0: Unnecessary semicolon (unnecessary-semicolon)
W: 16, 0: Unnecessary semicolon (unnecessary-semicolon)
W: 25, 0: Unnecessary semicolon (unnecessary-semicolon)
************* Module common.dbc
W:101, 0: Anomalous backslash in string: '\?'. String constant might be missing an r prefix. (anomalous-backslash-in-string)
************* Module selfdrive.car.gm.interface
R:102, 6: Redefinition of ret.minEnableSpeed type from float to int (redefined-variable-type)
R:103, 6: Redefinition of ret.mass type from int to float (redefined-variable-type)
************* Module selfdrive.updated
R: 20, 6: Redefinition of r type from int to str (redefined-variable-type)
2019-05-02 11:08:59 -07:00
Rick Lan
2a5a458172 * change steering torque to 1600 2019-04-24 21:59:03 +10:00
Vehicle Researcher
9c26f5ec7b openpilot v0.5.11 release 2019-04-23 01:41:19 +00:00
Vehicle Researcher
df25aa0a95 Merge opendbc subtree 2019-04-23 01:34:20 +00:00
Vehicle Researcher
3c25760cc9 Squashed 'panda/' changes from 38dc4e678..1282e8f5a
1282e8f5a cap libusb1 version in setup (#183)
64bcc89a9 Subaru: 545 msg must be generated
9159df9a5 Merge branch '0.5.10-chyrsler'
f8ab74a1c L-line relay (#166)
11c4cdcc4 Cleanup leftover jenkins command
22572d949 Fix Jenkins build dockerfiles with same name
1d2f8f0ab Jenkins (#179)
f383eee96 Power saving: wake on RX and don't print durint IRQ
9540db744 Chrysler safety: better to mention messages we don't want to forward
104950264 chrysler: forward bus 0 to bus 2 (#177)
4276c380e Additional Power saving (#170)

git-subtree-dir: panda
git-subtree-split: 1282e8f5a0904b1aaa50f382db2e27f20e74a154
2019-04-23 01:34:19 +00:00
Vehicle Researcher
65c42b436f Merge panda subtree 2019-04-23 01:34:19 +00:00
Nigel Armstrong
6ca53d7f6a Fix dirty flag
Git diff-index doesn't rebuild index, so files with modified dates or touched
are marked as modified with a SHA1 of all 0.

To fix this, we run update-index --refresh before diff index. Any touched
files are updated in the index.

https://stackoverflow.com/questions/36367190/git-diff-files-output-changes-after-git-status
2019-04-17 00:33:13 -07:00
Nigel Armstrong
ead64d7770 Better logging of dirty files 2019-04-16 20:22:38 -07:00
Nigel Armstrong
413db08e1a Log dirty files 2019-04-16 13:50:38 -07:00
wocsor
2f7d46071d add pedal IDs to a Lexus RXH and Rav4 China (#604) 2019-04-15 18:10:13 -07:00
Nigel Armstrong
7345433d03 Add pylint to travis-ci (#595)
* Add pylint to travis-ci

* Change travis build order

* Fix missing pylint

* Add pylint to dockerfile

* Test with fixed linter for chrysler changes

* Fix linter issues in OP

* fixed linter on ford

* Fix Riccardo's comments
2019-04-12 23:12:34 -07:00
Nigel Armstrong
27ef9f2236 Squashed 'panda/' changes from 06958e4..38dc4e6
38dc4e6 Chrysler safety: better to mention messages we don't want to forward
236705f chrysler: forward bus 0 to bus 2 (#177)
62d4219 debug_console.py: exit when no pandas found (#175)

git-subtree-dir: panda
git-subtree-split: 38dc4e678325d13b4324f91f6eff8cb6a0fe575d
2019-04-12 16:57:32 -07:00
Nigel Armstrong
b6e514d006 Merge panda subtree 2019-04-12 16:57:32 -07:00
Rick Lan
2a34efc31d Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-04-10 10:40:31 +10:00
eFini
9472ee91ed Add port for 2019 Honda CRV Hybrid (China ver) (#596)
* 2019 honda crv hybrid port (china version)

* adjust mass based on spec

* update mass based on spec

* add 2019 Honda CRV Hybrid
2019-04-09 17:35:57 -07:00
eFini
5669962393 Add Port for 2019 Honda Odyssey Exclusive (China version) (#592)
* Port for 2019 Honda Odyssey China ver

* update as per comments
2019-04-08 17:58:56 -07:00
dekerr
87f244b4fe remove transpose (#588) 2019-04-05 22:59:38 -07:00
Riccardo
a00df10264 Chrysler: matching file in panda repo 2019-04-05 00:27:39 -07:00
Drew Hintz
8bbca86603 Add Chrysler Pacifica Hybrid 2019 (#591)
Add Chrysler Pacifica Hybrid 2019 to list of supported cars.
Clarify Jeep 2019 minimum steering speed.
2019-04-04 23:45:57 -07:00
Drew Hintz
be36f71c44 📋📷 2019 Chrysler Pacifica and 2019 Jeep Grand Cherokee support (#590)
* 2019 Chrysler Pacfica and 2019 Jeep Grand Cherokee support, along with likely support for arbitrary models.
This is done by copying most values from the stock LKAS camera which is active with https://github.com/commaai/panda/pull/177

* No longer send LKAS_HEARTBIT because Panda now forwards it for us.

* Pacifica Hybrid 2018 combine fingerprints, add 808: 8

* panda chrysler: forward bus 0 to bus 2
copy of Panda commit: 1049502644
2019-04-04 22:48:37 -07:00
Rick Lan
6741753643 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-04-03 14:08:39 +10:00
Gernby
21a85c421a Eliminate unnecessary temporary disengagements (#584)
This status was defined as a bump error, but it isn't actually due to bumps.  It's also triggered by driver overrides that are somewhat higher than the "steer_override" threshold.  By removing this temporary disengagement, the car is much more predictable on bumpy roads AND in turns that require assistance from the driver.
2019-04-02 00:21:23 -07:00
Nigel Armstrong
a6cc298377 Update 0.5.10 Release Notes 2019-03-28 22:17:12 -07:00
Douglas Schilling Landgraf
011154ba20 patches (#582)
* selfdrive: add sys module to exit call

exit() is a helper for interactive shell. Let's explicit
use the module sys.

* selfdrive: tomstoned.py use constant for /data/tombstones/

Instead of use multiple times a string for
the data dir, use a variable.
2019-03-26 20:50:37 -07:00
Rick Lan
eaf2c1894d Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-03-27 09:02:39 +10:00
Rick Lan
f195f7e5fe Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-03-27 09:01:26 +10:00
Vehicle Researcher
1fca65977d openpilot v0.5.10 release 2019-03-26 01:09:18 -07:00
Vehicle Researcher
342bb13bff Squashed 'pyextra/' changes from 0d19c13e..42428013
42428013 websocket patch from commaai/websocket-client.git
0fda5bb7 add jsonrpc
8139b06b add websocket_client

git-subtree-dir: pyextra
git-subtree-split: 4242801316e12c55e5b7c626331fbefad2e15e0c
2019-03-26 01:03:51 -07:00
Vehicle Researcher
238c403df9 Merge pyextra subtree 2019-03-26 01:03:51 -07:00
Vehicle Researcher
7bb715cbe7 Merge opendbc subtree 2019-03-26 01:03:50 -07:00
Vehicle Researcher
2a0f066426 Squashed 'panda/' changes from 39c1e39e..06958e42
06958e42 Fix pedal bootstub build
f5817e6b Fix Pedal bootstub version
c00fe867 CircleCI needs to check bootstub doesn't break too
9b5b696e Subaru: remove GM leftover
20c76ad5 Power Saving (#169)
c6eeaad6 Subaru: added last engage/disengage regression test
37d46e0c Subaru: added subaru safety tests
5686dae2 Subaru updated driver factor
a6193a82 Dcp remove (#168)
e437b9b4 Subaru: fixed bug and added safety tests
176f1325 Subaru: added proper safety model
0b10bb70 Subaru safety: move camera to bus 2
bce279a6 Pedal: only one firmware (#164)
4f73cb48 Toyota pedal: checking for no pedal being commanded when openpilot is off
0b2327e5 Merge pull request #160 from commaai/capture_make_failure
7b504d2f panda safety test that replays drives of saved CAN messages (#151)
d7d08892 Capture make failure so it can be logged to sentry

git-subtree-dir: panda
git-subtree-split: 06958e424cad7efa3fb35d262480c29817733059
2019-03-26 01:03:49 -07:00
Vehicle Researcher
cfbc9ce733 Merge panda subtree 2019-03-26 01:03:49 -07:00
Rick Lan
a602f57dc4 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-03-20 10:18:51 +10:00
Rick Lan
18cf187fda Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-03-15 11:41:20 +10:00
Rick Lan
c831bf6993 move dbc files PR to opendbc repo. 2019-03-12 11:21:43 +10:00
Rick Lan
2606ba2100 fix symbol issue on checks array 2019-03-12 11:09:23 +10:00
Nigel Armstrong
c8e2a6636e Add better volt fingerprint detection (#564)
Missing 578:8 causing unsupported car exception
2019-03-11 12:13:18 -07:00
Sumit Binnani
eb527a4c81 Added new fingerprint for 2018 Camry Hybrid LE (#560)
* Updated Fingerprint for Camry Hybrid LE

The updated fingerprint is a superset of the previous fingerprint (maybe due to blindspot monitors).
2019-03-11 12:08:52 -07:00
arne182
2c220c87fa Add better volt fingerprint detection
Missing 578:8 causing unsupported car exception
2019-03-11 11:00:06 +01:00
srpape
bc107c28ae Fix 2018 volt fingerprint (#561)
Update fingerprint and remove offending PACIFICA_2018 match
2019-03-09 18:17:20 -08:00
arne182
290aa2ac41 update @Kumar fingerprint for better recognition (#554) 2019-03-08 17:26:08 -08:00
Rick Lan
9c7cf0f505 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-03-06 14:56:51 +10:00
Rick Lan
b386f50203 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-03-04 09:57:44 +10:00
jfrux
b71f83aa8f Updates splash image with newer UI for README (#543) 2019-02-28 20:13:07 +01:00
Rick Lan
2754e73d61 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-02-27 13:58:59 +10:00
Rick Lan
8f9844eb82 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-02-27 12:57:17 +10:00
Nigel Armstrong
a4ddc816e8 .gitignore visiond (#539) 2019-02-25 10:43:56 -08:00
Drew Hintz
444ece8c8f remove Pacifica 2019 from supported car list (#538)
Although there's a fingerprint and LKAS constant for the 2019 Pacifica, it doesn't work well enough that I'd consider it supported.

P.S. I have an idea for how to support all Chrysler with one code base, even those I've never looked at. Forward can0 to the stock LKAS (can2) so that the stock LKAS is active. Then read the stock LKAS messages on can2 to both get the vehicle's LKAS constant, any status messages, and perhaps a more reliable counter. I'll try to code it up this weekend.
2019-02-22 12:48:33 -08:00
Nigel Armstrong
69876dce00 Chrysler updates (#537)
* Chrysler updates

* Update openDBC
2019-02-21 23:23:40 -08:00
Rick Lan
3058b81601 Merge branch 'devel-lexus-ish-ave30r' of https://github.com/eFiniLan/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/car/toyota/carstate.py
2019-02-22 16:13:27 +10:00
Rick Lan
1ca8839e53 * refactor carstate 2019-02-22 16:12:38 +10:00
Rick Lan
cc7f15fe88 * refactor carstate 2019-02-22 16:08:33 +10:00
Rick Lan
b4bef4c034 update safetyParam to 66 2019-02-22 12:40:36 +10:00
Nigel Armstrong
9a47e634b9 Update Panda 2019-02-21 13:44:39 -08:00
Rick Lan
7e555671fe add stop_and_go and update retParam value 2019-02-21 23:35:32 +10:00
Rick Lan
5f268f3d9e Remove invalid signals/checks 2019-02-21 22:14:08 +10:00
Rick Lan
4ab5a70cdb remove duplicated definition 2019-02-21 20:15:45 +10:00
Rick Lan
1e2dc36a9f Update dbc 2019-02-21 19:57:54 +10:00
Rick Lan
2e7ee276f1 Merge branch 'devel' of https://github.com/eFiniLan/openpilot into devel-lexus-ish-ave30r 2019-02-21 16:46:29 +10:00
Rick Lan
ac4d303a54 fix indentation 2019-02-21 16:38:48 +10:00
Rick Lan
09c58ea91d Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/car/toyota/interface.py
2019-02-21 16:36:17 +10:00
Rick Lan
4edf2c5c01 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-02-21 16:14:15 +10:00
Vehicle Researcher
a36bad8391 openpilot v0.5.9 release 2019-02-20 01:39:02 +00:00
Vehicle Researcher
9a79df8a8a Squashed 'pyextra/' changes from 8cc1594..0d19c13
0d19c13 Revert adding reverse_geocoder
4a22fac Fix reverse_geocoder folder
35308c5 Add reverse_geocoder

git-subtree-dir: pyextra
git-subtree-split: 0d19c13e6e4e5fa82a470374146a86dc5d5afa35
2019-02-20 01:32:52 +00:00
Vehicle Researcher
993e63c000 Merge pyextra subtree 2019-02-20 01:32:52 +00:00
Vehicle Researcher
43867dfe1a Merge opendbc subtree 2019-02-20 01:32:51 +00:00
Vehicle Researcher
26de1b3fa8 Merge panda subtree 2019-02-20 01:32:50 +00:00
Vehicle Researcher
a25e2153a0 Squashed 'panda/' changes from 9ee6285..39c1e39
39c1e39 Cadillac: added brake msg forwarding
aaa1b14 bump VERSION
e0dd558 Fixed undefined reference error when "make recover" in EON
c91f038 Toyota pedal support (#159)
de1ba06 Build optimizer: back to Os now that 'make --recover' is fixed
fd23383 add -lgcc flag to fix "undefined reference to __aeabi_llsr" (#156)
1cc74e2 Reverted code optimizer option to O2 after 'make recover' broke
1218d09 Cadillac ascm proxy (#155)
064446f Panda: bumped version
93266a9 Hyundai: allow the same max steer torque as stock
d275fa8 Subaru: Forwarding (#152)

git-subtree-dir: panda
git-subtree-split: 39c1e39e8142d3c2984cf5efe6b55c42bc748d9a
2019-02-20 01:32:49 +00:00
Rick Lan
cbd8cf8686 apply quillford's value again 2019-02-17 12:36:49 +10:00
Rick Lan
caae16218e Revert "remove unnecessary changes in carstate.py"
This reverts commit 28836f85e5.
2019-02-17 12:36:11 +10:00
Rick Lan
17fbe1a4dd getting error from last change, revert a couple back. 2019-02-17 10:46:07 +10:00
Rick Lan
0f47ccc1ba apply quillford's KpV and KiV value. 2019-02-17 10:30:38 +10:00
Rick Lan
28836f85e5 remove unnecessary changes in carstate.py 2019-02-17 10:28:20 +10:00
Rick Lan
4368401e33 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-02-15 15:00:34 +10:00
Rick Lan
9e6470a325 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-02-15 14:59:28 +10:00
eFini
08fd80dc15 Allow uploader.py to compress rlog without upload permission (#471)
* Always Compress - Make sure uploader to bzip2 rlog once it's completed without any upload permission.
2019-02-13 20:39:24 -08:00
eFini
030577f4d7 Add "Accept-Encoding: gzip" header to mapd.py to reduce data consumption (#525) 2019-02-13 18:19:17 +01:00
Rick Lan
e867ae40ba Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-02-07 12:11:55 +10:00
Rick Lan
4b865a1955 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-02-07 12:10:23 +10:00
Riccardo
d03e94c4d5 Readme: FCA giraffe added 2019-02-06 16:40:08 -08:00
Rick Lan
8fe520a678 * add matched canbus message descriptions from 2017_toyota_master.dbc 2019-02-05 15:52:17 +10:00
kegman
97b5997b8b Eliminate brake oscillations and grinding / crunching / ripping sound when using Pedal (Honda Pilot Only) (#475)
* Eliminate brake oscillations when using Pedal

* Simplified code

* syntax error fix

* Grinding code as applied to Honda Pilot only 

Each model may need its own setting due to USER_BRAKE noise disengagements

* correction: self.CP.carFingerprint instead of CP.carFingerprint

* Add Ridgeline to Pedal Grinding fix

Confirmed to work also on Ridgeline
2019-02-04 20:30:19 -08:00
Rick Lan
c3390a0cb5 update dbc file add a couple more definitions 2019-02-01 16:44:59 +10:00
Rick Lan
e4a07f1b89 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-01-30 16:20:19 +10:00
Rick Lan
5c5ffb0129 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-01-30 16:18:35 +10:00
rbiasini
1b8ae3ed2e removal of snpe libs (#517)
Removal of unnecessary snpe shared libs
2019-01-28 21:10:39 -08:00
Roma Sokolkov
57d1157faf Add missing mapd and orbd dirs into README.md (#515) 2019-01-26 15:08:10 -08:00
Drew Hintz
26a61ecc61 fix typos, Jeep tuning (#511) 2019-01-25 22:41:08 -08:00
Rick Lan
4c2feaa1ab Update dbc file to support mini car and left/right line indicator on display 2019-01-25 12:28:04 +10:00
Rick Lan
3b3b366651 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2019-01-25 12:07:38 +10:00
Rick Lan
2eb7068a2d Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2019-01-25 11:51:16 +10:00
Vehicle Researcher
f2cd3a85a5 openpilot v0.5.8 release 2019-01-23 15:34:52 -08:00
Vehicle Researcher
2da41efc26 Merge opendbc subtree 2019-01-23 15:28:22 -08:00
Vehicle Researcher
d21c6591c1 Squashed 'panda/' changes from 293fa33..9ee6285
9ee6285 optimize board build for size to avoid going over the limit. (#150)
20e8fa9 Start introducing Bounties
a2046e9 make it smaller
1dfcf2b update panda price
37ee289 chrysler safety: fixed comments
c2dfbad tesla safety: return -1 to block forward (#149)
74c0c1b update README
be0061d Chrysler: safety now based on motor torque
039d183 Chrysler: fixed regression test
9193eeb Chrysler: safety limits updated
04f1d44 Chrysler safety: 3 sa max rate down for now
cf3ecd6 Chrysler safety: re-using hyundai framework
49ed9bc Update CLICKS for longer bootup time of EONS and avoid unwanted fast charge mode

git-subtree-dir: panda
git-subtree-split: 9ee628557f3f33759c62b567964b918a597d3387
2019-01-23 15:28:16 -08:00
Vehicle Researcher
67c96e196e Merge panda subtree 2019-01-23 15:28:16 -08:00
Chris Souers
2b9771e594 Increment hatchback year (#508)
Confirmed working by user. Same steer dropout as before.
2019-01-21 18:01:16 -08:00
Riccardo
80fea67a58 Updated links from Slack to Discord 2019-01-14 14:32:43 -08:00
Chris Souers
f6c2c9f283 Merge new 2019 Civic and existing 2017-18 Civic Hatch (#446)
* fingerprint and new car

* you know the drill

* fix

* mod civic hatch to work for now

* try to merge hatch and other bosch

* fix

* fixed spaces

* comma (heh)

* make mass civic

* Add to readme. Need to confirm speed

* steering dropout at ~3.3 kph

* Remove additional fingerprint

* combined comment. fixed formatting to match
2019-01-11 17:13:57 -08:00
Kylan
5d15d83faf Adding GM Steering Rate (#495)
* adding steering rate

* adding steering rate
2019-01-08 19:40:09 -08:00
Ted Slesinski
cb31eb3408 Fixed TOC anchor links (#492) 2019-01-02 20:33:37 -08:00
ErichMoraga
38130c20ac Added EX-L subsection for the existing 2019 Pilot (#489)
*  Added EX-L subsection for the existing 2019 Pilot

Verified working with @Hitmantw25 12/20... and again 12/27 (VG w/ "Josh").

* Update selfdrive/car/honda/values.py

@energee wants to revert a change he made in a previous PR.

Co-Authored-By: ErichMoraga <33645296+ErichMoraga@users.noreply.github.com>

* Removed an extra space @energee included.
2018-12-30 18:23:10 -08:00
arne182
35a23f6f46 Update 0x365 for Rav4H from @squall and my observations (#490)
on stock 00000080fc0008 is the inital value then it changes to a static 00000080fd0008
2018-12-29 11:12:28 -08:00
Andrew Frahn
55e6a6f58b Clean Up hyundai (#481)
* Update fingerprints.py

Taiwanese Prius Prime fingerprint was identical to the regular prime (107 msgs.), but should really have 110.  I have the correct one in there now.

* openpilot 0.4.3.1 (#220)

* Honda Pilot 2017 Port (#161)

* Update README.md

* Update fingerprints.py

* Update carstate.py

* Update hondacan.py

* Update interface.py

* Update interface.py

* Update interface.py

* Update README.md

* Update README.md

* Update README.md

* Update fingerprints.py

* Update carstate.py

* Update hondacan.py

* Update interface.py

* Update carstate.py

* Update hondacan.py

* Update README.md

* Update fingerprints.py

* Update carstate.py

* Update carstate.py

* Update carstate.py

* Update hondacan.py

* Update interface.py

* Update carstate.py

* Update carstate.py

* Update Pilot Fingerprint

* Update fingerprints.py

* Give pilot its own definition and not use ILX

* add pilot argument

* Add Pilot interface

* Add pilot argument

* Update interface.py

* Parse Different gear on pilot

* Add steer max

* Fixed duplication of steer max value

* Adjust PID's for steering

* Update carcontroller.py

* Change Steer Ratio and wheelbase

* Update Steer fault values

Steer fault value of 3, does not seem to effect anything

* Update Kp,Ki Ratio

* Update interface.py

* Update readme for Pilot

* add pilot

* Update fingerprints.py

* Update carstate.py

* add signals

* add signal

* fix restricting video upload to wifi

* Dibs on SAFETY_GM numerical value

To match Panda repo.

* Safety Reference for Honda Bosch

* Update fingerprints.py (#210)

Consolidated my fingerprint and removed duplicates and ordered the fingerprint for the RAV4H. Double Checked.

* Interpolate ki/kp for steering PID loop (#200)

* Interpolate ki/kp for steering PID loop

Very much needed for the Volt port: car ping-pongs with low kp
on high speeeds, and the loop is unstable with high kp on
low speeds.

Also, removes "number or array?" logic from PIController,
now that all the callers use interpolation ofr ki/kp.

* Pass speed to steering PID loop for ki/kp interpolation

* Remove unused numbers import

* Slight changes to UI and Fingerprint for Odyssey Elite (#196)

* Adding back drive time to UI

* Add fingerprint for Odyssey Elite

* Removed extended fingerprint for Elite

* Revert "Adding back drive time to UI"

This reverts commit b9b02f7ff2511f28922f0bea47cd8c70bb9f4010.

* Squashed 'panda/' changes from 98f29a4..67d5208

67d5208 fix signedness issue in toyota safety
fe15d3f bump pandacan
11c2b08 add fault invalid
2c26e45 add sleep
27c7637 forgot the counter
3a6d7db don't hang
bfa7d2e canloader works
b259e2a can flasher is close to working
83f2edf isotp can support in softloader
7ae7c79 typo
e85cc47 forgot the selfs
190b4f6 start work on canflasher
5c655c9 add recover support
ae3457f usbflash is reliable
f7a0ab0 pedal usbflash works
585d0f9 add way to call isotp
be82899 despite it being bad code, move isotp
000715b start work on pedal canloader
626e312 pedal has a bootstub now
3662d1e redundant check
81e6b0d fix bug
083cd12 should have bounty to refactor that ish
b65d30c bad asserts
b2e6c3f isotp untested support for subaddr
30fd66a Merge pull request #93 from vntarasov/volt
06f5109 Merge pull request #94 from gregjhogan/can-printer-hex
c7d098c Merge pull request #95 from gregjhogan/setup-script
22fe250 Merge pull request #99 from gregjhogan/bit-transition-example
ba16ba3 Merge pull request #100 from gregjhogan/j2534-troubleshooting-instructions
ad08ea4 Merge pull request #90 from gregjhogan/can-forwarding
f3b6f5d added j2534 troubleshooting instructions
858d150 added script to find bits that transition from 0 to 1
c6acac8 added checking pedal interceptor message length
f7226ff added brake safety checks
d0c2634 added gas safety checks
d378e4a removed bosch safety forwarding restriction on 29 bit addresses
5c7ef9e added bosch safety hooks and forwarding
90c64b6 add note
23de8d4 Merge pull request #97 from commaai/pedal_improvements
0261641 added missing python packages
b92b235 fix bytearray encode issue
2434f1c Tweak Volt's brake pedal stickiness
e2f73d2 enable has a whole byte to itself
d5a9e1e correct checksum
f8ed9fa better names
986a14c don't alias pointers
9b8472e add watchdog support
8f0add9 handle faults
1d917f8 split gas set into 2 values, and have a fault state
1b77026 j2534 isn't alpha anymore
fbcc872 Merge pull request #92 from commaai/pedal
8a6f44b pedal is sending messages
08f464c python 3 bro is bad bro
9390961 kline checksum algo was broken...
3b7c33b add kline debug support
aa622bc init values
631ea9f better refactor
eb1fd75 add PEDAL adc sets
ccaa310 don't build with usb
8d4d763 debug console works
bd09883 comma pedal is building
75a29d5 Merge pull request #84 from gregjhogan/j2534-hds
eece37d only the panda has gmlan
9f43abe Merge pull request #89 from vntarasov/volt
5364d43 Merge pull request #88 from vntarasov/smaller-firmware
377a1ec bump version for descriptor fix
4fabdf0 Merge pull request #87 from gregjhogan/usb-multi-packet-control
8580773 fix sending WinUSB Extended Properties Feature Descriptor
6908feb Chevy Volt safety
786a004 Enable optimization to reduce firmware size
d70f43b hack to fix thinkpad
95ab1ae fixed flow control message padding
bbd04d1 updated installer
62216d0 single standalone DLL for J2534 driver
5c9138d fixed 11 bit address issue
f3b0ad2 fix LOOPBACK getting set when DATA_RATE is set
b750d36 updated README
a9a097f lowered CPU utilization
7c26a70 TIS needs unsupported protocols to return an error
42692b4 TIS doesn't like ChannelID being zero
cf126bb SET_CONFIG return error for reserved parameters
2e99dbf fix HDS issues
8203cc8 add is_grey
e946a54 add insecure_okay flag
4363b3e check webpage
4f59ded add secure mode note
6b11fb5 add autosecuring to tests
b27d185 Merge pull request #86 from commaai/better_pairing
4b53b42 elm wifi isn't an automated test
99f85cb Merge pull request #85 from gregjhogan/usb-wcid
0d38060 auto-install WinUSB device driver
c6653ca from python import
38cc0ee add wifi_secure_mode, boots in insecure mode

git-subtree-dir: panda
git-subtree-split: 67d52089a1300b86800d897f2b271e0a24cf6dd6

* Squashed 'opendbc/' changes from 81d9871..aa067f7

aa067f7 Chevy Volt tweaks (#83)
a60c6c4 Toyota: change signal name in EPS_STATUS msg
ce70b1a extra setme field toyota LKAS_HUD
df2a552 toyota missing ACC_CONTROL checksum
48bb293 Revert "Toyota Prius: added a comma specific message to control the speed sent to the EPS"
5f42439 Toyota Prius: added a comma specific message to control the speed sent to the EPS
6f5e8b6 Pedal Interceptor: fault state VAL moved to _comma
efd5f5c add setme to honda ACC_HUD
97fc335 add interceptor to civic
6f40f16 update generator script to allow for multiple imports
9ca956b add setme to toyota STEERING_IPAS
e5afa57 run generator for ipas scaling
8bd1182 Toyota IPAS: proper steer angle unit
f57511e acceleration pedal for gasPressed
c8d1dbc high beams also. likely dashboard message.
9f1c78b high beams for genericToggle
f037d42 turn signal lights (and thus hazard lights)
b35bb08 turn signals
78986cf Revert "turn signals"
ba946c9 turn signals
2af3ecc Speed, braking, and distance signals
f40ab87 Set packet lengths, adding steering rate, adjusted speed
cd59bfa units for speed_right
c2fcce2 speed of right vs left side of car
4ef5fae value table for gear status
97c48e2 tighten up speed bits. brake pressue max comment.
a0cbfd1 add gear status PRNDL
0c82865 initial signals for chrysler pacifica 2017 hybrid
5ed0540 add set me to toyota LKAS_HUD
aecac5d add set me fields to toyota ACC_HUD
5417013 update toyota ACC_CONTROL fields
e91e967 Comma Pedal: made GAS_COMMAND 6 bytes
d04434a Comma Pedal: added state byte and enable bit
c30b2cd Comma Pedal: sending 2 tracks on 0x200
8f72467 Volt doors and belts status (#70)
60f8b6c add set me to lkas hud honda
3c9e335 fix honda pcm gas message size
7ca471d Add 2018 Toyota CHR dbc (#78)
637fe00 set scaling to 1 for brake and gas which have no real unit
62a88d4 Volt: switch to parsing ACC buttons from powertrain CAN (#74)
3fdd47b Volt's gas pedal only and combined gas/acc (#76)
45ec9c9 Add 2017 Honda Ridgeline (#77)
cbd186a Add 2018 Camry Hybrid DBC's (#73)
974eeaf Toyota: re-generated the files after cfbc9ae363f98ef
19ea195 Toyota: more vals for LKA_STATE
cfbc9ae fixed inconsistent factor for speed in Honda dbc files
e7db803 convert all line endings to unix style

git-subtree-dir: opendbc
git-subtree-split: aa067f7079aa12617f7a37d85233e51af44e1bb2

* openpilot v0.4.3 release

* Squashed 'panda/' changes from 67d5208..3125232

3125232 bump version
703c0b4 Gas Interceptor: another fix to gas pressed logic
196d383 Interceptor: fixed gas pressed logic

git-subtree-dir: panda
git-subtree-split: 31252324d98e701c33cb6aeda20af6b549175764

* Squashed 'opendbc/' changes from aa067f7..91e882d

91e882d Updating bosch dbcs to use new format and bringing in new honda changes (#82)
9b32e2e Fix Checksum errors for CH-R (#86)

git-subtree-dir: opendbc
git-subtree-split: 91e882d4a04c129e12d39bcff0bbe56b75166e0f

* openpilot v0.4.3 release

* openpilot v0.4.3.1 release

* fix bug in canpacker for Toyotas with DSU connected (#221)

* update year on civic

* Revert "openpilot 0.4.3.1 (#220)"

This reverts commit 32ebfde2ddf907878aa2faca2624ec23e495b5f7.

* Revert the changes to GM in 0.5.4 (#380) (#386)

* Revert 0.5.4 changes for GM for 18ers

* Redo the refactor of stock control msgs

* Fixed missing CONTROL_MSGS -> STOCK_CONTROL_MSGS

* Remove spacing

* Need candidate array idx

* Cleanup

Uses generic dbc
All car names in alphabetical order
All fingerprints in alphabetical order
Acknowledgement to users who have made each vehicle possible

* no unecessary comments

* Match dbc to opendbc
2018-12-26 21:43:04 -08:00
Braden
185e5b3865 Read from usb/present instead of usb/online (#484) 2018-12-25 09:51:07 -08:00
ErichMoraga
44d4b643f3 Replaced 60 msg. C-HR print w/ 73 msg. C-HR print (#467)
Confirmed working, and necessary with @wackojacko Toyota CHR's Kiwi (New Zealand) ICE C-HR.
2018-12-21 01:43:18 -06:00
arne182
431a6de992 add self.CP = CP as with other carstate files (#459) 2018-12-21 01:40:26 -06:00
Ted Slesinski
921b8d3cdb Adds 2019 Ridgeline fingerprint (#473)
* Adds 2019 Ridgeline fingerprint

* Add readme
2018-12-21 01:21:05 -06:00
rbiasini
734cb27345 Faster NEOS download and auto removal of NEOS image after installation (#478) 2018-12-21 01:17:27 -06:00
Rick Lan
0bf4f95a41 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-12-17 17:11:43 +10:00
Rick Lan
d473152c82 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-12-17 17:10:45 +10:00
rbiasini
cffdffb528 hotfix: wait longer in CDP mode before switching to fast charge, so EON can boot (#469) 2018-12-16 19:54:29 -07:00
Rick Lan
a641e8c9d3 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-12-14 10:42:46 +10:00
Rick Lan
46543952e5 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-12-14 10:25:05 +10:00
Riccardo
7d5daf4747 0.5.7 hotfixes 2018-12-13 20:49:44 +01:00
Rick Lan
b9a925481e Move ave30r related changes to only this branch 2018-12-12 11:52:31 +10:00
Rick Lan
39f150ad96 Merge branch 'devel' of https://github.com/EternityLan/openpilot into devel-lexus-ish-ave30r 2018-12-12 11:51:16 +10:00
Rick Lan
7f72a7d28e revert changes. 2018-12-12 11:50:06 +10:00
Rick Lan
8b7e17d86f Merge branch 'devel' of https://github.com/EternityLan/openpilot into devel 2018-12-12 11:47:37 +10:00
Rick Lan
4935fa7353 revert devel back to stock devel 2018-12-12 11:47:31 +10:00
Rick Lan
0cf5bfaaf4 revert devel back to stock devel 2018-12-12 11:45:51 +10:00
Rick Lan
f45cb16d4e Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-12-11 18:39:00 +10:00
Rick Lan
9cfd6bfeea Merge branch 'devel' of https://github.com/EternityLan/openpilot into devel 2018-12-11 18:36:40 +10:00
Vehicle Researcher
f552ca210e openpilot v0.5.7 release 2018-12-10 14:13:12 -08:00
Vehicle Researcher
30ec405890 Squashed 'pyextra/' changes from fb152de..8cc1594
8cc1594 update overpy
2c18997 switch to forked version of overpy

git-subtree-dir: pyextra
git-subtree-split: 8cc1594238fcae6acb8bcd825ac73bbca586b1be
2018-12-10 14:06:10 -08:00
Vehicle Researcher
9d2fef093e Merge pyextra subtree 2018-12-10 14:06:10 -08:00
Vehicle Researcher
2729c0d740 Merge opendbc subtree 2018-12-10 14:06:07 -08:00
chassdesk
51d9c1a7c6 Add Lexus RX450HL as sub to RX450H (#458)
Add Lexus RX450HL as sub to RX450H
2018-12-08 13:13:09 -08:00
Chris McCammon
9b86a6edf4 Fixed Capitalization + Made CT6 Comment Cleaner (#456)
* Update README.md

* Updated CT6 comment
2018-12-07 17:32:41 -08:00
Vasily Tarasov
15dc299714 GM: Cadillac ATS Coupe 2018 support (#445)
* GM: Cadillac ATS Coupe 2018 support

* Missed adding Cadillac ATS
2018-12-06 21:22:21 -08:00
Rick Lan
1ace12eb12 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-12-05 12:54:42 +10:00
Kylan
9ea18b8e2b Adding support for 2018 GMC Acadia Denali (#453)
* added acadia

* adding acadia

* adding acadia

* Update radar_interface.py

* adding acadia

* refactored

* fixed tuning

* Adding acadia

* Update interface.py

* fixed whitespace

* fixed whitespace
2018-12-04 08:35:36 -08:00
rbiasini
3251b60a22 Honda Nidec: avoid giraffe setting alert when car is turned off (#449) 2018-11-29 20:36:34 -08:00
Rick Lan
c49d85082f Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-23 11:03:32 +10:00
rbiasini
3fad3bfc5c Added Astra support to README and RELEASE notes (#443) 2018-11-21 00:01:04 -08:00
Rick Lan
0f4acd346c Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-21 15:38:07 +10:00
Alex Hill
0f82021798 Add initial support for Holden/Opel Astra BK (#431) 2018-11-20 20:12:50 -08:00
Rick Lan
703bef2735 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-20 16:02:26 +10:00
Vasily Tarasov
6e83cf4245 Keep steering on radar fault (#442) 2018-11-19 20:25:33 -08:00
Rick Lan
b7b24f5a8f revert if else statement so it doesn't cause error. 2018-11-19 21:10:50 +10:00
Rick Lan
6fd1eaf492 remove else statements 2018-11-19 12:27:34 +10:00
Rick Lan
f6bf0e4f4e Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-19 12:19:56 +10:00
Rick Lan
1b3dd93fcc ignore standstill in lexus ish 2018-11-19 12:19:27 +10:00
dekerr
083ce17c02 Move calibration values (#441)
* initial commit

* moved constants
2018-11-18 17:18:29 -08:00
Vasily Tarasov
5591e42fcf GM: remove refactor leftovers (#440) 2018-11-18 16:13:44 -08:00
Rick Lan
a79fc339ae fix dbc to adapt 0.5.6 2018-11-18 15:55:06 +10:00
Rick Lan
959abaca9c Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-18 14:13:32 +10:00
Abdul Hagi
a06eaf7b95 Added 2016 Honda pilot (#438)
I am able to validate that openpilot works on a 2016 Honda Pilot.
2018-11-17 09:34:48 -08:00
Vehicle Researcher
9302045232 openpilot v0.5.6 release 2018-11-17 02:08:34 -08:00
Vehicle Researcher
efa97f23a5 Squashed 'pyextra/' changes from eb09257..fb152de
fb152de add overpy

git-subtree-dir: pyextra
git-subtree-split: fb152de1e9e54247d933400be1dbf580f4dd0f43
2018-11-17 01:58:38 -08:00
Vehicle Researcher
e2df5f91ad Merge pyextra subtree 2018-11-17 01:58:38 -08:00
Vehicle Researcher
d44213f6d4 Merge opendbc subtree 2018-11-17 01:58:36 -08:00
Vehicle Researcher
c10a755516 Squashed 'panda/' changes from 4dd3f5a..293fa33
293fa33 Honda: fixed message forwarding addresses from can2 to can0
799c338 Chrysler safety controls (#130)
c05b15b Toyota frc on (#141)
8291971 Toyota: using a more generalized CRUISE_ACTIVE bit that works on all cars
6f157aa Toyota frc on (#140)
8d2470c bumped panda version
915ee4f Honda: forwarding CAN0 to camera, so camera can stay on (#139)

git-subtree-dir: panda
git-subtree-split: 293fa33f830f0c7cdfad31f621c4bdc016aa7d41
2018-11-17 01:58:34 -08:00
Vehicle Researcher
73df3624f9 Merge panda subtree 2018-11-17 01:58:34 -08:00
Rick Lan
21c6e66e4f Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-16 09:06:10 +10:00
rbiasini
4680447dd0 Revert "Honda Pilot tuning / lane centering fixes (#408)" (#433)
This reverts commit c6be3e2ed5.
2018-11-13 14:36:29 -08:00
Rick Lan
5e617d1104 use downloaded file 2018-11-12 16:06:12 +10:00
Rick Lan
729fc8464c more changes 2018-11-12 16:05:26 +10:00
Rick Lan
0e79da03b5 remove changes 2018-11-12 16:04:42 +10:00
Rick Lan
70a71b741b fix 2018-11-12 16:03:55 +10:00
Rick Lan
0990c0ee5e revert changes 2018-11-12 15:55:01 +10:00
Rick Lan
9d33ceee33 removed all customd stuff 2018-11-12 15:51:55 +10:00
Rick Lan
b47b371d7e some minor code update. 2018-11-12 15:44:33 +10:00
Rick Lan
977579e4aa Use os.system instead of subprocess. 2018-11-12 13:10:16 +10:00
Rick Lan
643224fd7d * init -- customd 2018-11-12 11:51:53 +10:00
arne182
bb2af14dab 0x470 for RAV4H (#428)
@squall and me have checked the dsu static values for our RAV4H and found that this is similar to the highlander message.
2018-11-09 13:36:34 -08:00
Rick Lan
e908f4b8dc Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-09 15:31:44 +10:00
rbiasini
07c33192fe more stable calibration (#427)
* more stable calibration

* no commented print
2018-11-08 19:48:21 -08:00
Rick Lan
49eaa39aa2 Merge branch 'devel' of https://github.com/EternityLan/openpilot into devel 2018-11-09 13:35:53 +10:00
Rick Lan
afa8692dbe more changes for removing lexus specific safety. 2018-11-09 13:35:39 +10:00
Rick Lan
6d1a974f74 more changes for removing lexus specific safety. 2018-11-09 13:34:36 +10:00
Rick Lan
096aec71e5 Cruise state on lexus and toyota are both in 0:1D2 @ 0x20, so we can mergee lexus specific safety check with toyota. 2018-11-09 13:31:33 +10:00
Rick Lan
93a5dc40c7 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-09 09:59:36 +10:00
ErichMoraga
b5f662e26c Expanded the previously added Chinese RAV4 (#425)
This came after testing a different trim level.  This fingerprint is confirmed working on both.
2018-11-08 09:56:05 -08:00
Rick Lan
6c73e0d877 Merge branch 'devel' of https://github.com/commaai/openpilot into devel 2018-11-07 16:56:35 +10:00
dekerr
2b8e62a0d6 Faster calibration filtering (#421)
* separable filter

* add missing args

* formatting

* fix casing
2018-11-06 13:51:37 -08:00
ErichMoraga
736cf2fe32 Added fingerprint for Chinese RAV4 (#422)
Confirmed working on 2017-2018 Chinese RAV4 by @Fiftycentsjj
2018-11-05 18:43:50 -08:00
kegman
c6be3e2ed5 Honda Pilot tuning / lane centering fixes (#408)
Tuned kP and kI and Tire Stiffness Factor settings.
Fixes lane centering issues in the following situations:
1.  Hugging of left lane line during fast left curving roads
2.  Hugging of right lane line during fast right curving roads
3.  Left bias in fast lane on crowned roads (sloping down to the left)
4.  Right bias in slow lane on crowned roads (sloping down to the right)
Works better when lane_width = 2.85 (vs 3.7 default) in pathplanner.py
2018-10-31 11:09:48 -07:00
Rick Lan
327c6b8c53 added missing line break 2018-10-31 12:44:21 +10:00
Rick Lan
87140dc8b5 Merge branch 'devel' of https://github.com/commaai/openpilot into devel
# Conflicts:
#	selfdrive/boardd/boardd.cc
2018-10-31 12:41:16 +10:00
dekerr
153d7a4816 Improve VM dynamic sol accuracy (#391)
* use solve and eye func

* remove uneeded import from vehicle model
2018-10-30 22:30:09 +01:00
Jafar Al-Gharaibeh
e0d95a63f3 boardd: keep defined safety models in sync with panda repo (#412)
This is a noop for most users, but for those of us working on new
car ports where we have our own additional defines, having
those defines out of sync creates merge conflicts in one place
(good so we can fix it) but not the other ( not good becasue
they will go unnoticed). I learned this the hardway!.

Signed-off-by: Jafar Al-Gharaibeh <to.jafar@gmail.com>
2018-10-30 22:13:18 +01:00
Rick Lan
43d81590bb min enable speed set to -1. 2018-10-29 08:54:27 +10:00
Willem Melching
ea684537a9 Improve Toyota radar filtering (#409) 2018-10-26 17:26:00 +02:00
Rick Lan
61576239cf Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-10-26 10:57:45 +10:00
Rick Lan
ad7f1bb446 * revert unnecessary changes 2018-10-26 10:24:57 +10:00
Rick Lan
72ab35d8d6 * added missing values in checks[] 2018-10-26 10:23:39 +10:00
Rick Lan
46655232b6 * clean up changes, rename PCM_CRUISE_LEXUS_ISH in dbc to PCM_CRUISE_2 to reduce changes required in carstate.py 2018-10-26 10:19:49 +10:00
Vasily Tarasov
318e22e39f GM: disengage on radar fault (#396)
* GM: copy cadillac's radar header DBC

* Remove unused interface imports

* Rename num targets message to radar header

* Catch various radar faults
2018-10-23 18:59:34 -07:00
James-T1
8b7f4dc154 Update Genesis fingerprint for longer version from Saeed (#406) 2018-10-23 18:57:51 -07:00
Rick Lan
bbc001e12a making sure every SAFETY_LEXUS_ISH defined as 9 2018-10-24 10:12:04 +10:00
Rick Lan
96dbf1657c Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-10-24 10:05:58 +10:00
Rick Lan
615f90629c update lexus ish defined value to match the value in safety.h in panda/ 2018-10-24 10:03:52 +10:00
rbiasini
434a29a4ee remove badly named file (#404) 2018-10-23 12:05:11 -07:00
Rick Lan
660aaae90c removed extra defined 2018-10-23 14:36:27 +10:00
Rick Lan
97fb20e9fd Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-10-23 13:45:42 +10:00
Willem Melching
1f0144d121 Fix Visiond (#402) 2018-10-22 21:59:18 +02:00
Rick Lan
6e4ac6e5be * merged with 0.5.5 2018-10-22 10:42:22 +10:00
Vehicle Researcher
caad98839f openpilot v0.5.5 release 2018-10-21 15:00:31 -07:00
Vehicle Researcher
25eb268c10 Merge opendbc subtree 2018-10-21 14:52:59 -07:00
Vehicle Researcher
9843c250ce Merge panda subtree 2018-10-21 14:52:58 -07:00
Vehicle Researcher
a51a60b598 Squashed 'panda/' changes from 5253ab0..4dd3f5a
4dd3f5a bump version
6385551 Added Tesla safety changes. (#132)

git-subtree-dir: panda
git-subtree-split: 4dd3f5ac0101a6a14b003ecac1105e122a8f10bd
2018-10-21 14:52:57 -07:00
Ted Slesinski
ecd6e1597f Added new fingerprint for EX-L (#401) 2018-10-20 11:02:00 -07:00
Rick Lan
8068e418c0 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-10-19 12:02:17 +10:00
Rick Lan
2ea95f18e4 * update auto high beam dbc address. 2018-10-19 12:02:00 +10:00
Andrew Frahn
ce13309d74 Revert to using CLU15 message for Gear Selection for Compatability Reasons (#362)
* hyundai WIP

* steer_driver_factor is 1

* removed unnecessary file

* removed unnecessary code

* Update carcontroller.py

bug fix

* safety tuning and fixed interface stiffness

* better lateral tuning, some fixes

* Fix set speed

* added camera state reading, autoresume from stop, cancel on accel, hud alerts

* WIP

* Updated for Kia Sorento *WIP*

* Cleanup

* clean2

* Bug Fixes

* pre-merge

* Add all the cars!

* Panda to auto-detect Camera Bus

* Move Checksum Check

* Final Sorento Tuning

* Make CAN3 for Cam default

* Update README.md

* update panda, minor aesthetic updates

* few other minor changes

* added steer not allowed alert

* bup panda version to force panda update

* fixed camera alerts

* Revert to using CLU15 for Gear Selection

* Missing Defines

Didn’t realise this was removed as well!

* Change Gear Selection Definitions

Add logic to use transmission message rather than cluster message for all gear selections UNLESS the car in question does not have the known good transmission messages

* Revert Camera CAN Bus

* self.candidate

* fixed fingerpint, tested on Sorento

* Update for Elantra on Hyundai-Dev Branch

Latest Elantra values that correlate to progress Community branch.
2018-10-14 07:30:18 -07:00
Vasily Tarasov
64f8cbd387 GM: LKA dashboard icon support (#389)
* GM: LKA dashboard icon support

* Decrease camera keepalive interval

* Use tuple for LKA icon status
2018-10-12 17:37:13 -07:00
Rick Lan
e2767e94a7 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-10-10 16:16:40 +10:00
dekerr
a2b46f3e8e Save one inverse call in building transformation matrix (#384) 2018-10-08 21:02:20 +02:00
Rick Lan
e70922b1ce Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-10-04 14:26:51 +10:00
Jamezz
92146346bf Revert the changes to GM in 0.5.4 (#380)
* Revert 0.5.4 changes for GM for 18ers

* Redo the refactor of stock control msgs

* Fixed missing CONTROL_MSGS -> STOCK_CONTROL_MSGS

* Remove spacing

* Need candidate array idx
2018-10-01 19:13:34 +02:00
Rick Lan
41cb13ada0 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-09-28 12:24:12 +10:00
George Hotz
fb2263a0b1 Merge pull request #377 from commaai/nowiggle
visiond: replace wiggly model with non wiggly model
2018-09-27 13:25:00 -08:00
George Hotz
a32e5119fd visiond: replace wiggly model with non wiggly model 2018-09-27 09:52:07 -07:00
Rick Lan
7b4cd6dd2d Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-09-26 10:15:33 +10:00
Vehicle Researcher
71f1af62c2 openpilot v0.5.4 release 2018-09-25 00:13:41 -07:00
Vehicle Researcher
07d65aa3e6 Merge opendbc subtree 2018-09-25 00:04:00 -07:00
Vehicle Researcher
5c0935d253 Squashed 'panda/' changes from f2292e4..5253ab0
5253ab0 bump panda
6277139 GM Volt: allowing 300 max steer
63b7926 Hyundai safety: temporarily disabled button spam check to avoid camera faults
53aef76 GM: passive on LKA-only cars (#135)
01b5235 bumped panda version
1c0ffd1 Hyundai safety: simplifications
56794d6 Hyundai Safety Auto-Detect which CAN bus Camera is on (#134)

git-subtree-dir: panda
git-subtree-split: 5253ab0ee8fd71f67f62ee1d08361459903c7172
2018-09-25 00:03:58 -07:00
Vehicle Researcher
12e51751ee Merge panda subtree 2018-09-25 00:03:58 -07:00
Vasily Tarasov
af474d4935 Increase Volt's steering limit (#351)
* Increase Volt's steering limit

* Merge panda subtree
2018-09-22 04:41:44 +02:00
Vasily Tarasov
0a72e578f0 GM refactor (#374) 2018-09-22 04:40:52 +02:00
wocsor
8e42b86660 Add XSE trim to fingerprints (#372) 2018-09-21 01:06:15 +02:00
Rick Lan
854f9cf59e Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-09-20 12:08:22 +10:00
Ted Slesinski
45a18307e5 Docker environment breaking (#369)
* Fixes matplotlib dependency

* Use version 2.1.2
2018-09-20 02:59:18 +02:00
Rick Lan
ddef346fc3 * fixed opendbc content order, otherwise cabana can't load it. 2018-09-20 10:27:43 +10:00
Rick Lan
976847dc69 * revert unnecessary changes. 2018-09-19 14:10:37 +10:00
EternityLan
ef0af88f23 Merge pull request #1 from EternityLan/devel_lexus-ish-ave30r_v2
Devel lexus ish ave30r v2
2018-09-19 14:05:16 +10:00
Rick Lan
4a1dd020c7 Merge branch 'devel-lexus-ish-ave30r' of https://github.com/EternityLan/openpilot into devel_lexus-ish-ave30r_v2 2018-09-19 14:02:25 +10:00
Rick Lan
6e476b69c7 * fixed .tx_lin assignment 2018-09-19 13:59:00 +10:00
Rick Lan
4cbbce39d7 * renamed AVE30 to ISH 2018-09-19 10:13:07 +10:00
Rick Lan
fe606a5ba4 Merge branch 'devel' of https://github.com/commaai/openpilot into devel_lexus-ish-ave30r_v2 2018-09-19 09:08:10 +10:00
Rick Lan
c87526ea54 * v2 init 2018-09-19 09:05:48 +10:00
Rick Lan
bfdf0508c0 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-09-19 09:02:35 +10:00
Ted Slesinski
cf268ff510 Add support for accord hybrid (#361) 2018-09-18 06:39:58 +02:00
wocsor
c1283b0976 update CHR fingerprint (#364)
CHR 2016 fingerprint has more messages
2018-09-17 22:24:52 +02:00
Andrew Frahn
72c13f975f Kia Sorento and future Multi-Car Support (#346)
* hyundai WIP

* steer_driver_factor is 1

* removed unnecessary file

* removed unnecessary code

* Update carcontroller.py

bug fix

* safety tuning and fixed interface stiffness

* better lateral tuning, some fixes

* Fix set speed

* added camera state reading, autoresume from stop, cancel on accel, hud alerts

* WIP

* Updated for Kia Sorento *WIP*

* Cleanup

* clean2

* Bug Fixes

* pre-merge

* Add all the cars!

* Panda to auto-detect Camera Bus

* Move Checksum Check

* Final Sorento Tuning

* Make CAN3 for Cam default

* Update README.md

* update panda, minor aesthetic updates

* few other minor changes

* added steer not allowed alert

* bup panda version to force panda update

* fixed camera alerts
2018-09-10 00:30:36 +02:00
Rick Lan
23126143be Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/car/toyota/interface.py
2018-09-08 19:53:22 +10:00
rbiasini
7abb07b402 fixed sign in after Google change (#357) 2018-09-08 06:19:48 +02:00
zeeexsixare
f94419ccb0 Tried native Stop and Go on Highlander ICE with no comma pedal: Works! (#353)
* Trying to make Highlander ICE stop and go

* Making acceleration slow for fuel efficiency

* Removing annoying commanded disengage beep

* Raised accel_max by 50% and commented on chime

* Testing if Highlander ICE can resume follow from 0

* Returned to 1.5 m/s2 for testing stop and go

* Prep for merging upstream

* Prep for upstream merge item #2

* Added Highlander ICE/Hybrid to Stop and Go

Also updated table of vehicles

* Rollback advertising stop and go for Highlanders

* Fix whitespace
2018-09-07 05:03:10 +02:00
Vasily Tarasov
ff3df00e0f GM: update readme, ACC is a required package (#354)
ACC implies Driver Confidence II, but not the other
way around. Openpilot requires front, long range radar
that only comes with ACC package.
2018-09-07 05:01:53 +02:00
Vasily Tarasov
d845a258de GM: go passive if detected ASCM or LKA camera (#350)
Since fingerprint is powertrain CAN only, camera still present
on object bus is not an issue.
2018-09-06 20:59:05 +02:00
daehahn
4888d07567 Correct typo for Highlander (#349) 2018-09-05 15:29:36 -07:00
Vasily Tarasov
5acc12852a Change dashboard command of GM to use packer (#347)
* Change dashboard command of GM to use packer

Also, separate "follow distance" from "engaged".

* Fix dashboard setSpeed scaling
2018-09-04 00:21:04 -07:00
Rick Lan
47fa5c78a1 * update safetyParam, 100 doesnt hold bumpy road 2018-09-04 17:16:37 +10:00
Vasily Tarasov
b87dc53c39 Fix pre-enable engagement on GM (#348)
In 2017 Volts, PCM fault occurs for a few seconds if ACC gas
is commanded while user presses gas pedal. PID winds up,
and when PCM fault clears, car gets a "max gas" jolt.

In 2018 Volts, PCM fault doesn't time out, which means pre-enable
doesn't work at all, and car would slowly decelerate, while openpilot
thinks it's engaged.
2018-09-04 00:16:09 -07:00
Rick Lan
175a3b074f * changed safetyParam to 100/1.0 2018-09-04 13:24:14 +10:00
Rick Lan
4bf897953c * remove extra space. 2018-09-04 13:22:39 +10:00
Rick Lan
30be8b9d04 * fix conflict. 2018-09-04 12:50:50 +10:00
Rick Lan
c70a2175c0 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/boardd/boardd.cc
#	selfdrive/car/toyota/interface.py
#	selfdrive/car/toyota/values.py
2018-09-04 12:40:02 +10:00
Vehicle Researcher
5942905701 openpilot v0.5.3 release 2018-09-03 16:43:12 -07:00
Vehicle Researcher
b6ade014a5 Merge opendbc subtree 2018-09-03 16:41:18 -07:00
Vehicle Researcher
c4bba32347 Squashed 'panda/' changes from b058c14..f2292e4
f2292e4 Hyundai: added safety check for button spam
1a8c4c4 Hyundai safety: fwd option
5398abf Hyundai safety: added tests for cruise enable/disable too
a91d7ef added hyundai regression test
487fcae Safety hyundai: fixed RT check
04270b8 Safety Hyundai: bug fixes
d0c28b7 Hyndai safety: tuned
ad1ba69 Hyundai safety: fixed wrong param
8a1dcbe Hyundai safety: added Santa Fe safety: need to be tested. Removed some unnecessary funcitons
4e9d08a Hyundai safety: controls_allowed ==1 by default for now
f42d092 Hyundai all output for now
7927cab compiling the use of bitbang_gmlan only for panda
4fe2dcd build pedal image in CI
3d67294 keep pedal obj folder

git-subtree-dir: panda
git-subtree-split: f2292e420bd856b8cef6633af46e2641f401e84c
2018-09-03 16:41:16 -07:00
Vehicle Researcher
46bdbd36b5 Merge panda subtree 2018-09-03 16:41:16 -07:00
Rick Lan
164a84d049 * updated minEnableSpeed to 19mph as per @rbiasini recommendation. 2018-09-03 13:46:33 +10:00
tentious
3f4c902c6a Honda Odyssey 2018/2019 EX-L PID Tuning (#343)
* Honda Odyssey 2019 EX-L PID Tuning.

* Update interface.py - Increased Kp for Odyssey

Increases response from 0.4, but oscillation still occurs in very sharp curves.
2018-09-02 20:06:19 -07:00
Rick Lan
d382623398 Merge branch 'devel-lexus-ish-ave30r' of https://github.com/EternityLan/openpilot into devel-lexus-ish-ave30r
# Conflicts:
#	selfdrive/car/toyota/interface.py
2018-09-03 12:00:45 +10:00
Rick Lan
db6f46b862 * update minEnableSpeed 2018-09-03 12:00:15 +10:00
Rick Lan
9c2cae25d0 * update minEnableSpeed 2018-09-03 11:53:13 +10:00
Rick Lan
7d34a8fe71 Merge branch 'devel' of https://github.com/commaai/openpilot into devel-lexus-ish-ave30r 2018-09-03 11:48:54 +10:00
Ted Slesinski
e968bb921d Some code refactoring to Honda (#335)
* Move vehicle state values (that get sent to radar) into values.py file, its a better place for it :)

* idx with offset should only be applied to 0x300

* Adds new honda pilot to vehicle state msg array
2018-08-31 19:57:11 -07:00
Rick Lan
4931c8ed3b * all to lower case 2018-08-31 10:40:55 +10:00
Rick Lan
e488a6d88d * minor changes to static msgs. 2018-08-31 10:28:17 +10:00
Rick Lan
f3af6c1fd5 * updated comments. 2018-08-31 00:04:46 +10:00
Rick Lan
397494478a * fix compile error. 2018-08-30 20:49:29 +10:00
Rick Lan
80f13dc8ef * delete unused def. 2018-08-30 20:46:33 +10:00
Rick Lan
7a1a14418e * removed unused var definition. 2018-08-30 20:45:06 +10:00
Rick Lan
defe5dff68 * fix control mismatch issue. 2018-08-30 20:40:46 +10:00
Rick Lan
c5d2d2ea5f * use standard ui command, looks no different before and after. 2018-08-30 20:26:09 +10:00
Rick Lan
bc81560e3b * removed duplicated msg in signal 2018-08-30 20:14:57 +10:00
Rick Lan
99a25a480b * init acc_addr & acc_vl value 2018-08-30 20:06:28 +10:00
Rick Lan
8c05ca15b4 * init commit 2018-08-30 16:11:04 +10:00
Riccardo
5e37e14498 Added Pilot 2019 as supported car to README 2018-08-28 14:25:00 -07:00
rbiasini
f815038069 fixing base UI crash after completing OP guide for the first time (#337) 2018-08-27 10:43:23 -07:00
Ted Slesinski
fe296e91ba Adds 2019 Pilot (#334) 2018-08-26 22:35:11 -07:00
rbiasini
64ba1a7cab fix critical put and get param that caused sporadic controlsd hanging (#333)
* fix critical put and get param that caused sporadic controlsd hanging

* test fix
2018-08-24 19:45:33 -07:00
Jamezz
d18aefe4bc Volt: Don't adjust speed on resume from stopped (#325)
* Don't adjust speed if resuming

* Detab
2018-08-23 18:39:11 -07:00
rbiasini
86a8902872 little endian mask fix (#330) 2018-08-22 11:36:55 -07:00
Vehicle Researcher
fd891b97d6 openpilot v0.5.2 release 2018-08-19 20:36:37 -07:00
Vehicle Researcher
c2a1b71ed4 Merge opendbc subtree 2018-08-19 20:34:33 -07:00
Vehicle Researcher
c812915765 Squashed 'panda/' changes from 5570dac..b058c14
b058c14 add build step for legacy board to CI
866dd85 Fix README (#133)
c2a0853 Hyundai safety: 593 also needs ot be modified
594863c Hyundai: added initial safety files which just fwd bus 0 to 2 and viceversa, except for lkas msgs
905a935 fixed pedal and legacy board builds: no float support
0a480ec moved interpolate function to safety header
d7bd473 Merge pull request #131 from appleguru/master
c0b1ef2 Example to get wifi password from panda over USB using python library
01c0383 Merge pull request #128 from appleguru/gmlan_gpio
f9a46e3 Match safety order from master
aafbe05 GMLAN GPIO Rebase
37df290 rename to gmlan_alt

git-subtree-dir: panda
git-subtree-split: b058c145709a93d56fbe764701962e7d97344ecf
2018-08-19 20:34:21 -07:00
Vehicle Researcher
5e3daaaf11 Merge panda subtree 2018-08-19 20:34:21 -07:00
rbiasini
5e21353fca updated opendbc (#322) 2018-08-16 17:02:52 -07:00
Ted Slesinski
c441124228 Adds 1.5L accord support (#321)
* Adds support for 1.5L Accord

* Merge opendbc subtree
2018-08-13 22:38:14 -07:00
arne182
ce6d787ca2 Spelling Correction (#316) 2018-08-03 00:17:00 -07:00
Vehicle Researcher
38cfc60441 openpilot v0.5.1 release 2018-08-02 02:58:52 +00:00
Vehicle Researcher
03f5ec3346 Merge opendbc subtree 2018-08-02 02:55:39 +00:00
Vehicle Researcher
84fd87c67c Merge panda subtree 2018-08-02 02:55:38 +00:00
Vehicle Researcher
76494ab0be Squashed 'panda/' changes from 5c905b75..5570dac1
5570dac1 Merge pull request #124 from AllWashedOut/patch-1
341e6d31 bumped panda version
98b71f3a Toyota safety: added support for camry and chr (#127)
ba8762d5 Toyota safety: vars and consts need 'toyota_' prefix
d8fc9ff4 Update tesla_tester.py
2a8c2c21 Strengthen VIN detection

git-subtree-dir: panda
git-subtree-split: 5570dac19e908e2980fbab6d935476e5a672299f
2018-08-02 02:55:37 +00:00
rbiasini
d17f80f86a Revert "Added 2014 pre-AP tesla (prior to Oct 28, 2014) (#303)" (#307)
This reverts commit 60426226d0.
2018-07-20 15:06:57 -07:00
Jean-Claude Thibault
60426226d0 Added 2014 pre-AP tesla (prior to Oct 28, 2014) (#303) 2018-07-20 15:02:01 -07:00
Mutley
fad769fbaa Update README.md (#295)
Changed GM minimum speed for steer control
2018-07-15 22:21:52 -07:00
Joshua F. Rountree
758c885973 Adds Pedal Interceptor Support for Honda & Acura Vehicles (#274)
* Adds Joel's Changes to values, sorted as Rick wanted.

* Adds space at end of file.

* Adds Changes to Steering Ratio for Pilot testing.

* Adding this to steer ratio makes it even 3.33

Not sure if this should go into this PR though or not.
This makes the ratio match the other vehicles in the file.  Otherwise it's 3.454545...

* Changes the RAV4 back to not include pedal.

* Updated Comments for Pedal Support

* - Adds menuever test output to gitignore.
- Slight comment update to Ridgeline

* - Cleanup steer status comments
- Adds steering warning for interceptor cars in low speed lockout.

* Cleans up comments.

* Update README.md

* Corrects verbiage in README regarding Comma Pedal on Honda's

* Updates Odyssey and MDX to not add extra warnings for low-speed-lockout.

* Updates Comma Pedal references to use anchor links.

* Minor tweak to README

* Updates RDX to warn no steering below 12mph

* Reverts changes to README, carstate.py, and interface.py

* Removes extra libraries from a prior experiment.

* Replaces README with one from current devel.  Hope this fixes spacing issues.

* Adds Pedal back to Honda Cars and sorts fingerprint values

* Fixes spacing changes that were not intentional.

* Fixed carstate no newline at end of file.

* Fixes new line at end of file issue.

* Converted the Long's to Int's
2018-07-13 17:15:42 -07:00
George Hotz
734002eb63 Merge pull request #290 from commaai/pedal-resum-speed-fix
fixed resume press when comma pedal is used
2018-07-13 16:55:40 -07:00
Riccardo
949cbd214b fixed resume press when comma pedal is used 2018-07-13 15:52:59 -07:00
George Hotz
0d9447c76b Merge pull request #288 from jfrux/patch-1
Minor README.md update.
2018-07-13 12:24:24 -07:00
Joshua F. Rountree
ce0205bcd4 Update README.md 2018-07-13 13:10:37 -04:00
Joshua F. Rountree
919a131c58 Integrated the requests by Andrew 2018-07-13 12:17:42 -04:00
George Hotz
34efbd6869 fix up table 2018-07-12 23:02:20 -07:00
Joshua F. Rountree
23444a7a70 Minor README.md update.
Loving the way this adds some realism and cleans things up a bit on the image.
Let's do this! xD <3

Thanks for the AMAZING and EXCITING update.  Driving on it first thing in the morning.
Congratulations Comma Team!
2018-07-13 01:56:01 -04:00
Vehicle Researcher
0ac89e92ae openpilot v0.5 release 2018-07-12 18:52:06 -07:00
Vehicle Researcher
df2413e2d7 Merge opendbc subtree 2018-07-12 18:48:44 -07:00
Vehicle Researcher
5e977f42b3 Merge panda subtree 2018-07-12 18:48:43 -07:00
Vehicle Researcher
7fca1ba2f4 Squashed 'panda/' changes from e7ca587b..5c905b75
5c905b75 update J2534 install instructions
a4f3cc79 update panda readme for amazon

git-subtree-dir: panda
git-subtree-split: 5c905b75253db1094926243d53faa9fa24fad19d
2018-07-12 18:48:42 -07:00
AlexMcInerney
3da91deed6 Added 2018 Chevy Volt Support with New Fingerprint (#283)
* Update values.py

* Add 2018 Volt Support Fingerprint
2018-07-06 16:29:31 -07:00
dekerr
6cdc2a8bc7 Small cleanup (#275)
* mass unit conversions

* flat/explicit conditions

* fix typos

* remove hardcode

* Update README.md

* Update carcontroller.py
2018-06-28 12:33:54 -07:00
Vehicle Researcher
16132b3aaa openpilot v0.4.7.2 release 2018-06-25 13:48:52 -07:00
Vehicle Researcher
00af220ee1 Merge opendbc subtree 2018-06-25 13:45:15 -07:00
Vehicle Researcher
7953078a31 Squashed 'panda/' changes from 0dcd84d7..e7ca587b
e7ca587b long isotp msgs
1a94543a Panda safety: minor generalization of the function max_limit_check
6b316011 Safety: minor data type cleanup

git-subtree-dir: panda
git-subtree-split: e7ca587b2bf70ae321e0260a7997cf893f8c8389
2018-06-25 13:45:14 -07:00
Vehicle Researcher
0b4715a1b4 Merge panda subtree 2018-06-25 13:45:14 -07:00
Ted Slesinski
05ae05ce05 Add accord hybrid to fingerprint (#271) 2018-06-24 20:43:51 -07:00
Ted Slesinski
6c299f6f62 Adjusting Kp, Ki values to reduce steer oscillation on CRV_5G 2018-06-21 19:53:21 +02:00
Vehicle Researcher
ec92462301 openpilot v0.4.7.1 release 2018-06-19 01:41:45 +00:00
Vehicle Researcher
7266508701 Merge opendbc subtree 2018-06-19 01:38:16 +00:00
rbiasini
16f124d385 Acura ILX steer fault fix: send STEER_TORQUE_REQUEST = 0 when temp faults are present (#264) 2018-06-17 23:35:05 -07:00
Vehicle Researcher
0d9734960e openpilot v0.4.7 release 2018-06-16 20:59:34 -07:00
Vehicle Researcher
c8f4b4e420 Merge opendbc subtree 2018-06-16 20:56:04 -07:00
Vehicle Researcher
4920e69752 Merge panda subtree 2018-06-16 20:56:03 -07:00
Vehicle Researcher
d5b884f824 Squashed 'panda/' changes from ef880b76..0dcd84d7
0dcd84d7 Toyota safety: integer division bug
9a268f33 Toyota Safety: cleaner var types
8638650d bump panda version
9ab6a562 gmlan recv test
a1a2d979 gmlan test
8efa3897 detect ack
f5fab4b4 nicer err
ad4d4231 add gmlan fail count
bb41ff75 test
998f7c01 oops, set recessive
80051bea autoretry on chime
813218de GM: allowing higher brakes in Volt, so decel can reach between 3 and 3.5 m/s2
74ad3d65 GM: max param definitions
38a9ea9a added gm safety for steering (#123)
bf5db45a Safety: made the driver steer check common so it can be shared across multiple safety files
ef079e6d Safety: made rate limit check also common
dc3cc240 Safety: made common the max torque check as well
dbc3568a removing extra spaces
1966bdf3 Safety: made real time rate limit check a shared function
e2144776 use timer for can bitbanging
cb927337 minor bitbang refactor
ed2920cf support extended addressing in canbitbang
36df0996 move speed
be46c7a3 Merge pull request #122 from commaai/gmbitbang
7edc88e5 put that back
fa66e4b7 Revert "handle rollover"
2ce3a26a handle rollover
223a1fb6 cleanin it up
1ba79077 that space tho
d917386b bitbanging works
74af4417 can crc
932d7278 bit stuffing support
be225227 bros ok match bros
55da0b65 rigol yea, dj pauly d yea
a5775835 working on gmbitbang
875c2bd3 Cadillac: block OP messages if OP is on
7caba241 Addition to Bosch safety to support Hatchback (#111)
63ca46bc modify before we forward
bf70f515 Safety: increase buffer for sampled signals. TBD a violation feedback from board to prevent car faults
b0541a83 Cadillac: monitoring the 4 torque messages independently
cd1dba9f Cadillac: fixed bug in regression safety
ca0b6beb Cadillac: fixed typo. Need better regression tests to catch this
d9f1e616 Cadillac: simplified the ignition code by removing the timeout logic and resetting controls_allowed = 0 at each init
293fd1ac GM: using real ignition logic. Creedit to Jamezz
8fa507b6 GM: simplified max steer check logic, Cadillac: fixed can parsing bug
c7e2c2d6 Cadillac (#119)
83bcaa39 small logic cleanup (#118)
9d92bf27 Cadillac: need to specify car name in const
79ab5af8 Toyota: moved common functions into safety header file
40c8ddaf Cadillac ignition: simplified logic
69be556d Cadillac: better ignition logic
d176220c Ignition: made a default hook for GPIO
bea51874 Cadillac: added max steer safety
dbc11a17 Cadillac: always controls allowed for now
ace232a9 Cadillac: ignition bug
e2c89d6b Cadillac: changed ignition logic to be based on can presence
528f901b Cadillac: simpler ignition logic
4e79ecf1 Cadillac: added safety file placeholder

git-subtree-dir: panda
git-subtree-split: 0dcd84d7912cd72d3aeaad4653007d1f178a1567
2018-06-16 20:56:02 -07:00
Ted Slesinski
e68afd7a08 Add missing messages fron Pilot EX-L to fingerprint (#260) 2018-06-06 10:20:38 -07:00
dekerr
0fe3e51115 Std unit conversions (#259)
* Added conversion constants

* implemented std unit conversion

* changed centerToFront ratio

Changed weight distribution ratios used to calc center of gravity distances to align closer to manufacturer specs

* implemented std unit conversion

* remove unused conversion

* reverted wheelbase conversion

slight change to pilot wheelbase

* removed redundant conversion

* removed incorrect/unused conversion

* removed class that now exists in honda/values.py

* redirect Cruisebuttons call

* redirect Cruisebuttons call

* Update interface.py

* Update numpy_fast.py

Refactor

* Update numpy_fast.py

* Update numpy_fast.py

-encapsulated get_interp 
-reduced calls to len() for iterable input
2018-06-04 12:39:54 -07:00
Tyler
2f641984d9 Update process_dbc.py 2018-05-31 20:16:08 +02:00
Vasily Tarasov
37ac143808 s/persistant/persistent/g (#254) 2018-05-30 13:40:18 -07:00
Willem Melching
0c959c062b clean git repo before neos update 2018-05-24 00:22:48 +02:00
Vehicle Researcher
c6a761a06f openpilot v0.4.6 release 2018-05-23 03:59:04 +00:00
Vehicle Researcher
ea6c19638c Squashed 'pyextra/' changes from 4eda4dd..eb09257
eb09257 Add gunicorn to pyextra
9558197 add flask to pyextra

git-subtree-dir: pyextra
git-subtree-split: eb092578c359bd54db22569d696ecacbd90237c3
2018-05-23 03:55:35 +00:00
Vehicle Researcher
e40ed2d6de Merge pyextra subtree 2018-05-23 03:55:35 +00:00
Vehicle Researcher
ece216260e Merge opendbc subtree 2018-05-23 03:55:33 +00:00
Vehicle Researcher
dcacbf606a Squashed 'panda/' changes from 9cffa74..ef880b7
ef880b7 Merge pull request #116 from commaai/buy_panda
9311f0d update readme graphics
4150684 add javascript and bump pandacan version
ace4a22 Ford safety (#115)

git-subtree-dir: panda
git-subtree-split: ef880b76356a992509d809d3369b5954636969f3
2018-05-23 03:55:30 +00:00
Vehicle Researcher
5bff3e4bc3 Merge panda subtree 2018-05-23 03:55:30 +00:00
Vehicle Researcher
ce0a47f674 openpilot v0.4.5.1 release 2018-05-01 23:19:47 +00:00
Vehicle Researcher
48de7ee011 openpilot v0.4.5 release 2018-04-28 09:44:39 +00:00
Vehicle Researcher
e1387452be Merge opendbc subtree 2018-04-28 09:40:30 +00:00
Vehicle Researcher
bb2587664a Squashed 'panda/' changes from 2253dd3..9cffa74
9cffa74 bump version
988fbf5 disable autobaud by default

git-subtree-dir: panda
git-subtree-split: 9cffa74e04a9c46d728162834b80df818dde0375
2018-04-28 09:40:29 +00:00
Vehicle Researcher
045cc233c8 Merge panda subtree 2018-04-28 09:40:29 +00:00
Vehicle Researcher
624abefdb0 openpilot v0.4.4 release 2018-04-14 06:10:58 +00:00
Vehicle Researcher
2da8c42a82 Merge opendbc subtree 2018-04-14 06:06:43 +00:00
Vehicle Researcher
e6e6ad2e1f Squashed 'panda/' changes from 3125232..2253dd3
2253dd3 fix volt ign detect
3b299d7 add ignition and refactor
af9af6d Merge pull request #110 from Jamezz/volt
13e850e more correct
f295063 add new define to tests
fec9758 gate that with debug
5516ebf one more ifdef
cac7b31 only panda has float
938d474 fpu enable
ffbf0c7 cleaner
de30f27 Revert "need f to not be double"
4142acf need f to not be double
3eb15c8 refactor to share code
a4c8b64 change to O2 to fix make recover
711fd11 Enable compiler optimizations, fix things it breaks
2e6f774 block IPAS in main toyota safety mode
e7a2b3a add ipas tests
894572c fix tests
367c9ad add safety toyota ipas
95919b9 Bounty: panda high quality CAN autobaud (#96)
6557cd2 Toyota Safety: allow controls only on rising edge of cruise_engaged
02c1ddf Revert "added steer override check when IPAS is in control (#106)"
9f925ba Fix the merge mess
23d3833 Merge from comma upstream
a0cc51a Undo safety mode override
ea1c1dc make wlan interface name generic
6dbd8c9 Implement WebUSB and upgrade WinUSB to 2.0 (#107)
4fc83a5 Add safety hook for ignition and have GM use gear selector to determine ignition
52b2ac0 switch from travis to circleci
48e2374 build panda esp image
065572a circleci build stm image
7a1f319 add panda python package test and fix safety test
021dde7 move saftey test helper files into safety folder
ce0545f add ci files
6a3307c no LIN over ELM
7d21acb added steer override check when IPAS is in control (#106)
1c88caf Safety code testing (#104)
f4efd1f Merge pull request #101 from adhintz/master
c02618b Merge pull request #102 from quillford/master
1ba5f8a added link to wiki for user scripts
de2b19e add support for multiple buses to can_unique and can_bittransition output data in sorted order.

git-subtree-dir: panda
git-subtree-split: 2253dd3c48e21abb82fe161d6f58237490111206
2018-04-14 06:06:42 +00:00
Vehicle Researcher
c9253a8d52 Merge panda subtree 2018-04-14 06:06:42 +00:00
Ted Slesinski
703b05187d 2017 Honda Ridgeline (#198)
* Adds Honda Ridgeline

Replaced trim level placeholder

Adding 0x301 ridgeline message

(I restructured this slightly since we don't need to repeat `commands.append(make_can_msg(0x300, msg_0x300, idx, 1))` so many times

Updated dbc name

Use pedal_gas to detect gas pressed

Remove unnecessary signal check

Fix array notation

* Tire stiffness factor bumped to 1.5x

* Adds safety tests at line 133

* Revert "Adds safety tests at line 133"

This reverts commit 349edf5b1a879cac704db3786d0626211497bcb7.

* fix failing build due to syntax

* update variables for failing build

* Update interface.py

* Update Tire Slip Factor
2018-04-12 19:12:45 -07:00
Vehicle Researcher
9f59ef7516 openpilot v0.4.3.2 release 2018-03-31 07:54:47 +00:00
Vehicle Researcher
2352ad0bb0 Merge opendbc subtree 2018-03-31 07:29:19 +00:00
vanillagorillaa
deab5888bb update year on civic 2018-03-22 23:34:47 +01:00
Willem Melching
80ed445604 fix bug in canpacker for Toyotas with DSU connected (#221) 2018-03-22 15:13:23 -07:00
Vehicle Researcher
2e591b3923 openpilot v0.4.3.1 release 2018-03-19 23:40:24 -07:00
Vehicle Researcher
5ddfd922fe openpilot v0.4.3 release 2018-03-18 10:36:29 -07:00
Vehicle Researcher
17c209da85 Merge opendbc subtree 2018-03-18 10:32:25 -07:00
Vehicle Researcher
a8d110ad74 Squashed 'panda/' changes from 67d5208..3125232
3125232 bump version
703c0b4 Gas Interceptor: another fix to gas pressed logic
196d383 Interceptor: fixed gas pressed logic

git-subtree-dir: panda
git-subtree-split: 31252324d98e701c33cb6aeda20af6b549175764
2018-03-18 10:32:24 -07:00
Vehicle Researcher
d55aa7b715 Merge panda subtree 2018-03-18 10:32:24 -07:00
George Hotz
6eca4b7b42 Merge pull request #192 from gregjhogan/wifi-only-upload-fix
fix restricting video upload to wifi
2018-03-17 12:01:42 -07:00
Vehicle Researcher
0a53d754af openpilot v0.4.3 release 2018-03-17 00:01:50 -07:00
Vehicle Researcher
75432db70d Merge opendbc subtree 2018-03-16 23:57:47 -07:00
Vehicle Researcher
38cac4d9a8 Merge panda subtree 2018-03-16 23:57:46 -07:00
Vehicle Researcher
098e304118 Squashed 'panda/' changes from 98f29a4..67d5208
67d5208 fix signedness issue in toyota safety
fe15d3f bump pandacan
11c2b08 add fault invalid
2c26e45 add sleep
27c7637 forgot the counter
3a6d7db don't hang
bfa7d2e canloader works
b259e2a can flasher is close to working
83f2edf isotp can support in softloader
7ae7c79 typo
e85cc47 forgot the selfs
190b4f6 start work on canflasher
5c655c9 add recover support
ae3457f usbflash is reliable
f7a0ab0 pedal usbflash works
585d0f9 add way to call isotp
be82899 despite it being bad code, move isotp
000715b start work on pedal canloader
626e312 pedal has a bootstub now
3662d1e redundant check
81e6b0d fix bug
083cd12 should have bounty to refactor that ish
b65d30c bad asserts
b2e6c3f isotp untested support for subaddr
30fd66a Merge pull request #93 from vntarasov/volt
06f5109 Merge pull request #94 from gregjhogan/can-printer-hex
c7d098c Merge pull request #95 from gregjhogan/setup-script
22fe250 Merge pull request #99 from gregjhogan/bit-transition-example
ba16ba3 Merge pull request #100 from gregjhogan/j2534-troubleshooting-instructions
ad08ea4 Merge pull request #90 from gregjhogan/can-forwarding
f3b6f5d added j2534 troubleshooting instructions
858d150 added script to find bits that transition from 0 to 1
c6acac8 added checking pedal interceptor message length
f7226ff added brake safety checks
d0c2634 added gas safety checks
d378e4a removed bosch safety forwarding restriction on 29 bit addresses
5c7ef9e added bosch safety hooks and forwarding
90c64b6 add note
23de8d4 Merge pull request #97 from commaai/pedal_improvements
0261641 added missing python packages
b92b235 fix bytearray encode issue
2434f1c Tweak Volt's brake pedal stickiness
e2f73d2 enable has a whole byte to itself
d5a9e1e correct checksum
f8ed9fa better names
986a14c don't alias pointers
9b8472e add watchdog support
8f0add9 handle faults
1d917f8 split gas set into 2 values, and have a fault state
1b77026 j2534 isn't alpha anymore
fbcc872 Merge pull request #92 from commaai/pedal
8a6f44b pedal is sending messages
08f464c python 3 bro is bad bro
9390961 kline checksum algo was broken...
3b7c33b add kline debug support
aa622bc init values
631ea9f better refactor
eb1fd75 add PEDAL adc sets
ccaa310 don't build with usb
8d4d763 debug console works
bd09883 comma pedal is building
75a29d5 Merge pull request #84 from gregjhogan/j2534-hds
eece37d only the panda has gmlan
9f43abe Merge pull request #89 from vntarasov/volt
5364d43 Merge pull request #88 from vntarasov/smaller-firmware
377a1ec bump version for descriptor fix
4fabdf0 Merge pull request #87 from gregjhogan/usb-multi-packet-control
8580773 fix sending WinUSB Extended Properties Feature Descriptor
6908feb Chevy Volt safety
786a004 Enable optimization to reduce firmware size
d70f43b hack to fix thinkpad
95ab1ae fixed flow control message padding
bbd04d1 updated installer
62216d0 single standalone DLL for J2534 driver
5c9138d fixed 11 bit address issue
f3b0ad2 fix LOOPBACK getting set when DATA_RATE is set
b750d36 updated README
a9a097f lowered CPU utilization
7c26a70 TIS needs unsupported protocols to return an error
42692b4 TIS doesn't like ChannelID being zero
cf126bb SET_CONFIG return error for reserved parameters
2e99dbf fix HDS issues
8203cc8 add is_grey
e946a54 add insecure_okay flag
4363b3e check webpage
4f59ded add secure mode note
6b11fb5 add autosecuring to tests
b27d185 Merge pull request #86 from commaai/better_pairing
4b53b42 elm wifi isn't an automated test
99f85cb Merge pull request #85 from gregjhogan/usb-wcid
0d38060 auto-install WinUSB device driver
c6653ca from python import
38cc0ee add wifi_secure_mode, boots in insecure mode

git-subtree-dir: panda
git-subtree-split: 67d52089a1300b86800d897f2b271e0a24cf6dd6
2018-03-16 23:57:45 -07:00
Mark Krieger
e9e884b0ee Slight changes to UI and Fingerprint for Odyssey Elite (#196)
* Adding back drive time to UI

* Add fingerprint for Odyssey Elite

* Removed extended fingerprint for Elite

* Revert "Adding back drive time to UI"

This reverts commit b9b02f7ff2511f28922f0bea47cd8c70bb9f4010.
2018-03-16 21:28:50 -07:00
Vasily Tarasov
e311cb647f Interpolate ki/kp for steering PID loop (#200)
* Interpolate ki/kp for steering PID loop

Very much needed for the Volt port: car ping-pongs with low kp
on high speeeds, and the loop is unstable with high kp on
low speeds.

Also, removes "number or array?" logic from PIController,
now that all the callers use interpolation ofr ki/kp.

* Pass speed to steering PID loop for ki/kp interpolation

* Remove unused numbers import
2018-03-15 13:28:15 -07:00
arne182
48de5711c9 Update fingerprints.py (#210)
Consolidated my fingerprint and removed duplicates and ordered the fingerprint for the RAV4H. Double Checked.
2018-03-09 13:34:39 -08:00
George Hotz
b7f4e0fb84 Merge pull request #203 from energee/safety-honda-bosch
Safety Reference for Honda Bosch
2018-03-08 08:33:31 -08:00
Ted Slesinski
5407485f96 Safety Reference for Honda Bosch 2018-02-28 10:24:05 -05:00
George Hotz
478012f716 Merge pull request #202 from vntarasov/volt-gm-id
Dibs on SAFETY_GM numerical value
2018-02-27 22:58:02 -08:00
Vasily Tarasov
d0b952fbc5 Dibs on SAFETY_GM numerical value
To match Panda repo.
2018-02-26 10:22:19 -08:00
Greg Hogan
420631d588 fix restricting video upload to wifi 2018-02-10 09:31:56 -06:00
vanillagorillaa
a102cc7c8c Honda Pilot 2017 Port (#161)
* Update README.md

* Update fingerprints.py

* Update carstate.py

* Update hondacan.py

* Update interface.py

* Update interface.py

* Update interface.py

* Update README.md

* Update README.md

* Update README.md

* Update fingerprints.py

* Update carstate.py

* Update hondacan.py

* Update interface.py

* Update carstate.py

* Update hondacan.py

* Update README.md

* Update fingerprints.py

* Update carstate.py

* Update carstate.py

* Update carstate.py

* Update hondacan.py

* Update interface.py

* Update carstate.py

* Update carstate.py

* Update Pilot Fingerprint

* Update fingerprints.py

* Give pilot its own definition and not use ILX

* add pilot argument

* Add Pilot interface

* Add pilot argument

* Update interface.py

* Parse Different gear on pilot

* Add steer max

* Fixed duplication of steer max value

* Adjust PID's for steering

* Update carcontroller.py

* Change Steer Ratio and wheelbase

* Update Steer fault values

Steer fault value of 3, does not seem to effect anything

* Update Kp,Ki Ratio

* Update interface.py

* Update readme for Pilot

* add pilot

* Update fingerprints.py

* Update carstate.py

* add signals

* add signal
2018-02-09 12:50:37 -08:00
Vehicle Researcher
ec46db033a openpilot v0.4.2 release 2018-02-06 12:43:45 -08:00
Vehicle Researcher
2446f64e45 Merge opendbc subtree 2018-02-06 12:39:39 -08:00
Vehicle Researcher
db67cffb4d Squashed 'panda/' changes from b42db6d..98f29a4
98f29a4 v1.0.7 has working grey panda

git-subtree-dir: panda
git-subtree-split: 98f29a4a97af58aa4707bdaba948ac366ab2e6a0
2018-02-06 12:39:38 -08:00
Vehicle Researcher
909cc30181 Merge panda subtree 2018-02-06 12:39:38 -08:00
vanillagorillaa
c7bf1369d6 Acura RDX 2018 AcuraWatch Plus Port (#162)
* Adding Acura RDX alpha support
2018-02-05 18:38:40 -08:00
ErichMoraga
c00bc15a2a Update fingerprints.py
Taiwanese Prius Prime fingerprint was identical to the regular prime (107 msgs.), but should really have 110.  I have the correct one in there now.
2018-02-05 14:16:58 -08:00
George Hotz
15aea578e0 openpilot v0.4.1 hotfix 2018-02-02 19:30:44 -08:00
George Hotz
0e60a6235d openpilot v0.4.1 tweaks 2018-01-30 21:34:01 -08:00
Vehicle Researcher
0250a1aa64 openpilot v0.4.1 release 2018-01-30 12:58:14 -08:00
Vehicle Researcher
4dc2cccd48 Merge opendbc subtree 2018-01-30 12:54:13 -08:00
Vehicle Researcher
96f8e5158e Squashed 'panda/' changes from 2573d86..b42db6d
b42db6d Merge pull request #82 from commaai/uart_dma
fd68f86 smallr
be99ffc ok that doesn't hurt i think
a9f6bf0 this
8b7e849 working now
7fa4808 froze up, maybe thats the fix
1465aa4 ok, it's fixed
915cd84 ugh, ok, need that
fd05376 comment out debug
37c5263 big fifo
497f069 dma is all critical, no interrupts
7c34afe minor change
743d244 high baud rate works
5d2a4ba v1.0.6
fbf1390 Toyota Safety: fix in input param
6c01d09 Toyota: less torque error allowance to meet Corolla acceptable behavior
07c01b2 Toyota safety: using input param
4410a59 add safety param support
fc81fc1 uart dma in progress
65fb2b2 grey panda query, 1.0.5
f415c9a grey panda detection
b68957e add pandadebug support
b5e4962 leave msgs around in isotp
0acce2d add recvaddr support
3fc38f4 set bootmode with power
d4c052a make that work
21f8195 fix panda serial write
af74aa9 from python import

git-subtree-dir: panda
git-subtree-split: b42db6dc082fb13ef5ac63ed197a63e179651ef6
2018-01-30 12:54:12 -08:00
Vehicle Researcher
dcf112237f Merge panda subtree 2018-01-30 12:54:12 -08:00
George Hotz
3368e23a5b Merge pull request #155 from slesinski/odyssey-port
Honda Odyssey 2018 EX-L with Honda Sensing
2018-01-18 21:49:14 -08:00
Ted Slesinski
fcddfab737 Unnecessary characters in comma's dongle id 2018-01-19 00:47:47 -05:00
Ted Slesinski
684a20da1d SteerRatio should be 14.35 2018-01-19 00:37:32 -05:00
Ted Slesinski
c0b865aa07 Added the extra carstate reads 2018-01-19 00:34:02 -05:00
Ted Slesinski
9bac947c5d Tuning specific to odyssey 2018-01-19 00:34:02 -05:00
Ted Slesinski
a0fa4b6bcc Gear shifter values like acura 2018-01-19 00:32:51 -05:00
Ted Slesinski
c5024a837d Car_gas 130 missing canbus, using 17c 2018-01-19 00:32:51 -05:00
Ted Slesinski
c00f90638d BRAKE_HOLD signal not ready yet 2018-01-19 00:32:51 -05:00
Ted Slesinski
d8b3a0220a Park Brake not yet in DBC 2018-01-19 00:32:51 -05:00
Ted Slesinski
eca5067f2b Wrong value for MAIN_ON 2018-01-19 00:32:51 -05:00
Ted Slesinski
c31e56727a Packet size off on a fingerprint id 2018-01-19 00:32:51 -05:00
Ted Slesinski
63dce92056 Add hondacan changes 2018-01-19 00:30:33 -05:00
Ted Slesinski
b599d835aa Add carcontroller changes 2018-01-19 00:30:33 -05:00
Ted Slesinski
981871c512 Add odyssey car params to interface 2018-01-19 00:30:33 -05:00
Ted Slesinski
d4b8088969 Add carstate changes 2018-01-19 00:30:33 -05:00
Ted Slesinski
0fd3ea3b1a Add odyssey fingerprint 2018-01-19 00:30:33 -05:00
Vehicle Researcher
176edf427e openpilot v0.4.0.2 release 2018-01-18 15:46:12 -08:00
Vehicle Researcher
87d313e132 Merge opendbc subtree 2018-01-18 15:42:13 -08:00
Vehicle Researcher
5f014635e1 Squashed 'panda/' changes from c371fe6..2573d86
2573d86 docs say max is 4, respect the docs
864cd8f failing on some devices
54bcc67 Merge pull request #75 from gregjhogan/j2534-vs-2017-upgrade
1664270 Merge pull request #74 from gregjhogan/j2534-disconnect-fix
a7e3a8f bump panda version for serial bug
aa0cfad fix UART hang
09ab8f6 add sendaddr support to isotp
40a1883 fix up baud rate
65997ff add PandaSerial and location panda (aka pigeon) test
57d633c upgraded to VS 2017
35cc32a fixed pointer exception on disconnect

git-subtree-dir: panda
git-subtree-split: 2573d861e605a2dcf456a6421b31e83fdd9ca606
2018-01-18 15:42:12 -08:00
Vehicle Researcher
252e8d57ce Merge panda subtree 2018-01-18 15:42:12 -08:00
Vehicle Researcher
6b1716a43c openpilot v0.4.0.1 tweaks 2018-01-16 23:26:39 -08:00
heatnation
23fe981cd5 Update fingerprints.py 2018-01-15 18:22:15 -08:00
Vehicle Researcher
68ffef7ae8 openpilot v0.4.0.1 release 2017-12-23 17:15:27 -08:00
Vehicle Researcher
57b9ddf20e Squashed 'pyextra/' content from commit 4eda4dd
git-subtree-dir: pyextra
git-subtree-split: 4eda4dd765c2bc719da9064774de6b2c14c322d1
2017-12-23 17:10:45 -08:00
Vehicle Researcher
ef1227777f Merge commit '57b9ddf20ef28d7a9b4fd57c08630281ef103422' as 'pyextra' 2017-12-23 17:10:45 -08:00
Vehicle Researcher
94c28dd0a0 Merge commit 'ba97d0e83837b4c893edc609001dde7c41b8e24b' as 'opendbc' 2017-12-23 17:10:44 -08:00
Vehicle Researcher
c251b312d8 Squashed 'panda/' content from commit c371fe6
git-subtree-dir: panda
git-subtree-split: c371fe688dbad4c53635905d3471a01c185e811d
2017-12-23 17:10:42 -08:00
Vehicle Researcher
36c3fc1842 Merge commit 'c251b312d87d26b5ed347b267f6f1570793f9b91' as 'panda' 2017-12-23 17:10:42 -08:00
Vehicle Researcher
73a0364d24 remove submodules 2017-12-23 17:06:56 -08:00
Vehicle Researcher
9bb5274201 openpilot v0.3.9 tweaks 2017-12-06 12:48:00 -08:00
Vehicle Researcher
4ad0e4c24c openpilot v0.3.9 release 2017-11-22 04:30:24 -08:00
Vehicle Researcher
cf7a5b9b7c update releases 2017-11-04 05:31:15 -07:00
Vehicle Researcher
d07b14657e openpilot v0.3.8.2 tweaks 2017-11-03 18:21:38 -07:00
Vehicle Researcher
e9e57ebc4d openpilot v0.3.8.2 release 2017-10-31 02:27:39 -07:00
Vehicle Researcher
61c2994880 openpilot v0.3.7 tweaks 2017-10-03 23:46:23 -07:00
Vehicle Researcher
629d2b8af4 openpilot v0.3.7 tweaks 2017-10-03 00:35:46 -07:00
George Hotz
8b7486f5c0 Bump panda version to fix old board updating 2017-09-30 23:30:38 -07:00
Vehicle Researcher
471024f7b7 openpilot v0.3.7 release 2017-09-30 19:05:03 -07:00
espes
d6dca124a7 Fix rear view mirror setting 2017-08-28 22:24:11 -07:00
Vehicle Researcher
d9f8719f51 openpilot v0.3.6.1 tweaks 2017-08-16 05:21:06 -07:00
Vehicle Researcher
be014c1b23 openpilot v0.3.6.1 release 2017-08-15 03:15:00 -07:00
Vehicle Researcher
6bd42e1d92 openpilot v0.3.6 tweaks 2017-08-10 20:38:56 -07:00
Vehicle Researcher
efac35a337 openpilot v0.3.6 release 2017-08-09 17:41:38 -07:00
Vehicle Researcher
d297393649 openpilot v0.3.5 release 2017-07-30 17:59:37 -07:00
Vehicle Researcher
93df8edcf6 openpilot v0.3.4 tweaks 2017-07-28 20:51:27 -07:00
Vehicle Researcher
8cc5a0802d openpilot v0.3.4 release 2017-07-28 03:23:57 -07:00
George Hotz
b1c272b893 Merge pull request #116 from commaai/revert-114-new_panda_code
Revert "Pulled in new panda firmware and updated boardd to support the changes."
2017-07-17 23:17:13 -07:00
George Hotz
9f0e201537 Revert "Pulled in new panda firmware and updated boardd to support the changes." 2017-07-17 23:16:57 -07:00
George Hotz
753f81a9f2 Merge pull request #114 from diamondman/new_panda_code
Pulled in new panda firmware and updated boardd to support the changes.
2017-07-11 22:24:38 -07:00
Jessy Diamond Exum
8162b0833c Removed unnecessary TODO 2017-07-11 22:01:04 -07:00
Jessy Diamond Exum
93e322a9a0 Moved boardd loopback config to envvar. 2017-07-11 21:59:03 -07:00
Jessy Diamond Exum
8e0cd2fd3b Pulled in new panda firmware and updated boardd to support the changes. 2017-07-11 21:45:16 -07:00
George Hotz
28b00c1086 Merge pull request #113 from pjlao307/update-alert-text
Update alert text
2017-07-07 10:25:59 -07:00
Joey Lao
8a760b4bb5 Update steering controls saturated message 2017-07-06 22:36:55 -07:00
pjlao307
3b9ebd43db Merge pull request #2 from commaai/release
Release
2017-07-03 11:15:42 -07:00
George Hotz
4a145a3415 Merge pull request #109 from commaai/devel
openpilot 0.3.3
2017-06-30 18:23:10 -07:00
Vehicle Researcher
f558179f1e openpilot v0.3.3 release 2017-06-28 13:57:09 -07:00
George Hotz
3e4854e7e6 Merge pull request #102 from energee/devel-crv
Bounty: 2016 Honda CR-V Touring
2017-06-22 11:52:38 -07:00
Ted Slesinski
bc57d65c36 Addresses brake error review comment 2017-06-20 02:51:58 -04:00
Ted Slesinski
5bbdee5b1d Fixes global saturation change 2017-06-20 02:47:47 -04:00
Ted Slesinski
df363ff0c3 Adds correct value of 8 to gearshifter check array 2017-06-20 02:46:59 -04:00
Ted Slesinski
d417e4b8aa Init crv variable 2017-06-20 02:26:50 -04:00
George Hotz
7b9791660d Merge pull request #103 from pjlao307/pjlao-update-ui
Update UI to make text more readable in all conditions as requested by community
2017-06-19 20:37:37 -07:00
Joey Lao
8cd9767a99 Make lead car text a little brighter 2017-06-12 16:39:10 -07:00
Vehicle Researcher
70467635f7 Revert last commit since KPH can get 3 digits long 2017-06-12 09:30:47 -07:00
Vehicle Researcher
83ceffbf87 Adjust position of left speed to align with label (based on 2 digit speeds) 2017-06-12 09:03:49 -07:00
Vehicle Researcher
c449945b6c More code cleanup 2017-06-12 08:41:11 -07:00
Vehicle Researcher
161a8e8184 Use color param in ui_draw_rounded_rect instead of hard coding 2017-06-12 08:27:57 -07:00
Vehicle Researcher
af90994b1e Add background to radar text. Code cleanup. 2017-06-12 08:19:47 -07:00
John Jones
1aebd13649 missed one update in latcontrol 2017-06-11 21:33:44 -04:00
Vehicle Researcher
c43d143744 Clean up code 2017-06-11 15:18:39 -07:00
Vehicle Researcher
fd1a382f99 Remove commented line 2017-06-11 15:16:46 -07:00
Vehicle Researcher
e1c419d845 Update UI to make speed text more readable in all conditions as requested by community 2017-06-11 15:12:50 -07:00
John Jones
ab03b47fc3 adding steering change from video and removing integer div and adding ki/kp changes 2017-06-11 13:20:19 -04:00
Ted Slesinski
70a192348f Reverting steering to original value 2017-06-08 13:15:30 -04:00
Ted Slesinski
0bae1a40d1 Syntax typo 2017-06-08 02:33:31 -04:00
Ted Slesinski
5a8384a048 Adds support for 2016 Honda CR-V Touring 2017-06-08 01:37:39 -04:00
Vehicle Researcher
1d87a0a350 openpilot v0.3.2 release 2017-05-22 22:26:12 -07:00
George Hotz
55ed5a1153 Merge pull request #82 from energee/devel
DBC file for 2017 Honda CR-V
2017-05-22 09:00:44 -07:00
Ted Slesinski
01c20c31c2 Adds 2017 CR-V dbc file 2017-05-21 19:46:34 -04:00
Vehicle Researcher
4479d4000e openpilot v0.3.1 release 2017-05-17 00:40:33 -07:00
Vehicle Researcher
edd511f06e openpilot v0.3.0 release 2017-05-12 16:46:20 -07:00
Vehicle Researcher
8ef3f520b1 openpilot v0.3.0-devel release 2017-05-11 12:41:17 -07:00
George Hotz
ab3492bb90 Merge pull request #93 from heidecjj/master
Bug fixes for testing suite
2017-05-02 23:34:32 -07:00
George Hotz
ed7cbb3866 Merge pull request #90 from heidecjj/patch-1
Update maneuver.py
2017-05-02 23:30:36 -07:00
Josh Heidecker
a30626cfe3 Fixed relative distance errors in testing 2017-05-02 22:01:03 -04:00
heidecjj
d2c087b3e2 Update maneuver.py
self.speed_lead_breakpoints was reading from "speed_lead_values" instead of "speed_lead_breakpoints"
2017-04-20 17:09:15 -04:00
George Hotz
0a747f991d Merge pull request #65 from jeankalud/master
Fixed little endian (and scaling/offset)
2017-03-01 16:09:46 -08:00
jeankalud
f5a1e86d85 Add files via upload
Removed unused debug strings
2017-03-01 18:13:37 -05:00
Vehicle Researcher
693bcb0f83 openpilot v0.2.9 release 2017-03-01 10:54:12 -08:00
jeankalud
0d0daed86e Add files via upload
Fixed little endian handling
Fixed offset / scaling handling
2017-03-01 11:02:46 -05:00
Vehicle Researcher
95a349abcc openpilot v0.2.8 release 2017-02-28 00:03:11 -08:00
Vehicle Researcher
c6ba5dc539 openpilot v0.2.7 release 2017-02-08 15:01:17 -08:00
Vehicle Researcher
6c3afeec0f openpilot v0.2.6 release 2017-01-31 01:33:55 -08:00
Vehicle Researcher
29c58b4588 openpilot v0.2.5 release 2017-01-30 14:10:01 -08:00
Vehicle Researcher
ecc565aa3f openpilot v0.2.4 release 2017-01-29 16:10:13 -08:00
George Hotz
db61810f98 Merge pull request #49 from mullakhmetov/master
Added context manager to file reading
2017-01-27 01:17:23 -08:00
Artur Mullakhmetov
48f203ad5b Added context manager to file reading 2017-01-27 11:33:27 +03:00
George Hotz
6ab4ac2dfb Merge pull request #47 from mullakhmetov/crossplatform-gettime
Refactor cross-platform libc usage
2017-01-25 09:19:22 -08:00
Artur Mullakhmetov
9cb3c7b6e6 Refactor cross-platform libc usage 2017-01-25 16:16:00 +03:00
Vehicle Researcher
adaa4ed350 openpilot v0.2.3 release 2017-01-11 14:30:55 -08:00
Vehicle Researcher
a64b9aa9b8 openpilot v0.2.2 release 2017-01-10 11:10:04 -08:00
George Hotz
0138eca61d Merge pull request #40 from TheMutley/master
DBC modified to match the Vector format
2017-01-09 20:47:52 -08:00
Mutley
139a40de29 DBC modified to match the Vector format 2017-01-05 16:55:54 -05:00
Vehicle Researcher
17d9becd3c openpilot v0.2.1 release 2016-12-14 21:29:12 -08:00
Vehicle Researcher
449b482cc3 openpilot v0.2 release 2016-12-12 20:18:19 -08:00
espes
a7e099c946 Update README.md 2016-11-30 14:31:28 -08:00
espes
610462be5a Merge pull request #2 from autti/ford-fusion
Ford Fusion 2017 dbc can file. refs #1.
2016-11-30 11:57:31 -08:00
Ariel Nuñez
207d32668f Added ford fusion dbc can file. refs #1.
Obtained from:

https://bitbucket.org/DataspeedInc/dbw_mkz_ros/downloads
2016-11-30 14:52:47 -05:00
Vehicle Researcher
e94a30bec0 openpilot release 2016-11-29 18:34:21 -08:00
2186 changed files with 580312 additions and 97 deletions

25
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,25 @@
---
name: Bug report
about: Create a report to help us improve openpilot
title: ''
labels: 'bug'
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**How to reproduce or log data**
Steps to reproduce the behavior, or a explorer/cabana link to the exact drive and timestamp of when the bug occurred.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Device/Version information (please complete the following information):**
- Device: [e.g. EON/EON Gold]
- Version: [e.g. 0.6.4], or commit hash when on devel
- Car make/model [e.g. Toyota Prius 2016]
**Additional context**
Add any other context about the problem here.

21
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,21 @@
Choose one of the templates below:
# Fingerprint
This pull requests adds a fingerprint for <Make - Model - Year - Trim>.
This is an explorer link to a drive with the stock system enabled: ...
# Car support
This pull requests adds support for <Make - Model - Year - Trim>.
This is an explorer link to a drive with the stock system enabled: ...
This is an explorer link to a drive with openpilot system enabled: ...
# Feature
This pull requests adds feature X
## Description
Explain what the feature does
## Testing
Explain how the feature was tested. Either by the added unit tests, or what tests were performed while driving.

60
.gitignore vendored
View File

@@ -1,10 +1,54 @@
venv/
.DS_Store
.tags
.ipynb_checkpoints
.idea
.sconsign.dblite
.vscode
model2.png
a.out
*.DSYM
*.d
*.pyc
*.os
*.tmp
*.pyo
.*.swp
can/*.so
can/build/
can/obj/
can/packer_pyx.cpp
can/parser_pyx.cpp
can/packer_impl.cpp
.*.swo
.*.un~
*.tmp
*.o
*.os
*.so
*.a
*.clb
*.class
*.pyxbldc
*.vcd
config.json
clcache
board/obj/
selfdrive/boardd/boardd
selfdrive/logcatd/logcatd
selfdrive/mapd/default_speeds_by_region.json
selfdrive/proclogd/proclogd
selfdrive/ui/_ui
selfdrive/test/longitudinal_maneuvers/out
selfdrive/visiond/visiond
selfdrive/loggerd/loggerd
selfdrive/sensord/_gpsd
selfdrive/sensord/_sensord
selfdrive/camerad/camerad
selfdrive/modeld/_modeld
selfdrive/modeld/_monitoringd
/src/
one
openpilot
notebooks
xx
panda_jungle
.coverage*
htmlcov

7
.travis.yml Normal file
View File

@@ -0,0 +1,7 @@
sudo: required
services:
- docker
script:
- ./run_docker_tests.sh

31
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,31 @@
# How to contribute
Our software is open source so you can solve your own problems without needing help from others. And if you solve a problem and are so kind, you can upstream it for the rest of the world to use.
Most open source development activity is coordinated through our [Discord](https://discord.comma.ai). A lot of documentation is available on our [medium](https://medium.com/@comma_ai/)
## Getting Started
* Join our [Discord](https://discord.comma.ai)
* Make sure you have a [GitHub account](https://github.com/signup/free)
* Fork [our repositories](https://github.com/commaai) on GitHub
## Testing
### Local Testing
You can test your changes on your machine by running `run_docker_tests.sh`. This will run some automated tests in docker against your code.
### Automated Testing
All PRs are automatically checked by travis. Check out `.travis.yml` for what travis runs. Any new tests sould be added to travis.
### Code Style and Linting
Code is automatically check for style by travis as part of the automated tests. You can also run these yourself by running `check_code_quality.sh`.
## Car Ports (openpilot)
We've released a [Model Port guide](https://medium.com/@comma_ai/openpilot-port-guide-for-toyota-models-e5467f4b5fe6) for porting to Toyota/Lexus models.
If you port openpilot to a substantially new car brand, see this more generic [Brand Port guide](https://medium.com/@comma_ai/how-to-write-a-car-port-for-openpilot-7ce0785eda84). You might also be eligible for a bounty. See our bounties at [comma.ai/bounties.html](https://comma.ai/bounties.html)

82
Dockerfile.openpilot Normal file
View File

@@ -0,0 +1,82 @@
FROM ubuntu:16.04
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get install -y \
autoconf \
build-essential \
bzip2 \
clang \
cmake \
curl \
ffmpeg \
git \
libarchive-dev \
libbz2-dev \
libcurl4-openssl-dev \
libeigen3-dev \
libffi-dev \
libglew-dev \
libgles2-mesa-dev \
libglib2.0-0 \
liblzma-dev \
libmysqlclient-dev \
libomp-dev \
libopencv-dev \
libssl-dev \
libtool \
libusb-1.0-0-dev \
libzmq5-dev \
locales \
ocl-icd-libopencl1 \
ocl-icd-opencl-dev \
opencl-headers \
python-dev \
python-pip \
screen \
sudo \
vim \
wget
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}"
RUN pyenv install 3.7.3
RUN pyenv global 3.7.3
RUN pyenv rehash
RUN pip install pipenv==2018.11.26
COPY Pipfile /tmp/
COPY Pipfile.lock /tmp/
RUN python --version
RUN cd /tmp && pipenv install --system --deploy
# Install subset of dev dependencies needed for CI
RUN pip install matplotlib==3.1.1 dictdiffer==0.8.0 fastcluster==1.1.25 aenum==2.2.1 scipy==1.3.1 lru-dict==1.1.6 tenacity==5.1.1 azure-common==1.1.23 azure-nspkg==3.0.2 azure-storage-blob==2.1.0 azure-storage-common==2.1.0 azure-storage-nspkg==3.1.0 pycurl==7.43.0.3
COPY phonelibs/install_capnp.sh /tmp/install_capnp.sh
RUN /tmp/install_capnp.sh
RUN git clone --branch v0.7 https://github.com/commaai/openpilot-tools.git /tmp/openpilot/tools
ENV PYTHONPATH /tmp/openpilot:${PYTHONPATH}
COPY ./.pylintrc /tmp/openpilot/.pylintrc
COPY ./common /tmp/openpilot/common
COPY ./cereal /tmp/openpilot/cereal
COPY ./opendbc /tmp/openpilot/opendbc
COPY ./selfdrive /tmp/openpilot/selfdrive
COPY ./phonelibs /tmp/openpilot/phonelibs
COPY ./pyextra /tmp/openpilot/pyextra
COPY ./panda /tmp/openpilot/panda
COPY SConstruct /tmp/openpilot/SConstruct
RUN mkdir -p /tmp/openpilot/selfdrive/test/out
RUN cd /tmp/openpilot && scons -j$(nproc)

7
LICENSE Normal file
View File

@@ -0,0 +1,7 @@
Copyright (c) 2018, Comma.ai, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

9
Makefile Normal file
View File

@@ -0,0 +1,9 @@
code_dir := $(shell pwd)
# TODO: Add a global build system
.PHONY: all
all:
cd selfdrive && PYTHONPATH=$(code_dir) PREPAREONLY=1 ./manager.py

149
Pipfile Normal file
View File

@@ -0,0 +1,149 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
opencv-python= "==3.4.2.17"
PyQt5 = "*"
ipython = "*"
networkx = "==2.3"
azure-common = "==1.1.23"
azure-nspkg = "==3.0.2"
azure-storage-blob = "==2.1.0"
azure-storage-common = "==2.1.0"
azure-storage-nspkg = "==3.1.0"
bincopy = "*"
bleach = "*"
boto = "*"
"boto3" = "*"
celery = "*"
control = "*"
datadog = "*"
decorator = "*"
dlib = "*"
dominate = "*"
elasticsearch = "*"
fasteners = "*"
future = "*"
futures = "*"
gevent = "*"
pycocotools = {git = "https://github.com/cocodataset/cocoapi.git",subdirectory = "PythonAPI"}
gunicorn = "*"
"h5py" = "*"
hexdump = "*"
"html5lib" = "*"
imageio = "*"
intervaltree = "*"
ipykernel = "*"
joblib = "*"
json-logging-py = "*"
jupyter = "*"
libarchive = "*"
lru-dict = "*"
lxml = "*"
"mpld3" = "*"
msgpack-python = "*"
nbstripout = "*"
nose-parameterized = "*"
numpy = "*"
osmium = "*"
pbr = "*"
percache = "*"
pprofile = "*"
psutil = "*"
pycurl = "*"
git-pylint-commit-hook = "*"
pymongo = "*"
"pynmea2" = "*"
pypolyline = "*"
pysendfile = "*"
python-logstash = "*"
pyvcd = "*"
redis = "*"
redlock = "*"
"s2sphere" = "*"
scikit-image = "*"
"subprocess32" = "*"
supervisor = "*"
tenacity = "*"
tensorflow-gpu = ""
utm = "*"
"v4l2" = "*"
PyJWT = "==1.4.1"
PyMySQL = "==0.9.2"
Theano = "*"
Werkzeug = "*"
"backports.lzma" = "*"
Flask-Cors = "*"
Flask-SocketIO = "*"
"GeoAlchemy2" = "*"
Pygments = "*"
PyNaCl = "*"
"PySDL2" = "*"
reverse_geocoder = "*"
Shapely = "*"
SQLAlchemy = "*"
uWSGI = "*"
scipy = "*"
fastcluster = "*"
backports-abc = "*"
pygame = "*"
simplejson = "*"
python-logstash-async = "*"
seaborn = "*"
tensorflow-estimator = "*"
pyproj = "*"
mock = "*"
blinker = "*"
gast = "==0.2.2"
matplotlib = "*"
dictdiffer = "*"
aenum = "*"
coverage = "*"
[packages]
overpy = {git = "https://github.com/commaai/python-overpy.git",ref = "f86529af402d4642e1faeb146671c40284007323"}
atomicwrites = "*"
cffi = "*"
crcmod = "*"
hexdump = "*"
libusb1 = "*"
numpy = "*"
psutil = "*"
pycapnp = "*"
cryptography = "*"
pyserial = "*"
python-dateutil = "*"
pyzmq = "*"
raven = "*"
requests = "*"
setproctitle = "*"
six = "*"
smbus2 = "*"
sympy = "*"
tqdm = "*"
Cython = "*"
PyYAML = "*"
websocket_client = "*"
Logentries = {git = "https://github.com/commaai/le_python.git",ref = "feaeacb48f7f4bdb02c0a8fc092326d4e101b7f2"}
urllib3 = "*"
chardet = "*"
idna = "*"
gunicorn = "*"
utm = "*"
json-rpc = "*"
Flask = "*"
PyJWT = "*"
"Jinja2" = "*"
nose = "*"
flake8 = "*"
pylint = "*"
pycryptodome = "*"
pillow = "*"
scons = "*"
cysignals = "*"
[requires]
python_version = "3.7.3"

2961
Pipfile.lock generated Normal file

File diff suppressed because it is too large Load Diff

325
README.md
View File

@@ -1,53 +1,300 @@
opendbc
======
[![](https://i.imgur.com/UetIFyH.jpg)](#)
The project to democratize access to the decoder ring of your car.
Table of Contents
=======================
* [What is openpilot?](#what-is-openpilot)
* [Integration with Stock Features](#integration-with-stock-features)
* [Supported Hardware](#supported-hardware)
* [Supported Cars](#supported-cars)
* [Community Maintained Cars and Features](#community-maintained-cars-and-features)
* [Installation Instructions](#installation-instructions)
* [Limitations of openpilot ALC and LDW](#limitations-of-openpilot-alc-and-ldw)
* [Limitations of openpilot ACC and FCW](#limitations-of-openpilot-acc-and-fcw)
* [Limitations of openpilot DM](#limitations-of-openpilot-dm)
* [User Data and comma Account](#user-data-and-comma-account)
* [Safety and Testing](#safety-and-testing)
* [Testing on PC](#testing-on-pc)
* [Community and Contributing](#community-and-contributing)
* [Directory Structure](#directory-structure)
* [Licensing](#licensing)
---
### DBC file basics
What is openpilot?
------
A DBC file encodes, in a humanly readable way, the information needed to understand a vehicle's CAN bus traffic. A vehicle might have multiple CAN buses and every CAN bus is represented by its own dbc file.
Wondering what's the DBC file format? [Here](http://www.socialledge.com/sjsu/index.php?title=DBC_Format) and [Here](https://github.com/stefanhoelzl/CANpy/blob/master/docs/DBC_Specification.md) a couple of good overviews.
[openpilot](http://github.com/commaai/openpilot) is an open source driver assistance system. Currently, openpilot performs the functions of Adaptive Cruise Control (ACC), Automated Lane Centering (ALC), Forward Collision Warning (FCW) and Lane Departure Warning (LDW) for a growing variety of supported [car makes, models and model years](#supported-cars). In addition, while openpilot is engaged, a camera based Driver Monitoring (DM) feature alerts distracted and asleep drivers.
### How to start reverse engineering cars
<table>
<tr>
<td><a href="https://www.youtube.com/watch?v=mgAbfr42oI8" title="YouTube" rel="noopener"><img src="https://i.imgur.com/kAtT6Ei.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=394rJKeh76k" title="YouTube" rel="noopener"><img src="https://i.imgur.com/lTt8cS2.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=1iNOc3cq8cs" title="YouTube" rel="noopener"><img src="https://i.imgur.com/ANnuSpe.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=Vr6NgrB-zHw" title="YouTube" rel="noopener"><img src="https://i.imgur.com/Qypanuq.png"></a></td>
</tr>
<tr>
<td><a href="https://www.youtube.com/watch?v=Ug41KIKF0oo" title="YouTube" rel="noopener"><img src="https://i.imgur.com/3caZ7xM.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=NVR_CdG1FRg" title="YouTube" rel="noopener"><img src="https://i.imgur.com/bAZOwql.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=tkEvIdzdfUE" title="YouTube" rel="noopener"><img src="https://i.imgur.com/EFINEzG.png"></a></td>
<td><a href="https://www.youtube.com/watch?v=_P-N1ewNne4" title="YouTube" rel="noopener"><img src="https://i.imgur.com/gAyAq22.png"></a></td>
</tr>
</table>
[opendbc](https://github.com/commaai/opendbc) is integrated with [cabana](https://community.comma.ai/cabana/).
Integration with Stock Features
------
Use [panda](https://github.com/commaai/panda) to connect your car to a computer.
In all supported cars:
* Stock Lane Keep Assist (LKA) and stock ALC are replaced by openpilot ALC, which only functions when openpilot is engaged by the user.
* Stock LDW is replaced by openpilot LDW.
### DBC file preprocessor
Additionally, on specific supported cars (see ACC column in [supported cars](#supported-cars)):
* Stock ACC is replaced by openpilot ACC.
* openpilot FCW operates in addition to stock FCW.
DBC files for different models of the same brand have a lot of overlap. Therefore, we wrote a preprocessor to create DBC files from a brand DBC file and a model specific DBC file. The source DBC files can be found in the generator folder. After changing one of the files run the generator.py script to regenerate the output files. These output files will be placed in the root of the opendbc repository and are suffixed by _generated.
openpilot should preserve all other vehicle's stock features, including, but are not limited to: FCW, Automatic Emergency Braking (AEB), auto high-beam, blind spot warning, and side collision warning.
### Good practices for contributing to opendbc
Supported Hardware
------
- Comments: the best way to store comments is to add them directly to the DBC files. For example:
```
CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
```
is a comment that refers to signal `LONG_ACCEL` in message `490`. Using comments is highly recommended, especially for doubts and uncertainties. [cabana](https://community.comma.ai/cabana/) can easily display/add/edit comments to signals and messages.
At the moment, openpilot supports the [EON DevKit](https://comma.ai/shop/products/eon-dashcam-devkit). A [car harness](https://comma.ai/shop/products/car-harness) is recommended to connect the EON to the car. In the future, we'd like to support other platforms as well.
- Units: when applicable, it's recommended to convert signals into physical units, by using a proper signal factor. Using a SI unit is preferred, unless a non-SI unit rounds the signal factor much better.
For example:
```
SG_ VEHICLE_SPEED : 7|15@0+ (0.00278,0) [0|70] "m/s" PCM
```
is better than:
```
SG_ VEHICLE_SPEED : 7|15@0+ (0.00620,0) [0|115] "mph" PCM
```
However, the cleanest option is really:
```
SG_ VEHICLE_SPEED : 7|15@0+ (0.01,0) [0|250] "kph" PCM
```
Supported Cars
------
- Signal size: always use the smallest amount of bits possible. For example, let's say I'm reverse engineering the gas pedal position and I've determined that it's in a 3 bytes message. For 0% pedal position I read a message value of `0x00 0x00 0x00`, while for 100% of pedal position I read `0x64 0x00 0x00`: clearly, the gas pedal position is within the first byte of the message and I might be tempted to define the signal `GAS_POS` as:
```
SG_ GAS_POS : 7|8@0+ (1,0) [0|100] "%" PCM
```
However, I can't be sure that the very first bit of the message is referred to the pedal position: I haven't seen it changing! Therefore, a safer way of defining the signal is:
```
SG_ GAS_POS : 6|7@0+ (1,0) [0|100] "%" PCM
```
which leaves the first bit unallocated. This prevents from very erroneous reading of the gas pedal position, in case the first bit is indeed used for something else.
| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below |
| ----------| ------------------------------| ------------------| -----------------| -------------------| -------------|
| Acura | ILX 2016-18 | AcuraWatch Plus | openpilot | 25mph<sup>5</sup> | 25mph |
| Acura | RDX 2016-18 | AcuraWatch Plus | openpilot | 25mph<sup>5</sup> | 12mph |
| Chrysler | Pacifica 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph |
| Chrysler | Pacifica Hybrid 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph |
| Chrysler | Pacifica Hybrid 2019 | Adaptive Cruise | Stock | 0mph | 39mph |
| Honda | Accord 2018-19 | All | Stock | 0mph | 3mph |
| Honda | Accord Hybrid 2018-19 | All | Stock | 0mph | 3mph |
| Honda | Civic Sedan/Coupe 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
| Honda | Civic Sedan/Coupe 2019 | Honda Sensing | Stock | 0mph | 2mph |
| Honda | Civic Hatchback 2017-19 | Honda Sensing | Stock | 0mph | 12mph |
| Honda | CR-V 2015-16 | Touring | openpilot | 25mph<sup>5</sup> | 12mph |
| Honda | CR-V 2017-19 | Honda Sensing | Stock | 0mph | 12mph |
| Honda | CR-V Hybrid 2017-2019 | Honda Sensing | Stock | 0mph | 12mph |
| Honda | Fit 2018-19 | Honda Sensing | openpilot | 25mph<sup>5</sup> | 12mph |
| Honda | Odyssey 2018-20 | Honda Sensing | openpilot | 25mph<sup>5</sup> | 0mph |
| Honda | Passport 2019 | All | openpilot | 25mph<sup>5</sup> | 12mph |
| Honda | Pilot 2016-18 | Honda Sensing | openpilot | 25mph<sup>5</sup> | 12mph |
| Honda | Pilot 2019 | All | openpilot | 25mph<sup>5</sup> | 12mph |
| Honda | Ridgeline 2017-19 | Honda Sensing | openpilot | 25mph<sup>5</sup> | 12mph |
| Hyundai | Santa Fe 2019<sup>1</sup> | All | Stock | 0mph | 0mph |
| Hyundai | Elantra 2017-19<sup>1</sup> | SCC + LKAS | Stock | 19mph | 34mph |
| Hyundai | Genesis 2018<sup>1</sup> | All | Stock | 19mph | 34mph |
| Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Stock | 0mph | 9mph |
| Jeep | Grand Cherokee 2019 | Adaptive Cruise | Stock | 0mph | 39mph |
| Kia | Optima 2019<sup>1</sup> | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Sorento 2018<sup>1</sup> | All | Stock | 0mph | 0mph |
| Kia | Stinger 2018<sup>1</sup> | SCC + LKAS | Stock | 0mph | 0mph |
| Lexus | CT Hybrid 2017-18 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Lexus | ES Hybrid 2019 | All | openpilot | 0mph | 0mph |
| Lexus | RX Hybrid 2016-19 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Lexus | IS 2017-2019 | All | Stock | 22mph | 0mph |
| Lexus | IS Hybrid 2017 | All | Stock | 0mph | 0mph |
| Subaru | Crosstrek 2018-19 | EyeSight | Stock | 0mph | 0mph |
| Subaru | Impreza 2019-20 | EyeSight | Stock | 0mph | 0mph |
| Toyota | Avalon 2016 | TSS-P | Stock<sup>4</sup>| 20mph<sup>5</sup> | 0mph |
| Toyota | Avalon 2017-18 | All | Stock<sup>4</sup>| 20mph<sup>5</sup> | 0mph |
| Toyota | Camry 2018-19 | All | Stock | 0mph<sup>2</sup> | 0mph |
| Toyota | Camry Hybrid 2018-19 | All | Stock | 0mph<sup>2</sup> | 0mph |
| Toyota | C-HR 2017-19 | All | Stock | 0mph | 0mph |
| Toyota | C-HR Hybrid 2017-19 | All | Stock | 0mph | 0mph |
| Toyota | Corolla 2017-19 | All | Stock<sup>4</sup>| 20mph<sup>5</sup> | 0mph |
| Toyota | Corolla 2020 | All | openpilot | 0mph | 0mph |
| Toyota | Corolla Hatchback 2019 | All | openpilot | 0mph | 0mph |
| Toyota | Corolla Hybrid 2020 | All | openpilot | 0mph | 0mph |
| Toyota | Highlander 2017-19 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Highlander Hybrid 2017-19 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Prius 2016 | TSS-P | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Prius 2017-19 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Prius Prime 2017-20 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Rav4 2016 | TSS-P | Stock<sup>4</sup>| 20mph<sup>5</sup> | 0mph |
| Toyota | Rav4 2017-18 | All | Stock<sup>4</sup>| 20mph<sup>5</sup> | 0mph |
| Toyota | Rav4 2019 | All | openpilot | 0mph | 0mph |
| Toyota | Rav4 Hybrid 2016 | TSS-P | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Rav4 Hybrid 2017-18 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Toyota | Sienna 2018 | All | Stock<sup>4</sup>| 0mph | 0mph |
| Volkswagen| Golf 2016-19<sup>3</sup> | Driver Assistance | Stock | 0mph | 0mph |
<sup>1</sup>Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and open sourced [Hyundai giraffe](https://github.com/commaai/neo/tree/master/giraffe/hyundai), designed for the 2019 Sante Fe; pinout may differ for other Hyundai and Kia models. <br />
<sup>2</sup>28mph for Camry 4CYL L, 4CYL LE and 4CYL SE which don't have Full-Speed Range Dynamic Radar Cruise Control. <br />
<sup>3</sup>Requires a [custom connector](https://community.comma.ai/wiki/index.php/Volkswagen#Integration_at_R242_Camera) for the [car harness](https://comma.ai/shop/products/car-harness) <br />
Community Maintained Cars and Features
------
| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below |
| ----------| ------------------------------| ------------------| -----------------| -------------------| -------------|
| Buick | Regal 2018<sup>6</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| Chevrolet | Malibu 2017<sup>6</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| Chevrolet | Volt 2017-18<sup>6</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| Cadillac | ATS 2018<sup>6</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| GMC | Acadia Denali 2018<sup>6</sup>| Adaptive Cruise | openpilot | 0mph | 7mph |
| Holden | Astra 2017<sup>6</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
<sup>4</sup>When disconnecting the Driver Support Unit (DSU), openpilot ACC will replace stock ACC. For DSU locations, see [Toyota Wiki page](https://community.comma.ai/wiki/index.php/Toyota). ***NOTE: disconnecting the DSU disables Automatic Emergency Braking (AEB).*** <br />
<sup>5</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](https://comma.ai).*** <br />
<sup>6</sup>Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and [community built giraffe](https://zoneos.com/volt/). ***NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).*** <br />
Community Maintained Cars and Features are not verified by comma to meet our [safety model](SAFETY.md). Be extra cautious using them. They are only available after enabling the toggle in `Settings->Developer->Enable Community Features`.
Installation Instructions
------
Install openpilot on a EON by entering ``https://openpilot.comma.ai`` during the installer setup.
Follow this [video instructions](https://youtu.be/3nlkomHathI) to properly mount the EON on the windshield. Note: openpilot features an automatic pose calibration routine and openpilot performance should not be affected by small pitch and yaw misalignments caused by imprecise EON mounting.
Before placing the device on your windshield, check the state and local laws and ordinances where you drive. Some state laws prohibit or restrict the placement of objects on the windshield of a motor vehicle.
You will be able to engage openpilot after reviewing the onboarding screens and finishing the calibration procedure.
Limitations of openpilot ALC and LDW
------
openpilot ALC and openpilot LDW do not automatically drive the vehicle or reduce the amount of attention that must be paid to operate your vehicle. The driver must always keep control of the steering wheel and be ready to correct the openpilot ALC action at all times.
Many factors can impact the performance of openpilot ALC and openpilot LDW, causing them to be unable to function as intended. These include, but are not limited to:
* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation.
* The road facing camera is obstructed, covered or damaged by mud, ice, snow, etc.
* Obstruction caused by applying excessive paint or adhesive products (such as wraps, stickers, rubber coating, etc.) onto the vehicle.
* The EON is mounted incorrectly.
* When in sharp curves, like on-off ramps, intersections etc...; openpilot is designed to be limited in the amount of steering torque it can produce.
* In the presence of restricted lanes or construction zones.
* When driving on highly banked roads or in presence of strong cross-wind.
* Extremely hot or cold temperatures.
* Bright light (due to oncoming headlights, direct sunlight, etc.).
* Driving on hills, narrow, or winding roads.
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. It is the driver's responsibility to be in control of the vehicle at all times.
Limitations of openpilot ACC and FCW
------
openpilot ACC and openpilot FCW are not systems that allow careless or inattentive driving. It is still necessary for the driver to pay close attention to the vehicles surroundings and to be ready to re-take control of the gas and the brake at all times.
Many factors can impact the performance of openpilot ACC and openpilot FCW, causing them to be unable to function as intended. These include, but are not limited to:
* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation.
* The road facing camera or radar are obstructed, covered, or damaged by mud, ice, snow, etc.
* Obstruction caused by applying excessive paint or adhesive products (such as wraps, stickers, rubber coating, etc.) onto the vehicle.
* The EON is mounted incorrectly.
* Approaching a toll booth, a bridge or a large metal plate.
* When driving on roads with pedestrians, cyclists, etc...
* In presence of traffic signs or stop lights, which are not detected by openpilot at this time.
* When the posted speed limit is below the user selected set speed. openpilot does not detect speed limits at this time.
* In presence of vehicles in the same lane that are not moving.
* When abrupt braking maneuvers are required. openpilot is designed to be limited in the amount of deceleration and acceleration that it can produce.
* When surrounding vehicles perform close cut-ins from neighbor lanes.
* Driving on hills, narrow, or winding roads.
* Extremely hot or cold temperatures.
* Bright light (due to oncoming headlights, direct sunlight, etc.).
* Interference from other equipment that generates radar waves.
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. It is the driver's responsibility to be in control of the vehicle at all times.
Limitations of openpilot DM
------
openpilot DM should not be considered an exact measurements of the status of alertness of the driver.
Many factors can impact the performance of openpilot DM, causing it to be unable to function as intended. These include, but are not limited to:
* Low light conditions, such as driving at night or in dark tunnels.
* Bright light (due to oncoming headlights, direct sunlight, etc.).
* The driver face is partially or completely outside field of view of the driver facing camera.
* Right hand driving vehicles.
* The driver facing camera is obstructed, covered, or damaged.
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. A driver should not rely on openpilot DM to assess their level of attention.
User Data and comma Account
------
By default, openpilot uploads the driving data to our servers. You can also access your data by pairing with the comma connect app ([iOS](https://apps.apple.com/us/app/comma-connect/id1456551889), [Android](https://play.google.com/store/apps/details?id=ai.comma.connect&hl=en_US)). We use your data to train better models and improve openpilot for everyone.
openpilot is open source software: the user is free to disable data collection if they wish to do so.
openpilot logs the road facing camera, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs.
The driver facing camera is only logged if you explicitly opt-in in settings. The microphone is not recorded.
By using openpilot, you agree to [our Privacy Policy](https://my.comma.ai/privacy). You understand that use of this software or its related services will generate certain types of user data, which may be logged and stored at the sole discretion of comma. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma for the use of this data.
Safety and Testing
----
* openpilot observes ISO26262 guidelines, see [SAFETY.md](SAFETY.md) for more detail.
* openpilot has software in the loop [tests](run_docker_tests.sh) that run on every commit.
* The safety model code lives in panda and is written in C, see [code rigor](https://github.com/commaai/panda#code-rigor) for more details.
* panda has software in the loop [safety tests](https://github.com/commaai/panda/tree/master/tests/safety).
* Internally, we have a hardware in the loop Jenkins test suite that builds and unit tests the various processes.
* panda has additional hardware in the loop [tests](https://github.com/commaai/panda/blob/master/Jenkinsfile).
* We run the latest openpilot in a testing closet containing 10 EONs continuously replaying routes.
Testing on PC
------
Check out [openpilot-tools](https://github.com/commaai/openpilot-tools): lots of tools you can use to replay driving data, test and develop openpilot from your pc.
Community and Contributing
------
openpilot is developed by [comma](https://comma.ai/) and by users like you. We welcome both pull requests and issues on [GitHub](http://github.com/commaai/openpilot). Bug fixes and new car ports are encouraged.
You can add support for your car by following guides we have written for [Brand](https://medium.com/@comma_ai/how-to-write-a-car-port-for-openpilot-7ce0785eda84) and [Model](https://medium.com/@comma_ai/openpilot-port-guide-for-toyota-models-e5467f4b5fe6) ports. Generally, a car with adaptive cruise control and lane keep assist is a good candidate. [Join our Discord](https://discord.comma.ai) to discuss car ports: most car makes have a dedicated channel.
Want to get paid to work on openpilot? [comma is hiring](https://comma.ai/jobs/). We also have a [bounty program](https://comma.ai/bounties.html).
And [follow us on Twitter](https://twitter.com/comma_ai).
Directory Structure
------
.
├── apk # The apk files used for the UI
├── cereal # The messaging spec and libs used for all logs on EON
├── common # Library like functionality we've developed here
├── installer/updater # Manages auto-updates of openpilot
├── opendbc # Files showing how to interpret data from cars
├── panda # Code used to communicate on CAN
├── phonelibs # Libraries used on EON
├── pyextra # Libraries used on EON
└── selfdrive # Code needed to drive the car
├── assets # Fonts and images for UI
├── athena # Allows communication with the app
├── boardd # Daemon to talk to the board
├── camerad # Driver to capture images from the camera sensors
├── car # Car specific code to read states and control actuators
├── common # Shared C/C++ code for the daemons
├── controls # Perception, planning and controls
├── debug # Tools to help you debug and do car ports
├── locationd # Soon to be home of precise location
├── logcatd # Android logcat as a service
├── loggerd # Logger and uploader of car data
├── modeld # Driving and monitoring model runners
├── proclogd # Logs information from proc
├── sensord # IMU / GPS interface code
├── tests # Unit tests, system tests and a car simulator
└── ui # The UI
To understand how the services interact, see `cereal/service_list.yaml`.
Licensing
------
openpilot is released under the MIT license. Some parts of the software are released under other licenses as specified.
Any user of this software shall indemnify and hold harmless comma.ai, Inc. and its directors, officers, employees, agents, stockholders, affiliates, subcontractors and customers from and against all allegations, claims, actions, suits, demands, damages, liabilities, obligations, losses, settlements, judgments, costs and expenses (including without limitation attorneys fees and costs) which arise out of, relate to or result from any use of this software by user.
**THIS IS ALPHA QUALITY SOFTWARE FOR RESEARCH PURPOSES ONLY. THIS IS NOT A PRODUCT.
YOU ARE RESPONSIBLE FOR COMPLYING WITH LOCAL LAWS AND REGULATIONS.
NO WARRANTY EXPRESSED OR IMPLIED.**
---
<img src="https://d1qb2nb5cznatu.cloudfront.net/startups/i/1061157-bc7e9bf3b246ece7322e6ffe653f6af8-medium_jpg.jpg?buster=1458363130" width="75"></img> <img src="https://cdn-images-1.medium.com/max/1600/1*C87EjxGeMPrkTuVRVWVg4w.png" width="225"></img>

491
RELEASES.md Normal file
View File

@@ -0,0 +1,491 @@
Version 0.7 (2019-12-13)
========================
* Move to SCons build system!
* Add Lane Departure Warning (LDW) for all supported vehicles!
* NEOS update: increase wifi speed thanks to jyoung8607!
* Adaptive driver monitoring based on scene
* New driving model trained end-to-end: improve lane lines and lead detection
* Smarter torque limit alerts for all cars
* Improve GM longitudinal control: proper computations for 15Hz radar
* Move GM port, Toyota with DSU removed, comma pedal in community features; toggle switch required
* Remove upload over cellular toggle: only upload qlog and qcamera files if not on wifi
* Refactor Panda code towards ISO26262 and SIL2 compliancy
* Forward stock FCW for Honda Nidec
* Volkswagen port now standard: comma Harness intercepts stock camera
Version 0.6.6 (2019-11-05)
========================
* Volkswagen support thanks to jyoung8607!
* Toyota Corolla Hybrid with TSS 2.0 support thanks to u8511049!
* Lexus ES with TSS 2.0 support thanks to energee!
* Fix GM ignition detection and lock safety mode not required anymore
* Log panda firmware and dongle ID thanks to martinl!
* New driving model: improve path prediction and lead detection
* New driver monitoring model, 4x smaller and running on DSP
* Display an alert and don't start openpilot if panda has wrong firmware
* Fix bug preventing EON from terminating processes after a drive
* Remove support for Toyota giraffe without the 120Ohm resistor
Version 0.6.5 (2019-10-07)
========================
* NEOS update: upgrade to Python3 and new installer!
* comma Harness support!
* New driving model: improve path prediction
* New driver monitoring model: more accurate face and eye detection
* Redesign offroad screen to display updates and alerts
* Increase maximum allowed acceleration
* Prevent car 12V battery drain by cutting off EON charge after 3 days of no drive
* Lexus CT Hybrid support thanks to thomaspich!
* Louder chime for critical alerts
* Add toggle to switch to dashcam mode
* Fix "invalid vehicle params" error on DSU-less Toyota
Version 0.6.4 (2019-09-08)
========================
* Forward stock AEB for Honda Nidec
* Improve lane centering on banked roads
* Always-on forward collision warning
* Always-on driver monitoring, except for right hand drive countries
* Driver monitoring learns the user's normal driving position
* Honda Fit support thanks to energee!
* Lexus IS support
Version 0.6.3 (2019-08-12)
========================
* Alert sounds from EON: requires NEOS update
* Improve driver monitoring: eye tracking and improved awareness logic
* Improve path prediction with new driving model
* Improve lane positioning with wide lanes and exits
* Improve lateral control on RAV4
* Slow down for turns using model
* Open sourced regression test to verify outputs against reference logs
* Open sourced regression test to sanity check all car models
Version 0.6.2 (2019-07-29)
========================
* New driving model!
* Improve lane tracking with double lines
* Strongly improve stationary vehicle detection
* Strongly reduce cases of braking due to false leads
* Better lead tracking around turns
* Improve cut-in prediction by using neural network
* Improve lateral control on Toyota Camry and C-HR thanks to zorrobyte!
* Fix unintended openpilot disengagements on Jeep thanks to adhintz!
* Fix delayed transition to offroad when car is turned off
Version 0.6.1 (2019-07-21)
========================
* Remote SSH with comma prime and [ssh.comma.ai](https://ssh.comma.ai)
* Panda code Misra-c2012 compliance, tested against cppcheck coverage
* Lockout openpilot after 3 terminal alerts for driver distracted or unresponsive
* Toyota Sienna support thanks to wocsor!
Version 0.6 (2019-07-01)
========================
* New model, with double the pixels and ten times the temporal context!
* Car should not take exits when in the right lane
* openpilot uses only ~65% of the CPU (down from 75%)
* Routes visible in connect/explorer after only 0.2% is uploaded (qlogs)
* loggerd and sensord are open source, every line of openpilot is now open
* Panda safety code is MISRA compliant and ships with a signed version on release2
* New NEOS is 500MB smaller and has a reproducible usr/pipenv
* Lexus ES Hybrid support thanks to wocsor!
* Improve tuning for supported Toyota with TSS 2.0
* Various other stability improvements
Version 0.5.13 (2019-05-31)
==========================
* Reduce panda power consumption by 70%, down to 80mW, when car is off (not for GM)
* Reduce EON power consumption by 40%, down to 1100mW, when car is off
* Reduce CPU utilization by 20% and improve stability
* Temporarily remove mapd functionalities to improve stability
* Add openpilot record-only mode for unsupported cars
* Synchronize controlsd to boardd to reduce latency
* Remove panda support for Subaru giraffe
Version 0.5.12 (2019-05-16)
==========================
* Improve lateral control for the Prius and Prius Prime
* Compress logs before writing to disk
* Remove old driving data when storage reaches 90% full
* Fix small offset in following distance
* Various small CPU optimizations
* Improve offroad power consumption: require NEOS Update
* Add default speed limits for Estonia thanks to martinl!
* Subaru Crosstrek support thanks to martinl!
* Toyota Avalon support thanks to njbrown09!
* Toyota Rav4 with TSS 2.0 support thanks to wocsor!
* Toyota Corolla with TSS 2.0 support thanks to wocsor!
Version 0.5.11 (2019-04-17)
========================
* Add support for Subaru
* Reduce panda power consumption by 60% when car is off
* Fix controlsd lag every 6 minutes. This would sometimes cause disengagements
* Fix bug in controls with new angle-offset learner in MPC
* Reduce cpu consumption of ubloxd by rewriting it in C++
* Improve driver monitoring model and face detection
* Improve performance of visiond and ui
* Honda Passport 2019 support
* Lexus RX Hybrid 2019 support thanks to schomems!
* Improve road selection heuristic in mapd
* Add Lane Departure Warning to dashboard for Toyota thanks to arne182
Version 0.5.10 (2019-03-19)
========================
* Self-tuning vehicle parameters: steering offset, tire stiffness and steering ratio
* Improve longitudinal control at low speed when lead vehicle harshly decelerates
* Fix panda bug going unexpectedly in DCP mode when EON is connected
* Reduce white panda power consumption by 500mW when EON is disconnected by turning off WIFI
* New Driver Monitoring Model
* Support QR codes for login using comma connect
* Refactor comma pedal FW and use CRC-8 checksum algorithm for safety. Reflashing pedal is required.
Please see `#hw-pedal` on [discord](discord.comma.ai) for assistance updating comma pedal.
* Additional speed limit rules for Germany thanks to arne182
* Allow negative speed limit offsets
Version 0.5.9 (2019-02-10)
========================
* Improve calibration using a dedicated neural network
* Abstract planner in its own process to remove lags in controls process
* Improve speed limits with country/region defaults by road type
* Reduce mapd data usage with gzip thanks to eFiniLan
* Zip log files in the background to reduce disk usage
* Kia Optima support thanks to emmertex!
* Buick Regal 2018 support thanks to HOYS!
* Comma pedal support for Toyota thanks to wocsor! Note: tuning needed and not maintained by comma
* Chrysler Pacifica and Jeep Grand Cherokee support thanks to adhintz!
Version 0.5.8 (2019-01-17)
========================
* Open sourced visiond
* Auto-slowdown for upcoming turns
* Chrysler/Jeep/Fiat support thanks to adhintz!
* Honda Civic 2019 support thanks to csouers!
* Improve use of car display in Toyota thanks to arne182!
* No data upload when connected to Android or iOS hotspots and "Enable Upload Over Cellular" setting is off
* EON stops charging when 12V battery drops below 11.8V
Version 0.5.7 (2018-12-06)
========================
* Speed limit from OpenStreetMap added to UI
* Highlight speed limit when speed exceeds road speed limit plus a delta
* Option to limit openpilot max speed to road speed limit plus a delta
* Cadillac ATS support thanks to vntarasov!
* GMC Acadia support thanks to CryptoKylan!
* Decrease GPU power consumption
* NEOSv8 autoupdate
Version 0.5.6 (2018-11-16)
========================
* Refresh settings layout and add feature descriptions
* In Honda, keep stock camera on for logging and extra stock features; new openpilot giraffe setting is 0111!
* In Toyota, option to keep stock camera on for logging and extra stock features (e.g. AHB); 120Ohm resistor required on giraffe.
* Improve camera calibration stability
* More tuning to Honda positive accelerations
* Reduce brake pump use on Hondas
* Chevrolet Malibu support thanks to tylergets!
* Holden Astra support thanks to AlexHill!
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)
========================
* New Driving Model
* New Driver Monitoring Model
* Improve longitudinal mpc in mid-low speed braking
* Honda Accord hybrid support thanks to energee!
* Ship mpc binaries and sensibly reduce build time
* Calibration more stable
* More Hyundai and Kia cars supported thanks to emmertex!
* Various GM Volt improvements thanks to vntarasov!
Version 0.5.3 (2018-09-03)
========================
* Hyundai Santa Fe support!
* Honda Pilot 2019 support thanks to energee!
* Toyota Highlander support thanks to daehahn!
* Improve steering tuning for Honda Odyssey
Version 0.5.2 (2018-08-16)
========================
* New calibration: more accurate, a lot faster, open source!
* Enable orbd
* Add little endian support to CAN packer
* Fix fingerprint for Honda Accord 1.5T
* Improve driver monitoring model
Version 0.5.1 (2018-08-01)
========================
* Fix radar error on Civic sedan 2018
* Improve thermal management logic
* Alpha Toyota C-HR and Camry support!
* Auto-switch Driver Monitoring to 3 min counter when inaccurate
Version 0.5 (2018-07-11)
========================
* Driver Monitoring (beta) option in settings!
* Make visiond, loggerd and UI use less resources
* 60 FPS UI
* Better car parameters for most cars
* New sidebar with stats
* Remove Waze and Spotify to free up system resources
* Remove rear view mirror option
* Calibration 3x faster
Version 0.4.7.2 (2018-06-25)
==========================
* Fix loggerd lag issue
* No longer prompt for updates
* Mitigate right lane hugging for properly mounted EON (procedure on wiki)
Version 0.4.7.1 (2018-06-18)
==========================
* Fix Acura ILX steer faults
* Fix bug in mock car
Version 0.4.7 (2018-06-15)
==========================
* New model!
* GM Volt (and CT6 lateral) support!
* Honda Bosch lateral support!
* Improve actuator modeling to reduce lateral wobble
* Minor refactor of car abstraction layer
* Hack around orbd startup issue
Version 0.4.6 (2018-05-18)
==========================
* NEOSv6 required! Will autoupdate
* Stability improvements
* Fix all memory leaks
* Update C++ compiler to clang6
* Improve front camera exposure
Version 0.4.5 (2018-04-27)
==========================
* Release notes added to the update popup
* Improve auto shut-off logic to disallow empty battery
* Added onboarding instructions
* Include orbd, the first piece of new calibration algorithm
* Show remaining upload data instead of file numbers
* Fix UI bugs
* Fix memory leaks
Version 0.4.4 (2018-04-13)
==========================
* EON are flipped! Flip your EON's mount!
* Alpha Honda Ridgeline support thanks to energee!
* Support optional front camera recording
* Upload over cellular toggle now applies to all files, not just video
* Increase acceleration when closing lead gap
* User now prompted for future updates
* NEO no longer supported :(
Version 0.4.3.2 (2018-03-29)
============================
* Improve autofocus
* Improve driving when only one lane line is detected
* Added fingerprint for Toyota Corolla LE
* Fixed Toyota Corolla steer error
* Full-screen driving UI
* Improved path drawing
Version 0.4.3.1 (2018-03-19)
============================
* Improve autofocus
* Add check for MPC solution error
* Make first distracted warning visual only
Version 0.4.3 (2018-03-13)
==========================
* Add HDR and autofocus
* Update UI aesthetic
* Grey panda works in Waze
* Add alpha support for 2017 Honda Pilot
* Slight increase in acceleration response from stop
* Switch CAN sending to use CANPacker
* Fix pulsing acceleration regression on Honda
* Fix openpilot bugs when stock system is in use
* Change starting logic for chffrplus to use battery voltage
Version 0.4.2 (2018-02-05)
==========================
* Add alpha support for 2017 Lexus RX Hybrid
* Add alpha support for 2018 ACURA RDX
* Updated fingerprint to include Toyota Rav4 SE and Prius Prime
* Bugfixes for Acura ILX and Honda Odyssey
Version 0.4.1 (2018-01-30)
==========================
* Add alpha support for 2017 Toyota Corolla
* Add alpha support for 2018 Honda Odyssey with Honda Sensing
* Add alpha support for Grey Panda
* Refactored car abstraction layer to make car ports easier
* Increased steering torque limit on Honda CR-V by 30%
Version 0.4.0.2 (2018-01-18)
==========================
* Add focus adjustment slider
* Minor bugfixes
Version 0.4.0.1 (2017-12-21)
==========================
* New UI to match chffrplus
* Improved lateral control tuning to fix oscillations on Civic
* Add alpha support for 2017 Toyota Rav4 Hybrid
* Reduced CPU usage
* Removed unnecessary utilization of fan at max speed
* Minor bug fixes
Version 0.3.9 (2017-11-21)
==========================
* Add alpha support for 2017 Toyota Prius
* Improved longitudinal control using model predictive control
* Enable Forward Collision Warning
* Acura ILX now maintains openpilot engaged at standstill when brakes are applied
Version 0.3.8.2 (2017-10-30)
==========================
* Add alpha support for 2017 Toyota RAV4
* Smoother lateral control
* Stay silent if stock system is connected through giraffe
* Minor bug fixes
Version 0.3.7 (2017-09-30)
==========================
* Improved lateral control using model predictive control
* Improved lane centering
* Improved GPS
* Reduced tendency of path deviation near right side exits
* Enable engagement while the accelerator pedal is pressed
* Enable engagement while the brake pedal is pressed, when stationary and with lead vehicle within 5m
* Disable engagement when park brake or brake hold are active
* Fixed sporadic longitudinal pulsing in Civic
* Cleanups to vehicle interface
Version 0.3.6.1 (2017-08-15)
============================
* Mitigate low speed steering oscillations on some vehicles
* Include board steering check for CR-V
Version 0.3.6 (2017-08-08)
==========================
* Fix alpha CR-V support
* Improved GPS
* Fix display of target speed not always matching HUD
* Increased acceleration after stop
* Mitigated some vehicles driving too close to the right line
Version 0.3.5 (2017-07-30)
==========================
* Fix bug where new devices would not begin calibration
* Minor robustness improvements
Version 0.3.4 (2017-07-28)
==========================
* Improved model trained on more data
* Much improved controls tuning
* Performance improvements
* Bugfixes and improvements to calibration
* Driving log can play back video
* Acura only: system now stays engaged below 25mph as long as brakes are applied
Version 0.3.3 (2017-06-28)
===========================
* Improved model trained on more data
* Alpha CR-V support thanks to energee and johnnwvs!
* Using the opendbc project for DBC files
* Minor performance improvements
* UI update thanks to pjlao307
* Power off button
* 6% more torque on the Civic
Version 0.3.2 (2017-05-22)
===========================
* Minor stability bugfixes
* Added metrics and rear view mirror disable to settings
* Update model with more crowdsourced data
Version 0.3.1 (2017-05-17)
===========================
* visiond stability bugfix
* Add logging for angle and flashing
Version 0.3.0 (2017-05-12)
===========================
* Add CarParams struct to improve the abstraction layer
* Refactor visiond IPC to support multiple clients
* Add raw GPS and beginning support for navigation
* Improve model in visiond using crowdsourced data
* Add improved system logging to diagnose instability
* Rewrite baseui in React Native
* Moved calibration to the cloud
Version 0.2.9 (2017-03-01)
===========================
* Retain compatibility with NEOS v1
Version 0.2.8 (2017-02-27)
===========================
* Fix bug where frames were being dropped in minute 71
Version 0.2.7 (2017-02-08)
===========================
* Better performance and pictures at night
* Fix ptr alignment issue in boardd
* Fix brake error light, fix crash if too cold
Version 0.2.6 (2017-01-31)
===========================
* Fix bug in visiond model execution
Version 0.2.5 (2017-01-30)
===========================
* Fix race condition in manager
Version 0.2.4 (2017-01-27)
===========================
* OnePlus 3T support
* Enable installation as NEOS app
* Various minor bugfixes
Version 0.2.3 (2017-01-11)
===========================
* Reduce space usage by 80%
* Add better logging
* Add Travis CI
Version 0.2.2 (2017-01-10)
===========================
* Board triggers started signal on CAN messages
* Improved autoexposure
* Handle out of space, improve upload status
Version 0.2.1 (2016-12-14)
===========================
* Performance improvements, removal of more numpy
* Fix boardd process priority
* Make counter timer reset on use of steering wheel
Version 0.2 (2016-12-12)
=========================
* Car/Radar abstraction layers have shipped, see cereal/car.capnp
* controlsd has been refactored
* Shipped plant model and testing maneuvers
* visiond exits more gracefully now
* Hardware encoder in visiond should always init
* ui now turns off the screen after 30 seconds
* Switch to openpilot release branch for future releases
* Added preliminary Docker container to run tests on PC
Version 0.1 (2016-11-29)
=========================
* Initial release of openpilot
* Adaptive cruise control is working
* Lane keep assist is working
* Support for Acura ILX 2016 with AcuraWatch Plus
* Support for Honda Civic 2016 Touring Edition

34
SAFETY.md Normal file
View File

@@ -0,0 +1,34 @@
openpilot Safety
======
openpilot is an Adaptive Cruise Control (ACC) and Automated Lane Centering (ALC) system.
Like other ACC and ALC systems, openpilot is a failsafe passive system and it requires the
driver to be alert and to pay attention at all times.
In order to enforce driver alertness, openpilot includes a driver monitoring feature
that alerts the driver when distracted.
However, even with an attentive driver, we must make further efforts for the system to be
safe. We repeat, **driver alertness is necessary, but not sufficient, for openpilot to be
used safely** and openpilot is provided with no warranty of fitness for any purpose.
openpilot is developed in good faith to be compliant with FMVSS requirements and to follow
industry standards of safety for Level 2 Driver Assistance Systems. In particular, we observe
ISO26262 guidelines, including those from [pertinent documents](https://www.nhtsa.gov/sites/nhtsa.dot.gov/files/documents/13498a_812_573_alcsystemreport.pdf)
released by NHTSA. In addition, we impose strict coding guidelines (like [MISRA C : 2012](https://www.misra.org.uk/MISRAHome/MISRAC2012/tabid/196/Default.aspx))
on parts of openpilot that are safety relevant. We also perform software-in-the-loop,
hardware-in-the-loop and in-vehicle tests before each software release.
Following Hazard and Risk Analysis and FMEA, at a very high level, we have designed openpilot
ensuring two main safety requirements.
1. The driver must always be capable to immediately retake manual control of the vehicle,
by stepping on either pedal or by pressing the cancel button.
2. The vehicle must not alter its trajectory too quickly for the driver to safely
react. This means that while the system is engaged, the actuators are constrained
to operate within reasonable limits.
For vehicle specific implementation of the safety concept, refer to `panda/board/safety/`.
**Extra note**: comma.ai strongly discourages the use of openpilot forks with safety code either missing or
not fully meeting the above requirements.

View File

@@ -1,18 +1,6 @@
import os
import subprocess
zmq = 'zmq'
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
cereal_dir = Dir('.')
cpppath = [
'#',
'#cereal',
"#cereal/messaging",
"#opendbc/can",
'/usr/lib/include',
]
import sys
AddOption('--test',
action='store_true',
@@ -22,13 +10,75 @@ AddOption('--asan',
action='store_true',
help='turn on ASAN')
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
if arch == "aarch64":
lenv = {
"LD_LIBRARY_PATH": '/data/data/com.termux/files/usr/lib',
"PATH": os.environ['PATH'],
"ANDROID_DATA": os.environ['ANDROID_DATA'],
"ANDROID_ROOT": os.environ['ANDROID_ROOT'],
}
cpppath = [
"#phonelibs/opencl/include",
]
libpath = [
"#phonelibs/snpe/aarch64-android-clang3.8",
"/usr/lib",
"/data/data/com.termux/files/usr/lib",
"/system/vendor/lib64",
"/system/comma/usr/lib",
"#phonelibs/yaml-cpp/lib",
"#phonelibs/nanovg",
"#phonelibs/libyuv/lib",
]
cflags = ["-DQCOM", "-mcpu=cortex-a57"]
cxxflags = ["-DQCOM", "-mcpu=cortex-a57"]
rpath = ["/system/vendor/lib64"]
else:
lenv = {
"PATH": "#external/bin:" + os.environ['PATH'],
}
cpppath = [
"#phonelibs/capnp-cpp/include",
"#phonelibs/capnp-c/include",
"#phonelibs/zmq/x64/include",
]
libpath = [
"#phonelibs/capnp-cpp/x64/lib",
"#phonelibs/capnp-c/x64/lib",
"#phonelibs/yaml-cpp/x64/lib",
"#phonelibs/snpe/x86_64-linux-clang",
"#phonelibs/zmq/x64/lib",
"#phonelibs/libyuv/x64/lib",
"#external/zmq/lib",
"#cereal",
"#selfdrive/common",
"/usr/lib",
"/usr/local/lib",
]
rpath = ["phonelibs/capnp-cpp/x64/lib",
"cereal",
"selfdrive/common"]
# allows shared libraries to work globally
rpath = [os.path.join(os.getcwd(), x) for x in rpath]
cflags = []
cxxflags = []
ccflags_asan = ["-fsanitize=address", "-fno-omit-frame-pointer"] if GetOption('asan') else []
ldflags_asan = ["-fsanitize=address"] if GetOption('asan') else []
# change pythonpath to this
lenv["PYTHONPATH"] = Dir("#").path
env = Environment(
ENV=os.environ,
CC='clang',
CXX='clang++',
ENV=lenv,
CCFLAGS=[
"-g",
"-fPIC",
@@ -38,20 +88,125 @@ env = Environment(
"-Werror=int-conversion",
"-Werror=return-type",
"-Werror=format-extra-args",
] + ccflags_asan,
LDFLAGS=ldflags_asan,
] + cflags + ccflags_asan,
CPPPATH=cpppath + [
"#",
"#selfdrive",
"#phonelibs/bzip2",
"#phonelibs/libyuv/include",
"#phonelibs/yaml-cpp/include",
"#phonelibs/openmax/include",
"#phonelibs/json/src",
"#phonelibs/json11",
"#phonelibs/eigen",
"#phonelibs/curl/include",
"#phonelibs/opencv/include",
"#phonelibs/libgralloc/include",
"#phonelibs/android_frameworks_native/include",
"#phonelibs/android_hardware_libhardware/include",
"#phonelibs/android_system_core/include",
"#phonelibs/linux/include",
"#phonelibs/snpe/include",
"#phonelibs/nanovg",
"#selfdrive/common",
"#selfdrive/camerad",
"#selfdrive/camerad/include",
"#selfdrive/loggerd/include",
"#selfdrive/modeld",
"#cereal/messaging",
"#cereal",
"#opendbc/can",
],
CC='clang',
CXX='clang++',
LINKFLAGS=ldflags_asan,
CFLAGS="-std=gnu11",
CXXFLAGS="-std=c++14",
CPPPATH=cpppath,
RPATH=rpath,
CFLAGS=["-std=gnu11"] + cflags,
CXXFLAGS=["-std=c++14"] + cxxflags,
LIBPATH=libpath +
[
"#cereal",
"#selfdrive/common",
"#phonelibs",
]
)
Export('env', 'zmq', 'arch')
if os.environ.get('SCONS_CACHE'):
CacheDir('/tmp/scons_cache')
cereal = [File('#cereal/libcereal.a')]
messaging = [File('#cereal/libmessaging.a')]
node_interval = 5
node_count = 0
def progress_function(node):
global node_count
node_count += node_interval
sys.stderr.write("progress: %d\n" % node_count)
if os.environ.get('SCONS_PROGRESS'):
Progress(progress_function, interval=node_interval)
SHARED = False
def abspath(x):
if arch == 'aarch64':
pth = os.path.join("/data/pythonpath", x[0].path)
env.Depends(pth, x)
return File(pth)
else:
# rpath works elsewhere
return x[0].path.rsplit("/", 1)[1][:-3]
#zmq = 'zmq'
# still needed for apks
zmq = FindFile("libzmq.a", libpath)
Export('env', 'arch', 'zmq', 'SHARED')
# cereal and messaging are shared with the system
SConscript(['cereal/SConscript'])
if SHARED:
cereal = abspath([File('cereal/libcereal_shared.so')])
messaging = abspath([File('cereal/libmessaging_shared.so')])
else:
cereal = [File('#cereal/libcereal.a')]
messaging = [File('#cereal/libmessaging.a')]
Export('cereal', 'messaging')
SConscript(['cereal/SConscript'])
SConscript(['selfdrive/common/SConscript'])
Import('_common', '_visionipc', '_gpucommon', '_gpu_libs')
if SHARED:
common, visionipc, gpucommon = abspath(common), abspath(visionipc), abspath(gpucommon)
else:
common = [_common, 'json']
visionipc = _visionipc
gpucommon = [_gpucommon] + _gpu_libs
Export('common', 'visionipc', 'gpucommon')
SConscript(['opendbc/can/SConscript'])
SConscript(['common/SConscript'])
SConscript(['common/kalman/SConscript'])
SConscript(['phonelibs/SConscript'])
SConscript(['selfdrive/modeld/SConscript'])
SConscript(['selfdrive/camerad/SConscript'])
SConscript(['selfdrive/controls/lib/cluster/SConscript'])
SConscript(['selfdrive/controls/lib/lateral_mpc/SConscript'])
SConscript(['selfdrive/controls/lib/longitudinal_mpc/SConscript'])
SConscript(['selfdrive/boardd/SConscript'])
SConscript(['selfdrive/proclogd/SConscript'])
if arch == "aarch64":
SConscript(['selfdrive/logcatd/SConscript'])
SConscript(['selfdrive/ui/SConscript'])
SConscript(['selfdrive/sensord/SConscript'])
SConscript(['selfdrive/loggerd/SConscript'])
SConscript(['selfdrive/locationd/SConscript'])
# TODO: finish cereal, dbcbuilder, MPC

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.

BIN
apk/0.7.0-en/com.waze.apk Normal file

Binary file not shown.

Binary file not shown.

BIN
apk/ai.comma.plus.black.apk Normal file

Binary file not shown.

BIN
apk/ai.comma.plus.frame.apk Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
apk/com.mixplorer.apk Normal file

Binary file not shown.

Binary file not shown.

BIN
apk/com.waze.apk Normal file

Binary file not shown.

Binary file not shown.

1
cereal/.dockerignore Normal file
View File

@@ -0,0 +1 @@
.sconsign.dblite

14
cereal/.gitignore vendored Normal file
View File

@@ -0,0 +1,14 @@
gen
node_modules
package-lock.json
*.pyc
__pycache__
.*.swp
.*.swo
libcereal*.a
libmessaging.*
libmessaging_shared.*
services.h
.sconsign.dblite
libcereal_shared.so

19
cereal/Dockerfile Normal file
View File

@@ -0,0 +1,19 @@
from ubuntu:16.04
RUN apt-get update && apt-get install -y libzmq3-dev clang wget git autoconf libtool curl make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl
RUN curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
ENV PATH="/root/.pyenv/bin:/root/.pyenv/shims:${PATH}"
RUN pyenv install 3.7.3
RUN pyenv global 3.7.3
RUN pyenv rehash
RUN pip3 install pyyaml==5.1.2 Cython==0.29.14 scons==3.1.1 pycapnp==0.6.4
WORKDIR /project/cereal
COPY install_capnp.sh .
RUN ./install_capnp.sh
ENV PYTHONPATH=/project
COPY . .
RUN scons -c && scons -j$(nproc)

68
cereal/SConscript Normal file
View File

@@ -0,0 +1,68 @@
Import('env', 'arch', 'zmq')
gen_dir = Dir('gen')
messaging_dir = Dir('messaging')
# TODO: remove src-prefix and cereal from command string. can we set working directory?
env.Command(["gen/c/include/c++.capnp.h", "gen/c/include/java.capnp.h"], [], "mkdir -p " + gen_dir.path + "/c/include && touch $TARGETS")
env.Command(
['gen/c/car.capnp.c', 'gen/c/log.capnp.c', 'gen/c/car.capnp.h', 'gen/c/log.capnp.h'],
['car.capnp', 'log.capnp'],
'capnpc $SOURCES --src-prefix=cereal -o c:' + gen_dir.path + '/c/')
env.Command(
['gen/cpp/car.capnp.c++', 'gen/cpp/log.capnp.c++', 'gen/cpp/car.capnp.h', 'gen/cpp/log.capnp.h'],
['car.capnp', 'log.capnp'],
'capnpc $SOURCES --src-prefix=cereal -o c++:' + gen_dir.path + '/cpp/')
import shutil
if shutil.which('capnpc-java'):
env.Command(
['gen/java/Car.java', 'gen/java/Log.java'],
['car.capnp', 'log.capnp'],
'capnpc $SOURCES --src-prefix=cereal -o java:' + gen_dir.path + '/java/')
# TODO: remove non shared cereal and messaging
cereal_objects = env.SharedObject([
'gen/c/car.capnp.c',
'gen/c/log.capnp.c',
'gen/cpp/car.capnp.c++',
'gen/cpp/log.capnp.c++',
])
env.Library('cereal', cereal_objects)
env.SharedLibrary('cereal_shared', cereal_objects)
cereal_dir = Dir('.')
services_h = env.Command(
['services.h'],
['service_list.yaml', 'services.py'],
'python3 ' + cereal_dir.path + '/services.py > $TARGET')
messaging_objects = env.SharedObject([
'messaging/messaging.cc',
'messaging/impl_zmq.cc',
'messaging/impl_msgq.cc',
'messaging/msgq.cc',
])
messaging_lib = env.Library('messaging', messaging_objects)
Depends('messaging/impl_zmq.cc', services_h)
# note, this rebuilds the deps shared, zmq is statically linked to make APK happy
# TODO: get APK to load system zmq to remove the static link
shared_lib_shared_lib = [zmq, 'm', 'stdc++'] + ["gnustl_shared"] if arch == "aarch64" else []
env.SharedLibrary('messaging_shared', messaging_objects, LIBS=shared_lib_shared_lib)
env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=[messaging_lib, 'zmq'])
Depends('messaging/bridge.cc', services_h)
# different target?
#env.Program('messaging/demo', ['messaging/demo.cc'], LIBS=[messaging_lib, 'zmq'])
env.Command(['messaging/messaging_pyx.so'],
[messaging_lib, 'messaging/messaging_pyx_setup.py', 'messaging/messaging_pyx.pyx', 'messaging/messaging.pxd'],
"cd " + messaging_dir.path + " && python3 messaging_pyx_setup.py build_ext --inplace")
if GetOption('test'):
env.Program('messaging/test_runner', ['messaging/test_runner.cc', 'messaging/msgq_tests.cc'], LIBS=[messaging_lib])

49
cereal/SConstruct Normal file
View File

@@ -0,0 +1,49 @@
import os
import subprocess
zmq = 'zmq'
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
cereal_dir = Dir('.')
cpppath = [
cereal_dir,
'/usr/lib/include',
]
AddOption('--test',
action='store_true',
help='build test files')
AddOption('--asan',
action='store_true',
help='turn on ASAN')
ccflags_asan = ["-fsanitize=address", "-fno-omit-frame-pointer"] if GetOption('asan') else []
ldflags_asan = ["-fsanitize=address"] if GetOption('asan') else []
env = Environment(
ENV=os.environ,
CC='clang',
CXX='clang++',
CCFLAGS=[
"-g",
"-fPIC",
"-O2",
"-Werror=implicit-function-declaration",
"-Werror=incompatible-pointer-types",
"-Werror=int-conversion",
"-Werror=return-type",
"-Werror=format-extra-args",
] + ccflags_asan,
LDFLAGS=ldflags_asan,
LINKFLAGS=ldflags_asan,
CFLAGS="-std=gnu11",
CXXFLAGS="-std=c++14",
CPPPATH=cpppath,
)
Export('env', 'zmq', 'arch')
SConscript(['SConscript'])

8
cereal/__init__.py Normal file
View File

@@ -0,0 +1,8 @@
import os
import capnp
CEREAL_PATH = os.path.dirname(os.path.abspath(__file__))
capnp.remove_import_hook()
log = capnp.load(os.path.join(CEREAL_PATH, "log.capnp"))
car = capnp.load(os.path.join(CEREAL_PATH, "car.capnp"))

View File

@@ -0,0 +1,14 @@
pr: none
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: |
set -e
docker build -t cereal .
docker run cereal bash -c "scons --test --asan -j$(nproc) && messaging/test_runner"
docker run cereal bash -c "ZMQ=1 python -m unittest discover ."
docker run cereal bash -c "MSGQ=1 python -m unittest discover ."
displayName: 'Run Tests'

465
cereal/car.capnp Normal file
View File

@@ -0,0 +1,465 @@
using Cxx = import "./include/c++.capnp";
$Cxx.namespace("cereal");
using Java = import "./include/java.capnp";
$Java.package("ai.comma.openpilot.cereal");
$Java.outerClassname("Car");
@0x8e2af1e708af8b8d;
# ******* events causing controls state machine transition *******
struct CarEvent @0x9b1657f34caf3ad3 {
name @0 :EventName;
enable @1 :Bool;
noEntry @2 :Bool;
warning @3 :Bool;
userDisable @4 :Bool;
softDisable @5 :Bool;
immediateDisable @6 :Bool;
preEnable @7 :Bool;
permanent @8 :Bool;
enum EventName @0xbaa8c5d505f727de {
# TODO: copy from error list
canError @0;
steerUnavailable @1;
brakeUnavailable @2;
gasUnavailable @3;
wrongGear @4;
doorOpen @5;
seatbeltNotLatched @6;
espDisabled @7;
wrongCarMode @8;
steerTempUnavailable @9;
reverseGear @10;
buttonCancel @11;
buttonEnable @12;
pedalPressed @13;
cruiseDisabled @14;
radarCanError @15;
dataNeeded @16;
speedTooLow @17;
outOfSpace @18;
overheat @19;
calibrationIncomplete @20;
calibrationInvalid @21;
controlsMismatch @22;
pcmEnable @23;
pcmDisable @24;
noTarget @25;
radarFault @26;
modelCommIssueDEPRECATED @27;
brakeHold @28;
parkBrake @29;
manualRestart @30;
lowSpeedLockout @31;
plannerError @32;
ipasOverride @33;
debugAlert @34;
steerTempUnavailableMute @35;
resumeRequired @36;
preDriverDistracted @37;
promptDriverDistracted @38;
driverDistracted @39;
geofence @40;
driverMonitorOn @41;
driverMonitorOff @42;
preDriverUnresponsive @43;
promptDriverUnresponsive @44;
driverUnresponsive @45;
belowSteerSpeed @46;
calibrationProgress @47;
lowBattery @48;
invalidGiraffeHonda @49;
vehicleModelInvalid @50;
controlsFailed @51;
sensorDataInvalid @52;
commIssue @53;
tooDistracted @54;
posenetInvalid @55;
soundsUnavailable @56;
preLaneChangeLeft @57;
preLaneChangeRight @58;
laneChange @59;
invalidGiraffeToyota @60;
internetConnectivityNeeded @61;
communityFeatureDisallowed @62;
lowMemory @63;
stockAeb @64;
ldw @65;
# dragonpilot
manualSteeringRequired @66;
manualSteeringRequiredBlinkersOn @67;
leadCarMoving @68;
leadCarDetected @69;
preAutoLaneChangeLeft @70;
preAutoLaneChangeRight @71;
autoLaneChange @72;
}
}
# ******* main car state @ 100hz *******
# all speeds in m/s
struct CarState {
errorsDEPRECATED @0 :List(CarEvent.EventName);
events @13 :List(CarEvent);
# car speed
vEgo @1 :Float32; # best estimate of speed
aEgo @16 :Float32; # best estimate of acceleration
vEgoRaw @17 :Float32; # unfiltered speed from CAN sensors
yawRate @22 :Float32; # best estimate of yaw rate
standstill @18 :Bool;
wheelSpeeds @2 :WheelSpeeds;
# gas pedal, 0.0-1.0
gas @3 :Float32; # this is user + computer
gasPressed @4 :Bool; # this is user pedal only
# brake pedal, 0.0-1.0
brake @5 :Float32; # this is user pedal only
brakePressed @6 :Bool; # this is user pedal only
brakeLights @19 :Bool;
# steering wheel
steeringAngle @7 :Float32; # deg
steeringRate @15 :Float32; # deg/s
steeringTorque @8 :Float32; # TODO: standardize units
steeringTorqueEps @27 :Float32; # TODO: standardize units
steeringPressed @9 :Bool; # if the user is using the steering wheel
steeringRateLimited @29 :Bool; # if the torque is limited by the rate limiter
stockAeb @30 :Bool;
stockFcw @31 :Bool;
# cruise state
cruiseState @10 :CruiseState;
# gear
gearShifter @14 :GearShifter;
# button presses
buttonEvents @11 :List(ButtonEvent);
leftBlinker @20 :Bool;
rightBlinker @21 :Bool;
genericToggle @23 :Bool;
# lock info
doorOpen @24 :Bool;
seatbeltUnlatched @25 :Bool;
canValid @26 :Bool;
# clutch (manual transmission only)
clutchPressed @28 :Bool;
# which packets this state came from
canMonoTimes @12: List(UInt64);
struct WheelSpeeds {
# optional wheel speeds
fl @0 :Float32;
fr @1 :Float32;
rl @2 :Float32;
rr @3 :Float32;
}
struct CruiseState {
enabled @0 :Bool;
speed @1 :Float32;
available @2 :Bool;
speedOffset @3 :Float32;
standstill @4 :Bool;
}
enum GearShifter {
unknown @0;
park @1;
drive @2;
neutral @3;
reverse @4;
sport @5;
low @6;
brake @7;
eco @8;
manumatic @9;
}
# send on change
struct ButtonEvent {
pressed @0 :Bool;
type @1 :Type;
enum Type {
unknown @0;
leftBlinker @1;
rightBlinker @2;
accelCruise @3;
decelCruise @4;
cancel @5;
altButton1 @6;
altButton2 @7;
altButton3 @8;
setCruise @9;
resumeCruise @10;
gapAdjustCruise @11;
}
}
}
# ******* radar state @ 20hz *******
struct RadarData @0x888ad6581cf0aacb {
errors @0 :List(Error);
points @1 :List(RadarPoint);
# which packets this state came from
canMonoTimes @2 :List(UInt64);
enum Error {
canError @0;
fault @1;
wrongConfig @2;
}
# similar to LiveTracks
# is one timestamp valid for all? I think so
struct RadarPoint {
trackId @0 :UInt64; # no trackId reuse
# these 3 are the minimum required
dRel @1 :Float32; # m from the front bumper of the car
yRel @2 :Float32; # m
vRel @3 :Float32; # m/s
# these are optional and valid if they are not NaN
aRel @4 :Float32; # m/s^2
yvRel @5 :Float32; # m/s
# some radars flag measurements VS estimates
measured @6 :Bool;
}
}
# ******* car controls @ 100hz *******
struct CarControl {
# must be true for any actuator commands to work
enabled @0 :Bool;
active @7 :Bool;
gasDEPRECATED @1 :Float32;
brakeDEPRECATED @2 :Float32;
steeringTorqueDEPRECATED @3 :Float32;
actuators @6 :Actuators;
cruiseControl @4 :CruiseControl;
hudControl @5 :HUDControl;
struct Actuators {
# range from 0.0 - 1.0
gas @0: Float32;
brake @1: Float32;
# range from -1.0 - 1.0
steer @2: Float32;
steerAngle @3: Float32;
}
struct CruiseControl {
cancel @0: Bool;
override @1: Bool;
speedOverride @2: Float32;
accelOverride @3: Float32;
}
struct HUDControl {
speedVisible @0: Bool;
setSpeed @1: Float32;
lanesVisible @2: Bool;
leadVisible @3: Bool;
visualAlert @4: VisualAlert;
audibleAlert @5: AudibleAlert;
rightLaneVisible @6: Bool;
leftLaneVisible @7: Bool;
rightLaneDepart @8: Bool;
leftLaneDepart @9: Bool;
enum VisualAlert {
# these are the choices from the Honda
# map as good as you can for your car
none @0;
fcw @1;
steerRequired @2;
brakePressed @3;
wrongGear @4;
seatbeltUnbuckled @5;
speedTooHigh @6;
ldw @7;
}
enum AudibleAlert {
# these are the choices from the Honda
# map as good as you can for your car
none @0;
chimeEngage @1;
chimeDisengage @2;
chimeError @3;
chimeWarning1 @4;
chimeWarning2 @5;
chimeWarningRepeat @6;
chimePrompt @7;
}
}
}
# ****** car param ******
struct CarParams {
carName @0 :Text;
carFingerprint @1 :Text;
enableGasInterceptor @2 :Bool;
enableCruise @3 :Bool;
enableCamera @4 :Bool;
enableDsu @5 :Bool; # driving support unit
enableApgs @6 :Bool; # advanced parking guidance system
minEnableSpeed @7 :Float32;
minSteerSpeed @8 :Float32;
safetyModel @9 :SafetyModel;
safetyModelPassive @42 :SafetyModel = silent;
safetyParam @10 :Int16;
steerMaxBP @11 :List(Float32);
steerMaxV @12 :List(Float32);
gasMaxBP @13 :List(Float32);
gasMaxV @14 :List(Float32);
brakeMaxBP @15 :List(Float32);
brakeMaxV @16 :List(Float32);
# things about the car in the manual
mass @17 :Float32; # [kg] running weight
wheelbase @18 :Float32; # [m] distance from rear to front axle
centerToFront @19 :Float32; # [m] GC distance to front axle
steerRatio @20 :Float32; # [] ratio between front wheels and steering wheel angles
steerRatioRear @21 :Float32; # [] rear steering ratio wrt front steering (usually 0)
# things we can derive
rotationalInertia @22 :Float32; # [kg*m2] body rotational inertia
tireStiffnessFront @23 :Float32; # [N/rad] front tire coeff of stiff
tireStiffnessRear @24 :Float32; # [N/rad] rear tire coeff of stiff
longitudinalTuning @25 :LongitudinalPIDTuning;
lateralTuning :union {
pid @26 :LateralPIDTuning;
indi @27 :LateralINDITuning;
lqr @40 :LateralLQRTuning;
}
steerLimitAlert @28 :Bool;
steerLimitTimer @47 :Float32; # time before steerLimitAlert is issued
vEgoStopping @29 :Float32; # Speed at which the car goes into stopping state
directAccelControl @30 :Bool; # Does the car have direct accel control or just gas/brake
stoppingControl @31 :Bool; # Does the car allows full control even at lows speeds when stopping
startAccel @32 :Float32; # Required acceleraton to overcome creep braking
steerRateCost @33 :Float32; # Lateral MPC cost on steering rate
steerControlType @34 :SteerControlType;
radarOffCan @35 :Bool; # True when radar objects aren't visible on CAN
steerActuatorDelay @36 :Float32; # Steering wheel actuator delay in seconds
openpilotLongitudinalControl @37 :Bool; # is openpilot doing the longitudinal control?
carVin @38 :Text; # VIN number queried during fingerprinting
isPandaBlack @39: Bool;
dashcamOnly @41: Bool;
transmissionType @43 :TransmissionType;
carFw @44 :List(CarFw);
radarTimeStep @45: Float32 = 0.05; # time delta between radar updates, 20Hz is very standard
communityFeature @46: Bool; # true if a community maintained feature is detected
struct LateralPIDTuning {
kpBP @0 :List(Float32);
kpV @1 :List(Float32);
kiBP @2 :List(Float32);
kiV @3 :List(Float32);
kf @4 :Float32;
}
struct LongitudinalPIDTuning {
kpBP @0 :List(Float32);
kpV @1 :List(Float32);
kiBP @2 :List(Float32);
kiV @3 :List(Float32);
deadzoneBP @4 :List(Float32);
deadzoneV @5 :List(Float32);
}
struct LateralINDITuning {
outerLoopGain @0 :Float32;
innerLoopGain @1 :Float32;
timeConstant @2 :Float32;
actuatorEffectiveness @3 :Float32;
}
struct LateralLQRTuning {
scale @0 :Float32;
ki @1 :Float32;
dcGain @2 :Float32;
# State space system
a @3 :List(Float32);
b @4 :List(Float32);
c @5 :List(Float32);
k @6 :List(Float32); # LQR gain
l @7 :List(Float32); # Kalman gain
}
enum SafetyModel {
silent @0;
honda @1;
toyota @2;
elm327 @3;
gm @4;
hondaBosch @5;
ford @6;
cadillac @7;
hyundai @8;
chrysler @9;
tesla @10;
subaru @11;
gmPassive @12;
mazda @13;
nissan @14;
volkswagen @15;
toyotaIpas @16;
allOutput @17;
gmAscm @18;
noOutput @19; # like silent but with silent CAN TXs
}
enum SteerControlType {
torque @0;
angle @1;
}
enum TransmissionType {
unknown @0;
automatic @1;
manual @2;
}
struct CarFw {
ecu @0 :Ecu;
fwVersion @1 :Text;
}
enum Ecu {
eps @0;
esp @1;
fwdRadar @2;
fwdCamera @3;
}
}

26
cereal/generate_javascript.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
rm -r gen/ts
rm -r gen/js
mkdir gen/ts
mkdir gen/js
echo "Installing needed npm modules"
npm i capnpc-ts capnp-ts
capnpc -o node_modules/.bin/capnpc-ts:gen/ts log.capnp car.capnp
capnpc -o node_modules/.bin/capnpc-ts:gen/ts car.capnp
cat log.capnp | egrep '\([a-zA-Z]*\.[^\s]+\.[^s]+\)' | sed 's/^.*([a-zA-Z]*\.\([a-zA-Z.]*\)).*/\1/' | while read line
do
TOKEN=`echo $line | sed 's/\./_/g'`
ROOT=`echo $line | sed 's/\..*$//g'`
cat gen/ts/log.capnp.ts | grep '^import.*'${TOKEN}
if [[ "$?" == "1" ]]
then
sed -i 's/^\(import {.*\)'${ROOT}'\(,*\) \(.*\)$/\1'${ROOT}', '${TOKEN}'\2 \3/' ./gen/ts/log.capnp.ts
fi
done
tsc ./gen/ts/* --lib es2015 --outDir ./gen/js

26
cereal/include/c++.capnp Normal file
View File

@@ -0,0 +1,26 @@
# Copyright (c) 2013-2014 Sandstorm Development Group, Inc. and contributors
# Licensed under the MIT License:
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
@0xbdf87d7bb8304e81;
$namespace("capnp::annotations");
annotation namespace(file): Text;
annotation name(field, enumerant, struct, enum, interface, method, param, group, union): Text;

28
cereal/include/java.capnp Normal file
View File

@@ -0,0 +1,28 @@
# Copyright (c) 2013-2015 Sandstorm Development Group, Inc. and contributors
# Licensed under the MIT License:
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
@0xc5f1af96651f70ea;
annotation package @0x9ee4c8f803b3b596 (file) : Text;
# Name of the package, such as "org.example.foo", in which the generated code will reside.
annotation outerClassname @0x9b066bb4881f7cd3 (file) : Text;
# Name of the outer class that will wrap the generated code.

40
cereal/install_capnp.sh Executable file
View File

@@ -0,0 +1,40 @@
set -e
echo "Installing capnp"
cd /tmp
VERSION=0.6.1
wget https://capnproto.org/capnproto-c++-${VERSION}.tar.gz
tar xvf capnproto-c++-${VERSION}.tar.gz
cd capnproto-c++-${VERSION}
CXXFLAGS="-fPIC" ./configure
make -j$(nproc)
make install
# manually build binaries statically
g++ -std=gnu++11 -I./src -I./src -DKJ_HEADER_WARNINGS -DCAPNP_HEADER_WARNINGS -DCAPNP_INCLUDE_DIR=\"/usr/local/include\" -pthread -O2 -DNDEBUG -pthread -pthread -o .libs/capnp src/capnp/compiler/module-loader.o src/capnp/compiler/capnp.o ./.libs/libcapnpc.a ./.libs/libcapnp.a ./.libs/libkj.a -lpthread -pthread
g++ -std=gnu++11 -I./src -I./src -DKJ_HEADER_WARNINGS -DCAPNP_HEADER_WARNINGS -DCAPNP_INCLUDE_DIR=\"/usr/local/include\" -pthread -O2 -DNDEBUG -pthread -pthread -o .libs/capnpc-c++ src/capnp/compiler/capnpc-c++.o ./.libs/libcapnp.a ./.libs/libkj.a -lpthread -pthread
g++ -std=gnu++11 -I./src -I./src -DKJ_HEADER_WARNINGS -DCAPNP_HEADER_WARNINGS -DCAPNP_INCLUDE_DIR=\"/usr/local/include\" -pthread -O2 -DNDEBUG -pthread -pthread -o .libs/capnpc-capnp src/capnp/compiler/capnpc-capnp.o ./.libs/libcapnp.a ./.libs/libkj.a -lpthread -pthread
cp .libs/capnp /usr/local/bin/
cp .libs/capnpc-c++ /usr/local/bin/
cp .libs/capnpc-capnp /usr/local/bin/
cp .libs/*.a /usr/local/lib
cd /tmp
echo "Installing c-capnp"
git clone https://github.com/commaai/c-capnproto.git
cd c-capnproto
git submodule update --init --recursive
autoreconf -f -i -s
CXXFLAGS="-fPIC" ./configure
make -j$(nproc)
make install
# manually build binaries statically
gcc -fPIC -o .libs/capnpc-c compiler/capnpc-c.o compiler/schema.capnp.o compiler/str.o ./.libs/libcapnp_c.a
cp .libs/capnpc-c /usr/local/bin/
cp .libs/*.a /usr/local/lib

1897
cereal/log.capnp Normal file

File diff suppressed because it is too large Load Diff

53
cereal/maptile.capnp Normal file
View File

@@ -0,0 +1,53 @@
using Cxx = import "./include/c++.capnp";
$Cxx.namespace("cereal");
using Java = import "./include/java.capnp";
$Java.package("ai.comma.openpilot.cereal");
$Java.outerClassname("Map");
@0xa086df597ef5d7a0;
# Geometry
struct Point {
x @0: Float64;
y @1: Float64;
z @2: Float64;
}
struct PolyLine {
points @0: List(Point);
}
# Map features
struct Lane {
id @0 :Text;
leftBoundary @1 :LaneBoundary;
rightBoundary @2 :LaneBoundary;
leftAdjacentId @3 :Text;
rightAdjacentId @4 :Text;
inboundIds @5 :List(Text);
outboundIds @6 :List(Text);
struct LaneBoundary {
polyLine @0 :PolyLine;
startHeading @1 :Float32; # WRT north
}
}
# Map tiles
struct TileSummary {
version @0 :Text;
updatedAt @1 :UInt64; # Millis since epoch
level @2 :UInt8;
x @3 :UInt16;
y @4 :UInt16;
}
struct MapTile {
summary @0 :TileSummary;
lanes @1 :List(Lane);
}

10
cereal/messaging/.gitignore vendored Normal file
View File

@@ -0,0 +1,10 @@
demo
bridge
test_runner
*.o
*.os
*.d
*.a
*.so
messaging_pyx.cpp
build/

View File

@@ -0,0 +1,219 @@
# must be build with scons
from .messaging_pyx import Context, Poller, SubSocket, PubSocket # pylint: disable=no-name-in-module, import-error
from .messaging_pyx import MultiplePublishersError, MessagingError # pylint: disable=no-name-in-module, import-error
assert MultiplePublishersError
assert MessagingError
from cereal import log
from cereal.services import service_list
# sec_since_boot is faster, but allow to run standalone too
try:
from common.realtime import sec_since_boot
except ImportError:
import time
sec_since_boot = time.time
print("Warning, using python time.time() instead of faster sec_since_boot")
context = Context()
def new_message():
dat = log.Event.new_message()
dat.logMonoTime = int(sec_since_boot() * 1e9)
dat.valid = True
return dat
def pub_sock(endpoint):
sock = PubSocket()
sock.connect(context, endpoint)
return sock
def sub_sock(endpoint, poller=None, addr="127.0.0.1", conflate=False, timeout=None):
sock = SubSocket()
addr = addr.encode('utf8')
sock.connect(context, endpoint, addr, conflate)
if timeout is not None:
sock.setTimeout(timeout)
if poller is not None:
poller.registerSocket(sock)
return sock
def drain_sock_raw(sock, wait_for_one=False):
"""Receive all message currently available on the queue"""
ret = []
while 1:
if wait_for_one and len(ret) == 0:
dat = sock.receive()
else:
dat = sock.receive(non_blocking=True)
if dat is None:
break
ret.append(dat)
return ret
def drain_sock(sock, wait_for_one=False):
"""Receive all message currently available on the queue"""
ret = []
while 1:
if wait_for_one and len(ret) == 0:
dat = sock.receive()
else:
dat = sock.receive(non_blocking=True)
if dat is None: # Timeout hit
break
dat = log.Event.from_bytes(dat)
ret.append(dat)
return ret
# TODO: print when we drop packets?
def recv_sock(sock, wait=False):
"""Same as drain sock, but only returns latest message. Consider using conflate instead."""
dat = None
while 1:
if wait and dat is None:
rcv = sock.receive()
else:
rcv = sock.receive(non_blocking=True)
if rcv is None: # Timeout hit
break
dat = rcv
if dat is not None:
dat = log.Event.from_bytes(dat)
return dat
def recv_one(sock):
dat = sock.receive()
if dat is not None:
dat = log.Event.from_bytes(dat)
return dat
def recv_one_or_none(sock):
dat = sock.receive(non_blocking=True)
if dat is not None:
dat = log.Event.from_bytes(dat)
return dat
def recv_one_retry(sock):
"""Keep receiving until we get a message"""
while True:
dat = sock.receive()
if dat is not None:
return log.Event.from_bytes(dat)
def get_one_can(logcan):
while True:
can = recv_one_retry(logcan)
if len(can.can) > 0:
return can
class SubMaster():
def __init__(self, services, ignore_alive=None, addr="127.0.0.1"):
self.poller = Poller()
self.frame = -1
self.updated = {s : False for s in services}
self.rcv_time = {s : 0. for s in services}
self.rcv_frame = {s : 0 for s in services}
self.alive = {s : False for s in services}
self.sock = {}
self.freq = {}
self.data = {}
self.logMonoTime = {}
self.valid = {}
if ignore_alive is not None:
self.ignore_alive = ignore_alive
else:
self.ignore_alive = []
for s in services:
if addr is not None:
self.sock[s] = sub_sock(s, poller=self.poller, addr=addr, conflate=True)
self.freq[s] = service_list[s].frequency
data = new_message()
if s in ['can', 'sensorEvents', 'liveTracks', 'sendCan',
'ethernetData', 'cellInfo', 'wifiScan',
'trafficEvents', 'orbObservation', 'carEvents']:
data.init(s, 0)
else:
data.init(s)
self.data[s] = getattr(data, s)
self.logMonoTime[s] = 0
self.valid[s] = data.valid
def __getitem__(self, s):
return self.data[s]
def update(self, timeout=1000):
msgs = []
for sock in self.poller.poll(timeout):
msgs.append(recv_one_or_none(sock))
self.update_msgs(sec_since_boot(), msgs)
def update_msgs(self, cur_time, msgs):
# TODO: add optional input that specify the service to wait for
self.frame += 1
self.updated = dict.fromkeys(self.updated, False)
for msg in msgs:
if msg is None:
continue
s = msg.which()
self.updated[s] = True
self.rcv_time[s] = cur_time
self.rcv_frame[s] = self.frame
self.data[s] = getattr(msg, s)
self.logMonoTime[s] = msg.logMonoTime
self.valid[s] = msg.valid
for s in self.data:
# arbitrary small number to avoid float comparison. If freq is 0, we can skip the check
if self.freq[s] > 1e-5:
# alive if delay is within 10x the expected frequency
self.alive[s] = (cur_time - self.rcv_time[s]) < (10. / self.freq[s])
else:
self.alive[s] = True
def all_alive(self, service_list=None):
if service_list is None: # check all
service_list = self.alive.keys()
return all(self.alive[s] for s in service_list if s not in self.ignore_alive)
def all_valid(self, service_list=None):
if service_list is None: # check all
service_list = self.valid.keys()
return all(self.valid[s] for s in service_list)
def all_alive_and_valid(self, service_list=None):
if service_list is None: # check all
service_list = self.alive.keys()
return self.all_alive(service_list=service_list) and self.all_valid(service_list=service_list)
class PubMaster():
def __init__(self, services):
self.sock = {}
for s in services:
self.sock[s] = pub_sock(s)
def send(self, s, dat):
# accept either bytes or capnp builder
if not isinstance(dat, bytes):
dat = dat.to_bytes()
self.sock[s].send(dat)

View File

@@ -0,0 +1,62 @@
#include <iostream>
#include <string>
#include <cassert>
#include <csignal>
#include <map>
#include "services.h"
#include "impl_msgq.hpp"
#include "impl_zmq.hpp"
void sigpipe_handler(int sig) {
assert(sig == SIGPIPE);
std::cout << "SIGPIPE received" << std::endl;
}
static std::vector<std::string> get_services() {
std::vector<std::string> name_list;
for (const auto& it : services) {
std::string name = it.name;
if (name == "plusFrame" || name == "uiLayoutState") continue;
name_list.push_back(name);
}
return name_list;
}
int main(void){
signal(SIGPIPE, (sighandler_t)sigpipe_handler);
auto endpoints = get_services();
std::map<SubSocket*, PubSocket*> sub2pub;
Context *zmq_context = new ZMQContext();
Context *msgq_context = new MSGQContext();
Poller *poller = new MSGQPoller();
for (auto endpoint: endpoints){
SubSocket * msgq_sock = new MSGQSubSocket();
msgq_sock->connect(msgq_context, endpoint, "127.0.0.1", false);
poller->registerSocket(msgq_sock);
PubSocket * zmq_sock = new ZMQPubSocket();
zmq_sock->connect(zmq_context, endpoint);
sub2pub[msgq_sock] = zmq_sock;
}
while (true){
for (auto sub_sock : poller->poll(100)){
Message * msg = sub_sock->receive();
if (msg == NULL) continue;
sub2pub[sub_sock]->sendMessage(msg);
delete msg;
}
}
return 0;
}

File diff suppressed because it is too large Load Diff

50
cereal/messaging/demo.cc Normal file
View File

@@ -0,0 +1,50 @@
#include <iostream>
#include <cstddef>
#include <chrono>
#include <thread>
#include <cassert>
#include "messaging.hpp"
#include "impl_zmq.hpp"
#define MSGS 1e5
int main() {
Context * c = Context::create();
SubSocket * sub_sock = SubSocket::create(c, "controlsState");
PubSocket * pub_sock = PubSocket::create(c, "controlsState");
char data[8];
Poller * poller = Poller::create({sub_sock});
auto start = std::chrono::steady_clock::now();
for (uint64_t i = 0; i < MSGS; i++){
*(uint64_t*)data = i;
pub_sock->send(data, 8);
auto r = poller->poll(100);
for (auto p : r){
Message * m = p->receive();
uint64_t ii = *(uint64_t*)m->getData();
assert(i == ii);
delete m;
}
}
auto end = std::chrono::steady_clock::now();
double elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count() / 1e9;
double throughput = ((double) MSGS / (double) elapsed);
std::cout << throughput << " msg/s" << std::endl;
delete poller;
delete sub_sock;
delete pub_sock;
delete c;
return 0;
}

30
cereal/messaging/demo.py Normal file
View File

@@ -0,0 +1,30 @@
import time
from messaging_pyx import Context, Poller, SubSocket, PubSocket # pylint: disable=no-name-in-module, import-error
MSGS = 1e5
if __name__ == "__main__":
c = Context()
sub_sock = SubSocket()
pub_sock = PubSocket()
sub_sock.connect(c, "controlsState")
pub_sock.connect(c, "controlsState")
poller = Poller()
poller.registerSocket(sub_sock)
t = time.time()
for i in range(int(MSGS)):
bts = i.to_bytes(4, 'little')
pub_sock.send(bts)
for s in poller.poll(100):
dat = s.receive()
ii = int.from_bytes(dat, 'little')
assert(i == ii)
dt = time.time() - t
print("%.1f msg/s" % (MSGS / dt))

View File

@@ -0,0 +1,190 @@
#include <cassert>
#include <cstring>
#include <iostream>
#include <cstdlib>
#include <csignal>
#include <cerrno>
#include "impl_msgq.hpp"
volatile sig_atomic_t msgq_do_exit = 0;
void sig_handler(int signal) {
assert(signal == SIGINT || signal == SIGTERM);
msgq_do_exit = 1;
}
MSGQContext::MSGQContext() {
}
MSGQContext::~MSGQContext() {
}
void MSGQMessage::init(size_t sz) {
size = sz;
data = new char[size];
}
void MSGQMessage::init(char * d, size_t sz) {
size = sz;
data = new char[size];
memcpy(data, d, size);
}
void MSGQMessage::takeOwnership(char * d, size_t sz) {
size = sz;
data = d;
}
void MSGQMessage::close() {
if (size > 0){
delete[] data;
}
size = 0;
}
MSGQMessage::~MSGQMessage() {
this->close();
}
int MSGQSubSocket::connect(Context *context, std::string endpoint, std::string address, bool conflate){
assert(context);
assert(address == "127.0.0.1");
q = new msgq_queue_t;
int r = msgq_new_queue(q, endpoint.c_str(), DEFAULT_SEGMENT_SIZE);
if (r != 0){
return r;
}
msgq_init_subscriber(q);
if (conflate){
q->read_conflate = true;
}
timeout = -1;
return 0;
}
Message * MSGQSubSocket::receive(bool non_blocking){
msgq_do_exit = 0;
void (*prev_handler_sigint)(int);
void (*prev_handler_sigterm)(int);
if (!non_blocking){
prev_handler_sigint = std::signal(SIGINT, sig_handler);
prev_handler_sigterm = std::signal(SIGTERM, sig_handler);
}
msgq_msg_t msg;
MSGQMessage *r = NULL;
r = NULL;
int rc = msgq_msg_recv(&msg, q);
// Hack to implement blocking read with a poller. Don't use this
while (!non_blocking && rc == 0 && msgq_do_exit == 0){
msgq_pollitem_t items[1];
items[0].q = q;
int t = (timeout != -1) ? timeout : 100;
int n = msgq_poll(items, 1, t);
rc = msgq_msg_recv(&msg, q);
// The poll indicated a message was ready, but the receive failed. Try again
if (n == 1 && rc == 0){
continue;
}
if (timeout != -1){
break;
}
}
if (rc > 0){
r = new MSGQMessage;
r->takeOwnership(msg.data, msg.size);
}
errno = msgq_do_exit ? EINTR : 0;
if (!non_blocking){
std::signal(SIGINT, prev_handler_sigint);
std::signal(SIGTERM, prev_handler_sigterm);
}
return (Message*)r;
}
void MSGQSubSocket::setTimeout(int t){
timeout = t;
}
MSGQSubSocket::~MSGQSubSocket(){
if (q != NULL){
msgq_close_queue(q);
delete q;
}
}
int MSGQPubSocket::connect(Context *context, std::string endpoint){
assert(context);
q = new msgq_queue_t;
msgq_new_queue(q, endpoint.c_str(), DEFAULT_SEGMENT_SIZE);
msgq_init_publisher(q);
return 0;
}
int MSGQPubSocket::sendMessage(Message *message){
msgq_msg_t msg;
msg.data = message->getData();
msg.size = message->getSize();
return msgq_msg_send(&msg, q);
}
int MSGQPubSocket::send(char *data, size_t size){
msgq_msg_t msg;
msg.data = data;
msg.size = size;
return msgq_msg_send(&msg, q);
}
MSGQPubSocket::~MSGQPubSocket(){
if (q != NULL){
msgq_close_queue(q);
delete q;
}
}
void MSGQPoller::registerSocket(SubSocket * socket){
assert(num_polls + 1 < MAX_POLLERS);
polls[num_polls].q = (msgq_queue_t*)socket->getRawSocket();
sockets.push_back(socket);
num_polls++;
}
std::vector<SubSocket*> MSGQPoller::poll(int timeout){
std::vector<SubSocket*> r;
msgq_poll(polls, num_polls, timeout);
for (size_t i = 0; i < num_polls; i++){
if (polls[i].revents){
r.push_back(sockets[i]);
}
}
return r;
}

View File

@@ -0,0 +1,64 @@
#pragma once
#include "messaging.hpp"
#include "msgq.hpp"
#include <zmq.h>
#include <string>
#define MAX_POLLERS 128
class MSGQContext : public Context {
private:
void * context = NULL;
public:
MSGQContext();
void * getRawContext() {return context;}
~MSGQContext();
};
class MSGQMessage : public Message {
private:
char * data;
size_t size;
public:
void init(size_t size);
void init(char *data, size_t size);
void takeOwnership(char *data, size_t size);
size_t getSize(){return size;}
char * getData(){return data;}
void close();
~MSGQMessage();
};
class MSGQSubSocket : public SubSocket {
private:
msgq_queue_t * q = NULL;
int timeout;
public:
int connect(Context *context, std::string endpoint, std::string address, bool conflate=false);
void setTimeout(int timeout);
void * getRawSocket() {return (void*)q;}
Message *receive(bool non_blocking=false);
~MSGQSubSocket();
};
class MSGQPubSocket : public PubSocket {
private:
msgq_queue_t * q = NULL;
public:
int connect(Context *context, std::string endpoint);
int sendMessage(Message *message);
int send(char *data, size_t size);
~MSGQPubSocket();
};
class MSGQPoller : public Poller {
private:
std::vector<SubSocket*> sockets;
msgq_pollitem_t polls[MAX_POLLERS];
size_t num_polls = 0;
public:
void registerSocket(SubSocket *socket);
std::vector<SubSocket*> poll(int timeout);
~MSGQPoller(){};
};

View File

@@ -0,0 +1,155 @@
#include <cassert>
#include <cstring>
#include <iostream>
#include <cstdlib>
#include <cerrno>
#include <zmq.h>
#include "services.h"
#include "impl_zmq.hpp"
static int get_port(std::string endpoint) {
int port = -1;
for (const auto& it : services) {
std::string name = it.name;
if (name == endpoint) {
port = it.port;
break;
}
}
assert(port >= 0);
return port;
}
ZMQContext::ZMQContext() {
context = zmq_ctx_new();
}
ZMQContext::~ZMQContext() {
zmq_ctx_term(context);
}
void ZMQMessage::init(size_t sz) {
size = sz;
data = new char[size];
}
void ZMQMessage::init(char * d, size_t sz) {
size = sz;
data = new char[size];
memcpy(data, d, size);
}
void ZMQMessage::close() {
if (size > 0){
delete[] data;
}
size = 0;
}
ZMQMessage::~ZMQMessage() {
this->close();
}
int ZMQSubSocket::connect(Context *context, std::string endpoint, std::string address, bool conflate){
sock = zmq_socket(context->getRawContext(), ZMQ_SUB);
if (sock == NULL){
return -1;
}
zmq_setsockopt(sock, ZMQ_SUBSCRIBE, "", 0);
if (conflate){
int arg = 1;
zmq_setsockopt(sock, ZMQ_CONFLATE, &arg, sizeof(int));
}
int reconnect_ivl = 500;
zmq_setsockopt(sock, ZMQ_RECONNECT_IVL_MAX, &reconnect_ivl, sizeof(reconnect_ivl));
full_endpoint = "tcp://" + address + ":";
full_endpoint += std::to_string(get_port(endpoint));
return zmq_connect(sock, full_endpoint.c_str());
}
Message * ZMQSubSocket::receive(bool non_blocking){
zmq_msg_t msg;
assert(zmq_msg_init(&msg) == 0);
int flags = non_blocking ? ZMQ_DONTWAIT : 0;
int rc = zmq_msg_recv(&msg, sock, flags);
Message *r = NULL;
if (rc >= 0){
// Make a copy to ensure the data is aligned
r = new ZMQMessage;
r->init((char*)zmq_msg_data(&msg), zmq_msg_size(&msg));
}
zmq_msg_close(&msg);
return r;
}
void ZMQSubSocket::setTimeout(int timeout){
zmq_setsockopt(sock, ZMQ_RCVTIMEO, &timeout, sizeof(int));
}
ZMQSubSocket::~ZMQSubSocket(){
zmq_close(sock);
}
int ZMQPubSocket::connect(Context *context, std::string endpoint){
sock = zmq_socket(context->getRawContext(), ZMQ_PUB);
if (sock == NULL){
return -1;
}
full_endpoint = "tcp://*:";
full_endpoint += std::to_string(get_port(endpoint));
return zmq_bind(sock, full_endpoint.c_str());
}
int ZMQPubSocket::sendMessage(Message *message){
return zmq_send(sock, message->getData(), message->getSize(), ZMQ_DONTWAIT);
}
int ZMQPubSocket::send(char *data, size_t size){
return zmq_send(sock, data, size, ZMQ_DONTWAIT);
}
ZMQPubSocket::~ZMQPubSocket(){
zmq_close(sock);
}
void ZMQPoller::registerSocket(SubSocket * socket){
assert(num_polls + 1 < MAX_POLLERS);
polls[num_polls].socket = socket->getRawSocket();
polls[num_polls].events = ZMQ_POLLIN;
sockets.push_back(socket);
num_polls++;
}
std::vector<SubSocket*> ZMQPoller::poll(int timeout){
std::vector<SubSocket*> r;
int rc = zmq_poll(polls, num_polls, timeout);
if (rc < 0){
return r;
}
for (size_t i = 0; i < num_polls; i++){
if (polls[i].revents){
r.push_back(sockets[i]);
}
}
return r;
}

View File

@@ -0,0 +1,63 @@
#pragma once
#include "messaging.hpp"
#include <zmq.h>
#include <string>
#define MAX_POLLERS 128
class ZMQContext : public Context {
private:
void * context = NULL;
public:
ZMQContext();
void * getRawContext() {return context;}
~ZMQContext();
};
class ZMQMessage : public Message {
private:
char * data;
size_t size;
public:
void init(size_t size);
void init(char *data, size_t size);
size_t getSize(){return size;}
char * getData(){return data;}
void close();
~ZMQMessage();
};
class ZMQSubSocket : public SubSocket {
private:
void * sock;
std::string full_endpoint;
public:
int connect(Context *context, std::string endpoint, std::string address, bool conflate=false);
void setTimeout(int timeout);
void * getRawSocket() {return sock;}
Message *receive(bool non_blocking=false);
~ZMQSubSocket();
};
class ZMQPubSocket : public PubSocket {
private:
void * sock;
std::string full_endpoint;
public:
int connect(Context *context, std::string endpoint);
int sendMessage(Message *message);
int send(char *data, size_t size);
~ZMQPubSocket();
};
class ZMQPoller : public Poller {
private:
std::vector<SubSocket*> sockets;
zmq_pollitem_t polls[MAX_POLLERS];
size_t num_polls = 0;
public:
void registerSocket(SubSocket *socket);
std::vector<SubSocket*> poll(int timeout);
~ZMQPoller(){};
};

View File

@@ -0,0 +1,117 @@
#include "messaging.hpp"
#include "impl_zmq.hpp"
#include "impl_msgq.hpp"
Context * Context::create(){
Context * c;
if (std::getenv("MSGQ")){
c = new MSGQContext();
} else {
c = new ZMQContext();
}
return c;
}
SubSocket * SubSocket::create(){
SubSocket * s;
if (std::getenv("MSGQ")){
s = new MSGQSubSocket();
} else {
s = new ZMQSubSocket();
}
return s;
}
SubSocket * SubSocket::create(Context * context, std::string endpoint){
SubSocket *s = SubSocket::create();
int r = s->connect(context, endpoint, "127.0.0.1");
if (r == 0) {
return s;
} else {
delete s;
return NULL;
}
}
SubSocket * SubSocket::create(Context * context, std::string endpoint, std::string address){
SubSocket *s = SubSocket::create();
int r = s->connect(context, endpoint, address);
if (r == 0) {
return s;
} else {
delete s;
return NULL;
}
}
SubSocket * SubSocket::create(Context * context, std::string endpoint, std::string address, bool conflate){
SubSocket *s = SubSocket::create();
int r = s->connect(context, endpoint, address, conflate);
if (r == 0) {
return s;
} else {
delete s;
return NULL;
}
}
PubSocket * PubSocket::create(){
PubSocket * s;
if (std::getenv("MSGQ")){
s = new MSGQPubSocket();
} else {
s = new ZMQPubSocket();
}
return s;
}
PubSocket * PubSocket::create(Context * context, std::string endpoint){
PubSocket *s = PubSocket::create();
int r = s->connect(context, endpoint);
if (r == 0) {
return s;
} else {
delete s;
return NULL;
}
}
Poller * Poller::create(){
Poller * p;
if (std::getenv("MSGQ")){
p = new MSGQPoller();
} else {
p = new ZMQPoller();
}
return p;
}
Poller * Poller::create(std::vector<SubSocket*> sockets){
Poller * p = Poller::create();
for (auto s : sockets){
p->registerSocket(s);
}
return p;
}
extern "C" Context * messaging_context_create() {
return Context::create();
}
extern "C" SubSocket * messaging_subsocket_create(Context* context, const char* endpoint) {
return SubSocket::create(context, std::string(endpoint));
}
extern "C" PubSocket * messaging_pubsocket_create(Context* context, const char* endpoint) {
return PubSocket::create(context, std::string(endpoint));
}
extern "C" Poller * messaging_poller_create(SubSocket** sockets, int size) {
std::vector<SubSocket*> socketsVec(sockets, sockets + size);
return Poller::create(socketsVec);
}

View File

@@ -0,0 +1,56 @@
#pragma once
#include <cstddef>
#include <vector>
#include <string>
#define MSG_MULTIPLE_PUBLISHERS 100
class Context {
public:
virtual void * getRawContext() = 0;
static Context * create();
virtual ~Context(){};
};
class Message {
public:
virtual void init(size_t size) = 0;
virtual void init(char * data, size_t size) = 0;
virtual void close() = 0;
virtual size_t getSize() = 0;
virtual char * getData() = 0;
virtual ~Message(){};
};
class SubSocket {
public:
virtual int connect(Context *context, std::string endpoint, std::string address, bool conflate=false) = 0;
virtual void setTimeout(int timeout) = 0;
virtual Message *receive(bool non_blocking=false) = 0;
virtual void * getRawSocket() = 0;
static SubSocket * create();
static SubSocket * create(Context * context, std::string endpoint);
static SubSocket * create(Context * context, std::string endpoint, std::string address);
static SubSocket * create(Context * context, std::string endpoint, std::string address, bool conflate);
virtual ~SubSocket(){};
};
class PubSocket {
public:
virtual int connect(Context *context, std::string endpoint) = 0;
virtual int sendMessage(Message *message) = 0;
virtual int send(char *data, size_t size) = 0;
static PubSocket * create();
static PubSocket * create(Context * context, std::string endpoint);
virtual ~PubSocket(){};
};
class Poller {
public:
virtual void registerSocket(SubSocket *socket) = 0;
virtual std::vector<SubSocket*> poll(int timeout) = 0;
static Poller * create();
static Poller * create(std::vector<SubSocket*> sockets);
virtual ~Poller(){};
};

View File

@@ -0,0 +1,39 @@
# distutils: language = c++
#cython: language_level=3
from libcpp.string cimport string
from libcpp.vector cimport vector
from libcpp cimport bool
cdef extern from "messaging.hpp":
cdef cppclass Context:
@staticmethod
Context * create()
cdef cppclass Message:
void init(size_t)
void init(char *, size_t)
void close()
size_t getSize()
char *getData()
cdef cppclass SubSocket:
@staticmethod
SubSocket * create()
int connect(Context *, string, string, bool)
Message * receive(bool)
void setTimeout(int)
cdef cppclass PubSocket:
@staticmethod
PubSocket * create()
int connect(Context *, string)
int sendMessage(Message *)
int send(char *, size_t)
cdef cppclass Poller:
@staticmethod
Poller * create()
void registerSocket(SubSocket *)
vector[SubSocket*] poll(int) nogil

View File

@@ -0,0 +1,151 @@
# distutils: language = c++
# cython: c_string_encoding=ascii, language_level=3
import sys
from libcpp.string cimport string
from libcpp cimport bool
from libc cimport errno
from messaging cimport Context as cppContext
from messaging cimport SubSocket as cppSubSocket
from messaging cimport PubSocket as cppPubSocket
from messaging cimport Poller as cppPoller
from messaging cimport Message as cppMessage
class MessagingError(Exception):
pass
class MultiplePublishersError(MessagingError):
pass
cdef class Context:
cdef cppContext * context
def __cinit__(self):
self.context = cppContext.create()
def term(self):
del self.context
self.context = NULL
def __dealloc__(self):
pass
# Deleting the context will hang if sockets are still active
# TODO: Figure out a way to make sure the context is closed last
# del self.context
cdef class Poller:
cdef cppPoller * poller
cdef list sub_sockets
def __cinit__(self):
self.sub_sockets = []
self.poller = cppPoller.create()
def __dealloc__(self):
del self.poller
def registerSocket(self, SubSocket socket):
self.sub_sockets.append(socket)
self.poller.registerSocket(socket.socket)
def poll(self, timeout):
sockets = []
cdef int t = timeout
with nogil:
result = self.poller.poll(t)
for s in result:
socket = SubSocket()
socket.setPtr(s)
sockets.append(socket)
return sockets
cdef class SubSocket:
cdef cppSubSocket * socket
cdef bool is_owner
def __cinit__(self):
self.socket = cppSubSocket.create()
self.is_owner = True
if self.socket == NULL:
raise MessagingError
def __dealloc__(self):
if self.is_owner:
del self.socket
cdef setPtr(self, cppSubSocket * ptr):
if self.is_owner:
del self.socket
self.is_owner = False
self.socket = ptr
def connect(self, Context context, string endpoint, string address=b"127.0.0.1", bool conflate=False):
r = self.socket.connect(context.context, endpoint, address, conflate)
if r != 0:
if errno.errno == errno.EADDRINUSE:
raise MultiplePublishersError
else:
raise MessagingError
def setTimeout(self, int timeout):
self.socket.setTimeout(timeout)
def receive(self, bool non_blocking=False):
msg = self.socket.receive(non_blocking)
if msg == NULL:
# If a blocking read returns no message check errno if SIGINT was caught in the C++ code
if errno.errno == errno.EINTR:
print("SIGINT received, exiting")
sys.exit(1)
return None
else:
sz = msg.getSize()
m = msg.getData()[:sz]
del msg
return m
cdef class PubSocket:
cdef cppPubSocket * socket
def __cinit__(self):
self.socket = cppPubSocket.create()
if self.socket == NULL:
raise MessagingError
def __dealloc__(self):
del self.socket
def connect(self, Context context, string endpoint):
r = self.socket.connect(context.context, endpoint)
if r != 0:
if errno.errno == errno.EADDRINUSE:
raise MultiplePublishersError
else:
raise MessagingError
def send(self, string data):
length = len(data)
r = self.socket.send(<char*>data.c_str(), length)
if r != length:
if errno.errno == errno.EADDRINUSE:
raise MultiplePublishersError
else:
raise MessagingError

View File

@@ -0,0 +1,56 @@
import os
import subprocess
import sysconfig
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module
from Cython.Build import cythonize
from Cython.Distutils import build_ext
def get_ext_filename_without_platform_suffix(filename):
name, ext = os.path.splitext(filename)
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
if ext_suffix == ext:
return filename
ext_suffix = ext_suffix.replace(ext, '')
idx = name.find(ext_suffix)
if idx == -1:
return filename
else:
return name[:idx] + ext
class BuildExtWithoutPlatformSuffix(build_ext):
def get_ext_filename(self, ext_name):
filename = super().get_ext_filename(ext_name)
return get_ext_filename_without_platform_suffix(filename)
sourcefiles = ['messaging_pyx.pyx']
extra_compile_args = ["-std=c++11"]
libraries = ['zmq']
ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pylint: disable=unexpected-keyword-arg
if ARCH == "aarch64":
extra_compile_args += ["-Wno-deprecated-register"]
libraries += ['gnustl_shared']
setup(name='CAN parser',
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
ext_modules=cythonize(
Extension(
"messaging_pyx",
language="c++",
sources=sourcefiles,
extra_compile_args=extra_compile_args,
libraries=libraries,
extra_objects=[
os.path.join(os.path.dirname(os.path.realpath(__file__)), '../', 'libmessaging.a'),
]
)
),
nthreads=4,
)

441
cereal/messaging/msgq.cc Normal file
View File

@@ -0,0 +1,441 @@
#include <iostream>
#include <cassert>
#include <cerrno>
#include <cmath>
#include <cstring>
#include <cstdint>
#include <chrono>
#include <algorithm>
#include <cstdlib>
#include <csignal>
#include <random>
#include <poll.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include "msgq.hpp"
void sigusr1_handler(int signal) {
assert(signal == SIGUSR1);
}
uint64_t msgq_get_uid(void){
std::random_device rd("/dev/urandom");
std::uniform_int_distribution<uint64_t> distribution(0,std::numeric_limits<uint32_t>::max());
uint64_t uid = distribution(rd) << 32 | syscall(SYS_gettid);
return uid;
}
int msgq_msg_init_size(msgq_msg_t * msg, size_t size){
msg->size = size;
msg->data = new(std::nothrow) char[size];
return (msg->data == NULL) ? -1 : 0;
}
int msgq_msg_init_data(msgq_msg_t * msg, char * data, size_t size) {
int r = msgq_msg_init_size(msg, size);
if (r == 0)
memcpy(msg->data, data, size);
return r;
}
int msgq_msg_close(msgq_msg_t * msg){
if (msg->size > 0)
delete[] msg->data;
msg->size = 0;
return 0;
}
void msgq_reset_reader(msgq_queue_t * q){
int id = q->reader_id;
q->read_valids[id]->store(true);
q->read_pointers[id]->store(*q->write_pointer);
}
void msgq_wait_for_subscriber(msgq_queue_t *q){
while (*q->num_readers == 0){
;
}
return;
}
int msgq_new_queue(msgq_queue_t * q, const char * path, size_t size){
assert(size < 0xFFFFFFFF); // Buffer must be smaller than 2^32 bytes
std::signal(SIGUSR1, sigusr1_handler);
const char * prefix = "/dev/shm/";
char * full_path = new char[strlen(path) + strlen(prefix) + 1];
strcpy(full_path, prefix);
strcat(full_path, path);
auto fd = open(full_path, O_RDWR | O_CREAT, 0777);
delete[] full_path;
if (fd < 0)
return -1;
int rc = ftruncate(fd, size + sizeof(msgq_header_t));
if (rc < 0)
return -1;
char * mem = (char*)mmap(NULL, size + sizeof(msgq_header_t), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
close(fd);
if (mem == NULL)
return -1;
q->mmap_p = mem;
msgq_header_t *header = (msgq_header_t *)mem;
// Setup pointers to header segment
q->num_readers = reinterpret_cast<std::atomic<uint64_t>*>(&header->num_readers);
q->write_pointer = reinterpret_cast<std::atomic<uint64_t>*>(&header->write_pointer);
q->write_uid = reinterpret_cast<std::atomic<uint64_t>*>(&header->write_uid);
for (size_t i = 0; i < NUM_READERS; i++){
q->read_pointers[i] = reinterpret_cast<std::atomic<uint64_t>*>(&header->read_pointers[i]);
q->read_valids[i] = reinterpret_cast<std::atomic<uint64_t>*>(&header->read_valids[i]);
q->read_uids[i] = reinterpret_cast<std::atomic<uint64_t>*>(&header->read_uids[i]);
}
q->data = mem + sizeof(msgq_header_t);
q->size = size;
q->reader_id = -1;
q->endpoint = path;
q->read_conflate = false;
return 0;
}
void msgq_close_queue(msgq_queue_t *q){
if (q->mmap_p != NULL){
munmap(q->mmap_p, q->size + sizeof(msgq_header_t));
}
}
void msgq_init_publisher(msgq_queue_t * q) {
std::cout << "Starting publisher" << std::endl;
uint64_t uid = msgq_get_uid();
*q->write_uid = uid;
*q->num_readers = 0;
for (size_t i = 0; i < NUM_READERS; i++){
*q->read_valids[i] = false;
*q->read_uids[i] = 0;
}
q->write_uid_local = uid;
}
void msgq_init_subscriber(msgq_queue_t * q) {
assert(q != NULL);
assert(q->num_readers != NULL);
uint64_t uid = msgq_get_uid();
// Get reader id
while (true){
uint64_t cur_num_readers = *q->num_readers;
uint64_t new_num_readers = cur_num_readers + 1;
// No more slots available. Reset all subscribers to kick out inactive ones
if (new_num_readers > NUM_READERS){
std::cout << "Warning, evicting all subscribers!" << std::endl;
*q->num_readers = 0;
for (size_t i = 0; i < NUM_READERS; i++){
*q->read_valids[i] = false;
uint64_t old_uid = *q->read_uids[i];
*q->read_uids[i] = 0;
// Wake up reader in case they are in a poll
syscall(SYS_tkill, old_uid & 0xFFFFFFFF, SIGUSR1);
}
continue;
}
// Use atomic compare and swap to handle race condition
// where two subscribers start at the same time
if (std::atomic_compare_exchange_strong(q->num_readers,
&cur_num_readers,
new_num_readers)){
q->reader_id = cur_num_readers;
q->read_uid_local = uid;
// We start with read_valid = false,
// on the first read the read pointer will be synchronized with the write pointer
*q->read_valids[cur_num_readers] = false;
*q->read_pointers[cur_num_readers] = 0;
*q->read_uids[cur_num_readers] = uid;
break;
}
}
std::cout << "New subscriber id: " << q->reader_id << " uid: " << q->read_uid_local << " " << q->endpoint << std::endl;
msgq_reset_reader(q);
}
int msgq_msg_send(msgq_msg_t * msg, msgq_queue_t *q){
// Die if we are no longer the active publisher
if (q->write_uid_local != *q->write_uid){
std::cout << "Killing old publisher: " << q->endpoint << std::endl;
errno = EADDRINUSE;
return -1;
}
uint64_t total_msg_size = ALIGN(msg->size + sizeof(int64_t));
// We need to fit at least three messages in the queue,
// then we can always safely access the last message
assert(3 * total_msg_size <= q->size);
uint64_t num_readers = *q->num_readers;
uint32_t write_cycles, write_pointer;
UNPACK64(write_cycles, write_pointer, *q->write_pointer);
char *p = q->data + write_pointer; // add base offset
// Check remaining space
// Always leave space for a wraparound tag for the next message, including alignment
int64_t remaining_space = q->size - write_pointer - total_msg_size - sizeof(int64_t);
if (remaining_space <= 0){
// Write -1 size tag indicating wraparound
*(int64_t*)p = -1;
// Invalidate all readers that are beyond the write pointer
// TODO: should we handle the case where a new reader shows up while this is running?
for (uint64_t i = 0; i < num_readers; i++){
uint64_t read_pointer = *q->read_pointers[i];
uint64_t read_cycles = read_pointer >> 32;
read_pointer &= 0xFFFFFFFF;
if ((read_pointer > write_pointer) && (read_cycles != write_cycles)) {
*q->read_valids[i] = false;
}
}
// Update global and local copies of write pointer and write_cycles
write_pointer = 0;
write_cycles = write_cycles + 1;
PACK64(*q->write_pointer, write_cycles, write_pointer);
// Set actual pointer to the beginning of the data segment
p = q->data;
}
// Invalidate readers that are in the area that will be written
uint64_t start = write_pointer;
uint64_t end = ALIGN(start + sizeof(int64_t) + msg->size);
for (uint64_t i = 0; i < num_readers; i++){
uint32_t read_cycles, read_pointer;
UNPACK64(read_cycles, read_pointer, *q->read_pointers[i]);
if ((read_pointer >= start) && (read_pointer < end) && (read_cycles != write_cycles)) {
*q->read_valids[i] = false;
}
}
// Write size tag
std::atomic<int64_t> *size_p = reinterpret_cast<std::atomic<int64_t>*>(p);
*size_p = msg->size;
// Copy data
memcpy(p + sizeof(int64_t), msg->data, msg->size);
__sync_synchronize();
// Update write pointer
uint32_t new_ptr = ALIGN(write_pointer + msg->size + sizeof(int64_t));
PACK64(*q->write_pointer, write_cycles, new_ptr);
// Notify readers
for (uint64_t i = 0; i < num_readers; i++){
uint64_t reader_uid = *q->read_uids[i];
syscall(SYS_tkill, reader_uid & 0xFFFFFFFF, SIGUSR1);
}
return msg->size;
}
int msgq_msg_ready(msgq_queue_t * q){
start:
int id = q->reader_id;
assert(id >= 0); // Make sure subscriber is initialized
if (q->read_uid_local != *q->read_uids[id]){
std::cout << q->endpoint << ": Reader was evicted, reconnecting" << std::endl;
msgq_init_subscriber(q);
goto start;
}
// Check valid
if (!*q->read_valids[id]){
msgq_reset_reader(q);
goto start;
}
uint32_t read_cycles, read_pointer;
UNPACK64(read_cycles, read_pointer, *q->read_pointers[id]);
uint32_t write_cycles, write_pointer;
UNPACK64(write_cycles, write_pointer, *q->write_pointer);
// Check if new message is available
return (read_pointer != write_pointer);
}
int msgq_msg_recv(msgq_msg_t * msg, msgq_queue_t * q){
start:
int id = q->reader_id;
assert(id >= 0); // Make sure subscriber is initialized
if (q->read_uid_local != *q->read_uids[id]){
std::cout << q->endpoint << ": Reader was evicted, reconnecting" << std::endl;
msgq_init_subscriber(q);
goto start;
}
// Check valid
if (!*q->read_valids[id]){
msgq_reset_reader(q);
goto start;
}
uint32_t read_cycles, read_pointer;
UNPACK64(read_cycles, read_pointer, *q->read_pointers[id]);
uint32_t write_cycles, write_pointer;
UNPACK64(write_cycles, write_pointer, *q->write_pointer);
char * p = q->data + read_pointer;
// Check if new message is available
if (read_pointer == write_pointer) {
msg->size = 0;
return 0;
}
// Read potential message size
std::atomic<int64_t> *size_p = reinterpret_cast<std::atomic<int64_t>*>(p);
std::int64_t size = *size_p;
// Check if the size that was read is valid
if (!*q->read_valids[id]){
msgq_reset_reader(q);
goto start;
}
// If size is -1 the buffer was full, and we need to wrap around
if (size == -1){
read_cycles++;
PACK64(*q->read_pointers[id], read_cycles, 0);
goto start;
}
// crashing is better than passing garbage data to the consumer
// the size will have weird value if it was overwritten by data accidentally
assert((uint64_t)size < q->size);
assert(size > 0);
uint32_t new_read_pointer = ALIGN(read_pointer + sizeof(std::int64_t) + size);
// If conflate is true, check if this is the latest message, else start over
if (q->read_conflate){
if (new_read_pointer != write_pointer){
// Update read pointer
PACK64(*q->read_pointers[id], read_cycles, new_read_pointer);
goto start;
}
}
// Copy message
if (msgq_msg_init_size(msg, size) < 0)
return -1;
__sync_synchronize();
memcpy(msg->data, p + sizeof(int64_t), size);
__sync_synchronize();
// Update read pointer
PACK64(*q->read_pointers[id], read_cycles, new_read_pointer);
// Check if the actual data that was copied is valid
if (!*q->read_valids[id]){
msgq_msg_close(msg);
msgq_reset_reader(q);
goto start;
}
return msg->size;
}
int msgq_poll(msgq_pollitem_t * items, size_t nitems, int timeout){
assert(timeout >= 0);
int num = 0;
// Check if messages ready
for (size_t i = 0; i < nitems; i++) {
items[i].revents = msgq_msg_ready(items[i].q);
if (items[i].revents) num++;
}
int ms = (timeout == -1) ? 100 : timeout;
struct timespec ts;
ts.tv_sec = ms / 1000;
ts.tv_nsec = (ms % 1000) * 1000 * 1000;
while (num == 0) {
int ret;
ret = nanosleep(&ts, &ts);
// Check if messages ready
for (size_t i = 0; i < nitems; i++) {
if (items[i].revents == 0 && msgq_msg_ready(items[i].q)){
num += 1;
items[i].revents = 1;
}
}
// exit if we had a timeout and the sleep finished
if (timeout != -1 && ret == 0){
break;
}
}
return num;
}

66
cereal/messaging/msgq.hpp Normal file
View File

@@ -0,0 +1,66 @@
#pragma once
#include <cstdint>
#include <cstring>
#include <string>
#include <atomic>
#define DEFAULT_SEGMENT_SIZE (10 * 1024 * 1024)
#define NUM_READERS 8
#define ALIGN(n) ((n + (8 - 1)) & -8)
#define UNPACK64(higher, lower, input) do {uint64_t tmp = input; higher = tmp >> 32; lower = tmp & 0xFFFFFFFF;} while (0)
#define PACK64(output, higher, lower) output = ((uint64_t)higher << 32 ) | ((uint64_t)lower & 0xFFFFFFFF)
struct msgq_header_t {
uint64_t num_readers;
uint64_t write_pointer;
uint64_t write_uid;
uint64_t read_pointers[NUM_READERS];
uint64_t read_valids[NUM_READERS];
uint64_t read_uids[NUM_READERS];
};
struct msgq_queue_t {
std::atomic<uint64_t> *num_readers;
std::atomic<uint64_t> *write_pointer;
std::atomic<uint64_t> *write_uid;
std::atomic<uint64_t> *read_pointers[NUM_READERS];
std::atomic<uint64_t> *read_valids[NUM_READERS];
std::atomic<uint64_t> *read_uids[NUM_READERS];
char * mmap_p;
char * data;
size_t size;
int reader_id;
uint64_t read_uid_local;
uint64_t write_uid_local;
bool read_conflate;
std::string endpoint;
};
struct msgq_msg_t {
size_t size;
char * data;
};
struct msgq_pollitem_t {
msgq_queue_t *q;
int revents;
};
void msgq_wait_for_subscriber(msgq_queue_t *q);
void msgq_reset_reader(msgq_queue_t *q);
int msgq_msg_init_size(msgq_msg_t *msg, size_t size);
int msgq_msg_init_data(msgq_msg_t *msg, char * data, size_t size);
int msgq_msg_close(msgq_msg_t *msg);
int msgq_new_queue(msgq_queue_t * q, const char * path, size_t size);
void msgq_close_queue(msgq_queue_t *q);
void msgq_init_publisher(msgq_queue_t * q);
void msgq_init_subscriber(msgq_queue_t * q);
int msgq_msg_send(msgq_msg_t *msg, msgq_queue_t *q);
int msgq_msg_recv(msgq_msg_t *msg, msgq_queue_t *q);
int msgq_msg_ready(msgq_queue_t * q);
int msgq_poll(msgq_pollitem_t * items, size_t nitems, int timeout);

56
cereal/messaging/msgq.md Normal file
View File

@@ -0,0 +1,56 @@
# MSGQ: A lock free single producer multi consumer message queue
[![Build Status](https://dev.azure.com/commaai/default/_apis/build/status/commaai.msgq?branchName=master)](https://dev.azure.com/commaai/default/_build/latest?definitionId=21&branchName=master)
## What is MSGQ?
MSGQ is a system to pass messages from a single producer to multiple consumers. All the consumers need to be able to receive all the messages. It is designed to be a high performance replacement for ZMQ-like SUB/PUB patterns. It uses a ring buffer in shared memory to efficiently read and write data. Each read requires a copy. Writing can be done without a copy, as long as the size of the data is known in advance.
## Storage
The storage for the queue consists of an area of metadata, and the actual buffer. The metadata contains:
1. A counter to the number of readers that are active
2. A pointer to the head of the queue for writing. From now on referred to as *write pointer*
3. A cycle counter for the writer. This counter is incremented when the writer wraps around
4. N pointers, pointing to the current read position for all the readers. From now on referred to as *read pointer*
5. N counters, counting the number of cycles for all the readers
6. N booleans, indicating validity for all the readers. From now on referred to as *validity flag*
The counter and the pointer are both 32 bit values, packed into 64 bit so they can be read and written atomically.
The data buffer is a ring buffer. All messages are prefixed by an 8 byte size field, followed by the data. A size of -1 indicates a wrap-around, and means the next message is stored at the beginning of the buffer.
## Writing
Writing involves the following steps:
1. Check if the area that is to be written overlaps with any of the read pointers, mark those readers as invalid by clearing the validity flag.
2. Write the message
3. Increase the write pointer by the size of the message
In case there is not enough space at the end of the buffer, a special empty message with a prefix of -1 is written. The cycle counter is incremented by one. In this case step 1 will check there are no read pointers pointing to the remainder of the buffer. Then another write cycle will start with the actual message.
There always needs to be 8 bytes of empty space at the end of the buffer. By doing this there is always space to write the -1.
## Reset reader
When the reader is lagging too much behind the read pointer becomes invalid and no longer points to the beginning of a valid message. To reset a reader to the current write pointer, the following steps are performed:
1. Set valid flag
2. Set read cycle counter to that of the writer
3. Set read pointer to write pointer
## Reading
Reading involves the following steps:
1. Read the size field at the current read pointer
2. Read the validity flag
3. Copy the data out of the buffer
4. Increase the read pointer by the size of the message
5. Check the validity flag again
Before starting the copy, the valid flag is checked. This is to prevent a race condition where the size prefix was invalid, and the read could read outside of the buffer. Make sure that step 1 and 2 are not reordered by your compiler or CPU.
If a writer overwrites the data while it's being copied out, the data will be invalid. Therefore the validity flag is also checked after reading it. The order of step 4 and 5 does not matter.
If at steps 2 or 5 the validity flag is not set, the reader is reset. Any data that was already read is discarded. After the reader is reset, the reading starts from the beginning.
If a message with size -1 is encountered, step 3 and 4 are replaced by increasing the cycle counter and setting the read pointer to the beginning of the buffer. After that another read is performed.

View File

@@ -0,0 +1,395 @@
#include "catch2/catch.hpp"
#include "msgq.hpp"
TEST_CASE("ALIGN"){
REQUIRE(ALIGN(0) == 0);
REQUIRE(ALIGN(1) == 8);
REQUIRE(ALIGN(7) == 8);
REQUIRE(ALIGN(8) == 8);
REQUIRE(ALIGN(99999) == 100000);
}
TEST_CASE("msgq_msg_init_size"){
const size_t msg_size = 30;
msgq_msg_t msg;
msgq_msg_init_size(&msg, msg_size);
REQUIRE(msg.size == msg_size);
msgq_msg_close(&msg);
}
TEST_CASE("msgq_msg_init_data"){
const size_t msg_size = 30;
char * data = new char[msg_size];
for (size_t i = 0; i < msg_size; i++){
data[i] = i;
}
msgq_msg_t msg;
msgq_msg_init_data(&msg, data, msg_size);
REQUIRE(msg.size == msg_size);
REQUIRE(memcmp(msg.data, data, msg_size) == 0);
delete[] data;
msgq_msg_close(&msg);
}
TEST_CASE("msgq_init_subscriber"){
remove("/dev/shm/test_queue");
msgq_queue_t q;
msgq_new_queue(&q, "test_queue", 1024);
REQUIRE(*q.num_readers == 0);
q.reader_id = 1;
*q.read_valids[0] = false;
*q.read_pointers[0] = ((uint64_t)1 << 32);
*q.write_pointer = 255;
msgq_init_subscriber(&q);
REQUIRE(q.read_conflate == false);
REQUIRE(*q.read_valids[0] == true);
REQUIRE((*q.read_pointers[0] >> 32) == 0);
REQUIRE((*q.read_pointers[0] & 0xFFFFFFFF) == 255);
}
TEST_CASE("msgq_msg_send first message"){
remove("/dev/shm/test_queue");
msgq_queue_t q;
msgq_new_queue(&q, "test_queue", 1024);
msgq_init_publisher(&q);
REQUIRE(*q.write_pointer == 0);
size_t msg_size = 128;
SECTION("Aligned message size"){
}
SECTION("Unaligned message size"){
msg_size--;
}
char * data = new char[msg_size];
for (size_t i = 0; i < msg_size; i++){
data[i] = i;
}
msgq_msg_t msg;
msgq_msg_init_data(&msg, data, msg_size);
msgq_msg_send(&msg, &q);
REQUIRE(*(int64_t*)q.data == msg_size); // Check size tag
REQUIRE(*q.write_pointer == 128 + sizeof(int64_t));
REQUIRE(memcmp(q.data + sizeof(int64_t), data, msg_size) == 0);
delete[] data;
msgq_msg_close(&msg);
}
TEST_CASE("msgq_msg_send test wraparound"){
remove("/dev/shm/test_queue");
msgq_queue_t q;
msgq_new_queue(&q, "test_queue", 1024);
msgq_init_publisher(&q);
REQUIRE((*q.write_pointer & 0xFFFFFFFF) == 0);
REQUIRE((*q.write_pointer >> 32) == 0);
const size_t msg_size = 120;
msgq_msg_t msg;
msgq_msg_init_size(&msg, msg_size);
for (int i = 0; i < 8; i++) {
msgq_msg_send(&msg, &q);
}
// Check 8th message was written at the beginning
REQUIRE((*q.write_pointer & 0xFFFFFFFF) == msg_size + sizeof(int64_t));
// Check cycle count
REQUIRE((*q.write_pointer >> 32) == 1);
// Check wraparound tag
char * tag_location = q.data;
tag_location += 7 * (msg_size + sizeof(int64_t));
REQUIRE(*(int64_t*)tag_location == -1);
msgq_msg_close(&msg);
}
TEST_CASE("msgq_msg_recv test wraparound"){
remove("/dev/shm/test_queue");
msgq_queue_t q_pub, q_sub;
msgq_new_queue(&q_pub, "test_queue", 1024);
msgq_new_queue(&q_sub, "test_queue", 1024);
msgq_init_publisher(&q_pub);
msgq_init_subscriber(&q_sub);
REQUIRE((*q_pub.write_pointer >> 32) == 0);
REQUIRE((*q_sub.read_pointers[0] >> 32) == 0);
const size_t msg_size = 120;
msgq_msg_t msg1;
msgq_msg_init_size(&msg1, msg_size);
SECTION("Check cycle counter after reset") {
for (int i = 0; i < 8; i++) {
msgq_msg_send(&msg1, &q_pub);
}
msgq_msg_t msg2;
msgq_msg_recv(&msg2, &q_sub);
REQUIRE(msg2.size == 0); // Reader had to reset
msgq_msg_close(&msg2);
}
SECTION("Check cycle counter while keeping up with writer") {
for (int i = 0; i < 8; i++) {
msgq_msg_send(&msg1, &q_pub);
msgq_msg_t msg2;
msgq_msg_recv(&msg2, &q_sub);
REQUIRE(msg2.size > 0);
msgq_msg_close(&msg2);
}
}
REQUIRE((*q_sub.read_pointers[0] >> 32) == 1);
msgq_msg_close(&msg1);
}
TEST_CASE("msgq_msg_send test invalidation"){
remove("/dev/shm/test_queue");
msgq_queue_t q_pub, q_sub;
msgq_new_queue(&q_pub, "test_queue", 1024);
msgq_new_queue(&q_sub, "test_queue", 1024);
msgq_init_publisher(&q_pub);
msgq_init_subscriber(&q_sub);
*q_sub.write_pointer = (uint64_t)1 << 32;
REQUIRE(*q_sub.read_valids[0] == true);
SECTION("read pointer in tag"){
*q_sub.read_pointers[0] = 0;
}
SECTION("read pointer in data section"){
*q_sub.read_pointers[0] = 64;
}
SECTION("read pointer in wraparound section"){
*q_pub.write_pointer = ((uint64_t)1 << 32) | 1000; // Writer is one cycle ahead
*q_sub.read_pointers[0] = 1020;
}
msgq_msg_t msg;
msgq_msg_init_size(&msg, 128);
msgq_msg_send(&msg, &q_pub);
REQUIRE(*q_sub.read_valids[0] == false);
msgq_msg_close(&msg);
}
TEST_CASE("msgq_init_subscriber init 2 subscribers"){
remove("/dev/shm/test_queue");
msgq_queue_t q1, q2;
msgq_new_queue(&q1, "test_queue", 1024);
msgq_new_queue(&q2, "test_queue", 1024);
*q1.num_readers = 0;
REQUIRE(*q1.num_readers == 0);
REQUIRE(*q2.num_readers == 0);
msgq_init_subscriber(&q1);
REQUIRE(*q1.num_readers == 1);
REQUIRE(*q2.num_readers == 1);
REQUIRE(q1.reader_id == 0);
msgq_init_subscriber(&q2);
REQUIRE(*q1.num_readers == 2);
REQUIRE(*q2.num_readers == 2);
REQUIRE(q2.reader_id == 1);
}
TEST_CASE("Write 1 msg, read 1 msg", "[integration]"){
remove("/dev/shm/test_queue");
const size_t msg_size = 128;
msgq_queue_t writer, reader;
msgq_new_queue(&writer, "test_queue", 1024);
msgq_new_queue(&reader, "test_queue", 1024);
msgq_init_publisher(&writer);
msgq_init_subscriber(&reader);
// Build 128 byte message
msgq_msg_t outgoing_msg;
msgq_msg_init_size(&outgoing_msg, msg_size);
for (size_t i = 0; i < msg_size; i++){
outgoing_msg.data[i] = i;
}
REQUIRE(msgq_msg_send(&outgoing_msg, &writer) == msg_size);
msgq_msg_t incoming_msg1;
REQUIRE(msgq_msg_recv(&incoming_msg1, &reader) == msg_size);
REQUIRE(memcmp(incoming_msg1.data, outgoing_msg.data, msg_size) == 0);
// Verify that there are no more messages
msgq_msg_t incoming_msg2;
REQUIRE(msgq_msg_recv(&incoming_msg2, &reader) == 0);
msgq_msg_close(&outgoing_msg);
msgq_msg_close(&incoming_msg1);
msgq_msg_close(&incoming_msg2);
}
TEST_CASE("Write 2 msg, read 2 msg - conflate = false", "[integration]"){
remove("/dev/shm/test_queue");
const size_t msg_size = 128;
msgq_queue_t writer, reader;
msgq_new_queue(&writer, "test_queue", 1024);
msgq_new_queue(&reader, "test_queue", 1024);
msgq_init_publisher(&writer);
msgq_init_subscriber(&reader);
// Build 128 byte message
msgq_msg_t outgoing_msg;
msgq_msg_init_size(&outgoing_msg, msg_size);
for (size_t i = 0; i < msg_size; i++){
outgoing_msg.data[i] = i;
}
REQUIRE(msgq_msg_send(&outgoing_msg, &writer) == msg_size);
REQUIRE(msgq_msg_send(&outgoing_msg, &writer) == msg_size);
msgq_msg_t incoming_msg1;
REQUIRE(msgq_msg_recv(&incoming_msg1, &reader) == msg_size);
REQUIRE(memcmp(incoming_msg1.data, outgoing_msg.data, msg_size) == 0);
msgq_msg_t incoming_msg2;
REQUIRE(msgq_msg_recv(&incoming_msg2, &reader) == msg_size);
REQUIRE(memcmp(incoming_msg2.data, outgoing_msg.data, msg_size) == 0);
msgq_msg_close(&outgoing_msg);
msgq_msg_close(&incoming_msg1);
msgq_msg_close(&incoming_msg2);
}
TEST_CASE("Write 2 msg, read 2 msg - conflate = true", "[integration]"){
remove("/dev/shm/test_queue");
const size_t msg_size = 128;
msgq_queue_t writer, reader;
msgq_new_queue(&writer, "test_queue", 1024);
msgq_new_queue(&reader, "test_queue", 1024);
msgq_init_publisher(&writer);
msgq_init_subscriber(&reader);
reader.read_conflate = true;
// Build 128 byte message
msgq_msg_t outgoing_msg;
msgq_msg_init_size(&outgoing_msg, msg_size);
for (size_t i = 0; i < msg_size; i++){
outgoing_msg.data[i] = i;
}
REQUIRE(msgq_msg_send(&outgoing_msg, &writer) == msg_size);
REQUIRE(msgq_msg_send(&outgoing_msg, &writer) == msg_size);
msgq_msg_t incoming_msg1;
REQUIRE(msgq_msg_recv(&incoming_msg1, &reader) == msg_size);
REQUIRE(memcmp(incoming_msg1.data, outgoing_msg.data, msg_size) == 0);
// Verify that there are no more messages
msgq_msg_t incoming_msg2;
REQUIRE(msgq_msg_recv(&incoming_msg2, &reader) == 0);
msgq_msg_close(&outgoing_msg);
msgq_msg_close(&incoming_msg1);
msgq_msg_close(&incoming_msg2);
}
TEST_CASE("1 publisher, 1 slow subscriber", "[integration]"){
remove("/dev/shm/test_queue");
msgq_queue_t writer, reader;
msgq_new_queue(&writer, "test_queue", 1024);
msgq_new_queue(&reader, "test_queue", 1024);
msgq_init_publisher(&writer);
msgq_init_subscriber(&reader);
int n_received = 0;
int n_skipped = 0;
for (uint64_t i = 0; i < 1e5; i++) {
msgq_msg_t outgoing_msg;
msgq_msg_init_data(&outgoing_msg, (char*)&i, sizeof(uint64_t));
msgq_msg_send(&outgoing_msg, &writer);
msgq_msg_close(&outgoing_msg);
if (i % 10 == 0){
msgq_msg_t msg1;
msgq_msg_recv(&msg1, &reader);
if (msg1.size == 0){
n_skipped++;
} else {
n_received++;
}
msgq_msg_close(&msg1);
}
}
// TODO: verify these numbers by hand
REQUIRE(n_received == 8572);
REQUIRE(n_skipped == 1428);
}
TEST_CASE("1 publisher, 2 subscribers", "[integration]"){
remove("/dev/shm/test_queue");
msgq_queue_t writer, reader1, reader2;
msgq_new_queue(&writer, "test_queue", 1024);
msgq_new_queue(&reader1, "test_queue", 1024);
msgq_new_queue(&reader2, "test_queue", 1024);
msgq_init_publisher(&writer);
msgq_init_subscriber(&reader1);
msgq_init_subscriber(&reader2);
for (uint64_t i = 0; i < 1024 * 3; i++) {
msgq_msg_t outgoing_msg;
msgq_msg_init_data(&outgoing_msg, (char*)&i, sizeof(uint64_t));
msgq_msg_send(&outgoing_msg, &writer);
msgq_msg_t msg1, msg2;
msgq_msg_recv(&msg1, &reader1);
msgq_msg_recv(&msg2, &reader2);
REQUIRE(msg1.size == sizeof(uint64_t));
REQUIRE(msg2.size == sizeof(uint64_t));
REQUIRE(*(uint64_t*)msg1.data == i);
REQUIRE(*(uint64_t*)msg2.data == i);
msgq_msg_close(&outgoing_msg);
msgq_msg_close(&msg1);
msgq_msg_close(&msg2);
}
}

View File

@@ -0,0 +1,14 @@
from messaging_pyx import Context, SubSocket, PubSocket # pylint: disable=no-name-in-module, import-error
if __name__ == "__main__":
c = Context()
pub_sock = PubSocket()
pub_sock.connect(c, "controlsState")
for i in range(int(1e10)):
print(i)
sub_sock = SubSocket()
sub_sock.connect(c, "controlsState")
pub_sock.send(b'a')
print(sub_sock.receive())

View File

@@ -0,0 +1,2 @@
#define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp"

View File

@@ -0,0 +1,142 @@
import unittest
import time
import cereal.messaging as messaging
import concurrent.futures
def poller():
context = messaging.Context()
p = messaging.Poller()
sub = messaging.SubSocket()
sub.connect(context, 'controlsState')
p.registerSocket(sub)
socks = p.poll(10000)
r = [s.receive(non_blocking=True) for s in socks]
return r
class TestPoller(unittest.TestCase):
def test_poll_once(self):
context = messaging.Context()
pub = messaging.PubSocket()
pub.connect(context, 'controlsState')
with concurrent.futures.ThreadPoolExecutor() as e:
poll = e.submit(poller)
time.sleep(0.1) # Slow joiner syndrome
# Send message
pub.send("a")
# Wait for poll result
result = poll.result()
del pub
context.term()
self.assertEqual(result, [b"a"])
def test_poll_and_create_many_subscribers(self):
context = messaging.Context()
pub = messaging.PubSocket()
pub.connect(context, 'controlsState')
with concurrent.futures.ThreadPoolExecutor() as e:
poll = e.submit(poller)
time.sleep(0.1) # Slow joiner syndrome
c = messaging.Context()
for _ in range(10):
messaging.SubSocket().connect(c, 'controlsState')
time.sleep(0.1)
# Send message
pub.send("a")
# Wait for poll result
result = poll.result()
del pub
context.term()
self.assertEqual(result, [b"a"])
def test_multiple_publishers_exception(self):
context = messaging.Context()
with self.assertRaises(messaging.MultiplePublishersError):
pub1 = messaging.PubSocket()
pub1.connect(context, 'controlsState')
pub2 = messaging.PubSocket()
pub2.connect(context, 'controlsState')
pub1.send("a")
del pub1
del pub2
context.term()
def test_multiple_messages(self):
context = messaging.Context()
pub = messaging.PubSocket()
pub.connect(context, 'controlsState')
sub = messaging.SubSocket()
sub.connect(context, 'controlsState')
time.sleep(0.1) # Slow joiner
for i in range(100):
pub.send(str(i))
msg_seen = False
i = 0
while True:
r = sub.receive(non_blocking=True)
if r is not None:
self.assertEqual(str(i), r.decode('utf8'))
msg_seen = True
i += 1
if r is None and msg_seen: # ZMQ sometimes receives nothing on the first receive
break
del pub
del sub
context.term()
def test_conflate(self):
context = messaging.Context()
pub = messaging.PubSocket()
pub.connect(context, 'controlsState')
sub = messaging.SubSocket()
sub.connect(context, 'controlsState', conflate=True)
time.sleep(0.1) # Slow joiner
pub.send('a')
pub.send('b')
self.assertEqual(b'b', sub.receive())
del pub
del sub
context.term()
if __name__ == "__main__":
unittest.main()

163
cereal/service_list.yaml Normal file
View File

@@ -0,0 +1,163 @@
# TODO: these port numbers are hardcoded in c, fix this
# LogRotate: 8001 is a PUSH PULL socket between loggerd and visiond
# all ZMQ pub sub: port, should_log, frequency, (qlog_decimation)
# frame syncing packet
frame: [8002, true, 20., 1]
# accel, gyro, and compass
sensorEvents: [8003, true, 100., 100]
# GPS data, also global timestamp
gpsNMEA: [8004, true, 9.] # 9 msgs each sec
# CPU+MEM+GPU+BAT temps
thermal: [8005, true, 2., 1]
# List(CanData), list of can messages
can: [8006, true, 100.]
controlsState: [8007, true, 100., 100]
#liveEvent: [8008, true, 0.]
model: [8009, true, 20., 5]
features: [8010, true, 0.]
health: [8011, true, 2., 1]
radarState: [8012, true, 20.]
#liveUI: [8014, true, 0.]
encodeIdx: [8015, true, 20.]
liveTracks: [8016, true, 20.]
sendcan: [8017, true, 100.]
logMessage: [8018, true, 0.]
liveCalibration: [8019, true, 5.]
androidLog: [8020, true, 0.]
carState: [8021, true, 100., 10]
# 8022 is reserved for sshd
carControl: [8023, true, 100., 10]
plan: [8024, true, 20.]
liveLocation: [8025, true, 0.]
gpsLocation: [8026, true, 1., 1]
ethernetData: [8027, true, 0.]
navUpdate: [8028, true, 0.]
qcomGnss: [8029, true, 0.]
lidarPts: [8030, true, 0.]
procLog: [8031, true, 0.5]
gpsLocationExternal: [8032, true, 10., 1]
ubloxGnss: [8033, true, 10.]
clocks: [8034, true, 1., 1]
liveMpc: [8035, false, 20.]
liveLongitudinalMpc: [8036, false, 20.]
navStatus: [8038, true, 0.]
gpsLocationTrimble: [8039, true, 0.]
trimbleGnss: [8041, true, 0.]
ubloxRaw: [8042, true, 20.]
gpsPlannerPoints: [8043, true, 0.]
gpsPlannerPlan: [8044, true, 0.]
applanixRaw: [8046, true, 0.]
orbLocation: [8047, true, 0.]
trafficEvents: [8048, true, 0.]
liveLocationTiming: [8049, true, 0.]
orbslamCorrection: [8050, true, 0.]
liveLocationCorrected: [8051, true, 0.]
orbObservation: [8052, true, 0.]
applanixLocation: [8053, true, 0.]
liveLocationKalman: [8054, true, 0.]
uiNavigationEvent: [8055, true, 0.]
orbOdometry: [8057, true, 0.]
orbFeatures: [8058, false, 0.]
orbKeyFrame: [8059, true, 0.]
uiLayoutState: [8060, true, 0.]
frontEncodeIdx: [8061, true, 5.]
orbFeaturesSummary: [8062, true, 0.]
driverMonitoring: [8063, true, 5., 1]
liveParameters: [8064, true, 10.]
liveMapData: [8065, true, 0.]
cameraOdometry: [8066, true, 5.]
pathPlan: [8067, true, 20.]
kalmanOdometry: [8068, true, 0.]
thumbnail: [8069, true, 0.2, 1]
carEvents: [8070, true, 1., 1]
carParams: [8071, true, 0.02, 1]
frontFrame: [8072, true, 10.]
testModel: [8040, false, 0.]
testLiveLocation: [8045, false, 0.]
testJoystick: [8056, false, 0.]
# 8080 is reserved for slave testing daemon
# 8762 is reserved for logserver
# manager -- base process to manage starting and stopping of all others
# subscribes: thermal
# **** processes that communicate with the outside world ****
# thermald -- decides when to start and stop onroad
# subscribes: health, location
# publishes: thermal
# boardd -- communicates with the car
# subscribes: sendcan
# publishes: can, health, ubloxRaw
# sensord -- publishes IMU and Magnetometer
# publishes: sensorEvents
# gpsd -- publishes EON's gps
# publishes: gpsNMEA
# visiond -- talks to the cameras, runs the model, saves the videos
# publishes: frame, model, driverMonitoring, cameraOdometry, thumbnail
# **** stateful data transformers ****
# plannerd -- decides where to drive the car
# subscribes: carState, model, radarState, controlsState, liveParameters
# publishes: plan, pathPlan, liveMpc, liveLongitudinalMpc
# controlsd -- drives the car by sending CAN messages to panda
# subscribes: can, thermal, health, plan, pathPlan, driverMonitoring, liveCalibration
# publishes: carState, carControl, sendcan, controlsState, carEvents, carParams
# radard -- processes the radar and vision data
# subscribes: can, controlsState, model, liveParameters
# publishes: radarState, liveTracks
# params_learner -- learns vehicle params by observing the vehicle dynamics
# subscribes: controlsState, sensorEvents, cameraOdometry
# publishes: liveParameters
# calibrationd -- reads posenet and applies a temporal filter on the frame region to look at
# subscribes: cameraOdometry
# publishes: liveCalibration
# ubloxd -- read raw ublox data and converts them in readable format
# subscribes: ubloxRaw
# publishes: ubloxGnss
# **** LOGGING SERVICE ****
# loggerd
# subscribes: EVERYTHING
# **** NON VITAL SERVICES ****
# ui
# subscribes: thermal, model, controlsState, uiLayout, liveCalibration, radarState, liveMpc, plusFrame, liveMapData
# uploader
# communicates through file system with loggerd
# deleter
# communicates through file system with loggerd and uploader
# logmessaged -- central logging service, can log to cloud
# publishes: logMessage
# logcatd -- fetches logcat info from android
# publishes: androidLog
# proclogd -- fetches process information
# publishes: procLog
# tombstoned -- reports native crashes
# athenad -- on request, open a sub socket and return the value
# updated -- waits for network access and tries to update every hour

33
cereal/services.py Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env python3
import os
import yaml
class Service():
def __init__(self, port, should_log, frequency, decimation=None):
self.port = port
self.should_log = should_log
self.frequency = frequency
self.decimation = decimation
service_list_path = os.path.join(os.path.dirname(__file__), "service_list.yaml")
service_list = {}
with open(service_list_path, "r") as f:
for k, v in yaml.safe_load(f).items():
decimation = None
if len(v) == 4:
decimation = v[3]
service_list[k] = Service(v[0], v[1], v[2], decimation)
if __name__ == "__main__":
print("/* THIS IS AN AUTOGENERATED FILE, PLEASE EDIT service_list.yaml */")
print("#ifndef __SERVICES_H")
print("#define __SERVICES_H")
print("struct service { int port; bool should_log; int frequency; int decimation; char name[0x100]; };")
print("static struct service services[] = {")
for k, v in service_list.items():
print(' { .name = "%s", .port = %d, .should_log = %s, .frequency = %d, .decimation = %d },' % (k, v.port, "true" if v.should_log else "false", v.frequency, -1 if v.decimation is None else v.decimation))
print("};")
print("#endif")

12
check_code_quality.sh Normal file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
# Only pyflakes checks (--select=F)
flake8 --select=F $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda")
RESULT=$?
if [ $RESULT -eq 0 ]; then
pylint $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda")
RESULT=$? & 3
fi
[ $RESULT -ne 0 ] && exit 1
exit 0

1
common/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.cpp

6
common/SConscript Normal file
View File

@@ -0,0 +1,6 @@
Import('env')
# parser
env.Command(['common_pyx.so'],
['common_pyx_setup.py', 'clock.pyx'],
"cd common && python3 common_pyx_setup.py build_ext --inplace")

73
common/android.py Normal file
View File

@@ -0,0 +1,73 @@
import binascii
import itertools
import re
import struct
import subprocess
def getprop(key):
return subprocess.check_output(["getprop", key], encoding='utf8').strip()
def get_imei():
ret = getprop("oem.device.imeicache")
if ret == "":
ret = "000000000000000"
return ret
def get_serial():
return getprop("ro.serialno")
def get_subscriber_info():
ret = parse_service_call_string(["iphonesubinfo", "7"])
if ret is None or len(ret) < 8:
return ""
return ret
def reboot(reason=None):
if reason is None:
reason_args = ["null"]
else:
reason_args = ["s16", reason]
subprocess.check_output([
"service", "call", "power", "16", # IPowerManager.reboot
"i32", "0", # no confirmation,
*reason_args,
"i32", "1" # wait
])
def parse_service_call_unpack(call, fmt):
r = parse_service_call_bytes(call)
try:
return struct.unpack(fmt, r)[0]
except Exception:
return None
def parse_service_call_string(call):
r = parse_service_call_bytes(call)
try:
r = r[8:] # Cut off length field
r = r.decode('utf_16_be')
# All pairs of two characters seem to be swapped. Not sure why
result = ""
for a, b, in itertools.zip_longest(r[::2], r[1::2], fillvalue='\x00'):
result += b + a
result = result.replace('\x00', '')
return result
except Exception:
return None
def parse_service_call_bytes(call):
ret = subprocess.check_output(["service", "call", *call], encoding='utf8').strip()
if 'Parcel' not in ret:
return None
try:
r = b""
for hex_part in re.findall(r'[ (]([0-9a-f]{8})', ret):
r += binascii.unhexlify(hex_part)
return r
except Exception:
return None

42
common/api/__init__.py Normal file
View File

@@ -0,0 +1,42 @@
import jwt
import requests
from datetime import datetime, timedelta
from selfdrive.version import version
class Api():
def __init__(self, dongle_id):
self.dongle_id = dongle_id
with open('/persist/comma/id_rsa') as f:
self.private_key = f.read()
def get(self, *args, **kwargs):
return self.request('GET', *args, **kwargs)
def post(self, *args, **kwargs):
return self.request('POST', *args, **kwargs)
def request(self, method, endpoint, timeout=None, access_token=None, **params):
return api_get(endpoint, method=method, timeout=timeout, access_token=access_token, **params)
def get_token(self):
now = datetime.utcnow()
payload = {
'identity': self.dongle_id,
'nbf': now,
'iat': now,
'exp': now + timedelta(hours=1)
}
return jwt.encode(payload, self.private_key, algorithm='RS256').decode('utf8')
def api_get(endpoint, method='GET', timeout=None, access_token=None, **params):
backend = "https://api.commadotai.com/"
headers = {}
if access_token is not None:
headers['Authorization'] = "JWT "+access_token
headers['User-Agent'] = "openpilot-" + version
return requests.request(method, backend+endpoint, timeout=timeout, headers = headers, params=params)

98
common/apk.py Normal file
View File

@@ -0,0 +1,98 @@
import os
import subprocess
import glob
import hashlib
import shutil
from common.basedir import BASEDIR
from selfdrive.swaglog import cloudlog
android_packages = ("tw.com.ainvest.outpack", "cn.dragonpilot.gpsservice", "com.autonavi.amapauto", "com.mixplorer", "com.tomtom.speedcams.android.map", "ai.comma.plus.offroad", "ai.comma.plus.frame")
def get_installed_apks():
dat = subprocess.check_output(["pm", "list", "packages", "-f"], encoding='utf8').strip().split("\n")
ret = {}
for x in dat:
if x.startswith("package:"):
v,k = x.split("package:")[1].split("=")
ret[k] = v
return ret
def install_apk(path):
# can only install from world readable path
install_path = "/sdcard/%s" % os.path.basename(path)
shutil.copyfile(path, install_path)
ret = subprocess.call(["pm", "install", "-r", install_path])
os.remove(install_path)
return ret == 0
def start_frame():
set_package_permissions()
system("am start -n ai.comma.plus.frame/.MainActivity")
def set_package_permissions():
pm_grant("ai.comma.plus.offroad", "android.permission.ACCESS_FINE_LOCATION")
appops_set("ai.comma.plus.offroad", "SU", "allow")
appops_set("ai.comma.plus.offroad", "WIFI_SCAN", "allow")
appops_set("ai.comma.plus.offroad", "READ_EXTERNAL_STORAGE", "allow")
appops_set("ai.comma.plus.offroad", "WRITE_EXTERNAL_STORAGE", "allow")
def appops_set(package, op, mode):
system(f"LD_LIBRARY_PATH= appops set {package} {op} {mode}")
def pm_grant(package, permission):
system(f"pm grant {package} {permission}")
def system(cmd):
try:
cloudlog.info("running %s" % cmd)
subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError as e:
cloudlog.event("running failed",
cmd=e.cmd,
output=e.output[-1024:],
returncode=e.returncode)
# *** external functions ***
def update_apks():
# install apks
installed = get_installed_apks()
install_apks = glob.glob(os.path.join(BASEDIR, "apk/*.apk"))
for apk in install_apks:
app = os.path.basename(apk)[:-4]
if app not in installed:
installed[app] = None
cloudlog.info("installed apks %s" % (str(installed), ))
for app in installed.keys():
apk_path = os.path.join(BASEDIR, "apk/"+app+".apk")
if not os.path.exists(apk_path):
continue
h1 = hashlib.sha1(open(apk_path, 'rb').read()).hexdigest()
h2 = None
if installed[app] is not None:
h2 = hashlib.sha1(open(installed[app], 'rb').read()).hexdigest()
cloudlog.info("comparing version of %s %s vs %s" % (app, h1, h2))
if h2 is None or h1 != h2:
cloudlog.info("installing %s" % app)
success = install_apk(apk_path)
if not success:
cloudlog.info("needing to uninstall %s" % app)
system("pm uninstall %s" % app)
success = install_apk(apk_path)
assert success
def pm_apply_packages(cmd):
for p in android_packages:
system("pm %s %s" % (cmd, p))
if __name__ == "__main__":
update_apks()

4
common/basedir.py Normal file
View File

@@ -0,0 +1,4 @@
import os
BASEDIR = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../"))

16
common/clock.pyx Normal file
View File

@@ -0,0 +1,16 @@
from posix.time cimport clock_gettime, timespec, CLOCK_BOOTTIME, CLOCK_MONOTONIC_RAW
cdef double readclock(int clock_id):
cdef timespec ts
cdef double current
clock_gettime(clock_id, &ts)
current = ts.tv_sec + (ts.tv_nsec / 1000000000.)
return current
def monotonic_time():
return readclock(CLOCK_MONOTONIC_RAW)
def sec_since_boot():
return readclock(CLOCK_BOOTTIME)

View File

@@ -0,0 +1,20 @@
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module
from Cython.Build import cythonize
from common.cython_hacks import BuildExtWithoutPlatformSuffix
sourcefiles = ['clock.pyx']
extra_compile_args = ["-std=c++11"]
setup(name='Common',
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
ext_modules=cythonize(
Extension(
"common_pyx",
language="c++",
sources=sourcefiles,
extra_compile_args=extra_compile_args,
)
),
nthreads=4,
)

23
common/cython_hacks.py Normal file
View File

@@ -0,0 +1,23 @@
import os
import sysconfig
from Cython.Distutils import build_ext
def get_ext_filename_without_platform_suffix(filename):
name, ext = os.path.splitext(filename)
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
if ext_suffix == ext:
return filename
ext_suffix = ext_suffix.replace(ext, '')
idx = name.find(ext_suffix)
if idx == -1:
return filename
else:
return name[:idx] + ext
class BuildExtWithoutPlatformSuffix(build_ext):
def get_ext_filename(self, ext_name):
filename = super().get_ext_filename(ext_name)
return get_ext_filename_without_platform_suffix(filename)

49
common/ffi_wrapper.py Normal file
View File

@@ -0,0 +1,49 @@
import os
import sys
import fcntl
import hashlib
from cffi import FFI
def ffi_wrap(name, c_code, c_header, tmpdir="/tmp/ccache", cflags="", libraries=None):
if libraries is None:
libraries = []
cache = name + "_" + hashlib.sha1(c_code.encode('utf-8')).hexdigest()
try:
os.mkdir(tmpdir)
except OSError:
pass
fd = os.open(tmpdir, 0)
fcntl.flock(fd, fcntl.LOCK_EX)
try:
sys.path.append(tmpdir)
try:
mod = __import__(cache)
except Exception:
print("cache miss {0}".format(cache))
compile_code(cache, c_code, c_header, tmpdir, cflags, libraries)
mod = __import__(cache)
finally:
os.close(fd)
return mod.ffi, mod.lib
def compile_code(name, c_code, c_header, directory, cflags="", libraries=None):
if libraries is None:
libraries = []
ffibuilder = FFI()
ffibuilder.set_source(name, c_code, source_extension='.cpp', libraries=libraries)
ffibuilder.cdef(c_header)
os.environ['OPT'] = "-fwrapv -O2 -DNDEBUG -std=c++11"
os.environ['CFLAGS'] = cflags
ffibuilder.compile(verbose=True, debug=False, tmpdir=directory)
def wrap_compiled(name, directory):
sys.path.append(directory)
mod = __import__(name)
return mod.ffi, mod.lib

109
common/file_helpers.py Normal file
View File

@@ -0,0 +1,109 @@
import os
import shutil
import tempfile
from atomicwrites import AtomicWriter
def mkdirs_exists_ok(path):
try:
os.makedirs(path)
except OSError:
if not os.path.isdir(path):
raise
def rm_not_exists_ok(path):
try:
os.remove(path)
except OSError:
if os.path.exists(path):
raise
def rm_tree_or_link(path):
if os.path.islink(path):
os.unlink(path)
elif os.path.isdir(path):
shutil.rmtree(path)
def get_tmpdir_on_same_filesystem(path):
normpath = os.path.normpath(path)
parts = normpath.split("/")
if len(parts) > 1 and parts[1] == "scratch":
return "/scratch/tmp"
elif len(parts) > 2 and parts[2] == "runner":
return "/{}/runner/tmp".format(parts[1])
return "/tmp"
class AutoMoveTempdir():
def __init__(self, target_path, temp_dir=None):
self._target_path = target_path
self._path = tempfile.mkdtemp(dir=temp_dir)
@property
def name(self):
return self._path
def close(self):
os.rename(self._path, self._target_path)
def __enter__(self): return self
def __exit__(self, type, value, traceback):
if type is None:
self.close()
else:
shutil.rmtree(self._path)
class NamedTemporaryDir():
def __init__(self, temp_dir=None):
self._path = tempfile.mkdtemp(dir=temp_dir)
@property
def name(self):
return self._path
def close(self):
shutil.rmtree(self._path)
def __enter__(self): return self
def __exit__(self, type, value, traceback):
self.close()
def _get_fileobject_func(writer, temp_dir):
def _get_fileobject():
file_obj = writer.get_fileobject(dir=temp_dir)
os.chmod(file_obj.name, 0o644)
return file_obj
return _get_fileobject
def atomic_write_on_fs_tmp(path, **kwargs):
"""Creates an atomic writer using a temporary file in a temporary directory
on the same filesystem as path.
"""
# TODO(mgraczyk): This use of AtomicWriter relies on implementation details to set the temp
# directory.
writer = AtomicWriter(path, **kwargs)
return writer._open(_get_fileobject_func(writer, get_tmpdir_on_same_filesystem(path)))
def atomic_write_in_dir(path, **kwargs):
"""Creates an atomic writer using a temporary file in the same directory
as the destination file.
"""
writer = AtomicWriter(path, **kwargs)
return writer._open(_get_fileobject_func(writer, os.path.dirname(path)))
def atomic_write_in_dir_neos(path, contents, mode=None):
"""
Atomically writes contents to path using a temporary file in the same directory
as path. Useful on NEOS, where `os.link` (required by atomic_write_in_dir) is missing.
"""
f = tempfile.NamedTemporaryFile(delete=False, prefix=".tmp", dir=os.path.dirname(path))
f.write(contents)
f.flush()
if mode is not None:
os.fchmod(f.fileno(), mode)
os.fsync(f.fileno())
f.close()
os.rename(f.name, path)

10
common/filter_simple.py Normal file
View File

@@ -0,0 +1,10 @@
class FirstOrderFilter():
# first order filter
def __init__(self, x0, ts, dt):
self.k = (dt / ts) / (1. + dt / ts)
self.x = x0
def update(self, x):
self.x = (1. - self.k) * self.x + self.k * x

1
common/kalman/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
simple_kalman_impl.c

6
common/kalman/SConscript Normal file
View File

@@ -0,0 +1,6 @@
Import('env')
env.Command(['simple_kalman_impl.so'],
['simple_kalman_impl.pyx', 'simple_kalman_impl.pxd', 'simple_kalman_setup.py'],
"cd common/kalman && python3 simple_kalman_setup.py build_ext --inplace")

View File

@@ -0,0 +1,3 @@
# pylint: skip-file
from common.kalman.simple_kalman_impl import KF1D as KF1D
assert KF1D

View File

@@ -0,0 +1,16 @@
cdef class KF1D:
cdef public:
double x0_0
double x1_0
double K0_0
double K1_0
double A0_0
double A0_1
double A1_0
double A1_1
double C0_0
double C0_1
double A_K_0
double A_K_1
double A_K_2
double A_K_3

View File

@@ -0,0 +1,36 @@
# cython: language_level=3
cdef class KF1D:
def __init__(self, x0, A, C, K):
self.x0_0 = x0[0][0]
self.x1_0 = x0[1][0]
self.A0_0 = A[0][0]
self.A0_1 = A[0][1]
self.A1_0 = A[1][0]
self.A1_1 = A[1][1]
self.C0_0 = C[0]
self.C0_1 = C[1]
self.K0_0 = K[0][0]
self.K1_0 = K[1][0]
self.A_K_0 = self.A0_0 - self.K0_0 * self.C0_0
self.A_K_1 = self.A0_1 - self.K0_0 * self.C0_1
self.A_K_2 = self.A1_0 - self.K1_0 * self.C0_0
self.A_K_3 = self.A1_1 - self.K1_0 * self.C0_1
def update(self, meas):
cdef double x0_0 = self.A_K_0 * self.x0_0 + self.A_K_1 * self.x1_0 + self.K0_0 * meas
cdef double x1_0 = self.A_K_2 * self.x0_0 + self.A_K_3 * self.x1_0 + self.K1_0 * meas
self.x0_0 = x0_0
self.x1_0 = x1_0
return [self.x0_0, self.x1_0]
@property
def x(self):
return [[self.x0_0], [self.x1_0]]
@x.setter
def x(self, x):
self.x0_0 = x[0][0]
self.x1_0 = x[1][0]

View File

@@ -0,0 +1,23 @@
import numpy as np
class KF1D:
# this EKF assumes constant covariance matrix, so calculations are much simpler
# the Kalman gain also needs to be precomputed using the control module
def __init__(self, x0, A, C, K):
self.x = x0
self.A = A
self.C = C
self.K = K
self.A_K = self.A - np.dot(self.K, self.C)
# K matrix needs to be pre-computed as follow:
# import control
# (x, l, K) = control.dare(np.transpose(self.A), np.transpose(self.C), Q, R)
# self.K = np.transpose(K)
def update(self, meas):
self.x = np.dot(self.A_K, self.x) + np.dot(self.K, meas)
return self.x

View File

@@ -0,0 +1,9 @@
from distutils.core import Extension, setup
from Cython.Build import cythonize
from common.cython_hacks import BuildExtWithoutPlatformSuffix
setup(name='Simple Kalman Implementation',
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
ext_modules=cythonize(Extension("simple_kalman_impl", ["simple_kalman_impl.pyx"])))

View File

View File

@@ -0,0 +1,85 @@
import unittest
import random
import timeit
import numpy as np
from common.kalman.simple_kalman import KF1D
from common.kalman.simple_kalman_old import KF1D as KF1D_old
class TestSimpleKalman(unittest.TestCase):
def setUp(self):
dt = 0.01
x0_0 = 0.0
x1_0 = 0.0
A0_0 = 1.0
A0_1 = dt
A1_0 = 0.0
A1_1 = 1.0
C0_0 = 1.0
C0_1 = 0.0
K0_0 = 0.12287673
K1_0 = 0.29666309
self.kf_old = KF1D_old(x0=np.matrix([[x0_0], [x1_0]]),
A=np.matrix([[A0_0, A0_1], [A1_0, A1_1]]),
C=np.matrix([C0_0, C0_1]),
K=np.matrix([[K0_0], [K1_0]]))
self.kf = KF1D(x0=[[x0_0], [x1_0]],
A=[[A0_0, A0_1], [A1_0, A1_1]],
C=[C0_0, C0_1],
K=[[K0_0], [K1_0]])
def test_getter_setter(self):
self.kf.x = [[1.0], [1.0]]
self.assertEqual(self.kf.x, [[1.0], [1.0]])
def update_returns_state(self):
x = self.kf.update(100)
self.assertEqual(x, self.kf.x)
def test_old_equal_new(self):
for _ in range(1000):
v_wheel = random.uniform(0, 200)
x_old = self.kf_old.update(v_wheel)
x = self.kf.update(v_wheel)
# Compare the output x, verify that the error is less than 1e-4
self.assertAlmostEqual(x_old[0], x[0])
self.assertAlmostEqual(x_old[1], x[1])
def test_new_is_faster(self):
setup = """
import numpy as np
from common.kalman.simple_kalman import KF1D
from common.kalman.simple_kalman_old import KF1D as KF1D_old
dt = 0.01
x0_0 = 0.0
x1_0 = 0.0
A0_0 = 1.0
A0_1 = dt
A1_0 = 0.0
A1_1 = 1.0
C0_0 = 1.0
C0_1 = 0.0
K0_0 = 0.12287673
K1_0 = 0.29666309
kf_old = KF1D_old(x0=np.matrix([[x0_0], [x1_0]]),
A=np.matrix([[A0_0, A0_1], [A1_0, A1_1]]),
C=np.matrix([C0_0, C0_1]),
K=np.matrix([[K0_0], [K1_0]]))
kf = KF1D(x0=[[x0_0], [x1_0]],
A=[[A0_0, A0_1], [A1_0, A1_1]],
C=[C0_0, C0_1],
K=[[K0_0], [K1_0]])
"""
kf_speed = timeit.timeit("kf.update(1234)", setup=setup, number=10000)
kf_old_speed = timeit.timeit("kf_old.update(1234)", setup=setup, number=10000)
self.assertTrue(kf_speed < kf_old_speed / 4)

174
common/logging_extra.py Normal file
View File

@@ -0,0 +1,174 @@
import os
import sys
import copy
import json
import socket
import logging
from threading import local
from collections import OrderedDict
from contextlib import contextmanager
def json_handler(obj):
# if isinstance(obj, (datetime.date, datetime.time)):
# return obj.isoformat()
return repr(obj)
def json_robust_dumps(obj):
return json.dumps(obj, default=json_handler)
class NiceOrderedDict(OrderedDict):
def __str__(self):
return json_robust_dumps(self)
class SwagFormatter(logging.Formatter):
def __init__(self, swaglogger):
logging.Formatter.__init__(self, None, '%a %b %d %H:%M:%S %Z %Y')
self.swaglogger = swaglogger
self.host = socket.gethostname()
def format_dict(self, record):
record_dict = NiceOrderedDict()
if isinstance(record.msg, dict):
record_dict['msg'] = record.msg
else:
try:
record_dict['msg'] = record.getMessage()
except (ValueError, TypeError):
record_dict['msg'] = [record.msg]+record.args
record_dict['ctx'] = self.swaglogger.get_ctx()
if record.exc_info:
record_dict['exc_info'] = self.formatException(record.exc_info)
record_dict['level'] = record.levelname
record_dict['levelnum'] = record.levelno
record_dict['name'] = record.name
record_dict['filename'] = record.filename
record_dict['lineno'] = record.lineno
record_dict['pathname'] = record.pathname
record_dict['module'] = record.module
record_dict['funcName'] = record.funcName
record_dict['host'] = self.host
record_dict['process'] = record.process
record_dict['thread'] = record.thread
record_dict['threadName'] = record.threadName
record_dict['created'] = record.created
return record_dict
def format(self, record):
return json_robust_dumps(self.format_dict(record))
class SwagErrorFilter(logging.Filter):
def filter(self, record):
return record.levelno < logging.ERROR
_tmpfunc = lambda: 0
_srcfile = os.path.normcase(_tmpfunc.__code__.co_filename)
class SwagLogger(logging.Logger):
def __init__(self):
logging.Logger.__init__(self, "swaglog")
self.global_ctx = {}
self.log_local = local()
self.log_local.ctx = {}
def findCaller(self, stack_info=None):
"""
Find the stack frame of the caller so that we can note the source
file name, line number and function name.
"""
# f = currentframe()
f = sys._getframe(3)
#On some versions of IronPython, currentframe() returns None if
#IronPython isn't run with -X:Frames.
if f is not None:
f = f.f_back
rv = "(unknown file)", 0, "(unknown function)"
while hasattr(f, "f_code"):
co = f.f_code
filename = os.path.normcase(co.co_filename)
if filename in (logging._srcfile, _srcfile):
f = f.f_back
continue
rv = (co.co_filename, f.f_lineno, co.co_name)
break
return rv
def local_ctx(self):
try:
return self.log_local.ctx
except AttributeError:
self.log_local.ctx = {}
return self.log_local.ctx
def get_ctx(self):
return dict(self.local_ctx(), **self.global_ctx)
@contextmanager
def ctx(self, **kwargs):
old_ctx = self.local_ctx()
self.log_local.ctx = copy.copy(old_ctx) or {}
self.log_local.ctx.update(kwargs)
try:
yield
finally:
self.log_local.ctx = old_ctx
def bind(self, **kwargs):
self.local_ctx().update(kwargs)
def bind_global(self, **kwargs):
self.global_ctx.update(kwargs)
def event(self, event_name, *args, **kwargs):
evt = NiceOrderedDict()
evt['event'] = event_name
if args:
evt['args'] = args
evt.update(kwargs)
ctx = self.get_ctx()
if ctx:
evt['ctx'] = self.get_ctx()
if 'error' in kwargs:
self.error(evt)
else:
self.info(evt)
if __name__ == "__main__":
log = SwagLogger()
stdout_handler = logging.StreamHandler(sys.stdout)
stdout_handler.setLevel(logging.INFO)
stdout_handler.addFilter(SwagErrorFilter())
log.addHandler(stdout_handler)
stderr_handler = logging.StreamHandler(sys.stderr)
stderr_handler.setLevel(logging.ERROR)
log.addHandler(stderr_handler)
log.info("asdasd %s", "a")
log.info({'wut': 1})
log.warning("warning")
log.error("error")
log.critical("critical")
log.event("test", x="y")
with log.ctx():
stdout_handler.setFormatter(SwagFormatter(log))
stderr_handler.setFormatter(SwagFormatter(log))
log.bind(user="some user")
log.info("in req")
print("")
log.warning("warning")
print("")
log.error("error")
print("")
log.critical("critical")
print("")
log.event("do_req", a=1, b="c")

21
common/numpy_fast.py Normal file
View File

@@ -0,0 +1,21 @@
def int_rnd(x):
return int(round(x))
def clip(x, lo, hi):
return max(lo, min(hi, x))
def interp(x, xp, fp):
N = len(xp)
def get_interp(xv):
hi = 0
while hi < N and xv > xp[hi]:
hi += 1
low = hi - 1
return fp[-1] if hi == N and xv > xp[low] else (
fp[0] if hi == 0 else
(xv - xp[low]) * (fp[hi] - fp[low]) / (xp[hi] - xp[low]) + fp[low])
return [get_interp(v) for v in x] if hasattr(
x, '__iter__') else get_interp(x)
def mean(x):
return sum(x) / len(x)

469
common/params.py Executable file
View File

@@ -0,0 +1,469 @@
#!/usr/bin/env python3
"""ROS has a parameter server, we have files.
The parameter store is a persistent key value store, implemented as a directory with a writer lock.
On Android, we store params under params_dir = /data/params. The writer lock is a file
"<params_dir>/.lock" taken using flock(), and data is stored in a directory symlinked to by
"<params_dir>/d".
Each key, value pair is stored as a file with named <key> with contents <value>, located in
<params_dir>/d/<key>
Readers of a single key can just open("<params_dir>/d/<key>") and read the file contents.
Readers who want a consistent snapshot of multiple keys should take the lock.
Writers should take the lock before modifying anything. Writers should also leave the DB in a
consistent state after a crash. The implementation below does this by copying all params to a temp
directory <params_dir>/<tmp>, then atomically symlinking <params_dir>/<d> to <params_dir>/<tmp>
before deleting the old <params_dir>/<d> directory.
Writers that only modify a single key can simply take the lock, then swap the corresponding value
file in place without messing with <params_dir>/d.
"""
import time
import os
import errno
import sys
import shutil
import fcntl
import tempfile
import threading
from enum import Enum
def mkdirs_exists_ok(path):
try:
os.makedirs(path)
except OSError:
if not os.path.isdir(path):
raise
class TxType(Enum):
PERSISTENT = 1
CLEAR_ON_MANAGER_START = 2
CLEAR_ON_PANDA_DISCONNECT = 3
class UnknownKeyName(Exception):
pass
keys = {
"AccessToken": [TxType.PERSISTENT],
"AthenadPid": [TxType.PERSISTENT],
"CalibrationParams": [TxType.PERSISTENT],
"CarParams": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"CarVin": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"CommunityFeaturesToggle": [TxType.PERSISTENT],
"CompletedTrainingVersion": [TxType.PERSISTENT],
"ControlsParams": [TxType.PERSISTENT],
"DoUninstall": [TxType.CLEAR_ON_MANAGER_START],
"DongleId": [TxType.PERSISTENT],
"GitBranch": [TxType.PERSISTENT],
"GitCommit": [TxType.PERSISTENT],
"GitRemote": [TxType.PERSISTENT],
"GithubSshKeys": [TxType.PERSISTENT],
"HasAcceptedTerms": [TxType.PERSISTENT],
"HasCompletedSetup": [TxType.PERSISTENT],
"IsLdwEnabled": [TxType.PERSISTENT],
"IsGeofenceEnabled": [TxType.PERSISTENT],
"IsMetric": [TxType.PERSISTENT],
"IsRHD": [TxType.PERSISTENT],
"IsTakingSnapshot": [TxType.CLEAR_ON_MANAGER_START],
"IsUpdateAvailable": [TxType.PERSISTENT],
"IsUploadRawEnabled": [TxType.PERSISTENT],
"LastUpdateTime": [TxType.PERSISTENT],
"LimitSetSpeed": [TxType.PERSISTENT],
"LimitSetSpeedNeural": [TxType.PERSISTENT],
"LiveParameters": [TxType.PERSISTENT],
"LongitudinalControl": [TxType.PERSISTENT],
"OpenpilotEnabledToggle": [TxType.PERSISTENT],
"PandaFirmware": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"PandaDongleId": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"Passive": [TxType.PERSISTENT],
"RecordFront": [TxType.PERSISTENT],
"ReleaseNotes": [TxType.PERSISTENT],
"ShouldDoUpdate": [TxType.CLEAR_ON_MANAGER_START],
"SpeedLimitOffset": [TxType.PERSISTENT],
"SubscriberInfo": [TxType.PERSISTENT],
"TermsVersion": [TxType.PERSISTENT],
"TrainingVersion": [TxType.PERSISTENT],
"UpdateAvailable": [TxType.CLEAR_ON_MANAGER_START],
"Version": [TxType.PERSISTENT],
"Offroad_ChargeDisabled": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"Offroad_ConnectivityNeeded": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_ConnectivityNeededPrompt": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_TemperatureTooHigh": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_PandaFirmwareMismatch": [TxType.CLEAR_ON_MANAGER_START, TxType.CLEAR_ON_PANDA_DISCONNECT],
"Offroad_InvalidTime": [TxType.CLEAR_ON_MANAGER_START],
"Offroad_IsTakingSnapshot": [TxType.CLEAR_ON_MANAGER_START],
#dragonpilot config
"DragonEnableDashcam": [TxType.PERSISTENT],
"DragonEnableDriverSafetyCheck": [TxType.PERSISTENT],
"DragonAutoShutdownAt": [TxType.PERSISTENT],
"DragonEnableSteeringOnSignal": [TxType.PERSISTENT],
"DragonEnableLogger": [TxType.PERSISTENT],
"DragonEnableUploader": [TxType.PERSISTENT],
"DragonNoctuaMode": [TxType.PERSISTENT],
"DragonCacheCar": [TxType.PERSISTENT],
"DragonCachedModel": [TxType.PERSISTENT],
"DragonCachedFP": [TxType.PERSISTENT],
"DragonCachedVIN": [TxType.PERSISTENT],
"DragonAllowGas": [TxType.PERSISTENT],
"DragonToyotaStockDSU": [TxType.PERSISTENT],
"DragonLatCtrl": [TxType.PERSISTENT],
"DragonUISpeed": [TxType.PERSISTENT],
"DragonUIEvent": [TxType.PERSISTENT],
"DragonUIMaxSpeed": [TxType.PERSISTENT],
"DragonUIFace": [TxType.PERSISTENT],
"DragonUIDev": [TxType.PERSISTENT],
"DragonUIDevMini": [TxType.PERSISTENT],
"DragonEnableTomTom": [TxType.PERSISTENT],
"DragonBootTomTom": [TxType.PERSISTENT],
"DragonRunTomTom": [TxType.PERSISTENT],
"DragonEnableAutonavi": [TxType.PERSISTENT],
"DragonBootAutonavi": [TxType.PERSISTENT],
"DragonRunAutonavi": [TxType.PERSISTENT],
"DragonEnableAegis": [TxType.PERSISTENT],
"DragonBootAegis": [TxType.PERSISTENT],
"DragonRunAegis": [TxType.PERSISTENT],
"DragonEnableMixplorer": [TxType.PERSISTENT],
"DragonRunMixplorer": [TxType.PERSISTENT],
"DragonSteeringMonitorTimer": [TxType.PERSISTENT],
"DragonCameraOffset": [TxType.PERSISTENT],
"DragonUIVolumeBoost": [TxType.PERSISTENT],
"DragonGreyPandaMode": [TxType.PERSISTENT],
"DragonDrivingUI": [TxType.PERSISTENT],
"DragonDisplaySteeringLimitAlert": [TxType.PERSISTENT],
"DragonChargingCtrl": [TxType.PERSISTENT],
"DragonCharging": [TxType.PERSISTENT],
"DragonDisCharging": [TxType.PERSISTENT],
"DragonToyotaLaneDepartureWarning": [TxType.PERSISTENT],
"DragonUILane": [TxType.PERSISTENT],
"DragonUILead": [TxType.PERSISTENT],
"DragonUIPath": [TxType.PERSISTENT],
"DragonUIBlinker": [TxType.PERSISTENT],
"DragonEnableDriverMonitoring": [TxType.PERSISTENT],
"DragonCarModel": [TxType.PERSISTENT],
"DragonCarVIN": [TxType.PERSISTENT],
"DragonEnableSlowOnCurve": [TxType.PERSISTENT],
"DragonEnableLeadCarMovingAlert": [TxType.PERSISTENT],
"DragonToyotaSnGMod": [TxType.PERSISTENT],
"DragonIsEON": [TxType.PERSISTENT],
"DragonHWChecked": [TxType.PERSISTENT],
"DragonEnableSRLearner": [TxType.PERSISTENT],
"DragonWazeMode": [TxType.PERSISTENT],
"DragonRunWaze": [TxType.PERSISTENT],
"DragonEnableAssistedLC": [TxType.PERSISTENT],
"DragonEnableAutoLC": [TxType.PERSISTENT],
"DragonAssistedLCMinMPH": [TxType.PERSISTENT],
"DragonAutoLCMinMPH": [TxType.PERSISTENT],
"DragonAutoLCDelay": [TxType.PERSISTENT],
}
def fsync_dir(path):
fd = os.open(path, os.O_RDONLY)
try:
os.fsync(fd)
finally:
os.close(fd)
class FileLock():
def __init__(self, path, create):
self._path = path
self._create = create
self._fd = None
def acquire(self):
self._fd = os.open(self._path, os.O_CREAT if self._create else 0)
fcntl.flock(self._fd, fcntl.LOCK_EX)
def release(self):
if self._fd is not None:
os.close(self._fd)
self._fd = None
class DBAccessor():
def __init__(self, path):
self._path = path
self._vals = None
def keys(self):
self._check_entered()
return self._vals.keys()
def get(self, key):
self._check_entered()
try:
return self._vals[key]
except KeyError:
return None
def _get_lock(self, create):
lock = FileLock(os.path.join(self._path, ".lock"), create)
lock.acquire()
return lock
def _read_values_locked(self):
"""Callers should hold a lock while calling this method."""
vals = {}
try:
data_path = self._data_path()
keys = os.listdir(data_path)
for key in keys:
with open(os.path.join(data_path, key), "rb") as f:
vals[key] = f.read()
except (OSError, IOError) as e:
# Either the DB hasn't been created yet, or somebody wrote a bug and left the DB in an
# inconsistent state. Either way, return empty.
if e.errno == errno.ENOENT:
return {}
return vals
def _data_path(self):
return os.path.join(self._path, "d")
def _check_entered(self):
if self._vals is None:
raise Exception("Must call __enter__ before using DB")
class DBReader(DBAccessor):
def __enter__(self):
try:
lock = self._get_lock(False)
except OSError as e:
# Do not create lock if it does not exist.
if e.errno == errno.ENOENT:
self._vals = {}
return self
try:
# Read everything.
self._vals = self._read_values_locked()
return self
finally:
lock.release()
def __exit__(self, type, value, traceback): pass
class DBWriter(DBAccessor):
def __init__(self, path):
super(DBWriter, self).__init__(path)
self._lock = None
self._prev_umask = None
def put(self, key, value):
self._vals[key] = value
def delete(self, key):
self._vals.pop(key, None)
def __enter__(self):
mkdirs_exists_ok(self._path)
# Make sure we can write and that permissions are correct.
self._prev_umask = os.umask(0)
try:
os.chmod(self._path, 0o777)
self._lock = self._get_lock(True)
self._vals = self._read_values_locked()
except:
os.umask(self._prev_umask)
self._prev_umask = None
raise
return self
def __exit__(self, type, value, traceback):
self._check_entered()
try:
# data_path refers to the externally used path to the params. It is a symlink.
# old_data_path is the path currently pointed to by data_path.
# tempdir_path is a path where the new params will go, which the new data path will point to.
# new_data_path is a temporary symlink that will atomically overwrite data_path.
#
# The current situation is:
# data_path -> old_data_path
# We're going to write params data to tempdir_path
# tempdir_path -> params data
# Then point new_data_path to tempdir_path
# new_data_path -> tempdir_path
# Then atomically overwrite data_path with new_data_path
# data_path -> tempdir_path
old_data_path = None
new_data_path = None
tempdir_path = tempfile.mkdtemp(prefix=".tmp", dir=self._path)
try:
# Write back all keys.
os.chmod(tempdir_path, 0o777)
for k, v in self._vals.items():
with open(os.path.join(tempdir_path, k), "wb") as f:
f.write(v)
f.flush()
os.fsync(f.fileno())
fsync_dir(tempdir_path)
data_path = self._data_path()
try:
old_data_path = os.path.join(self._path, os.readlink(data_path))
except (OSError, IOError):
# NOTE(mgraczyk): If other DB implementations have bugs, this could cause
# copies to be left behind, but we still want to overwrite.
pass
new_data_path = "{}.link".format(tempdir_path)
os.symlink(os.path.basename(tempdir_path), new_data_path)
os.rename(new_data_path, data_path)
fsync_dir(self._path)
finally:
# If the rename worked, we can delete the old data. Otherwise delete the new one.
success = new_data_path is not None and os.path.exists(data_path) and (
os.readlink(data_path) == os.path.basename(tempdir_path))
if success:
if old_data_path is not None:
shutil.rmtree(old_data_path)
else:
shutil.rmtree(tempdir_path)
# Regardless of what happened above, there should be no link at new_data_path.
if new_data_path is not None and os.path.islink(new_data_path):
os.remove(new_data_path)
finally:
os.umask(self._prev_umask)
self._prev_umask = None
# Always release the lock.
self._lock.release()
self._lock = None
def read_db(params_path, key):
path = "%s/d/%s" % (params_path, key)
try:
with open(path, "rb") as f:
return f.read()
except IOError:
return None
def write_db(params_path, key, value):
if isinstance(value, str):
value = value.encode('utf8')
prev_umask = os.umask(0)
lock = FileLock(params_path+"/.lock", True)
lock.acquire()
try:
tmp_path = tempfile.mktemp(prefix=".tmp", dir=params_path)
with open(tmp_path, "wb") as f:
f.write(value)
f.flush()
os.fsync(f.fileno())
path = "%s/d/%s" % (params_path, key)
os.rename(tmp_path, path)
fsync_dir(os.path.dirname(path))
finally:
os.umask(prev_umask)
lock.release()
class Params():
def __init__(self, db='/data/params'):
self.db = db
# create the database if it doesn't exist...
if not os.path.exists(self.db+"/d"):
with self.transaction(write=True):
pass
def transaction(self, write=False):
if write:
return DBWriter(self.db)
else:
return DBReader(self.db)
def _clear_keys_with_type(self, tx_type):
with self.transaction(write=True) as txn:
for key in keys:
if tx_type in keys[key]:
txn.delete(key)
def manager_start(self):
self._clear_keys_with_type(TxType.CLEAR_ON_MANAGER_START)
def panda_disconnect(self):
self._clear_keys_with_type(TxType.CLEAR_ON_PANDA_DISCONNECT)
def delete(self, key):
with self.transaction(write=True) as txn:
txn.delete(key)
def get(self, key, block=False, encoding=None):
if key not in keys:
raise UnknownKeyName(key)
while 1:
ret = read_db(self.db, key)
if not block or ret is not None:
break
# is polling really the best we can do?
time.sleep(0.05)
if ret is not None and encoding is not None:
ret = ret.decode(encoding)
return ret
def put(self, key, dat):
"""
Warning: This function blocks until the param is written to disk!
In very rare cases this can take over a second, and your code will hang.
Use the put_nonblocking helper function in time sensitive code, but
in general try to avoid writing params as much as possible.
"""
if key not in keys:
raise UnknownKeyName(key)
write_db(self.db, key, dat)
def put_nonblocking(key, val):
def f(key, val):
params = Params()
params.put(key, val)
t = threading.Thread(target=f, args=(key, val))
t.start()
return t
if __name__ == "__main__":
params = Params()
if len(sys.argv) > 2:
params.put(sys.argv[1], sys.argv[2])
else:
for k in keys:
pp = params.get(k)
if pp is None:
print("%s is None" % k)
elif all(ord(c) < 128 and ord(c) >= 32 for c in pp):
print("%s = %s" % (k, pp))
else:
print("%s = %s" % (k, pp.encode("hex")))
# Test multiprocess:
# seq 0 100000 | xargs -P20 -I{} python common/params.py DongleId {} && sleep 0.05
# while python common/params.py DongleId; do sleep 0.05; done

46
common/profiler.py Normal file
View File

@@ -0,0 +1,46 @@
import time
class Profiler():
def __init__(self, enabled=False):
self.enabled = enabled
self.cp = {}
self.cp_ignored = []
self.iter = 0
self.start_time = time.time()
self.last_time = self.start_time
self.tot = 0.
def reset(self, enabled=False):
self.enabled = enabled
self.cp = {}
self.cp_ignored = []
self.iter = 0
self.start_time = time.time()
self.last_time = self.start_time
def checkpoint(self, name, ignore=False):
# ignore flag needed when benchmarking threads with ratekeeper
if not self.enabled:
return
tt = time.time()
if name not in self.cp:
self.cp[name] = 0.
if ignore:
self.cp_ignored.append(name)
self.cp[name] += tt - self.last_time
if not ignore:
self.tot += tt - self.last_time
self.last_time = tt
def display(self):
if not self.enabled:
return
self.iter += 1
print("******* Profiling *******")
for n, ms in sorted(self.cp.items(), key=lambda x: -x[1]):
if n in self.cp_ignored:
print("%30s: %7.2f percent: %3.0f IGNORED" % (n, ms*1000.0, ms/self.tot*100))
else:
print("%30s: %7.2f percent: %3.0f" % (n, ms*1000.0, ms/self.tot*100))
print("Iter clock: %2.6f TOTAL: %2.2f" % (self.tot/self.iter, self.tot))

Some files were not shown because too many files have changed in this diff Show More