Compare commits

..

12 Commits
0.8.6 ... 0.8.7

Author SHA1 Message Date
eFini
39f2d349b5 clean up 2021-10-27 15:38:32 +08:00
eFini
c0a8416229 Merge pull request #99 from lirudy/0.8.7
fix: vw white panda with j533 acc error
2021-08-31 22:09:35 +10:00
Kumar
92883c53dc Merge pull request #100 from stingshen/2018_chinese_camry_hybrid_fingerprint
add 2018 chinese camry hybrid fingerprint
2021-08-30 23:46:13 -07:00
Yi
5b31463d9c add 2018 chinese camry hybrid fingerprint 2021-08-30 16:52:33 +00:00
eFini
7489d32183 VW quick fix 2021-08-30 17:00:51 +08:00
Rick Lan
30e0313357 vw quick fix 2021-08-26 08:30:15 +08:00
lirudy
1afd68d485 Update safety_defaults.h
fix vw j533 mode for w/g panda: relay stock signal on j533 bus , just ONLY for White / Grey Panda!!!
2021-08-25 23:33:40 +08:00
lirudy
c2d44cb333 Update power_saving.h 2021-08-25 23:03:11 +08:00
lirudy
9f1a209f4f Update SConscript
fix vw check file name
2021-08-25 23:02:04 +08:00
Rick Lan
f7433d9426 dragonpilot mod for 0.8.7-4 2021-08-25 08:51:47 +08:00
Adeeb Shihadeh
444aace15f Hotfix: agnos 1.2 (#21856)
* agnos 1.2 (#21847)

* update nav ad (#21836)

* the comma three
2021-08-04 11:22:14 -07:00
Vehicle Researcher
5face13bc5 openpilot v0.8.7 release 2021-08-02 20:27:11 -07:00
293 changed files with 8680 additions and 1251 deletions

2
.gitignore vendored
View File

@@ -41,6 +41,8 @@ selfdrive/boardd/boardd
selfdrive/logcatd/logcatd
selfdrive/mapd/default_speeds_by_region.json
selfdrive/proclogd/proclogd
selfdrive/test/longitudinal_maneuvers/out
selfdrive/visiond/visiond
selfdrive/loggerd/loggerd

View File

@@ -1,3 +1,44 @@
dragonpilot 0.8.7-4
========================
* 2017 JADE w/ Added Comma Pedal Support. (Thanks to @lijunhao731)
* Fixed toyota / honda brake light display. (Thanks to @loveloveses)
* Fixed UI toggle. (Thanks to @鄧育林@謝聖鴻)
* Fixed VW resume/display issue. (Thanks to @SKY)
* Fixed CJK font installation issue.
dragonpilot 0.8.7-3
========================
* Bug fixes.
* Fixed gpxd.
* Added some Chinese support.
dragonpilot 0.8.7-2
========================
* Fixed sound issue.
* Changed gpx logs to OSM compatible format.
* HONDA: Added BSM support for CRV-Hybrid.
* HONDA: Added toggle to force displaying km/h in HUD.
* TOYOTA: Add new Toggles under DP - Cars to enable/disable Following Modes / Accel Modes with physical button feature.
dragonpilot 0.8.7-1
========================
* Based on openpilot 0.8.7 devel.
* Support 1+3t / C2 / Jetson Xavier NX.
* Support White / Grey Panda.
* TOYOTA: Can now change Following Modes with physical button from the steering wheel.
* TOYOTA: Can now change Acceleration Modes with physical button if your car supports it.
* TOYOTA: Added Low speed override toggles.
* Dev UI now displays RPM reading.
* Added Prebuilt toggle for faster boot.
* Lexus RX high RPM fix. (Thanks to @crazysim).
* Added toggle to launch Language settings.
* Added toggle to launch Volume settings.
* Added toggle to launch date/time settings.
* Added toggle to flash panda.
* Added toggle to recover panda firmware.
* Added toggle to delete logging (/sdcard/realdata).
* Added GPS Logger.
dragonpilot 0.8.6-1
========================
* Based on openpilot 0.8.6 devel.

View File

@@ -1,28 +1,35 @@
# CONTRIBUTORS
Due to the way we manage the source code, it is not possible to see all the contributors info, hence we create a list here.
Due to the way we manage the source code, it is not possible to see all the contributors' info, hence we create a list here.
If you have contributed to DP project before and your name is not listed here, feel free to send us a PR to update this!
name | github | contribution
------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------
andy741217 | [andy741217](https://github.com/andy741217) | New features, bug fixes
Arne Schwarck | [arne182](https://github.com/arne182) | New features, bug fixes
berno22 | [berno22](https://github.com/berno22) | New car fingerprint
Bobbydough | [Bobbydough](https://github.com/bobbydough) | Bug fixes
Curtis Jenkins | [actuallylemoncurd](https://github.com/actuallylemoncurd) | New Features
DFyffe | [donfyffe](https://github.com/donfyffe) | New features, bug fixes
dinglx | [dingliangxue](https://github.com/dingliangxue) | New features, bug fixes
eyezenheim | [eyezenheim](https://github.com/eyezenheim) | Tester
kegman | [kegman](https://github.com/kegman) | New features, bug fixes
kumar | [rav4kumar](https://github.com/rav4kumar) | DP main maintainer, New features, bug fixes
lijunhao731 | [lijunhao731](https://github.com/lijunhao731) | New car fingerprint
lirudy | [lirudy](https://github.com/lirudy) | Bug fixes
LOVEChen | [LOVEChen](https://github.com/LOVEChen) | Bug fixes
loveloveses | [loveloveses](https://github.com/loveloveses) | Bug fixes, DP wiki main maintainer
menwenliang | [menwenliang](https://github.com/menwenliang) | New features
Rick Lan | [efinilan](https://github.com/efinilan) | Project lead
rming | [Rming](https://github.com/rming) | Bug fixes, wiki contributor
sebastian4k | [sebastian4k](https://github.com/sebastian4k) | Bug fixes
Shane Smiskol | [sshane](https://github.com/sshane) | New features, bug fixes
toyboxZ | [toyboxZ](https://github.com/toyboxZ) | New features, bug fixes
### TEAM
Name | github | Role
------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------
cafe | [cafe](https://github.com/coffice12) | Resource Provider
kumar | [rav4kumar](https://github.com/rav4kumar) | Release Maintainer
loveloveses | [loveloveses](https://github.com/loveloveses) | Wiki Maintainer
Rick Lan | [efinilan](https://github.com/efinilan) | Release Maintainer
### CONTRIBUTORS
Name | github
------------------------------------------------------------ | ------------------------------------------------------------
andy741217 | [andy741217](https://github.com/andy741217)
Arne Schwarck | [arne182](https://github.com/arne182)
berno22 | [berno22](https://github.com/berno22)
Bobbydough | [Bobbydough](https://github.com/bobbydough)
cgw1968 | [cgw1968](https://github.com/cgw1968-5779)
Curtis Jenkins | [actuallylemoncurd](https://github.com/actuallylemoncurd)
DFyffe | [donfyffe](https://github.com/donfyffe)
dinglx | [dingliangxue](https://github.com/dingliangxue)
eyezenheim | [eyezenheim](https://github.com/eyezenheim)
kegman | [kegman](https://github.com/kegman)
lijunhao731 | [lijunhao731](https://github.com/lijunhao731)
lirudy | [lirudy](https://github.com/lirudy)
LOVEChen | [LOVEChen](https://github.com/LOVEChen)
menwenliang | [menwenliang](https://github.com/menwenliang)
Nelson Chen | [nelsonjchen](https://github.com/nelsonjchen)
rming | [Rming](https://github.com/rming)
sebastian4k | [sebastian4k](https://github.com/sebastian4k)
Shane Smiskol | [sshane](https://github.com/sshane)
toyboxZ | [toyboxZ](https://github.com/toyboxZ)

View File

@@ -1,9 +1,9 @@
How to install on Oneplus 3t?
------
1. clone dragonpilot to /data/ and make sure it's named openpilot:
(手動安裝切換至 dragonpilot 0.8.6 branch)
(手動安裝切換至 dp)
```
cd /data/ && rm -fr openpilot; && git clone https://github.com/dragonpilot-community/dragonpilot.git -b 0.8.4
cd /data/ && rm -fr openpilot ; git clone https://github.com/dragonpilot-community/dragonpilot.git openpilot -b 0.8.7
```
2. run command:
@@ -22,4 +22,4 @@ cd /data/openpilot/scripts/ && ./oneplus_update_neos.sh
(在 Recovery mode點選 `apply update` -> `Choose from emulated` -> `0/` -> `update.zip` -> `Reboot system now`)
6. You should be able to boot into openpilot, if touch screen is not working, try to reboot again.
(你現在應該可以進入 openpilot 畫面,如果點擊畫面沒有反應,請再重新開機一次)
(你現在應該可以進入 openpilot 畫面,如果點擊畫面沒有反應,請再重新開機一次)

10
JETSON.md Normal file
View File

@@ -0,0 +1,10 @@
set_core_affinity
------
Jetson Xavier NX has 6 cores running at 1.9 GHz, here is what I've defined
0 = (not specified)
1 = plannerd / radard
2 = boardd
3 = controlsd
4 = camerad
5 = modeld

27
Jenkinsfile vendored
View File

@@ -71,7 +71,24 @@ pipeline {
}
steps {
phone_steps("eon-build", [
["build release2-staging and dashcam-staging", "cd release && PUSH=1 ./build_release2.sh"],
["build release2-staging & dashcam-staging", "cd release && PUSH=1 ./build_release2.sh"],
])
}
}
stage('Build release3') {
agent {
docker {
image 'python:3.7.3'
args '--user=root'
}
}
when {
branch 'devel-staging'
}
steps {
phone_steps("tici", [
["build release3-staging & dashcam3-staging", "PUSH=1 $SOURCE_DIR/release/build_release3.sh"],
])
}
}
@@ -80,7 +97,10 @@ pipeline {
when {
not {
anyOf {
branch 'master-ci'; branch 'devel'; branch 'devel-staging'; branch 'release2'; branch 'release2-staging'; branch 'dashcam'; branch 'dashcam-staging'; branch 'testing-closet*'; branch 'hotfix-*'
branch 'master-ci'; branch 'devel'; branch 'devel-staging';
branch 'release2'; branch 'release2-staging'; branch 'dashcam'; branch 'dashcam-staging';
branch 'release3'; branch 'release3-staging'; branch 'dashcam3'; branch 'dashcam3-staging';
branch 'testing-closet*'; branch 'hotfix-*'
}
}
}
@@ -152,7 +172,7 @@ pipeline {
phone_steps("eon", [
["build", "cd selfdrive/manager && ./build.py"],
["test athena", "nosetests -s selfdrive/athena/tests/test_athenad_old.py"],
["test sounds", "nosetests -s selfdrive/test/test_sounds.py"],
["test sounds", "nosetests -s selfdrive/ui/tests/test_sounds.py"],
["test boardd loopback", "nosetests -s selfdrive/boardd/tests/test_boardd_loopback.py"],
["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"],
["test encoder", "python selfdrive/loggerd/tests/test_encoder.py"],
@@ -191,7 +211,6 @@ pipeline {
phone_steps("tici", [
["build", "cd selfdrive/manager && ./build.py"],
["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"],
//["build release3-staging", "cd release && PUSH=${env.R3_PUSH} ./build_release3.sh"],
])
}
}

View File

@@ -1,4 +1,4 @@
[![](https://i.imgur.com/UelUjKAh.png)](#)
![](https://user-images.githubusercontent.com/37757984/127420744-89ca219c-8f8e-46d3-bccf-c1cb53b81bb1.png)
Table of Contents
=======================
@@ -57,7 +57,7 @@ openpilot should preserve all other vehicle's stock features, including, but are
Supported Hardware
------
At the moment, openpilot supports the EON Gold DevKit and the [comma two](https://comma.ai/shop/products/comma-two-devkit). A [car harness](https://comma.ai/shop/products/car-harness) is recommended to connect the EON or comma two to the car. For experimental purposes, openpilot can also run on an Ubuntu computer with external [webcams](https://github.com/commaai/openpilot/tree/master/tools/webcam).
At the moment, openpilot supports the EON Gold DevKit, [comma two](https://comma.ai/shop/products/two), and [comma three](https://comma.ai/shop/products/three). A [car harness](https://comma.ai/shop/products/car-harness) is recommended to connect your device to the car. For experimental purposes, openpilot can also run on an Ubuntu computer with external [webcams](https://github.com/commaai/openpilot/tree/master/tools/webcam).
Supported Cars
------
@@ -204,6 +204,7 @@ Community Maintained Cars and Features
| Volkswagen| Jetta 2018-20 | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| Jetta GLI 2021 | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| Passat 2016-17<sup>2</sup> | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| T-Cross 2021 | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| Tiguan 2020 | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| Touran 2017 | Driver Assistance | Stock | 0mph | 0mph |
@@ -219,7 +220,7 @@ Although they're not upstream, the community has openpilot running on other make
Installation Instructions
------
Install openpilot on an EON Gold or comma two by entering ``https://openpilot.comma.ai`` during the installer setup.
Install openpilot on a supported device by entering ``https://openpilot.comma.ai`` during the installer setup.
Follow these [video instructions](https://youtu.be/lcjqxCymins) to properly mount the device 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 device mounting.
@@ -298,13 +299,13 @@ openpilot is open source software: the user is free to disable data collection i
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.
By using openpilot, you agree to [our Privacy Policy](https://connect.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 details.
* openpilot has software in the loop [tests](.github/workflows/test.yaml) that run on every commit.
* openpilot has software in the loop [tests](.github/workflows/selfdrive_tests.yaml) 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.

View File

@@ -1,3 +1,9 @@
Version 0.8.7 (2021-07-31)
========================
* comma three support!
* Navigation alpha for the comma three!
* Volkswagen T-Cross 2021 support thanks to jyoung8607!
Version 0.8.6 (2021-07-21)
========================
* Revamp lateral and longitudinal planners

View File

@@ -141,6 +141,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
timebombWarn @110;
timebombBypassing @111;
timebombBypassed @112;
mapdAlert @113;
}
}
@@ -209,6 +210,7 @@ struct CarState {
# dp
lkMode @37 :Bool;
stopSteering @38 :Bool; # timebomb - stopSteering
engineRPM @39 :Float32;
struct WheelSpeeds {
# optional wheel speeds

View File

@@ -45,13 +45,17 @@ struct DragonConf {
dpUiVolume @31 :Int8;
dpToyotaLdw @32 :Bool;
dpToyotaSng @33 :Bool;
dpVwTimebombAssist @34 :Bool;
dpIpAddr @35 :Text;
dpCameraOffset @36 :Int8;
dpPathOffset @37 :Int8;
dpLocale @38 :Text;
dpSrLearner @39 :Bool;
dpSrCustom @40 :Float32;
dpAppd @41 :Bool;
dpDebug @42 :Bool;
}
dpToyotaCruiseOverride @34 :Bool;
dpToyotaCruiseOverrideVego @35 :Bool;
dpToyotaCruiseOverrideAt @36 :Float32;
dpToyotaCruiseOverrideSpeed @37 :Float32;
dpVwTimebombAssist @38 :Bool;
dpIpAddr @39 :Text;
dpCameraOffset @40 :Int8;
dpPathOffset @41 :Int8;
dpLocale @42 :Text;
dpSrLearner @43 :Bool;
dpSrCustom @44 :Float32;
dpAppd @45 :Bool;
dpMapd @46 :Bool;
}

View File

@@ -434,6 +434,7 @@ struct PandaState @0xa7649e2575e4591e {
pedal @4;
uno @5;
dos @6;
red @7;
}
enum UsbPowerMode {

View File

@@ -49,7 +49,6 @@ class VisionBuf {
// ion
int handle = 0;
bool owner = false;
void allocate(size_t len);
void import();

View File

@@ -62,7 +62,6 @@ void VisionBuf::allocate(size_t len) {
memset(addr, 0, ion_alloc.len);
this->owner = true;
this->len = len;
this->mmap_len = ion_alloc.len;
this->addr = addr;
@@ -82,7 +81,6 @@ void VisionBuf::import(){
err = ioctl(ion_fd, ION_IOC_IMPORT, &fd_data);
assert(err == 0);
this->owner = false;
this->handle = fd_data.handle;
this->addr = mmap(NULL, this->mmap_len, PROT_READ | PROT_WRITE, MAP_SHARED, this->fd, 0);
assert(this->addr != MAP_FAILED);
@@ -139,10 +137,6 @@ void VisionBuf::free() {
munmap(this->addr, this->mmap_len);
close(this->fd);
// Free the ION buffer if we also shared it
if (this->owner){
struct ion_handle_data handle_data = {.handle = this->handle};
int ret = ioctl(ion_fd, ION_IOC_FREE, &handle_data);
assert(ret == 0);
}
struct ion_handle_data handle_data = {.handle = this->handle};
ioctl(ion_fd, ION_IOC_FREE, &handle_data);
}

View File

@@ -122,7 +122,6 @@ void VisionIpcServer::listener(){
bufs[i].buf_cl = 0;
bufs[i].copy_q = 0;
bufs[i].handle = 0;
bufs[i].owner = false;
bufs[i].server_id = server_id;
}

View File

@@ -60,14 +60,22 @@ confs = [
{'name': 'dp_ui_brightness', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 100, 'conf_type': ['param', 'struct']},
{'name': 'dp_ui_volume', 'default': -5, 'type': 'Int8', 'min': -5, 'max': 100, 'conf_type': ['param', 'struct']},
# toyota
{'name': 'dp_lexus_rx_rpm_fix', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param']},
{'name': 'dp_toyota_ldw', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_toyota_sng', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_toyota_zss', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_toyota_fp_btn_link', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_toyota_ap_btn_link', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_toyota_disable_relay', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_toyota_cruise_override', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_toyota_cruise_override_vego', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}, {'name': 'dp_toyota_cruise_override', 'vals': [True]}], 'conf_type': ['param', 'struct']},
{'name': 'dp_toyota_cruise_override_at', 'default': 44, 'type': 'Float32', 'depends': [{'name': 'dp_atl', 'vals': [False]}, {'name': 'dp_toyota_cruise_override', 'vals': [True]}], 'min': 0, 'max': 50., 'conf_type': ['param', 'struct']},
{'name': 'dp_toyota_cruise_override_speed', 'default': 32, 'type': 'Float32', 'depends': [{'name': 'dp_atl', 'vals': [False]}, {'name': 'dp_toyota_cruise_override', 'vals': [True]}], 'min': 0, 'max': 50., 'conf_type': ['param', 'struct']},
# hyundai
{'name': 'dp_hkg_smart_mdps', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
# honda
{'name': 'dp_honda_eps_mod', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_honda_kmh_display', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
# volkswagen
{'name': 'dp_vw_panda', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_vw_timebomb_assist', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
@@ -96,7 +104,12 @@ confs = [
{'name': 'dp_panda_fake_black', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_panda_no_gps', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_last_candidate', 'default': '', 'type': 'Text', 'conf_type': ['param']},
{'name': 'dp_debug', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
{'name': 'dp_prebuilt', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_gpxd', 'default': False, 'type': 'Bool', 'conf_type': ['param']},
{'name': 'dp_mapd', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
# custom server support
# {'name': 'dp_custom_server', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']},
# {'name': 'dp_custom_server_url', 'default': 'api.retropilot.org', 'type': 'Text', 'depends': [{'name': 'dp_custom_server', 'vals': [True]}], 'conf_type': ['param', 'struct']},
]
def get_definition(name):

View File

@@ -158,7 +158,7 @@ class SwagLogger(logging.Logger):
evt.update(kwargs)
if 'error' in kwargs:
self.error(evt)
if 'debug' in kwargs:
elif 'debug' in kwargs:
self.debug(evt)
else:
self.info(evt)

View File

@@ -0,0 +1,4 @@
#!/usr/bin/bash
cd /data/openpilot
exec ./launch_openpilot.sh

View File

@@ -1,813 +0,0 @@
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <unistd.h>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <memory>
#include <mutex>
#include <sstream>
#include <string>
#include <thread>
#include <curl/curl.h>
#include <openssl/sha.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES3/gl3.h>
#include "nanovg.h"
#define NANOVG_GLES3_IMPLEMENTATION
#include "json11.hpp"
#include "nanovg_gl.h"
#include "nanovg_gl_utils.h"
#include "selfdrive/common/framebuffer.h"
#include "selfdrive/common/touch.h"
#include "selfdrive/common/util.h"
#define USER_AGENT "NEOSUpdater-0.2"
#define MANIFEST_URL_NEOS_STAGING "https://github.com/commaai/eon-neos/raw/master/update.staging.json"
#define MANIFEST_URL_NEOS_LOCAL "http://192.168.5.1:8000/neosupdate/update.local.json"
#define MANIFEST_URL_NEOS "https://github.com/commaai/eon-neos/raw/master/update.json"
const char *manifest_url = MANIFEST_URL_NEOS;
#define RECOVERY_DEV "/dev/block/bootdevice/by-name/recovery"
#define RECOVERY_COMMAND "/cache/recovery/command"
#define UPDATE_DIR "/data/neoupdate"
extern const uint8_t bin_opensans_regular[] asm("_binary_opensans_regular_ttf_start");
extern const uint8_t bin_opensans_regular_end[] asm("_binary_opensans_regular_ttf_end");
extern const uint8_t bin_opensans_semibold[] asm("_binary_opensans_semibold_ttf_start");
extern const uint8_t bin_opensans_semibold_end[] asm("_binary_opensans_semibold_ttf_end");
extern const uint8_t bin_opensans_bold[] asm("_binary_opensans_bold_ttf_start");
extern const uint8_t bin_opensans_bold_end[] asm("_binary_opensans_bold_ttf_end");
namespace {
std::string sha256_file(std::string fn, size_t limit=0) {
SHA256_CTX ctx;
SHA256_Init(&ctx);
FILE *file = fopen(fn.c_str(), "rb");
if (!file) return "";
const size_t buf_size = 8192;
std::unique_ptr<char[]> buffer( new char[ buf_size ] );
bool read_limit = (limit != 0);
while (true) {
size_t read_size = buf_size;
if (read_limit) read_size = std::min(read_size, limit);
size_t bytes_read = fread(buffer.get(), 1, read_size, file);
if (!bytes_read) break;
SHA256_Update(&ctx, buffer.get(), bytes_read);
if (read_limit) {
limit -= bytes_read;
if (limit == 0) break;
}
}
uint8_t hash[SHA256_DIGEST_LENGTH];
SHA256_Final(hash, &ctx);
fclose(file);
return util::tohex(hash, sizeof(hash));
}
size_t download_string_write(void *ptr, size_t size, size_t nmeb, void *up) {
size_t sz = size * nmeb;
((std::string*)up)->append((char*)ptr, sz);
return sz;
}
std::string download_string(CURL *curl, std::string url) {
std::string os;
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 0);
curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
curl_easy_setopt(curl, CURLOPT_RESUME_FROM, 0);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, download_string_write);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &os);
CURLcode res = curl_easy_perform(curl);
if (res != CURLE_OK) {
return "";
}
return os;
}
size_t download_file_write(void *ptr, size_t size, size_t nmeb, void *up) {
return fwrite(ptr, size, nmeb, (FILE*)up);
}
int battery_capacity() {
std::string bat_cap_s = util::read_file("/sys/class/power_supply/battery/capacity");
return atoi(bat_cap_s.c_str());
}
int battery_current() {
std::string current_now_s = util::read_file("/sys/class/power_supply/battery/current_now");
return atoi(current_now_s.c_str());
}
bool has_no_battery() {
if (FILE *file = fopen("/data/params/d/dp_no_batt", "r")) {
fclose(file);
std::string has_no_batt = util::read_file("/data/params/d/dp_no_batt");
return atoi(has_no_batt.c_str()) == 1;
} else {
return false;
}
}
bool check_battery() {
int bat_cap = battery_capacity();
int current_now = battery_current();
return (has_no_battery())? true : bat_cap > 35 || (current_now < 0 && bat_cap > 10);
}
bool check_space() {
struct statvfs stat;
if (statvfs("/data/", &stat) != 0) {
return false;
}
size_t space = stat.f_bsize * stat.f_bavail;
return space > 2000000000ULL; // 2GB
}
static void start_settings_activity(const char* name) {
char launch_cmd[1024];
snprintf(launch_cmd, sizeof(launch_cmd),
"am start -W --ez :settings:show_fragment_as_subsetting true -n 'com.android.settings/.%s'", name);
system(launch_cmd);
}
bool is_settings_active() {
FILE *fp;
char sys_output[4096];
fp = popen("/bin/dumpsys window windows", "r");
if (fp == NULL) {
return false;
}
bool active = false;
while (fgets(sys_output, sizeof(sys_output), fp) != NULL) {
if (strstr(sys_output, "mCurrentFocus=null") != NULL) {
break;
}
if (strstr(sys_output, "mCurrentFocus=Window") != NULL) {
active = true;
break;
}
}
pclose(fp);
return active;
}
struct Updater {
bool do_exit = false;
TouchState touch;
int fb_w, fb_h;
std::unique_ptr<FrameBuffer> fb;
NVGcontext *vg = NULL;
int font_regular;
int font_semibold;
int font_bold;
std::thread update_thread_handle;
std::mutex lock;
enum UpdateState {
CONFIRMATION,
LOW_BATTERY,
RUNNING,
ERROR,
};
UpdateState state;
std::string progress_text;
float progress_frac;
std::string error_text;
std::string low_battery_text;
std::string low_battery_title;
std::string low_battery_context;
std::string battery_cap_text;
int min_battery_cap = 35;
// button
int b_x, b_w, b_y, b_h;
int balt_x;
// download stage writes these for the installation stage
int recovery_len;
std::string recovery_hash;
std::string recovery_fn;
std::string ota_fn;
CURL *curl = NULL;
void ui_init() {
touch_init(&touch);
fb = std::make_unique<FrameBuffer>("updater", 0x00001000, false, &fb_w, &fb_h);
fb->set_power(HWC_POWER_MODE_NORMAL);
vg = nvgCreateGLES3(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG);
assert(vg);
font_regular = nvgCreateFontMem(vg, "opensans_regular", (unsigned char*)bin_opensans_regular, (bin_opensans_regular_end - bin_opensans_regular), 0);
assert(font_regular >= 0);
font_semibold = nvgCreateFontMem(vg, "opensans_semibold", (unsigned char*)bin_opensans_semibold, (bin_opensans_semibold_end - bin_opensans_semibold), 0);
assert(font_semibold >= 0);
font_bold = nvgCreateFontMem(vg, "opensans_bold", (unsigned char*)bin_opensans_bold, (bin_opensans_bold_end - bin_opensans_bold), 0);
assert(font_bold >= 0);
b_w = 640;
balt_x = 200;
b_x = fb_w-b_w-200;
b_y = 720;
b_h = 220;
if (download_stage(true)) {
state = RUNNING;
update_thread_handle = std::thread(&Updater::run_stages, this);
} else {
state = CONFIRMATION;
}
}
int download_file_xferinfo(curl_off_t dltotal, curl_off_t dlno,
curl_off_t ultotal, curl_off_t ulnow) {
{
std::lock_guard<std::mutex> guard(lock);
if (dltotal != 0) {
progress_frac = (float) dlno / dltotal;
}
}
// printf("info: %ld %ld %f\n", dltotal, dlno, progress_frac);
return 0;
}
bool download_file(std::string url, std::string out_fn) {
FILE *of = fopen(out_fn.c_str(), "ab");
assert(of);
CURLcode res;
long last_resume_from = 0;
fseek(of, 0, SEEK_END);
int tries = 4;
bool ret = false;
while (true) {
long resume_from = ftell(of);
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 0);
curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
curl_easy_setopt(curl, CURLOPT_RESUME_FROM, resume_from);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, download_file_write);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, of);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
curl_easy_setopt(curl, CURLOPT_XFERINFODATA, this);
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, &Updater::download_file_xferinfo);
CURLcode res = curl_easy_perform(curl);
long response_code = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
// double content_length = 0.0;
// curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &content_length);
printf("download %s res %d, code %ld, resume from %ld\n", url.c_str(), res, response_code, resume_from);
if (res == CURLE_OK) {
ret = true;
break;
} else if (res == CURLE_HTTP_RETURNED_ERROR && response_code == 416) {
// failed because the file is already complete?
ret = true;
break;
} else if (resume_from == last_resume_from) {
// failed and dind't make make forward progress. only retry a couple times
tries--;
if (tries <= 0) {
break;
}
}
last_resume_from = resume_from;
}
// printf("res %d\n", res);
// printf("- %ld %f\n", response_code, content_length);
fclose(of);
return ret;
}
void set_progress(std::string text) {
std::lock_guard<std::mutex> guard(lock);
progress_text = text;
}
void set_error(std::string text) {
std::lock_guard<std::mutex> guard(lock);
error_text = text;
state = ERROR;
}
void set_battery_low() {
std::lock_guard<std::mutex> guard(lock);
state = LOW_BATTERY;
}
void set_running() {
std::lock_guard<std::mutex> guard(lock);
state = RUNNING;
}
std::string download(std::string url, std::string hash, std::string name, bool dry_run) {
std::string out_fn = UPDATE_DIR "/" + util::base_name(url);
std::string fn_hash = sha256_file(out_fn);
if (dry_run) {
return (hash.compare(fn_hash) != 0) ? "" : out_fn;
}
// start or resume downloading if hash doesn't match
if (hash.compare(fn_hash) != 0) {
set_progress("Downloading " + name + "...");
bool r = download_file(url, out_fn);
if (!r) {
set_error("failed to download " + name);
unlink(out_fn.c_str());
return "";
}
fn_hash = sha256_file(out_fn);
}
set_progress("Verifying " + name + "...");
printf("got %s hash: %s\n", name.c_str(), hash.c_str());
if (fn_hash != hash) {
set_error(name + " was corrupt");
unlink(out_fn.c_str());
return "";
}
return out_fn;
}
bool download_stage(bool dry_run = false) {
curl = curl_easy_init();
assert(curl);
// ** quick checks before download **
if (!check_space()) {
if (!dry_run) set_error("2GB of free space required to update");
return false;
}
mkdir(UPDATE_DIR, 0777);
set_progress("Finding latest version...");
std::string manifest_s = download_string(curl, manifest_url);
printf("manifest: %s\n", manifest_s.c_str());
std::string err;
auto manifest = json11::Json::parse(manifest_s, err);
if (manifest.is_null() || !err.empty()) {
set_error("failed to load update manifest");
return false;
}
std::string ota_url = manifest["ota_url"].string_value();
std::string ota_hash = manifest["ota_hash"].string_value();
std::string recovery_url = manifest["recovery_url"].string_value();
recovery_hash = manifest["recovery_hash"].string_value();
recovery_len = manifest["recovery_len"].int_value();
// std::string installer_url = manifest["installer_url"].string_value();
// std::string installer_hash = manifest["installer_hash"].string_value();
if (ota_url.empty() || ota_hash.empty()) {
set_error("invalid update manifest");
return false;
}
// std::string installer_fn = download(installer_url, installer_hash, "installer");
// if (installer_fn.empty()) {
// //error'd
// return;
// }
// ** handle recovery download **
if (recovery_url.empty() || recovery_hash.empty() || recovery_len == 0) {
set_progress("Skipping recovery flash...");
} else {
// only download the recovery if it differs from what's flashed
set_progress("Checking recovery...");
std::string existing_recovery_hash = sha256_file(RECOVERY_DEV, recovery_len);
printf("existing recovery hash: %s\n", existing_recovery_hash.c_str());
if (existing_recovery_hash != recovery_hash) {
recovery_fn = download(recovery_url, recovery_hash, "recovery", dry_run);
if (recovery_fn.empty()) {
// error'd
return false;
}
}
}
// ** handle ota download **
ota_fn = download(ota_url, ota_hash, "update", dry_run);
if (ota_fn.empty()) {
//error'd
return false;
}
// download sucessful
return true;
}
// thread that handles downloading and installing the update
void run_stages() {
printf("run_stages start\n");
// ** download update **
if (!check_battery()) {
set_battery_low();
int battery_cap = battery_capacity();
while(battery_cap < min_battery_cap) {
battery_cap = battery_capacity();
battery_cap_text = std::to_string(battery_cap);
util::sleep_for(1000);
}
set_running();
}
bool sucess = download_stage();
if (!sucess) {
return;
}
// ** install update **
if (!check_battery()) {
set_battery_low();
int battery_cap = battery_capacity();
while(battery_cap < min_battery_cap) {
battery_cap = battery_capacity();
battery_cap_text = std::to_string(battery_cap);
util::sleep_for(1000);
}
set_running();
}
if (!recovery_fn.empty()) {
// flash recovery
set_progress("Flashing recovery...");
FILE *flash_file = fopen(recovery_fn.c_str(), "rb");
if (!flash_file) {
set_error("failed to flash recovery");
return;
}
FILE *recovery_dev = fopen(RECOVERY_DEV, "w+b");
if (!recovery_dev) {
fclose(flash_file);
set_error("failed to flash recovery");
return;
}
const size_t buf_size = 4096;
std::unique_ptr<char[]> buffer( new char[ buf_size ] );
while (true) {
size_t bytes_read = fread(buffer.get(), 1, buf_size, flash_file);
if (!bytes_read) break;
size_t bytes_written = fwrite(buffer.get(), 1, bytes_read, recovery_dev);
if (bytes_read != bytes_written) {
fclose(recovery_dev);
fclose(flash_file);
set_error("failed to flash recovery: write failed");
return;
}
}
fclose(recovery_dev);
fclose(flash_file);
set_progress("Verifying flash...");
std::string new_recovery_hash = sha256_file(RECOVERY_DEV, recovery_len);
printf("new recovery hash: %s\n", new_recovery_hash.c_str());
if (new_recovery_hash != recovery_hash) {
set_error("recovery flash corrupted");
return;
}
}
// write arguments to recovery
FILE *cmd_file = fopen(RECOVERY_COMMAND, "wb");
if (!cmd_file) {
set_error("failed to reboot into recovery");
return;
}
fprintf(cmd_file, "--update_package=%s\n", ota_fn.c_str());
fclose(cmd_file);
set_progress("Rebooting");
// remove the continue.sh so we come back into the setup.
// maybe we should go directly into the installer, but what if we don't come back with internet? :/
//unlink("/data/data/com.termux/files/continue.sh");
// TODO: this should be generic between android versions
// IPowerManager.reboot(confirm=false, reason="recovery", wait=true)
system("service call power 16 i32 0 s16 recovery i32 1");
while (true) pause();
// execl("/system/bin/reboot", "recovery");
// set_error("failed to reboot into recovery");
}
void draw_ack_screen(const char *title, const char *message, const char *button, const char *altbutton) {
nvgFillColor(vg, nvgRGBA(255,255,255,255));
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
nvgFontFace(vg, "opensans_bold");
nvgFontSize(vg, 120.0f);
nvgTextBox(vg, 110, 220, fb_w-240, title, NULL);
nvgFontFace(vg, "opensans_regular");
nvgFontSize(vg, 86.0f);
nvgTextBox(vg, 130, 380, fb_w-260, message, NULL);
// draw button
if (button) {
nvgBeginPath(vg);
nvgFillColor(vg, nvgRGBA(8, 8, 8, 255));
nvgRoundedRect(vg, b_x, b_y, b_w, b_h, 20);
nvgFill(vg);
nvgFillColor(vg, nvgRGBA(255, 255, 255, 255));
nvgFontFace(vg, "opensans_semibold");
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
nvgText(vg, b_x+b_w/2, b_y+b_h/2, button, NULL);
nvgBeginPath(vg);
nvgStrokeColor(vg, nvgRGBA(255, 255, 255, 50));
nvgStrokeWidth(vg, 5);
nvgRoundedRect(vg, b_x, b_y, b_w, b_h, 20);
nvgStroke(vg);
}
// draw button
if (altbutton) {
nvgBeginPath(vg);
nvgFillColor(vg, nvgRGBA(8, 8, 8, 255));
nvgRoundedRect(vg, balt_x, b_y, b_w, b_h, 20);
nvgFill(vg);
nvgFillColor(vg, nvgRGBA(255, 255, 255, 255));
nvgFontFace(vg, "opensans_semibold");
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
nvgText(vg, balt_x+b_w/2, b_y+b_h/2, altbutton, NULL);
nvgBeginPath(vg);
nvgStrokeColor(vg, nvgRGBA(255, 255, 255, 50));
nvgStrokeWidth(vg, 5);
nvgRoundedRect(vg, balt_x, b_y, b_w, b_h, 20);
nvgStroke(vg);
}
}
void draw_battery_screen() {
low_battery_title = "Low Battery";
low_battery_text = "Please connect EON to your charger. Update will continue once EON battery reaches 35%.";
low_battery_context = "Current battery charge: " + battery_cap_text + "%";
nvgFillColor(vg, nvgRGBA(255,255,255,255));
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
nvgFontFace(vg, "opensans_bold");
nvgFontSize(vg, 120.0f);
nvgTextBox(vg, 110, 220, fb_w-240, low_battery_title.c_str(), NULL);
nvgFontFace(vg, "opensans_regular");
nvgFontSize(vg, 86.0f);
nvgTextBox(vg, 130, 380, fb_w-260, low_battery_text.c_str(), NULL);
nvgFontFace(vg, "opensans_bold");
nvgFontSize(vg, 86.0f);
nvgTextBox(vg, 130, 700, fb_w-260, low_battery_context.c_str(), NULL);
}
void draw_progress_screen() {
// draw progress message
nvgFontSize(vg, 64.0f);
nvgFillColor(vg, nvgRGBA(255,255,255,255));
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
nvgFontFace(vg, "opensans_bold");
nvgFontSize(vg, 86.0f);
nvgTextBox(vg, 0, 380, fb_w, progress_text.c_str(), NULL);
// draw progress bar
{
int progress_width = 1000;
int progress_x = fb_w/2-progress_width/2;
int progress_y = 520;
int progress_height = 50;
int powerprompt_y = 312;
nvgFontFace(vg, "opensans_regular");
nvgFontSize(vg, 64.0f);
nvgText(vg, fb_w/2, 740, "Ensure your device remains connected to a power source.", NULL);
NVGpaint paint = nvgBoxGradient(
vg, progress_x + 1, progress_y + 1,
progress_width - 2, progress_height, 3, 4, nvgRGB(27, 27, 27), nvgRGB(27, 27, 27));
nvgBeginPath(vg);
nvgRoundedRect(vg, progress_x, progress_y, progress_width, progress_height, 12);
nvgFillPaint(vg, paint);
nvgFill(vg);
float value = std::min(std::max(0.0f, progress_frac), 1.0f);
int bar_pos = ((progress_width - 2) * value);
paint = nvgBoxGradient(
vg, progress_x, progress_y,
bar_pos+1.5f, progress_height-1, 3, 4,
nvgRGB(245, 245, 245), nvgRGB(105, 105, 105));
nvgBeginPath(vg);
nvgRoundedRect(
vg, progress_x+1, progress_y+1,
bar_pos, progress_height-2, 12);
nvgFillPaint(vg, paint);
nvgFill(vg);
}
}
void ui_draw() {
std::lock_guard<std::mutex> guard(lock);
nvgBeginFrame(vg, fb_w, fb_h, 1.0f);
switch (state) {
case CONFIRMATION:
draw_ack_screen("An update to NEOS is required.",
"Your device will now be reset and upgraded. You may want to connect to wifi as download is around 1 GB. Existing data on device should not be lost.",
"Continue",
"Connect to WiFi");
break;
case LOW_BATTERY:
draw_battery_screen();
break;
case RUNNING:
draw_progress_screen();
break;
case ERROR:
draw_ack_screen("There was an error", (error_text).c_str(), NULL, "Reboot");
break;
}
nvgEndFrame(vg);
}
void ui_update() {
std::lock_guard<std::mutex> guard(lock);
if (state == ERROR || state == CONFIRMATION) {
int touch_x = -1, touch_y = -1;
int res = touch_poll(&touch, &touch_x, &touch_y, 0);
if (res == 1 && !is_settings_active()) {
if (touch_x >= b_x && touch_x < b_x+b_w && touch_y >= b_y && touch_y < b_y+b_h) {
if (state == CONFIRMATION) {
state = RUNNING;
update_thread_handle = std::thread(&Updater::run_stages, this);
}
}
if (touch_x >= balt_x && touch_x < balt_x+b_w && touch_y >= b_y && touch_y < b_y+b_h) {
if (state == CONFIRMATION) {
start_settings_activity("Settings$WifiSettingsActivity");
} else if (state == ERROR) {
do_exit = 1;
}
}
}
}
}
void go() {
ui_init();
while (!do_exit) {
ui_update();
glClearColor(0.08, 0.08, 0.08, 1.0);
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
// background
nvgBeginPath(vg);
NVGpaint bg = nvgLinearGradient(vg, fb_w, 0, fb_w, fb_h,
nvgRGBA(0, 0, 0, 0), nvgRGBA(0, 0, 0, 255));
nvgFillPaint(vg, bg);
nvgRect(vg, 0, 0, fb_w, fb_h);
nvgFill(vg);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
ui_draw();
glDisable(GL_BLEND);
fb->swap();
assert(glGetError() == GL_NO_ERROR);
// no simple way to do 30fps vsync with surfaceflinger...
util::sleep_for(30);
}
if (update_thread_handle.joinable()) {
update_thread_handle.join();
}
// reboot
system("service call power 16 i32 0 i32 0 i32 1");
}
};
}
int main(int argc, char *argv[]) {
bool background_cache = false;
if (argc > 1) {
if (strcmp(argv[1], "local") == 0) {
manifest_url = MANIFEST_URL_NEOS_LOCAL;
} else if (strcmp(argv[1], "staging") == 0) {
manifest_url = MANIFEST_URL_NEOS_STAGING;
} else if (strcmp(argv[1], "bgcache") == 0) {
manifest_url = argv[2];
background_cache = true;
} else {
manifest_url = argv[1];
}
}
printf("updating from %s\n", manifest_url);
Updater updater;
int err = 0;
if (background_cache) {
err = !updater.download_stage();
} else {
updater.go();
}
return err;
}

View File

@@ -16,6 +16,15 @@ fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
function two_init {
if [ ! -f "/system/fonts/NotoSansTC-Regular.otf" ] || [ -L "/system/fonts/NotoSansTC-Regular.otf" ]; then
mount -o remount,rw /system
find /system/fonts/NotoSans*.otf -type l -delete
cp -frv /usr/share/fonts/NotoSans* /system/fonts/
cp -fr /data/openpilot/selfdrive/dragonpilot/fonts.xml /system/etc/fonts.xml
chmod 644 /system/etc/fonts.xml
chmod 644 /system/fonts/NotoSans*
mount -o remount,r /system
fi
# Wifi scan
wpa_cli IFNAME=wlan0 SCAN
@@ -117,6 +126,11 @@ function two_init {
}
function tici_init {
# wait longer for weston to come up
if [ -f "$BASEDIR/prebuilt" ]; then
sleep 3
fi
sudo su -c 'echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu0/governor'
sudo su -c 'echo "performance" > /sys/class/devfreq/soc:qcom,memlat-cpu4/governor'
nmcli connection modify --temporary lte gsm.auto-config yes
@@ -127,11 +141,12 @@ function tici_init {
# Check if AGNOS update is required
if [ $(< /VERSION) != "$AGNOS_VERSION" ]; then
AGNOS_PY="$DIR/selfdrive/hardware/tici/agnos.py"
MANIFEST="$DIR/selfdrive/hardware/tici/agnos.json"
$DIR/selfdrive/hardware/tici/agnos.py --swap $MANIFEST
sleep 1
sudo reboot
if $AGNOS_PY --verify $MANIFEST; then
sudo reboot
fi
$DIR/selfdrive/hardware/tici/updater $AGNOS_PY $MANIFEST
fi
}

View File

@@ -11,7 +11,7 @@ if [ -z "$REQUIRED_NEOS_VERSION" ]; then
fi
if [ -z "$AGNOS_VERSION" ]; then
export AGNOS_VERSION="0.21"
export AGNOS_VERSION="1.2"
fi
if [ -z "$PASSIVE" ]; then

View File

@@ -350,6 +350,14 @@ BO_ 1163 RSA3: 8 FCM
SG_ OVSPVALH : 27|4@0+ (1,-5) [0|0] "" XXX
SG_ TSRSPU : 33|2@0+ (1,0) [0|0] "" XXX
BO_ 956 GEAR_PACKET2: 8 XXX
SG_ SPORT_ON : 2|1@0+ (1,0) [0|1] "" XXX
SG_ GEAR : 13|6@0+ (1,0) [0|63] "" XXX
SG_ SPORT_GEAR_ON : 33|1@0+ (1,0) [0|1] "" XXX
SG_ SPORT_GEAR : 38|3@0+ (1,0) [0|7] "" XXX
SG_ ECON_ON : 40|1@0+ (1,0) [0|1] "" XXX
SG_ DRIVE_ENGAGED : 47|1@0+ (1,0) [0|1] "" XXX
CM_ SG_ 36 ACCEL_Y "unit is tbd";
CM_ SG_ 36 YAW_RATE "verify";
CM_ SG_ 36 STEERING_TORQUE "does not seem the steer torque, tbd";
@@ -396,15 +404,17 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
VAL_ 956 SPORT_ON 0 "off" 1 "on";
VAL_ 956 ECON_ON 0 "off" 1 "on";
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
VAL_ 1042 LEFT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
VAL_ 1553 UNITS 1 "km" 2 "miles";
VAL_ 1556 TURN_SIGNALS 3 "none" 2 "right" 1 "left";
VAL_ 1161 TSGN1 1 "speed sign" 0 "none";
VAL_ 1161 TSGN1 36 "speed sign mph" 1 "speed sign kph" 0 "none";
VAL_ 1161 TSGN2 1 "speed sign" 0 "none";
VAL_ 1161 SPLSGN2 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none";
VAL_ 1161 SPLSGN2 15 "conditional blank" 6 "snow" 5 "rain" 4 "wet road" 5 "rain" 3 "left" 2 "right" 1 "time" 0 "none";
VAL_ 1162 TSGN3 0 "none" 1 "speed sign" 2 "0 unlimited" 7 "unlimited" 16 "highway" 17 "no highway" 18 "motorway" 19 "no motorway" 20 "in city" 21 "outside city" 22 "pedestrian area" 23 "no pedestrian area" 65 "no overtaking left" 66 "no overtaking right" 67 "overtaking allowed again" 81 "no right turn" 97 "stop" 105 "yield" 113 "stop" 114 "yield us" 129 "no entry" 138 "no entry tss2" 145 "do not enter";
VAL_ 1162 SPLSGN3 15 "conditional blank" 4 "wet road" 5 "rain" 0 "none";

View File

@@ -442,6 +442,7 @@ BO_ 956 GEAR_PACKET: 8 XXX
SG_ SPORT_ON : 2|1@0+ (1,0) [0|1] "" XXX
SG_ GEAR : 13|6@0+ (1,0) [0|63] "" XXX
SG_ ECON_ON : 40|1@0+ (1,0) [0|1] "" XXX
SG_ SPORT_ON_2 : 55|1@0+ (1,0) [0|1] "" XXX
CM_ SG_ 548 BRAKE_PRESSURE "seems prop to pedal force";
CM_ SG_ 548 BRAKE_POSITION "seems proportional to pedal displacement, unclear the max value of 0x1c8";
@@ -451,3 +452,4 @@ VAL_ 610 LKA_STATE 25 "temporary_fault" 9 "temporary_fault2" 5 "active" 1 "stand
VAL_ 956 GEAR 0 "D" 1 "S" 8 "N" 16 "R" 32 "P";
VAL_ 956 SPORT_ON 0 "off" 1 "on";
VAL_ 956 ECON_ON 0 "off" 1 "on";
VAL_ 956 SPORT_ON_2 0 "off" 1 "on";

View File

@@ -37,7 +37,7 @@ else:
"-DPANDA",
]
if FindFile('dp_vw', '/data/params/d') != None:
if FindFile('dp_vw_panda', '/data/params/d') != None:
with open('/data/params/d/dp_vw_panda') as f:
if (int(f.read().strip())) == 1:
PROJECT_FLAGS += ['-Dvw']

View File

@@ -32,7 +32,7 @@ void set_power_save_state(int state) {
// Volkswagen community port:
// If this is a White or Grey Panda, always keep the CAN transceivers
// powered up so that transparent forwarding is maintained.
current_board->enable_can_transceivers(board_has_obd() ? enable : true);
current_board->enable_can_transceivers(current_board->has_obd ? enable : true);
#else
current_board->enable_can_transceivers(enable);
#endif

View File

@@ -32,7 +32,7 @@ static int default_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) {
// Don't do this for BP/C2, where we have Advanced Actual Relay Technology.
int bus_fwd = -1;
if(!board_has_relay()) {
if(hw_type == HW_TYPE_WHITE_PANDA || hw_type == HW_TYPE_GREY_PANDA) {
switch (bus_num) {
case 0:
bus_fwd = 2;

View File

@@ -0,0 +1 @@
#include "qmapbox.hpp"

View File

@@ -0,0 +1 @@
#include "qmapboxgl.hpp"

View File

@@ -0,0 +1,147 @@
#ifndef QMAPBOX_H
#define QMAPBOX_H
#include <QColor>
#include <QPair>
#include <QString>
#include <QVariant>
#include <QVector>
// This header follows the Qt coding style: https://wiki.qt.io/Qt_Coding_Style
#if !defined(QT_MAPBOXGL_STATIC)
# if defined(QT_BUILD_MAPBOXGL_LIB)
# define Q_MAPBOXGL_EXPORT Q_DECL_EXPORT
# else
# define Q_MAPBOXGL_EXPORT Q_DECL_IMPORT
# endif
#else
# define Q_MAPBOXGL_EXPORT
#endif
namespace QMapbox {
typedef QPair<double, double> Coordinate;
typedef QPair<Coordinate, double> CoordinateZoom;
typedef QPair<double, double> ProjectedMeters;
typedef QVector<Coordinate> Coordinates;
typedef QVector<Coordinates> CoordinatesCollection;
typedef QVector<CoordinatesCollection> CoordinatesCollections;
struct Q_MAPBOXGL_EXPORT Feature {
enum Type {
PointType = 1,
LineStringType,
PolygonType
};
/*! Class constructor. */
Feature(Type type_ = PointType, const CoordinatesCollections& geometry_ = CoordinatesCollections(),
const QVariantMap& properties_ = QVariantMap(), const QVariant& id_ = QVariant())
: type(type_), geometry(geometry_), properties(properties_), id(id_) {}
Type type;
CoordinatesCollections geometry;
QVariantMap properties;
QVariant id;
};
struct Q_MAPBOXGL_EXPORT ShapeAnnotationGeometry {
enum Type {
LineStringType = 1,
PolygonType,
MultiLineStringType,
MultiPolygonType
};
/*! Class constructor. */
ShapeAnnotationGeometry(Type type_ = LineStringType, const CoordinatesCollections& geometry_ = CoordinatesCollections())
: type(type_), geometry(geometry_) {}
Type type;
CoordinatesCollections geometry;
};
struct Q_MAPBOXGL_EXPORT SymbolAnnotation {
Coordinate geometry;
QString icon;
};
struct Q_MAPBOXGL_EXPORT LineAnnotation {
/*! Class constructor. */
LineAnnotation(const ShapeAnnotationGeometry& geometry_ = ShapeAnnotationGeometry(), float opacity_ = 1.0f,
float width_ = 1.0f, const QColor& color_ = Qt::black)
: geometry(geometry_), opacity(opacity_), width(width_), color(color_) {}
ShapeAnnotationGeometry geometry;
float opacity;
float width;
QColor color;
};
struct Q_MAPBOXGL_EXPORT FillAnnotation {
/*! Class constructor. */
FillAnnotation(const ShapeAnnotationGeometry& geometry_ = ShapeAnnotationGeometry(), float opacity_ = 1.0f,
const QColor& color_ = Qt::black, const QVariant& outlineColor_ = QVariant())
: geometry(geometry_), opacity(opacity_), color(color_), outlineColor(outlineColor_) {}
ShapeAnnotationGeometry geometry;
float opacity;
QColor color;
QVariant outlineColor;
};
typedef QVariant Annotation;
typedef quint32 AnnotationID;
typedef QVector<AnnotationID> AnnotationIDs;
enum NetworkMode {
Online, // Default
Offline,
};
Q_MAPBOXGL_EXPORT QVector<QPair<QString, QString> >& defaultStyles();
Q_MAPBOXGL_EXPORT NetworkMode networkMode();
Q_MAPBOXGL_EXPORT void setNetworkMode(NetworkMode);
// This struct is a 1:1 copy of mbgl::CustomLayerRenderParameters.
struct Q_MAPBOXGL_EXPORT CustomLayerRenderParameters {
double width;
double height;
double latitude;
double longitude;
double zoom;
double bearing;
double pitch;
double fieldOfView;
};
class Q_MAPBOXGL_EXPORT CustomLayerHostInterface {
public:
virtual ~CustomLayerHostInterface() = default;
virtual void initialize() = 0;
virtual void render(const CustomLayerRenderParameters&) = 0;
virtual void deinitialize() = 0;
};
Q_MAPBOXGL_EXPORT double metersPerPixelAtLatitude(double latitude, double zoom);
Q_MAPBOXGL_EXPORT ProjectedMeters projectedMetersForCoordinate(const Coordinate &);
Q_MAPBOXGL_EXPORT Coordinate coordinateForProjectedMeters(const ProjectedMeters &);
} // namespace QMapbox
Q_DECLARE_METATYPE(QMapbox::Coordinate);
Q_DECLARE_METATYPE(QMapbox::Coordinates);
Q_DECLARE_METATYPE(QMapbox::CoordinatesCollection);
Q_DECLARE_METATYPE(QMapbox::CoordinatesCollections);
Q_DECLARE_METATYPE(QMapbox::Feature);
Q_DECLARE_METATYPE(QMapbox::SymbolAnnotation);
Q_DECLARE_METATYPE(QMapbox::ShapeAnnotationGeometry);
Q_DECLARE_METATYPE(QMapbox::LineAnnotation);
Q_DECLARE_METATYPE(QMapbox::FillAnnotation);
#endif // QMAPBOX_H

View File

@@ -0,0 +1,277 @@
#ifndef QMAPBOXGL_H
#define QMAPBOXGL_H
#include <QImage>
#include <QMapbox>
#include <QMargins>
#include <QObject>
#include <QPointF>
#include <QSize>
#include <QString>
#include <QStringList>
#include <functional>
class QMapboxGLPrivate;
// This header follows the Qt coding style: https://wiki.qt.io/Qt_Coding_Style
class Q_MAPBOXGL_EXPORT QMapboxGLSettings
{
public:
QMapboxGLSettings();
enum GLContextMode {
UniqueGLContext = 0,
SharedGLContext
};
enum MapMode {
Continuous = 0,
Static
};
enum ConstrainMode {
NoConstrain = 0,
ConstrainHeightOnly,
ConstrainWidthAndHeight
};
enum ViewportMode {
DefaultViewport = 0,
FlippedYViewport
};
GLContextMode contextMode() const;
void setContextMode(GLContextMode);
MapMode mapMode() const;
void setMapMode(MapMode);
ConstrainMode constrainMode() const;
void setConstrainMode(ConstrainMode);
ViewportMode viewportMode() const;
void setViewportMode(ViewportMode);
unsigned cacheDatabaseMaximumSize() const;
void setCacheDatabaseMaximumSize(unsigned);
QString cacheDatabasePath() const;
void setCacheDatabasePath(const QString &);
QString assetPath() const;
void setAssetPath(const QString &);
QString accessToken() const;
void setAccessToken(const QString &);
QString apiBaseUrl() const;
void setApiBaseUrl(const QString &);
QString localFontFamily() const;
void setLocalFontFamily(const QString &);
std::function<std::string(const std::string &)> resourceTransform() const;
void setResourceTransform(const std::function<std::string(const std::string &)> &);
private:
GLContextMode m_contextMode;
MapMode m_mapMode;
ConstrainMode m_constrainMode;
ViewportMode m_viewportMode;
unsigned m_cacheMaximumSize;
QString m_cacheDatabasePath;
QString m_assetPath;
QString m_accessToken;
QString m_apiBaseUrl;
QString m_localFontFamily;
std::function<std::string(const std::string &)> m_resourceTransform;
};
struct Q_MAPBOXGL_EXPORT QMapboxGLCameraOptions {
QVariant center; // Coordinate
QVariant anchor; // QPointF
QVariant zoom; // double
QVariant bearing; // double
QVariant pitch; // double
};
class Q_MAPBOXGL_EXPORT QMapboxGL : public QObject
{
Q_OBJECT
Q_PROPERTY(double latitude READ latitude WRITE setLatitude)
Q_PROPERTY(double longitude READ longitude WRITE setLongitude)
Q_PROPERTY(double zoom READ zoom WRITE setZoom)
Q_PROPERTY(double bearing READ bearing WRITE setBearing)
Q_PROPERTY(double pitch READ pitch WRITE setPitch)
Q_PROPERTY(QString styleJson READ styleJson WRITE setStyleJson)
Q_PROPERTY(QString styleUrl READ styleUrl WRITE setStyleUrl)
Q_PROPERTY(double scale READ scale WRITE setScale)
Q_PROPERTY(QMapbox::Coordinate coordinate READ coordinate WRITE setCoordinate)
Q_PROPERTY(QMargins margins READ margins WRITE setMargins)
public:
enum MapChange {
MapChangeRegionWillChange = 0,
MapChangeRegionWillChangeAnimated,
MapChangeRegionIsChanging,
MapChangeRegionDidChange,
MapChangeRegionDidChangeAnimated,
MapChangeWillStartLoadingMap,
MapChangeDidFinishLoadingMap,
MapChangeDidFailLoadingMap,
MapChangeWillStartRenderingFrame,
MapChangeDidFinishRenderingFrame,
MapChangeDidFinishRenderingFrameFullyRendered,
MapChangeWillStartRenderingMap,
MapChangeDidFinishRenderingMap,
MapChangeDidFinishRenderingMapFullyRendered,
MapChangeDidFinishLoadingStyle,
MapChangeSourceDidChange
};
enum MapLoadingFailure {
StyleParseFailure,
StyleLoadFailure,
NotFoundFailure,
UnknownFailure
};
// Determines the orientation of the map.
enum NorthOrientation {
NorthUpwards, // Default
NorthRightwards,
NorthDownwards,
NorthLeftwards,
};
QMapboxGL(QObject* parent = 0,
const QMapboxGLSettings& = QMapboxGLSettings(),
const QSize& size = QSize(),
qreal pixelRatio = 1);
virtual ~QMapboxGL();
QString styleJson() const;
QString styleUrl() const;
void setStyleJson(const QString &);
void setStyleUrl(const QString &);
double latitude() const;
void setLatitude(double latitude);
double longitude() const;
void setLongitude(double longitude);
double scale() const;
void setScale(double scale, const QPointF &center = QPointF());
double zoom() const;
void setZoom(double zoom);
double minimumZoom() const;
double maximumZoom() const;
double bearing() const;
void setBearing(double degrees);
void setBearing(double degrees, const QPointF &center);
double pitch() const;
void setPitch(double pitch);
void pitchBy(double pitch);
NorthOrientation northOrientation() const;
void setNorthOrientation(NorthOrientation);
QMapbox::Coordinate coordinate() const;
void setCoordinate(const QMapbox::Coordinate &);
void setCoordinateZoom(const QMapbox::Coordinate &, double zoom);
void jumpTo(const QMapboxGLCameraOptions&);
void setGestureInProgress(bool inProgress);
void setTransitionOptions(qint64 duration, qint64 delay = 0);
void addAnnotationIcon(const QString &name, const QImage &sprite);
QMapbox::AnnotationID addAnnotation(const QMapbox::Annotation &);
void updateAnnotation(QMapbox::AnnotationID, const QMapbox::Annotation &);
void removeAnnotation(QMapbox::AnnotationID);
bool setLayoutProperty(const QString &layer, const QString &property, const QVariant &value);
bool setPaintProperty(const QString &layer, const QString &property, const QVariant &value);
bool isFullyLoaded() const;
void moveBy(const QPointF &offset);
void scaleBy(double scale, const QPointF &center = QPointF());
void rotateBy(const QPointF &first, const QPointF &second);
void resize(const QSize &size);
double metersPerPixelAtLatitude(double latitude, double zoom) const;
QMapbox::ProjectedMeters projectedMetersForCoordinate(const QMapbox::Coordinate &) const;
QMapbox::Coordinate coordinateForProjectedMeters(const QMapbox::ProjectedMeters &) const;
QPointF pixelForCoordinate(const QMapbox::Coordinate &) const;
QMapbox::Coordinate coordinateForPixel(const QPointF &) const;
QMapbox::CoordinateZoom coordinateZoomForBounds(const QMapbox::Coordinate &sw, QMapbox::Coordinate &ne) const;
QMapbox::CoordinateZoom coordinateZoomForBounds(const QMapbox::Coordinate &sw, QMapbox::Coordinate &ne, double bearing, double pitch);
void setMargins(const QMargins &margins);
QMargins margins() const;
void addSource(const QString &sourceID, const QVariantMap& params);
bool sourceExists(const QString &sourceID);
void updateSource(const QString &sourceID, const QVariantMap& params);
void removeSource(const QString &sourceID);
void addImage(const QString &name, const QImage &sprite);
void removeImage(const QString &name);
void addCustomLayer(const QString &id,
QScopedPointer<QMapbox::CustomLayerHostInterface>& host,
const QString& before = QString());
void addLayer(const QVariantMap &params, const QString& before = QString());
bool layerExists(const QString &id);
void removeLayer(const QString &id);
QVector<QString> layerIds() const;
void setFilter(const QString &layer, const QVariant &filter);
QVariant getFilter(const QString &layer) const;
// When rendering on a different thread,
// should be called on the render thread.
void createRenderer();
void destroyRenderer();
void setFramebufferObject(quint32 fbo, const QSize &size);
public slots:
void render();
void connectionEstablished();
// Commit changes, load all the resources
// and renders the map when completed.
void startStaticRender();
signals:
void needsRendering();
void mapChanged(QMapboxGL::MapChange);
void mapLoadingFailed(QMapboxGL::MapLoadingFailure, const QString &reason);
void copyrightsChanged(const QString &copyrightsHtml);
void staticRenderFinished(const QString &error);
private:
Q_DISABLE_COPY(QMapboxGL)
QMapboxGLPrivate *d_ptr;
};
Q_DECLARE_METATYPE(QMapboxGL::MapChange);
Q_DECLARE_METATYPE(QMapboxGL::MapLoadingFailure);
#endif // QMAPBOXGL_H

70
release/build_devel.sh Executable file
View File

@@ -0,0 +1,70 @@
#!/usr/bin/bash -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
TARGET_DIR=/data/openpilot
SOURCE_DIR="$(git rev-parse --show-toplevel)"
# set git identity
source $DIR/identity.sh
echo "[-] Setting up repo T=$SECONDS"
if [ ! -d "$TARGET_DIR" ]; then
mkdir -p $TARGET_DIR
cd $TARGET_DIR
git init
git remote add origin git@github.com:commaai/openpilot.git
fi
echo "[-] bringing master-ci and devel in sync T=$SECONDS"
cd $TARGET_DIR
git prune || true
git remote prune origin || true
git fetch origin master-ci
git fetch origin devel
git checkout -f --track origin/master-ci
git reset --hard master-ci
git checkout master-ci
git reset --hard origin/devel
git clean -xdf
# remove everything except .git
echo "[-] erasing old openpilot T=$SECONDS"
find . -maxdepth 1 -not -path './.git' -not -name '.' -not -name '..' -exec rm -rf '{}' \;
# reset source tree
cd $SOURCE_DIR
git clean -xdf
# do the files copy
echo "[-] copying files T=$SECONDS"
cd $SOURCE_DIR
cp -pR --parents $(cat release/files_common) $TARGET_DIR/
cp -pR --parents $(cat release/files_tici) $TARGET_DIR/
if [ ! -z "$EXTRA_FILES" ]; then
cp -pR --parents $EXTRA_FILES $TARGET_DIR/
fi
# append source commit hash and build date to version
GIT_HASH=$(git --git-dir=$SOURCE_DIR/.git rev-parse --short HEAD)
DATETIME=$(date '+%Y-%m-%dT%H:%M:%S')
VERSION=$(cat selfdrive/common/version.h | awk -F\" '{print $2}')
echo "#define COMMA_VERSION \"$VERSION-$GIT_HASH-$DATETIME\"" > selfdrive/common/version.h
# in the directory
cd $TARGET_DIR
rm -f panda/board/obj/panda.bin.signed
echo "[-] committing version $VERSION T=$SECONDS"
git add -f .
git status
git commit -a -m "openpilot v$VERSION release"
if [ ! -z "$PUSH" ]; then
echo "[-] Pushing to $PUSH T=$SECONDS"
git remote set-url origin git@github.com:commaai/openpilot.git
git push -f origin master-ci:$PUSH
fi
echo "[-] done T=$SECONDS"

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env bash
set -e
export GIT_COMMITTER_NAME="rav4kumar"
export GIT_COMMITTER_EMAIL=" 36933347+rav4kumar@users.noreply.github.com"
export GIT_AUTHOR_NAME="rav4kumar"
export GIT_AUTHOR_EMAIL=" 36933347+rav4kumar@users.noreply.github.com"
export GIT_COMMITTER_NAME="Vehicle Researcher"
export GIT_COMMITTER_EMAIL="user@comma.ai"
export GIT_AUTHOR_NAME="Vehicle Researcher"
export GIT_AUTHOR_EMAIL="user@comma.ai"
export GIT_SSH_COMMAND="ssh -i /data/gitkey"
@@ -17,7 +17,7 @@ if [ ! -z "$CLEAN" ]; then
# Create git repo
git init
git remote add origin git@github.com:rav4kumar/dp-devel.git
git remote add origin git@github.com:commaai/openpilot.git
git fetch origin devel-staging
else
cd /data/openpilot
@@ -26,6 +26,7 @@ else
fi
git fetch origin release2-staging
git fetch origin dashcam-staging
# Create release2 with no history
if [ ! -z "$CLEAN" ]; then
@@ -40,16 +41,20 @@ echo "#define COMMA_VERSION \"$VERSION-release\"" > selfdrive/common/version.h
git commit -m "openpilot v$VERSION"
# Build signed panda firmware
#pushd panda/
#CERT=/data/openpilot/panda/certs/debug RELEASE=0 scons -u .
#mv board/obj/panda.bin.signed /tmp/panda.bin.signed
#popd
pushd panda/
CERT=/tmp/pandaextra/certs/release RELEASE=1 scons -u .
mv board/obj/panda.bin.signed /tmp/panda.bin.signed
popd
# Build stuff
ln -sfn /data/openpilot /data/pythonpath
export PYTHONPATH="/data/openpilot:/data/openpilot/pyextra"
scons -j3
# Run tests
python selfdrive/manager/test/test_manager.py
selfdrive/car/tests/test_car_interfaces.py
# Ensure no submodules in release
if test "$(git submodule--helper list | wc -l)" -gt "0"; then
echo "submodules found:"
@@ -64,14 +69,13 @@ find . -name '*.o' -delete
find . -name '*.os' -delete
find . -name '*.pyc' -delete
find . -name '__pycache__' -delete
find selfdrive/ui -name '*.h' -delete
rm -rf panda/board panda/certs panda/crypto
rm -rf .sconsign.dblite Jenkinsfile release/
rm models/supercombo.dlc
# Move back signed panda fw
#mkdir -p panda/board/obj
#mv /tmp/panda.bin.signed panda/board/obj/panda.bin.signed
mkdir -p panda/board/obj
mv /tmp/panda.bin.signed panda/board/obj/panda.bin.signed
# Restore phonelibs
git checkout phonelibs/
@@ -86,7 +90,15 @@ git commit --amend -m "openpilot v$VERSION"
# Print committed files that are normally gitignored
#git status --ignored
#git remote set-url origin git@github.com:rav4kumar/dp-devel.git
if [ ! -z "$PUSH" ]; then
git remote set-url origin git@github.com:commaai/openpilot.git
# Push to release2-staging
#git push -f origin release2-staging
# Push to release2-staging
git push -f origin release2-staging
# Create dashcam release
git rm selfdrive/car/*/carcontroller.py
git commit -m "create dashcam release from release2"
git push -f origin release2-staging:dashcam-staging
fi

91
release/build_release3.sh Executable file
View File

@@ -0,0 +1,91 @@
#!/usr/bin/bash -e
# git diff --name-status origin/release3-staging | grep "^A" | less
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd $DIR
BUILD_DIR=/data/openpilot
SOURCE_DIR="$(git rev-parse --show-toplevel)"
BRANCH=release3-staging
# set git identity
source $DIR/identity.sh
echo "[-] Setting up repo T=$SECONDS"
rm -rf $BUILD_DIR
mkdir -p $BUILD_DIR
cd $BUILD_DIR
git init
git remote add origin git@github.com:commaai/openpilot.git
git checkout -f -B $BRANCH
# do the files copy
echo "[-] copying files T=$SECONDS"
cd $SOURCE_DIR
cp -pR --parents $(cat release/files_common) $BUILD_DIR/
cp -pR --parents $(cat release/files_tici) $BUILD_DIR/
# in the directory
cd $BUILD_DIR
rm -f panda/board/obj/panda.bin.signed
VERSION=$(cat selfdrive/common/version.h | awk -F[\"-] '{print $2}')
echo "#define COMMA_VERSION \"$VERSION-release\"" > selfdrive/common/version.h
echo "[-] committing version $VERSION T=$SECONDS"
git add -f .
git commit -a -m "openpilot v$VERSION release"
# Build panda firmware
pushd panda/
CERT=/data/pandaextra/certs/release RELEASE=1 scons -u .
mv board/obj/panda.bin.signed /tmp/panda.bin.signed
popd
# Build
export PYTHONPATH="$BUILD_DIR"
scons -j$(nproc)
# Run tests
#python selfdrive/manager/test/test_manager.py
selfdrive/car/tests/test_car_interfaces.py
# Cleanup
find . -name '*.a' -delete
find . -name '*.o' -delete
find . -name '*.os' -delete
find . -name '*.pyc' -delete
find . -name '__pycache__' -delete
rm -rf panda/board panda/certs panda/crypto
rm -rf .sconsign.dblite Jenkinsfile release/
# Move back signed panda fw
mkdir -p panda/board/obj
mv /tmp/panda.bin.signed panda/board/obj/panda.bin.signed
# Restore phonelibs
git checkout phonelibs/
# Mark as prebuilt release
touch prebuilt
# Add built files to git
git add -f .
git commit --amend -m "openpilot v$VERSION"
if [ ! -z "$PUSH" ]; then
echo "[-] pushing T=$SECONDS"
git remote set-url origin git@github.com:commaai/openpilot.git
git push -f origin $BRANCH
# Create dashcam
git rm selfdrive/car/*/carcontroller.py
git commit -m "create dashcam release from release"
git push -f origin $BRANCH:dashcam3-staging
fi
echo "[-] done T=$SECONDS"

12
release/check-submodules.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
while read hash submodule ref; do
git -C $submodule fetch --depth 100 origin master
git -C $submodule branch -r --contains $hash | grep "origin/master"
if [ "$?" -eq 0 ]; then
echo "$submodule ok"
else
echo "$submodule: $hash is not on master"
exit 1
fi
done <<< $(git submodule status --recursive)

622
release/files_common Normal file
View File

@@ -0,0 +1,622 @@
.gitignore
LICENSE
launch_env.sh
launch_chffrplus.sh
launch_openpilot.sh
Jenkinsfile
SConstruct
CONTRIBUTING.md
README.md
RELEASES.md
SAFETY.md
site_scons/site_tools/cython.py
common/.gitignore
common/__init__.py
common/gpio.py
common/realtime.py
common/clock.pyx
common/timeout.py
common/ffi_wrapper.py
common/file_helpers.py
common/logging_extra.py
common/numpy_fast.py
common/params.py
common/params_pxd.pxd
common/params_pyx.pyx
common/xattr.py
common/profiler.py
common/basedir.py
common/dict_helpers.py
common/filter_simple.py
common/stat_live.py
common/spinner.py
common/text_window.py
common/cython_hacks.py
common/SConscript
common/kalman/.gitignore
common/kalman/*
common/transformations/__init__.py
common/transformations/camera.py
common/transformations/model.py
common/transformations/SConscript
common/transformations/coordinates.py
common/transformations/coordinates.cc
common/transformations/coordinates.hpp
common/transformations/orientation.py
common/transformations/orientation.cc
common/transformations/orientation.hpp
common/transformations/transformations.pxd
common/transformations/transformations.pyx
common/api/__init__.py
models/supercombo.dlc
models/dmonitoring_model_q.dlc
release/*
selfdrive/version.py
selfdrive/__init__.py
selfdrive/config.py
selfdrive/crash.py
selfdrive/swaglog.py
selfdrive/logmessaged.py
selfdrive/tombstoned.py
selfdrive/pandad.py
selfdrive/updated.py
selfdrive/rtshield.py
selfdrive/athena/__init__.py
selfdrive/athena/athenad.py
selfdrive/athena/manage_athenad.py
selfdrive/athena/registration.py
selfdrive/boardd/.gitignore
selfdrive/boardd/SConscript
selfdrive/boardd/__init__.py
selfdrive/boardd/boardd.cc
selfdrive/boardd/boardd.py
selfdrive/boardd/boardd_api_impl.pyx
selfdrive/boardd/can_list_to_can_capnp.cc
selfdrive/boardd/panda.cc
selfdrive/boardd/panda.h
selfdrive/boardd/pigeon.cc
selfdrive/boardd/pigeon.h
selfdrive/boardd/set_time.py
selfdrive/car/__init__.py
selfdrive/car/car_helpers.py
selfdrive/car/fingerprints.py
selfdrive/car/interfaces.py
selfdrive/car/vin.py
selfdrive/car/fw_versions.py
selfdrive/car/isotp_parallel_query.py
selfdrive/car/tests/__init__.py
selfdrive/car/tests/test_car_interfaces.py
selfdrive/car/chrysler/__init__.py
selfdrive/car/chrysler/carstate.py
selfdrive/car/chrysler/interface.py
selfdrive/car/chrysler/radar_interface.py
selfdrive/car/chrysler/values.py
selfdrive/car/chrysler/carcontroller.py
selfdrive/car/chrysler/chryslercan.py
selfdrive/car/honda/__init__.py
selfdrive/car/honda/carstate.py
selfdrive/car/honda/interface.py
selfdrive/car/honda/radar_interface.py
selfdrive/car/honda/values.py
selfdrive/car/honda/carcontroller.py
selfdrive/car/honda/hondacan.py
selfdrive/car/hyundai/__init__.py
selfdrive/car/hyundai/carstate.py
selfdrive/car/hyundai/interface.py
selfdrive/car/hyundai/radar_interface.py
selfdrive/car/hyundai/values.py
selfdrive/car/hyundai/carcontroller.py
selfdrive/car/hyundai/hyundaican.py
selfdrive/car/toyota/__init__.py
selfdrive/car/toyota/carstate.py
selfdrive/car/toyota/interface.py
selfdrive/car/toyota/radar_interface.py
selfdrive/car/toyota/values.py
selfdrive/car/toyota/carcontroller.py
selfdrive/car/toyota/toyotacan.py
selfdrive/car/nissan/__init__.py
selfdrive/car/nissan/carcontroller.py
selfdrive/car/nissan/carstate.py
selfdrive/car/nissan/interface.py
selfdrive/car/nissan/nissancan.py
selfdrive/car/nissan/radar_interface.py
selfdrive/car/nissan/values.py
selfdrive/car/volkswagen/__init__.py
selfdrive/car/volkswagen/carstate.py
selfdrive/car/volkswagen/interface.py
selfdrive/car/volkswagen/radar_interface.py
selfdrive/car/volkswagen/values.py
selfdrive/car/volkswagen/carcontroller.py
selfdrive/car/volkswagen/volkswagencan.py
selfdrive/car/gm/__init__.py
selfdrive/car/gm/carstate.py
selfdrive/car/gm/interface.py
selfdrive/car/gm/radar_interface.py
selfdrive/car/gm/values.py
selfdrive/car/gm/carcontroller.py
selfdrive/car/gm/gmcan.py
selfdrive/car/ford/__init__.py
selfdrive/car/ford/carstate.py
selfdrive/car/ford/interface.py
selfdrive/car/ford/radar_interface.py
selfdrive/car/ford/values.py
selfdrive/car/ford/carcontroller.py
selfdrive/car/ford/fordcan.py
selfdrive/car/subaru/__init__.py
selfdrive/car/subaru/carstate.py
selfdrive/car/subaru/interface.py
selfdrive/car/subaru/radar_interface.py
selfdrive/car/subaru/values.py
selfdrive/car/subaru/carcontroller.py
selfdrive/car/subaru/subarucan.py
selfdrive/car/mazda/__init__.py
selfdrive/car/mazda/carstate.py
selfdrive/car/mazda/interface.py
selfdrive/car/mazda/radar_interface.py
selfdrive/car/mazda/values.py
selfdrive/car/mazda/carcontroller.py
selfdrive/car/mazda/mazdacan.py
selfdrive/car/tesla/__init__.py
selfdrive/car/tesla/teslacan.py
selfdrive/car/tesla/carcontroller.py
selfdrive/car/tesla/radar_interface.py
selfdrive/car/tesla/values.py
selfdrive/car/tesla/carstate.py
selfdrive/car/tesla/interface.py
selfdrive/car/mock/*.py
selfdrive/clocksd/.gitignore
selfdrive/clocksd/SConscript
selfdrive/clocksd/clocksd.cc
selfdrive/debug/*.py
selfdrive/common/SConscript
selfdrive/common/version.h
selfdrive/common/framebuffer.h
selfdrive/common/framebuffer.cc
selfdrive/common/glutil.cc
selfdrive/common/glutil.h
selfdrive/common/touch.[c,h]
selfdrive/common/swaglog.h
selfdrive/common/swaglog.cc
selfdrive/common/util.cc
selfdrive/common/util.h
selfdrive/common/queue.h
selfdrive/common/clutil.cc
selfdrive/common/clutil.h
selfdrive/common/params.h
selfdrive/common/params.cc
selfdrive/common/watchdog.cc
selfdrive/common/watchdog.h
selfdrive/common/modeldata.h
selfdrive/common/mat.h
selfdrive/common/timing.h
selfdrive/common/visionimg.cc
selfdrive/common/visionimg.h
selfdrive/common/gpio.cc
selfdrive/common/gpio.h
selfdrive/common/i2c.cc
selfdrive/common/i2c.h
selfdrive/controls/__init__.py
selfdrive/controls/controlsd.py
selfdrive/controls/plannerd.py
selfdrive/controls/radard.py
selfdrive/controls/lib/__init__.py
selfdrive/controls/lib/alertmanager.py
selfdrive/controls/lib/alerts_offroad.json
selfdrive/controls/lib/events.py
selfdrive/controls/lib/drive_helpers.py
selfdrive/controls/lib/latcontrol_pid.py
selfdrive/controls/lib/latcontrol_indi.py
selfdrive/controls/lib/latcontrol_lqr.py
selfdrive/controls/lib/latcontrol_angle.py
selfdrive/controls/lib/longcontrol.py
selfdrive/controls/lib/lateral_planner.py
selfdrive/controls/lib/lane_planner.py
selfdrive/controls/lib/pid.py
selfdrive/controls/lib/longitudinal_planner.py
selfdrive/controls/lib/radar_helpers.py
selfdrive/controls/lib/vehicle_model.py
selfdrive/controls/lib/fcw.py
selfdrive/controls/lib/long_mpc.py
selfdrive/controls/lib/lead_mpc.py
selfdrive/controls/lib/cluster/*
selfdrive/controls/lib/lateral_mpc/lib_mpc_export/*
selfdrive/controls/lib/lateral_mpc/.gitignore
selfdrive/controls/lib/lateral_mpc/SConscript
selfdrive/controls/lib/lateral_mpc/__init__.py
selfdrive/controls/lib/lateral_mpc/generator.cpp
selfdrive/controls/lib/lateral_mpc/libmpc_py.py
selfdrive/controls/lib/lateral_mpc/lateral_mpc.c
selfdrive/controls/lib/lead_mpc_lib/lib_mpc_export/*
selfdrive/controls/lib/lead_mpc_lib/.gitignore
selfdrive/controls/lib/lead_mpc_lib/SConscript
selfdrive/controls/lib/lead_mpc_lib/__init__.py
selfdrive/controls/lib/lead_mpc_lib/generator.cpp
selfdrive/controls/lib/lead_mpc_lib/libmpc_py.py
selfdrive/controls/lib/lead_mpc_lib/longitudinal_mpc.c
selfdrive/controls/lib/longitudinal_mpc_lib/lib_mpc_export/*
selfdrive/controls/lib/longitudinal_mpc_lib/.gitignore
selfdrive/controls/lib/longitudinal_mpc_lib/SConscript
selfdrive/controls/lib/longitudinal_mpc_lib/__init__.py
selfdrive/controls/lib/longitudinal_mpc_lib/generator.cpp
selfdrive/controls/lib/longitudinal_mpc_lib/libmpc_py.py
selfdrive/controls/lib/longitudinal_mpc_lib/longitudinal_mpc.c
selfdrive/hardware/__init__.py
selfdrive/hardware/base.h
selfdrive/hardware/base.py
selfdrive/hardware/hw.h
selfdrive/hardware/eon/__init__.py
selfdrive/hardware/eon/hardware.h
selfdrive/hardware/eon/hardware.py
selfdrive/hardware/tici/__init__.py
selfdrive/hardware/tici/hardware.py
selfdrive/hardware/tici/amplifier.py
selfdrive/hardware/tici/iwlist.py
selfdrive/hardware/pc/__init__.py
selfdrive/hardware/pc/hardware.py
selfdrive/locationd/__init__.py
selfdrive/locationd/.gitignore
selfdrive/locationd/SConscript
selfdrive/locationd/ubloxd.cc
selfdrive/locationd/ublox_msg.cc
selfdrive/locationd/ublox_msg.h
selfdrive/locationd/generated/ubx.cpp
selfdrive/locationd/generated/ubx.h
selfdrive/locationd/generated/gps.cpp
selfdrive/locationd/generated/gps.h
selfdrive/locationd/locationd.h
selfdrive/locationd/locationd.cc
selfdrive/locationd/paramsd.py
selfdrive/locationd/models/.gitignore
selfdrive/locationd/models/live_kf.py
selfdrive/locationd/models/car_kf.py
selfdrive/locationd/models/constants.py
selfdrive/locationd/models/live_kf.h
selfdrive/locationd/models/live_kf.cc
selfdrive/locationd/calibrationd.py
selfdrive/logcatd/SConscript
selfdrive/logcatd/logcatd_android.cc
selfdrive/logcatd/logcatd_systemd.cc
selfdrive/proclogd/SConscript
selfdrive/proclogd/proclogd.cc
selfdrive/loggerd/SConscript
selfdrive/loggerd/encoder.h
selfdrive/loggerd/omx_encoder.cc
selfdrive/loggerd/omx_encoder.h
selfdrive/loggerd/logger.cc
selfdrive/loggerd/logger.h
selfdrive/loggerd/loggerd.cc
selfdrive/loggerd/bootlog.cc
selfdrive/loggerd/raw_logger.cc
selfdrive/loggerd/raw_logger.h
selfdrive/loggerd/include/msm_media_info.h
selfdrive/loggerd/__init__.py
selfdrive/loggerd/config.py
selfdrive/loggerd/uploader.py
selfdrive/loggerd/deleter.py
selfdrive/loggerd/xattr_cache.py
selfdrive/sensord/SConscript
selfdrive/sensord/libdiag.h
selfdrive/sensord/sensors_qcom.cc
selfdrive/sensord/sensors_qcom2.cc
selfdrive/sensord/sensors/*.cc
selfdrive/sensord/sensors/*.h
selfdrive/sensord/sensord
selfdrive/thermald/thermald.py
selfdrive/thermald/power_monitoring.py
selfdrive/test/__init__.py
selfdrive/test/helpers.py
selfdrive/test/setup_device_ci.sh
selfdrive/test/test_fingerprints.py
selfdrive/test/test_onroad.py
selfdrive/ui/.gitignore
selfdrive/ui/SConscript
selfdrive/ui/*.cc
selfdrive/ui/*.h
selfdrive/ui/ui
selfdrive/ui/text
selfdrive/ui/spinner
selfdrive/ui/soundd
selfdrive/ui/qt/*.cc
selfdrive/ui/qt/*.h
selfdrive/ui/qt/offroad/*.cc
selfdrive/ui/qt/offroad/*.h
selfdrive/ui/qt/offroad/*.qml
selfdrive/ui/qt/widgets/*.cc
selfdrive/ui/qt/widgets/*.h
selfdrive/ui/qt/spinner_aarch64
selfdrive/ui/qt/text_aarch64
selfdrive/camerad/SConscript
selfdrive/camerad/main.cc
selfdrive/camerad/snapshot/*
selfdrive/camerad/include/*
selfdrive/camerad/cameras/camera_common.h
selfdrive/camerad/cameras/camera_common.cc
selfdrive/camerad/cameras/camera_frame_stream.cc
selfdrive/camerad/cameras/camera_frame_stream.h
selfdrive/camerad/cameras/camera_qcom.cc
selfdrive/camerad/cameras/camera_qcom.h
selfdrive/camerad/cameras/debayer.cl
selfdrive/camerad/cameras/sensor_i2c.h
selfdrive/camerad/cameras/sensor2_i2c.h
selfdrive/camerad/transforms/rgb_to_yuv.cc
selfdrive/camerad/transforms/rgb_to_yuv.h
selfdrive/camerad/transforms/rgb_to_yuv.cl
selfdrive/camerad/transforms/rgb_to_yuv_test.cc
selfdrive/camerad/imgproc/conv.cl
selfdrive/camerad/imgproc/pool.cl
selfdrive/camerad/imgproc/utils.cc
selfdrive/camerad/imgproc/utils.h
selfdrive/manager/__init__.py
selfdrive/manager/build.py
selfdrive/manager/helpers.py
selfdrive/manager/manager.py
selfdrive/manager/process_config.py
selfdrive/manager/process.py
selfdrive/manager/test/__init__.py
selfdrive/manager/test/test_manager.py
selfdrive/modeld/SConscript
selfdrive/modeld/modeld.cc
selfdrive/modeld/dmonitoringmodeld.cc
selfdrive/modeld/constants.py
selfdrive/modeld/modeld
selfdrive/modeld/dmonitoringmodeld
selfdrive/modeld/models/commonmodel.cc
selfdrive/modeld/models/commonmodel.h
selfdrive/modeld/models/driving.cc
selfdrive/modeld/models/driving.h
selfdrive/modeld/models/dmonitoring.cc
selfdrive/modeld/models/dmonitoring.h
selfdrive/modeld/transforms/loadyuv.cc
selfdrive/modeld/transforms/loadyuv.h
selfdrive/modeld/transforms/loadyuv.cl
selfdrive/modeld/transforms/transform.cc
selfdrive/modeld/transforms/transform.h
selfdrive/modeld/transforms/transform.cl
selfdrive/modeld/thneed/thneed.*
selfdrive/modeld/thneed/serialize.cc
selfdrive/modeld/thneed/compile.cc
selfdrive/modeld/thneed/include/*
selfdrive/modeld/runners/snpemodel.cc
selfdrive/modeld/runners/snpemodel.h
selfdrive/modeld/runners/thneedmodel.cc
selfdrive/modeld/runners/thneedmodel.h
selfdrive/modeld/runners/runmodel.h
selfdrive/modeld/runners/run.h
selfdrive/monitoring/dmonitoringd.py
selfdrive/monitoring/driver_monitor.py
selfdrive/assets/.gitignore
selfdrive/assets/assets.qrc
selfdrive/assets/*.png
selfdrive/assets/*.svg
selfdrive/assets/fonts/*.ttf
selfdrive/assets/images/*
selfdrive/assets/offroad/*
selfdrive/assets/sounds/*
selfdrive/assets/training/*
phonelibs/SConscript
phonelibs/nanovg/*.c
phonelibs/nanovg/*.h
phonelibs/libgralloc/**
phonelibs/linux/**
phonelibs/opencl/**
phonelibs/zlib/*
phonelibs/bzip2/*
phonelibs/openmax/**
phonelibs/json11/json11.cpp
phonelibs/json11/json11.hpp
phonelibs/qpoases/**
phonelibs/qrcode/*.cc
phonelibs/qrcode/*.hpp
phonelibs/kaitai/*.h
phonelibs/kaitai/*.cpp
phonelibs/libyuv/include/**
phonelibs/libyuv/lib/**
phonelibs/libyuv/larch64/**
phonelibs/snpe/include/**
phonelibs/snpe/aarch64**
phonelibs/snpe/larch64**
phonelibs/snpe/dsp**
phonelibs/android_frameworks_native/**
phonelibs/android_hardware_libhardware/**
phonelibs/android_system_core/**
installer/updater/updater
installer/updater/updater.cc
installer/updater/update.json
installer/updater/Makefile
scripts/update_now.sh
scripts/stop_updater.sh
pyextra/.gitignore
rednose/**
cereal/.gitignore
cereal/__init__.py
cereal/car.capnp
cereal/legacy.capnp
cereal/log.capnp
cereal/services.py
cereal/SConscript
cereal/include/**
cereal/messaging/.gitignore
cereal/messaging/__init__.py
cereal/messaging/bridge.cc
cereal/messaging/impl_msgq.cc
cereal/messaging/impl_msgq.h
cereal/messaging/impl_zmq.cc
cereal/messaging/impl_zmq.h
cereal/messaging/messaging.cc
cereal/messaging/messaging.h
cereal/messaging/messaging.pxd
cereal/messaging/messaging_pyx.pyx
cereal/messaging/msgq.cc
cereal/messaging/msgq.h
cereal/messaging/socketmaster.cc
cereal/visionipc/.gitignore
cereal/visionipc/__init__.py
cereal/visionipc/*.cc
cereal/visionipc/*.h
cereal/visionipc/*.pyx
cereal/visionipc/*.pxd
panda/.gitignore
panda/__init__.py
panda/VERSION
panda/board/**
panda/certs/**
panda/crypto/**
panda/examples/query_fw_versions.py
panda/python/**
opendbc/.gitignore
opendbc/__init__.py
opendbc/can/__init__.py
opendbc/can/SConscript
opendbc/can/can_define.py
opendbc/can/common.cc
opendbc/can/common.h
opendbc/can/common.pxd
opendbc/can/common_dbc.h
opendbc/can/dbc.cc
opendbc/can/dbc.py
opendbc/can/dbc_template.cc
opendbc/can/packer.cc
opendbc/can/packer.py
opendbc/can/packer_pyx.pyx
opendbc/can/parser.cc
opendbc/can/parser.py
opendbc/can/parser_pyx.pyx
opendbc/can/process_dbc.py
opendbc/can/dbc_out/.gitkeep
opendbc/can/dbc_out/.gitignore
opendbc/chrysler_pacifica_2017_hybrid.dbc
opendbc/chrysler_pacifica_2017_hybrid_private_fusion.dbc
opendbc/gm_global_a_powertrain.dbc
opendbc/gm_global_a_object.dbc
opendbc/gm_global_a_chassis.dbc
opendbc/ford_fusion_2018_pt.dbc
opendbc/ford_fusion_2018_adas.dbc
opendbc/honda_accord_2018_can_generated.dbc
opendbc/acura_ilx_2016_can_generated.dbc
opendbc/acura_rdx_2018_can_generated.dbc
opendbc/acura_rdx_2020_can_generated.dbc
opendbc/honda_civic_touring_2016_can_generated.dbc
opendbc/honda_civic_hatchback_ex_2017_can_generated.dbc
opendbc/honda_civic_sedan_16_diesel_2019_can_generated.dbc
opendbc/honda_crv_touring_2016_can_generated.dbc
opendbc/honda_crv_ex_2017_can_generated.dbc
opendbc/honda_crv_ex_2017_body_generated.dbc
opendbc/honda_crv_executive_2016_can_generated.dbc
opendbc/honda_crv_hybrid_2019_can_generated.dbc
opendbc/honda_fit_ex_2018_can_generated.dbc
opendbc/honda_hrv_touring_2019_can_generated.dbc
opendbc/honda_odyssey_exl_2018_generated.dbc
opendbc/honda_odyssey_extreme_edition_2018_china_can_generated.dbc
opendbc/honda_pilot_touring_2017_can_generated.dbc
opendbc/honda_ridgeline_black_edition_2017_can_generated.dbc
opendbc/honda_insight_ex_2019_can_generated.dbc
opendbc/acura_ilx_2016_nidec.dbc
opendbc/hyundai_kia_generic.dbc
opendbc/mazda_2017.dbc
opendbc/nissan_x_trail_2017.dbc
opendbc/nissan_leaf_2018.dbc
opendbc/subaru_global_2017_generated.dbc
opendbc/subaru_outback_2015_generated.dbc
opendbc/subaru_outback_2019_generated.dbc
opendbc/subaru_forester_2017_generated.dbc
opendbc/toyota_rav4_hybrid_2017_pt_generated.dbc
opendbc/toyota_rav4_2017_pt_generated.dbc
opendbc/toyota_prius_2017_pt_generated.dbc
opendbc/toyota_corolla_2017_pt_generated.dbc
opendbc/lexus_rx_350_2016_pt_generated.dbc
opendbc/lexus_rx_hybrid_2017_pt_generated.dbc
opendbc/toyota_nodsu_pt_generated.dbc
opendbc/toyota_nodsu_hybrid_pt_generated.dbc
opendbc/toyota_camry_hybrid_2018_pt_generated.dbc
opendbc/toyota_highlander_2017_pt_generated.dbc
opendbc/toyota_highlander_hybrid_2018_pt_generated.dbc
opendbc/toyota_avalon_2017_pt_generated.dbc
opendbc/toyota_sienna_xle_2018_pt_generated.dbc
opendbc/lexus_is_2018_pt_generated.dbc
opendbc/lexus_ct200h_2018_pt_generated.dbc
opendbc/lexus_nx300h_2018_pt_generated.dbc
opendbc/lexus_nx300_2018_pt_generated.dbc
opendbc/toyota_adas.dbc
opendbc/toyota_tss2_adas.dbc
opendbc/vw_mqb_2010.dbc
opendbc/tesla_can.dbc

3
release/files_pc Normal file
View File

@@ -0,0 +1,3 @@
phonelibs/mapbox-gl-native-qt/x86_64/**
phonelibs/qt-plugins/x86_64/**

27
release/files_tici Normal file
View File

@@ -0,0 +1,27 @@
installer/continue_openpilot.sh
phonelibs/mapbox-gl-native-qt/include/*
selfdrive/timezoned.py
selfdrive/assets/navigation/*
selfdrive/assets/training_wide/*
selfdrive/assets/sounds_tici/*
selfdrive/camerad/cameras/camera_qcom2.cc
selfdrive/camerad/cameras/camera_qcom2.h
selfdrive/camerad/cameras/real_debayer.cl
selfdrive/hardware/tici/__init__.py
selfdrive/hardware/tici/hardware.h
selfdrive/hardware/tici/hardware.py
selfdrive/hardware/tici/pins.py
selfdrive/hardware/tici/agnos.py
selfdrive/hardware/tici/agnos.json
selfdrive/hardware/tici/amplifier.py
selfdrive/hardware/tici/updater
selfdrive/ui/qt/spinner_larch64
selfdrive/ui/qt/text_larch64
selfdrive/ui/qt/maps/*.cc
selfdrive/ui/qt/maps/*.h

5
release/identity.sh Normal file
View File

@@ -0,0 +1,5 @@
export GIT_COMMITTER_NAME="Vehicle Researcher"
export GIT_COMMITTER_EMAIL="user@comma.ai"
export GIT_AUTHOR_NAME="Vehicle Researcher"
export GIT_AUTHOR_EMAIL="user@comma.ai"
export GIT_SSH_COMMAND="ssh -i /data/gitkey"

View File

@@ -2,7 +2,6 @@
sudo echo 5000 > /sys/devices/c250000.i2c/i2c-7/7-0040/iio:device0/crit_current_limit_0
sudo nvpmodel -m 2 && sudo jetson_clocks
export PASSIVE=0
export NOSENSOR=1
export USE_MIPI=1
cd ../selfdrive/manager && ./manager.py
# available freq: 1651200 1728000 1804800 1881600 1907200
for i in /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq; do echo 1907200 > $i; done
cd /home/openpilot/openpilot/selfdrive/manager && PASSIVE=0 NOSENSOR=1 USE_MIPI=1 ./manager.py

58
scripts/reset_usb.py Normal file
View File

@@ -0,0 +1,58 @@
#!/usr/bin/env python
import os
import sys
from subprocess import Popen, PIPE
import fcntl
def create_usb_list():
device_list = list()
try:
lsusb_out = Popen('lsusb -v', shell=True, bufsize=64, stdin=PIPE, stdout=PIPE, close_fds=True).stdout.read().strip().decode('utf-8')
usb_devices = lsusb_out.split('%s%s' % (os.linesep, os.linesep))
for device_categories in usb_devices:
if not device_categories:
continue
categories = device_categories.split(os.linesep)
device_stuff = categories[0].strip().split()
bus = device_stuff[1]
device = device_stuff[3][:-1]
device_dict = {'bus': bus, 'device': device}
device_info = ' '.join(device_stuff[6:])
device_dict['description'] = device_info
for category in categories:
if not category:
continue
categoryinfo = category.strip().split()
if categoryinfo[0] == 'iManufacturer':
manufacturer_info = ' '.join(categoryinfo[2:])
device_dict['manufacturer'] = manufacturer_info
if categoryinfo[0] == 'iProduct':
device_info = ' '.join(categoryinfo[2:])
device_dict['device'] = device_info
path = '/dev/bus/usb/%s/%s' % (bus, device)
device_dict['path'] = path
device_list.append(device_dict)
except Exception as ex:
print('Failed to list usb devices! Error: %s' % ex)
sys.exit(-1)
return device_list
def kill_usb(dev_path):
USBDEVFS_RESET = 21780
try:
f = open(dev_path, 'w', os.O_WRONLY)
fcntl.ioctl(f, USBDEVFS_RESET, 0)
print('Successfully reset %s' % dev_path)
sys.exit(0)
except Exception as ex:
print('Failed to reset device! Error: %s' % ex)
sys.exit(-1)
if __name__ == "__main__":
usb_list = create_usb_list()
for device in usb_list:
if device['manufacturer'] == 'comma.ai':
kill_usb(device['path'])
sys.exit(0)

1
selfdrive/assets/.gitignore vendored Normal file
View File

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

View File

@@ -0,0 +1,15 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>img_continue_triangle.svg</file>
<file>img_circled_check.svg</file>
<file>img_circled_slash.svg</file>
<file>img_eye_open.svg</file>
<file>img_eye_closed.svg</file>
<file>offroad/icon_lock_closed.svg</file>
<file>offroad/icon_checkmark.svg</file>
<file>offroad/icon_wifi_strength_low.svg</file>
<file>offroad/icon_wifi_strength_medium.svg</file>
<file>offroad/icon_wifi_strength_high.svg</file>
<file>offroad/icon_wifi_strength_full.svg</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,4 @@
<svg width="104" height="104" viewBox="0 0 104 104" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M76.3 36L43.8 67.7L28 51.9" stroke="white" stroke-width="7" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M52 101.5C79.3381 101.5 101.5 79.3381 101.5 52C101.5 24.6619 79.3381 2.5 52 2.5C24.6619 2.5 2.5 24.6619 2.5 52C2.5 79.3381 24.6619 101.5 52 101.5Z" stroke="white" stroke-width="5"/>
</svg>

After

Width:  |  Height:  |  Size: 439 B

View File

@@ -0,0 +1,4 @@
<svg width="104" height="104" viewBox="0 0 104 104" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M52 98C77.4051 98 98 77.4051 98 52C98 26.5949 77.4051 6 52 6C26.5949 6 6 26.5949 6 52C6 77.4051 26.5949 98 52 98Z" stroke="#696969" stroke-width="12"/>
<path d="M19 85L85 19" stroke="#696969" stroke-width="12"/>
</svg>

After

Width:  |  Height:  |  Size: 328 B

View File

@@ -0,0 +1,3 @@
<svg width="54" height="106" viewBox="0 0 54 106" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.01946 4.01488L47.249 54.0666L6.1184 102.141" stroke="white" stroke-width="10"/>
</svg>

After

Width:  |  Height:  |  Size: 197 B

View File

@@ -0,0 +1,5 @@
<svg width="81" height="54" viewBox="0 0 81 54" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M56.4845 7.63065C51.7905 6.01921 46.5684 5 40.8516 5C23.3024 5 10.5368 14.4989 3.27501 21.356C-0.113807 24.5209 -0.113807 29.4791 3.27501 32.644C5.49715 34.7423 8.23466 37.088 11.4669 39.3332L16.0284 36.1208C11.8215 33.3047 8.50721 30.4206 6.47928 28.5297C5.63207 27.6857 5.63207 26.5253 6.47928 25.6813C11.6835 20.7231 25.4809 9.32967 40.8516 9.32967C44.5542 9.32967 48.1656 9.99692 51.5875 11.0793L56.4845 7.63065ZM70.3373 14.7537L65.6283 18.0699C69.8565 20.9236 73.194 23.8528 75.2239 25.7868C75.9501 26.5253 75.9501 27.5802 75.2239 28.3187C70.0197 33.2769 56.3434 44.7758 40.8516 44.7758C37.1452 44.7758 33.5427 44.1237 30.1353 43.0649L25.3547 46.4316C30.0041 48.0071 35.1778 49 40.8516 49C58.4009 49 71.2875 39.5011 78.5492 32.433C81.817 29.2681 81.817 24.5209 78.5492 21.4615C76.3287 19.3647 73.5822 17.0111 70.3373 14.7537Z" fill="#BDBDBD"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M46.1473 14.9103C44.5479 14.113 42.757 13.6667 40.8663 13.6667C34.0916 13.6667 28.5996 19.3974 28.5996 26.4667C28.5996 26.7303 28.6073 26.9922 28.6223 27.2519L46.1473 14.9103ZM36.6377 38.4858C37.9559 38.9909 39.3802 39.2667 40.8663 39.2667C47.5104 39.2667 52.9208 33.7546 53.1269 26.8737L36.6377 38.4858Z" fill="#BDBDBD"/>
<line x1="73.2745" y1="4.18015" x2="7.18015" y2="50.7255" stroke="#BDBDBD" stroke-width="6" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,4 @@
<svg width="81" height="44" viewBox="0 0 81 44" fill="none" xmlns="http://www.w3.org/2000/svg">
<ellipse cx="40.8663" cy="21.4667" rx="12.2667" ry="12.8" fill="#BDBDBD"/>
<path d="M40.8516 44C23.3024 44 10.5368 34.5011 3.27501 27.644C-0.113807 24.4791 -0.113807 19.5209 3.27501 16.356C10.5368 9.4989 23.3024 0 40.8516 0C58.4009 0 71.2875 9.6044 78.5492 16.4615C81.817 19.5209 81.817 24.2681 78.5492 27.433C71.2875 34.5011 58.4009 44 40.8516 44ZM6.47928 20.6813C5.63207 21.5253 5.63207 22.6857 6.47928 23.5297C11.6835 28.3824 25.3598 39.7758 40.8516 39.7758C56.3434 39.7758 70.0197 28.2769 75.2239 23.3187C75.9501 22.5802 75.9501 21.5253 75.2239 20.7868C70.0197 15.8286 56.2223 4.32967 40.8516 4.32967C25.4809 4.32967 11.6835 15.7231 6.47928 20.6813Z" fill="#BDBDBD"/>
</svg>

After

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

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