Skip to content

Commit

Permalink
Merge pull request commaai#18 from commaai/devel
Browse files Browse the repository at this point in the history
Devel 0.7.4
  • Loading branch information
brfield94 authored Mar 18, 2020
2 parents 6abefa5 + a5c3340 commit be41085
Show file tree
Hide file tree
Showing 208 changed files with 6,494 additions and 4,250 deletions.
20 changes: 15 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ Most open source development activity is coordinated through our [Discord](https

### 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.
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.
All PRs are automatically checked by Github Actions. Check out `.github/workflows/` for what Github Actions runs. Any new tests sould be added to Github Actions.

### 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`.
Code is automatically checked for style by Github Actions as part of the automated tests. You can also run these tests yourself by running `pylint_openpilot.sh` and `flake8_openpilot.sh`.

## Car Ports (openpilot)

Expand All @@ -32,9 +32,19 @@ If you port openpilot to a substantially new car brand, see this more generic [B

## Pull Requests

Pull requests should be against the master branch. Before running master on in-car hardware, you'll need to run
Pull requests should be against the master branch. Before running master on in-car hardware, you'll need to clone the submodules too. That can be done by recursively cloning the repository:
```
git clone https://github.com/commaai/openpilot.git --recursive
```
Or alternatively, when on the master branch:
```
git submodule init
git submodule update
```
in order to pull down the submodules, such as `panda` and `opendbc`.
The reasons for having submodules on a dedicated repository and our new development philosophy can be found in our [post about externalization](https://medium.com/@comma_ai/a-2020-theme-externalization-13b33326d8b3).
Modules that are in seperate repositories include:
* apks
* cereal
* laika
* opendbc
* panda
150 changes: 76 additions & 74 deletions README.md

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
Version 0.7.4 (2020-03-20)
========================
* New driving model: improved lane changes and lead car detection
* Improved driver monitoring model: improve eye detection
* Improved calibration stability
* Improved lateral control on some 2019 and 2020 Toyota Prius
* Improved lateral control on VW Golf: 20% more steering torque
* Fixed bug where some 2017 and 2018 Toyota C-HR would use the wrong steering angle sensor
* Support for Honda Insight thanks to theantihero!
* Code cleanup in car abstraction layers and ui

Version 0.7.3 (2020-02-21)
========================
* Support for 2020 Highlander thanks to che220!
Expand Down
Binary file removed apk/ai.comma.plus.black.apk
Binary file not shown.
Binary file removed apk/ai.comma.plus.frame.apk
Binary file not shown.
Binary file modified apk/ai.comma.plus.offroad.apk
Binary file not shown.
3 changes: 1 addition & 2 deletions cereal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ while 1:

# in publisher
pm = messaging.PubMaster(['sensorEvents'])
dat = messaging.new_message()
dat.init('sensorEvents', 1)
dat = messaging.new_message('sensorEvents', size=1)
dat.sensorEvents[0] = {"gyro": {"v": [0.1, -0.1, 0.1]}}
pm.send('sensorEvents', dat)
```
17 changes: 17 additions & 0 deletions cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ struct CarState {
steeringRateLimited @29 :Bool; # if the torque is limited by the rate limiter
stockAeb @30 :Bool;
stockFcw @31 :Bool;
espDisabled @32 :Bool;

# cruise state
cruiseState @10 :CruiseState;
Expand All @@ -150,6 +151,10 @@ struct CarState {

# which packets this state came from
canMonoTimes @12: List(UInt64);

# blindspot sensors
leftBlindspot @33 :Bool; # Is there something blocking the left lane change
rightBlindspot @34 :Bool; # Is there something blocking the right lane change

struct WheelSpeeds {
# optional wheel speeds
Expand Down Expand Up @@ -441,6 +446,7 @@ struct CarParams {
noOutput @19; # like silent but without silent CAN TXs
hondaBoschHarness @20;
volkswagenPq @21;
subaruLegacy @22; # pre-Global platform
}

enum SteerControlType {
Expand Down Expand Up @@ -468,10 +474,21 @@ struct CarParams {
fwdCamera @3;
engine @4;
unknown @5;
transmission @8; # Transmission Control Module
srs @9; # airbag
gateway @10; # can gateway
hud @11; # heads up display
combinationMeter @12; # instrument cluster

# Toyota only
dsu @6;
apgs @7;

# Honda only
vsa @13; # Vehicle Stability Assist
programmedFuelInjection @14;
electricBrakeBooster @15;
shiftByWire @16;
}

enum FingerprintSource {
Expand Down
73 changes: 72 additions & 1 deletion cereal/log.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ struct FrameData {
lensTruePos @14 :Float32;
image @6 :Data;
gainFrac @15 :Float32;
focusVal @16 :List(Int16);
focusConf @17 :List(UInt8);

frameType @7 :FrameType;
timestampSof @8 :UInt64;
Expand Down Expand Up @@ -281,6 +283,7 @@ struct ThermalData {
usbOnline @12 :Bool;
networkType @22 :NetworkType;
offroadPowerUsage @23 :UInt32; # Power usage since going offroad in uWh
networkStrength @24 :NetworkStrength;

fanSpeed @10 :UInt16;
started @11 :Bool;
Expand Down Expand Up @@ -308,6 +311,14 @@ struct ThermalData {
cell4G @4;
cell5G @5;
}

enum NetworkStrength {
unknown @0;
poor @1;
moderate @2;
good @3;
great @4;
}
}

struct HealthData {
Expand Down Expand Up @@ -626,9 +637,11 @@ struct ModelData {
brakeDisengageProb @2 :Float32;
gasDisengageProb @3 :Float32;
steerOverrideProb @4 :Float32;
desireState @5 :List(Float32);
}

struct LongitudinalData {
distances @2 :List(Float32);
speeds @0 :List(Float32);
accelerations @1 :List(Float32);
}
Expand Down Expand Up @@ -790,6 +803,52 @@ struct PathPlan {
}
}

struct LiveLocationKalman {

# More info on reference frames:
# https://github.com/commaai/openpilot/tree/master/common/transformations

positionECEF @0 : Measurement;
positionGeodetic @1 : Measurement;
velocityECEF @2 : Measurement;
velocityNED @3 : Measurement;
velocityDevice @4 : Measurement;
accelerationDevice @5: Measurement;


# These angles are all eulers and roll, pitch, yaw
# orientationECEF transforms to rot matrix: ecef_from_device
orientationECEF @6 : Measurement;
orientationNED @7 : Measurement;
angularVelocityDevice @8 : Measurement;

# orientationNEDCalibrated transforms to rot matrix: NED_from_calibrated
orientationNEDCalibrated @9 : Measurement;

# Calibrated frame is simply device frame
# aligned with the vehicle
velocityCalibrated @10 : Measurement;
accelerationCalibrated @11 : Measurement;
angularVelocityCalibrated @12 : Measurement;

gpsWeek @13 :Int32;
gpsTimeOfWeek @14 :Float64;
status @15 :Status;
unixTimestampMillis @16 :Int64;

enum Status {
uninitialized @0;
uncalibrated @1;
valid @2;
}

struct Measurement {
value @0 : List(Float64);
std @1 : List(Float64);
valid @2 : Bool;
}
}

struct LiveLocationData {
status @0 :UInt8;

Expand Down Expand Up @@ -1877,6 +1936,16 @@ struct KalmanOdometry {
rotStd @3 :List(Float32); # std rad/s in device frame
}

struct Sentinel {
enum SentinelType {
endOfSegment @0;
endOfRoute @1;
startOfSegment @2;
startOfRoute @3;
}
type @0 :SentinelType;
}

struct Event {
# in nanoseconds?
logMonoTime @0 :UInt64;
Expand Down Expand Up @@ -1933,7 +2002,7 @@ struct Event {
gpsLocationExternal @48 :GpsLocationData;
location @49 :LiveLocationData;
uiNavigationEvent @50 :UiNavigationEvent;
liveLocationKalman @51 :LiveLocationData;
liveLocationKalmanDEPRECATED @51 :LiveLocationData;
testJoystick @52 :Joystick;
orbOdometry @53 :OrbOdometry;
orbFeatures @54 :OrbFeatures;
Expand All @@ -1953,5 +2022,7 @@ struct Event {
carParams @69: Car.CarParams;
frontFrame @70: FrameData;
dMonitoringState @71: DMonitoringState;
liveLocationKalman @72 :LiveLocationKalman;
sentinel @73 :Sentinel;
}
}
12 changes: 8 additions & 4 deletions cereal/messaging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@

context = Context()

def new_message():
def new_message(service=None, size=None):
dat = log.Event.new_message()
dat.logMonoTime = int(sec_since_boot() * 1e9)
dat.valid = True
if service is not None:
if size is None:
dat.init(service)
else:
dat.init(service, size)
return dat

def pub_sock(endpoint):
Expand Down Expand Up @@ -148,12 +153,11 @@ def __init__(self, services, ignore_alive=None, addr="127.0.0.1"):
self.sock[s] = sub_sock(s, poller=self.poller, addr=addr, conflate=True)
self.freq[s] = service_list[s].frequency

data = new_message()
try:
data.init(s)
data = new_message(s)
except capnp.lib.capnp.KjException:
# lists
data.init(s, 0)
data = new_message(s, 0)

self.data[s] = getattr(data, s)
self.logMonoTime[s] = 0
Expand Down
4 changes: 2 additions & 2 deletions cereal/service_list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ controlsState: [8007, true, 100., 100]
model: [8009, true, 20., 5]
features: [8010, true, 0.]
health: [8011, true, 2., 1]
radarState: [8012, true, 20.]
radarState: [8012, true, 20., 5]
#liveUI: [8014, true, 0.]
encodeIdx: [8015, true, 20.]
liveTracks: [8016, true, 20.]
Expand Down Expand Up @@ -57,7 +57,7 @@ orbslamCorrection: [8050, true, 0.]
liveLocationCorrected: [8051, true, 0.]
orbObservation: [8052, true, 0.]
applanixLocation: [8053, true, 0.]
liveLocationKalman: [8054, true, 0.]
liveLocationKalman: [8054, true, 0., 1]
uiNavigationEvent: [8055, true, 0.]
orbOdometry: [8057, true, 0.]
orbFeatures: [8058, false, 0.]
Expand Down
Loading

0 comments on commit be41085

Please sign in to comment.