Shane Smiskol f797567ef8 long planner: run when using stock longitudinal (#25017)
* Squashed commit of the following:

commit e27a5b4e2bfeab4e6a47440b1d4eb180ee4acf49
Author: Shane Smiskol <shane@smiskol.com>
Date:   Fri Jul 1 14:10:06 2022 -0700

    remove this test

    remove this test

commit c3c10af82222ea4641d94c53a3a07b486cca8452
Author: Shane Smiskol <shane@smiskol.com>
Date:   Fri Jul 1 14:08:15 2022 -0700

    only planner changes

commit 50e0f1d8704c15acfce8987faf3515c99e8af4f4
Merge: e088fde67 fcc5b3d70
Author: Shane Smiskol <shane@smiskol.com>
Date:   Fri Jul 1 14:05:36 2022 -0700

    Merge remote-tracking branch 'upstream/master' into enable-planner2

commit e088fde67edcc32ccfeea23b4ae9e44845240429
Author: Shane Smiskol <shane@smiskol.com>
Date:   Thu Jun 30 13:58:38 2022 -0700

    no walrus

commit b7b425e530e949b9cc427833562473cc241d1367
Merge: f8634266b c49f997be
Author: Shane Smiskol <shane@smiskol.com>
Date:   Thu Jun 30 13:54:30 2022 -0700

    Merge remote-tracking branch 'upstream/master' into enable-planner

commit f8634266b49c3f692b255e6cfac66cccc438ae20
Author: Shane Smiskol <shane@smiskol.com>
Date:   Wed Jun 29 16:07:35 2022 -0700

    stricter test, speeds[-1] is 0.14 when starting here

commit c9e446ad2183feba9d03ee39f9801091ab791c08
Merge: e6c4106ea 879a7c320
Author: Shane Smiskol <shane@smiskol.com>
Date:   Wed Jun 29 16:01:32 2022 -0700

    Merge remote-tracking branch 'upstream/master' into enable-planner

commit e6c4106ea185c68a6c7b3d59d5bde664df8bdc9c
Author: Shane Smiskol <shane@smiskol.com>
Date:   Sat Jun 25 03:28:41 2022 -0700

    fix test

commit 0520c7f21613b57b804e08a8e8d10950ac059074
Author: Shane Smiskol <shane@smiskol.com>
Date:   Sat Jun 25 03:26:16 2022 -0700

    add test for resuming

commit 04db5f80bff4a002f5241765a625d7cf57b74364
Merge: e23b37d3f d8bfe2f00
Author: Shane Smiskol <shane@smiskol.com>
Date:   Wed Jun 22 20:15:50 2022 -0700

    Merge remote-tracking branch 'upstream/master' into enable-planner

commit e23b37d3fe8dd3dd07b46a32a4f0564fabade1aa
Author: Shane Smiskol <shane@smiskol.com>
Date:   Tue Jun 21 12:46:04 2022 -0700

    0.1 should be pretty safe

commit e7dc3960da3d713753f28732f50dbd25811fad28
Author: Shane Smiskol <shane@smiskol.com>
Date:   Tue Jun 21 12:39:30 2022 -0700

    try 0.2

commit ff0597ec92a0d2c52915316961ec123b0183c5cf
Author: Shane Smiskol <shane@smiskol.com>
Date:   Tue Jun 21 11:34:00 2022 -0700

    Always run planner if not opLong

commit 13997c55271f79fd3ca62d6db45ec3790b09aa60
Merge: d2f51ee55 95d8517a8
Author: Shane Smiskol <shane@smiskol.com>
Date:   Tue Jun 21 11:29:22 2022 -0700

    Merge remote-tracking branch 'upstream/master' into enable-planner

commit d2f51ee55fd3bde38275371e76714d7741bc6f6b
Author: Shane Smiskol <shane@smiskol.com>
Date:   Tue Jun 21 11:27:45 2022 -0700

    same for non-HDA2

commit 6a63bd60f09a0abd9185049cd173100d3ef6fefa
Author: Shane Smiskol <shane@smiskol.com>
Date:   Mon Jun 20 23:37:07 2022 -0700

    mazda: ensure no resume if cancelling

commit 5771cdecab7999765d9f5203c75a67f1555cf975
Author: Shane Smiskol <shane@smiskol.com>
Date:   Mon Jun 20 23:27:58 2022 -0700

    maintain original button msg rate

commit 6c1fe0606fd0a0819ffeaac92526e43b3110f2f4
Author: Shane Smiskol <shane@smiskol.com>
Date:   Wed Jun 15 23:45:26 2022 -0700

    rename to resume

commit 00b1df652f1679137c769f9db61eed7dd14e1542
Author: Shane Smiskol <shane@smiskol.com>
Date:   Wed Jun 15 21:57:54 2022 -0700

    remove comments

commit 325ea9bbd5e0dd946961ede0cdcc446ad5e5bbdb
Author: Shane Smiskol <shane@smiskol.com>
Date:   Wed Jun 15 21:56:20 2022 -0700

    vw

commit 2c9061042b36fe1d6b029a4216655be69a980849
Author: Shane Smiskol <shane@smiskol.com>
Date:   Wed Jun 15 21:54:37 2022 -0700

    do rest but vw

commit 3dc51f663dfdd4ea1fd72d239bcd5db8c7da4b47
Author: Shane Smiskol <shane@smiskol.com>
Date:   Wed Jun 15 16:34:48 2022 -0700

    only spam resume when future is > vEgoStarting

commit 5f32cd1fcb402bee425d866a9dc76b6feea3d241
Author: Shane Smiskol <shane@smiskol.com>
Date:   Wed Jun 15 16:09:43 2022 -0700

    always log leads, we hide them in ui

* reset when not CS.enabled

remove comment

* update refs
2022-07-05 22:19:20 -07:00
2022-06-29 11:36:03 +02:00
2022-07-05 16:42:53 -07:00
2022-07-01 16:43:44 +02:00
2022-07-05 14:28:54 -07:00
2021-01-05 12:50:23 -08:00
2020-01-17 10:25:50 -08:00
2022-01-12 23:07:06 -08:00
2022-06-21 23:39:26 -07:00
2020-06-15 16:49:18 -07:00
2022-01-10 23:14:30 -08:00
2020-05-11 10:40:49 -07:00
2022-06-20 16:24:51 -07:00
2020-01-17 10:22:00 -08:00
2022-06-03 19:38:34 -07:00
2021-10-07 16:32:44 -07:00
2020-01-17 10:22:00 -08:00
2022-05-02 16:48:04 -07:00
2022-06-14 20:38:25 -07:00
2022-06-14 20:38:25 -07:00
2020-05-14 15:36:56 -07:00
2022-06-30 15:52:53 -07:00

Table of Contents


What is openpilot?

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. In addition, while openpilot is engaged, a camera based Driver Monitoring (DM) feature alerts distracted and asleep drivers. See more about the vehicle integration and limitations.

Running on a dedicated device in a car

To use openpilot in a car, you need four things

  • A supported device to run this software: a comma three.
  • This software. The setup procedure of the comma three allows the user to enter a url for custom software. The url, openpilot.comma.ai will install the release version of openpilot. To install openpilot master, you can use installer.comma.ai/commaai/master, and replacing commaai with another github username can install a fork.
  • One of the 150+ supported cars. We support Honda, Toyota, Hyundai, Nissan, Kia, Chrysler, Lexus, Acura, Audi, VW, and more. If your car is not supported, but has adaptive cruise control and lane keeping assist, it's likely able to run openpilot.
  • A car harness to connect to your car.

We have detailed instructions for how to mount the device in a car.

Running on PC

All of openpilot's services can run as normal on a PC, even without special hardware or a car. To develop or experiment with openpilot you can run openpilot on recorded or simulated data.

With openpilot's tools you can plot logs, replay drives and watch the full-res camera streams. See the tools README for more information.

You can also run openpilot in simulation with the CARLA simulator. This allows openpilot to drive around a virtual car on your Ubuntu machine. The whole setup should only take a few minutes, but does require a decent GPU.

A PC running openpilot can also control your vehicle if it is connected to a a webcam, a black panda, and a harness.

Community and Contributing

openpilot is developed by comma and by users like you. We welcome both pull requests and issues on GitHub. Bug fixes and new car ports are encouraged. Check out the contributing docs.

Documentation related to openpilot development can be found on docs.comma.ai. Information about running openpilot (e.g. FAQ, fingerprinting, troubleshooting, custom forks, community hardware) should go on the wiki.

You can add support for your car by following guides we have written for Brand and Model ports. Generally, a car with adaptive cruise control and lane keep assist is a good candidate. Join our Discord to discuss car ports: most car makes have a dedicated channel.

Want to get paid to work on openpilot? comma is hiring.

And follow us on Twitter.

User Data and comma Account

By default, openpilot uploads the driving data to our servers. You can also access your data through comma connect. 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 cameras, 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. 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 for more details.
  • openpilot has software in the loop tests that run on every commit.
  • The code enforcing the safety model lives in panda and is written in C, see code rigor for more details.
  • panda has software in the loop safety tests.
  • 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.
  • We run the latest openpilot in a testing closet containing 10 comma devices continuously replaying routes.

Directory Structure

.
├── cereal              # The messaging spec and libs used for all logs
├── common              # Library like functionality we've developed here
├── docs                # Documentation
├── opendbc             # Files showing how to interpret data from cars
├── panda               # Code used to communicate on CAN
├── third_party         # External libraries
├── pyextra             # Extra python packages
└── system              # Generic services
    ├── logcatd         # systemd journal as a service
    └── proclogd        # Logs information from /proc
└── selfdrive           # Code needed to drive the car
    ├── assets          # Fonts, images, and sounds 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        # Planning and controls
    ├── debug           # Tools to help you debug and do car ports
    ├── locationd       # Precise localization and vehicle parameter estimation
    ├── loggerd         # Logger and uploader of car data
    ├── modeld          # Driving and monitoring model runners
    ├── proclogd        # Logs information from proc
    ├── sensord         # IMU interface code
    ├── navd            # Turn-by-turn navigation
    ├── test            # Unit tests, system tests, and a car simulator
    └── ui              # The UI

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.


openpilot tests Total alerts Language grade: Python Language grade: C/C++ codecov

Languages
Python 70.6%
C++ 21.7%
C 2.2%
Cap'n Proto 1.9%
Shell 1.6%
Other 1.9%