Skip to content

Commit

Permalink
openpilot v0.8.11 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Vehicle Researcher committed Nov 29, 2021
1 parent 93e8dbb commit bf338bf
Show file tree
Hide file tree
Showing 328 changed files with 9,222 additions and 3,933 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ selfdrive/logcatd/logcatd
selfdrive/mapd/default_speeds_by_region.json
selfdrive/proclogd/proclogd
selfdrive/ui/_ui
selfdrive/ui/_soundd
selfdrive/test/longitudinal_maneuvers/out
selfdrive/visiond/visiond
selfdrive/loggerd/loggerd
Expand Down Expand Up @@ -78,3 +77,7 @@ selfdrive/modeld/thneed/compile
models/*.thneed

*.bz2

build/

!**/.gitkeep
26 changes: 15 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ EOF"""

def phone_steps(String device_type, steps) {
lock(resource: "", label: device_type, inversePrecedence: true, variable: 'device_ip', quantity: 1) {
timeout(time: 150, unit: 'MINUTES') {
timeout(time: 60, unit: 'MINUTES') {
phone(device_ip, "git checkout", readFile("selfdrive/test/setup_device_ci.sh"),)
steps.each { item ->
phone(device_ip, item[0], item[1])
Expand All @@ -53,7 +53,7 @@ pipeline {
SOURCE_DIR = "/data/openpilot_source/"
}
options {
timeout(time: 3, unit: 'HOURS')
timeout(time: 4, unit: 'HOURS')
}

stages {
Expand Down Expand Up @@ -145,10 +145,10 @@ pipeline {
stages {
stage('parallel tests') {
parallel {
stage('Devel Tests') {
stage('C2: build') {
steps {
phone_steps("eon-build", [
["build devel", "cd $SOURCE_DIR/release && EXTRA_FILES='tools/' ./build_devel.sh"],
["build master-ci", "cd $SOURCE_DIR/release && EXTRA_FILES='tools/' ./build_devel.sh"],
["build openpilot", "cd selfdrive/manager && ./build.py"],
["test manager", "python selfdrive/manager/test/test_manager.py"],
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
Expand All @@ -157,7 +157,7 @@ pipeline {
}
}

stage('Replay Tests') {
stage('C2: replay') {
steps {
phone_steps("eon2", [
["build", "cd selfdrive/manager && ./build.py"],
Expand All @@ -166,7 +166,7 @@ pipeline {
}
}

stage('HW + Unit Tests') {
stage('C2: HW + Unit Tests') {
steps {
phone_steps("eon", [
["build", "cd selfdrive/manager && ./build.py"],
Expand Down Expand Up @@ -201,29 +201,33 @@ pipeline {
}
*/

stage('tici Build') {
stage('C3: build') {
environment {
R3_PUSH = "${env.BRANCH_NAME == 'master' ? '1' : ' '}"
}
steps {
phone_steps("tici", [
["build", "cd selfdrive/manager && ./build.py"],
["build master-ci", "cd $SOURCE_DIR/release && EXTRA_FILES='tools/' ./build_devel.sh"],
["build openpilot", "cd selfdrive/manager && ./build.py"],
["test manager", "python selfdrive/manager/test/test_manager.py"],
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
["test car interfaces", "cd selfdrive/car/tests/ && ./test_car_interfaces.py"],
])
}
}

stage('Unit Tests (tici)') {
stage('C3: HW + Unit Tests') {
steps {
phone_steps("tici2", [
["build", "cd selfdrive/manager && ./build.py"],
["test boardd loopback", "python selfdrive/boardd/tests/test_boardd_loopback.py"],
["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"],
["test encoder", "LD_LIBRARY_PATH=/usr/local/lib python selfdrive/loggerd/tests/test_encoder.py"],
])
}
}

stage('EON camerad') {
stage('C2: camerad') {
steps {
phone_steps("eon-party", [
["build", "cd selfdrive/manager && ./build.py"],
Expand All @@ -233,7 +237,7 @@ pipeline {
}
}

stage('tici camerad') {
stage('C3: camerad') {
steps {
phone_steps("tici-party", [
["build", "cd selfdrive/manager && ./build.py"],
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Table of Contents
What is openpilot?
------

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

<table>
<tr>
Expand Down Expand Up @@ -61,6 +61,8 @@ 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. Check out [the contributing docs](docs/CONTRIBUTING.md).

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

You can add support for your car by following guides we have written for [Brand](https://blog.comma.ai/how-to-write-a-car-port-for-openpilot/) and [Model](https://blog.comma.ai/openpilot-port-guide-for-toyota-models/) 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/).
Expand Down
14 changes: 14 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
Version 0.8.11 (2021-11-29)
========================
* Support for CAN FD on the red panda
* Support for an external panda on the comma three
* Navigation: Show more detailed instructions when approaching maneuver
* Fixed occasional steering faults on GM cars thanks to jyoung8607!
* Nissan ECU firmware fingerprinting thanks to robin-reckmann, martinl, and razem-io!
* Cadillac Escalade ESV 2016 support thanks to Gibby!
* Genesis G70 2020 support thanks to tecandrew!
* Hyundai Santa Fe Hybrid 2022 support thanks to sunnyhaibin!
* Mazda CX-9 2021 support thanks to Jacar!
* Volkswagen Polo 2020 support thanks to jyoung8607!
* Volkswagen T-Roc 2021 support thanks to jyoung8607!

Version 0.8.10 (2021-11-01)
========================
* New driving model
Expand Down
12 changes: 9 additions & 3 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ AddOption('--test',
action='store_true',
help='build test files')

AddOption('--setup',
AddOption('--extras',
action='store_true',
help='build setup and installer files')
help='build misc extras, like setup and installer files')

AddOption('--kaitai',
action='store_true',
Expand Down Expand Up @@ -68,6 +68,7 @@ lenv = {
"PYTHONPATH": Dir("#").abspath + ":" + Dir("#pyextra/").abspath,

"ACADOS_SOURCE_DIR": Dir("#third_party/acados/acados").abspath,
"ACADOS_PYTHON_INTERFACE_PATH": Dir("#pyextra/acados_template").abspath,
"TERA_PATH": Dir("#").abspath + f"/third_party/acados/{arch}/t_renderer",
}

Expand Down Expand Up @@ -181,12 +182,14 @@ env = Environment(
"-O2",
"-Wunused",
"-Werror",
"-Wshadow",
"-Wno-unknown-warning-option",
"-Wno-deprecated-register",
"-Wno-register",
"-Wno-inconsistent-missing-override",
"-Wno-c99-designator",
"-Wno-reorder-init-list",
"-Wno-error=unused-but-set-variable",
] + cflags + ccflags,

CPPPATH=cpppath + [
Expand Down Expand Up @@ -267,7 +270,7 @@ def abspath(x):
py_include = sysconfig.get_paths()['include']
envCython = env.Clone()
envCython["CPPPATH"] += [py_include, np.get_include()]
envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-deprecated-declarations"]
envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-shadow", "-Wno-deprecated-declarations"]

envCython["LIBS"] = []
if arch == "Darwin":
Expand Down Expand Up @@ -429,6 +432,9 @@ SConscript(['selfdrive/ui/SConscript'])
if arch != "Darwin":
SConscript(['selfdrive/logcatd/SConscript'])

if GetOption('test'):
SConscript('panda/tests/safety/SConscript')

external_sconscript = GetOption('external_sconscript')
if external_sconscript:
SConscript([external_sconscript])
12 changes: 8 additions & 4 deletions cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
wideRoadCameraError @102;
localizerMalfunction @103;
highCpuUsage @105;
cruiseMismatch @106;

driverMonitorLowAccDEPRECATED @68;
radarCanErrorDEPRECATED @15;
Expand Down Expand Up @@ -150,6 +151,7 @@ struct CarState {
# brake pedal, 0.0-1.0
brake @5 :Float32; # this is user pedal only
brakePressed @6 :Bool; # this is user pedal only
brakeHoldActive @38 :Bool;

# steering wheel
steeringAngleDeg @7 :Float32;
Expand Down Expand Up @@ -289,6 +291,8 @@ struct CarControl {
active @7 :Bool;

actuators @6 :Actuators;
roll @8 :Float32;
pitch @9 :Float32;

cruiseControl @4 :CruiseControl;
hudControl @5 :HUDControl;
Expand Down Expand Up @@ -350,11 +354,11 @@ struct CarControl {
chimeEngage @1;
chimeDisengage @2;
chimeError @3;
chimeWarning1 @4;
chimeWarning2 @5;
chimeWarningRepeat @6;
chimeWarning1 @4; # unused
chimeWarningRepeat @5;
chimeWarningRepeatInfinite @6;
chimePrompt @7;
chimeWarning2Repeat @8;
chimeWarning2RepeatInfinite @8;
}
}

Expand Down
51 changes: 51 additions & 0 deletions cereal/log.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ struct DeviceState @0xa4d8b5af2aa492eb {
chargingDisabled @18 :Bool;
offroadPowerUsageUwh @23 :UInt32;
carBatteryCapacityUwh @25 :UInt32;
powerDrawW @40 :Float32;

# device thermals
cpuTempC @26 :List(Float32);
Expand All @@ -315,11 +316,18 @@ struct DeviceState @0xa4d8b5af2aa492eb {
ambientTempC @30 :Float32;
nvmeTempC @35 :List(Float32);
modemTempC @36 :List(Float32);
pmicTempC @39 :List(Float32);
thermalZones @38 :List(ThermalZone);
thermalStatus @14 :ThermalStatus;

fanSpeedPercentDesired @10 :UInt16;
screenBrightnessPercent @37 :Int8;

struct ThermalZone {
name @0 :Text;
temp @1 :Float32;
}

enum ThermalStatus {
green @0;
yellow @1;
Expand Down Expand Up @@ -685,6 +693,7 @@ struct ModelDataV2 {
orientation @5 :XYZTData;
velocity @6 :XYZTData;
orientationRate @7 :XYZTData;
acceleration @19 :XYZTData;

# prediction lanelines and road edges
laneLines @8 :List(XYZTData);
Expand Down Expand Up @@ -1285,6 +1294,7 @@ struct DriverMonitoringState @0xb83cda094a1da284 {
struct Boot {
wallTimeNanos @0 :UInt64;
pstore @4 :Map(Text, Data);
commands @5 :Map(Text, Data);
launchLog @3 :Text;

lastKmsgDEPRECATED @1 :Data;
Expand Down Expand Up @@ -1372,6 +1382,44 @@ struct UploaderState {
lastFilename @6 :Text;
}

struct NavInstruction {
maneuverPrimaryText @0 :Text;
maneuverSecondaryText @1 :Text;
maneuverDistance @2 :Float32; # m
maneuverType @3 :Text; # TODO: Make Enum
maneuverModifier @4 :Text; # TODO: Make Enum

distanceRemaining @5 :Float32; # m
timeRemaining @6 :Float32; # s
timeRemainingTypical @7 :Float32; # s

lanes @8 :List(Lane);
showFull @9 :Bool;

struct Lane {
directions @0 :List(Direction);
active @1 :Bool;
activeDirection @2 :Direction;
}

enum Direction {
none @0;
left @1;
right @2;
straight @3;
}

}

struct NavRoute {
coordinates @0 :List(Coordinate);

struct Coordinate {
latitude @0 :Float32;
longitude @1 :Float32;
}
}

struct Event {
logMonoTime @0 :UInt64; # nanoseconds
valid @67 :Bool = true;
Expand Down Expand Up @@ -1429,6 +1477,9 @@ struct Event {
deviceState @6 :DeviceState;
logMessage @18 :Text;

# navigation
navInstruction @82 :NavInstruction;
navRoute @83 :NavRoute;

# *********** debug ***********
testJoystick @52 :Joystick;
Expand Down
2 changes: 2 additions & 0 deletions cereal/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def __init__(self, port: int, should_log: bool, frequency: float, decimation: Op
"modelV2": (True, 20., 40),
"managerState": (True, 2., 1),
"uploaderState": (True, 0., 1),
"navInstruction": (True, 0.),
"navRoute": (True, 0.),

# debug
"testJoystick": (False, 0.),
Expand Down
27 changes: 18 additions & 9 deletions cereal/visionipc/visionbuf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,28 @@ void visionbuf_compute_aligned_width_and_height(int width, int height, int *alig
#endif
}

void VisionBuf::init_rgb(size_t width, size_t height, size_t stride) {
void VisionBuf::init_rgb(size_t init_width, size_t init_height, size_t init_stride) {
this->rgb = true;
this->width = width;
this->height = height;
this->stride = stride;
this->width = init_width;
this->height = init_height;
this->stride = init_stride;
}

void VisionBuf::init_yuv(size_t width, size_t height){
void VisionBuf::init_yuv(size_t init_width, size_t init_height){
this->rgb = false;
this->width = width;
this->height = height;
this->width = init_width;
this->height = init_height;

this->y = (uint8_t *)this->addr;
this->u = this->y + (width * height);
this->v = this->u + (width / 2 * height / 2);
this->u = this->y + (this->width * this->height);
this->v = this->u + (this->width / 2 * this->height / 2);
}


uint64_t VisionBuf::get_frame_id() {
return *frame_id;
}

void VisionBuf::set_frame_id(uint64_t id) {
*frame_id = id;
}
Loading

0 comments on commit bf338bf

Please sign in to comment.