mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-12 05:44:14 +08:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
adaa4ed350 | ||
|
|
a64b9aa9b8 | ||
|
|
0138eca61d | ||
|
|
139a40de29 | ||
|
|
17d9becd3c | ||
|
|
449b482cc3 | ||
|
|
a7e099c946 | ||
|
|
610462be5a | ||
|
|
207d32668f |
21
.gitignore
vendored
Normal file
21
.gitignore
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
.DS_Store
|
||||
.tags
|
||||
|
||||
*.pyc
|
||||
.*.swp
|
||||
.*.swo
|
||||
.*.un~
|
||||
*.o
|
||||
*.d
|
||||
*.so
|
||||
*.a
|
||||
*.clb
|
||||
config.json
|
||||
clcache
|
||||
|
||||
board/obj/
|
||||
selfdrive/boardd/boardd
|
||||
selfdrive/logcatd/logcatd
|
||||
selfdrive/sensord/sensord
|
||||
selfdrive/ui/ui
|
||||
|
||||
13
.travis.yml
Normal file
13
.travis.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
sudo: required
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
install:
|
||||
- docker build -t tmppilot -f Dockerfile.openpilot .
|
||||
|
||||
script:
|
||||
- docker run --rm
|
||||
-v "$(pwd)"/selfdrive/test/plant/out:/tmp/openpilot/selfdrive/test/plant/out
|
||||
tmppilot /bin/sh -c 'cd /tmp/openpilot/selfdrive/test/plant && ./runtest.sh'
|
||||
|
||||
19
Dockerfile.openpilot
Normal file
19
Dockerfile.openpilot
Normal file
@@ -0,0 +1,19 @@
|
||||
FROM ubuntu:14.04
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
RUN apt-get update && apt-get install -y build-essential screen wget bzip2 git libglib2.0-0
|
||||
|
||||
RUN wget -nv -O /tmp/anaconda.sh https://repo.continuum.io/archive/Anaconda2-4.2.0-Linux-x86_64.sh && \
|
||||
/bin/bash /tmp/anaconda.sh -b -p /opt/conda && \
|
||||
rm /tmp/anaconda.sh
|
||||
|
||||
ENV PATH /opt/conda/bin:$PATH
|
||||
|
||||
RUN conda install numpy==1.11.2 && conda install scipy==0.18.1
|
||||
|
||||
COPY requirements_openpilot.txt /tmp/
|
||||
RUN pip install -r /tmp/requirements_openpilot.txt
|
||||
|
||||
ENV PYTHONPATH /tmp/openpilot:$PYTHONPATH
|
||||
|
||||
COPY . /tmp/openpilot
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2016, comma.ai
|
||||
Copyright (c) 2016, Comma.ai, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
|
||||
22
README.md
22
README.md
@@ -42,26 +42,42 @@ Directory structure
|
||||
- assets -- Fonts for ui
|
||||
- boardd -- Daemon to talk to the board
|
||||
- calibrationd -- Camera calibration server
|
||||
- car -- Code that talks to the car and implements CarInterface
|
||||
- common -- Shared C/C++ code for the daemons
|
||||
- controls -- Python controls (PID loops etc) for the car
|
||||
- logcatd -- Android logcat as a service
|
||||
- loggerd -- Logger and uploader of car data
|
||||
- radar -- Code that talks to the radar and implements RadarInterface
|
||||
- sensord -- IMU / GPS interface code
|
||||
- test/plant -- Car simulator running code through virtual maneuvers
|
||||
- ui -- The UI
|
||||
- visiond -- embedded vision pipeline
|
||||
|
||||
To understand how the services interact, see `common/services.py`
|
||||
|
||||
Testing on PC
|
||||
------
|
||||
|
||||
There is rudimentary infrastructure to run a basic simulation and generate a report of openpilot's behavior in different scenarios.
|
||||
|
||||
```bash
|
||||
# Requires working docker
|
||||
./run_docker_tests.sh
|
||||
```
|
||||
|
||||
The results are written to `selfdrive/test/plant/out/index.html`
|
||||
|
||||
More extensive testing infrastructure and simulation environments are coming soon.
|
||||
|
||||
Adding Car Support
|
||||
------
|
||||
|
||||
It should be relatively easy to add support for the Honda CR-V Touring. The brake message is the same. Steering has a slightly different message with a different message id. Sniff CAN while using LKAS to find it.
|
||||
|
||||
The Honda Accord uses different signalling for the steering and probably requires new hardware.
|
||||
The Honda Accord uses different signaling for the steering and probably requires new hardware.
|
||||
|
||||
Adding other manufacturers besides Honda/Acura is doable but will be more of an undertaking.
|
||||
|
||||
|
||||
User Data / chffr Account / Crash Reporting
|
||||
------
|
||||
|
||||
@@ -81,7 +97,7 @@ We welcome both pull requests and issues on
|
||||
[github](http://github.com/commaai/openpilot). See the TODO file for a list of
|
||||
good places to start.
|
||||
|
||||
|
||||
Want to get paid to work on openpilot? [comma.ai is hiring](http://comma.ai/hiring.html)
|
||||
|
||||
Licensing
|
||||
------
|
||||
|
||||
37
RELEASES.md
Normal file
37
RELEASES.md
Normal file
@@ -0,0 +1,37 @@
|
||||
Version 0.2.3 (2017-01-11)
|
||||
===========================
|
||||
* Reduce space usage by 80%
|
||||
* Add better logging
|
||||
* Add Travis CI
|
||||
|
||||
Version 0.2.2 (2017-01-10)
|
||||
===========================
|
||||
* Board triggers started signal on CAN messages
|
||||
* Improved autoexposure
|
||||
* Handle out of space, improve upload status
|
||||
|
||||
Version 0.2.1 (2016-12-14)
|
||||
===========================
|
||||
* Performance improvements, removal of more numpy
|
||||
* Fix boardd process priority
|
||||
* Make counter timer reset on use of steering wheel
|
||||
|
||||
Version 0.2 (2016-12-12)
|
||||
=========================
|
||||
* Car/Radar abstraction layers have shipped, see cereal/car.capnp
|
||||
* controlsd has been refactored
|
||||
* Shipped plant model and testing maneuvers
|
||||
* visiond exits more gracefully now
|
||||
* Hardware encoder in visiond should always init
|
||||
* ui now turns off the screen after 30 seconds
|
||||
* Switch to openpilot release branch for future releases
|
||||
* Added preliminary Docker container to run tests on PC
|
||||
|
||||
Version 0.1 (2016-11-29)
|
||||
=========================
|
||||
* Initial release of openpilot
|
||||
* Adaptive cruise control is working
|
||||
* Lane keep assist is working
|
||||
* Support for Acura ILX 2016 with AcuraWatch Plus
|
||||
* Support for Honda Civic 2016 Touring Edition
|
||||
|
||||
14
TODO.md
14
TODO.md
@@ -1,14 +0,0 @@
|
||||
TODO
|
||||
======
|
||||
|
||||
An incomplete list of known issues and desired featues.
|
||||
|
||||
- TX and RX amounts on UI are wrong for a few frames at startup because we
|
||||
subtract (total sent - 0). We should initialize sent bytes before displaying.
|
||||
|
||||
- Rewrite common/dbc.py to be faster and cleaner, potentially in C++.
|
||||
|
||||
- Add module and class level documentation where appropriate.
|
||||
|
||||
- Fix lock file cleanup so there isn't always 1 pending upload when the vehicle
|
||||
shuts off.
|
||||
33
board/main.c
33
board/main.c
@@ -2,6 +2,7 @@
|
||||
//#define CAN_LOOPBACK_MODE
|
||||
//#define USE_INTERNAL_OSC
|
||||
//#define OLD_BOARD
|
||||
//#define ENABLE_CURRENT_SENSOR
|
||||
|
||||
#define USB_VID 0xbbaa
|
||||
#define USB_PID 0xddcc
|
||||
@@ -24,7 +25,12 @@ USB_OTG_GlobalTypeDef *USBx = USB_OTG_FS;
|
||||
|
||||
// debug safety check: is controls allowed?
|
||||
int controls_allowed = 0;
|
||||
int started = 0;
|
||||
int can_live = 0, pending_can_live = 0;
|
||||
|
||||
// optional features
|
||||
int gas_interceptor_detected = 0;
|
||||
int started_signal_detected = 0;
|
||||
|
||||
// ********************* instantiate queues *********************
|
||||
|
||||
@@ -146,6 +152,9 @@ void CAN2_TX_IRQHandler() {
|
||||
// CAN receive handlers
|
||||
void can_rx(CAN_TypeDef *CAN, int can_number) {
|
||||
while (CAN->RF0R & CAN_RF0R_FMP0) {
|
||||
// can is live
|
||||
pending_can_live = 1;
|
||||
|
||||
// add to my fifo
|
||||
CAN_FIFOMailBox_TypeDef to_push;
|
||||
to_push.RIR = CAN->sFIFOMailBox[0].RIR;
|
||||
@@ -255,12 +264,20 @@ int get_health_pkt(void *dat) {
|
||||
uint8_t started;
|
||||
uint8_t controls_allowed;
|
||||
uint8_t gas_interceptor_detected;
|
||||
uint8_t started_signal_detected;
|
||||
} *health = dat;
|
||||
health->voltage = adc_get(ADCCHAN_VOLTAGE);
|
||||
#ifdef ENABLE_CURRENT_SENSOR
|
||||
health->current = adc_get(ADCCHAN_CURRENT);
|
||||
health->started = (GPIOC->IDR & (1 << 13)) != 0;
|
||||
#else
|
||||
health->current = 0;
|
||||
#endif
|
||||
health->started = started;
|
||||
|
||||
health->controls_allowed = controls_allowed;
|
||||
|
||||
health->gas_interceptor_detected = gas_interceptor_detected;
|
||||
health->started_signal_detected = started_signal_detected;
|
||||
return sizeof(*health);
|
||||
}
|
||||
|
||||
@@ -463,6 +480,9 @@ int main() {
|
||||
|
||||
// LED should keep on blinking all the time
|
||||
while (1) {
|
||||
can_live = pending_can_live;
|
||||
pending_can_live = 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
puts("** blink ");
|
||||
puth(can_rx_q.r_ptr); puts(" "); puth(can_rx_q.w_ptr); puts(" ");
|
||||
@@ -484,14 +504,21 @@ int main() {
|
||||
GPIOB->ODR &= ~(1 << 10);
|
||||
delay(1000000);
|
||||
|
||||
if (GPIOC->IDR & (1 << 13)) {
|
||||
// started logic
|
||||
int started_signal = (GPIOC->IDR & (1 << 13)) != 0;
|
||||
if (started_signal) { started_signal_detected = 1; }
|
||||
|
||||
if (started_signal || (!started_signal_detected && can_live)) {
|
||||
started = 1;
|
||||
|
||||
// turn on fan at half speed
|
||||
set_fan_speed(32768);
|
||||
} else {
|
||||
started = 0;
|
||||
|
||||
// turn off fan
|
||||
set_fan_speed(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -4,4 +4,5 @@ capnp.remove_import_hook()
|
||||
|
||||
CEREAL_PATH = os.path.dirname(os.path.abspath(__file__))
|
||||
log = capnp.load(os.path.join(CEREAL_PATH, "log.capnp"))
|
||||
car = capnp.load(os.path.join(CEREAL_PATH, "car.capnp"))
|
||||
|
||||
|
||||
172
cereal/car.capnp
Normal file
172
cereal/car.capnp
Normal file
@@ -0,0 +1,172 @@
|
||||
using Cxx = import "c++.capnp";
|
||||
$Cxx.namespace("cereal");
|
||||
|
||||
@0x8e2af1e708af8b8d;
|
||||
|
||||
# ******* main car state @ 100hz *******
|
||||
# all speeds in m/s
|
||||
|
||||
struct CarState {
|
||||
errors @0: List(Error);
|
||||
|
||||
# car speed
|
||||
vEgo @1 :Float32; # best estimate of speed
|
||||
wheelSpeeds @2 :WheelSpeeds;
|
||||
|
||||
# gas pedal, 0.0-1.0
|
||||
gas @3 :Float32; # this is user + computer
|
||||
gasPressed @4 :Bool; # this is user pedal only
|
||||
|
||||
# brake pedal, 0.0-1.0
|
||||
brake @5 :Float32; # this is user pedal only
|
||||
brakePressed @6 :Bool; # this is user pedal only
|
||||
|
||||
# steering wheel
|
||||
steeringAngle @7 :Float32; # deg
|
||||
steeringTorque @8 :Float32; # TODO: standardize units
|
||||
steeringPressed @9 :Bool; # if the user is using the steering wheel
|
||||
|
||||
# cruise state
|
||||
cruiseState @10 :CruiseState;
|
||||
|
||||
# button presses
|
||||
buttonEvents @11 :List(ButtonEvent);
|
||||
|
||||
# which packets this state came from
|
||||
canMonoTimes @12: List(UInt64);
|
||||
|
||||
struct WheelSpeeds {
|
||||
# optional wheel speeds
|
||||
fl @0 :Float32;
|
||||
fr @1 :Float32;
|
||||
rl @2 :Float32;
|
||||
rr @3 :Float32;
|
||||
}
|
||||
|
||||
struct CruiseState {
|
||||
enabled @0: Bool;
|
||||
speed @1: Float32;
|
||||
}
|
||||
|
||||
enum Error {
|
||||
# TODO: copy from error list
|
||||
commIssue @0;
|
||||
steerUnavailable @1;
|
||||
brakeUnavailable @2;
|
||||
gasUnavailable @3;
|
||||
wrongGear @4;
|
||||
doorOpen @5;
|
||||
seatbeltNotLatched @6;
|
||||
espDisabled @7;
|
||||
wrongCarMode @8;
|
||||
steerTemporarilyUnavailable @9;
|
||||
reverseGear @10;
|
||||
# ...
|
||||
}
|
||||
|
||||
# send on change
|
||||
struct ButtonEvent {
|
||||
pressed @0: Bool;
|
||||
type @1: Type;
|
||||
|
||||
enum Type {
|
||||
unknown @0;
|
||||
leftBlinker @1;
|
||||
rightBlinker @2;
|
||||
accelCruise @3;
|
||||
decelCruise @4;
|
||||
cancel @5;
|
||||
altButton1 @6;
|
||||
altButton2 @7;
|
||||
altButton3 @8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ******* radar state @ 20hz *******
|
||||
|
||||
struct RadarState {
|
||||
errors @0: List(Error);
|
||||
points @1: List(RadarPoint);
|
||||
|
||||
# which packets this state came from
|
||||
canMonoTimes @2: List(UInt64);
|
||||
|
||||
enum Error {
|
||||
notValid @0;
|
||||
}
|
||||
|
||||
# similar to LiveTracks
|
||||
# is one timestamp valid for all? I think so
|
||||
struct RadarPoint {
|
||||
trackId @0: UInt64; # no trackId reuse
|
||||
|
||||
# these 3 are the minimum required
|
||||
dRel @1: Float32; # m from the front bumper of the car
|
||||
yRel @2: Float32; # m
|
||||
vRel @3: Float32; # m/s
|
||||
|
||||
# these are optional and valid if they are not NaN
|
||||
aRel @4: Float32; # m/s^2
|
||||
yvRel @5: Float32; # m/s
|
||||
}
|
||||
}
|
||||
|
||||
# ******* car controls @ 100hz *******
|
||||
|
||||
struct CarControl {
|
||||
# must be true for any actuator commands to work
|
||||
enabled @0: Bool;
|
||||
|
||||
# range from 0.0 - 1.0
|
||||
gas @1: Float32;
|
||||
brake @2: Float32;
|
||||
|
||||
# range from -1.0 - 1.0
|
||||
steeringTorque @3 :Float32;
|
||||
|
||||
cruiseControl @4: CruiseControl;
|
||||
hudControl @5: HUDControl;
|
||||
|
||||
struct CruiseControl {
|
||||
cancel @0: Bool;
|
||||
override @1: Bool;
|
||||
speedOverride @2: Float32;
|
||||
accelOverride @3: Float32;
|
||||
}
|
||||
|
||||
struct HUDControl {
|
||||
speedVisible @0: Bool;
|
||||
setSpeed @1: Float32;
|
||||
lanesVisible @2: Bool;
|
||||
leadVisible @3: Bool;
|
||||
visualAlert @4: VisualAlert;
|
||||
audibleAlert @5: AudibleAlert;
|
||||
|
||||
enum VisualAlert {
|
||||
# these are the choices from the Honda
|
||||
# map as good as you can for your car
|
||||
none @0;
|
||||
fcw @1;
|
||||
steerRequired @2;
|
||||
brakePressed @3;
|
||||
wrongGear @4;
|
||||
seatbeltUnbuckled @5;
|
||||
speedTooHigh @6;
|
||||
}
|
||||
|
||||
enum AudibleAlert {
|
||||
# these are the choices from the Honda
|
||||
# map as good as you can for your car
|
||||
none @0;
|
||||
beepSingle @1;
|
||||
beepTriple @2;
|
||||
beepRepeated @3;
|
||||
chimeSingle @4;
|
||||
chimeDouble @5;
|
||||
chimeRepeated @6;
|
||||
chimeContinuous @7;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,12 +235,12 @@ void cereal_set_CanData(const struct cereal_CanData *s, cereal_CanData_list l, i
|
||||
|
||||
cereal_ThermalData_ptr cereal_new_ThermalData(struct capn_segment *s) {
|
||||
cereal_ThermalData_ptr p;
|
||||
p.p = capn_new_struct(s, 16, 0);
|
||||
p.p = capn_new_struct(s, 24, 0);
|
||||
return p;
|
||||
}
|
||||
cereal_ThermalData_list cereal_new_ThermalData_list(struct capn_segment *s, int len) {
|
||||
cereal_ThermalData_list p;
|
||||
p.p = capn_new_list(s, len, 16, 0);
|
||||
p.p = capn_new_list(s, len, 24, 0);
|
||||
return p;
|
||||
}
|
||||
void cereal_read_ThermalData(struct cereal_ThermalData *s, cereal_ThermalData_ptr p) {
|
||||
@@ -252,6 +252,7 @@ void cereal_read_ThermalData(struct cereal_ThermalData *s, cereal_ThermalData_pt
|
||||
s->mem = capn_read16(p.p, 8);
|
||||
s->gpu = capn_read16(p.p, 10);
|
||||
s->bat = capn_read32(p.p, 12);
|
||||
s->freeSpace = capn_to_f32(capn_read32(p.p, 16));
|
||||
}
|
||||
void cereal_write_ThermalData(const struct cereal_ThermalData *s, cereal_ThermalData_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
@@ -262,6 +263,7 @@ void cereal_write_ThermalData(const struct cereal_ThermalData *s, cereal_Thermal
|
||||
capn_write16(p.p, 8, s->mem);
|
||||
capn_write16(p.p, 10, s->gpu);
|
||||
capn_write32(p.p, 12, s->bat);
|
||||
capn_write32(p.p, 16, capn_from_f32(s->freeSpace));
|
||||
}
|
||||
void cereal_get_ThermalData(struct cereal_ThermalData *s, cereal_ThermalData_list l, int i) {
|
||||
cereal_ThermalData_ptr p;
|
||||
@@ -291,6 +293,7 @@ void cereal_read_HealthData(struct cereal_HealthData *s, cereal_HealthData_ptr p
|
||||
s->started = (capn_read8(p.p, 8) & 1) != 0;
|
||||
s->controlsAllowed = (capn_read8(p.p, 8) & 2) != 0;
|
||||
s->gasInterceptorDetected = (capn_read8(p.p, 8) & 4) != 0;
|
||||
s->startedSignalDetected = (capn_read8(p.p, 8) & 8) != 0;
|
||||
}
|
||||
void cereal_write_HealthData(const struct cereal_HealthData *s, cereal_HealthData_ptr p) {
|
||||
capn_resolve(&p.p);
|
||||
@@ -299,6 +302,7 @@ void cereal_write_HealthData(const struct cereal_HealthData *s, cereal_HealthDat
|
||||
capn_write1(p.p, 64, s->started != 0);
|
||||
capn_write1(p.p, 65, s->controlsAllowed != 0);
|
||||
capn_write1(p.p, 66, s->gasInterceptorDetected != 0);
|
||||
capn_write1(p.p, 67, s->startedSignalDetected != 0);
|
||||
}
|
||||
void cereal_get_HealthData(struct cereal_HealthData *s, cereal_HealthData_list l, int i) {
|
||||
cereal_HealthData_ptr p;
|
||||
@@ -361,11 +365,11 @@ void cereal_read_Live20Data(struct cereal_Live20Data *s, cereal_Live20Data_ptr p
|
||||
s->canMonoTimes.p = capn_getp(p.p, 3, 0);
|
||||
s->mdMonoTime = capn_read64(p.p, 16);
|
||||
s->ftMonoTime = capn_read64(p.p, 24);
|
||||
s->warpMatrix.p = capn_getp(p.p, 0, 0);
|
||||
s->angleOffset = capn_to_f32(capn_read32(p.p, 0));
|
||||
s->calStatus = (int8_t) ((int8_t)capn_read8(p.p, 4));
|
||||
s->calCycle = (int32_t) ((int32_t)capn_read32(p.p, 12));
|
||||
s->calPerc = (int8_t) ((int8_t)capn_read8(p.p, 5));
|
||||
s->warpMatrixDEPRECATED.p = capn_getp(p.p, 0, 0);
|
||||
s->angleOffsetDEPRECATED = capn_to_f32(capn_read32(p.p, 0));
|
||||
s->calStatusDEPRECATED = (int8_t) ((int8_t)capn_read8(p.p, 4));
|
||||
s->calCycleDEPRECATED = (int32_t) ((int32_t)capn_read32(p.p, 12));
|
||||
s->calPercDEPRECATED = (int8_t) ((int8_t)capn_read8(p.p, 5));
|
||||
s->leadOne.p = capn_getp(p.p, 1, 0);
|
||||
s->leadTwo.p = capn_getp(p.p, 2, 0);
|
||||
s->cumLagMs = capn_to_f32(capn_read32(p.p, 8));
|
||||
@@ -375,11 +379,11 @@ void cereal_write_Live20Data(const struct cereal_Live20Data *s, cereal_Live20Dat
|
||||
capn_setp(p.p, 3, s->canMonoTimes.p);
|
||||
capn_write64(p.p, 16, s->mdMonoTime);
|
||||
capn_write64(p.p, 24, s->ftMonoTime);
|
||||
capn_setp(p.p, 0, s->warpMatrix.p);
|
||||
capn_write32(p.p, 0, capn_from_f32(s->angleOffset));
|
||||
capn_write8(p.p, 4, (uint8_t) (s->calStatus));
|
||||
capn_write32(p.p, 12, (uint32_t) (s->calCycle));
|
||||
capn_write8(p.p, 5, (uint8_t) (s->calPerc));
|
||||
capn_setp(p.p, 0, s->warpMatrixDEPRECATED.p);
|
||||
capn_write32(p.p, 0, capn_from_f32(s->angleOffsetDEPRECATED));
|
||||
capn_write8(p.p, 4, (uint8_t) (s->calStatusDEPRECATED));
|
||||
capn_write32(p.p, 12, (uint32_t) (s->calCycleDEPRECATED));
|
||||
capn_write8(p.p, 5, (uint8_t) (s->calPercDEPRECATED));
|
||||
capn_setp(p.p, 1, s->leadOne.p);
|
||||
capn_setp(p.p, 2, s->leadTwo.p);
|
||||
capn_write32(p.p, 8, capn_from_f32(s->cumLagMs));
|
||||
@@ -545,7 +549,7 @@ void cereal_read_Live100Data(struct cereal_Live100Data *s, cereal_Live100Data_pt
|
||||
s->l20MonoTime = capn_read64(p.p, 72);
|
||||
s->mdMonoTime = capn_read64(p.p, 80);
|
||||
s->vEgo = capn_to_f32(capn_read32(p.p, 0));
|
||||
s->aEgo = capn_to_f32(capn_read32(p.p, 4));
|
||||
s->aEgoDEPRECATED = capn_to_f32(capn_read32(p.p, 4));
|
||||
s->vPid = capn_to_f32(capn_read32(p.p, 8));
|
||||
s->vTargetLead = capn_to_f32(capn_read32(p.p, 12));
|
||||
s->upAccelCmd = capn_to_f32(capn_read32(p.p, 16));
|
||||
@@ -558,7 +562,7 @@ void cereal_read_Live100Data(struct cereal_Live100Data *s, cereal_Live100Data_pt
|
||||
s->aTargetMax = capn_to_f32(capn_read32(p.p, 44));
|
||||
s->jerkFactor = capn_to_f32(capn_read32(p.p, 48));
|
||||
s->angleSteers = capn_to_f32(capn_read32(p.p, 52));
|
||||
s->hudLead = (int32_t) ((int32_t)capn_read32(p.p, 56));
|
||||
s->hudLeadDEPRECATED = (int32_t) ((int32_t)capn_read32(p.p, 56));
|
||||
s->cumLagMs = capn_to_f32(capn_read32(p.p, 60));
|
||||
s->enabled = (capn_read8(p.p, 88) & 1) != 0;
|
||||
s->steerOverride = (capn_read8(p.p, 88) & 2) != 0;
|
||||
@@ -575,7 +579,7 @@ void cereal_write_Live100Data(const struct cereal_Live100Data *s, cereal_Live100
|
||||
capn_write64(p.p, 72, s->l20MonoTime);
|
||||
capn_write64(p.p, 80, s->mdMonoTime);
|
||||
capn_write32(p.p, 0, capn_from_f32(s->vEgo));
|
||||
capn_write32(p.p, 4, capn_from_f32(s->aEgo));
|
||||
capn_write32(p.p, 4, capn_from_f32(s->aEgoDEPRECATED));
|
||||
capn_write32(p.p, 8, capn_from_f32(s->vPid));
|
||||
capn_write32(p.p, 12, capn_from_f32(s->vTargetLead));
|
||||
capn_write32(p.p, 16, capn_from_f32(s->upAccelCmd));
|
||||
@@ -588,7 +592,7 @@ void cereal_write_Live100Data(const struct cereal_Live100Data *s, cereal_Live100
|
||||
capn_write32(p.p, 44, capn_from_f32(s->aTargetMax));
|
||||
capn_write32(p.p, 48, capn_from_f32(s->jerkFactor));
|
||||
capn_write32(p.p, 52, capn_from_f32(s->angleSteers));
|
||||
capn_write32(p.p, 56, (uint32_t) (s->hudLead));
|
||||
capn_write32(p.p, 56, (uint32_t) (s->hudLeadDEPRECATED));
|
||||
capn_write32(p.p, 60, capn_from_f32(s->cumLagMs));
|
||||
capn_write1(p.p, 704, s->enabled != 0);
|
||||
capn_write1(p.p, 705, s->steerOverride != 0);
|
||||
|
||||
@@ -193,13 +193,14 @@ struct cereal_ThermalData {
|
||||
uint16_t mem;
|
||||
uint16_t gpu;
|
||||
uint32_t bat;
|
||||
float freeSpace;
|
||||
};
|
||||
|
||||
static const size_t cereal_ThermalData_word_count = 2;
|
||||
static const size_t cereal_ThermalData_word_count = 3;
|
||||
|
||||
static const size_t cereal_ThermalData_pointer_count = 0;
|
||||
|
||||
static const size_t cereal_ThermalData_struct_bytes_count = 16;
|
||||
static const size_t cereal_ThermalData_struct_bytes_count = 24;
|
||||
|
||||
struct cereal_HealthData {
|
||||
uint32_t voltage;
|
||||
@@ -207,6 +208,7 @@ struct cereal_HealthData {
|
||||
unsigned started : 1;
|
||||
unsigned controlsAllowed : 1;
|
||||
unsigned gasInterceptorDetected : 1;
|
||||
unsigned startedSignalDetected : 1;
|
||||
};
|
||||
|
||||
static const size_t cereal_HealthData_word_count = 2;
|
||||
@@ -232,11 +234,11 @@ struct cereal_Live20Data {
|
||||
capn_list64 canMonoTimes;
|
||||
uint64_t mdMonoTime;
|
||||
uint64_t ftMonoTime;
|
||||
capn_list32 warpMatrix;
|
||||
float angleOffset;
|
||||
int8_t calStatus;
|
||||
int32_t calCycle;
|
||||
int8_t calPerc;
|
||||
capn_list32 warpMatrixDEPRECATED;
|
||||
float angleOffsetDEPRECATED;
|
||||
int8_t calStatusDEPRECATED;
|
||||
int32_t calCycleDEPRECATED;
|
||||
int8_t calPercDEPRECATED;
|
||||
cereal_Live20Data_LeadData_ptr leadOne;
|
||||
cereal_Live20Data_LeadData_ptr leadTwo;
|
||||
float cumLagMs;
|
||||
@@ -307,7 +309,7 @@ struct cereal_Live100Data {
|
||||
uint64_t l20MonoTime;
|
||||
uint64_t mdMonoTime;
|
||||
float vEgo;
|
||||
float aEgo;
|
||||
float aEgoDEPRECATED;
|
||||
float vPid;
|
||||
float vTargetLead;
|
||||
float upAccelCmd;
|
||||
@@ -320,7 +322,7 @@ struct cereal_Live100Data {
|
||||
float aTargetMax;
|
||||
float jerkFactor;
|
||||
float angleSteers;
|
||||
int32_t hudLead;
|
||||
int32_t hudLeadDEPRECATED;
|
||||
float cumLagMs;
|
||||
unsigned enabled : 1;
|
||||
unsigned steerOverride : 1;
|
||||
|
||||
@@ -641,73 +641,80 @@ const ::capnp::_::RawSchema s_8785009a964c7c59 = {
|
||||
0, 4, i_8785009a964c7c59, nullptr, nullptr, { &s_8785009a964c7c59, nullptr, nullptr, 0, 0, nullptr }
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<122> b_8d8231a40b7fe6e0 = {
|
||||
static const ::capnp::_::AlignedData<138> b_8d8231a40b7fe6e0 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
224, 230, 127, 11, 164, 49, 130, 141,
|
||||
10, 0, 0, 0, 1, 0, 2, 0,
|
||||
10, 0, 0, 0, 1, 0, 3, 0,
|
||||
91, 40, 164, 37, 126, 241, 177, 243,
|
||||
0, 0, 7, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 0, 0, 0, 178, 0, 0, 0,
|
||||
29, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
25, 0, 0, 0, 143, 1, 0, 0,
|
||||
25, 0, 0, 0, 199, 1, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
108, 111, 103, 46, 99, 97, 112, 110,
|
||||
112, 58, 84, 104, 101, 114, 109, 97,
|
||||
108, 68, 97, 116, 97, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
28, 0, 0, 0, 3, 0, 4, 0,
|
||||
32, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
181, 0, 0, 0, 42, 0, 0, 0,
|
||||
209, 0, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
176, 0, 0, 0, 3, 0, 1, 0,
|
||||
188, 0, 0, 0, 2, 0, 1, 0,
|
||||
204, 0, 0, 0, 3, 0, 1, 0,
|
||||
216, 0, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
185, 0, 0, 0, 42, 0, 0, 0,
|
||||
213, 0, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
180, 0, 0, 0, 3, 0, 1, 0,
|
||||
192, 0, 0, 0, 2, 0, 1, 0,
|
||||
208, 0, 0, 0, 3, 0, 1, 0,
|
||||
220, 0, 0, 0, 2, 0, 1, 0,
|
||||
2, 0, 0, 0, 2, 0, 0, 0,
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
189, 0, 0, 0, 42, 0, 0, 0,
|
||||
217, 0, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
184, 0, 0, 0, 3, 0, 1, 0,
|
||||
196, 0, 0, 0, 2, 0, 1, 0,
|
||||
212, 0, 0, 0, 3, 0, 1, 0,
|
||||
224, 0, 0, 0, 2, 0, 1, 0,
|
||||
3, 0, 0, 0, 3, 0, 0, 0,
|
||||
0, 0, 1, 0, 3, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
193, 0, 0, 0, 42, 0, 0, 0,
|
||||
221, 0, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
188, 0, 0, 0, 3, 0, 1, 0,
|
||||
200, 0, 0, 0, 2, 0, 1, 0,
|
||||
216, 0, 0, 0, 3, 0, 1, 0,
|
||||
228, 0, 0, 0, 2, 0, 1, 0,
|
||||
4, 0, 0, 0, 4, 0, 0, 0,
|
||||
0, 0, 1, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
197, 0, 0, 0, 34, 0, 0, 0,
|
||||
225, 0, 0, 0, 34, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
192, 0, 0, 0, 3, 0, 1, 0,
|
||||
204, 0, 0, 0, 2, 0, 1, 0,
|
||||
220, 0, 0, 0, 3, 0, 1, 0,
|
||||
232, 0, 0, 0, 2, 0, 1, 0,
|
||||
5, 0, 0, 0, 5, 0, 0, 0,
|
||||
0, 0, 1, 0, 5, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
201, 0, 0, 0, 34, 0, 0, 0,
|
||||
229, 0, 0, 0, 34, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
196, 0, 0, 0, 3, 0, 1, 0,
|
||||
208, 0, 0, 0, 2, 0, 1, 0,
|
||||
224, 0, 0, 0, 3, 0, 1, 0,
|
||||
236, 0, 0, 0, 2, 0, 1, 0,
|
||||
6, 0, 0, 0, 3, 0, 0, 0,
|
||||
0, 0, 1, 0, 6, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
205, 0, 0, 0, 34, 0, 0, 0,
|
||||
233, 0, 0, 0, 34, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
200, 0, 0, 0, 3, 0, 1, 0,
|
||||
212, 0, 0, 0, 2, 0, 1, 0,
|
||||
228, 0, 0, 0, 3, 0, 1, 0,
|
||||
240, 0, 0, 0, 2, 0, 1, 0,
|
||||
7, 0, 0, 0, 4, 0, 0, 0,
|
||||
0, 0, 1, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
237, 0, 0, 0, 82, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
236, 0, 0, 0, 3, 0, 1, 0,
|
||||
248, 0, 0, 0, 2, 0, 1, 0,
|
||||
99, 112, 117, 48, 0, 0, 0, 0,
|
||||
7, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@@ -762,19 +769,28 @@ static const ::capnp::_::AlignedData<122> b_8d8231a40b7fe6e0 = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
8, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
102, 114, 101, 101, 83, 112, 97, 99,
|
||||
101, 0, 0, 0, 0, 0, 0, 0,
|
||||
10, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
10, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
::capnp::word const* const bp_8d8231a40b7fe6e0 = b_8d8231a40b7fe6e0.words;
|
||||
#if !CAPNP_LITE
|
||||
static const uint16_t m_8d8231a40b7fe6e0[] = {6, 0, 1, 2, 3, 5, 4};
|
||||
static const uint16_t i_8d8231a40b7fe6e0[] = {0, 1, 2, 3, 4, 5, 6};
|
||||
static const uint16_t m_8d8231a40b7fe6e0[] = {6, 0, 1, 2, 3, 7, 5, 4};
|
||||
static const uint16_t i_8d8231a40b7fe6e0[] = {0, 1, 2, 3, 4, 5, 6, 7};
|
||||
const ::capnp::_::RawSchema s_8d8231a40b7fe6e0 = {
|
||||
0x8d8231a40b7fe6e0, b_8d8231a40b7fe6e0.words, 122, nullptr, m_8d8231a40b7fe6e0,
|
||||
0, 7, i_8d8231a40b7fe6e0, nullptr, nullptr, { &s_8d8231a40b7fe6e0, nullptr, nullptr, 0, 0, nullptr }
|
||||
0x8d8231a40b7fe6e0, b_8d8231a40b7fe6e0.words, 138, nullptr, m_8d8231a40b7fe6e0,
|
||||
0, 8, i_8d8231a40b7fe6e0, nullptr, nullptr, { &s_8d8231a40b7fe6e0, nullptr, nullptr, 0, 0, nullptr }
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<95> b_cfa2b0c2c82af1e4 = {
|
||||
static const ::capnp::_::AlignedData<112> b_cfa2b0c2c82af1e4 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
228, 241, 42, 200, 194, 176, 162, 207,
|
||||
10, 0, 0, 0, 1, 0, 2, 0,
|
||||
@@ -784,49 +800,56 @@ static const ::capnp::_::AlignedData<95> b_cfa2b0c2c82af1e4 = {
|
||||
21, 0, 0, 0, 170, 0, 0, 0,
|
||||
29, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
25, 0, 0, 0, 31, 1, 0, 0,
|
||||
25, 0, 0, 0, 87, 1, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
108, 111, 103, 46, 99, 97, 112, 110,
|
||||
112, 58, 72, 101, 97, 108, 116, 104,
|
||||
68, 97, 116, 97, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0, 1, 0,
|
||||
20, 0, 0, 0, 3, 0, 4, 0,
|
||||
24, 0, 0, 0, 3, 0, 4, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
125, 0, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
120, 0, 0, 0, 3, 0, 1, 0,
|
||||
132, 0, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
129, 0, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
124, 0, 0, 0, 3, 0, 1, 0,
|
||||
136, 0, 0, 0, 2, 0, 1, 0,
|
||||
2, 0, 0, 0, 64, 0, 0, 0,
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
133, 0, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
128, 0, 0, 0, 3, 0, 1, 0,
|
||||
140, 0, 0, 0, 2, 0, 1, 0,
|
||||
3, 0, 0, 0, 65, 0, 0, 0,
|
||||
0, 0, 1, 0, 3, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
137, 0, 0, 0, 130, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
136, 0, 0, 0, 3, 0, 1, 0,
|
||||
148, 0, 0, 0, 2, 0, 1, 0,
|
||||
4, 0, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 1, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
145, 0, 0, 0, 186, 0, 0, 0,
|
||||
153, 0, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
148, 0, 0, 0, 3, 0, 1, 0,
|
||||
160, 0, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
157, 0, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
152, 0, 0, 0, 3, 0, 1, 0,
|
||||
164, 0, 0, 0, 2, 0, 1, 0,
|
||||
2, 0, 0, 0, 64, 0, 0, 0,
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
161, 0, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
156, 0, 0, 0, 3, 0, 1, 0,
|
||||
168, 0, 0, 0, 2, 0, 1, 0,
|
||||
3, 0, 0, 0, 65, 0, 0, 0,
|
||||
0, 0, 1, 0, 3, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
165, 0, 0, 0, 130, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
164, 0, 0, 0, 3, 0, 1, 0,
|
||||
176, 0, 0, 0, 2, 0, 1, 0,
|
||||
4, 0, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 1, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
173, 0, 0, 0, 186, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
176, 0, 0, 0, 3, 0, 1, 0,
|
||||
188, 0, 0, 0, 2, 0, 1, 0,
|
||||
5, 0, 0, 0, 67, 0, 0, 0,
|
||||
0, 0, 1, 0, 5, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
185, 0, 0, 0, 178, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
188, 0, 0, 0, 3, 0, 1, 0,
|
||||
200, 0, 0, 0, 2, 0, 1, 0,
|
||||
118, 111, 108, 116, 97, 103, 101, 0,
|
||||
8, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@@ -863,6 +886,16 @@ static const ::capnp::_::AlignedData<95> b_cfa2b0c2c82af1e4 = {
|
||||
103, 97, 115, 73, 110, 116, 101, 114,
|
||||
99, 101, 112, 116, 111, 114, 68, 101,
|
||||
116, 101, 99, 116, 101, 100, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
115, 116, 97, 114, 116, 101, 100, 83,
|
||||
105, 103, 110, 97, 108, 68, 101, 116,
|
||||
101, 99, 116, 101, 100, 0, 0, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@@ -873,11 +906,11 @@ static const ::capnp::_::AlignedData<95> b_cfa2b0c2c82af1e4 = {
|
||||
};
|
||||
::capnp::word const* const bp_cfa2b0c2c82af1e4 = b_cfa2b0c2c82af1e4.words;
|
||||
#if !CAPNP_LITE
|
||||
static const uint16_t m_cfa2b0c2c82af1e4[] = {3, 1, 4, 2, 0};
|
||||
static const uint16_t i_cfa2b0c2c82af1e4[] = {0, 1, 2, 3, 4};
|
||||
static const uint16_t m_cfa2b0c2c82af1e4[] = {3, 1, 4, 2, 5, 0};
|
||||
static const uint16_t i_cfa2b0c2c82af1e4[] = {0, 1, 2, 3, 4, 5};
|
||||
const ::capnp::_::RawSchema s_cfa2b0c2c82af1e4 = {
|
||||
0xcfa2b0c2c82af1e4, b_cfa2b0c2c82af1e4.words, 95, nullptr, m_cfa2b0c2c82af1e4,
|
||||
0, 5, i_cfa2b0c2c82af1e4, nullptr, nullptr, { &s_cfa2b0c2c82af1e4, nullptr, nullptr, 0, 0, nullptr }
|
||||
0xcfa2b0c2c82af1e4, b_cfa2b0c2c82af1e4.words, 112, nullptr, m_cfa2b0c2c82af1e4,
|
||||
0, 6, i_cfa2b0c2c82af1e4, nullptr, nullptr, { &s_cfa2b0c2c82af1e4, nullptr, nullptr, 0, 0, nullptr }
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<81> b_c08240f996aefced = {
|
||||
@@ -972,7 +1005,7 @@ const ::capnp::_::RawSchema s_c08240f996aefced = {
|
||||
0, 4, i_c08240f996aefced, nullptr, nullptr, { &s_c08240f996aefced, nullptr, nullptr, 0, 0, nullptr }
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<202> b_9a185389d6fdd05f = {
|
||||
static const ::capnp::_::AlignedData<208> b_9a185389d6fdd05f = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
95, 208, 253, 214, 137, 83, 24, 154,
|
||||
10, 0, 0, 0, 1, 0, 4, 0,
|
||||
@@ -997,82 +1030,83 @@ static const ::capnp::_::AlignedData<202> b_9a185389d6fdd05f = {
|
||||
3, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
37, 1, 0, 0, 90, 0, 0, 0,
|
||||
37, 1, 0, 0, 170, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
36, 1, 0, 0, 3, 0, 1, 0,
|
||||
64, 1, 0, 0, 2, 0, 1, 0,
|
||||
40, 1, 0, 0, 3, 0, 1, 0,
|
||||
68, 1, 0, 0, 2, 0, 1, 0,
|
||||
4, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
61, 1, 0, 0, 98, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
60, 1, 0, 0, 3, 0, 1, 0,
|
||||
72, 1, 0, 0, 2, 0, 1, 0,
|
||||
5, 0, 0, 0, 4, 0, 0, 0,
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
69, 1, 0, 0, 82, 0, 0, 0,
|
||||
65, 1, 0, 0, 178, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
68, 1, 0, 0, 3, 0, 1, 0,
|
||||
80, 1, 0, 0, 2, 0, 1, 0,
|
||||
5, 0, 0, 0, 4, 0, 0, 0,
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
77, 1, 0, 0, 162, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
80, 1, 0, 0, 3, 0, 1, 0,
|
||||
92, 1, 0, 0, 2, 0, 1, 0,
|
||||
8, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 3, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
77, 1, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
72, 1, 0, 0, 3, 0, 1, 0,
|
||||
84, 1, 0, 0, 2, 0, 1, 0,
|
||||
9, 0, 0, 0, 2, 0, 0, 0,
|
||||
0, 0, 1, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
81, 1, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
76, 1, 0, 0, 3, 0, 1, 0,
|
||||
88, 1, 0, 0, 2, 0, 1, 0,
|
||||
10, 0, 0, 0, 2, 0, 0, 0,
|
||||
0, 0, 1, 0, 5, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
85, 1, 0, 0, 74, 0, 0, 0,
|
||||
89, 1, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
84, 1, 0, 0, 3, 0, 1, 0,
|
||||
96, 1, 0, 0, 2, 0, 1, 0,
|
||||
9, 0, 0, 0, 2, 0, 0, 0,
|
||||
0, 0, 1, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
93, 1, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
88, 1, 0, 0, 3, 0, 1, 0,
|
||||
100, 1, 0, 0, 2, 0, 1, 0,
|
||||
10, 0, 0, 0, 2, 0, 0, 0,
|
||||
0, 0, 1, 0, 5, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
97, 1, 0, 0, 74, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
96, 1, 0, 0, 3, 0, 1, 0,
|
||||
108, 1, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 0, 0, 2, 0, 0, 0,
|
||||
0, 0, 1, 0, 6, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
93, 1, 0, 0, 90, 0, 0, 0,
|
||||
105, 1, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
92, 1, 0, 0, 3, 0, 1, 0,
|
||||
104, 1, 0, 0, 2, 0, 1, 0,
|
||||
104, 1, 0, 0, 3, 0, 1, 0,
|
||||
116, 1, 0, 0, 2, 0, 1, 0,
|
||||
2, 0, 0, 0, 3, 0, 0, 0,
|
||||
0, 0, 1, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
101, 1, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 1, 0, 0, 3, 0, 1, 0,
|
||||
112, 1, 0, 0, 2, 0, 1, 0,
|
||||
6, 0, 0, 0, 3, 0, 0, 0,
|
||||
0, 0, 1, 0, 8, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
109, 1, 0, 0, 74, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
108, 1, 0, 0, 3, 0, 1, 0,
|
||||
120, 1, 0, 0, 2, 0, 1, 0,
|
||||
7, 0, 0, 0, 5, 0, 0, 0,
|
||||
0, 0, 1, 0, 9, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
117, 1, 0, 0, 66, 0, 0, 0,
|
||||
113, 1, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
112, 1, 0, 0, 3, 0, 1, 0,
|
||||
124, 1, 0, 0, 2, 0, 1, 0,
|
||||
6, 0, 0, 0, 3, 0, 0, 0,
|
||||
0, 0, 1, 0, 8, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
121, 1, 0, 0, 154, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
124, 1, 0, 0, 3, 0, 1, 0,
|
||||
136, 1, 0, 0, 2, 0, 1, 0,
|
||||
7, 0, 0, 0, 5, 0, 0, 0,
|
||||
0, 0, 1, 0, 9, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
133, 1, 0, 0, 146, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
136, 1, 0, 0, 3, 0, 1, 0,
|
||||
148, 1, 0, 0, 2, 0, 1, 0,
|
||||
0, 0, 0, 0, 3, 0, 0, 0,
|
||||
0, 0, 1, 0, 10, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
121, 1, 0, 0, 106, 0, 0, 0,
|
||||
145, 1, 0, 0, 106, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
120, 1, 0, 0, 3, 0, 1, 0,
|
||||
148, 1, 0, 0, 2, 0, 1, 0,
|
||||
144, 1, 0, 0, 3, 0, 1, 0,
|
||||
172, 1, 0, 0, 2, 0, 1, 0,
|
||||
119, 97, 114, 112, 77, 97, 116, 114,
|
||||
105, 120, 0, 0, 0, 0, 0, 0,
|
||||
105, 120, 68, 69, 80, 82, 69, 67,
|
||||
65, 84, 69, 68, 0, 0, 0, 0,
|
||||
14, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@@ -1085,7 +1119,8 @@ static const ::capnp::_::AlignedData<202> b_9a185389d6fdd05f = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
97, 110, 103, 108, 101, 79, 102, 102,
|
||||
115, 101, 116, 0, 0, 0, 0, 0,
|
||||
115, 101, 116, 68, 69, 80, 82, 69,
|
||||
67, 65, 84, 69, 68, 0, 0, 0,
|
||||
10, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@@ -1094,7 +1129,8 @@ static const ::capnp::_::AlignedData<202> b_9a185389d6fdd05f = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
99, 97, 108, 83, 116, 97, 116, 117,
|
||||
115, 0, 0, 0, 0, 0, 0, 0,
|
||||
115, 68, 69, 80, 82, 69, 67, 65,
|
||||
84, 69, 68, 0, 0, 0, 0, 0,
|
||||
2, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@@ -1146,7 +1182,8 @@ static const ::capnp::_::AlignedData<202> b_9a185389d6fdd05f = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
99, 97, 108, 67, 121, 99, 108, 101,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
68, 69, 80, 82, 69, 67, 65, 84,
|
||||
69, 68, 0, 0, 0, 0, 0, 0,
|
||||
4, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@@ -1154,7 +1191,9 @@ static const ::capnp::_::AlignedData<202> b_9a185389d6fdd05f = {
|
||||
4, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
99, 97, 108, 80, 101, 114, 99, 0,
|
||||
99, 97, 108, 80, 101, 114, 99, 68,
|
||||
69, 80, 82, 69, 67, 65, 84, 69,
|
||||
68, 0, 0, 0, 0, 0, 0, 0,
|
||||
2, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@@ -1184,7 +1223,7 @@ static const ::capnp::_::RawSchema* const d_9a185389d6fdd05f[] = {
|
||||
static const uint16_t m_9a185389d6fdd05f[] = {1, 8, 9, 2, 10, 5, 7, 3, 4, 6, 0};
|
||||
static const uint16_t i_9a185389d6fdd05f[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
|
||||
const ::capnp::_::RawSchema s_9a185389d6fdd05f = {
|
||||
0x9a185389d6fdd05f, b_9a185389d6fdd05f.words, 202, d_9a185389d6fdd05f, m_9a185389d6fdd05f,
|
||||
0x9a185389d6fdd05f, b_9a185389d6fdd05f.words, 208, d_9a185389d6fdd05f, m_9a185389d6fdd05f,
|
||||
1, 11, i_9a185389d6fdd05f, nullptr, nullptr, { &s_9a185389d6fdd05f, nullptr, nullptr, 0, 0, nullptr }
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
@@ -1675,7 +1714,7 @@ const ::capnp::_::RawSchema s_8faa644732dec251 = {
|
||||
0, 10, i_8faa644732dec251, nullptr, nullptr, { &s_8faa644732dec251, nullptr, nullptr, 0, 0, nullptr }
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
static const ::capnp::_::AlignedData<443> b_97ff69c53601abf1 = {
|
||||
static const ::capnp::_::AlignedData<446> b_97ff69c53601abf1 = {
|
||||
{ 0, 0, 0, 0, 5, 0, 6, 0,
|
||||
241, 171, 1, 54, 197, 105, 255, 151,
|
||||
10, 0, 0, 0, 1, 0, 13, 0,
|
||||
@@ -1703,185 +1742,185 @@ static const ::capnp::_::AlignedData<443> b_97ff69c53601abf1 = {
|
||||
5, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
233, 2, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
228, 2, 0, 0, 3, 0, 1, 0,
|
||||
240, 2, 0, 0, 2, 0, 1, 0,
|
||||
6, 0, 0, 0, 2, 0, 0, 0,
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
237, 2, 0, 0, 42, 0, 0, 0,
|
||||
233, 2, 0, 0, 122, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
232, 2, 0, 0, 3, 0, 1, 0,
|
||||
244, 2, 0, 0, 2, 0, 1, 0,
|
||||
6, 0, 0, 0, 2, 0, 0, 0,
|
||||
0, 0, 1, 0, 2, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
241, 2, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
236, 2, 0, 0, 3, 0, 1, 0,
|
||||
248, 2, 0, 0, 2, 0, 1, 0,
|
||||
7, 0, 0, 0, 3, 0, 0, 0,
|
||||
0, 0, 1, 0, 3, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
241, 2, 0, 0, 98, 0, 0, 0,
|
||||
245, 2, 0, 0, 98, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
240, 2, 0, 0, 3, 0, 1, 0,
|
||||
252, 2, 0, 0, 2, 0, 1, 0,
|
||||
244, 2, 0, 0, 3, 0, 1, 0,
|
||||
0, 3, 0, 0, 2, 0, 1, 0,
|
||||
8, 0, 0, 0, 4, 0, 0, 0,
|
||||
0, 0, 1, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
249, 2, 0, 0, 90, 0, 0, 0,
|
||||
253, 2, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
248, 2, 0, 0, 3, 0, 1, 0,
|
||||
4, 3, 0, 0, 2, 0, 1, 0,
|
||||
252, 2, 0, 0, 3, 0, 1, 0,
|
||||
8, 3, 0, 0, 2, 0, 1, 0,
|
||||
9, 0, 0, 0, 5, 0, 0, 0,
|
||||
0, 0, 1, 0, 5, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
1, 3, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 3, 0, 0, 3, 0, 1, 0,
|
||||
12, 3, 0, 0, 2, 0, 1, 0,
|
||||
10, 0, 0, 0, 6, 0, 0, 0,
|
||||
0, 0, 1, 0, 6, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
9, 3, 0, 0, 66, 0, 0, 0,
|
||||
5, 3, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
4, 3, 0, 0, 3, 0, 1, 0,
|
||||
16, 3, 0, 0, 2, 0, 1, 0,
|
||||
11, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 1, 0, 7, 0, 0, 0,
|
||||
10, 0, 0, 0, 6, 0, 0, 0,
|
||||
0, 0, 1, 0, 6, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
13, 3, 0, 0, 42, 0, 0, 0,
|
||||
13, 3, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
8, 3, 0, 0, 3, 0, 1, 0,
|
||||
20, 3, 0, 0, 2, 0, 1, 0,
|
||||
12, 0, 0, 0, 8, 0, 0, 0,
|
||||
0, 0, 1, 0, 8, 0, 0, 0,
|
||||
11, 0, 0, 0, 7, 0, 0, 0,
|
||||
0, 0, 1, 0, 7, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
17, 3, 0, 0, 66, 0, 0, 0,
|
||||
17, 3, 0, 0, 42, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
12, 3, 0, 0, 3, 0, 1, 0,
|
||||
24, 3, 0, 0, 2, 0, 1, 0,
|
||||
13, 0, 0, 0, 9, 0, 0, 0,
|
||||
0, 0, 1, 0, 9, 0, 0, 0,
|
||||
12, 0, 0, 0, 8, 0, 0, 0,
|
||||
0, 0, 1, 0, 8, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
21, 3, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
16, 3, 0, 0, 3, 0, 1, 0,
|
||||
28, 3, 0, 0, 2, 0, 1, 0,
|
||||
13, 0, 0, 0, 9, 0, 0, 0,
|
||||
0, 0, 1, 0, 9, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
25, 3, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
20, 3, 0, 0, 3, 0, 1, 0,
|
||||
32, 3, 0, 0, 2, 0, 1, 0,
|
||||
14, 0, 0, 0, 10, 0, 0, 0,
|
||||
0, 0, 1, 0, 10, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
25, 3, 0, 0, 90, 0, 0, 0,
|
||||
29, 3, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
24, 3, 0, 0, 3, 0, 1, 0,
|
||||
36, 3, 0, 0, 2, 0, 1, 0,
|
||||
28, 3, 0, 0, 3, 0, 1, 0,
|
||||
40, 3, 0, 0, 2, 0, 1, 0,
|
||||
15, 0, 0, 0, 11, 0, 0, 0,
|
||||
0, 0, 1, 0, 11, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
33, 3, 0, 0, 90, 0, 0, 0,
|
||||
37, 3, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
32, 3, 0, 0, 3, 0, 1, 0,
|
||||
44, 3, 0, 0, 2, 0, 1, 0,
|
||||
36, 3, 0, 0, 3, 0, 1, 0,
|
||||
48, 3, 0, 0, 2, 0, 1, 0,
|
||||
16, 0, 0, 0, 12, 0, 0, 0,
|
||||
0, 0, 1, 0, 12, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
41, 3, 0, 0, 90, 0, 0, 0,
|
||||
45, 3, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
40, 3, 0, 0, 3, 0, 1, 0,
|
||||
52, 3, 0, 0, 2, 0, 1, 0,
|
||||
44, 3, 0, 0, 3, 0, 1, 0,
|
||||
56, 3, 0, 0, 2, 0, 1, 0,
|
||||
17, 0, 0, 0, 13, 0, 0, 0,
|
||||
0, 0, 1, 0, 13, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
49, 3, 0, 0, 98, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
48, 3, 0, 0, 3, 0, 1, 0,
|
||||
60, 3, 0, 0, 2, 0, 1, 0,
|
||||
18, 0, 0, 0, 14, 0, 0, 0,
|
||||
0, 0, 1, 0, 14, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
57, 3, 0, 0, 66, 0, 0, 0,
|
||||
53, 3, 0, 0, 98, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
52, 3, 0, 0, 3, 0, 1, 0,
|
||||
64, 3, 0, 0, 2, 0, 1, 0,
|
||||
18, 0, 0, 0, 14, 0, 0, 0,
|
||||
0, 0, 1, 0, 14, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
61, 3, 0, 0, 146, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
64, 3, 0, 0, 3, 0, 1, 0,
|
||||
76, 3, 0, 0, 2, 0, 1, 0,
|
||||
19, 0, 0, 0, 15, 0, 0, 0,
|
||||
0, 0, 1, 0, 15, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
61, 3, 0, 0, 74, 0, 0, 0,
|
||||
73, 3, 0, 0, 74, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
60, 3, 0, 0, 3, 0, 1, 0,
|
||||
72, 3, 0, 0, 2, 0, 1, 0,
|
||||
72, 3, 0, 0, 3, 0, 1, 0,
|
||||
84, 3, 0, 0, 2, 0, 1, 0,
|
||||
0, 0, 0, 0, 8, 0, 0, 0,
|
||||
0, 0, 1, 0, 16, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
69, 3, 0, 0, 98, 0, 0, 0,
|
||||
81, 3, 0, 0, 98, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
68, 3, 0, 0, 3, 0, 1, 0,
|
||||
80, 3, 0, 0, 2, 0, 1, 0,
|
||||
80, 3, 0, 0, 3, 0, 1, 0,
|
||||
92, 3, 0, 0, 2, 0, 1, 0,
|
||||
2, 0, 0, 0, 9, 0, 0, 0,
|
||||
0, 0, 1, 0, 17, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
77, 3, 0, 0, 98, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
76, 3, 0, 0, 3, 0, 1, 0,
|
||||
88, 3, 0, 0, 2, 0, 1, 0,
|
||||
3, 0, 0, 0, 10, 0, 0, 0,
|
||||
0, 0, 1, 0, 18, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
85, 3, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
84, 3, 0, 0, 3, 0, 1, 0,
|
||||
96, 3, 0, 0, 2, 0, 1, 0,
|
||||
20, 0, 0, 0, 192, 2, 0, 0,
|
||||
0, 0, 1, 0, 19, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
93, 3, 0, 0, 66, 0, 0, 0,
|
||||
89, 3, 0, 0, 98, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
88, 3, 0, 0, 3, 0, 1, 0,
|
||||
100, 3, 0, 0, 2, 0, 1, 0,
|
||||
21, 0, 0, 0, 193, 2, 0, 0,
|
||||
0, 0, 1, 0, 20, 0, 0, 0,
|
||||
3, 0, 0, 0, 10, 0, 0, 0,
|
||||
0, 0, 1, 0, 18, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
97, 3, 0, 0, 114, 0, 0, 0,
|
||||
97, 3, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
96, 3, 0, 0, 3, 0, 1, 0,
|
||||
108, 3, 0, 0, 2, 0, 1, 0,
|
||||
20, 0, 0, 0, 192, 2, 0, 0,
|
||||
0, 0, 1, 0, 19, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 3, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
100, 3, 0, 0, 3, 0, 1, 0,
|
||||
112, 3, 0, 0, 2, 0, 1, 0,
|
||||
21, 0, 0, 0, 193, 2, 0, 0,
|
||||
0, 0, 1, 0, 20, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
109, 3, 0, 0, 114, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
108, 3, 0, 0, 3, 0, 1, 0,
|
||||
120, 3, 0, 0, 2, 0, 1, 0,
|
||||
1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 21, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
105, 3, 0, 0, 106, 0, 0, 0,
|
||||
117, 3, 0, 0, 106, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 3, 0, 0, 3, 0, 1, 0,
|
||||
132, 3, 0, 0, 2, 0, 1, 0,
|
||||
116, 3, 0, 0, 3, 0, 1, 0,
|
||||
144, 3, 0, 0, 2, 0, 1, 0,
|
||||
22, 0, 0, 0, 23, 0, 0, 0,
|
||||
0, 0, 1, 0, 22, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
129, 3, 0, 0, 66, 0, 0, 0,
|
||||
141, 3, 0, 0, 66, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
124, 3, 0, 0, 3, 0, 1, 0,
|
||||
136, 3, 0, 0, 2, 0, 1, 0,
|
||||
136, 3, 0, 0, 3, 0, 1, 0,
|
||||
148, 3, 0, 0, 2, 0, 1, 0,
|
||||
23, 0, 0, 0, 194, 2, 0, 0,
|
||||
0, 0, 1, 0, 23, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
133, 3, 0, 0, 98, 0, 0, 0,
|
||||
145, 3, 0, 0, 98, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
132, 3, 0, 0, 3, 0, 1, 0,
|
||||
144, 3, 0, 0, 2, 0, 1, 0,
|
||||
144, 3, 0, 0, 3, 0, 1, 0,
|
||||
156, 3, 0, 0, 2, 0, 1, 0,
|
||||
24, 0, 0, 0, 1, 0, 0, 0,
|
||||
0, 0, 1, 0, 24, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
141, 3, 0, 0, 90, 0, 0, 0,
|
||||
153, 3, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
140, 3, 0, 0, 3, 0, 1, 0,
|
||||
152, 3, 0, 0, 2, 0, 1, 0,
|
||||
152, 3, 0, 0, 3, 0, 1, 0,
|
||||
164, 3, 0, 0, 2, 0, 1, 0,
|
||||
25, 0, 0, 0, 2, 0, 0, 0,
|
||||
0, 0, 1, 0, 25, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
149, 3, 0, 0, 90, 0, 0, 0,
|
||||
161, 3, 0, 0, 90, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
148, 3, 0, 0, 3, 0, 1, 0,
|
||||
160, 3, 0, 0, 2, 0, 1, 0,
|
||||
160, 3, 0, 0, 3, 0, 1, 0,
|
||||
172, 3, 0, 0, 2, 0, 1, 0,
|
||||
26, 0, 0, 0, 24, 0, 0, 0,
|
||||
0, 0, 1, 0, 26, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
157, 3, 0, 0, 130, 0, 0, 0,
|
||||
169, 3, 0, 0, 130, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
156, 3, 0, 0, 3, 0, 1, 0,
|
||||
168, 3, 0, 0, 2, 0, 1, 0,
|
||||
168, 3, 0, 0, 3, 0, 1, 0,
|
||||
180, 3, 0, 0, 2, 0, 1, 0,
|
||||
118, 69, 103, 111, 0, 0, 0, 0,
|
||||
10, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@@ -1890,7 +1929,8 @@ static const ::capnp::_::AlignedData<443> b_97ff69c53601abf1 = {
|
||||
10, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
97, 69, 103, 111, 0, 0, 0, 0,
|
||||
97, 69, 103, 111, 68, 69, 80, 82,
|
||||
69, 67, 65, 84, 69, 68, 0, 0,
|
||||
10, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@@ -2001,7 +2041,9 @@ static const ::capnp::_::AlignedData<443> b_97ff69c53601abf1 = {
|
||||
10, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
104, 117, 100, 76, 101, 97, 100, 0,
|
||||
104, 117, 100, 76, 101, 97, 100, 68,
|
||||
69, 80, 82, 69, 67, 65, 84, 69,
|
||||
68, 0, 0, 0, 0, 0, 0, 0,
|
||||
4, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0,
|
||||
@@ -2125,7 +2167,7 @@ static const ::capnp::_::AlignedData<443> b_97ff69c53601abf1 = {
|
||||
static const uint16_t m_97ff69c53601abf1[] = {1, 11, 10, 24, 25, 13, 26, 16, 21, 15, 19, 14, 12, 17, 18, 23, 20, 5, 9, 4, 8, 22, 0, 2, 3, 6, 7};
|
||||
static const uint16_t i_97ff69c53601abf1[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26};
|
||||
const ::capnp::_::RawSchema s_97ff69c53601abf1 = {
|
||||
0x97ff69c53601abf1, b_97ff69c53601abf1.words, 443, nullptr, m_97ff69c53601abf1,
|
||||
0x97ff69c53601abf1, b_97ff69c53601abf1.words, 446, nullptr, m_97ff69c53601abf1,
|
||||
0, 27, i_97ff69c53601abf1, nullptr, nullptr, { &s_97ff69c53601abf1, nullptr, nullptr, 0, 0, nullptr }
|
||||
};
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
@@ -158,7 +158,7 @@ struct ThermalData {
|
||||
class Pipeline;
|
||||
|
||||
struct _capnpPrivate {
|
||||
CAPNP_DECLARE_STRUCT_HEADER(8d8231a40b7fe6e0, 2, 0)
|
||||
CAPNP_DECLARE_STRUCT_HEADER(8d8231a40b7fe6e0, 3, 0)
|
||||
#if !CAPNP_LITE
|
||||
static constexpr ::capnp::_::RawBrandedSchema const* brand = &schema->defaultBrand;
|
||||
#endif // !CAPNP_LITE
|
||||
@@ -1109,6 +1109,8 @@ public:
|
||||
|
||||
inline ::uint32_t getBat() const;
|
||||
|
||||
inline float getFreeSpace() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
@@ -1158,6 +1160,9 @@ public:
|
||||
inline ::uint32_t getBat();
|
||||
inline void setBat( ::uint32_t value);
|
||||
|
||||
inline float getFreeSpace();
|
||||
inline void setFreeSpace(float value);
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
@@ -1211,6 +1216,8 @@ public:
|
||||
|
||||
inline bool getGasInterceptorDetected() const;
|
||||
|
||||
inline bool getStartedSignalDetected() const;
|
||||
|
||||
private:
|
||||
::capnp::_::StructReader _reader;
|
||||
template <typename, ::capnp::Kind>
|
||||
@@ -1254,6 +1261,9 @@ public:
|
||||
inline bool getGasInterceptorDetected();
|
||||
inline void setGasInterceptorDetected(bool value);
|
||||
|
||||
inline bool getStartedSignalDetected();
|
||||
inline void setStartedSignalDetected(bool value);
|
||||
|
||||
private:
|
||||
::capnp::_::StructBuilder _builder;
|
||||
template <typename, ::capnp::Kind>
|
||||
@@ -1398,12 +1408,12 @@ public:
|
||||
}
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasWarpMatrix() const;
|
||||
inline ::capnp::List<float>::Reader getWarpMatrix() const;
|
||||
inline bool hasWarpMatrixDEPRECATED() const;
|
||||
inline ::capnp::List<float>::Reader getWarpMatrixDEPRECATED() const;
|
||||
|
||||
inline float getAngleOffset() const;
|
||||
inline float getAngleOffsetDEPRECATED() const;
|
||||
|
||||
inline ::int8_t getCalStatus() const;
|
||||
inline ::int8_t getCalStatusDEPRECATED() const;
|
||||
|
||||
inline bool hasLeadOne() const;
|
||||
inline ::cereal::Live20Data::LeadData::Reader getLeadOne() const;
|
||||
@@ -1417,9 +1427,9 @@ public:
|
||||
|
||||
inline ::uint64_t getFtMonoTime() const;
|
||||
|
||||
inline ::int32_t getCalCycle() const;
|
||||
inline ::int32_t getCalCycleDEPRECATED() const;
|
||||
|
||||
inline ::int8_t getCalPerc() const;
|
||||
inline ::int8_t getCalPercDEPRECATED() const;
|
||||
|
||||
inline bool hasCanMonoTimes() const;
|
||||
inline ::capnp::List< ::uint64_t>::Reader getCanMonoTimes() const;
|
||||
@@ -1452,19 +1462,19 @@ public:
|
||||
inline ::kj::StringTree toString() const { return asReader().toString(); }
|
||||
#endif // !CAPNP_LITE
|
||||
|
||||
inline bool hasWarpMatrix();
|
||||
inline ::capnp::List<float>::Builder getWarpMatrix();
|
||||
inline void setWarpMatrix( ::capnp::List<float>::Reader value);
|
||||
inline void setWarpMatrix(::kj::ArrayPtr<const float> value);
|
||||
inline ::capnp::List<float>::Builder initWarpMatrix(unsigned int size);
|
||||
inline void adoptWarpMatrix(::capnp::Orphan< ::capnp::List<float>>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::List<float>> disownWarpMatrix();
|
||||
inline bool hasWarpMatrixDEPRECATED();
|
||||
inline ::capnp::List<float>::Builder getWarpMatrixDEPRECATED();
|
||||
inline void setWarpMatrixDEPRECATED( ::capnp::List<float>::Reader value);
|
||||
inline void setWarpMatrixDEPRECATED(::kj::ArrayPtr<const float> value);
|
||||
inline ::capnp::List<float>::Builder initWarpMatrixDEPRECATED(unsigned int size);
|
||||
inline void adoptWarpMatrixDEPRECATED(::capnp::Orphan< ::capnp::List<float>>&& value);
|
||||
inline ::capnp::Orphan< ::capnp::List<float>> disownWarpMatrixDEPRECATED();
|
||||
|
||||
inline float getAngleOffset();
|
||||
inline void setAngleOffset(float value);
|
||||
inline float getAngleOffsetDEPRECATED();
|
||||
inline void setAngleOffsetDEPRECATED(float value);
|
||||
|
||||
inline ::int8_t getCalStatus();
|
||||
inline void setCalStatus( ::int8_t value);
|
||||
inline ::int8_t getCalStatusDEPRECATED();
|
||||
inline void setCalStatusDEPRECATED( ::int8_t value);
|
||||
|
||||
inline bool hasLeadOne();
|
||||
inline ::cereal::Live20Data::LeadData::Builder getLeadOne();
|
||||
@@ -1489,11 +1499,11 @@ public:
|
||||
inline ::uint64_t getFtMonoTime();
|
||||
inline void setFtMonoTime( ::uint64_t value);
|
||||
|
||||
inline ::int32_t getCalCycle();
|
||||
inline void setCalCycle( ::int32_t value);
|
||||
inline ::int32_t getCalCycleDEPRECATED();
|
||||
inline void setCalCycleDEPRECATED( ::int32_t value);
|
||||
|
||||
inline ::int8_t getCalPerc();
|
||||
inline void setCalPerc( ::int8_t value);
|
||||
inline ::int8_t getCalPercDEPRECATED();
|
||||
inline void setCalPercDEPRECATED( ::int8_t value);
|
||||
|
||||
inline bool hasCanMonoTimes();
|
||||
inline ::capnp::List< ::uint64_t>::Builder getCanMonoTimes();
|
||||
@@ -1899,7 +1909,7 @@ public:
|
||||
|
||||
inline float getVEgo() const;
|
||||
|
||||
inline float getAEgo() const;
|
||||
inline float getAEgoDEPRECATED() const;
|
||||
|
||||
inline float getVPid() const;
|
||||
|
||||
@@ -1925,7 +1935,7 @@ public:
|
||||
|
||||
inline float getAngleSteers() const;
|
||||
|
||||
inline ::int32_t getHudLead() const;
|
||||
inline ::int32_t getHudLeadDEPRECATED() const;
|
||||
|
||||
inline float getCumLagMs() const;
|
||||
|
||||
@@ -1985,8 +1995,8 @@ public:
|
||||
inline float getVEgo();
|
||||
inline void setVEgo(float value);
|
||||
|
||||
inline float getAEgo();
|
||||
inline void setAEgo(float value);
|
||||
inline float getAEgoDEPRECATED();
|
||||
inline void setAEgoDEPRECATED(float value);
|
||||
|
||||
inline float getVPid();
|
||||
inline void setVPid(float value);
|
||||
@@ -2024,8 +2034,8 @@ public:
|
||||
inline float getAngleSteers();
|
||||
inline void setAngleSteers(float value);
|
||||
|
||||
inline ::int32_t getHudLead();
|
||||
inline void setHudLead( ::int32_t value);
|
||||
inline ::int32_t getHudLeadDEPRECATED();
|
||||
inline void setHudLeadDEPRECATED( ::int32_t value);
|
||||
|
||||
inline float getCumLagMs();
|
||||
inline void setCumLagMs(float value);
|
||||
@@ -4106,6 +4116,20 @@ inline void ThermalData::Builder::setBat( ::uint32_t value) {
|
||||
3 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline float ThermalData::Reader::getFreeSpace() const {
|
||||
return _reader.getDataField<float>(
|
||||
4 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline float ThermalData::Builder::getFreeSpace() {
|
||||
return _builder.getDataField<float>(
|
||||
4 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void ThermalData::Builder::setFreeSpace(float value) {
|
||||
_builder.setDataField<float>(
|
||||
4 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline ::uint32_t HealthData::Reader::getVoltage() const {
|
||||
return _reader.getDataField< ::uint32_t>(
|
||||
0 * ::capnp::ELEMENTS);
|
||||
@@ -4176,6 +4200,20 @@ inline void HealthData::Builder::setGasInterceptorDetected(bool value) {
|
||||
66 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool HealthData::Reader::getStartedSignalDetected() const {
|
||||
return _reader.getDataField<bool>(
|
||||
67 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline bool HealthData::Builder::getStartedSignalDetected() {
|
||||
return _builder.getDataField<bool>(
|
||||
67 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void HealthData::Builder::setStartedSignalDetected(bool value) {
|
||||
_builder.setDataField<bool>(
|
||||
67 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool LiveUI::Reader::getRearViewCam() const {
|
||||
return _reader.getDataField<bool>(
|
||||
0 * ::capnp::ELEMENTS);
|
||||
@@ -4268,66 +4306,66 @@ inline void LiveUI::Builder::setAwarenessStatus(float value) {
|
||||
1 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline bool Live20Data::Reader::hasWarpMatrix() const {
|
||||
inline bool Live20Data::Reader::hasWarpMatrixDEPRECATED() const {
|
||||
return !_reader.getPointerField(0 * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline bool Live20Data::Builder::hasWarpMatrix() {
|
||||
inline bool Live20Data::Builder::hasWarpMatrixDEPRECATED() {
|
||||
return !_builder.getPointerField(0 * ::capnp::POINTERS).isNull();
|
||||
}
|
||||
inline ::capnp::List<float>::Reader Live20Data::Reader::getWarpMatrix() const {
|
||||
inline ::capnp::List<float>::Reader Live20Data::Reader::getWarpMatrixDEPRECATED() const {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List<float>>::get(
|
||||
_reader.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline ::capnp::List<float>::Builder Live20Data::Builder::getWarpMatrix() {
|
||||
inline ::capnp::List<float>::Builder Live20Data::Builder::getWarpMatrixDEPRECATED() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List<float>>::get(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
inline void Live20Data::Builder::setWarpMatrix( ::capnp::List<float>::Reader value) {
|
||||
inline void Live20Data::Builder::setWarpMatrixDEPRECATED( ::capnp::List<float>::Reader value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List<float>>::set(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline void Live20Data::Builder::setWarpMatrix(::kj::ArrayPtr<const float> value) {
|
||||
inline void Live20Data::Builder::setWarpMatrixDEPRECATED(::kj::ArrayPtr<const float> value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List<float>>::set(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), value);
|
||||
}
|
||||
inline ::capnp::List<float>::Builder Live20Data::Builder::initWarpMatrix(unsigned int size) {
|
||||
inline ::capnp::List<float>::Builder Live20Data::Builder::initWarpMatrixDEPRECATED(unsigned int size) {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List<float>>::init(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), size);
|
||||
}
|
||||
inline void Live20Data::Builder::adoptWarpMatrix(
|
||||
inline void Live20Data::Builder::adoptWarpMatrixDEPRECATED(
|
||||
::capnp::Orphan< ::capnp::List<float>>&& value) {
|
||||
::capnp::_::PointerHelpers< ::capnp::List<float>>::adopt(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS), kj::mv(value));
|
||||
}
|
||||
inline ::capnp::Orphan< ::capnp::List<float>> Live20Data::Builder::disownWarpMatrix() {
|
||||
inline ::capnp::Orphan< ::capnp::List<float>> Live20Data::Builder::disownWarpMatrixDEPRECATED() {
|
||||
return ::capnp::_::PointerHelpers< ::capnp::List<float>>::disown(
|
||||
_builder.getPointerField(0 * ::capnp::POINTERS));
|
||||
}
|
||||
|
||||
inline float Live20Data::Reader::getAngleOffset() const {
|
||||
inline float Live20Data::Reader::getAngleOffsetDEPRECATED() const {
|
||||
return _reader.getDataField<float>(
|
||||
0 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline float Live20Data::Builder::getAngleOffset() {
|
||||
inline float Live20Data::Builder::getAngleOffsetDEPRECATED() {
|
||||
return _builder.getDataField<float>(
|
||||
0 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Live20Data::Builder::setAngleOffset(float value) {
|
||||
inline void Live20Data::Builder::setAngleOffsetDEPRECATED(float value) {
|
||||
_builder.setDataField<float>(
|
||||
0 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline ::int8_t Live20Data::Reader::getCalStatus() const {
|
||||
inline ::int8_t Live20Data::Reader::getCalStatusDEPRECATED() const {
|
||||
return _reader.getDataField< ::int8_t>(
|
||||
4 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::int8_t Live20Data::Builder::getCalStatus() {
|
||||
inline ::int8_t Live20Data::Builder::getCalStatusDEPRECATED() {
|
||||
return _builder.getDataField< ::int8_t>(
|
||||
4 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Live20Data::Builder::setCalStatus( ::int8_t value) {
|
||||
inline void Live20Data::Builder::setCalStatusDEPRECATED( ::int8_t value) {
|
||||
_builder.setDataField< ::int8_t>(
|
||||
4 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
@@ -4448,30 +4486,30 @@ inline void Live20Data::Builder::setFtMonoTime( ::uint64_t value) {
|
||||
3 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline ::int32_t Live20Data::Reader::getCalCycle() const {
|
||||
inline ::int32_t Live20Data::Reader::getCalCycleDEPRECATED() const {
|
||||
return _reader.getDataField< ::int32_t>(
|
||||
3 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::int32_t Live20Data::Builder::getCalCycle() {
|
||||
inline ::int32_t Live20Data::Builder::getCalCycleDEPRECATED() {
|
||||
return _builder.getDataField< ::int32_t>(
|
||||
3 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Live20Data::Builder::setCalCycle( ::int32_t value) {
|
||||
inline void Live20Data::Builder::setCalCycleDEPRECATED( ::int32_t value) {
|
||||
_builder.setDataField< ::int32_t>(
|
||||
3 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline ::int8_t Live20Data::Reader::getCalPerc() const {
|
||||
inline ::int8_t Live20Data::Reader::getCalPercDEPRECATED() const {
|
||||
return _reader.getDataField< ::int8_t>(
|
||||
5 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::int8_t Live20Data::Builder::getCalPerc() {
|
||||
inline ::int8_t Live20Data::Builder::getCalPercDEPRECATED() {
|
||||
return _builder.getDataField< ::int8_t>(
|
||||
5 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Live20Data::Builder::setCalPerc( ::int8_t value) {
|
||||
inline void Live20Data::Builder::setCalPercDEPRECATED( ::int8_t value) {
|
||||
_builder.setDataField< ::int8_t>(
|
||||
5 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
@@ -4912,16 +4950,16 @@ inline void Live100Data::Builder::setVEgo(float value) {
|
||||
0 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline float Live100Data::Reader::getAEgo() const {
|
||||
inline float Live100Data::Reader::getAEgoDEPRECATED() const {
|
||||
return _reader.getDataField<float>(
|
||||
1 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline float Live100Data::Builder::getAEgo() {
|
||||
inline float Live100Data::Builder::getAEgoDEPRECATED() {
|
||||
return _builder.getDataField<float>(
|
||||
1 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Live100Data::Builder::setAEgo(float value) {
|
||||
inline void Live100Data::Builder::setAEgoDEPRECATED(float value) {
|
||||
_builder.setDataField<float>(
|
||||
1 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
@@ -5094,16 +5132,16 @@ inline void Live100Data::Builder::setAngleSteers(float value) {
|
||||
13 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
inline ::int32_t Live100Data::Reader::getHudLead() const {
|
||||
inline ::int32_t Live100Data::Reader::getHudLeadDEPRECATED() const {
|
||||
return _reader.getDataField< ::int32_t>(
|
||||
14 * ::capnp::ELEMENTS);
|
||||
}
|
||||
|
||||
inline ::int32_t Live100Data::Builder::getHudLead() {
|
||||
inline ::int32_t Live100Data::Builder::getHudLeadDEPRECATED() {
|
||||
return _builder.getDataField< ::int32_t>(
|
||||
14 * ::capnp::ELEMENTS);
|
||||
}
|
||||
inline void Live100Data::Builder::setHudLead( ::int32_t value) {
|
||||
inline void Live100Data::Builder::setHudLeadDEPRECATED( ::int32_t value) {
|
||||
_builder.setDataField< ::int32_t>(
|
||||
14 * ::capnp::ELEMENTS, value);
|
||||
}
|
||||
|
||||
@@ -61,6 +61,9 @@ struct ThermalData {
|
||||
mem @4 :UInt16;
|
||||
gpu @5 :UInt16;
|
||||
bat @6 :UInt32;
|
||||
|
||||
# not thermal
|
||||
freeSpace @7 :Float32;
|
||||
}
|
||||
|
||||
struct HealthData {
|
||||
@@ -70,6 +73,7 @@ struct HealthData {
|
||||
started @2 :Bool;
|
||||
controlsAllowed @3 :Bool;
|
||||
gasInterceptorDetected @4 :Bool;
|
||||
startedSignalDetected @5 :Bool;
|
||||
}
|
||||
|
||||
struct LiveUI {
|
||||
@@ -85,11 +89,11 @@ struct Live20Data {
|
||||
ftMonoTime @7 :UInt64;
|
||||
|
||||
# all deprecated
|
||||
warpMatrix @0 :List(Float32);
|
||||
angleOffset @1 :Float32;
|
||||
calStatus @2 :Int8;
|
||||
calCycle @8 :Int32;
|
||||
calPerc @9 :Int8;
|
||||
warpMatrixDEPRECATED @0 :List(Float32);
|
||||
angleOffsetDEPRECATED @1 :Float32;
|
||||
calStatusDEPRECATED @2 :Int8;
|
||||
calCycleDEPRECATED @8 :Int32;
|
||||
calPercDEPRECATED @9 :Int8;
|
||||
|
||||
leadOne @3 :LeadData;
|
||||
leadTwo @4 :LeadData;
|
||||
@@ -138,7 +142,7 @@ struct Live100Data {
|
||||
mdMonoTime @18 :UInt64;
|
||||
|
||||
vEgo @0 :Float32;
|
||||
aEgo @1 :Float32;
|
||||
aEgoDEPRECATED @1 :Float32;
|
||||
vPid @2 :Float32;
|
||||
vTargetLead @3 :Float32;
|
||||
upAccelCmd @4 :Float32;
|
||||
@@ -151,7 +155,7 @@ struct Live100Data {
|
||||
aTargetMax @11 :Float32;
|
||||
jerkFactor @12 :Float32;
|
||||
angleSteers @13 :Float32;
|
||||
hudLead @14 :Int32;
|
||||
hudLeadDEPRECATED @14 :Int32;
|
||||
cumLagMs @15 :Float32;
|
||||
|
||||
enabled @19: Bool;
|
||||
|
||||
@@ -3,6 +3,6 @@ import requests
|
||||
def api_get(endpoint, method='GET', timeout=None, **params):
|
||||
backend = "https://api.commadotai.com/"
|
||||
|
||||
params['_version'] = "OPENPILOTv0.0"
|
||||
params['_version'] = "OPENPILOTv0.2"
|
||||
|
||||
return requests.request(method, backend+endpoint, timeout=timeout, params=params)
|
||||
|
||||
@@ -5,6 +5,8 @@ import sys
|
||||
if os.getenv("NOLOG"):
|
||||
def capture_exception(*exc_info):
|
||||
pass
|
||||
def bind_user(**kwargs):
|
||||
pass
|
||||
def install():
|
||||
pass
|
||||
else:
|
||||
@@ -16,6 +18,9 @@ else:
|
||||
|
||||
capture_exception = client.captureException
|
||||
|
||||
def bind_user(**kwargs):
|
||||
client.user_context(kwargs)
|
||||
|
||||
def install():
|
||||
# installs a sys.excepthook
|
||||
__excepthook__ = sys.excepthook
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import re
|
||||
from collections import namedtuple
|
||||
import bitstring
|
||||
from binascii import hexlify
|
||||
from collections import namedtuple
|
||||
|
||||
def int_or_float(s):
|
||||
# return number, trying to maintain int format
|
||||
@@ -148,8 +149,8 @@ class dbc(object):
|
||||
if debug:
|
||||
print name
|
||||
|
||||
blen = (len(x[2])/2)*8
|
||||
x2_int = int(x[2], 16)
|
||||
blen = 8*len(x[2])
|
||||
x2_int = int(hexlify(x[2]), 16)
|
||||
|
||||
for s in msg[1]:
|
||||
if arr is not None and s[0] not in arr:
|
||||
|
||||
@@ -1,2 +1,25 @@
|
||||
def clip(x, lo, hi):
|
||||
return max(lo, min(hi, x))
|
||||
|
||||
|
||||
def interp(x, xp, fp):
|
||||
N = len(xp)
|
||||
if not hasattr(x, '__iter__'):
|
||||
hi = 0
|
||||
while hi < N and x > xp[hi]:
|
||||
hi += 1
|
||||
low = hi - 1
|
||||
return fp[-1] if hi == N and x > xp[low] else (
|
||||
fp[0] if hi == 0 else
|
||||
(x - xp[low]) * (fp[hi] - fp[low]) / (xp[hi] - xp[low]) + fp[low])
|
||||
|
||||
result = []
|
||||
for v in x:
|
||||
hi = 0
|
||||
while hi < N and v > xp[hi]:
|
||||
hi += 1
|
||||
low = hi - 1
|
||||
result.append(fp[-1] if hi == N and v > xp[low] else (fp[
|
||||
0] if hi == 0 else (v - xp[low]) * (fp[hi] - fp[low]) / (xp[hi] - xp[low]
|
||||
) + fp[low]))
|
||||
return result
|
||||
|
||||
26
common/profiler.py
Normal file
26
common/profiler.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from common.realtime import sec_since_boot
|
||||
|
||||
class Profiler(object):
|
||||
def __init__(self, enabled=False):
|
||||
self.enabled = enabled
|
||||
self.cp = []
|
||||
self.start_time = sec_since_boot()
|
||||
self.last_time = self.start_time
|
||||
|
||||
def checkpoint(self, name):
|
||||
if not self.enabled:
|
||||
return
|
||||
tt = sec_since_boot()
|
||||
self.cp.append((name, tt - self.last_time))
|
||||
self.last_time = tt
|
||||
|
||||
def display(self):
|
||||
if not self.enabled:
|
||||
return
|
||||
print "******* Profiling *******"
|
||||
tot = 0.0
|
||||
for n, ms in self.cp:
|
||||
print "%30s: %7.2f" % (n, ms*1000.0)
|
||||
tot += ms
|
||||
print " TOTAL: %7.2f" % (tot*1000.0)
|
||||
|
||||
@@ -28,7 +28,7 @@ if libc is not None:
|
||||
libc.clock_gettime.argtypes = [ctypes.c_int, ctypes.POINTER(timespec)]
|
||||
|
||||
def clock_gettime(clk_id):
|
||||
if platform.system() == "darwin":
|
||||
if platform.system().lower() == "darwin":
|
||||
# TODO: fix this
|
||||
return time.time()
|
||||
else:
|
||||
@@ -47,7 +47,7 @@ def sec_since_boot():
|
||||
|
||||
def set_realtime_priority(level):
|
||||
if os.getuid() != 0:
|
||||
print "not setting priority, not root"
|
||||
print("not setting priority, not root")
|
||||
return
|
||||
if platform.machine() == "x86_64":
|
||||
NR_gettid = 186
|
||||
@@ -57,7 +57,7 @@ def set_realtime_priority(level):
|
||||
raise NotImplementedError
|
||||
|
||||
tid = libc.syscall(NR_gettid)
|
||||
subprocess.check_call(['chrt', '-f', '-p', str(level), str(tid)])
|
||||
return subprocess.call(['chrt', '-f', '-p', str(level), str(tid)])
|
||||
|
||||
|
||||
class Ratekeeper(object):
|
||||
@@ -80,15 +80,19 @@ class Ratekeeper(object):
|
||||
|
||||
# Maintain loop rate by calling this at the end of each loop
|
||||
def keep_time(self):
|
||||
self.monitor_time()
|
||||
lagged = self.monitor_time()
|
||||
if self._remaining > 0:
|
||||
time.sleep(self._remaining)
|
||||
return lagged
|
||||
|
||||
# this only monitor the cumulative lag, but does not enforce a rate
|
||||
def monitor_time(self):
|
||||
lagged = False
|
||||
remaining = self._next_frame_time - sec_since_boot()
|
||||
self._next_frame_time += self._interval
|
||||
if remaining < -self._print_delay_threshold:
|
||||
print self._process_name, "lagging by", round(-remaining * 1000, 2), "ms"
|
||||
print(self._process_name, "lagging by", round(-remaining * 1000, 2), "ms")
|
||||
lagged = True
|
||||
self._frame += 1
|
||||
self._remaining = remaining
|
||||
return lagged
|
||||
|
||||
@@ -39,14 +39,21 @@ service_list = {
|
||||
# subscribes: health
|
||||
# publishes: thermal
|
||||
|
||||
# **** processes that communicate with the outside world ****
|
||||
|
||||
# boardd -- communicates with the car
|
||||
# subscribes: sendcan
|
||||
# publishes: can, health
|
||||
|
||||
# sensord -- publishes the IMU and GPS
|
||||
# publishes: sensorEvents, gpsNMEA
|
||||
|
||||
# visiond -- talks to the cameras, runs the model, saves the videos
|
||||
# subscribes: liveCalibration, sensorEvents
|
||||
# publishes: frame, encodeIdx, model, features
|
||||
|
||||
# **** stateful data transformers ****
|
||||
|
||||
# controlsd -- actually drives the car
|
||||
# subscribes: can, thermal, model, live20
|
||||
# publishes: sendcan, live100
|
||||
@@ -55,9 +62,6 @@ service_list = {
|
||||
# subscribes: can, live100, model
|
||||
# publishes: live20, liveTracks
|
||||
|
||||
# sensord -- publishes the IMU and GPS
|
||||
# publishes: sensorEvents, gpsNMEA
|
||||
|
||||
# calibrationd -- places the camera box
|
||||
# subscribes: features, live100
|
||||
# publishes: liveCalibration
|
||||
@@ -80,3 +84,4 @@ service_list = {
|
||||
|
||||
# logcatd -- fetches logcat info from android
|
||||
# publishes: androidLog
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ NS_ :
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
@@ -33,263 +33,292 @@ NS_ :
|
||||
|
||||
BS_:
|
||||
|
||||
BO_ 0x039 XXX: 3 XXX
|
||||
|
||||
BO_ 0x091 XXX: 8 XXX
|
||||
SG_ LAT_ACCEL : 0|10@1+ (0.02,-512) [-20|20] "m/s2" Vector__XXX
|
||||
|
||||
BO_ 0x0E4 STEERING_CONTROL: 5 ADAS
|
||||
SG_ STEER_TORQUE : 0|16@1- (1,0) [-3840|3840] "" Vector__XXX
|
||||
SG_ STEER_TORQUE_REQUEST : 16|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SET_ME_X00 : 17|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ SET_ME_X00 : 24|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ COUNTER : 34|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 36|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x130 GAS_PEDAL2: 8 PCM
|
||||
SG_ ENGINE_TORQUE_ESTIMATE : 0|16@1- (1,0) [-1000|1000] "Nm" Vector__XXX
|
||||
SG_ ENGINE_TORQUE_REQUEST : 16|16@1- (1,0) [-1000|1000] "Nm" Vector__XXX
|
||||
SG_ CAR_GAS : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
|
||||
BO_ 0x13C GAS_PEDAL: 8 PCM
|
||||
SG_ CAR_GAS : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
|
||||
BO_ 0x156 STEERING_SENSORS: 6 EPS
|
||||
SG_ STEER_ANGLE : 0|16@1- (-0.1,0) [-500|500] "deg" Vector__XXX
|
||||
SG_ STEER_ANGLE_RATE : 16|16@1- (1,0) [-3000|3000] "deg/s" Vector__XXX
|
||||
SG_ COUNTER : 42|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 44|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x158 POWERTRAIN_DATA: 8 PCM
|
||||
SG_ XMISSION_SPEED : 0|16@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ ENGINE_RPM : 16|16@1+ (1,0) [0|15000] "rpm" Vector__XXX
|
||||
SG_ XMISSION_SPEED2 : 32|16@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x17C POWERTRAIN_DATA2: 8 PCM
|
||||
SG_ PEDAL_GAS : 0|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ ENGINE_RPM : 16|16@1+ (1,0) [0|15000] "rpm" Vector__XXX
|
||||
SG_ GAS_PRESSED : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ ACC_STATUS : 33|1@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BOH_17C : 34|5@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BRAKE_LIGHTS_ON : 39|1@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BOH2_17C : 40|10@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BRAKE_PRESSED : 50|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH3_17C : 51|5@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x18E XXX: 3 XXX
|
||||
|
||||
BO_ 0x18F STEER_STATUS: 7 EPS
|
||||
SG_ STEER_TORQUE_SENSOR : 0|16@1- (1,0) [-31000|31000] "tbd" Vector__XXX
|
||||
SG_ STEER_TORQUE_MOTOR : 16|16@1- (1,0) [-31000|31000] "tbd" Vector__XXX
|
||||
SG_ STEER_STATUS : 32|4@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ STEER_CONTROL_ACTIVE : 36|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 50|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 52|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x1A3 GEARBOX: 8 PCM
|
||||
SG_ GEAR : 0|8@1+ (1,0) [0|256] "" Vector__XXX
|
||||
SG_ GEAR_SHIFTER : 36|4@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x1A4 VSA_STATUS: 8 VSA
|
||||
SG_ USER_BRAKE : 0|16@1+ (0.015625,-103) [0|1000] "" Vector__XXX
|
||||
SG_ ESP_DISABLED : 27|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x1A6 SCM_BUTTONS: 8 SCM
|
||||
SG_ CRUISE_BUTTONS : 0|3@1+ (1,0) [0|7] "" Vector__XXX
|
||||
SG_ LIGHTS_SETTING : 6|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ MAIN_ON : 40|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_SETTING : 44|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x1AC XXX: 8 XXX
|
||||
|
||||
BO_ 0x1B0 STANDSTILL: 7 VSA
|
||||
SG_ WHEELS_MOVING : 11|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BRAKE_ERROR_1 : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BRAKE_ERROR_2 : 14|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 50|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 52|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x1D0 WHEEL_SPEEDS: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 0|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ WHEEL_SPEED_FR : 15|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RL : 30|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RR : 45|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x1DC XXX: 4 XXX
|
||||
|
||||
BO_ 0x1EA VEHICLE_DYNAMICS: 8 VSA
|
||||
SG_ LONG_ACCEL : 16|16@1- (0.0015384,0) [-20|20] "m/s2" Vector__XXX
|
||||
|
||||
BO_ 0x1FA BRAKE_COMMAND: 8 ADAS
|
||||
SG_ COMPUTER_BRAKE : 0|10@1+ (0.003906248,0) [0|1] "" Vector__XXX
|
||||
SG_ ZEROS_BOH : 10|5@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COMPUTER_BRAKE_REQUEST : 15|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_BOH2 : 16|3@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_OVERRIDE : 19|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_BOH3 : 20|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_FAULT_CMD : 21|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_CANCEL_CMD : 22|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COMPUTER_BRAKE_REQUEST_2 : 23|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_BOH4 : 24|8@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BRAKE_LIGHTS : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_BOH5 : 33|7@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CHIME : 40|3@1+ (1,0) [0|7] "" Vector__XXX
|
||||
SG_ CRUISE_BOH6 : 43|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ FCW : 44|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CRUISE_BOH7 : 46|10@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x200 GAS_COMMAND: 3 ADAS
|
||||
SG_ GAS_COMMAND : 0|16@1+ (0.253984064,-328) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 18|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 20|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x201 GAS_SENSOR: 5 ADAS
|
||||
SG_ INTERCEPTOR_GAS : 0|16@1+ (0.253984064,-328) [0|1] "" Vector__XXX
|
||||
SG_ INTERCEPTOR_GAS2 : 16|16@1+ (0.126992032,-656) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 34|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 36|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x21E XXX: 7 XXX
|
||||
BO_ 0x221 XXX: 4 XXX
|
||||
|
||||
BO_ 0x255 ROUGH_WHEEL_SPEED: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 0|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ WHEEL_SPEED_FR : 8|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RL : 16|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RR : 24|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ SET_TO_X55 : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ SET_TO_X55 : 40|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
|
||||
BO_ 0x294 SCM_COMMANDS: 8 SCM
|
||||
SG_ RIGHT_BLINKER : 1|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LEFT_BLINKER : 2|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ WIPERS_SPEED : 3|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x305 SEATBELT_STATUS: 7 BDY
|
||||
SG_ SEATBELT_DRIVER_LAMP : 0|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SEATBELT_DRIVER_LATCHED : 10|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 50|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 52|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x309 XXX: 8 XXX
|
||||
|
||||
BO_ 0x30C ACC_HUD: 8 ADAS
|
||||
SG_ PCM_SPEED : 0|16@1+ (0.002763889,0) [0|100] "m/s" Vector__XXX
|
||||
SG_ PCM_GAS : 16|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ ZEROS_BOH : 23|1@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ CRUISE_SPEED : 24|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ DTC_MODE : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH : 33|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ ACC_PROBLEM : 34|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ FCM_OFF : 35|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH_2 : 36|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ FCM_PROBLEM : 37|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ RADAR_OBSTRUCTED : 38|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ ENABLE_MINI_CAR : 39|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SET_ME_X03 : 40|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ HUD_LEAD : 42|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ BOH_3 : 44|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ BOH_4 : 45|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ BOH_5 : 46|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CRUISE_CONTROL_LABEL : 47|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ HUD_DISTANCE_3 : 51|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x320 XXX: 8 XXX
|
||||
|
||||
BO_ 0x324 CRUISE: 8 PCM
|
||||
SG_ ENGINE_TEMPERATURE : 0|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH : 8|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ TRIP_FUEL_CONSUMED : 16|16@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ CRUISE_SPEED_PCM : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH2 : 40|8@1- (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH3 : 48|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
|
||||
BO_ 0x328 XXX: 8 XXX
|
||||
BO_ 0x333 XXX: 7 XXX
|
||||
BO_ 0x335 XXX: 5 XXX
|
||||
|
||||
BO_ 0x33D LKAS_HUD_2: 5 ADAS
|
||||
SG_ CAM_TEMP_HIGH : 0|1@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH : 1|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ DASHED_LANES : 9|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DTC : 10|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LKAS_PROBLEM : 11|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LKAS_OFF : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SOLID_LANES : 13|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LDW_RIGHT : 14|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ STEERING_REQUIRED : 15|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH : 16|2@1+ (1,0) [0|4] "" Vector__XXX
|
||||
SG_ LDW_PROBLEM : 18|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BEEP : 22|2@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LDW_ON : 27|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LDW_OFF : 28|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CLEAN_WINDSHIELD : 29|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SET_ME_X48 : 24|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ COUNTER : 34|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 36|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BU_: INTERCEPTOR EBCM NEO ADAS PCM EPS VSA SCM BDY XXX
|
||||
|
||||
|
||||
BO_ 0x372 XXX: 2 XXX
|
||||
BO_ 57 XXX_1: 3 XXX
|
||||
|
||||
BO_ 0x374 XXX: 7 XXX
|
||||
BO_ 0x377 XXX: 8 XXX
|
||||
BO_ 0x378 XXX: 8 XXX
|
||||
BO_ 0x37C XXX: 8 XXX
|
||||
BO_ 0x39B XXX: 2 XXX
|
||||
BO_ 0x3A1 XXX: 4 XXX
|
||||
BO_ 0x3D7 XXX: 8 XXX
|
||||
BO_ 0x3D9 XXX: 3 XXX
|
||||
BO_ 0x400 XXX: 5 XXX
|
||||
BO_ 0x403 XXX: 5 XXX
|
||||
BO_ 145 XXX_2: 8 XXX
|
||||
SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" NEO
|
||||
|
||||
BO_ 0x405 DOORS_STATUS: 8 BDY
|
||||
SG_ DOOR_OPEN_FL : 34|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DOOR_OPEN_FR : 33|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DOOR_OPEN_RL : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DOOR_OPEN_RR : 47|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 228 STEERING_CONTROL: 5 ADAS
|
||||
SG_ STEER_TORQUE : 7|16@0- (1,0) [-3840|3840] "" EPS
|
||||
SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS
|
||||
SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS
|
||||
SG_ SET_ME_X00 : 31|8@0+ (1,0) [0|0] "" EPS
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" EPS
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" EPS
|
||||
|
||||
BO_ 0x406 XXX: 5 VSA
|
||||
BO_ 0x40A XXX: 5 XXX
|
||||
BO_ 0x40C XXX: 8 XXX
|
||||
BO_ 0x40F XXX: 8 XXX
|
||||
BO_ 0x421 XXX: 5 EPS
|
||||
BO_ 0x428 XXX: 7 XXX
|
||||
BO_ 0x454 XXX: 8 XXX
|
||||
BO_ 0x555 XXX: 5 XXX
|
||||
BO_ 0x640 XXX: 5 XXX
|
||||
BO_ 0x641 XXX: 8 XXX
|
||||
BO_ 304 GAS_PEDAL2: 8 PCM
|
||||
SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" NEO
|
||||
SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" NEO
|
||||
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
VAL_ 0x1A6 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none";
|
||||
VAL_ 0x1A6 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none";
|
||||
VAL_ 0x30C HUD_LEAD 3 "no_car" 2 "solid_car" 1 "dashed_car" 0 "no_car";
|
||||
VAL_ 0x1A6 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights";
|
||||
VAL_ 0x18F STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal";
|
||||
VAL_ 0x1A3 GEAR_SHIFTER 10 "S" 4 "D" 3 "N" 2 "R" 1 "P";
|
||||
VAL_ 0x33D BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep";
|
||||
VAL_ 0x1FA CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime";
|
||||
VAL_ 0x1FA FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw";
|
||||
BO_ 316 GAS_PEDAL: 8 PCM
|
||||
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
BO_ 342 STEERING_SENSORS: 6 EPS
|
||||
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" NEO
|
||||
SG_ STEER_ANGLE_RATE : 23|16@0- (1,0) [-3000|3000] "deg/s" NEO
|
||||
SG_ COUNTER : 45|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 43|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 344 POWERTRAIN_DATA: 8 PCM
|
||||
SG_ XMISSION_SPEED : 7|16@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" NEO
|
||||
SG_ XMISSION_SPEED2 : 39|16@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 380 POWERTRAIN_DATA2: 8 PCM
|
||||
SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" NEO
|
||||
SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BRAKE_LIGHTS_ON : 32|1@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 398 XXX_3: 3 XXX
|
||||
|
||||
BO_ 399 STEER_STATUS: 7 EPS
|
||||
SG_ STEER_TORQUE_SENSOR : 7|16@0- (1,0) [-31000|31000] "tbd" NEO
|
||||
SG_ STEER_TORQUE_MOTOR : 23|16@0- (1,0) [-31000|31000] "tbd" NEO
|
||||
SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" NEO
|
||||
SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 419 GEARBOX: 8 PCM
|
||||
SG_ GEAR : 7|8@0+ (1,0) [0|256] "" NEO
|
||||
SG_ GEAR_SHIFTER : 35|4@0+ (1,0) [0|15] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 420 VSA_STATUS: 8 VSA
|
||||
SG_ USER_BRAKE : 7|16@0+ (0.015625,-103) [0|1000] "" NEO
|
||||
SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 422 SCM_BUTTONS: 8 SCM
|
||||
SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" NEO
|
||||
SG_ LIGHTS_SETTING : 1|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ MAIN_ON : 47|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ CRUISE_SETTING : 43|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 428 XXX_4: 8 XXX
|
||||
|
||||
BO_ 432 STANDSTILL: 7 VSA
|
||||
SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 464 WHEEL_SPEEDS: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ WHEEL_SPEED_FR : 8|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ WHEEL_SPEED_RL : 25|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ WHEEL_SPEED_RR : 42|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 476 XXX_5: 4 XXX
|
||||
|
||||
BO_ 490 VEHICLE_DYNAMICS: 8 VSA
|
||||
SG_ LONG_ACCEL : 23|16@0- (0.0015384,0) [-20|20] "m/s2" NEO
|
||||
|
||||
BO_ 506 BRAKE_COMMAND: 8 ADAS
|
||||
SG_ COMPUTER_BRAKE : 7|10@0+ (0.003906248,0) [0|1] "" EBCM
|
||||
SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ COMPUTER_BRAKE_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ COMPUTER_BRAKE_REQUEST_2 : 16|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH4 : 31|8@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH5 : 38|7@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM
|
||||
SG_ CRUISE_BOH6 : 44|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ FCW : 43|2@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ CRUISE_BOH7 : 41|10@0+ (1,0) [0|0] "" EBCM
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EBCM
|
||||
|
||||
BO_ 512 GAS_COMMAND: 3 NEO
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-328) [0|1] "" INTERCEPTOR
|
||||
SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" INTERCEPTOR
|
||||
SG_ CHECKSUM : 19|4@0+ (1,0) [0|3] "" INTERCEPTOR
|
||||
|
||||
BO_ 513 GAS_SENSOR: 5 INTERCEPTOR
|
||||
SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-328) [0|1] "" NEO
|
||||
SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-656) [0|1] "" NEO
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 542 XXX_6: 7 XXX
|
||||
|
||||
BO_ 545 XXX_7: 4 XXX
|
||||
|
||||
BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ SET_TO_X55 : 47|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
BO_ 660 SCM_COMMANDS: 8 SCM
|
||||
SG_ RIGHT_BLINKER : 6|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LEFT_BLINKER : 5|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ WIPERS_SPEED : 4|2@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 773 SEATBELT_STATUS: 7 BDY
|
||||
SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 777 XXX_8: 8 XXX
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ PCM_SPEED : 7|16@0+ (0.002763889,0) [0|100] "m/s" BDY
|
||||
SG_ PCM_GAS : 23|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ ZEROS_BOH : 16|1@0+ (1,0) [0|255] "" BDY
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH_2 : 35|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X03 : 47|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY
|
||||
|
||||
BO_ 800 XXX_9: 8 XXX
|
||||
|
||||
BO_ 804 CRUISE: 8 PCM
|
||||
SG_ ENGINE_TEMPERATURE : 7|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ BOH : 15|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" NEO
|
||||
SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ BOH2 : 47|8@0- (1,0) [0|255] "" NEO
|
||||
SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 808 XXX_10: 8 XXX
|
||||
|
||||
BO_ 819 XXX_11: 7 XXX
|
||||
|
||||
BO_ 821 XXX_12: 5 XXX
|
||||
|
||||
BO_ 829 LKAS_HUD_2: 5 ADAS
|
||||
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
|
||||
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
|
||||
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" BDY
|
||||
|
||||
BO_ 882 XXX_13: 2 XXX
|
||||
|
||||
BO_ 884 XXX_14: 7 XXX
|
||||
|
||||
BO_ 887 XXX_15: 8 XXX
|
||||
|
||||
BO_ 888 XXX_16: 8 XXX
|
||||
|
||||
BO_ 892 XXX_17: 8 XXX
|
||||
|
||||
BO_ 923 XXX_18: 2 XXX
|
||||
|
||||
BO_ 929 XXX_19: 4 XXX
|
||||
|
||||
BO_ 983 XXX_20: 8 XXX
|
||||
|
||||
BO_ 985 XXX_21: 3 XXX
|
||||
|
||||
BO_ 1024 XXX_22: 5 XXX
|
||||
|
||||
BO_ 1027 XXX_23: 5 XXX
|
||||
|
||||
BO_ 1029 DOORS_STATUS: 8 BDY
|
||||
SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 1030 XXX_24: 5 VSA
|
||||
|
||||
BO_ 1034 XXX_25: 5 XXX
|
||||
|
||||
BO_ 1036 XXX_26: 8 XXX
|
||||
|
||||
BO_ 1039 XXX_27: 8 XXX
|
||||
|
||||
BO_ 1057 XXX_28: 5 EPS
|
||||
|
||||
BO_ 1064 XXX_29: 7 XXX
|
||||
|
||||
BO_ 1108 XXX_30: 8 XXX
|
||||
|
||||
BO_ 1365 XXX_31: 5 XXX
|
||||
|
||||
BO_ 1600 XXX_32: 5 XXX
|
||||
|
||||
BO_ 1601 XXX_33: 8 XXX
|
||||
|
||||
BO_TX_BU_ 228 : NEO,ADAS;
|
||||
BO_TX_BU_ 506 : NEO,ADAS;
|
||||
BO_TX_BU_ 780 : NEO,ADAS;
|
||||
BO_TX_BU_ 829 : NEO,ADAS;
|
||||
|
||||
|
||||
CM_ SG_ 419 GEAR "10 = reverse, 11 = transition";
|
||||
CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
CM_ SG_ 780 CRUISE_SPEED "255 = no speed";
|
||||
CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed";
|
||||
CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc...";
|
||||
VAL_ 399 STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
VAL_ 419 GEAR_SHIFTER 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
|
||||
VAL_ 422 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
|
||||
VAL_ 422 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights" ;
|
||||
VAL_ 422 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ;
|
||||
VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime" ;
|
||||
VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw" ;
|
||||
VAL_ 780 HUD_LEAD 3 "no_car" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
|
||||
CM_ SG_ 0x1A3 GEAR "10 = reverse, 11 = transition";
|
||||
CM_ SG_ 0x324 CRUISE_SPEED_ECHO "255 = no speed";
|
||||
CM_ SG_ 0x33D CRUISE_SPEED "255 = no speed";
|
||||
CM_ SG_ 0x1EA LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
CM_ SG_ 0x33D BEEP "beeps are pleasant, chimes are for warnngs etc...";
|
||||
|
||||
@@ -15,7 +15,7 @@ NS_ :
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
@@ -33,143 +33,151 @@ NS_ :
|
||||
|
||||
BS_:
|
||||
|
||||
BU_: ADAS RADAR NEO XXX
|
||||
|
||||
BO_ 0x300 VEHICLE_STATE: 8 ADAS
|
||||
SG_ SET_ME_XF9 : 0|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ VEHICLE_SPEED : 8|8@1+ (1,0) [0|255] "kph" Vector__XXX
|
||||
|
||||
BO_ 0x301 VEHICLE_STATE2: 8 ADAS
|
||||
SG_ SET_ME_0F18510 : 0|28@1+ (1,0) [0|268435455] "" Vector__XXX
|
||||
SG_ SET_ME_25A0000 : 28|28@1+ (1,0) [0|268435455] "" Vector__XXX
|
||||
BO_ 768 VEHICLE_STATE: 8 ADAS
|
||||
SG_ SET_ME_XF9 : 7|8@0+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ VEHICLE_SPEED : 15|8@0+ (1,0) [0|255] "kph" Vector__XXX
|
||||
|
||||
BO_ 0x400 XXX: 8 RADAR
|
||||
BO_ 769 VEHICLE_STATE2: 8 ADAS
|
||||
SG_ SET_ME_0F18510 : 7|28@0+ (1,0) [0|268435455] "" Vector__XXX
|
||||
SG_ SET_ME_25A0000 : 27|28@0+ (1,0) [0|268435455] "" Vector__XXX
|
||||
|
||||
BO_ 0x410 XXX: 8 RADAR
|
||||
BO_ 1024 XXX_100: 8 RADAR
|
||||
|
||||
BO_ 0x411 XXX: 8 RADAR
|
||||
BO_ 1040 XXX_101: 8 RADAR
|
||||
|
||||
BO_ 0x412 XXX: 8 RADAR
|
||||
BO_ 1041 XXX_102: 8 RADAR
|
||||
|
||||
BO_ 0x413 XXX: 8 RADAR
|
||||
BO_ 1042 XXX_103: 8 RADAR
|
||||
|
||||
BO_ 0x414 XXX: 8 RADAR
|
||||
BO_ 1043 XXX_104: 8 RADAR
|
||||
|
||||
BO_ 0x415 XXX: 8 RADAR
|
||||
BO_ 1044 XXX_105: 8 RADAR
|
||||
|
||||
BO_ 0x416 XXX: 8 RADAR
|
||||
BO_ 1045 XXX_106: 8 RADAR
|
||||
|
||||
BO_ 0x417 XXX: 8 RADAR
|
||||
BO_ 1046 XXX_107: 8 RADAR
|
||||
|
||||
BO_ 0x420 XXX: 8 RADAR
|
||||
BO_ 1047 XXX_108: 8 RADAR
|
||||
|
||||
BO_ 0x421 XXX: 8 RADAR
|
||||
BO_ 1056 XXX_109: 8 RADAR
|
||||
|
||||
BO_ 0x422 XXX: 8 RADAR
|
||||
BO_ 1057 XXX_110: 8 RADAR
|
||||
|
||||
BO_ 0x423 XXX: 8 RADAR
|
||||
BO_ 1058 XXX_111: 8 RADAR
|
||||
|
||||
BO_ 0x424 XXX: 8 RADAR
|
||||
BO_ 1059 XXX_112: 8 RADAR
|
||||
|
||||
BO_ 0x430 TRACK_0: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1060 XXX_113: 8 RADAR
|
||||
|
||||
BO_ 0x431 TRACK_1: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1072 TRACK_0: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x432 TRACK_2: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1073 TRACK_1: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x433 TRACK_3: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1074 TRACK_2: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x434 TRACK_4: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1075 TRACK_3: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x435 TRACK_5: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1076 TRACK_4: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x436 TRACK_6: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1077 TRACK_5: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x437 TRACK_7: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1078 TRACK_6: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x438 TRACK_8: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1079 TRACK_7: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x439 TRACK_9: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1080 TRACK_8: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x440 TRACK_10: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1081 TRACK_9: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x441 TRACK_11: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1088 TRACK_10: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x442 TRACK_12: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1089 TRACK_11: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x443 TRACK_13: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1090 TRACK_12: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x444 TRACK_14: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1091 TRACK_13: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x445 TRACK_15: 8 RADAR
|
||||
SG_ LONG_DIST : 0|12@1+ (0.0625,0) [0|255.5] "m" Vector__XXX
|
||||
SG_ NEW_TRACK : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LAT_DIST : 14|10@1- (0.0625,0) [0|63.5] "m" Vector__XXX
|
||||
SG_ REL_SPEED : 24|12@1- (0.03125,0) [0|127.5] "m/s" Vector__XXX
|
||||
BO_ 1092 TRACK_14: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 0x4FF XXX: 8 RADAR
|
||||
BO_ 1093 TRACK_15: 8 RADAR
|
||||
SG_ LONG_DIST : 7|12@0+ (0.0625,0) [0|255.5] "m" NEO
|
||||
SG_ NEW_TRACK : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LAT_DIST : 9|10@0- (0.0625,0) [0|63.5] "m" NEO
|
||||
SG_ REL_SPEED : 31|12@0- (0.03125,0) [0|127.5] "m/s" NEO
|
||||
|
||||
BO_ 1279 XXX_114: 8 RADAR
|
||||
|
||||
BO_ 1280 XXX_115: 8 RADAR
|
||||
|
||||
BO_ 1296 XXX_116: 8 RADAR
|
||||
|
||||
BO_ 1297 XXX_117: 8 RADAR
|
||||
|
||||
BO_TX_BU_ 768 : NEO,ADAS;
|
||||
BO_TX_BU_ 769 : NEO,ADAS;
|
||||
|
||||
BO_ 0x500 XXX: 8 RADAR
|
||||
|
||||
BO_ 0x510 XXX: 8 RADAR
|
||||
|
||||
BO_ 0x511 XXX: 8 RADAR
|
||||
|
||||
@@ -15,7 +15,7 @@ NS_ :
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
@@ -33,287 +33,311 @@ NS_ :
|
||||
|
||||
BS_:
|
||||
|
||||
BO_ 0x039 XXX: 3 XXX
|
||||
BU_: INTERCEPTOR EBCM NEO ADAS PCM EPS VSA SCM BDY XXX EPB
|
||||
|
||||
BO_ 0x94 XXX: 8 XXX
|
||||
SG_ LAT_ACCEL : 0|10@1+ (0.02,-512) [-20|20] "m/s2" Vector__XXX
|
||||
SG_ LONG_ACCEL : 31|9@1- (-0.02,0) [-20|20] "m/s2" Vector__XXX
|
||||
|
||||
BO_ 0x0E4 STEERING_CONTROL: 5 ADAS
|
||||
SG_ STEER_TORQUE : 0|16@1- (1,0) [-3840|3840] "" Vector__XXX
|
||||
SG_ STEER_TORQUE_REQUEST : 16|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SET_ME_X00 : 17|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ SET_ME_X00_2 : 24|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ CHECKSUM : 32|4@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ COUNTER : 38|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 57 XXX_1: 3 XXX
|
||||
|
||||
BO_ 0x130 GAS_PEDAL2: 8 PCM
|
||||
SG_ ENGINE_TORQUE_ESTIMATE : 0|16@1- (1,0) [-1000|1000] "Nm" Vector__XXX
|
||||
SG_ ENGINE_TORQUE_REQUEST : 16|16@1- (1,0) [-1000|1000] "Nm" Vector__XXX
|
||||
SG_ CAR_GAS : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
BO_ 148 XXX_2: 8 XXX
|
||||
SG_ LAT_ACCEL : 7|10@0+ (0.02,-512) [-20|20] "m/s2" NEO
|
||||
SG_ LONG_ACCEL : 24|9@0- (-0.02,0) [-20|20] "m/s2" NEO
|
||||
|
||||
BO_ 0x14A STEERING_SENSORS: 8 EPS
|
||||
SG_ STEER_ANGLE : 0|16@1- (-0.1,0) [-500|500] "deg" Vector__XXX
|
||||
SG_ STEER_ANGLE_RATE : 16|16@1- (-1,0) [-3000|3000] "deg/s" Vector__XXX
|
||||
SG_ STEER_ANGLE_OFFSET : 32|8@1- (-0.1,0) [-128|127] "deg" Vector__XXX
|
||||
SG_ STEER_WHEEL_ANGLE : 40|16@1- (-0.1,0) [-500|500] "deg" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 228 STEERING_CONTROL: 5 ADAS
|
||||
SG_ STEER_TORQUE : 7|16@0- (1,0) [-3840|3840] "" EPS
|
||||
SG_ STEER_TORQUE_REQUEST : 23|1@0+ (1,0) [0|1] "" EPS
|
||||
SG_ SET_ME_X00 : 22|7@0+ (1,0) [0|127] "" EPS
|
||||
SG_ SET_ME_X00_2 : 31|8@0+ (1,0) [0|0] "" EPS
|
||||
SG_ CHECKSUM : 39|4@0+ (1,0) [0|15] "" EPS
|
||||
SG_ COUNTER : 33|2@0+ (1,0) [0|3] "" EPS
|
||||
|
||||
BO_ 0x158 POWERTRAIN_DATA: 8 PCM
|
||||
SG_ XMISSION_SPEED : 0|16@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ ENGINE_RPM : 16|16@1+ (1,0) [0|15000] "rpm" Vector__XXX
|
||||
SG_ XMISSION_SPEED2 : 32|16@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 304 GAS_PEDAL2: 8 PCM
|
||||
SG_ ENGINE_TORQUE_ESTIMATE : 7|16@0- (1,0) [-1000|1000] "Nm" NEO
|
||||
SG_ ENGINE_TORQUE_REQUEST : 23|16@0- (1,0) [-1000|1000] "Nm" NEO
|
||||
SG_ CAR_GAS : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
BO_ 0x17C POWERTRAIN_DATA2: 8 PCM
|
||||
SG_ PEDAL_GAS : 0|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ ENGINE_RPM : 16|16@1+ (1,0) [0|15000] "rpm" Vector__XXX
|
||||
SG_ GAS_PRESSED : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ ACC_STATUS : 33|1@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BOH_17C : 34|5@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BRAKE_LIGHTS_ON : 39|1@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BOH2_17C : 40|10@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ BRAKE_PRESSED : 50|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH3_17C : 51|5@1+ (1,0) [0|1] "rpm" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 330 STEERING_SENSORS: 8 EPS
|
||||
SG_ STEER_ANGLE : 7|16@0- (-0.1,0) [-500|500] "deg" NEO
|
||||
SG_ STEER_ANGLE_RATE : 23|16@0- (-1,0) [-3000|3000] "deg/s" NEO
|
||||
SG_ STEER_ANGLE_OFFSET : 39|8@0- (-0.1,0) [-128|127] "deg" NEO
|
||||
SG_ STEER_WHEEL_ANGLE : 47|16@0- (-0.1,0) [-500|500] "deg" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x18F STEER_STATUS: 7 EPS
|
||||
SG_ STEER_TORQUE_SENSOR : 0|16@1- (1,0) [-31000|31000] "tbd" Vector__XXX
|
||||
SG_ STEER_TORQUE_MOTOR : 16|16@1- (1,0) [-31000|31000] "tbd" Vector__XXX
|
||||
SG_ STEER_STATUS : 32|4@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ STEER_CONTROL_ACTIVE : 36|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 50|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 52|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 344 POWERTRAIN_DATA: 8 PCM
|
||||
SG_ XMISSION_SPEED : 7|16@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" NEO
|
||||
SG_ XMISSION_SPEED2 : 39|16@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x191 GEARBOX: 8 PCM
|
||||
SG_ GEAR_SHIFTER : 2|6@1+ (1,0) [0|63] "" Vector__XXX
|
||||
SG_ GEAR : 36|4@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 380 POWERTRAIN_DATA2: 8 PCM
|
||||
SG_ PEDAL_GAS : 7|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ ENGINE_RPM : 23|16@0+ (1,0) [0|15000] "rpm" NEO
|
||||
SG_ GAS_PRESSED : 39|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ ACC_STATUS : 38|1@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BOH_17C : 37|5@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BRAKE_LIGHTS_ON : 32|1@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BOH2_17C : 47|10@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ BRAKE_PRESSED : 53|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ BOH3_17C : 52|5@0+ (1,0) [0|1] "rpm" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1A4 VSA_STATUS: 8 VSA
|
||||
SG_ USER_BRAKE : 0|16@1+ (0.015625,-103) [0|1000] "" Vector__XXX
|
||||
SG_ ESP_DISABLED : 27|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 399 STEER_STATUS: 7 EPS
|
||||
SG_ STEER_TORQUE_SENSOR : 7|16@0- (1,0) [-31000|31000] "tbd" NEO
|
||||
SG_ STEER_TORQUE_MOTOR : 23|16@0- (1,0) [-31000|31000] "tbd" NEO
|
||||
SG_ STEER_STATUS : 39|4@0+ (1,0) [0|15] "" NEO
|
||||
SG_ STEER_CONTROL_ACTIVE : 35|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1AB XXX: 3 VSA
|
||||
BO_ 401 GEARBOX: 8 PCM
|
||||
SG_ GEAR_SHIFTER : 5|6@0+ (1,0) [0|63] "" NEO
|
||||
SG_ GEAR : 35|4@0+ (1,0) [0|15] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1AC XXX: 8 XXX
|
||||
BO_ 420 VSA_STATUS: 8 VSA
|
||||
SG_ USER_BRAKE : 7|16@0+ (0.015625,-103) [0|1000] "" NEO
|
||||
SG_ ESP_DISABLED : 28|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1B0 STANDSTILL: 7 VSA
|
||||
SG_ WHEELS_MOVING : 11|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BRAKE_ERROR_1 : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BRAKE_ERROR_2 : 14|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 50|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 52|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 427 XXX_3: 3 VSA
|
||||
|
||||
BO_ 0x1C2 XXX: 8 EPB
|
||||
SG_ EPB_ACTIVE : 4|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ EPB_STATE : 26|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 428 XXX_4: 8 XXX
|
||||
|
||||
BO_ 0x1D0 WHEEL_SPEEDS: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 0|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ WHEEL_SPEED_FR : 15|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RL : 30|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RR : 45|15@1+ (0.002759506,0) [0|70] "m/s" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 432 STANDSTILL: 7 VSA
|
||||
SG_ WHEELS_MOVING : 12|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ BRAKE_ERROR_1 : 11|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ BRAKE_ERROR_2 : 9|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1D6 XXX: 2 VSA
|
||||
BO_ 450 XXX_5: 8 EPB
|
||||
SG_ EPB_ACTIVE : 3|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ EPB_STATE : 29|2@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1DC XXX: 7 XXX
|
||||
BO_ 464 WHEEL_SPEEDS: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ WHEEL_SPEED_FR : 8|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ WHEEL_SPEED_RL : 25|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ WHEEL_SPEED_RR : 42|15@0+ (0.002759506,0) [0|70] "m/s" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x1E7 XXX: 4 VSA
|
||||
SG_ BRAKE_PRESSURE1 : 0|10@1+ (0.015625,-103) [0|1000] "" Vector__XXX
|
||||
SG_ BRAKE_PRESSURE2 : 14|10@1+ (0.015625,-103) [0|1000] "" Vector__XXX
|
||||
BO_ 470 XXX_6: 2 VSA
|
||||
|
||||
BO_ 0x1EA VEHICLE_DYNAMICS: 8 VSA
|
||||
SG_ LONG_ACCEL : 16|16@1- (0.0015384,0) [-20|20] "m/s2" Vector__XXX
|
||||
BO_ 476 XXX_7: 7 XXX
|
||||
|
||||
BO_ 0x1ED XXX: 5 VSA
|
||||
BO_ 487 XXX_8: 4 VSA
|
||||
SG_ BRAKE_PRESSURE1 : 7|10@0+ (0.015625,-103) [0|1000] "" NEO
|
||||
SG_ BRAKE_PRESSURE2 : 9|10@0+ (0.015625,-103) [0|1000] "" NEO
|
||||
|
||||
BO_ 0x1FA BRAKE_COMMAND: 8 ADAS
|
||||
SG_ COMPUTER_BRAKE : 0|10@1+ (0.003906248,0) [0|1.0] "" Vector__XXX
|
||||
SG_ ZEROS_BOH : 10|5@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COMPUTER_BRAKE_REQUEST : 15|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_BOH2 : 16|3@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_OVERRIDE : 19|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_BOH3 : 20|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_FAULT_CMD : 21|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_CANCEL_CMD : 22|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COMPUTER_BRAKE_REQUEST_2 : 23|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SET_ME_0X80 : 24|8@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BRAKE_LIGHTS : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CRUISE_STATES : 33|7@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CHIME : 40|3@1+ (1,0) [0|7] "" Vector__XXX
|
||||
SG_ ZEROS_BOH6 : 43|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ FCW : 44|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ ZEROS_BOH3 : 45|2@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ FCW2 : 47|1@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ ZEROS_BOH4 : 48|8@1+ (1,0) [0|0] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 490 VEHICLE_DYNAMICS: 8 VSA
|
||||
SG_ LONG_ACCEL : 23|16@0- (0.0015384,0) [-20|20] "m/s2" NEO
|
||||
|
||||
BO_ 0x200 GAS_COMMAND: 3 ADAS
|
||||
SG_ GAS_COMMAND : 0|16@1+ (0.253984064,-328) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 18|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 20|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 493 XXX_9: 5 VSA
|
||||
|
||||
BO_ 0x201 GAS_SENSOR: 5 ADAS
|
||||
SG_ INTERCEPTOR_GAS : 0|16@1+ (0.253984064,-328) [0|1] "" Vector__XXX
|
||||
SG_ INTERCEPTOR_GAS2 : 16|16@1+ (0.126992032,-656) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 34|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 36|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 506 BRAKE_COMMAND: 8 ADAS
|
||||
SG_ COMPUTER_BRAKE : 7|10@0+ (0.003906248,0) [0|1] "" EBCM
|
||||
SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ COMPUTER_BRAKE_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ COMPUTER_BRAKE_REQUEST_2 : 16|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ CHIME : 47|3@0+ (1,0) [0|7] "" EBCM
|
||||
SG_ ZEROS_BOH6 : 44|1@0+ (1,0) [0|1] "" EBCM
|
||||
SG_ FCW : 43|1@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ ZEROS_BOH3 : 42|2@0+ (1,0) [0|0] "" EBCM
|
||||
SG_ FCW2 : 40|1@0+ (1,0) [0|0] "" EBCM
|
||||
SG_ ZEROS_BOH4 : 55|8@0+ (1,0) [0|0] "" EBCM
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EBCM
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EBCM
|
||||
|
||||
BO_ 0x221 XXX: 6 XXX
|
||||
BO_ 512 GAS_COMMAND: 3 NEO
|
||||
SG_ GAS_COMMAND : 7|16@0+ (0.253984064,-328) [0|1] "" INTERCEPTOR
|
||||
SG_ COUNTER : 21|2@0+ (1,0) [0|3] "" INTERCEPTOR
|
||||
SG_ CHECKSUM : 19|4@0+ (1,0) [0|3] "" INTERCEPTOR
|
||||
|
||||
BO_ 0x255 ROUGH_WHEEL_SPEED: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 0|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ WHEEL_SPEED_FR : 8|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RL : 16|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ WHEEL_SPEED_RR : 24|8@1+ (1,0) [0|255] "mph" Vector__XXX
|
||||
SG_ SET_TO_X55 : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ SET_TO_X55 : 40|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
BO_ 513 GAS_SENSOR: 5 INTERCEPTOR
|
||||
SG_ INTERCEPTOR_GAS : 7|16@0+ (0.253984064,-328) [0|1] "" NEO
|
||||
SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.126992032,-656) [0|1] "" NEO
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x296 CRUISE_BUTTONS: 4 SCM
|
||||
SG_ CRUISE_BUTTONS : 0|3@1+ (1,0) [0|7] "" Vector__XXX
|
||||
SG_ CRUISE_SETTING : 4|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 545 XXX_10: 6 XXX
|
||||
|
||||
BO_ 0x305 SEATBELT_STATUS: 7 BDY
|
||||
SG_ SEATBELT_DRIVER_LAMP : 0|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SEATBELT_DRIVER_LATCHED : 10|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 50|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 52|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 597 ROUGH_WHEEL_SPEED: 8 VSA
|
||||
SG_ WHEEL_SPEED_FL : 7|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ WHEEL_SPEED_FR : 15|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ WHEEL_SPEED_RL : 23|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ WHEEL_SPEED_RR : 31|8@0+ (1,0) [0|255] "mph" NEO
|
||||
SG_ SET_TO_X55 : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ SET_TO_X55 : 47|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
BO_ 0x309 XXX: 8 XXX
|
||||
BO_ 662 CRUISE_BUTTONS: 4 SCM
|
||||
SG_ CRUISE_BUTTONS : 7|3@0+ (1,0) [0|7] "" NEO
|
||||
SG_ CRUISE_SETTING : 3|2@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x30C ACC_HUD: 8 ADAS
|
||||
SG_ PCM_SPEED : 0|16@1+ (0.002763889,0) [0|100] "m/s" Vector__XXX
|
||||
SG_ PCM_GAS : 16|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ ZEROS_BOH : 23|1@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ CRUISE_SPEED : 24|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ DTC_MODE : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH : 33|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ ACC_PROBLEM : 34|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ FCM_OFF : 35|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH_2 : 36|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ FCM_PROBLEM : 37|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ RADAR_OBSTRUCTED : 38|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ ENABLE_MINI_CAR : 39|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ HUD_DISTANCE : 40|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ HUD_LEAD : 42|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ BOH_3 : 44|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ BOH_4 : 45|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ BOH_5 : 46|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CRUISE_CONTROL_LABEL : 47|1@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 773 SEATBELT_STATUS: 7 BDY
|
||||
SG_ SEATBELT_DRIVER_LAMP : 7|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ SEATBELT_DRIVER_LATCHED : 13|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 51|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x31B XXX: 8 XXX
|
||||
BO_ 777 XXX_11: 8 XXX
|
||||
|
||||
BO_ 0x320 XXX: 8 XXX
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ PCM_SPEED : 7|16@0+ (0.002763889,0) [0|100] "m/s" BDY
|
||||
SG_ PCM_GAS : 23|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ ZEROS_BOH : 16|1@0+ (1,0) [0|255] "" BDY
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ DTC_MODE : 39|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 38|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ACC_PROBLEM : 37|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_OFF : 36|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH_2 : 35|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ FCM_PROBLEM : 34|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ RADAR_OBSTRUCTED : 33|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ ENABLE_MINI_CAR : 32|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ HUD_DISTANCE : 47|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ HUD_LEAD : 45|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_3 : 43|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_4 : 42|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" BDY
|
||||
|
||||
BO_ 0x324 CRUISE: 8 PCM
|
||||
SG_ ENGINE_TEMPERATURE : 0|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH : 8|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ TRIP_FUEL_CONSUMED : 16|16@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ CRUISE_SPEED_PCM : 32|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH2 : 40|8@1- (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH3 : 48|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 795 XXX_12: 8 XXX
|
||||
|
||||
BO_ 0x326 SCM_FEEDBACK: 8 SCM
|
||||
SG_ CMBS_BUTTON : 17|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ MAIN_ON : 27|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ RIGHT_BLINKER : 28|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LEFT_BLINKER : 29|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
|
||||
BO_ 800 XXX_13: 8 XXX
|
||||
|
||||
BO_ 0x328 XXX: 8 XXX
|
||||
BO_ 804 CRUISE: 8 PCM
|
||||
SG_ ENGINE_TEMPERATURE : 7|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ BOH : 15|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ TRIP_FUEL_CONSUMED : 23|16@0+ (1,0) [0|255] "" NEO
|
||||
SG_ CRUISE_SPEED_PCM : 39|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ BOH2 : 47|8@0- (1,0) [0|255] "" NEO
|
||||
SG_ BOH3 : 55|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 0x33D LKAS_HUD_2: 5 ADAS
|
||||
SG_ CAM_TEMP_HIGH : 0|1@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ BOH : 1|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ DASHED_LANES : 9|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DTC : 10|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LKAS_PROBLEM : 11|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LKAS_OFF : 12|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SOLID_LANES : 13|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LDW_RIGHT : 14|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ STEERING_REQUIRED : 15|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BOH : 16|2@1+ (1,0) [0|4] "" Vector__XXX
|
||||
SG_ LDW_PROBLEM : 18|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ BEEP : 22|2@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LDW_ON : 27|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ LDW_OFF : 28|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ CLEAN_WINDSHIELD : 29|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ SET_ME_X48 : 24|8@1+ (1,0) [0|255] "" Vector__XXX
|
||||
SG_ COUNTER : 34|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 36|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 806 SCM_FEEDBACK: 8 SCM
|
||||
SG_ CMBS_BUTTON : 22|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ MAIN_ON : 28|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ RIGHT_BLINKER : 27|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ LEFT_BLINKER : 26|1@0+ (1,0) [0|1] "" NEO
|
||||
|
||||
BO_ 0x35E XXX: 8 ADAS
|
||||
SG_ UI_ALERTS : 0|56@1+ (1,0) [0|127] "" Vector__XXX
|
||||
BO_ 808 XXX_14: 8 XXX
|
||||
|
||||
BO_ 0x374 XXX: 8 XXX
|
||||
BO_ 0x37B XXX: 8 XXX
|
||||
BO_ 0x37C XXX: 8 XXX
|
||||
BO_ 829 LKAS_HUD_2: 5 ADAS
|
||||
SG_ CAM_TEMP_HIGH : 7|1@0+ (1,0) [0|255] "" BDY
|
||||
SG_ BOH : 6|7@0+ (1,0) [0|127] "" BDY
|
||||
SG_ DASHED_LANES : 14|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ DTC : 13|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_PROBLEM : 12|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LKAS_OFF : 11|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SOLID_LANES : 10|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_RIGHT : 9|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ STEERING_REQUIRED : 8|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BOH : 23|2@0+ (1,0) [0|4] "" BDY
|
||||
SG_ LDW_PROBLEM : 21|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ BEEP : 17|2@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_ON : 28|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ LDW_OFF : 27|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ CLEAN_WINDSHIELD : 26|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ SET_ME_X48 : 31|8@0+ (1,0) [0|255] "" BDY
|
||||
SG_ COUNTER : 37|2@0+ (1,0) [0|3] "" BDY
|
||||
SG_ CHECKSUM : 35|4@0+ (1,0) [0|3] "" BDY
|
||||
|
||||
BO_ 0x39F XXX: 8 ADAS
|
||||
SG_ ZEROS_BOH : 0|17@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ APPLY_BRAKES_FOR_CANC : 16|1@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ ZEROS_BOH2 : 17|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ RESUME_INSTRUCTION : 18|1@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ ACC_ALERTS : 19|5@1+ (1,0) [0|15] "" Vector__XXX
|
||||
SG_ ZEROS_BOH2 : 24|8@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ LEAD_SPEED : 32|9@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ LEAD_STATE : 41|3@1+ (1,0) [0|127] "" Vector__XXX
|
||||
SG_ LEAD_DISTANCE : 44|5@1+ (1,0) [0|31] "" Vector__XXX
|
||||
SG_ ZEROS_BOH3 : 49|7@1+ (1,0) [0|127] "" Vector__XXX
|
||||
BO_ 862 XXX_15: 8 ADAS
|
||||
SG_ UI_ALERTS : 7|56@0+ (1,0) [0|127] "" BDY
|
||||
|
||||
BO_ 0x3A1 XXX: 8 XXX
|
||||
BO_ 0x3D9 XXX: 3 XXX
|
||||
BO_ 0x400 XXX: 5 XXX
|
||||
BO_ 0x403 XXX: 5 XXX
|
||||
BO_ 884 XXX_16: 8 XXX
|
||||
|
||||
BO_ 0x405 DOORS_STATUS: 8 BDY
|
||||
SG_ DOOR_OPEN_FL : 34|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DOOR_OPEN_FR : 33|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DOOR_OPEN_RL : 32|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ DOOR_OPEN_RR : 47|1@1+ (1,0) [0|1] "" Vector__XXX
|
||||
SG_ COUNTER : 58|2@1+ (1,0) [0|3] "" Vector__XXX
|
||||
SG_ CHECKSUM : 60|4@1+ (1,0) [0|3] "" Vector__XXX
|
||||
BO_ 891 XXX_17: 8 XXX
|
||||
|
||||
BO_ 0x40C XXX: 8 XXX
|
||||
BO_ 0x40F XXX: 8 XXX
|
||||
BO_ 0x454 XXX: 8 XXX
|
||||
BO_ 0x516 XXX: 8 XXX
|
||||
BO_ 0x52A XXX: 5 XXX
|
||||
BO_ 0x551 XXX: 5 XXX
|
||||
BO_ 0x555 XXX: 5 XXX
|
||||
BO_ 0x590 XXX: 5 XXX
|
||||
BO_ 0x640 XXX: 5 XXX
|
||||
BO_ 0x641 XXX: 8 XXX
|
||||
BO_ 0x661 XXX: 8 XXX
|
||||
BO_ 892 XXX_18: 8 XXX
|
||||
|
||||
VAL_ 0x296 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none";
|
||||
VAL_ 0x296 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none";
|
||||
VAL_ 0x33D HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car";
|
||||
VAL_ 0x1A6 LIGHTS_SETTING 3 "high_beam" 2 "low_beam" 1 "position" 0 "no_lights";
|
||||
VAL_ 0x18F STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal";
|
||||
VAL_ 0x191 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P";
|
||||
VAL_ 0x33D BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep";
|
||||
VAL_ 0x1FA CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime";
|
||||
VAL_ 0x1C2 EPB_STATE 3 "engaged" 2 "disengaging" 1 "engaging" 0 "disengaged";
|
||||
VAL_ 0x326 CMBS_BUTTON 3 "pressed" 0 "released";
|
||||
VAL_ 0x39F ACC_ALERTS 29 "esp_active_acc_canceled" 10 "b_pedal_applied" 9 "speed_too_low" 8 "speed_too_high" 7 "p_brake_applied" 6 "gear_no_d" 5 "seatbelt" 4 "too_steep_downhill" 3 "too_steep_uphill" 2 "too_close" 1 "no_vehicle_ahead";
|
||||
VAL_ 0x30C CRUISE_SPEED 255 "no_speed" 252 "stopped";
|
||||
BO_ 927 XXX_19: 8 ADAS
|
||||
SG_ ZEROS_BOH : 7|17@0+ (1,0) [0|127] "" BDY
|
||||
SG_ APPLY_BRAKES_FOR_CANC : 23|1@0+ (1,0) [0|15] "" BDY
|
||||
SG_ ZEROS_BOH2 : 22|1@0+ (1,0) [0|1] "" BDY
|
||||
SG_ RESUME_INSTRUCTION : 21|1@0+ (1,0) [0|15] "" BDY
|
||||
SG_ ACC_ALERTS : 20|5@0+ (1,0) [0|15] "" BDY
|
||||
SG_ ZEROS_BOH2 : 31|8@0+ (1,0) [0|127] "" BDY
|
||||
SG_ LEAD_SPEED : 39|9@0+ (1,0) [0|127] "" BDY
|
||||
SG_ LEAD_STATE : 46|3@0+ (1,0) [0|127] "" BDY
|
||||
SG_ LEAD_DISTANCE : 43|5@0+ (1,0) [0|31] "" BDY
|
||||
SG_ ZEROS_BOH3 : 54|7@0+ (1,0) [0|127] "" BDY
|
||||
|
||||
BO_ 929 XXX_20: 8 XXX
|
||||
|
||||
BO_ 985 XXX_21: 3 XXX
|
||||
|
||||
BO_ 1024 XXX_22: 5 XXX
|
||||
|
||||
BO_ 1027 XXX_23: 5 XXX
|
||||
|
||||
BO_ 1029 DOORS_STATUS: 8 BDY
|
||||
SG_ DOOR_OPEN_FL : 37|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ DOOR_OPEN_FR : 38|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ DOOR_OPEN_RL : 39|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ DOOR_OPEN_RR : 40|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" NEO
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" NEO
|
||||
|
||||
BO_ 1036 XXX_24: 8 XXX
|
||||
|
||||
BO_ 1039 XXX_25: 8 XXX
|
||||
|
||||
BO_ 1108 XXX_26: 8 XXX
|
||||
|
||||
BO_ 1302 XXX_27: 8 XXX
|
||||
|
||||
BO_ 1322 XXX_28: 5 XXX
|
||||
|
||||
BO_ 1361 XXX_29: 5 XXX
|
||||
|
||||
BO_ 1365 XXX_30: 5 XXX
|
||||
|
||||
BO_ 1424 XXX_31: 5 XXX
|
||||
|
||||
BO_ 1600 XXX_32: 5 XXX
|
||||
|
||||
BO_ 1601 XXX_33: 8 XXX
|
||||
|
||||
BO_ 1633 XXX_34: 8 XXX
|
||||
|
||||
BO_TX_BU_ 228 : NEO,ADAS;
|
||||
BO_TX_BU_ 506 : NEO,ADAS;
|
||||
BO_TX_BU_ 780 : NEO,ADAS;
|
||||
BO_TX_BU_ 829 : NEO,ADAS;
|
||||
BO_TX_BU_ 862 : NEO,ADAS;
|
||||
BO_TX_BU_ 927 : NEO,ADAS;
|
||||
|
||||
|
||||
CM_ SG_ 401 GEAR "10 = reverse, 11 = transition";
|
||||
CM_ SG_ 490 LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
CM_ SG_ 780 CRUISE_SPEED "255 = no speed";
|
||||
CM_ SG_ 804 CRUISE_SPEED_PCM "255 = no speed";
|
||||
CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnngs etc...";
|
||||
VAL_ 399 STEER_STATUS 5 "fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ;
|
||||
VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P" ;
|
||||
VAL_ 450 EPB_STATE 3 "engaged" 2 "disengaging" 1 "engaging" 0 "disengaged" ;
|
||||
VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime" ;
|
||||
VAL_ 662 CRUISE_BUTTONS 7 "tbd" 6 "tbd" 5 "tbd" 4 "accel_res" 3 "decel_set" 2 "cancel" 1 "main" 0 "none" ;
|
||||
VAL_ 662 CRUISE_SETTING 3 "distance_adj" 2 "tbd" 1 "lkas_button" 0 "none" ;
|
||||
VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
|
||||
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
|
||||
VAL_ 806 CMBS_BUTTON 3 "pressed" 0 "released" ;
|
||||
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;
|
||||
VAL_ 927 ACC_ALERTS 29 "esp_active_acc_canceled" 10 "b_pedal_applied" 9 "speed_too_low" 8 "speed_too_high" 7 "p_brake_applied" 6 "gear_no_d" 5 "seatbelt" 4 "too_steep_downhill" 3 "too_steep_uphill" 2 "too_close" 1 "no_vehicle_ahead" ;
|
||||
|
||||
CM_ SG_ 0x1A3 GEAR "10 = reverse, 11 = transition";
|
||||
CM_ SG_ 0x324 CRUISE_SPEED_PCM "255 = no speed";
|
||||
CM_ SG_ 0x30C CRUISE_SPEED "255 = no speed";
|
||||
CM_ SG_ 0x1EA LONG_ACCEL "wheel speed derivative, noisy and zero snapping";
|
||||
CM_ SG_ 0x33D BEEP "beeps are pleasant, chimes are for warnngs etc...";
|
||||
|
||||
@@ -3,19 +3,17 @@
|
||||
# enable wifi access point for debugging only!
|
||||
#service call wifi 37 i32 0 i32 1 # WifiService.setWifiApEnabled(null, true)
|
||||
|
||||
# use the openpilot ro key
|
||||
export GIT_SSH_COMMAND="ssh -i /data/data/com.termux/files/id_rsa_openpilot_ro"
|
||||
|
||||
# check out the openpilot repo
|
||||
# TODO: release branch only
|
||||
if [ ! -d /data/openpilot ]; then
|
||||
cd /tmp
|
||||
git clone git@github.com:commaai/openpilot.git
|
||||
git clone https://github.com/commaai/openpilot.git -b release
|
||||
mv /tmp/openpilot /data/openpilot
|
||||
fi
|
||||
|
||||
# update the openpilot repo
|
||||
# enter openpilot directory
|
||||
cd /data/openpilot
|
||||
|
||||
# automatic update
|
||||
git pull
|
||||
|
||||
# start manager
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEpAIBAAKCAQEAy/ZlYE/iHHjhbSvCnBm5Zsq5GPpVugLXFHai/doqyfRxErop
|
||||
/g1TIRhzK3mkHRYRN7H0L9whogwoIVr5CldoxU49FDnNbVHNimScNrL4LprRWjq6
|
||||
dRmCVoxMpLHZTyX1jIkcHsMr7klcUnssyeQO2pWvZv0ZC67wM7G20r7+ZLdEa0Ck
|
||||
MBh8JYhDaZx2xvYtTnt6vKMmFVE5+zW/+wDVma3a4r9pG9s0+r0wCl8CUuJ+yDhR
|
||||
mzNkPJ5mJCMx99AI6k4Gq9Vsng8/35b6Azh3TucPaXOLK7yPnL3YBKUa0PpR7IRH
|
||||
+OKkVCH+LL7tcPFSqPPVy/pUTBdEUROjJdSHxwIDAQABAoIBAQCxBgUM56h3T89Q
|
||||
AoghFg6dkdu/Ox8GmAp231UuAJncuMUfHObvcj8xXVgwZp4zBIEjFte6ZlPmoqh9
|
||||
8sht2lm7zeEjWdvbQwGjWRlgPEs9n++OYaSNl/tRBOpMk3Ppxydst1/prznE0nVH
|
||||
vVKtU7w0qXAYchm30zj1lQv5s/12CTGmnpQatbo5X488RfCfv2zFX1h+lEWF8ycL
|
||||
eZRi8z6l8h2Y+JLyEwPCmR+gR6XtosZ/ECQcTknavqLqdr7NbYYfOo3JfHCUtpJa
|
||||
8s7m0VFhMuxFFCl1sV0eMzAynJYNVz45DyaKpr2b/2YAGY8fn96FxaWv1xw1xTkK
|
||||
c5+wStwJAoGBAOjQpLZ1qGa4GwXzeHoDsGFpGgY9ug6af0M23c8O42fJHAwYkk7r
|
||||
Qeo4SSBddoSfo3jdchFLo59+m3qyTKpjkph7NBBCEwaCvX3heStDIMZEWX0IOV5y
|
||||
iJD/D6EXSqFmXCUUaudX2OxlaHguA0yOEx9s/5uUJrvaIHbBAOpYyar1AoGBAOBG
|
||||
MJp+EA3e1Zx/VszD2Tdxn8V0DAwvy9WIEqZuG689S/Sk5GnA4m2L8Txv0xAHFvLv
|
||||
JpF7Zn9AoFXGpjf9P0FF53cpjEYn9f+uK84j1HOL/6R7Nj9rcS5yL2PCP1ZHymw6
|
||||
xOXl3oZa1YtYE6jfvXUaOb8Z7y8gaStP763sXmpLAoGBAM1WSBANUcvXES58gIPN
|
||||
ASHJGwTqKFF8/kV//L4EuZjuDWi1u0UTxX0Yy5ZaGI/8ZKfTWCnc9qFTfzoGTAvz
|
||||
6nXGJDM6s6EIaqy90qrPd/amje7y8/ZTOhP4ggZojpAvwZGKoocMOey1vCBTJOG+
|
||||
ZStQbVkAn/EK/5r9uxr12FiJAoGAH9UWlPcLpExamWnhkhLCRAJWoRoFk708+0Pj
|
||||
EchTGZ5jp4e3++KqwM26Ic/lb0LyWOzk1oVjWPB9UW9urEe/sK4RWnKFPHfzjKTW
|
||||
Bt5DC1t1n4z1eC7x05vVah1qC/8IljAJPnBQE1XVNX/82l1XcMWWKK+vqUq6YrFn
|
||||
3ZHNHN0CgYA3uUVWqW37vfJuk0MJBkQSqMo5Y5TPlCt4b1ebkdhlM4v/N+iuiPiC
|
||||
PBhjP1MLeudkJvzllt4YvNWLerCKpMWuw7Zvy5uzFEsqOrVlzfnyWqqqYbYjHe9f
|
||||
Ef0/yXKuGJajs54Ts6Xrm0+elVUu//pEuf6NI96Ehctqz8/BqGqAtw==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
@@ -1,10 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# move files into place
|
||||
adb push files/id_rsa_openpilot_ro /tmp/id_rsa_openpilot_ro
|
||||
adb shell mv /tmp/id_rsa_openpilot_ro /data/data/com.termux/files/
|
||||
|
||||
# moving continue into place runs the continue script
|
||||
adb push files/continue.sh /tmp/continue.sh
|
||||
adb shell mv /tmp/continue.sh /data/data/com.termux/files/
|
||||
|
||||
11
requirements_openpilot.txt
Normal file
11
requirements_openpilot.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
Cython==0.24.1
|
||||
bitstring==3.1.5
|
||||
fastcluster==1.1.21
|
||||
libusb1==1.5.0
|
||||
pycapnp==0.5.9
|
||||
pyzmq==15.4.0
|
||||
raven==5.23.0
|
||||
requests==2.10.0
|
||||
setproctitle==1.1.10
|
||||
simplejson==3.8.2
|
||||
-e git+https://github.com/commaai/le_python.git#egg=Logentries
|
||||
7
run_docker_tests.sh
Executable file
7
run_docker_tests.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
docker build -t tmppilot -f Dockerfile.openpilot .
|
||||
docker run --rm \
|
||||
-v "$(pwd)"/selfdrive/test/plant/out:/tmp/openpilot/selfdrive/test/plant/out \
|
||||
tmppilot /bin/sh -c 'cd /tmp/openpilot/selfdrive/test/plant && ./runtest.sh'
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <sched.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
@@ -27,13 +28,15 @@ libusb_context *ctx = NULL;
|
||||
libusb_device_handle *dev_handle;
|
||||
pthread_mutex_t usb_lock;
|
||||
|
||||
bool spoofing_started = false;
|
||||
|
||||
// double the FIFO size
|
||||
#define RECV_SIZE (0x1000)
|
||||
#define TIMEOUT 0
|
||||
|
||||
#define DEBUG_BOARDD
|
||||
#ifdef DEBUG_BOARDD
|
||||
#define DPRINTF(fmt, ...) printf("boardd: " fmt, ## __VA_ARGS__)
|
||||
#define DPRINTF(fmt, ...) printf("boardd(%lu): " fmt, time(NULL), ## __VA_ARGS__)
|
||||
#else
|
||||
#define DPRINTF(fmt, ...)
|
||||
#endif
|
||||
@@ -126,6 +129,7 @@ void can_health(void *s) {
|
||||
uint8_t started;
|
||||
uint8_t controls_allowed;
|
||||
uint8_t gas_interceptor_detected;
|
||||
uint8_t started_signal_detected;
|
||||
} health;
|
||||
|
||||
// recv from board
|
||||
@@ -147,9 +151,14 @@ void can_health(void *s) {
|
||||
// set fields
|
||||
healthData.setVoltage(health.voltage);
|
||||
healthData.setCurrent(health.current);
|
||||
healthData.setStarted(health.started);
|
||||
if (spoofing_started) {
|
||||
healthData.setStarted(1);
|
||||
} else {
|
||||
healthData.setStarted(health.started);
|
||||
}
|
||||
healthData.setControlsAllowed(health.controls_allowed);
|
||||
healthData.setGasInterceptorDetected(health.gas_interceptor_detected);
|
||||
healthData.setStartedSignalDetected(health.started_signal_detected);
|
||||
|
||||
// send to health
|
||||
auto words = capnp::messageToFlatArray(msg);
|
||||
@@ -177,7 +186,7 @@ void can_send(void *s) {
|
||||
memset(send, 0, msg_count*0x10);
|
||||
|
||||
for (int i = 0; i < msg_count; i++) {
|
||||
auto cmsg = event.getCan()[i];
|
||||
auto cmsg = event.getSendcan()[i];
|
||||
if (cmsg.getAddress() >= 0x800) {
|
||||
// extended
|
||||
send[i*4] = (cmsg.getAddress() << 3) | 5;
|
||||
@@ -262,13 +271,26 @@ void *can_health_thread(void *crap) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int set_realtime_priority(int level) {
|
||||
// should match python using chrt
|
||||
struct sched_param sa;
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sched_priority = level;
|
||||
return sched_setscheduler(getpid(), SCHED_FIFO, &sa);
|
||||
}
|
||||
|
||||
int main() {
|
||||
int err;
|
||||
printf("boardd: starting boardd\n");
|
||||
DPRINTF("starting boardd\n");
|
||||
|
||||
// set process priority
|
||||
err = setpriority(PRIO_PROCESS, 0, -4);
|
||||
printf("boardd: setpriority returns %d\n", err);
|
||||
err = set_realtime_priority(4);
|
||||
DPRINTF("setpriority returns %d\n", err);
|
||||
|
||||
// check the environment
|
||||
if (getenv("STARTED")) {
|
||||
spoofing_started = true;
|
||||
}
|
||||
|
||||
// connect to the board
|
||||
err = libusb_init(&ctx);
|
||||
|
||||
@@ -18,27 +18,25 @@ except Exception:
|
||||
# TODO: rewrite in C to save CPU
|
||||
|
||||
# *** serialization functions ***
|
||||
def can_list_to_can_capnp(can_msgs):
|
||||
def can_list_to_can_capnp(can_msgs, msgtype='can'):
|
||||
dat = messaging.new_message()
|
||||
dat.init('can', len(can_msgs))
|
||||
dat.init(msgtype, len(can_msgs))
|
||||
for i, can_msg in enumerate(can_msgs):
|
||||
dat.can[i].address = can_msg[0]
|
||||
dat.can[i].busTime = can_msg[1]
|
||||
dat.can[i].dat = can_msg[2]
|
||||
dat.can[i].src = can_msg[3]
|
||||
if msgtype == 'sendcan':
|
||||
cc = dat.sendcan[i]
|
||||
else:
|
||||
cc = dat.can[i]
|
||||
cc.address = can_msg[0]
|
||||
cc.busTime = can_msg[1]
|
||||
cc.dat = can_msg[2]
|
||||
cc.src = can_msg[3]
|
||||
return dat
|
||||
|
||||
def can_capnp_to_can_list_old(dat, src_filter=[]):
|
||||
def can_capnp_to_can_list(can, src_filter=None):
|
||||
ret = []
|
||||
for msg in dat.can:
|
||||
if msg.src in src_filter:
|
||||
ret.append([msg.address, msg.busTime, msg.dat.encode("hex")])
|
||||
return ret
|
||||
|
||||
def can_capnp_to_can_list(dat):
|
||||
ret = []
|
||||
for msg in dat.can:
|
||||
ret.append([msg.address, msg.busTime, msg.dat, msg.src])
|
||||
for msg in can:
|
||||
if src_filter is None or msg.src in src_filter:
|
||||
ret.append((msg.address, msg.busTime, msg.dat, msg.src))
|
||||
return ret
|
||||
|
||||
# *** can driver ***
|
||||
@@ -111,7 +109,7 @@ def boardd_mock_loop():
|
||||
|
||||
while 1:
|
||||
tsc = messaging.drain_sock(logcan, wait_for_one=True)
|
||||
snds = map(can_capnp_to_can_list, tsc)
|
||||
snds = map(lambda x: can_capnp_to_can_list(x.can), tsc)
|
||||
snd = []
|
||||
for s in snds:
|
||||
snd += s
|
||||
@@ -164,7 +162,7 @@ def boardd_loop(rate=200):
|
||||
# send can if we have a packet
|
||||
tsc = messaging.recv_sock(sendcan)
|
||||
if tsc is not None:
|
||||
can_send_many(can_capnp_to_can_list(tsc))
|
||||
can_send_many(can_capnp_to_can_list(tsc.sendcan))
|
||||
|
||||
rk.keep_time()
|
||||
|
||||
|
||||
0
selfdrive/car/__init__.py
Normal file
0
selfdrive/car/__init__.py
Normal file
@@ -1,8 +1,12 @@
|
||||
fingerprints = {
|
||||
"ACURA ILX 2016 ACURAWATCH PLUS": {
|
||||
1024L: 5, 513L: 5, 1027L: 5, 1029L: 8, 929L: 4, 1057L: 5, 777L: 8, 1034L: 5, 1036L: 8, 398L: 3, 399L: 7, 145L: 8, 660L: 8, 985L: 3, 923L: 2, 542L: 7, 773L: 7, 800L: 8, 432L: 7, 419L: 8, 420L: 8, 1030L: 5, 422L: 8, 808L: 8, 428L: 8, 304L: 8, 819L: 7, 821L: 5, 57L: 3, 316L: 8, 545L: 4, 464L: 8, 1108L: 8, 597L: 8, 342L: 6, 983L: 8, 344L: 8, 804L: 8, 1039L: 8, 476L: 4, 892L: 8, 490L: 8, 1064L: 7, 882L: 2, 884L: 7, 887L: 8, 888L: 8, 380L: 8, 1365L: 5
|
||||
1024L: 5, 513L: 5, 1027L: 5, 1029L: 8, 929L: 4, 1057L: 5, 777L: 8, 1034L: 5, 1036L: 8, 398L: 3, 399L: 7, 145L: 8, 660L: 8, 985L: 3, 923L: 2, 542L: 7, 773L: 7, 800L: 8, 432L: 7, 419L: 8, 420L: 8, 1030L: 5, 422L: 8, 808L: 8, 428L: 8, 304L: 8, 819L: 7, 821L: 5, 57L: 3, 316L: 8, 545L: 4, 464L: 8, 1108L: 8, 597L: 8, 342L: 6, 983L: 8, 344L: 8, 804L: 8, 1039L: 8, 476L: 4, 892L: 8, 490L: 8, 1064L: 7, 882L: 2, 884L: 7, 887L: 8, 888L: 8, 380L: 8, 1365L: 5,
|
||||
# sent messages
|
||||
0xe4: 5, 0x1fa: 8, 0x200: 3, 0x30c: 8, 0x33d: 4,
|
||||
},
|
||||
"HONDA CIVIC 2016 TOURING": {
|
||||
1024L: 5, 513L: 5, 1027L: 5, 1029L: 8, 777L: 8, 1036L: 8, 1039L: 8, 1424L: 5, 401L: 8, 148L: 8, 662L: 4, 985L: 3, 795L: 8, 773L: 7, 800L: 8, 545L: 6, 420L: 8, 806L: 8, 808L: 8, 1322L: 5, 427L: 3, 428L: 8, 304L: 8, 432L: 7, 57L: 3, 450L: 8, 929L: 8, 330L: 8, 1302L: 8, 464L: 8, 1361L: 5, 1108L: 8, 597L: 8, 470L: 2, 344L: 8, 804L: 8, 399L: 7, 476L: 7, 1633L: 8, 487L: 4, 892L: 8, 490L: 8, 493L: 5, 884L: 8, 891L: 8, 380L: 8, 1365L: 5
|
||||
1024L: 5, 513L: 5, 1027L: 5, 1029L: 8, 777L: 8, 1036L: 8, 1039L: 8, 1424L: 5, 401L: 8, 148L: 8, 662L: 4, 985L: 3, 795L: 8, 773L: 7, 800L: 8, 545L: 6, 420L: 8, 806L: 8, 808L: 8, 1322L: 5, 427L: 3, 428L: 8, 304L: 8, 432L: 7, 57L: 3, 450L: 8, 929L: 8, 330L: 8, 1302L: 8, 464L: 8, 1361L: 5, 1108L: 8, 597L: 8, 470L: 2, 344L: 8, 804L: 8, 399L: 7, 476L: 7, 1633L: 8, 487L: 4, 892L: 8, 490L: 8, 493L: 5, 884L: 8, 891L: 8, 380L: 8, 1365L: 5,
|
||||
# sent messages
|
||||
0xe4: 5, 0x1fa: 8, 0x200: 3, 0x30c: 8, 0x33d: 5, 0x35e: 8, 0x39f: 8,
|
||||
}
|
||||
}
|
||||
0
selfdrive/car/honda/__init__.py
Normal file
0
selfdrive/car/honda/__init__.py
Normal file
@@ -2,7 +2,7 @@ import os
|
||||
import dbcs
|
||||
from collections import defaultdict
|
||||
|
||||
from selfdrive.controls.lib.hondacan import fix
|
||||
from selfdrive.car.honda.hondacan import fix
|
||||
from common.realtime import sec_since_boot
|
||||
from common.dbc import dbc
|
||||
|
||||
@@ -59,22 +59,22 @@ class CANParser(object):
|
||||
cn_vl_max = 5 # no more than 5 wrong counter checks
|
||||
|
||||
# we are subscribing to PID_XXX, else data from USB
|
||||
for msg, ts, cdat in can_recv:
|
||||
for msg, ts, cdat, _ in can_recv:
|
||||
idxs = self._message_indices[msg]
|
||||
if idxs:
|
||||
self.msgs_upd += [msg]
|
||||
self.msgs_upd.append(msg)
|
||||
# read the entire message
|
||||
out = self.can_dbc.decode([msg, 0, cdat])[1]
|
||||
out = self.can_dbc.decode((msg, 0, cdat))[1]
|
||||
# checksum check
|
||||
self.ck[msg] = True
|
||||
if "CHECKSUM" in out.keys() and msg in self.msgs_ck:
|
||||
# remove checksum (half byte)
|
||||
ck_portion = (''.join((cdat[:-1], '0'))).decode('hex')
|
||||
ck_portion = cdat[:-1] + chr(ord(cdat[-1]) & 0xF0)
|
||||
# recalculate checksum
|
||||
msg_vl = fix(ck_portion, msg)
|
||||
# compare recalculated vs received checksum
|
||||
if msg_vl != cdat.decode('hex'):
|
||||
print hex(msg), "CHECKSUM FAIL"
|
||||
if msg_vl != cdat:
|
||||
print "CHECKSUM FAIL: " + hex(msg)
|
||||
self.ck[msg] = False
|
||||
self.ok[msg] = False
|
||||
# counter check
|
||||
@@ -89,6 +89,7 @@ class CANParser(object):
|
||||
self.cn_vl[msg] -= 1 # counter check passed
|
||||
# message status is invalid if we received too many wrong counter values
|
||||
if self.cn_vl[msg] >= cn_vl_max:
|
||||
print "COUNTER WRONG: " + hex(msg)
|
||||
self.ok[msg] = False
|
||||
|
||||
# update msg time stamps and counter value
|
||||
@@ -112,7 +113,7 @@ class CANParser(object):
|
||||
# assess overall can validity: if there is one relevant message invalid, then set can validity flag to False
|
||||
self.can_valid = True
|
||||
if False in self.ok.values():
|
||||
print "CAN INVALID!"
|
||||
#print "CAN INVALID!"
|
||||
self.can_valid = False
|
||||
|
||||
def _check_dead_msgs(self):
|
||||
@@ -1,25 +1,54 @@
|
||||
from collections import namedtuple
|
||||
|
||||
import common.numpy_fast as np
|
||||
import selfdrive.controls.lib.hondacan as hondacan
|
||||
from common.realtime import sec_since_boot
|
||||
from selfdrive.config import CruiseButtons
|
||||
from selfdrive.boardd.boardd import can_list_to_can_capnp
|
||||
from selfdrive.controls.lib.alert_database import process_hud_alert
|
||||
from selfdrive.controls.lib.drive_helpers import actuator_hystereses, rate_limit
|
||||
|
||||
class AH:
|
||||
#[alert_idx, value]
|
||||
# See dbc files for info on values"
|
||||
NONE = [0, 0]
|
||||
FCW = [1, 0x8]
|
||||
STEER = [2, 1]
|
||||
BRAKE_PRESSED = [3, 10]
|
||||
GEAR_NOT_D = [4, 6]
|
||||
SEATBELT = [5, 5]
|
||||
SPEED_TOO_HIGH = [6, 8]
|
||||
|
||||
|
||||
def process_hud_alert(hud_alert):
|
||||
# initialize to no alert
|
||||
fcw_display = 0
|
||||
steer_required = 0
|
||||
acc_alert = 0
|
||||
if hud_alert == AH.NONE: # no alert
|
||||
pass
|
||||
elif hud_alert == AH.FCW: # FCW
|
||||
fcw_display = hud_alert[1]
|
||||
elif hud_alert == AH.STEER: # STEER
|
||||
steer_required = hud_alert[1]
|
||||
else: # any other ACC alert
|
||||
acc_alert = hud_alert[1]
|
||||
|
||||
return fcw_display, steer_required, acc_alert
|
||||
|
||||
import selfdrive.car.honda.hondacan as hondacan
|
||||
|
||||
HUDData = namedtuple("HUDData",
|
||||
["pcm_accel", "v_cruise", "X2", "car", "X4", "X5",
|
||||
"lanes", "beep", "X8", "chime", "acc_alert"])
|
||||
|
||||
class CarController(object):
|
||||
def __init__(self):
|
||||
self.controls_allowed = False
|
||||
self.mismatch_start, self.pcm_mismatch_start = 0, 0
|
||||
self.braking = False
|
||||
self.brake_steady = 0.
|
||||
self.final_brake_last = 0.
|
||||
|
||||
# redundant safety check with the board
|
||||
self.controls_allowed = False
|
||||
|
||||
def update(self, sendcan, enabled, CS, frame, final_gas, final_brake, final_steer, \
|
||||
pcm_speed, pcm_override, pcm_cancel_cmd, pcm_accel, \
|
||||
hud_v_cruise, hud_show_lanes, hud_show_car, hud_alert, \
|
||||
@@ -61,9 +90,9 @@ class CarController(object):
|
||||
#print chime, alert_id, hud_alert
|
||||
fcw_display, steer_required, acc_alert = process_hud_alert(hud_alert)
|
||||
|
||||
hud = HUDData(pcm_accel, hud_v_cruise, 0x41, hud_car,
|
||||
hud = HUDData(int(pcm_accel), int(hud_v_cruise), 0x41, hud_car,
|
||||
0xc1, 0x41, hud_lanes + steer_required,
|
||||
snd_beep, 0x48, (snd_chime << 5) + fcw_display, acc_alert)
|
||||
int(snd_beep), 0x48, (snd_chime << 5) + fcw_display, acc_alert)
|
||||
|
||||
if not all(isinstance(x, int) and 0 <= x < 256 for x in hud):
|
||||
print "INVALID HUD", hud
|
||||
@@ -71,14 +100,11 @@ class CarController(object):
|
||||
|
||||
# **** process the car messages ****
|
||||
|
||||
user_brake_ctrl = CS.user_brake/0.015625 # FIXME: factor needed to convert to old scale
|
||||
|
||||
# *** compute control surfaces ***
|
||||
tt = sec_since_boot()
|
||||
GAS_MAX = 1004
|
||||
BRAKE_MAX = 1024/4
|
||||
#STEER_MAX = 0xF00 if not CS.torque_mod else 0xF00/4 # ilx has 8x steering torque limit, used as a 2x
|
||||
STEER_MAX = 0xF00 # ilx has 8x steering torque limit, used as a 2x
|
||||
STEER_MAX = 0xF00
|
||||
GAS_OFFSET = 328
|
||||
|
||||
# steer torque is converted back to CAN reference (positive when steering right)
|
||||
@@ -87,51 +113,37 @@ class CarController(object):
|
||||
apply_steer = int(np.clip(-final_steer*STEER_MAX, -STEER_MAX, STEER_MAX))
|
||||
|
||||
# no gas if you are hitting the brake or the user is
|
||||
if apply_gas > 0 and (apply_brake != 0 or user_brake_ctrl > 10):
|
||||
print "CANCELLING GAS", apply_brake, user_brake_ctrl
|
||||
if apply_gas > 0 and (apply_brake != 0 or CS.brake_pressed):
|
||||
print "CANCELLING GAS", apply_brake
|
||||
apply_gas = 0
|
||||
|
||||
# no computer brake if the user is hitting the gas
|
||||
# if the computer is trying to brake, it can't be hitting the gas
|
||||
# TODO: car_gas can override brakes without canceling... this is bad
|
||||
# no computer brake if the gas is being pressed
|
||||
if CS.car_gas > 0 and apply_brake != 0:
|
||||
print "CANCELLING BRAKE"
|
||||
apply_brake = 0
|
||||
|
||||
# any other cp.vl[0x18F]['STEER_STATUS'] is common and can happen during user override. sending 0 torque to avoid EPS sending error 5
|
||||
if CS.steer_not_allowed:
|
||||
print "STEER ALERT, TORQUE INHIBITED"
|
||||
apply_steer = 0
|
||||
|
||||
# *** entry into controls state ***
|
||||
if (CS.prev_cruise_buttons == CruiseButtons.DECEL_SET or CS.prev_cruise_buttons == CruiseButtons.RES_ACCEL) and \
|
||||
CS.cruise_buttons == 0 and not self.controls_allowed:
|
||||
print "CONTROLS ARE LIVE"
|
||||
self.controls_allowed = True
|
||||
|
||||
# to avoid race conditions, check if control has been disabled for at least 0.2s
|
||||
# keep resetting start timer if mismatch isn't true
|
||||
if not (self.controls_allowed and not enabled):
|
||||
self.mismatch_start = tt
|
||||
|
||||
# to avoid race conditions, check if control is disabled but pcm control is on for at least 0.2s
|
||||
if not (not self.controls_allowed and CS.pcm_acc_status):
|
||||
self.pcm_mismatch_start = tt
|
||||
|
||||
# something is very wrong, since pcm control is active but controls should not be allowed; TODO: send pcm fault cmd?
|
||||
if (tt - self.pcm_mismatch_start) > 0.2:
|
||||
pcm_cancel_cmd = True
|
||||
|
||||
# TODO: clean up gear condition, ideally only D (and P for debug) shall be valid gears
|
||||
# *** exit from controls state on cancel, gas, or brake ***
|
||||
if (CS.cruise_buttons == CruiseButtons.CANCEL or CS.brake_pressed or
|
||||
CS.user_gas_pressed or (tt - self.mismatch_start) > 0.2 or
|
||||
not CS.main_on or not CS.gear_shifter_valid or
|
||||
(CS.pedal_gas > 0 and CS.brake_only)) and self.controls_allowed:
|
||||
CS.user_gas_pressed or (CS.pedal_gas > 0 and CS.brake_only)) and self.controls_allowed:
|
||||
print "CONTROLS ARE DEAD"
|
||||
self.controls_allowed = False
|
||||
|
||||
# 5 is a permanent fault, no torque request will be fullfilled
|
||||
# *** controls fail on steer error, brake error, or invalid can ***
|
||||
if CS.steer_error:
|
||||
print "STEER ERROR"
|
||||
self.controls_allowed = False
|
||||
|
||||
# any other cp.vl[0x18F]['STEER_STATUS'] is common and can happen during user override. sending 0 torque to avoid EPS sending error 5
|
||||
elif CS.steer_not_allowed:
|
||||
print "STEER ALERT, TORQUE INHIBITED"
|
||||
apply_steer = 0
|
||||
|
||||
if CS.brake_error:
|
||||
print "BRAKE ERROR"
|
||||
self.controls_allowed = False
|
||||
@@ -140,13 +152,6 @@ class CarController(object):
|
||||
print "CAN INVALID"
|
||||
self.controls_allowed = False
|
||||
|
||||
if not self.controls_allowed:
|
||||
apply_steer = 0
|
||||
apply_gas = 0
|
||||
apply_brake = 0
|
||||
pcm_speed = 0 # make sure you send 0 target speed to pcm
|
||||
#pcm_cancel_cmd = 1 # prevent pcm control from turning on. FIXME: we can't just do this
|
||||
|
||||
# Send CAN commands.
|
||||
can_sends = []
|
||||
|
||||
@@ -160,7 +165,6 @@ class CarController(object):
|
||||
can_sends.append(
|
||||
hondacan.create_brake_command(apply_brake, pcm_override,
|
||||
pcm_cancel_cmd, hud.chime, idx))
|
||||
|
||||
if not CS.brake_only:
|
||||
# send exactly zero if apply_gas is zero. Interceptor will send the max between read value and apply_gas.
|
||||
# This prevents unexpected pedal range rescaling
|
||||
@@ -182,4 +186,5 @@ class CarController(object):
|
||||
idx = (frame/radar_send_step) % 4
|
||||
can_sends.extend(hondacan.create_radar_commands(CS.v_ego, CS.civic, idx))
|
||||
|
||||
sendcan.send(can_list_to_can_capnp(can_sends).to_bytes())
|
||||
sendcan.send(can_list_to_can_capnp(can_sends, msgtype='sendcan').to_bytes())
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import numpy as np
|
||||
|
||||
import selfdrive.messaging as messaging
|
||||
from selfdrive.boardd.boardd import can_capnp_to_can_list_old, can_capnp_to_can_list
|
||||
from selfdrive.controls.lib.can_parser import CANParser
|
||||
from selfdrive.controls.lib.fingerprints import fingerprints
|
||||
from selfdrive.boardd.boardd import can_capnp_to_can_list
|
||||
from selfdrive.config import VehicleParams
|
||||
from common.realtime import sec_since_boot
|
||||
|
||||
from selfdrive.car.fingerprints import fingerprints
|
||||
from selfdrive.car.honda.can_parser import CANParser
|
||||
|
||||
def get_can_parser(civic, brake_only):
|
||||
# this function generates lists for signal, messages and initial values
|
||||
@@ -46,6 +46,7 @@ def get_can_parser(civic, brake_only):
|
||||
("LEFT_BLINKER", 0x326, 0),
|
||||
("RIGHT_BLINKER", 0x326, 0),
|
||||
("COUNTER", 0x324, 0),
|
||||
("ENGINE_RPM", 0x17C, 0)
|
||||
]
|
||||
checks = [
|
||||
(0x14a, 100),
|
||||
@@ -97,6 +98,7 @@ def get_can_parser(civic, brake_only):
|
||||
("LEFT_BLINKER", 0x294, 0),
|
||||
("RIGHT_BLINKER", 0x294, 0),
|
||||
("COUNTER", 0x324, 0),
|
||||
("ENGINE_RPM", 0x17C, 0)
|
||||
]
|
||||
checks = [
|
||||
(0x156, 100),
|
||||
@@ -130,7 +132,7 @@ def fingerprint(logcan):
|
||||
for a in messaging.drain_sock(logcan, wait_for_one=True):
|
||||
if st is None:
|
||||
st = sec_since_boot()
|
||||
for adr, _, msg, idx in can_capnp_to_can_list(a):
|
||||
for adr, _, msg, idx in can_capnp_to_can_list(a.can):
|
||||
# pedal
|
||||
if adr == 0x201 and idx == 0:
|
||||
brake_only = False
|
||||
@@ -153,6 +155,7 @@ def fingerprint(logcan):
|
||||
if len(possible_cars) == 1 and st is not None and (sec_since_boot()-st) > 0.1:
|
||||
break
|
||||
elif len(possible_cars) == 0:
|
||||
print finger
|
||||
raise Exception("car doesn't match any fingerprints")
|
||||
|
||||
print "fingerprinted", possible_cars[0]
|
||||
@@ -183,6 +186,9 @@ class CarState(object):
|
||||
self.cruise_setting = 0
|
||||
self.blinker_on = 0
|
||||
|
||||
self.left_blinker_on = 0
|
||||
self.right_blinker_on = 0
|
||||
|
||||
# TODO: actually make this work
|
||||
self.a_ego = 0.
|
||||
|
||||
@@ -190,16 +196,9 @@ class CarState(object):
|
||||
self.ui_speed_fudge = 1.01 if self.civic else 1.025
|
||||
|
||||
# load vehicle params
|
||||
self.VP = VehicleParams(self.civic)
|
||||
|
||||
def update(self, logcan):
|
||||
# ******************* do can recv *******************
|
||||
can_pub_main = []
|
||||
canMonoTimes = []
|
||||
for a in messaging.drain_sock(logcan):
|
||||
canMonoTimes.append(a.logMonoTime)
|
||||
can_pub_main.extend(can_capnp_to_can_list_old(a, [0,2]))
|
||||
self.VP = VehicleParams(self.civic, self.brake_only, self.torque_mod)
|
||||
|
||||
def update(self, can_pub_main):
|
||||
cp = self.cp
|
||||
cp.update_can(can_pub_main)
|
||||
|
||||
@@ -215,6 +214,11 @@ class CarState(object):
|
||||
self.prev_cruise_setting = self.cruise_setting
|
||||
self.prev_blinker_on = self.blinker_on
|
||||
|
||||
self.prev_left_blinker_on = self.left_blinker_on
|
||||
self.prev_right_blinker_on = self.right_blinker_on
|
||||
|
||||
self.rpm = cp.vl[0x17C]['ENGINE_RPM']
|
||||
|
||||
# ******************* parse out can *******************
|
||||
self.door_all_closed = not any([cp.vl[0x405]['DOOR_OPEN_FL'], cp.vl[0x405]['DOOR_OPEN_FR'],
|
||||
cp.vl[0x405]['DOOR_OPEN_RL'], cp.vl[0x405]['DOOR_OPEN_RR']])
|
||||
@@ -252,6 +256,8 @@ class CarState(object):
|
||||
self.main_on = cp.vl[0x326]['MAIN_ON']
|
||||
self.gear_shifter_valid = self.gear_shifter in [1,8] # TODO: 1/P allowed for debug
|
||||
self.blinker_on = cp.vl[0x326]['LEFT_BLINKER'] or cp.vl[0x326]['RIGHT_BLINKER']
|
||||
self.left_blinker_on = cp.vl[0x326]['LEFT_BLINKER']
|
||||
self.right_blinker_on = cp.vl[0x326]['RIGHT_BLINKER']
|
||||
else:
|
||||
self.gear_shifter = cp.vl[0x1A3]['GEAR_SHIFTER']
|
||||
self.angle_steers = cp.vl[0x156]['STEER_ANGLE']
|
||||
@@ -261,6 +267,8 @@ class CarState(object):
|
||||
self.main_on = cp.vl[0x1A6]['MAIN_ON']
|
||||
self.gear_shifter_valid = self.gear_shifter in [1,4] # TODO: 1/P allowed for debug
|
||||
self.blinker_on = cp.vl[0x294]['LEFT_BLINKER'] or cp.vl[0x294]['RIGHT_BLINKER']
|
||||
self.left_blinker_on = cp.vl[0x294]['LEFT_BLINKER']
|
||||
self.right_blinker_on = cp.vl[0x294]['RIGHT_BLINKER']
|
||||
self.car_gas = cp.vl[0x130]['CAR_GAS']
|
||||
self.brake_pressed = cp.vl[0x17C]['BRAKE_PRESSED']
|
||||
self.user_brake = cp.vl[0x1A4]['USER_BRAKE']
|
||||
@@ -272,4 +280,3 @@ class CarState(object):
|
||||
self.hud_lead = cp.vl[0x30C]['HUD_LEAD']
|
||||
self.counter_pcm = cp.vl[0x324]['COUNTER']
|
||||
|
||||
return canMonoTimes
|
||||
238
selfdrive/car/honda/interface.py
Executable file
238
selfdrive/car/honda/interface.py
Executable file
@@ -0,0 +1,238 @@
|
||||
#!/usr/bin/env python
|
||||
import time
|
||||
import numpy as np
|
||||
|
||||
from selfdrive.config import Conversions as CV
|
||||
from selfdrive.car.honda.carstate import CarState
|
||||
from selfdrive.car.honda.carcontroller import CarController, AH
|
||||
from selfdrive.boardd.boardd import can_capnp_to_can_list
|
||||
|
||||
from cereal import car
|
||||
|
||||
import zmq
|
||||
from common.services import service_list
|
||||
import selfdrive.messaging as messaging
|
||||
|
||||
# Car button codes
|
||||
class CruiseButtons:
|
||||
RES_ACCEL = 4
|
||||
DECEL_SET = 3
|
||||
CANCEL = 2
|
||||
MAIN = 1
|
||||
|
||||
#car chimes: enumeration from dbc file. Chimes are for alerts and warnings
|
||||
class CM:
|
||||
MUTE = 0
|
||||
SINGLE = 3
|
||||
DOUBLE = 4
|
||||
REPEATED = 1
|
||||
CONTINUOUS = 2
|
||||
|
||||
#car beepss: enumeration from dbc file. Beeps are for activ and deactiv
|
||||
class BP:
|
||||
MUTE = 0
|
||||
SINGLE = 3
|
||||
TRIPLE = 2
|
||||
REPEATED = 1
|
||||
|
||||
|
||||
class CarInterface(object):
|
||||
def __init__(self, read_only=False):
|
||||
context = zmq.Context()
|
||||
self.logcan = messaging.sub_sock(context, service_list['can'].port)
|
||||
|
||||
self.frame = 0
|
||||
self.can_invalid_count = 0
|
||||
|
||||
# *** init the major players ***
|
||||
self.CS = CarState(self.logcan)
|
||||
|
||||
# sending if read only is False
|
||||
if not read_only:
|
||||
self.sendcan = messaging.pub_sock(context, service_list['sendcan'].port)
|
||||
self.CC = CarController()
|
||||
|
||||
def getVehicleParams(self):
|
||||
return self.CS.VP
|
||||
|
||||
# returns a car.CarState
|
||||
def update(self):
|
||||
# ******************* do can recv *******************
|
||||
can_pub_main = []
|
||||
canMonoTimes = []
|
||||
for a in messaging.drain_sock(self.logcan):
|
||||
canMonoTimes.append(a.logMonoTime)
|
||||
can_pub_main.extend(can_capnp_to_can_list(a.can, [0,2]))
|
||||
self.CS.update(can_pub_main)
|
||||
|
||||
# create message
|
||||
ret = car.CarState.new_message()
|
||||
|
||||
# speeds
|
||||
ret.vEgo = self.CS.v_ego
|
||||
ret.wheelSpeeds.fl = self.CS.cp.vl[0x1D0]['WHEEL_SPEED_FL']
|
||||
ret.wheelSpeeds.fr = self.CS.cp.vl[0x1D0]['WHEEL_SPEED_FR']
|
||||
ret.wheelSpeeds.rl = self.CS.cp.vl[0x1D0]['WHEEL_SPEED_RL']
|
||||
ret.wheelSpeeds.rr = self.CS.cp.vl[0x1D0]['WHEEL_SPEED_RR']
|
||||
|
||||
# gas pedal
|
||||
ret.gas = self.CS.car_gas / 256.0
|
||||
if self.CS.VP.brake_only:
|
||||
ret.gasPressed = self.CS.pedal_gas > 0
|
||||
else:
|
||||
ret.gasPressed = self.CS.user_gas_pressed
|
||||
|
||||
# brake pedal
|
||||
ret.brake = self.CS.user_brake
|
||||
ret.brakePressed = self.CS.brake_pressed != 0
|
||||
|
||||
# steering wheel
|
||||
# TODO: units
|
||||
ret.steeringAngle = self.CS.angle_steers
|
||||
ret.steeringTorque = self.CS.cp.vl[0x18F]['STEER_TORQUE_SENSOR']
|
||||
ret.steeringPressed = self.CS.steer_override
|
||||
|
||||
# cruise state
|
||||
ret.cruiseState.enabled = self.CS.pcm_acc_status != 0
|
||||
ret.cruiseState.speed = self.CS.v_cruise_pcm * CV.KPH_TO_MS
|
||||
|
||||
# TODO: button presses
|
||||
buttonEvents = []
|
||||
|
||||
if self.CS.left_blinker_on != self.CS.prev_left_blinker_on:
|
||||
be = car.CarState.ButtonEvent.new_message()
|
||||
be.type = 'leftBlinker'
|
||||
be.pressed = self.CS.left_blinker_on != 0
|
||||
buttonEvents.append(be)
|
||||
|
||||
if self.CS.right_blinker_on != self.CS.prev_right_blinker_on:
|
||||
be = car.CarState.ButtonEvent.new_message()
|
||||
be.type = 'rightBlinker'
|
||||
be.pressed = self.CS.right_blinker_on != 0
|
||||
buttonEvents.append(be)
|
||||
|
||||
if self.CS.cruise_buttons != self.CS.prev_cruise_buttons:
|
||||
be = car.CarState.ButtonEvent.new_message()
|
||||
be.type = 'unknown'
|
||||
if self.CS.cruise_buttons != 0:
|
||||
be.pressed = True
|
||||
but = self.CS.cruise_buttons
|
||||
else:
|
||||
be.pressed = False
|
||||
but = self.CS.prev_cruise_buttons
|
||||
if but == CruiseButtons.RES_ACCEL:
|
||||
be.type = 'accelCruise'
|
||||
elif but == CruiseButtons.DECEL_SET:
|
||||
be.type = 'decelCruise'
|
||||
elif but == CruiseButtons.CANCEL:
|
||||
be.type = 'cancel'
|
||||
elif but == CruiseButtons.MAIN:
|
||||
be.type = 'altButton3'
|
||||
buttonEvents.append(be)
|
||||
|
||||
if self.CS.cruise_setting != self.CS.prev_cruise_setting:
|
||||
be = car.CarState.ButtonEvent.new_message()
|
||||
be.type = 'unknown'
|
||||
if self.CS.cruise_setting != 0:
|
||||
be.pressed = True
|
||||
but = self.CS.cruise_setting
|
||||
else:
|
||||
be.pressed = False
|
||||
but = self.CS.prev_cruise_setting
|
||||
if but == 1:
|
||||
be.type = 'altButton1'
|
||||
# TODO: more buttons?
|
||||
buttonEvents.append(be)
|
||||
ret.buttonEvents = buttonEvents
|
||||
|
||||
# errors
|
||||
# TODO: I don't like the way capnp does enums
|
||||
# These strings aren't checked at compile time
|
||||
errors = []
|
||||
if not self.CS.can_valid:
|
||||
self.can_invalid_count += 1
|
||||
if self.can_invalid_count >= 5:
|
||||
errors.append('commIssue')
|
||||
else:
|
||||
self.can_invalid_count = 0
|
||||
if self.CS.steer_error:
|
||||
errors.append('steerUnavailable')
|
||||
elif self.CS.steer_not_allowed:
|
||||
errors.append('steerTemporarilyUnavailable')
|
||||
if self.CS.brake_error:
|
||||
errors.append('brakeUnavailable')
|
||||
if not self.CS.gear_shifter_valid:
|
||||
errors.append('wrongGear')
|
||||
if not self.CS.door_all_closed:
|
||||
errors.append('doorOpen')
|
||||
if not self.CS.seatbelt:
|
||||
errors.append('seatbeltNotLatched')
|
||||
if self.CS.esp_disabled:
|
||||
errors.append('espDisabled')
|
||||
if not self.CS.main_on:
|
||||
errors.append('wrongCarMode')
|
||||
if self.CS.gear_shifter == 2:
|
||||
errors.append('reverseGear')
|
||||
|
||||
ret.errors = errors
|
||||
ret.canMonoTimes = canMonoTimes
|
||||
|
||||
# cast to reader so it can't be modified
|
||||
#print ret
|
||||
return ret.as_reader()
|
||||
|
||||
# pass in a car.CarControl
|
||||
# to be called @ 100hz
|
||||
def apply(self, c):
|
||||
#print c
|
||||
|
||||
if c.hudControl.speedVisible:
|
||||
hud_v_cruise = c.hudControl.setSpeed * CV.MS_TO_KPH
|
||||
else:
|
||||
hud_v_cruise = 255
|
||||
|
||||
hud_alert = {
|
||||
"none": AH.NONE,
|
||||
"fcw": AH.FCW,
|
||||
"steerRequired": AH.STEER,
|
||||
"brakePressed": AH.BRAKE_PRESSED,
|
||||
"wrongGear": AH.GEAR_NOT_D,
|
||||
"seatbeltUnbuckled": AH.SEATBELT,
|
||||
"speedTooHigh": AH.SPEED_TOO_HIGH}[str(c.hudControl.visualAlert)]
|
||||
|
||||
snd_beep, snd_chime = {
|
||||
"none": (BP.MUTE, CM.MUTE),
|
||||
"beepSingle": (BP.SINGLE, CM.MUTE),
|
||||
"beepTriple": (BP.TRIPLE, CM.MUTE),
|
||||
"beepRepeated": (BP.REPEATED, CM.MUTE),
|
||||
"chimeSingle": (BP.MUTE, CM.SINGLE),
|
||||
"chimeDouble": (BP.MUTE, CM.DOUBLE),
|
||||
"chimeRepeated": (BP.MUTE, CM.REPEATED),
|
||||
"chimeContinuous": (BP.MUTE, CM.CONTINUOUS)}[str(c.hudControl.audibleAlert)]
|
||||
|
||||
pcm_accel = int(np.clip(c.cruiseControl.accelOverride/1.4,0,1)*0xc6)
|
||||
|
||||
self.CC.update(self.sendcan, c.enabled, self.CS, self.frame, \
|
||||
c.gas, c.brake, c.steeringTorque, \
|
||||
c.cruiseControl.speedOverride, \
|
||||
c.cruiseControl.override, \
|
||||
c.cruiseControl.cancel, \
|
||||
pcm_accel, \
|
||||
hud_v_cruise, c.hudControl.lanesVisible, \
|
||||
hud_show_car = c.hudControl.leadVisible, \
|
||||
hud_alert = hud_alert, \
|
||||
snd_beep = snd_beep, \
|
||||
snd_chime = snd_chime)
|
||||
|
||||
self.frame += 1
|
||||
return not (c.enabled and not self.CC.controls_allowed)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
CI = CarInterface(read_only=True)
|
||||
while 1:
|
||||
cs = CI.update()
|
||||
print(chr(27) + "[2J")
|
||||
print cs
|
||||
time.sleep(0.1)
|
||||
|
||||
1
selfdrive/common/version.h
Normal file
1
selfdrive/common/version.h
Normal file
@@ -0,0 +1 @@
|
||||
const char *openpilot_version = "0.2.3";
|
||||
@@ -57,12 +57,18 @@ class UIParams:
|
||||
car_color = 110
|
||||
|
||||
class VehicleParams:
|
||||
def __init__(self, civic):
|
||||
def __init__(self, civic, brake_only=False, torque_mod=False):
|
||||
if civic:
|
||||
self.wheelbase = 2.67
|
||||
self.steer_ratio = 15.3
|
||||
self.slip_factor = 0.0014
|
||||
self.civic = True
|
||||
else:
|
||||
self.wheelbase = 2.67 # from http://www.edmunds.com/acura/ilx/2016/sedan/features-specs/
|
||||
self.steer_ratio = 15.3 # from http://www.edmunds.com/acura/ilx/2016/road-test-specs/
|
||||
self.slip_factor = 0.0014
|
||||
self.civic = False
|
||||
self.brake_only = brake_only
|
||||
self.torque_mod = torque_mod
|
||||
self.ui_speed_fudge = 1.01 if self.civic else 1.025
|
||||
|
||||
|
||||
@@ -1,234 +1,221 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
import zmq
|
||||
import numpy as np
|
||||
|
||||
from common.services import service_list
|
||||
from common.realtime import sec_since_boot, set_realtime_priority, Ratekeeper
|
||||
|
||||
from selfdrive.config import CruiseButtons
|
||||
from selfdrive.config import Conversions as CV
|
||||
|
||||
from selfdrive.controls.lib.drive_helpers import learn_angle_offset
|
||||
from selfdrive.controls.lib.alert_database import process_alert, AI
|
||||
|
||||
import selfdrive.messaging as messaging
|
||||
|
||||
from selfdrive.controls.lib.carstate import CarState
|
||||
from selfdrive.controls.lib.carcontroller import CarController
|
||||
from cereal import car
|
||||
|
||||
from common.numpy_fast import clip
|
||||
|
||||
from selfdrive.config import Conversions as CV
|
||||
from common.services import service_list
|
||||
from common.realtime import sec_since_boot, set_realtime_priority, Ratekeeper
|
||||
from common.profiler import Profiler
|
||||
|
||||
from selfdrive.controls.lib.drive_helpers import learn_angle_offset
|
||||
|
||||
from selfdrive.controls.lib.longcontrol import LongControl
|
||||
from selfdrive.controls.lib.latcontrol import LatControl
|
||||
|
||||
from selfdrive.controls.lib.pathplanner import PathPlanner
|
||||
from selfdrive.controls.lib.adaptivecruise import AdaptiveCruise
|
||||
|
||||
from selfdrive.controls.lib.alertmanager import AlertManager
|
||||
|
||||
car_type = os.getenv("CAR")
|
||||
if car_type is not None:
|
||||
exec('from selfdrive.car.'+car_type+'.interface import CarInterface')
|
||||
else:
|
||||
from selfdrive.car.honda.interface import CarInterface
|
||||
|
||||
V_CRUISE_MAX = 144
|
||||
V_CRUISE_MIN = 8
|
||||
V_CRUISE_DELTA = 8
|
||||
V_CRUISE_ENABLE_MIN = 40
|
||||
|
||||
def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
# *** log ***
|
||||
context = zmq.Context()
|
||||
live100 = messaging.pub_sock(context, service_list['live100'].port)
|
||||
|
||||
thermal = messaging.sub_sock(context, service_list['thermal'].port)
|
||||
live20 = messaging.sub_sock(context, service_list['live20'].port)
|
||||
model = messaging.sub_sock(context, service_list['model'].port)
|
||||
health = messaging.sub_sock(context, service_list['health'].port)
|
||||
|
||||
logcan = messaging.sub_sock(context, service_list['can'].port)
|
||||
sendcan = messaging.pub_sock(context, service_list['sendcan'].port)
|
||||
|
||||
# *** init the major players ***
|
||||
CS = CarState(logcan)
|
||||
CC = CarController()
|
||||
# connects to can and sendcan
|
||||
CI = CarInterface()
|
||||
VP = CI.getVehicleParams()
|
||||
|
||||
PP = PathPlanner(model)
|
||||
AC = AdaptiveCruise(live20)
|
||||
|
||||
AM = AlertManager()
|
||||
|
||||
LoC = LongControl()
|
||||
LaC = LatControl()
|
||||
|
||||
# *** control initial values ***
|
||||
apply_brake = 0
|
||||
# controls enabled state
|
||||
enabled = False
|
||||
last_enable_request = 0
|
||||
|
||||
# *** time values ***
|
||||
last_enable_pressed = 0
|
||||
|
||||
# *** controls initial values ***
|
||||
# *** display stuff
|
||||
soft_disable_start = 0
|
||||
sounding = False
|
||||
no_mismatch_pcm_last, no_mismatch_ctrl_last = 0, 0
|
||||
|
||||
# car state
|
||||
alert, sound_exp, hud_exp, text_exp, alert_p = None, 0, 0, 0, 0
|
||||
rear_view_cam, rear_view_toggle = False, False
|
||||
|
||||
v_cruise = 255 # this means no display
|
||||
v_cruise_max = 144
|
||||
v_cruise_min = 8
|
||||
v_cruise_delta = 8
|
||||
|
||||
# on activation target at least 25mph. With 5mph you need too much tapping
|
||||
v_cruise_enable_min = 40
|
||||
|
||||
hud_v_cruise = 255
|
||||
|
||||
# learned angle offset
|
||||
angle_offset = 0
|
||||
|
||||
max_enable_speed = 57. # ~91 mph
|
||||
# rear view camera state
|
||||
rear_view_toggle = False
|
||||
|
||||
pcm_threshold = 25.*CV.MPH_TO_MS # below this speed pcm cancels
|
||||
|
||||
overtemp = True
|
||||
v_cruise_kph = 255
|
||||
|
||||
# 0.0 - 1.0
|
||||
awareness_status = 0.0
|
||||
|
||||
soft_disable_timer = None
|
||||
|
||||
# Is cpu temp too high to enable?
|
||||
overtemp = False
|
||||
free_space = 1.0
|
||||
|
||||
# start the loop
|
||||
set_realtime_priority(2)
|
||||
|
||||
rk = Ratekeeper(rate)
|
||||
rk = Ratekeeper(rate, print_delay_threshold=2./1000)
|
||||
while 1:
|
||||
prof = Profiler()
|
||||
cur_time = sec_since_boot()
|
||||
|
||||
# read CAN
|
||||
canMonoTimes = CS.update(logcan)
|
||||
CS = CI.update()
|
||||
|
||||
# **** rearview mirror management ***
|
||||
if CS.cruise_setting == 1 and CS.prev_cruise_setting == 0:
|
||||
rear_view_toggle = not rear_view_toggle
|
||||
prof.checkpoint("CarInterface")
|
||||
|
||||
# show rear view camera on phone if in reverse gear or when lkas button is pressed
|
||||
rear_view_cam = (CS.gear_shifter == 2) or rear_view_toggle or CS.blinker_on
|
||||
# did it request to enable?
|
||||
enable_request, enable_condition = False, False
|
||||
|
||||
if enabled:
|
||||
# gives the user 6 minutes
|
||||
awareness_status -= 1.0/(100*60*6)
|
||||
if awareness_status <= 0.:
|
||||
AM.add("driverDistracted", enabled)
|
||||
|
||||
# reset awareness status on steering
|
||||
if CS.steeringPressed:
|
||||
awareness_status = 1.0
|
||||
|
||||
# handle button presses
|
||||
for b in CS.buttonEvents:
|
||||
print b
|
||||
|
||||
# reset awareness on any user action
|
||||
awareness_status = 1.0
|
||||
|
||||
# button presses for rear view
|
||||
if b.type == "leftBlinker" or b.type == "rightBlinker":
|
||||
if b.pressed:
|
||||
rear_view_toggle = True
|
||||
else:
|
||||
rear_view_toggle = False
|
||||
|
||||
if b.type == "altButton1" and b.pressed:
|
||||
rear_view_toggle = not rear_view_toggle
|
||||
|
||||
if not VP.brake_only and enabled and not b.pressed:
|
||||
if b.type == "accelCruise":
|
||||
v_cruise_kph = v_cruise_kph - (v_cruise_kph % V_CRUISE_DELTA) + V_CRUISE_DELTA
|
||||
elif b.type == "decelCruise":
|
||||
v_cruise_kph = v_cruise_kph - (v_cruise_kph % V_CRUISE_DELTA) - V_CRUISE_DELTA
|
||||
v_cruise_kph = clip(v_cruise_kph, V_CRUISE_MIN, V_CRUISE_MAX)
|
||||
|
||||
if not enabled and b.type in ["accelCruise", "decelCruise"] and not b.pressed:
|
||||
enable_request = True
|
||||
|
||||
# do disable on button down
|
||||
if b.type == "cancel" and b.pressed:
|
||||
AM.add("disable", enabled)
|
||||
|
||||
prof.checkpoint("Buttons")
|
||||
|
||||
# *** health checking logic ***
|
||||
hh = messaging.recv_sock(health)
|
||||
if hh is not None:
|
||||
# if the board isn't allowing controls but somehow we are enabled!
|
||||
if not hh.health.controlsAllowed and enabled:
|
||||
AM.add("controlsMismatch", enabled)
|
||||
|
||||
# *** thermal checking logic ***
|
||||
|
||||
# thermal data, checked every second
|
||||
td = messaging.recv_sock(thermal)
|
||||
if td is not None:
|
||||
cpu_temps = [td.thermal.cpu0, td.thermal.cpu1, td.thermal.cpu2,
|
||||
td.thermal.cpu3, td.thermal.mem, td.thermal.gpu]
|
||||
# check overtemp
|
||||
overtemp = any(t > 950 for t in cpu_temps)
|
||||
# Check temperature.
|
||||
overtemp = any(
|
||||
t > 950
|
||||
for t in (td.thermal.cpu0, td.thermal.cpu1, td.thermal.cpu2,
|
||||
td.thermal.cpu3, td.thermal.mem, td.thermal.gpu))
|
||||
# under 15% of space free
|
||||
free_space = td.thermal.freeSpace
|
||||
|
||||
prof.checkpoint("Health")
|
||||
|
||||
# *** getting model logic ***
|
||||
PP.update(cur_time, CS.v_ego)
|
||||
PP.update(cur_time, CS.vEgo)
|
||||
|
||||
if rk.frame % 5 == 2:
|
||||
# *** run this at 20hz again ***
|
||||
angle_offset = learn_angle_offset(enabled, CS.v_ego, angle_offset, np.asarray(PP.d_poly), LaC.y_des, CS.steer_override)
|
||||
angle_offset = learn_angle_offset(enabled, CS.vEgo, angle_offset, np.asarray(PP.d_poly), LaC.y_des, CS.steeringPressed)
|
||||
|
||||
# to avoid race conditions, check if control has been disabled for at least 0.2s
|
||||
mismatch_ctrl = not CC.controls_allowed and enabled
|
||||
mismatch_pcm = (not CS.pcm_acc_status and (not apply_brake or CS.v_ego < 0.1)) and enabled
|
||||
|
||||
# keep resetting start timer if mismatch isn't true
|
||||
if not mismatch_ctrl:
|
||||
no_mismatch_ctrl_last = cur_time
|
||||
if not mismatch_pcm or not CS.brake_only:
|
||||
no_mismatch_pcm_last = cur_time
|
||||
|
||||
#*** v_cruise logic ***
|
||||
if CS.brake_only:
|
||||
v_cruise = int(CS.v_cruise_pcm) # TODO: why sometimes v_cruise_pcm is long type?
|
||||
else:
|
||||
if CS.prev_cruise_buttons == 0 and CS.cruise_buttons == CruiseButtons.RES_ACCEL and enabled:
|
||||
v_cruise = v_cruise - (v_cruise % v_cruise_delta) + v_cruise_delta
|
||||
elif CS.prev_cruise_buttons == 0 and CS.cruise_buttons == CruiseButtons.DECEL_SET and enabled:
|
||||
v_cruise = v_cruise + (v_cruise % v_cruise_delta) - v_cruise_delta
|
||||
|
||||
# *** enabling/disabling logic ***
|
||||
enable_pressed = (CS.prev_cruise_buttons == CruiseButtons.DECEL_SET or CS.prev_cruise_buttons == CruiseButtons.RES_ACCEL) \
|
||||
and CS.cruise_buttons == 0
|
||||
|
||||
if enable_pressed:
|
||||
print "enabled pressed at", cur_time
|
||||
last_enable_pressed = cur_time
|
||||
|
||||
# if pcm does speed control than we need to wait on pcm to enable
|
||||
if CS.brake_only:
|
||||
enable_condition = (cur_time - last_enable_pressed) < 0.2 and CS.pcm_acc_status
|
||||
else:
|
||||
enable_condition = enable_pressed
|
||||
|
||||
# always clear the alert at every cycle
|
||||
alert_id = []
|
||||
|
||||
# check for PCM not enabling
|
||||
if CS.brake_only and (cur_time - last_enable_pressed) < 0.2 and not CS.pcm_acc_status:
|
||||
print "waiting for PCM to enable"
|
||||
|
||||
# check for denied enabling
|
||||
if enable_pressed and not enabled:
|
||||
deny_enable = \
|
||||
[(AI.SEATBELT, not CS.seatbelt),
|
||||
(AI.DOOR_OPEN, not CS.door_all_closed),
|
||||
(AI.ESP_OFF, CS.esp_disabled),
|
||||
(AI.STEER_ERROR, CS.steer_error),
|
||||
(AI.BRAKE_ERROR, CS.brake_error),
|
||||
(AI.GEAR_NOT_D, not CS.gear_shifter_valid),
|
||||
(AI.MAIN_OFF, not CS.main_on),
|
||||
(AI.PEDAL_PRESSED, CS.user_gas_pressed or CS.brake_pressed or (CS.pedal_gas > 0 and CS.brake_only)),
|
||||
(AI.HIGH_SPEED, CS.v_ego > max_enable_speed),
|
||||
(AI.OVERHEAT, overtemp),
|
||||
(AI.COMM_ISSUE, PP.dead or AC.dead),
|
||||
(AI.CONTROLSD_LAG, rk.remaining < -0.2)]
|
||||
for alertn, cond in deny_enable:
|
||||
if cond:
|
||||
alert_id += [alertn]
|
||||
|
||||
# check for soft disables
|
||||
# disable if the pedals are pressed while engaged, this is a user disable
|
||||
if enabled:
|
||||
soft_disable = \
|
||||
[(AI.SEATBELT_SD, not CS.seatbelt),
|
||||
(AI.DOOR_OPEN_SD, not CS.door_all_closed),
|
||||
(AI.ESP_OFF_SD, CS.esp_disabled),
|
||||
(AI.OVERHEAT_SD, overtemp),
|
||||
(AI.COMM_ISSUE_SD, PP.dead or AC.dead),
|
||||
(AI.CONTROLSD_LAG_SD, rk.remaining < -0.2)]
|
||||
sounding = False
|
||||
for alertn, cond in soft_disable:
|
||||
if cond:
|
||||
alert_id += [alertn]
|
||||
sounding = True
|
||||
# soft disengagement expired, user need to take control
|
||||
if (cur_time - soft_disable_start) > 3.:
|
||||
enabled = False
|
||||
v_cruise = 255
|
||||
if not sounding:
|
||||
soft_disable_start = cur_time
|
||||
if CS.gasPressed or CS.brakePressed:
|
||||
AM.add("disable", enabled)
|
||||
|
||||
# check for immediate disables
|
||||
if enabled:
|
||||
immediate_disable = \
|
||||
[(AI.PCM_LOW_SPEED, (cur_time > no_mismatch_pcm_last > 0.2) and CS.v_ego < pcm_threshold),
|
||||
(AI.STEER_ERROR_ID, CS.steer_error),
|
||||
(AI.BRAKE_ERROR_ID, CS.brake_error),
|
||||
(AI.CTRL_MISMATCH_ID, (cur_time - no_mismatch_ctrl_last) > 0.2),
|
||||
(AI.PCM_MISMATCH_ID, (cur_time - no_mismatch_pcm_last) > 0.2)]
|
||||
for alertn, cond in immediate_disable:
|
||||
if cond:
|
||||
alert_id += [alertn]
|
||||
# immediate turn off control
|
||||
enabled = False
|
||||
v_cruise = 255
|
||||
if enable_request:
|
||||
# check for pressed pedals
|
||||
if CS.gasPressed or CS.brakePressed:
|
||||
AM.add("pedalPressed", enabled)
|
||||
enable_request = False
|
||||
else:
|
||||
print "enabled pressed at", cur_time
|
||||
last_enable_request = cur_time
|
||||
|
||||
# user disabling
|
||||
if enabled and (CS.user_gas_pressed or CS.brake_pressed or not CS.gear_shifter_valid or \
|
||||
(CS.cruise_buttons == CruiseButtons.CANCEL and CS.prev_cruise_buttons == 0) or \
|
||||
not CS.main_on or (CS.pedal_gas > 0 and CS.brake_only)):
|
||||
enabled = False
|
||||
v_cruise = 255
|
||||
alert_id += [AI.DISABLE]
|
||||
# don't engage with less than 15% free
|
||||
if free_space < 0.15:
|
||||
AM.add("outOfSpace", enabled)
|
||||
enable_request = False
|
||||
|
||||
# enabling
|
||||
if enable_condition and not enabled and len(alert_id) == 0:
|
||||
if VP.brake_only:
|
||||
enable_condition = ((cur_time - last_enable_request) < 0.2) and CS.cruiseState.enabled
|
||||
else:
|
||||
enable_condition = enable_request
|
||||
|
||||
if enable_request or enable_condition or enabled:
|
||||
# add all alerts from car
|
||||
for alert in CS.errors:
|
||||
AM.add(alert, enabled)
|
||||
|
||||
if AC.dead:
|
||||
AM.add("radarCommIssue", enabled)
|
||||
|
||||
if PP.dead:
|
||||
AM.add("modelCommIssue", enabled)
|
||||
|
||||
if overtemp:
|
||||
AM.add("overheat", enabled)
|
||||
|
||||
prof.checkpoint("Model")
|
||||
|
||||
if enable_condition and not enabled and not AM.alertPresent():
|
||||
print "*** enabling controls"
|
||||
|
||||
#enable both lateral and longitudinal controls
|
||||
# beep for enabling
|
||||
AM.add("enable", enabled)
|
||||
|
||||
# enable both lateral and longitudinal controls
|
||||
enabled = True
|
||||
counter_pcm_enabled = CS.counter_pcm
|
||||
|
||||
# on activation, let's always set v_cruise from where we are, even if PCM ACC is active
|
||||
# what we want to be displayed in mph
|
||||
v_cruise_mph = round(CS.v_ego * CV.MS_TO_MPH * CS.ui_speed_fudge)
|
||||
# what we need to send to have that displayed
|
||||
v_cruise = int(round(np.maximum(v_cruise_mph * CV.MPH_TO_KPH, v_cruise_enable_min)))
|
||||
v_cruise_kph = int(round(max(CS.vEgo * CV.MS_TO_KPH * VP.ui_speed_fudge, V_CRUISE_ENABLE_MIN)))
|
||||
|
||||
# 6 minutes driver you're on
|
||||
awareness_status = 1.0
|
||||
@@ -236,67 +223,74 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
# reset the PID loops
|
||||
LaC.reset()
|
||||
# start long control at actual speed
|
||||
LoC.reset(v_pid = CS.v_ego)
|
||||
LoC.reset(v_pid = CS.vEgo)
|
||||
|
||||
alert_id += [AI.ENABLE]
|
||||
if VP.brake_only and CS.cruiseState.enabled:
|
||||
v_cruise_kph = CS.cruiseState.speed * CV.MS_TO_KPH
|
||||
|
||||
if v_cruise != 255 and not CS.brake_only:
|
||||
v_cruise = np.clip(v_cruise, v_cruise_min, v_cruise_max)
|
||||
# *** put the adaptive in adaptive cruise control ***
|
||||
AC.update(cur_time, CS.vEgo, CS.steeringAngle, LoC.v_pid, awareness_status, VP)
|
||||
|
||||
# **** awareness status manager ****
|
||||
if enabled:
|
||||
# gives the user 6 minutes
|
||||
awareness_status -= 1.0/(100*60*6)
|
||||
# reset on steering, blinker, or cruise buttons
|
||||
if CS.steer_override or CS.blinker_on or CS.cruise_buttons or CS.cruise_setting:
|
||||
awareness_status = 1.0
|
||||
if awareness_status <= 0.:
|
||||
alert_id += [AI.DRIVER_DISTRACTED]
|
||||
prof.checkpoint("AdaptiveCruise")
|
||||
|
||||
# ****** initial actuators commands ***
|
||||
# *** gas/brake PID loop ***
|
||||
AC.update(cur_time, CS.v_ego, CS.angle_steers, LoC.v_pid, awareness_status, CS.VP)
|
||||
final_gas, final_brake = LoC.update(enabled, CS, v_cruise, AC.v_target_lead, AC.a_target, AC.jerk_factor)
|
||||
pcm_accel = int(np.clip(AC.a_pcm/1.4,0,1)*0xc6) # TODO: perc of max accel in ACC?
|
||||
final_gas, final_brake = LoC.update(enabled, CS.vEgo, v_cruise_kph, AC.v_target_lead, AC.a_target, AC.jerk_factor, VP)
|
||||
|
||||
# *** steering PID loop ***
|
||||
final_steer, sat_flag = LaC.update(enabled, CS, PP.d_poly, angle_offset)
|
||||
final_steer, sat_flag = LaC.update(enabled, CS.vEgo, CS.steeringAngle, CS.steeringPressed, PP.d_poly, angle_offset, VP)
|
||||
|
||||
# this needs to stay before hysteresis logic to avoid pcm staying on control during brake hysteresis
|
||||
pcm_override = True # this is always True
|
||||
pcm_cancel_cmd = False
|
||||
if CS.brake_only and final_brake == 0.:
|
||||
pcm_speed = LoC.v_pid - .3 # FIXME: just for exp
|
||||
else:
|
||||
pcm_speed = 0
|
||||
prof.checkpoint("PID")
|
||||
|
||||
# ***** handle alerts ****
|
||||
# send a "steering required alert" if saturation count has reached the limit
|
||||
if sat_flag:
|
||||
alert_id += [AI.STEER_SATURATED]
|
||||
AM.add("steerSaturated", enabled)
|
||||
|
||||
# process the alert, based on id
|
||||
alert, chime, beep, hud_alert, alert_text, sound_exp, hud_exp, text_exp, alert_p = \
|
||||
process_alert(alert_id, alert, cur_time, sound_exp, hud_exp, text_exp, alert_p)
|
||||
if enabled and AM.alertShouldDisable():
|
||||
print "DISABLING IMMEDIATELY ON ALERT"
|
||||
enabled = False
|
||||
|
||||
# alerts pub
|
||||
if len(alert_id) != 0:
|
||||
print alert_id, alert_text
|
||||
|
||||
# *** process for hud display ***
|
||||
if not enabled or (hud_v_cruise == 255 and CS.counter_pcm == counter_pcm_enabled):
|
||||
hud_v_cruise = 255
|
||||
if enabled and AM.alertShouldSoftDisable():
|
||||
if soft_disable_timer is None:
|
||||
soft_disable_timer = 3 * rate
|
||||
elif soft_disable_timer == 0:
|
||||
print "SOFT DISABLING ON ALERT"
|
||||
enabled = False
|
||||
else:
|
||||
soft_disable_timer -= 1
|
||||
else:
|
||||
hud_v_cruise = v_cruise
|
||||
soft_disable_timer = None
|
||||
|
||||
# *** actually do can sends ***
|
||||
CC.update(sendcan, enabled, CS, rk.frame, \
|
||||
final_gas, final_brake, final_steer, \
|
||||
pcm_speed, pcm_override, pcm_cancel_cmd, pcm_accel, \
|
||||
hud_v_cruise, hud_show_lanes = enabled, \
|
||||
hud_show_car = AC.has_lead, \
|
||||
hud_alert = hud_alert, \
|
||||
snd_beep = beep, snd_chime = chime)
|
||||
# *** push the alerts to current ***
|
||||
alert_text_1, alert_text_2, visual_alert, audible_alert = AM.process_alerts(cur_time)
|
||||
|
||||
# ***** control the car *****
|
||||
CC = car.CarControl.new_message()
|
||||
|
||||
CC.enabled = enabled
|
||||
|
||||
CC.gas = float(final_gas)
|
||||
CC.brake = float(final_brake)
|
||||
CC.steeringTorque = float(final_steer)
|
||||
|
||||
CC.cruiseControl.override = True
|
||||
CC.cruiseControl.cancel = bool((not VP.brake_only) or (not enabled and CS.cruiseState.enabled)) # always cancel if we have an interceptor
|
||||
CC.cruiseControl.speedOverride = float((LoC.v_pid - .3) if (VP.brake_only and final_brake == 0.) else 0.0)
|
||||
CC.cruiseControl.accelOverride = float(AC.a_pcm)
|
||||
|
||||
CC.hudControl.setSpeed = float(v_cruise_kph * CV.KPH_TO_MS)
|
||||
CC.hudControl.speedVisible = enabled
|
||||
CC.hudControl.lanesVisible = enabled
|
||||
CC.hudControl.leadVisible = bool(AC.has_lead)
|
||||
|
||||
CC.hudControl.visualAlert = visual_alert
|
||||
CC.hudControl.audibleAlert = audible_alert
|
||||
|
||||
# this alert will apply next controls cycle
|
||||
if not CI.apply(CC):
|
||||
AM.add("controlsFailed", enabled)
|
||||
|
||||
prof.checkpoint("CarControl")
|
||||
|
||||
# ***** publish state to logger *****
|
||||
|
||||
@@ -304,14 +298,14 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
dat = messaging.new_message()
|
||||
dat.init('live100')
|
||||
|
||||
# move liveUI into live100
|
||||
dat.live100.rearViewCam = bool(rear_view_cam)
|
||||
dat.live100.alertText1 = alert_text[0]
|
||||
dat.live100.alertText2 = alert_text[1]
|
||||
# show rear view camera on phone if in reverse gear or when button is pressed
|
||||
dat.live100.rearViewCam = ('reverseGear' in CS.errors) or rear_view_toggle
|
||||
dat.live100.alertText1 = alert_text_1
|
||||
dat.live100.alertText2 = alert_text_2
|
||||
dat.live100.awarenessStatus = max(awareness_status, 0.0) if enabled else 0.0
|
||||
|
||||
# what packets were used to process
|
||||
dat.live100.canMonoTimes = canMonoTimes
|
||||
dat.live100.canMonoTimes = list(CS.canMonoTimes)
|
||||
dat.live100.mdMonoTime = PP.logMonoTime
|
||||
dat.live100.l20MonoTime = AC.logMonoTime
|
||||
|
||||
@@ -319,15 +313,13 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
dat.live100.enabled = enabled
|
||||
|
||||
# car state
|
||||
dat.live100.vEgo = float(CS.v_ego)
|
||||
dat.live100.aEgo = float(CS.a_ego)
|
||||
dat.live100.angleSteers = float(CS.angle_steers)
|
||||
dat.live100.hudLead = CS.hud_lead
|
||||
dat.live100.steerOverride = CS.steer_override
|
||||
dat.live100.vEgo = CS.vEgo
|
||||
dat.live100.angleSteers = CS.steeringAngle
|
||||
dat.live100.steerOverride = CS.steeringPressed
|
||||
|
||||
# longitudinal control state
|
||||
dat.live100.vPid = float(LoC.v_pid)
|
||||
dat.live100.vCruise = float(v_cruise)
|
||||
dat.live100.vCruise = float(v_cruise_kph)
|
||||
dat.live100.upAccelCmd = float(LoC.Up_accel_cmd)
|
||||
dat.live100.uiAccelCmd = float(LoC.Ui_accel_cmd)
|
||||
|
||||
@@ -348,8 +340,11 @@ def controlsd_thread(gctx, rate=100): #rate in Hz
|
||||
|
||||
live100.send(dat.to_bytes())
|
||||
|
||||
prof.checkpoint("Live100")
|
||||
|
||||
# *** run loop at fixed rate ***
|
||||
rk.keep_time()
|
||||
if rk.keep_time():
|
||||
prof.display()
|
||||
|
||||
def main(gctx=None):
|
||||
controlsd_thread(gctx, 100)
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
import selfdrive.messaging as messaging
|
||||
import math
|
||||
import numpy as np
|
||||
from common.numpy_fast import clip, interp
|
||||
import selfdrive.messaging as messaging
|
||||
|
||||
# lookup tables VS speed to determine min and max accels in cruise
|
||||
_A_CRUISE_MIN_V = np.asarray([-1.0, -.8, -.67, -.5, -.30])
|
||||
_A_CRUISE_MIN_BP = np.asarray([ 0., 5., 10., 20., 40.])
|
||||
_A_CRUISE_MIN_V = [-1.0, -.8, -.67, -.5, -.30]
|
||||
_A_CRUISE_MIN_BP = [ 0., 5., 10., 20., 40.]
|
||||
|
||||
# need fast accel at very low speed for stop and go
|
||||
_A_CRUISE_MAX_V = np.asarray([1., 1., .8, .5, .30])
|
||||
_A_CRUISE_MAX_BP = np.asarray([0., 5., 10., 20., 40.])
|
||||
_A_CRUISE_MAX_V = [1., 1., .8, .5, .30]
|
||||
_A_CRUISE_MAX_BP = [0., 5., 10., 20., 40.]
|
||||
|
||||
def calc_cruise_accel_limits(v_ego):
|
||||
a_cruise_min = np.interp(v_ego, _A_CRUISE_MIN_BP, _A_CRUISE_MIN_V)
|
||||
a_cruise_max = np.interp(v_ego, _A_CRUISE_MAX_BP, _A_CRUISE_MAX_V)
|
||||
a_cruise_min = interp(v_ego, _A_CRUISE_MIN_BP, _A_CRUISE_MIN_V)
|
||||
a_cruise_max = interp(v_ego, _A_CRUISE_MAX_BP, _A_CRUISE_MAX_V)
|
||||
return np.vstack([a_cruise_min, a_cruise_max])
|
||||
|
||||
a_pcm = 1. # always 1 for now
|
||||
return np.vstack([a_cruise_min, a_cruise_max]), a_pcm
|
||||
|
||||
_A_TOTAL_MAX_V = np.asarray([1.5, 1.9, 3.2])
|
||||
_A_TOTAL_MAX_BP = np.asarray([0., 20., 40.])
|
||||
_A_TOTAL_MAX_V = [1.5, 1.9, 3.2]
|
||||
_A_TOTAL_MAX_BP = [0., 20., 40.]
|
||||
|
||||
def limit_accel_in_turns(v_ego, angle_steers, a_target, a_pcm, VP):
|
||||
#*** this function returns a limited long acceleration allowed, depending on the existing lateral acceleration
|
||||
# this should avoid accelerating when losing the target in turns
|
||||
deg_to_rad = np.pi / 180. # from can reading to rad
|
||||
|
||||
a_total_max = np.interp(v_ego, _A_TOTAL_MAX_BP, _A_TOTAL_MAX_V)
|
||||
a_total_max = interp(v_ego, _A_TOTAL_MAX_BP, _A_TOTAL_MAX_V)
|
||||
a_y = v_ego**2 * angle_steers * deg_to_rad / (VP.steer_ratio * VP.wheelbase)
|
||||
a_x_allowed = np.sqrt(np.maximum(a_total_max**2 - a_y**2, 0.))
|
||||
a_x_allowed = math.sqrt(max(a_total_max**2 - a_y**2, 0.))
|
||||
|
||||
a_target[1] = np.minimum(a_target[1], a_x_allowed)
|
||||
a_pcm = np.minimum(a_pcm, a_x_allowed)
|
||||
a_target[1] = min(a_target[1], a_x_allowed)
|
||||
a_pcm = min(a_pcm, a_x_allowed)
|
||||
return a_target, a_pcm
|
||||
|
||||
def process_a_lead(a_lead):
|
||||
# soft threshold of 0.5m/s^2 applied to a_lead to reject noise, also not considered positive a_lead
|
||||
a_lead_threshold = 0.5
|
||||
a_lead = np.minimum(a_lead + a_lead_threshold, 0)
|
||||
a_lead = min(a_lead + a_lead_threshold, 0)
|
||||
return a_lead
|
||||
|
||||
def calc_desired_distance(v_lead):
|
||||
@@ -46,12 +46,12 @@ def calc_desired_distance(v_lead):
|
||||
|
||||
|
||||
#linear slope
|
||||
_L_SLOPE_V = np.asarray([0.40, 0.10])
|
||||
_L_SLOPE_BP = np.asarray([0., 40])
|
||||
_L_SLOPE_V = [0.40, 0.10]
|
||||
_L_SLOPE_BP = [0., 40]
|
||||
|
||||
# parabola slope
|
||||
_P_SLOPE_V = np.asarray([1.0, 0.25])
|
||||
_P_SLOPE_BP = np.asarray([0., 40])
|
||||
_P_SLOPE_V = [1.0, 0.25]
|
||||
_P_SLOPE_BP = [0., 40]
|
||||
|
||||
def calc_desired_speed(d_lead, d_des, v_lead, a_lead):
|
||||
#*** compute desired speed ***
|
||||
@@ -64,8 +64,8 @@ def calc_desired_speed(d_lead, d_des, v_lead, a_lead):
|
||||
max_runaway_speed = -2. # no slower than 2m/s over the lead
|
||||
|
||||
# interpolate the lookups to find the slopes for a give lead speed
|
||||
l_slope = np.interp(v_lead, _L_SLOPE_BP, _L_SLOPE_V)
|
||||
p_slope = np.interp(v_lead, _P_SLOPE_BP, _P_SLOPE_V)
|
||||
l_slope = interp(v_lead, _L_SLOPE_BP, _L_SLOPE_V)
|
||||
p_slope = interp(v_lead, _P_SLOPE_BP, _P_SLOPE_V)
|
||||
|
||||
# this is where parabola and linear curves are tangents
|
||||
x_linear_to_parabola = p_slope / l_slope**2
|
||||
@@ -79,41 +79,41 @@ def calc_desired_speed(d_lead, d_des, v_lead, a_lead):
|
||||
# calculate v_rel_des on one third of the linear slope
|
||||
v_rel_des_2 = (d_lead - d_des) * l_slope / 3.
|
||||
# take the min of the 2 above
|
||||
v_rel_des = np.minimum(v_rel_des_1, v_rel_des_2)
|
||||
v_rel_des = np.maximum(v_rel_des, max_runaway_speed)
|
||||
v_rel_des = min(v_rel_des_1, v_rel_des_2)
|
||||
v_rel_des = max(v_rel_des, max_runaway_speed)
|
||||
elif d_lead < d_des + x_linear_to_parabola:
|
||||
v_rel_des = (d_lead - d_des) * l_slope
|
||||
v_rel_des = np.maximum(v_rel_des, max_runaway_speed)
|
||||
v_rel_des = max(v_rel_des, max_runaway_speed)
|
||||
else:
|
||||
v_rel_des = np.sqrt(2 * (d_lead - d_des - x_parabola_offset) * p_slope)
|
||||
v_rel_des = math.sqrt(2 * (d_lead - d_des - x_parabola_offset) * p_slope)
|
||||
|
||||
# compute desired speed
|
||||
v_target = v_rel_des + v_lead
|
||||
|
||||
# compute v_coast: above this speed we want to coast
|
||||
t_lookahead = 1. # how far in time we consider a_lead to anticipate the coast region
|
||||
v_coast_shift = np.maximum(a_lead * t_lookahead, - v_lead) # don't consider projections that would make v_lead<0
|
||||
v_coast_shift = max(a_lead * t_lookahead, - v_lead) # don't consider projections that would make v_lead<0
|
||||
v_coast = (v_lead + v_target)/2 + v_coast_shift # no accel allowed above this line
|
||||
v_coast = np.minimum(v_coast, v_target)
|
||||
v_coast = min(v_coast, v_target)
|
||||
|
||||
return v_target, v_coast
|
||||
|
||||
def calc_critical_decel(d_lead, v_rel, d_offset, v_offset):
|
||||
# this function computes the required decel to avoid crashing, given safety offsets
|
||||
a_critical = - np.maximum(0., v_rel + v_offset)**2/np.maximum(2*(d_lead - d_offset), 0.5)
|
||||
a_critical = - max(0., v_rel + v_offset)**2/max(2*(d_lead - d_offset), 0.5)
|
||||
return a_critical
|
||||
|
||||
|
||||
# maximum acceleration adjustment
|
||||
_A_CORR_BY_SPEED_V = np.asarray([0.4, 0.4, 0])
|
||||
_A_CORR_BY_SPEED_V = [0.4, 0.4, 0]
|
||||
# speeds
|
||||
_A_CORR_BY_SPEED_BP = np.asarray([0., 5., 20.])
|
||||
_A_CORR_BY_SPEED_BP = [0., 5., 20.]
|
||||
|
||||
def calc_positive_accel_limit(d_lead, d_des, v_ego, v_rel, v_ref, v_rel_ref, v_coast, v_target, a_lead_contr, a_max):
|
||||
a_coast_min = -1.0 # never coast faster then -1m/s^2
|
||||
# coasting behavior above v_coast. Forcing a_max to be negative will force the pid_speed to decrease,
|
||||
# regardless v_target
|
||||
if v_ref > np.minimum(v_coast, v_target):
|
||||
if v_ref > min(v_coast, v_target):
|
||||
# for smooth coast we can be agrressive and target a point where car would actually crash
|
||||
v_offset_coast = 0.
|
||||
d_offset_coast = d_des/2. - 4.
|
||||
@@ -123,31 +123,31 @@ def calc_positive_accel_limit(d_lead, d_des, v_ego, v_rel, v_ref, v_rel_ref, v_c
|
||||
a_coast = calc_critical_decel(d_lead, v_rel_ref, d_offset_coast, v_offset_coast)
|
||||
# if lead is decelerating, then offset the coast decel
|
||||
a_coast += a_lead_contr
|
||||
a_max = np.maximum(a_coast, a_coast_min)
|
||||
a_max = max(a_coast, a_coast_min)
|
||||
else:
|
||||
a_max = a_coast_min
|
||||
else:
|
||||
# same as cruise accel, but add a small correction based on lead acceleration at low speeds
|
||||
# when lead car accelerates faster, we can do the same, and vice versa
|
||||
|
||||
a_max = a_max + np.interp(v_ego, _A_CORR_BY_SPEED_BP, _A_CORR_BY_SPEED_V) \
|
||||
* np.clip(-v_rel / 4., -.5, 1)
|
||||
a_max = a_max + interp(v_ego, _A_CORR_BY_SPEED_BP, _A_CORR_BY_SPEED_V) \
|
||||
* clip(-v_rel / 4., -.5, 1)
|
||||
return a_max
|
||||
|
||||
# arbitrary limits to avoid too high accel being computed
|
||||
_A_SAT = np.asarray([-10., 5.])
|
||||
_A_SAT = [-10., 5.]
|
||||
|
||||
# do not consider a_lead at 0m/s, fully consider it at 10m/s
|
||||
_A_LEAD_LOW_SPEED_V = np.asarray([0., 1.])
|
||||
_A_LEAD_LOW_SPEED_V = [0., 1.]
|
||||
|
||||
# speed break points
|
||||
_A_LEAD_LOW_SPEED_BP = np.asarray([0., 10.])
|
||||
_A_LEAD_LOW_SPEED_BP = [0., 10.]
|
||||
|
||||
# add a small offset to the desired decel, just for safety margin
|
||||
_DECEL_OFFSET_V = np.asarray([-0.3, -0.5, -0.5, -0.4, -0.3])
|
||||
_DECEL_OFFSET_V = [-0.3, -0.5, -0.5, -0.4, -0.3]
|
||||
|
||||
# speed bp: different offset based on the likelyhood that lead decels abruptly
|
||||
_DECEL_OFFSET_BP = np.asarray([0., 4., 15., 30, 40.])
|
||||
_DECEL_OFFSET_BP = [0., 4., 15., 30, 40.]
|
||||
|
||||
|
||||
def calc_acc_accel_limits(d_lead, d_des, v_ego, v_pid, v_lead, v_rel, a_lead,
|
||||
@@ -159,8 +159,8 @@ def calc_acc_accel_limits(d_lead, d_des, v_ego, v_pid, v_lead, v_rel, a_lead,
|
||||
v_rel_pid = v_pid - v_lead
|
||||
|
||||
# this is how much lead accel we consider in assigning the desired decel
|
||||
a_lead_contr = a_lead * np.interp(v_lead, _A_LEAD_LOW_SPEED_BP,
|
||||
_A_LEAD_LOW_SPEED_V) * 0.8
|
||||
a_lead_contr = a_lead * interp(v_lead, _A_LEAD_LOW_SPEED_BP,
|
||||
_A_LEAD_LOW_SPEED_V) * 0.8
|
||||
|
||||
# first call of calc_positive_accel_limit is used to shape v_pid
|
||||
a_target[1] = calc_positive_accel_limit(d_lead, d_des, v_ego, v_rel, v_pid,
|
||||
@@ -178,15 +178,15 @@ def calc_acc_accel_limits(d_lead, d_des, v_ego, v_pid, v_lead, v_rel, a_lead,
|
||||
pass # acc target speed is above vehicle speed, so we can use the cruise limits
|
||||
elif d_lead > d_offset + 0.01: # add small value to avoid by zero divisions
|
||||
# compute needed accel to get to 1m distance with -1m/s rel speed
|
||||
decel_offset = np.interp(v_lead, _DECEL_OFFSET_BP, _DECEL_OFFSET_V)
|
||||
decel_offset = interp(v_lead, _DECEL_OFFSET_BP, _DECEL_OFFSET_V)
|
||||
|
||||
critical_decel = calc_critical_decel(d_lead, v_rel, d_offset, v_offset)
|
||||
a_target[0] = np.minimum(decel_offset + critical_decel + a_lead_contr,
|
||||
a_target[0])
|
||||
a_target[0] = min(decel_offset + critical_decel + a_lead_contr,
|
||||
a_target[0])
|
||||
else:
|
||||
a_target[0] = _A_SAT[0]
|
||||
# a_min can't be higher than a_max
|
||||
a_target[0] = np.minimum(a_target[0], a_target[1])
|
||||
a_target[0] = min(a_target[0], a_target[1])
|
||||
# final check on limits
|
||||
a_target = np.clip(a_target, _A_SAT[0], _A_SAT[1])
|
||||
a_target = a_target.tolist()
|
||||
@@ -208,8 +208,8 @@ def calc_jerk_factor(d_lead, v_rel):
|
||||
else:
|
||||
a_critical = - calc_critical_decel(d_lead, -v_rel, d_offset, v_offset)
|
||||
# increase Kp and Ki by 20% for every 1m/s2 of decel required above 1m/s2
|
||||
jerk_factor = np.maximum(a_critical - a_offset, 0.)/5.
|
||||
jerk_factor = np.minimum(jerk_factor, jerk_factor_max)
|
||||
jerk_factor = max(a_critical - a_offset, 0.)/5.
|
||||
jerk_factor = min(jerk_factor, jerk_factor_max)
|
||||
return jerk_factor
|
||||
|
||||
|
||||
@@ -223,27 +223,27 @@ def calc_ttc(d_rel, v_rel, a_rel, v_lead):
|
||||
# assuming that closing gap a_rel comes from lead vehicle decel, then limit a_rel so that v_lead will get to zero in no sooner than t_decel
|
||||
# this helps overweighting a_rel when v_lead is close to zero.
|
||||
t_decel = 2.
|
||||
a_rel = np.minimum(a_rel, v_lead/t_decel)
|
||||
a_rel = min(a_rel, v_lead/t_decel)
|
||||
|
||||
delta = v_rel**2 + 2 * d_rel * a_rel
|
||||
# assign an arbitrary high ttc value if there is no solution to ttc
|
||||
if delta < 0.1:
|
||||
ttc = 5.
|
||||
elif np.sqrt(delta) + v_rel < 0.1:
|
||||
elif math.sqrt(delta) + v_rel < 0.1:
|
||||
ttc = 5.
|
||||
else:
|
||||
ttc = 2 * d_rel / (np.sqrt(delta) + v_rel)
|
||||
ttc = 2 * d_rel / (math.sqrt(delta) + v_rel)
|
||||
return ttc
|
||||
|
||||
|
||||
def limit_accel_driver_awareness(v_ego, a_target, a_pcm, awareness_status):
|
||||
decel_bp = [0. , 40.]
|
||||
decel_v = [-0.3, -0.2]
|
||||
decel = np.interp(v_ego, decel_bp, decel_v)
|
||||
decel = interp(v_ego, decel_bp, decel_v)
|
||||
# gives 18 seconds before decel begins (w 6 minute timeout)
|
||||
if awareness_status < -0.05:
|
||||
a_target[1] = np.minimum(a_target[1], decel)
|
||||
a_target[0] = np.minimum(a_target[1], a_target[0])
|
||||
a_target[1] = min(a_target[1], decel)
|
||||
a_target[0] = min(a_target[1], a_target[0])
|
||||
a_pcm = 0.
|
||||
return a_target, a_pcm
|
||||
|
||||
@@ -258,7 +258,10 @@ def compute_speed_with_leads(v_ego, angle_steers, v_pid, l1, l2, awareness_statu
|
||||
v_target_lead = MAX_SPEED_POSSIBLE
|
||||
|
||||
#*** set accel limits as cruise accel/decel limits ***
|
||||
a_target, a_pcm = calc_cruise_accel_limits(v_ego)
|
||||
a_target = calc_cruise_accel_limits(v_ego)
|
||||
# Always 1 for now.
|
||||
a_pcm = 1
|
||||
|
||||
#*** limit max accel in sharp turns
|
||||
a_target, a_pcm = limit_accel_in_turns(v_ego, angle_steers, a_target, a_pcm, VP)
|
||||
jerk_factor = 0.
|
||||
|
||||
@@ -1,178 +0,0 @@
|
||||
alerts = []
|
||||
keys = ["id",
|
||||
"chime",
|
||||
"beep",
|
||||
"hud_alert",
|
||||
"screen_chime",
|
||||
"priority",
|
||||
"text_line_1",
|
||||
"text_line_2",
|
||||
"duration_sound",
|
||||
"duration_hud_alert",
|
||||
"duration_text"]
|
||||
|
||||
|
||||
#car chimes: enumeration from dbc file. Chimes are for alerts and warnings
|
||||
class CM:
|
||||
MUTE = 0
|
||||
SINGLE = 3
|
||||
DOUBLE = 4
|
||||
REPEATED = 1
|
||||
CONTINUOUS = 2
|
||||
|
||||
|
||||
#car beepss: enumeration from dbc file. Beeps are for activ and deactiv
|
||||
class BP:
|
||||
MUTE = 0
|
||||
SINGLE = 3
|
||||
TRIPLE = 2
|
||||
REPEATED = 1
|
||||
|
||||
|
||||
# lert ids
|
||||
class AI:
|
||||
ENABLE = 0
|
||||
DISABLE = 1
|
||||
SEATBELT = 2
|
||||
DOOR_OPEN = 3
|
||||
PEDAL_PRESSED = 4
|
||||
COMM_ISSUE = 5
|
||||
ESP_OFF = 6
|
||||
FCW = 7
|
||||
STEER_ERROR = 8
|
||||
BRAKE_ERROR = 9
|
||||
CALIB_INCOMPLETE = 10
|
||||
CALIB_INVALID = 11
|
||||
GEAR_NOT_D = 12
|
||||
MAIN_OFF = 13
|
||||
STEER_SATURATED = 14
|
||||
PCM_LOW_SPEED = 15
|
||||
THERMAL_DEAD = 16
|
||||
OVERHEAT = 17
|
||||
HIGH_SPEED = 18
|
||||
CONTROLSD_LAG = 19
|
||||
STEER_ERROR_ID = 100
|
||||
BRAKE_ERROR_ID = 101
|
||||
PCM_MISMATCH_ID = 102
|
||||
CTRL_MISMATCH_ID = 103
|
||||
SEATBELT_SD = 200
|
||||
DOOR_OPEN_SD = 201
|
||||
COMM_ISSUE_SD = 202
|
||||
ESP_OFF_SD = 203
|
||||
THERMAL_DEAD_SD = 204
|
||||
OVERHEAT_SD = 205
|
||||
CONTROLSD_LAG_SD = 206
|
||||
CALIB_INCOMPLETE_SD = 207
|
||||
CALIB_INVALID_SD = 208
|
||||
DRIVER_DISTRACTED = 300
|
||||
|
||||
class AH:
|
||||
#[alert_idx, value]
|
||||
# See dbc files for info on values"
|
||||
NONE = [0, 0]
|
||||
FCW = [1, 0x8]
|
||||
STEER = [2, 1]
|
||||
BRAKE_PRESSED = [3, 10]
|
||||
GEAR_NOT_D = [4, 6]
|
||||
SEATBELT = [5, 5]
|
||||
SPEED_TOO_HIGH = [6, 8]
|
||||
|
||||
class ET:
|
||||
ENABLE = 0
|
||||
NO_ENTRY = 1
|
||||
WARNING = 2
|
||||
SOFT_DISABLE = 3
|
||||
IMMEDIATE_DISABLE = 4
|
||||
USER_DISABLE = 5
|
||||
|
||||
def process_alert(alert_id, alert, cur_time, sound_exp, hud_exp, text_exp, alert_p):
|
||||
# INPUTS:
|
||||
# alert_id is mapped to the alert properties in alert_database
|
||||
# cur_time is current time
|
||||
# sound_exp is when the alert beep/chime is supposed to end
|
||||
# hud_exp is when the hud visual is supposed to end
|
||||
# text_exp is when the alert text is supposed to disappear
|
||||
# alert_p is the priority of the current alert
|
||||
# CM, BP, AH are classes defined in alert_database and they respresents chimes, beeps and hud_alerts
|
||||
if len(alert_id) > 0:
|
||||
# take the alert with higher priority
|
||||
alerts_present = filter(lambda a_id: a_id['id'] in alert_id, alerts)
|
||||
alert = sorted(alerts_present, key=lambda k: k['priority'])[-1]
|
||||
# check if we have a more important alert
|
||||
if alert['priority'] > alert_p:
|
||||
alert_p = alert['priority']
|
||||
sound_exp = cur_time + alert['duration_sound']
|
||||
hud_exp = cur_time + alert['duration_hud_alert']
|
||||
text_exp = cur_time + alert['duration_text']
|
||||
|
||||
chime = CM.MUTE
|
||||
beep = BP.MUTE
|
||||
if cur_time < sound_exp:
|
||||
chime = alert['chime']
|
||||
beep = alert['beep']
|
||||
|
||||
hud_alert = AH.NONE
|
||||
if cur_time < hud_exp:
|
||||
hud_alert = alert['hud_alert']
|
||||
|
||||
alert_text = ["", ""]
|
||||
if cur_time < text_exp:
|
||||
alert_text = [alert['text_line_1'], alert['text_line_2']]
|
||||
|
||||
if chime == CM.MUTE and beep == BP.MUTE and hud_alert == AH.NONE: #and alert_text[0] is None and alert_text[1] is None:
|
||||
alert_p = 0
|
||||
return alert, chime, beep, hud_alert, alert_text, sound_exp, hud_exp, text_exp, alert_p
|
||||
|
||||
def process_hud_alert(hud_alert):
|
||||
# initialize to no alert
|
||||
fcw_display = 0
|
||||
steer_required = 0
|
||||
acc_alert = 0
|
||||
if hud_alert == AH.NONE: # no alert
|
||||
pass
|
||||
elif hud_alert == AH.FCW: # FCW
|
||||
fcw_display = hud_alert[1]
|
||||
elif hud_alert == AH.STEER: # STEER
|
||||
steer_required = hud_alert[1]
|
||||
else: # any other ACC alert
|
||||
acc_alert = hud_alert[1]
|
||||
|
||||
return fcw_display, steer_required, acc_alert
|
||||
|
||||
def app_alert(alert_add):
|
||||
alerts.append(dict(zip(keys, alert_add)))
|
||||
|
||||
app_alert([AI.ENABLE, CM.MUTE, BP.SINGLE, AH.NONE, ET.ENABLE, 2, "", "", .2, 0., 0.])
|
||||
app_alert([AI.DISABLE, CM.MUTE, BP.SINGLE, AH.NONE, ET.USER_DISABLE, 2, "", "", .2, 0., 0.])
|
||||
app_alert([AI.SEATBELT, CM.DOUBLE, BP.MUTE, AH.SEATBELT, ET.NO_ENTRY, 1, "Comma Unavailable", "Seatbelt Unlatched", .4, 2., 3.])
|
||||
app_alert([AI.DOOR_OPEN, CM.DOUBLE, BP.MUTE, AH.NONE, ET.NO_ENTRY, 1, "Comma Unavailable", "Door Open", .4, 0., 3.])
|
||||
app_alert([AI.PEDAL_PRESSED, CM.DOUBLE, BP.MUTE, AH.BRAKE_PRESSED, ET.NO_ENTRY, 1, "Comma Unavailable", "Pedal Pressed", .4, 2., 3.])
|
||||
app_alert([AI.COMM_ISSUE, CM.DOUBLE, BP.MUTE, AH.NONE, ET.NO_ENTRY, 1, "Comma Unavailable", "Communcation Issues", .4, 0., 3.])
|
||||
app_alert([AI.ESP_OFF, CM.DOUBLE, BP.MUTE, AH.NONE, ET.NO_ENTRY, 1, "Comma Unavailable", "ESP Off", .4, 0., 3.])
|
||||
app_alert([AI.FCW, CM.REPEATED, BP.MUTE, AH.FCW, ET.WARNING, 3, "Risk of Collision", "", 1., 2., 3.])
|
||||
app_alert([AI.STEER_ERROR, CM.DOUBLE, BP.MUTE, AH.NONE, ET.NO_ENTRY, 1, "Comma Unavailable", "Steer Error", .4, 0., 3.])
|
||||
app_alert([AI.BRAKE_ERROR, CM.DOUBLE, BP.MUTE, AH.NONE, ET.NO_ENTRY, 1, "Comma Unavailable", "Brake Error", .4, 0., 3.])
|
||||
app_alert([AI.CALIB_INCOMPLETE, CM.DOUBLE, BP.MUTE, AH.NONE, ET.NO_ENTRY, 1, "Comma Unavailable", "Calibration in Progress", .4, 0., 3.])
|
||||
app_alert([AI.CALIB_INVALID, CM.DOUBLE, BP.MUTE, AH.NONE, ET.NO_ENTRY, 1, "Comma Unavailable", "Calibration Error", .4, 0., 3.])
|
||||
app_alert([AI.GEAR_NOT_D, CM.DOUBLE, BP.MUTE, AH.GEAR_NOT_D, ET.NO_ENTRY, 1, "Comma Unavailable", "Gear not in D", .4, 2., 3.])
|
||||
app_alert([AI.MAIN_OFF, CM.MUTE, BP.MUTE, AH.NONE, ET.NO_ENTRY, 1, "Comma Unavailable", "Main Switch Off", .4, 0., 3.])
|
||||
app_alert([AI.STEER_SATURATED, CM.SINGLE, BP.MUTE, AH.STEER, ET.WARNING, 2, "Take Control", "Steer Control Saturated", 1., 2., 3.])
|
||||
app_alert([AI.PCM_LOW_SPEED, CM.MUTE, BP.SINGLE, AH.STEER, ET.WARNING, 2, "Comma disengaged", "Speed too low", .2, 2., 3.])
|
||||
app_alert([AI.THERMAL_DEAD, CM.DOUBLE, BP.MUTE, AH.NONE, ET.NO_ENTRY, 1, "Comma Unavailable", "Thermal Unavailable", .4, 0., 3.])
|
||||
app_alert([AI.OVERHEAT, CM.DOUBLE, BP.MUTE, AH.NONE, ET.NO_ENTRY, 1, "Comma Unavailable", "System Overheated", .4, 0., 3.])
|
||||
app_alert([AI.HIGH_SPEED, CM.DOUBLE, BP.MUTE, AH.SPEED_TOO_HIGH, ET.NO_ENTRY, 1, "Comma Unavailable", "Speed Too High", .4, 2., 3.])
|
||||
app_alert([AI.CONTROLSD_LAG, CM.DOUBLE, BP.MUTE, AH.NONE, ET.NO_ENTRY, 1, "Comma Unavailable", "Controls Lagging", .4, 0., 3.])
|
||||
app_alert([AI.STEER_ERROR_ID, CM.REPEATED, BP.MUTE, AH.STEER, ET.IMMEDIATE_DISABLE, 3, "Take Control Immediately", "Steer Error", 1., 3., 3.])
|
||||
app_alert([AI.BRAKE_ERROR_ID, CM.REPEATED, BP.MUTE, AH.STEER, ET.IMMEDIATE_DISABLE, 3, "Take Control Immediately", "Brake Error", 1., 3., 3.])
|
||||
app_alert([AI.PCM_MISMATCH_ID, CM.REPEATED, BP.MUTE, AH.STEER, ET.IMMEDIATE_DISABLE, 3, "Take Control Immediately", "Pcm Mismatch", 1., 3., 3.])
|
||||
app_alert([AI.CTRL_MISMATCH_ID, CM.REPEATED, BP.MUTE, AH.STEER, ET.IMMEDIATE_DISABLE, 3, "Take Control Immediately", "Ctrl Mismatch", 1., 3., 3.])
|
||||
app_alert([AI.SEATBELT_SD, CM.REPEATED, BP.MUTE, AH.STEER, ET.SOFT_DISABLE, 3, "Take Control Immediately", "Seatbelt Unlatched", 1., 3., 3.])
|
||||
app_alert([AI.DOOR_OPEN_SD, CM.REPEATED, BP.MUTE, AH.STEER, ET.SOFT_DISABLE, 3, "Take Control Immediately", "Door Open", 1., 3., 3.])
|
||||
app_alert([AI.COMM_ISSUE_SD, CM.REPEATED, BP.MUTE, AH.STEER, ET.SOFT_DISABLE, 3, "Take Control Immediately", "Technical Issues", 1., 3., 3.])
|
||||
app_alert([AI.ESP_OFF_SD, CM.REPEATED, BP.MUTE, AH.STEER, ET.SOFT_DISABLE, 3, "Take Control Immediately", "ESP Off", 1., 3., 3.])
|
||||
app_alert([AI.THERMAL_DEAD_SD, CM.REPEATED, BP.MUTE, AH.STEER, ET.SOFT_DISABLE, 3, "Take Control Immediately", "Thermal Unavailable", 1., 3., 3.])
|
||||
app_alert([AI.OVERHEAT_SD, CM.REPEATED, BP.MUTE, AH.STEER, ET.SOFT_DISABLE, 3, "Take Control Immediately", "System Overheated", 1., 3., 3.])
|
||||
app_alert([AI.CONTROLSD_LAG_SD, CM.REPEATED, BP.MUTE, AH.STEER, ET.SOFT_DISABLE, 3, "Take Control Immediately", "Controls Lagging", 1., 3., 3.])
|
||||
app_alert([AI.CALIB_INCOMPLETE_SD, CM.REPEATED, BP.MUTE, AH.STEER, ET.SOFT_DISABLE, 3, "Take Control Immediately", "Calibration in Progress", 1., 3., 3.])
|
||||
app_alert([AI.CALIB_INVALID_SD, CM.REPEATED, BP.MUTE, AH.STEER, ET.SOFT_DISABLE, 3, "Take Control Immediately", "Calibration Error", 1., 3., 3.])
|
||||
app_alert([AI.DRIVER_DISTRACTED, CM.REPEATED, BP.MUTE, AH.STEER, ET.SOFT_DISABLE, 2, "Take Control to Regain Speed", "User Distracted", 1., 1., 1.])
|
||||
115
selfdrive/controls/lib/alertmanager.py
Normal file
115
selfdrive/controls/lib/alertmanager.py
Normal file
@@ -0,0 +1,115 @@
|
||||
from cereal import car
|
||||
|
||||
class ET:
|
||||
ENABLE = 0
|
||||
NO_ENTRY = 1
|
||||
WARNING = 2
|
||||
SOFT_DISABLE = 3
|
||||
IMMEDIATE_DISABLE = 4
|
||||
USER_DISABLE = 5
|
||||
|
||||
class alert(object):
|
||||
def __init__(self, alert_text_1, alert_text_2, alert_type, visual_alert, audible_alert, duration_sound, duration_hud_alert, duration_text):
|
||||
self.alert_text_1 = alert_text_1
|
||||
self.alert_text_2 = alert_text_2
|
||||
self.alert_type = alert_type
|
||||
self.visual_alert = visual_alert if visual_alert is not None else "none"
|
||||
self.audible_alert = audible_alert if audible_alert is not None else "none"
|
||||
|
||||
self.duration_sound = duration_sound
|
||||
self.duration_hud_alert = duration_hud_alert
|
||||
self.duration_text = duration_text
|
||||
|
||||
# typecheck that enums are valid on startup
|
||||
tst = car.CarControl.new_message()
|
||||
tst.hudControl.visualAlert = self.visual_alert
|
||||
tst.hudControl.audibleAlert = self.audible_alert
|
||||
|
||||
def __str__(self):
|
||||
return self.alert_text_1 + "/" + self.alert_text_2 + " " + str(self.alert_type) + " " + str(self.visual_alert) + " " + str(self.audible_alert)
|
||||
|
||||
def __gt__(self, alert2):
|
||||
return self.alert_type > alert2.alert_type
|
||||
|
||||
class AlertManager(object):
|
||||
alerts = {
|
||||
"enable": alert("", "", ET.ENABLE, None, "beepSingle", .2, 0., 0.),
|
||||
"disable": alert("", "", ET.USER_DISABLE, None, "beepSingle", .2, 0., 0.),
|
||||
"pedalPressed": alert("Comma Unavailable", "Pedal Pressed", ET.NO_ENTRY, "brakePressed", "chimeDouble", .4, 2., 3.),
|
||||
"driverDistracted": alert("Take Control to Regain Speed", "User Distracted", ET.WARNING, "steerRequired", "chimeRepeated", 1., 1., 1.),
|
||||
"steerSaturated": alert("Take Control", "Steer Control Saturated", ET.WARNING, "steerRequired", "chimeSingle", 1., 2., 3.),
|
||||
"overheat": alert("Take Control Immediately", "System Overheated", ET.SOFT_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"controlsMismatch": alert("Take Control Immediately", "Controls Mismatch", ET.IMMEDIATE_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"radarCommIssue": alert("Take Control Immediately", "Radar Comm Issue", ET.IMMEDIATE_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"modelCommIssue": alert("Take Control Immediately", "Model Comm Issue", ET.IMMEDIATE_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"controlsFailed": alert("Take Control Immediately", "Controls Failed", ET.IMMEDIATE_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
# car errors
|
||||
"commIssue": alert("Take Control Immediately","Communication Issues", ET.IMMEDIATE_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"steerUnavailable": alert("Take Control Immediately","Steer Error", ET.IMMEDIATE_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"steerTemporarilyUnavailable": alert("Take Control", "Steer Temporarily Unavailable", ET.WARNING, "steerRequired", "chimeRepeated", 1., 2., 3.),
|
||||
"brakeUnavailable": alert("Take Control Immediately","Brake Error", ET.IMMEDIATE_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"gasUnavailable": alert("Take Control Immediately","Gas Error", ET.IMMEDIATE_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"wrongGear": alert("Take Control Immediately","Gear not D", ET.SOFT_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"reverseGear": alert("Take Control Immediately","Car in Reverse", ET.IMMEDIATE_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"doorOpen": alert("Take Control Immediately","Door Open", ET.SOFT_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"seatbeltNotLatched": alert("Take Control Immediately","Seatbelt Unlatched", ET.SOFT_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"espDisabled": alert("Take Control Immediately","ESP Off", ET.SOFT_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
"wrongCarMode": alert("Comma Unavailable","Main Switch Off", ET.NO_ENTRY, None, "chimeDouble", .4, 0., 3.),
|
||||
"outOfSpace": alert("Comma Unavailable","Out of Space", ET.NO_ENTRY, None, "chimeDouble", .4, 0., 3.),
|
||||
"ethicalDilemma": alert("Take Control Immediately","Ethical Dilemma Detected", ET.IMMEDIATE_DISABLE, "steerRequired", "chimeRepeated", 1., 3., 3.),
|
||||
}
|
||||
def __init__(self):
|
||||
self.activealerts = []
|
||||
self.current_alert = None
|
||||
|
||||
def alertPresent(self):
|
||||
return len(self.activealerts) > 0
|
||||
|
||||
def alertShouldSoftDisable(self):
|
||||
return len(self.activealerts) > 0 and self.activealerts[0].alert_type == ET.SOFT_DISABLE
|
||||
|
||||
def alertShouldDisable(self):
|
||||
return len(self.activealerts) > 0 and self.activealerts[0].alert_type >= ET.IMMEDIATE_DISABLE
|
||||
|
||||
def add(self, alert_type, enabled = True):
|
||||
this_alert = self.alerts[str(alert_type)]
|
||||
|
||||
# downgrade the alert if we aren't enabled
|
||||
if not enabled and this_alert.alert_type > ET.NO_ENTRY:
|
||||
this_alert = alert("Comma Unavailable" if this_alert.alert_text_1 != "" else "", this_alert.alert_text_2, ET.NO_ENTRY, None, "chimeDouble", .4, 0., 3.)
|
||||
|
||||
# ignore no entries if we are enabled
|
||||
if enabled and this_alert.alert_type < ET.WARNING:
|
||||
return
|
||||
|
||||
self.activealerts.append(this_alert)
|
||||
self.activealerts.sort()
|
||||
|
||||
def process_alerts(self, cur_time):
|
||||
if self.alertPresent():
|
||||
self.alert_start_time = cur_time
|
||||
self.current_alert = self.activealerts[0]
|
||||
print self.current_alert
|
||||
|
||||
alert_text_1 = ""
|
||||
alert_text_2 = ""
|
||||
visual_alert = "none"
|
||||
audible_alert = "none"
|
||||
|
||||
if self.current_alert is not None:
|
||||
# ewwwww
|
||||
if self.alert_start_time + self.current_alert.duration_sound > cur_time:
|
||||
audible_alert = self.current_alert.audible_alert
|
||||
|
||||
if self.alert_start_time + self.current_alert.duration_hud_alert > cur_time:
|
||||
visual_alert = self.current_alert.visual_alert
|
||||
|
||||
if self.alert_start_time + self.current_alert.duration_text > cur_time:
|
||||
alert_text_1 = self.current_alert.alert_text_1
|
||||
alert_text_2 = self.current_alert.alert_text_2
|
||||
|
||||
# reset
|
||||
self.activealerts = []
|
||||
|
||||
return alert_text_1, alert_text_2, visual_alert, audible_alert
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import numpy as np
|
||||
from common.numpy_fast import clip, interp
|
||||
|
||||
def rate_limit(new_value, last_value, dw_step, up_step):
|
||||
return np.clip(new_value, last_value + dw_step, last_value + up_step)
|
||||
return clip(new_value, last_value + dw_step, last_value + up_step)
|
||||
|
||||
def learn_angle_offset(lateral_control, v_ego, angle_offset, d_poly, y_des, steer_override):
|
||||
# simple integral controller that learns how much steering offset to put to have the car going straight
|
||||
@@ -11,12 +12,12 @@ def learn_angle_offset(lateral_control, v_ego, angle_offset, d_poly, y_des, stee
|
||||
min_learn_speed = 1.
|
||||
|
||||
# learn less at low speed or when turning
|
||||
alpha_v = alpha*(np.maximum(v_ego - min_learn_speed, 0.))/(1. + 0.5*abs(y_des))
|
||||
alpha_v = alpha*(max(v_ego - min_learn_speed, 0.))/(1. + 0.5*abs(y_des))
|
||||
|
||||
# only learn if lateral control is active and if driver is not overriding:
|
||||
if lateral_control and not steer_override:
|
||||
angle_offset += d_poly[3] * alpha_v
|
||||
angle_offset = np.clip(angle_offset, min_offset, max_offset)
|
||||
angle_offset = clip(angle_offset, min_offset, max_offset)
|
||||
|
||||
return angle_offset
|
||||
|
||||
@@ -44,7 +45,7 @@ def actuator_hystereses(final_brake, braking, brake_steady, v_ego, civic):
|
||||
brake_on_offset_v = [.25, .15] # min brake command on brake activation. below this no decel is perceived
|
||||
brake_on_offset_bp = [15., 30.] # offset changes VS speed to not have too abrupt decels at high speeds
|
||||
# offset the brake command for threshold in the brake system. no brake torque perceived below it
|
||||
brake_on_offset = np.interp(v_ego, brake_on_offset_bp, brake_on_offset_v)
|
||||
brake_on_offset = interp(v_ego, brake_on_offset_bp, brake_on_offset_v)
|
||||
brake_offset = brake_on_offset - brake_hyst_on
|
||||
if final_brake > 0.0:
|
||||
final_brake += brake_offset
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import math
|
||||
import numpy as np
|
||||
from common.numpy_fast import clip
|
||||
|
||||
def calc_curvature(v_ego, angle_steers, VP, angle_offset=0):
|
||||
deg_to_rad = np.pi/180.
|
||||
@@ -14,7 +16,7 @@ def calc_d_lookahead(v_ego):
|
||||
# sqrt on speed is needed to keep, for a given curvature, the y_offset
|
||||
# proportional to speed. Indeed, y_offset is prop to d_lookahead^2
|
||||
# 26m at 25m/s
|
||||
d_lookahead = offset_lookahead + np.sqrt(np.maximum(v_ego, 0)) * coeff_lookahead
|
||||
d_lookahead = offset_lookahead + math.sqrt(max(v_ego, 0)) * coeff_lookahead
|
||||
return d_lookahead
|
||||
|
||||
def calc_lookahead_offset(v_ego, angle_steers, d_lookahead, VP, angle_offset):
|
||||
@@ -53,7 +55,7 @@ def pid_lateral_control(v_ego, y_actual, y_des, Ui_steer, steer_max,
|
||||
Ui_steer -= Ui_unwind_speed * np.sign(Ui_steer)
|
||||
|
||||
# still, intergral term should not be bigger then limits
|
||||
Ui_steer = np.clip(Ui_steer, -steer_max, steer_max)
|
||||
Ui_steer = clip(Ui_steer, -steer_max, steer_max)
|
||||
|
||||
output_steer = Up_steer + Ui_steer
|
||||
|
||||
@@ -67,7 +69,7 @@ def pid_lateral_control(v_ego, y_actual, y_des, Ui_steer, steer_max,
|
||||
if abs(output_steer) > steer_max:
|
||||
lateral_control_sat = True
|
||||
|
||||
output_steer = np.clip(output_steer, -steer_max, steer_max)
|
||||
output_steer = clip(output_steer, -steer_max, steer_max)
|
||||
|
||||
# if lateral control is saturated for a certain period of time, send an alert for taking control of the car
|
||||
# wind
|
||||
@@ -81,7 +83,7 @@ def pid_lateral_control(v_ego, y_actual, y_des, Ui_steer, steer_max,
|
||||
if sat_count >= sat_count_limit:
|
||||
sat_flag = True
|
||||
|
||||
sat_count = np.clip(sat_count, 0, 1)
|
||||
sat_count = clip(sat_count, 0, 1)
|
||||
|
||||
return output_steer, Up_steer, Ui_steer, lateral_control_sat, sat_count, sat_flag
|
||||
|
||||
@@ -97,24 +99,24 @@ class LatControl(object):
|
||||
def reset(self):
|
||||
self.Ui_steer = 0.
|
||||
|
||||
def update(self, enabled, CS, d_poly, angle_offset):
|
||||
def update(self, enabled, v_ego, angle_steers, steer_override, d_poly, angle_offset, VP):
|
||||
rate = 100
|
||||
|
||||
steer_max = 1.0
|
||||
|
||||
# how far we look ahead is function of speed
|
||||
d_lookahead = calc_d_lookahead(CS.v_ego)
|
||||
d_lookahead = calc_d_lookahead(v_ego)
|
||||
|
||||
# calculate actual offset at the lookahead point
|
||||
self.y_actual, _ = calc_lookahead_offset(CS.v_ego, CS.angle_steers,
|
||||
d_lookahead, CS.VP, angle_offset)
|
||||
self.y_actual, _ = calc_lookahead_offset(v_ego, angle_steers,
|
||||
d_lookahead, VP, angle_offset)
|
||||
|
||||
# desired lookahead offset
|
||||
self.y_des = np.polyval(d_poly, d_lookahead)
|
||||
|
||||
output_steer, self.Up_steer, self.Ui_steer, self.lateral_control_sat, self.sat_count, sat_flag = pid_lateral_control(
|
||||
CS.v_ego, self.y_actual, self.y_des, self.Ui_steer, steer_max,
|
||||
CS.steer_override, self.sat_count, enabled, CS.torque_mod, rate)
|
||||
v_ego, self.y_actual, self.y_des, self.Ui_steer, steer_max,
|
||||
steer_override, self.sat_count, enabled, VP.torque_mod, rate)
|
||||
|
||||
final_steer = np.clip(output_steer, -steer_max, steer_max)
|
||||
final_steer = clip(output_steer, -steer_max, steer_max)
|
||||
return final_steer, sat_flag
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import numpy as np
|
||||
from common.numpy_fast import clip, interp
|
||||
from selfdrive.config import Conversions as CV
|
||||
|
||||
class LongCtrlState:
|
||||
@@ -82,15 +83,18 @@ def get_compute_gb():
|
||||
# takes in [desired_accel, current_speed] -> [-1.0, 1.0] where -1.0 is max brake and 1.0 is max gas
|
||||
compute_gb = get_compute_gb()
|
||||
|
||||
|
||||
_KP_BP = [0., 5., 35.]
|
||||
_KP_V = [1.2, 0.8, 0.5]
|
||||
|
||||
_kI_BP = [0., 35.]
|
||||
_kI_V = [0.18, 0.12]
|
||||
|
||||
def pid_long_control(v_ego, v_pid, Ui_accel_cmd, gas_max, brake_max, jerk_factor, gear, rate):
|
||||
#*** This function compute the gb pedal positions in order to track the desired speed
|
||||
# proportional and integral terms. More precision at low speed
|
||||
Kp_v = [1.2, 0.8, 0.5]
|
||||
Kp_bp = [0., 5., 35.]
|
||||
Kp = np.interp(v_ego, Kp_bp, Kp_v)
|
||||
Ki_v = [0.18, 0.12]
|
||||
Ki_bp = [0., 35.]
|
||||
Ki = np.interp(v_ego, Ki_bp, Ki_v)
|
||||
Kp = interp(v_ego, _KP_BP, _KP_V)
|
||||
Ki = interp(v_ego, _kI_BP, _kI_V)
|
||||
|
||||
# scle Kp and Ki by jerk factor drom drive_thread
|
||||
Kp = (1. + jerk_factor)*Kp
|
||||
@@ -98,7 +102,7 @@ def pid_long_control(v_ego, v_pid, Ui_accel_cmd, gas_max, brake_max, jerk_factor
|
||||
|
||||
# this is ugly but can speed reports 0 when speed<0.3m/s and we can't have that jump
|
||||
v_ego_min = 0.3
|
||||
v_ego = np.maximum(v_ego, v_ego_min)
|
||||
v_ego = max(v_ego, v_ego_min)
|
||||
|
||||
v_error = v_pid - v_ego
|
||||
|
||||
@@ -107,7 +111,7 @@ def pid_long_control(v_ego, v_pid, Ui_accel_cmd, gas_max, brake_max, jerk_factor
|
||||
accel_cmd_new = Ui_accel_cmd_new + Up_accel_cmd
|
||||
output_gb_new = compute_gb([accel_cmd_new, v_ego])
|
||||
|
||||
# Anti-wind up for integrator: only update integrator if we not against the thottle and brake limits
|
||||
# Anti-wind up for integrator: only update integrator if we not against the throttle and brake limits
|
||||
# do not wind up if we are changing gear and we are on the gas pedal
|
||||
if (((v_error >= 0. and (output_gb_new < gas_max or Ui_accel_cmd < 0)) or
|
||||
(v_error <= 0. and (output_gb_new > - brake_max or Ui_accel_cmd > 0))) and
|
||||
@@ -126,7 +130,7 @@ def pid_long_control(v_ego, v_pid, Ui_accel_cmd, gas_max, brake_max, jerk_factor
|
||||
if output_gb > gas_max or output_gb < -brake_max:
|
||||
long_control_sat = True
|
||||
|
||||
output_gb = np.clip(output_gb, -brake_max, gas_max)
|
||||
output_gb = clip(output_gb, -brake_max, gas_max)
|
||||
|
||||
return output_gb, Up_accel_cmd, Ui_accel_cmd, long_control_sat
|
||||
|
||||
@@ -136,8 +140,8 @@ starting_brake_rate = 0.6 # brake_travel/s while releasing on restart
|
||||
starting_Ui = 0.5 # Since we don't have much info about acceleration at this point, be conservative
|
||||
brake_stopping_target = 0.5 # apply at least this amount of brake to maintain the vehicle stationary
|
||||
|
||||
max_speed_error_v = [1.5, .8] # max positive v_pid error VS actual speed; this avoids controls windup due to slow pedal resp
|
||||
max_speed_error_bp = [0., 30.] # speed breakpoints
|
||||
_MAX_SPEED_ERROR_BP = [0., 30.] # speed breakpoints
|
||||
_MAX_SPEED_ERROR_V = [1.5, .8] # max positive v_pid error VS actual speed; this avoids controls windup due to slow pedal resp
|
||||
|
||||
class LongControl(object):
|
||||
def __init__(self):
|
||||
@@ -151,19 +155,20 @@ class LongControl(object):
|
||||
self.Ui_accel_cmd = 0.
|
||||
self.v_pid = v_pid
|
||||
|
||||
def update(self, enabled, CS, v_cruise, v_target_lead, a_target, jerk_factor):
|
||||
# TODO: not every time
|
||||
if CS.brake_only:
|
||||
gas_max_v = [0, 0] # values
|
||||
else:
|
||||
gas_max_v = [0.6, 0.6] # values
|
||||
gas_max_bp = [0., 100.] # speeds
|
||||
brake_max_v = [1.0, 1.0, 0.8, 0.8] # values
|
||||
def update(self, enabled, v_ego, v_cruise, v_target_lead, a_target, jerk_factor, VP):
|
||||
brake_max_bp = [0., 5., 20., 100.] # speeds
|
||||
brake_max_v = [1.0, 1.0, 0.8, 0.8] # values
|
||||
|
||||
# brake and gas limits
|
||||
brake_max = np.interp(CS.v_ego, brake_max_bp, brake_max_v)
|
||||
gas_max = np.interp(CS.v_ego, gas_max_bp, gas_max_v)
|
||||
brake_max = interp(v_ego, brake_max_bp, brake_max_v)
|
||||
|
||||
# TODO: not every time
|
||||
if VP.brake_only:
|
||||
gas_max = 0
|
||||
else:
|
||||
gas_max_bp = [0., 100.] # speeds
|
||||
gas_max_v = [0.6, 0.6] # values
|
||||
gas_max = interp(v_ego, gas_max_bp, gas_max_v)
|
||||
|
||||
overshoot_allowance = 2.0 # overshoot allowed when changing accel sign
|
||||
|
||||
@@ -172,30 +177,30 @@ class LongControl(object):
|
||||
|
||||
# limit max target speed based on cruise setting:
|
||||
v_cruise_mph = round(v_cruise * CV.KPH_TO_MPH) # what's displayed in mph on the IC
|
||||
v_target = np.minimum(v_target_lead, v_cruise_mph * CV.MPH_TO_MS / CS.ui_speed_fudge)
|
||||
v_target = min(v_target_lead, v_cruise_mph * CV.MPH_TO_MS / VP.ui_speed_fudge)
|
||||
|
||||
max_speed_delta_up = a_target[1]*1.0/rate
|
||||
max_speed_delta_down = a_target[0]*1.0/rate
|
||||
|
||||
# *** long control substate transitions
|
||||
self.long_control_state = long_control_state_trans(enabled, self.long_control_state, CS.v_ego, v_target, self.v_pid, output_gb)
|
||||
self.long_control_state = long_control_state_trans(enabled, self.long_control_state, v_ego, v_target, self.v_pid, output_gb)
|
||||
|
||||
# *** long control behavior based on state
|
||||
# TODO: move this to drive_helpers
|
||||
# disabled
|
||||
if self.long_control_state == LongCtrlState.off:
|
||||
self.v_pid = CS.v_ego # do nothing
|
||||
self.v_pid = v_ego # do nothing
|
||||
output_gb = 0.
|
||||
self.Ui_accel_cmd = 0.
|
||||
# tracking objects and driving
|
||||
elif self.long_control_state == LongCtrlState.pid:
|
||||
#reset v_pid close to v_ego if it was too far and new v_target is closer to v_ego
|
||||
if ((self.v_pid > CS.v_ego + overshoot_allowance) and
|
||||
if ((self.v_pid > v_ego + overshoot_allowance) and
|
||||
(v_target < self.v_pid)):
|
||||
self.v_pid = np.maximum(v_target, CS.v_ego + overshoot_allowance)
|
||||
elif ((self.v_pid < CS.v_ego - overshoot_allowance) and
|
||||
self.v_pid = max(v_target, v_ego + overshoot_allowance)
|
||||
elif ((self.v_pid < v_ego - overshoot_allowance) and
|
||||
(v_target > self.v_pid)):
|
||||
self.v_pid = np.minimum(v_target, CS.v_ego - overshoot_allowance)
|
||||
self.v_pid = min(v_target, v_ego - overshoot_allowance)
|
||||
|
||||
# move v_pid no faster than allowed accel limits
|
||||
if (v_target > self.v_pid + max_speed_delta_up):
|
||||
@@ -206,27 +211,29 @@ class LongControl(object):
|
||||
self.v_pid = v_target
|
||||
|
||||
# to avoid too much wind up on acceleration, limit positive speed error
|
||||
if not CS.brake_only:
|
||||
max_speed_error = np.interp(CS.v_ego, max_speed_error_bp, max_speed_error_v)
|
||||
self.v_pid = np.minimum(self.v_pid, CS.v_ego + max_speed_error)
|
||||
if not VP.brake_only:
|
||||
max_speed_error = interp(v_ego, _MAX_SPEED_ERROR_BP, _MAX_SPEED_ERROR_V)
|
||||
self.v_pid = min(self.v_pid, v_ego + max_speed_error)
|
||||
|
||||
output_gb, self.Up_accel_cmd, self.Ui_accel_cmd, self.long_control_sat = pid_long_control(CS.v_ego, self.v_pid, \
|
||||
self.Ui_accel_cmd, gas_max, brake_max, jerk_factor, CS.gear, rate)
|
||||
# TODO: removed anti windup on gear change, does it matter?
|
||||
output_gb, self.Up_accel_cmd, self.Ui_accel_cmd, self.long_control_sat = pid_long_control(v_ego, self.v_pid, \
|
||||
self.Ui_accel_cmd, gas_max, brake_max, jerk_factor, 0, rate)
|
||||
# intention is to stop, switch to a different brake control until we stop
|
||||
elif self.long_control_state == LongCtrlState.stopping:
|
||||
if CS.v_ego > 0. or output_gb > -brake_stopping_target or not CS.standstill:
|
||||
if v_ego > 0. or output_gb > -brake_stopping_target:
|
||||
output_gb -= stopping_brake_rate/rate
|
||||
output_gb = np.clip(output_gb, -brake_max, gas_max)
|
||||
self.v_pid = CS.v_ego
|
||||
output_gb = clip(output_gb, -brake_max, gas_max)
|
||||
self.v_pid = v_ego
|
||||
self.Ui_accel_cmd = 0.
|
||||
# intention is to move again, release brake fast before handling control to PID
|
||||
elif self.long_control_state == LongCtrlState.starting:
|
||||
if output_gb < -0.2:
|
||||
output_gb += starting_brake_rate/rate
|
||||
self.v_pid = CS.v_ego
|
||||
self.v_pid = v_ego
|
||||
self.Ui_accel_cmd = starting_Ui
|
||||
|
||||
self.last_output_gb = output_gb
|
||||
final_gas = np.clip(output_gb, 0., gas_max)
|
||||
final_brake = -np.clip(output_gb, -brake_max, 0.)
|
||||
final_gas = clip(output_gb, 0., gas_max)
|
||||
final_brake = -clip(output_gb, -brake_max, 0.)
|
||||
return final_gas, final_brake
|
||||
|
||||
|
||||
@@ -1,26 +1,36 @@
|
||||
import selfdrive.messaging as messaging
|
||||
import math
|
||||
import numpy as np
|
||||
X_PATH = np.arange(0.0, 50.0)
|
||||
|
||||
def model_polyfit(points):
|
||||
return np.polyfit(X_PATH, map(float, points), 3)
|
||||
from common.numpy_fast import interp
|
||||
import selfdrive.messaging as messaging
|
||||
|
||||
|
||||
def compute_path_pinv():
|
||||
deg = 3
|
||||
x = np.arange(50.0)
|
||||
X = np.vstack(tuple(x**n for n in range(deg, -1, -1))).T
|
||||
pinv = np.linalg.pinv(X)
|
||||
return pinv
|
||||
|
||||
def model_polyfit(points, path_pinv):
|
||||
return np.dot(path_pinv, map(float, points))
|
||||
|
||||
# lane width http://safety.fhwa.dot.gov/geometric/pubs/mitigationstrategies/chapter3/3_lanewidth.cfm
|
||||
_LANE_WIDTH_V = np.asarray([3., 3.8])
|
||||
_LANE_WIDTH_V = [3., 3.8]
|
||||
|
||||
# break points of speed
|
||||
_LANE_WIDTH_BP = np.asarray([0., 31.])
|
||||
_LANE_WIDTH_BP = [0., 31.]
|
||||
|
||||
def calc_desired_path(l_poly, r_poly, p_poly, l_prob, r_prob, p_prob, speed):
|
||||
#*** this function computes the poly for the center of the lane, averaging left and right polys
|
||||
lane_width = np.interp(speed, _LANE_WIDTH_BP, _LANE_WIDTH_V)
|
||||
lane_width = interp(speed, _LANE_WIDTH_BP, _LANE_WIDTH_V)
|
||||
|
||||
# lanes in US are ~3.6m wide
|
||||
half_lane_poly = np.array([0., 0., 0., lane_width / 2.])
|
||||
if l_prob + r_prob > 0.01:
|
||||
c_poly = ((l_poly - half_lane_poly) * l_prob +
|
||||
(r_poly + half_lane_poly) * r_prob) / (l_prob + r_prob)
|
||||
c_prob = np.sqrt((l_prob**2 + r_prob**2) / 2.)
|
||||
c_prob = math.sqrt((l_prob**2 + r_prob**2) / 2.)
|
||||
else:
|
||||
c_poly = np.zeros(4)
|
||||
c_prob = 0.
|
||||
@@ -37,24 +47,26 @@ class PathPlanner(object):
|
||||
self.last_model = 0.
|
||||
self.logMonoTime = 0
|
||||
self.lead_dist, self.lead_prob, self.lead_var = 0, 0, 1
|
||||
self._path_pinv = compute_path_pinv()
|
||||
|
||||
def update(self, cur_time, v_ego):
|
||||
md = messaging.recv_sock(self.model)
|
||||
|
||||
if md is not None:
|
||||
self.logMonoTime = md.logMonoTime
|
||||
p_poly = model_polyfit(md.model.path.points) # predicted path
|
||||
p_prob = 1. # model does not tell this probability yet, so set to 1 for now
|
||||
l_poly = model_polyfit(md.model.leftLane.points) # left line
|
||||
l_prob = md.model.leftLane.prob # left line prob
|
||||
r_poly = model_polyfit(md.model.rightLane.points) # right line
|
||||
r_prob = md.model.rightLane.prob # right line prob
|
||||
p_poly = model_polyfit(md.model.path.points, self._path_pinv) # predicted path
|
||||
l_poly = model_polyfit(md.model.leftLane.points, self._path_pinv) # left line
|
||||
r_poly = model_polyfit(md.model.rightLane.points, self._path_pinv) # right line
|
||||
|
||||
p_prob = 1. # model does not tell this probability yet, so set to 1 for now
|
||||
l_prob = md.model.leftLane.prob # left line prob
|
||||
r_prob = md.model.rightLane.prob # right line prob
|
||||
|
||||
self.lead_dist = md.model.lead.dist
|
||||
self.lead_prob = md.model.lead.prob
|
||||
self.lead_var = md.model.lead.std**2
|
||||
|
||||
#*** compute target path ***
|
||||
# compute target path
|
||||
self.d_poly, _, _ = calc_desired_path(l_poly, r_poly, p_poly, l_prob, r_prob, p_prob, v_ego)
|
||||
|
||||
self.last_model = cur_time
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import numpy as np
|
||||
import platform
|
||||
import os
|
||||
import sys
|
||||
import math
|
||||
import platform
|
||||
import numpy as np
|
||||
|
||||
from common.numpy_fast import clip, interp
|
||||
from common.kalman.ekf import FastEKF1D, SimpleSensor
|
||||
|
||||
# radar tracks
|
||||
@@ -51,14 +53,14 @@ class Track(object):
|
||||
else:
|
||||
# estimate acceleration
|
||||
a_rel_unfilt = (self.vRel - self.vRelPrev) / ts
|
||||
a_rel_unfilt = np.clip(a_rel_unfilt, -10., 10.)
|
||||
a_rel_unfilt = clip(a_rel_unfilt, -10., 10.)
|
||||
self.aRel = k_a_lead * a_rel_unfilt + (1 - k_a_lead) * self.aRel
|
||||
|
||||
v_lat_unfilt = (self.dPath - self.dPathPrev) / ts
|
||||
self.vLat = k_v_lat * v_lat_unfilt + (1 - k_v_lat) * self.vLat
|
||||
|
||||
a_lead_unfilt = (self.vLead - self.vLeadPrev) / ts
|
||||
a_lead_unfilt = np.clip(a_lead_unfilt, -10., 10.)
|
||||
a_lead_unfilt = clip(a_lead_unfilt, -10., 10.)
|
||||
self.aLead = k_a_lead * a_lead_unfilt + (1 - k_a_lead) * self.aLead
|
||||
|
||||
if self.stationary:
|
||||
@@ -232,12 +234,12 @@ class Cluster(object):
|
||||
d_path = self.dPath
|
||||
|
||||
if enabled:
|
||||
t_lookahead = np.interp(self.dRel, t_lookahead_bp, t_lookahead_v)
|
||||
t_lookahead = interp(self.dRel, t_lookahead_bp, t_lookahead_v)
|
||||
# correct d_path for lookahead time, considering only cut-ins and no more than 1m impact
|
||||
lat_corr = np.clip(t_lookahead * self.vLat, -1, 0)
|
||||
lat_corr = clip(t_lookahead * self.vLat, -1, 0)
|
||||
else:
|
||||
lat_corr = 0.
|
||||
d_path = np.maximum(d_path + lat_corr, 0)
|
||||
d_path = max(d_path + lat_corr, 0)
|
||||
|
||||
if d_path < 1.5 and not self.stationary and not self.oncoming:
|
||||
return True
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
import zmq
|
||||
import numpy as np
|
||||
import numpy.matlib
|
||||
@@ -7,9 +8,7 @@ from collections import defaultdict
|
||||
from fastcluster import linkage_vector
|
||||
|
||||
import selfdrive.messaging as messaging
|
||||
from selfdrive.boardd.boardd import can_capnp_to_can_list_old
|
||||
from selfdrive.controls.lib.latcontrol import calc_lookahead_offset
|
||||
from selfdrive.controls.lib.can_parser import CANParser
|
||||
from selfdrive.controls.lib.pathplanner import PathPlanner
|
||||
from selfdrive.config import VehicleParams
|
||||
from selfdrive.controls.lib.radar_helpers import Track, Cluster, fcluster, RDR_TO_LDR
|
||||
@@ -18,10 +17,16 @@ from common.services import service_list
|
||||
from common.realtime import sec_since_boot, set_realtime_priority, Ratekeeper
|
||||
from common.kalman.ekf import EKF, SimpleSensor
|
||||
|
||||
radar_type = os.getenv("RADAR")
|
||||
if radar_type is not None:
|
||||
exec('from selfdrive.radar.'+car_type+'.interface import RadarInterface')
|
||||
else:
|
||||
from selfdrive.radar.nidec.interface import RadarInterface
|
||||
|
||||
#vision point
|
||||
DIMSV = 2
|
||||
XV, SPEEDV = 0, 1
|
||||
VISION_POINT = 1
|
||||
VISION_POINT = -1
|
||||
|
||||
class EKFV1D(EKF):
|
||||
def __init__(self):
|
||||
@@ -31,7 +36,6 @@ class EKFV1D(EKF):
|
||||
self.var_init = 1e2 # ~ model variance when probability is 70%, so good starting point
|
||||
self.covar = self.identity * self.var_init
|
||||
|
||||
# self.process_noise = np.asmatrix(np.diag([100, 10]))
|
||||
self.process_noise = np.matlib.diag([0.5, 1])
|
||||
|
||||
def calc_transfer_fun(self, dt):
|
||||
@@ -41,30 +45,6 @@ class EKFV1D(EKF):
|
||||
return tf, tfj
|
||||
|
||||
|
||||
# nidec radar decoding
|
||||
def nidec_decode(cp, ar_pts):
|
||||
for ii in cp.msgs_upd:
|
||||
# filter points with very big distance, as fff (~255) is invalid. FIXME: use VAL tables from dbc
|
||||
if cp.vl[ii]['LONG_DIST'] < 255:
|
||||
ar_pts[ii] = [cp.vl[ii]['LONG_DIST'] + RDR_TO_LDR,
|
||||
-cp.vl[ii]['LAT_DIST'], cp.vl[ii]['REL_SPEED'], np.nan,
|
||||
cp.ts[ii], cp.vl[ii]['NEW_TRACK'], cp.ct[ii]]
|
||||
elif ii in ar_pts:
|
||||
del ar_pts[ii]
|
||||
return ar_pts
|
||||
|
||||
|
||||
def _create_radard_can_parser():
|
||||
dbc_f = 'acura_ilx_2016_nidec.dbc'
|
||||
radar_messages = range(0x430, 0x43A) + range(0x440, 0x446)
|
||||
signals = zip(['LONG_DIST'] * 16 + ['NEW_TRACK'] * 16 + ['LAT_DIST'] * 16 +
|
||||
['REL_SPEED'] * 16, radar_messages * 4,
|
||||
[255] * 16 + [1] * 16 + [0] * 16 + [0] * 16)
|
||||
checks = zip(radar_messages, [20]*16)
|
||||
|
||||
return CANParser(dbc_f, signals, checks)
|
||||
|
||||
|
||||
# fuses camera and radar data for best lead detection
|
||||
def radard_thread(gctx=None):
|
||||
set_realtime_priority(1)
|
||||
@@ -73,10 +53,10 @@ def radard_thread(gctx=None):
|
||||
|
||||
# *** subscribe to features and model from visiond
|
||||
model = messaging.sub_sock(context, service_list['model'].port)
|
||||
logcan = messaging.sub_sock(context, service_list['can'].port)
|
||||
live100 = messaging.sub_sock(context, service_list['live100'].port)
|
||||
|
||||
PP = PathPlanner(model)
|
||||
RI = RadarInterface()
|
||||
|
||||
# *** publish live20 and liveTracks
|
||||
live20 = messaging.pub_sock(context, service_list['live20'].port)
|
||||
@@ -84,9 +64,8 @@ def radard_thread(gctx=None):
|
||||
|
||||
# subscribe to stats about the car
|
||||
# TODO: move this to new style packet
|
||||
VP = VehicleParams(False) # same for ILX and civic
|
||||
VP = VehicleParams(False, False) # same for ILX and civic
|
||||
|
||||
ar_pts = {}
|
||||
path_x = np.arange(0.0, 140.0, 0.1) # 140 meters is max
|
||||
|
||||
# Time-alignment
|
||||
@@ -100,9 +79,6 @@ def radard_thread(gctx=None):
|
||||
|
||||
tracks = defaultdict(dict)
|
||||
|
||||
# Nidec
|
||||
cp = _create_radard_can_parser()
|
||||
|
||||
# Kalman filter stuff:
|
||||
ekfv = EKFV1D()
|
||||
speedSensorV = SimpleSensor(XV, 1, 2)
|
||||
@@ -114,23 +90,11 @@ def radard_thread(gctx=None):
|
||||
|
||||
rk = Ratekeeper(rate, print_delay_threshold=np.inf)
|
||||
while 1:
|
||||
canMonoTimes = []
|
||||
can_pub_radar = []
|
||||
for a in messaging.drain_sock(logcan, wait_for_one=True):
|
||||
canMonoTimes.append(a.logMonoTime)
|
||||
can_pub_radar.extend(can_capnp_to_can_list_old(a, [1, 3]))
|
||||
rr = RI.update()
|
||||
|
||||
# only run on the 0x445 packets, used for timing
|
||||
if not any(x[0] == 0x445 for x in can_pub_radar):
|
||||
continue
|
||||
|
||||
cp.update_can(can_pub_radar)
|
||||
|
||||
if not cp.can_valid:
|
||||
# TODO: handle this
|
||||
pass
|
||||
|
||||
ar_pts = nidec_decode(cp, ar_pts)
|
||||
ar_pts = {}
|
||||
for pt in rr.points:
|
||||
ar_pts[pt.trackId] = [pt.dRel + RDR_TO_LDR, pt.yRel, pt.vRel, pt.aRel, None, False, None]
|
||||
|
||||
# receive the live100s
|
||||
l100 = messaging.recv_sock(live100)
|
||||
@@ -184,7 +148,7 @@ def radard_thread(gctx=None):
|
||||
v_ego_t_aligned = np.interp(cur_time - rdr_delay, v_ego_array[1], v_ego_array[0])
|
||||
d_path = np.sqrt(np.amin((path_x - rpt[0]) ** 2 + (path_y - rpt[1]) ** 2))
|
||||
|
||||
# create the track
|
||||
# create the track if it doesn't exist or it's a new track
|
||||
if ids not in tracks or rpt[5] == 1:
|
||||
tracks[ids] = Track()
|
||||
tracks[ids].update(rpt[0], rpt[1], rpt[2], d_path, v_ego_t_aligned)
|
||||
@@ -246,7 +210,7 @@ def radard_thread(gctx=None):
|
||||
dat = messaging.new_message()
|
||||
dat.init('live20')
|
||||
dat.live20.mdMonoTime = PP.logMonoTime
|
||||
dat.live20.canMonoTimes = canMonoTimes
|
||||
dat.live20.canMonoTimes = list(rr.canMonoTimes)
|
||||
if lead_len > 0:
|
||||
lead_clusters[0].toLive20(dat.live20.leadOne)
|
||||
if lead2_len > 0:
|
||||
|
||||
31
selfdrive/debug/dump.py
Executable file
31
selfdrive/debug/dump.py
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env python
|
||||
import sys
|
||||
import argparse
|
||||
import zmq
|
||||
from hexdump import hexdump
|
||||
|
||||
import selfdrive.messaging as messaging
|
||||
from common.services import service_list
|
||||
|
||||
if __name__ == "__main__":
|
||||
context = zmq.Context()
|
||||
poller = zmq.Poller()
|
||||
|
||||
parser = argparse.ArgumentParser(description='Sniff a communcation socket')
|
||||
parser.add_argument('--raw', action='store_true')
|
||||
parser.add_argument("socket", type=str,
|
||||
help="socket name")
|
||||
args = parser.parse_args()
|
||||
|
||||
messaging.sub_sock(context, service_list[args.socket].port, poller)
|
||||
|
||||
while 1:
|
||||
polld = poller.poll(timeout=1000)
|
||||
for sock, mode in polld:
|
||||
if mode != zmq.POLLIN:
|
||||
continue
|
||||
if args.raw:
|
||||
hexdump(sock.recv())
|
||||
else:
|
||||
print messaging.recv_sock(sock)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import os
|
||||
|
||||
# fetch from environment
|
||||
DONGLE_ID = os.getenv("DONGLE_ID")
|
||||
DONGLE_SECRET = os.getenv("DONGLE_SECRET")
|
||||
def get_dongle_id_and_secret():
|
||||
return os.getenv("DONGLE_ID"), os.getenv("DONGLE_SECRET")
|
||||
|
||||
ROOT = '/sdcard/realdata/'
|
||||
|
||||
|
||||
@@ -75,10 +75,17 @@ def main(gctx=None):
|
||||
rotate_msg = messaging.log.LogRotate.new_message()
|
||||
rotate_msg.segmentNum = cur_part
|
||||
rotate_msg.path = cur_dir
|
||||
|
||||
vision_control_sock.send(rotate_msg.to_bytes())
|
||||
|
||||
finally:
|
||||
cloudlog.info("loggerd exiting...")
|
||||
|
||||
# tell visiond to stop logging
|
||||
rotate_msg = messaging.log.LogRotate.new_message()
|
||||
rotate_msg.segmentNum = -1
|
||||
rotate_msg.path = "/dev/null"
|
||||
vision_control_sock.send(rotate_msg.to_bytes())
|
||||
|
||||
# stop logging
|
||||
logger.stop()
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -9,11 +9,14 @@ import requests
|
||||
import traceback
|
||||
import threading
|
||||
|
||||
from collections import Counter
|
||||
from selfdrive.swaglog import cloudlog
|
||||
from selfdrive.loggerd.config import DONGLE_ID, DONGLE_SECRET, ROOT
|
||||
from selfdrive.loggerd.config import get_dongle_id_and_secret, ROOT
|
||||
|
||||
from common.api import api_get
|
||||
|
||||
fake_upload = os.getenv("FAKEUPLOAD") is not None
|
||||
|
||||
def raise_on_thread(t, exctype):
|
||||
for ctid, tobj in threading._active.items():
|
||||
if tobj is t:
|
||||
@@ -84,6 +87,8 @@ class Uploader(object):
|
||||
cloudlog.exception("clean_dirs failed")
|
||||
|
||||
def gen_upload_files(self):
|
||||
if not os.path.isdir(self.root):
|
||||
return
|
||||
for logname in listdir_by_creation_date(self.root):
|
||||
path = os.path.join(self.root, logname)
|
||||
names = os.listdir(path)
|
||||
@@ -96,6 +101,14 @@ class Uploader(object):
|
||||
|
||||
yield (name, key, fn)
|
||||
|
||||
def get_data_stats(self):
|
||||
name_counts = Counter()
|
||||
total_size = 0
|
||||
for name, key, fn in self.gen_upload_files():
|
||||
name_counts[name] += 1
|
||||
total_size += os.stat(fn).st_size
|
||||
return dict(name_counts), total_size
|
||||
|
||||
def next_file_to_upload(self):
|
||||
# try to upload log files first
|
||||
for name, key, fn in self.gen_upload_files():
|
||||
@@ -118,8 +131,15 @@ class Uploader(object):
|
||||
url = url_resp.text
|
||||
cloudlog.info({"upload_url", url})
|
||||
|
||||
with open(fn, "rb") as f:
|
||||
self.last_resp = requests.put(url, data=f)
|
||||
if fake_upload:
|
||||
print "*** WARNING, THIS IS A FAKE UPLOAD TO %s ***" % url
|
||||
class FakeResponse(object):
|
||||
def __init__(self):
|
||||
self.status_code = 200
|
||||
self.last_resp = FakeResponse()
|
||||
else:
|
||||
with open(fn, "rb") as f:
|
||||
self.last_resp = requests.put(url, data=f)
|
||||
except Exception as e:
|
||||
self.last_exc = (e, traceback.format_exc())
|
||||
raise
|
||||
@@ -203,7 +223,13 @@ class Uploader(object):
|
||||
def uploader_fn(exit_event):
|
||||
cloudlog.info("uploader_fn")
|
||||
|
||||
uploader = Uploader(DONGLE_ID, DONGLE_SECRET, ROOT)
|
||||
dongle_id, dongle_secret = get_dongle_id_and_secret()
|
||||
|
||||
if dongle_id is None or dongle_secret is None:
|
||||
cloudlog.info("uploader MISSING DONGLE_ID or DONGLE_SECRET")
|
||||
raise Exception("uploader can't start without dongle id and secret")
|
||||
|
||||
uploader = Uploader(dongle_id, dongle_secret, ROOT)
|
||||
|
||||
while True:
|
||||
backoff = 0.1
|
||||
|
||||
@@ -6,7 +6,7 @@ import selfdrive.messaging as messaging
|
||||
|
||||
def main(gctx):
|
||||
# setup logentries. we forward log messages to it
|
||||
le_token = "bc65354a-b887-4ef4-8525-15dd51230e8c"
|
||||
le_token = "e8549616-0798-4d7e-a2ca-2513ae81fa17"
|
||||
le_handler = LogentriesHandler(le_token, use_tls=False)
|
||||
|
||||
le_level = 20 #logging.INFO
|
||||
|
||||
@@ -18,9 +18,12 @@ from selfdrive.swaglog import cloudlog
|
||||
import selfdrive.messaging as messaging
|
||||
from selfdrive.thermal import read_thermal
|
||||
from selfdrive.registration import register
|
||||
from selfdrive.loggerd.uploader import Uploader
|
||||
|
||||
import common.crash
|
||||
|
||||
from selfdrive.loggerd.config import ROOT
|
||||
|
||||
# comment out anything you don't want to run
|
||||
managed_processes = {
|
||||
"uploader": "selfdrive.loggerd.uploader",
|
||||
@@ -29,7 +32,6 @@ managed_processes = {
|
||||
"calibrationd": "selfdrive.calibrationd.calibrationd",
|
||||
"loggerd": "selfdrive.loggerd.loggerd",
|
||||
"logmessaged": "selfdrive.logmessaged",
|
||||
#"boardd": "selfdrive.boardd.boardd",
|
||||
"logcatd": ("logcatd", ["./logcatd"]),
|
||||
"boardd": ("boardd", ["./boardd"]), # switch to c++ boardd
|
||||
"ui": ("ui", ["./ui"]),
|
||||
@@ -38,16 +40,18 @@ managed_processes = {
|
||||
|
||||
running = {}
|
||||
|
||||
car_started_processes = ['controlsd', 'loggerd', 'visiond', 'sensord', 'radard', 'calibrationd']
|
||||
# due to qualcomm kernel bugs SIGKILLing visiond sometimes causes page table corruption
|
||||
unkillable_processes = ['visiond']
|
||||
|
||||
# processes to end with SIGINT instead of SIGTERM
|
||||
interrupt_processes = ['loggerd']
|
||||
|
||||
car_started_processes = ['controlsd', 'loggerd', 'sensord', 'radard', 'calibrationd', 'visiond']
|
||||
|
||||
|
||||
# ****************** process management functions ******************
|
||||
def launcher(proc, gctx):
|
||||
try:
|
||||
# unset the signals
|
||||
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||
signal.signal(signal.SIGTERM, signal.SIG_DFL)
|
||||
|
||||
# import the process
|
||||
mod = importlib.import_module(proc)
|
||||
|
||||
@@ -56,6 +60,8 @@ def launcher(proc, gctx):
|
||||
|
||||
# exec the process
|
||||
mod.main(gctx)
|
||||
except KeyboardInterrupt:
|
||||
cloudlog.info("child %s got ctrl-c" % proc)
|
||||
except Exception:
|
||||
# can't install the crash handler becuase sys.excepthook doesn't play nice
|
||||
# with threads, so catch it here.
|
||||
@@ -91,15 +97,30 @@ def kill_managed_process(name):
|
||||
if name not in running or name not in managed_processes:
|
||||
return
|
||||
cloudlog.info("killing %s" % name)
|
||||
running[name].terminate()
|
||||
|
||||
if name in interrupt_processes:
|
||||
os.kill(running[name].pid, signal.SIGINT)
|
||||
else:
|
||||
running[name].terminate()
|
||||
|
||||
|
||||
# give it 5 seconds to die
|
||||
running[name].join(5.0)
|
||||
if running[name].exitcode is None:
|
||||
cloudlog.info("killing %s with SIGKILL" % name)
|
||||
os.kill(running[name].pid, signal.SIGKILL)
|
||||
running[name].join()
|
||||
cloudlog.info("%s is finally dead" % name)
|
||||
else:
|
||||
cloudlog.info("%s is dead with %d" % (name, running[name].exitcode))
|
||||
if name in unkillable_processes:
|
||||
cloudlog.critical("unkillable process %s failed to exit! rebooting in 15 if it doesn't die" % name)
|
||||
running[name].join(15.0)
|
||||
if running[name].exitcode is None:
|
||||
cloudlog.critical("FORCE REBOOTING PHONE!")
|
||||
os.system("date > /sdcard/unkillable_reboot")
|
||||
os.system("reboot")
|
||||
raise RuntimeError
|
||||
else:
|
||||
cloudlog.info("killing %s with SIGKILL" % name)
|
||||
os.kill(running[name].pid, signal.SIGKILL)
|
||||
running[name].join()
|
||||
|
||||
cloudlog.info("%s is dead with %d" % (name, running[name].exitcode))
|
||||
del running[name]
|
||||
|
||||
def cleanup_all_processes(signal, frame):
|
||||
@@ -111,7 +132,7 @@ def cleanup_all_processes(signal, frame):
|
||||
# ****************** run loop ******************
|
||||
|
||||
def manager_init():
|
||||
global gctx
|
||||
global gctx, fake_uploader
|
||||
|
||||
reg_res = register()
|
||||
if reg_res:
|
||||
@@ -125,6 +146,9 @@ def manager_init():
|
||||
os.environ['DONGLE_SECRET'] = dongle_secret
|
||||
|
||||
cloudlog.bind_global(dongle_id=dongle_id)
|
||||
common.crash.bind_user(dongle_id=dongle_id)
|
||||
|
||||
fake_uploader = Uploader(dongle_id, dongle_secret, ROOT)
|
||||
|
||||
# set gctx
|
||||
gctx = {
|
||||
@@ -135,25 +159,25 @@ def manager_init():
|
||||
}
|
||||
}
|
||||
|
||||
# hook to kill all processes
|
||||
signal.signal(signal.SIGINT, cleanup_all_processes)
|
||||
signal.signal(signal.SIGTERM, cleanup_all_processes)
|
||||
|
||||
def manager_thread():
|
||||
# now loop
|
||||
context = zmq.Context()
|
||||
thermal_sock = messaging.pub_sock(context, service_list['thermal'].port)
|
||||
health_sock = messaging.sub_sock(context, service_list['health'].port)
|
||||
|
||||
cloudlog.info("manager start")
|
||||
version = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "common", "version.h")).read().split('"')[1]
|
||||
|
||||
cloudlog.info("manager start %s" % version)
|
||||
cloudlog.info(dict(os.environ))
|
||||
|
||||
start_managed_process("logmessaged")
|
||||
start_managed_process("logcatd")
|
||||
start_managed_process("uploader")
|
||||
start_managed_process("ui")
|
||||
|
||||
# *** wait for the board ***
|
||||
wait_for_device()
|
||||
if os.getenv("NOBOARD") is None:
|
||||
# *** wait for the board ***
|
||||
wait_for_device()
|
||||
|
||||
# flash the device
|
||||
if os.getenv("NOPROG") is None:
|
||||
@@ -166,6 +190,10 @@ def manager_thread():
|
||||
for p in car_started_processes:
|
||||
start_managed_process(p)
|
||||
|
||||
logger_dead = False
|
||||
|
||||
count = 0
|
||||
|
||||
while 1:
|
||||
# get health of board, log this in "thermal"
|
||||
td = messaging.recv_sock(health_sock, wait=True)
|
||||
@@ -173,6 +201,13 @@ def manager_thread():
|
||||
|
||||
# replace thermald
|
||||
msg = read_thermal()
|
||||
|
||||
# loggerd is gated based on free space
|
||||
statvfs = os.statvfs(ROOT)
|
||||
avail = (statvfs.f_bavail * 1.0)/statvfs.f_blocks
|
||||
|
||||
# thermal message now also includes free space
|
||||
msg.thermal.freeSpace = avail
|
||||
thermal_sock.send(msg.to_bytes())
|
||||
print msg
|
||||
|
||||
@@ -187,17 +222,33 @@ def manager_thread():
|
||||
elif max_temp < 70.0:
|
||||
start_managed_process("uploader")
|
||||
|
||||
if avail < 0.05:
|
||||
logger_dead = True
|
||||
|
||||
# start constellation of processes when the car starts
|
||||
if td.health.started:
|
||||
for p in car_started_processes:
|
||||
start_managed_process(p)
|
||||
else:
|
||||
for p in car_started_processes:
|
||||
kill_managed_process(p)
|
||||
if not os.getenv("STARTALL"):
|
||||
# with 2% left, we killall, otherwise the phone is bricked
|
||||
if td.health.started and avail > 0.02:
|
||||
for p in car_started_processes:
|
||||
if p == "loggerd" and logger_dead:
|
||||
kill_managed_process(p)
|
||||
else:
|
||||
start_managed_process(p)
|
||||
else:
|
||||
logger_dead = False
|
||||
for p in car_started_processes:
|
||||
kill_managed_process(p)
|
||||
|
||||
# check the status of all processes, did any of them die?
|
||||
for p in running:
|
||||
cloudlog.info(" running %s %s" % (p, running[p]))
|
||||
cloudlog.debug(" running %s %s" % (p, running[p]))
|
||||
|
||||
# report to server once per minute
|
||||
if (count%60) == 0:
|
||||
names, total_size = fake_uploader.get_data_stats()
|
||||
cloudlog.info({"names": names, "total_size": total_size, "running": running.keys(), "count": count, "health": td.to_dict(), "thermal": msg.to_dict(), "version": version, "nonce": "THIS_STATUS_PACKET"})
|
||||
|
||||
count += 1
|
||||
|
||||
|
||||
# optional, build the c++ binaries and preimport the python for speed
|
||||
@@ -257,8 +308,17 @@ def wait_for_device():
|
||||
def main():
|
||||
if os.getenv("NOLOG") is not None:
|
||||
del managed_processes['loggerd']
|
||||
if os.getenv("NOUPLOAD") is not None:
|
||||
del managed_processes['uploader']
|
||||
if os.getenv("NOVISION") is not None:
|
||||
del managed_processes['visiond']
|
||||
if os.getenv("NOBOARD") is not None:
|
||||
del managed_processes['boardd']
|
||||
if os.getenv("LEAN") is not None:
|
||||
del managed_processes['uploader']
|
||||
del managed_processes['loggerd']
|
||||
del managed_processes['logmessaged']
|
||||
del managed_processes['logcatd']
|
||||
|
||||
manager_init()
|
||||
|
||||
|
||||
0
selfdrive/radar/__init__.py
Normal file
0
selfdrive/radar/__init__.py
Normal file
0
selfdrive/radar/nidec/__init__.py
Normal file
0
selfdrive/radar/nidec/__init__.py
Normal file
83
selfdrive/radar/nidec/interface.py
Executable file
83
selfdrive/radar/nidec/interface.py
Executable file
@@ -0,0 +1,83 @@
|
||||
#!/usr/bin/env python
|
||||
import numpy as np
|
||||
from selfdrive.car.honda.can_parser import CANParser
|
||||
from selfdrive.boardd.boardd import can_capnp_to_can_list
|
||||
|
||||
from cereal import car
|
||||
|
||||
import zmq
|
||||
from common.services import service_list
|
||||
import selfdrive.messaging as messaging
|
||||
|
||||
def _create_radard_can_parser():
|
||||
dbc_f = 'acura_ilx_2016_nidec.dbc'
|
||||
radar_messages = range(0x430, 0x43A) + range(0x440, 0x446)
|
||||
signals = zip(['LONG_DIST'] * 16 + ['NEW_TRACK'] * 16 + ['LAT_DIST'] * 16 +
|
||||
['REL_SPEED'] * 16, radar_messages * 4,
|
||||
[255] * 16 + [1] * 16 + [0] * 16 + [0] * 16)
|
||||
checks = zip(radar_messages, [20]*16)
|
||||
|
||||
return CANParser(dbc_f, signals, checks)
|
||||
|
||||
class RadarInterface(object):
|
||||
def __init__(self):
|
||||
# radar
|
||||
self.pts = {}
|
||||
self.track_id = 0
|
||||
|
||||
# Nidec
|
||||
self.rcp = _create_radard_can_parser()
|
||||
|
||||
context = zmq.Context()
|
||||
self.logcan = messaging.sub_sock(context, service_list['can'].port)
|
||||
|
||||
def update(self):
|
||||
canMonoTimes = []
|
||||
can_pub_radar = []
|
||||
|
||||
# TODO: can hang if no packets show up
|
||||
while 1:
|
||||
for a in messaging.drain_sock(self.logcan, wait_for_one=True):
|
||||
canMonoTimes.append(a.logMonoTime)
|
||||
can_pub_radar.extend(can_capnp_to_can_list(a.can, [1, 3]))
|
||||
|
||||
# only run on the 0x445 packets, used for timing
|
||||
if any(x[0] == 0x445 for x in can_pub_radar):
|
||||
break
|
||||
|
||||
self.rcp.update_can(can_pub_radar)
|
||||
|
||||
ret = car.RadarState.new_message()
|
||||
errors = []
|
||||
if not self.rcp.can_valid:
|
||||
errors.append("notValid")
|
||||
ret.errors = errors
|
||||
ret.canMonoTimes = canMonoTimes
|
||||
|
||||
for ii in self.rcp.msgs_upd:
|
||||
cpt = self.rcp.vl[ii]
|
||||
if cpt['LONG_DIST'] < 255:
|
||||
if ii not in self.pts or cpt['NEW_TRACK']:
|
||||
self.pts[ii] = car.RadarState.RadarPoint.new_message()
|
||||
self.pts[ii].trackId = self.track_id
|
||||
self.track_id += 1
|
||||
self.pts[ii].dRel = cpt['LONG_DIST'] # from front of car
|
||||
self.pts[ii].yRel = -cpt['LAT_DIST'] # in car frame's y axis, left is positive
|
||||
self.pts[ii].vRel = cpt['REL_SPEED']
|
||||
self.pts[ii].aRel = float('nan')
|
||||
self.pts[ii].yvRel = float('nan')
|
||||
else:
|
||||
if ii in self.pts:
|
||||
del self.pts[ii]
|
||||
|
||||
ret.points = self.pts.values()
|
||||
return ret
|
||||
|
||||
if __name__ == "__main__":
|
||||
RI = RadarInterface()
|
||||
while 1:
|
||||
ret = RI.update()
|
||||
print(chr(27) + "[2J")
|
||||
print ret
|
||||
|
||||
|
||||
0
selfdrive/test/__init__.py
Normal file
0
selfdrive/test/__init__.py
Normal file
0
selfdrive/test/plant/__init__.py
Normal file
0
selfdrive/test/plant/__init__.py
Normal file
71
selfdrive/test/plant/maneuver.py
Normal file
71
selfdrive/test/plant/maneuver.py
Normal file
@@ -0,0 +1,71 @@
|
||||
import os
|
||||
from enum import Enum
|
||||
from maneuverplots import ManeuverPlot
|
||||
from plant import Plant
|
||||
import numpy as np
|
||||
|
||||
|
||||
class Maneuver(object):
|
||||
def __init__(self, title, duration, **kwargs):
|
||||
# Was tempted to make a builder class
|
||||
self.distance_lead = kwargs.get("initial_distance_lead", 200.0)
|
||||
self.speed = kwargs.get("initial_speed", 0.0)
|
||||
self.lead_relevancy = kwargs.get("lead_relevancy", 0)
|
||||
|
||||
self.grade_values = kwargs.get("grade_values", [0.0, 0.0])
|
||||
self.grade_breakpoints = kwargs.get("grade_breakpoints", [0.0, duration])
|
||||
self.speed_lead_values = kwargs.get("speed_lead_values", [0.0, 0.0])
|
||||
self.speed_lead_breakpoints = kwargs.get("speed_lead_values", [0.0, duration])
|
||||
|
||||
self.cruise_button_presses = kwargs.get("cruise_button_presses", [])
|
||||
|
||||
self.duration = duration
|
||||
self.title = title
|
||||
|
||||
def evaluate(self):
|
||||
"""runs the plant sim and returns (score, run_data)"""
|
||||
plant = Plant(
|
||||
lead_relevancy = self.lead_relevancy,
|
||||
speed = self.speed,
|
||||
distance_lead = self.distance_lead
|
||||
)
|
||||
|
||||
last_live100 = None
|
||||
event_queue = sorted(self.cruise_button_presses, key=lambda a: a[1])[::-1]
|
||||
plot = ManeuverPlot(self.title)
|
||||
|
||||
buttons_sorted = sorted(self.cruise_button_presses, key=lambda a: a[1])
|
||||
current_button = 0
|
||||
while plant.current_time() < self.duration:
|
||||
while buttons_sorted and plant.current_time() >= buttons_sorted[0][1]:
|
||||
current_button = buttons_sorted[0][0]
|
||||
buttons_sorted = buttons_sorted[1:]
|
||||
print "current button changed to", current_button
|
||||
|
||||
grade = np.interp(plant.current_time(), self.grade_breakpoints, self.grade_values)
|
||||
speed_lead = np.interp(plant.current_time(), self.speed_lead_breakpoints, self.speed_lead_values)
|
||||
|
||||
distance, speed, acceleration, distance_lead, brake, gas, steer_torque, live100 = plant.step(speed_lead, current_button, grade)
|
||||
if live100:
|
||||
last_live100 = live100[-1]
|
||||
|
||||
d_rel = distance_lead - distance if self.lead_relevancy else 200.
|
||||
v_rel = speed_lead - speed if self.lead_relevancy else 0.
|
||||
|
||||
if last_live100:
|
||||
# print last_live100
|
||||
#develop plots
|
||||
plot.add_data(
|
||||
time=plant.current_time(),
|
||||
gas=gas, brake=brake, steer_torque=steer_torque,
|
||||
distance=distance, speed=speed, acceleration=acceleration,
|
||||
up_accel_cmd=last_live100.upAccelCmd, ui_accel_cmd=last_live100.uiAccelCmd,
|
||||
d_rel=d_rel, v_rel=v_rel, v_lead=speed_lead,
|
||||
v_target_lead=last_live100.vTargetLead, pid_speed=last_live100.vPid,
|
||||
cruise_speed=last_live100.vCruise,
|
||||
jerk_factor=last_live100.jerkFactor,
|
||||
a_target_min=last_live100.aTargetMin, a_target_max=last_live100.aTargetMax)
|
||||
|
||||
return (None, plot)
|
||||
|
||||
|
||||
140
selfdrive/test/plant/maneuverplots.py
Normal file
140
selfdrive/test/plant/maneuverplots.py
Normal file
@@ -0,0 +1,140 @@
|
||||
import os
|
||||
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
import pylab
|
||||
|
||||
from selfdrive.config import Conversions as CV
|
||||
|
||||
class ManeuverPlot(object):
|
||||
def __init__(self, title = None):
|
||||
self.time_array = []
|
||||
|
||||
self.gas_array = []
|
||||
self.brake_array = []
|
||||
self.steer_torque_array = []
|
||||
|
||||
self.distance_array = []
|
||||
self.speed_array = []
|
||||
self.acceleration_array = []
|
||||
|
||||
self.up_accel_cmd_array = []
|
||||
self.ui_accel_cmd_array = []
|
||||
|
||||
self.d_rel_array = []
|
||||
self.v_rel_array = []
|
||||
self.v_lead_array = []
|
||||
self.v_target_lead_array = []
|
||||
self.pid_speed_array = []
|
||||
self.cruise_speed_array = []
|
||||
self.jerk_factor_array = []
|
||||
|
||||
self.a_target_min_array = []
|
||||
self.a_target_max_array = []
|
||||
|
||||
self.v_target_array = []
|
||||
|
||||
self.title = title
|
||||
|
||||
def add_data(self, time, gas, brake, steer_torque, distance, speed,
|
||||
acceleration, up_accel_cmd, ui_accel_cmd, d_rel, v_rel, v_lead,
|
||||
v_target_lead, pid_speed, cruise_speed, jerk_factor, a_target_min,
|
||||
a_target_max):
|
||||
self.time_array.append(time)
|
||||
self.gas_array.append(gas)
|
||||
self.brake_array.append(brake)
|
||||
self.steer_torque_array.append(steer_torque)
|
||||
self.distance_array.append(distance)
|
||||
self.speed_array.append(speed)
|
||||
self.acceleration_array.append(acceleration)
|
||||
self.up_accel_cmd_array.append(up_accel_cmd)
|
||||
self.ui_accel_cmd_array.append(ui_accel_cmd)
|
||||
self.d_rel_array.append(d_rel)
|
||||
self.v_rel_array.append(v_rel)
|
||||
self.v_lead_array.append(v_lead)
|
||||
self.v_target_lead_array.append(v_target_lead)
|
||||
self.pid_speed_array.append(pid_speed)
|
||||
self.cruise_speed_array.append(cruise_speed)
|
||||
self.jerk_factor_array.append(jerk_factor)
|
||||
self.a_target_min_array.append(a_target_min)
|
||||
self.a_target_max_array.append(a_target_max)
|
||||
|
||||
|
||||
def write_plot(self, path, maneuver_name):
|
||||
title = self.title or maneuver_name
|
||||
# TODO: Missing plots from the old one:
|
||||
# long_control_state
|
||||
# proportional_gb, intergral_gb
|
||||
if not os.path.exists(path + "/" + maneuver_name):
|
||||
os.makedirs(path + "/" + maneuver_name)
|
||||
plt_num = 0
|
||||
|
||||
# speed chart ===================
|
||||
plt_num += 1
|
||||
plt.figure(plt_num)
|
||||
plt.plot(
|
||||
np.array(self.time_array), np.array(self.speed_array) * CV.MS_TO_MPH, 'r',
|
||||
np.array(self.time_array), np.array(self.pid_speed_array) * CV.MS_TO_MPH, 'y--',
|
||||
np.array(self.time_array), np.array(self.v_target_lead_array) * CV.MS_TO_MPH, 'b',
|
||||
np.array(self.time_array), np.array(self.cruise_speed_array) * CV.KPH_TO_MPH, 'k',
|
||||
np.array(self.time_array), np.array(self.v_lead_array) * CV.MS_TO_MPH, 'm'
|
||||
)
|
||||
plt.xlabel('Time [s]')
|
||||
plt.ylabel('Speed [mph]')
|
||||
plt.legend(['speed', 'pid speed', 'Target (lead) speed', 'Cruise speed', 'Lead speed'], loc=0)
|
||||
plt.grid()
|
||||
pylab.savefig("/".join([path, maneuver_name, 'speeds.svg']), dpi=1000)
|
||||
|
||||
# acceleration chart ============
|
||||
plt_num += 1
|
||||
plt.figure(plt_num)
|
||||
plt.plot(
|
||||
np.array(self.time_array), np.array(self.acceleration_array), 'g',
|
||||
np.array(self.time_array), np.array(self.a_target_min_array), 'k--',
|
||||
np.array(self.time_array), np.array(self.a_target_max_array), 'k--',
|
||||
)
|
||||
plt.xlabel('Time [s]')
|
||||
plt.ylabel('Acceleration [m/s^2]')
|
||||
plt.legend(['accel', 'max', 'min'], loc=0)
|
||||
plt.grid()
|
||||
pylab.savefig("/".join([path, maneuver_name, 'acceleration.svg']), dpi=1000)
|
||||
|
||||
# pedal chart ===================
|
||||
plt_num += 1
|
||||
plt.figure(plt_num)
|
||||
plt.plot(
|
||||
np.array(self.time_array), np.array(self.gas_array), 'g',
|
||||
np.array(self.time_array), np.array(self.brake_array), 'r',
|
||||
)
|
||||
plt.xlabel('Time [s]')
|
||||
plt.ylabel('Pedal []')
|
||||
plt.legend(['Gas pedal', 'Brake pedal'], loc=0)
|
||||
plt.grid()
|
||||
pylab.savefig("/".join([path, maneuver_name, 'pedals.svg']), dpi=1000)
|
||||
|
||||
# pid chart ======================
|
||||
plt_num += 1
|
||||
plt.figure(plt_num)
|
||||
plt.plot(
|
||||
np.array(self.time_array), np.array(self.up_accel_cmd_array), 'g',
|
||||
np.array(self.time_array), np.array(self.ui_accel_cmd_array), 'b'
|
||||
)
|
||||
plt.xlabel("Time, [s]")
|
||||
plt.ylabel("Accel Cmd [m/s^2]")
|
||||
plt.grid()
|
||||
plt.legend(["Proportional", "Integral"], loc=0)
|
||||
pylab.savefig("/".join([path, maneuver_name, "pid.svg"]), dpi=1000)
|
||||
|
||||
# relative distances chart =======
|
||||
plt_num += 1
|
||||
plt.figure(plt_num)
|
||||
plt.plot(
|
||||
np.array(self.time_array), np.array(self.d_rel_array), 'g',
|
||||
)
|
||||
plt.xlabel('Time [s]')
|
||||
plt.ylabel('Relative Distance [m]')
|
||||
plt.grid()
|
||||
pylab.savefig("/".join([path, maneuver_name, 'distance.svg']), dpi=1000)
|
||||
|
||||
plt.close("all")
|
||||
|
||||
274
selfdrive/test/plant/plant.py
Executable file
274
selfdrive/test/plant/plant.py
Executable file
@@ -0,0 +1,274 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
import struct
|
||||
|
||||
import zmq
|
||||
import numpy as np
|
||||
|
||||
from dbcs import DBC_PATH
|
||||
|
||||
from common.realtime import Ratekeeper
|
||||
from common.services import service_list
|
||||
|
||||
import selfdrive.messaging as messaging
|
||||
from selfdrive.config import CruiseButtons
|
||||
from selfdrive.car.honda.hondacan import fix
|
||||
from selfdrive.car.honda.carstate import get_can_parser
|
||||
from selfdrive.boardd.boardd import can_capnp_to_can_list, can_list_to_can_capnp
|
||||
|
||||
from selfdrive.car.honda.can_parser import CANParser
|
||||
|
||||
|
||||
from common.dbc import dbc
|
||||
acura = dbc(os.path.join(DBC_PATH, "acura_ilx_2016_can.dbc"))
|
||||
|
||||
def car_plant(pos, speed, grade, gas, brake):
|
||||
# vehicle parameters
|
||||
mass = 1700
|
||||
aero_cd = 0.3
|
||||
force_peak = mass*3.
|
||||
force_brake_peak = -mass*10. #1g
|
||||
power_peak = 100000 # 100kW
|
||||
speed_base = power_peak/force_peak
|
||||
rolling_res = 0.01
|
||||
g = 9.81
|
||||
wheel_r = 0.31
|
||||
frontal_area = 2.2
|
||||
air_density = 1.225
|
||||
gas_to_peak_linear_slope = 3.33
|
||||
brake_to_peak_linear_slope = 0.2
|
||||
creep_accel_v = [1., 0.]
|
||||
creep_accel_bp = [0., 1.5]
|
||||
|
||||
#*** longitudinal model ***
|
||||
# find speed where peak torque meets peak power
|
||||
force_brake = brake * force_brake_peak * brake_to_peak_linear_slope
|
||||
if speed < speed_base: # torque control
|
||||
force_gas = gas * force_peak * gas_to_peak_linear_slope
|
||||
else: # power control
|
||||
force_gas = gas * power_peak / speed * gas_to_peak_linear_slope
|
||||
|
||||
force_grade = - grade * mass # positive grade means uphill
|
||||
|
||||
creep_accel = np.interp(speed, creep_accel_bp, creep_accel_v)
|
||||
force_creep = creep_accel * mass
|
||||
|
||||
force_resistance = -(rolling_res * mass * g + 0.5 * speed**2 * aero_cd * air_density)
|
||||
force = force_gas + force_brake + force_resistance + force_grade + force_creep
|
||||
acceleration = force / mass
|
||||
|
||||
# TODO: lateral model
|
||||
return speed, acceleration
|
||||
|
||||
def get_car_can_parser():
|
||||
dbc_f = 'acura_ilx_2016_can.dbc'
|
||||
signals = [
|
||||
("STEER_TORQUE", 0xe4, 0),
|
||||
("STEER_TORQUE_REQUEST", 0xe4, 0),
|
||||
("COMPUTER_BRAKE", 0x1fa, 0),
|
||||
("COMPUTER_BRAKE_REQUEST", 0x1fa, 0),
|
||||
("GAS_COMMAND", 0x200, 0),
|
||||
]
|
||||
checks = [
|
||||
(0xe4, 100),
|
||||
(0x1fa, 50),
|
||||
(0x200, 50),
|
||||
]
|
||||
return CANParser(dbc_f, signals, checks)
|
||||
|
||||
|
||||
class Plant(object):
|
||||
messaging_initialized = False
|
||||
|
||||
def __init__(self, lead_relevancy=False, rate=100, speed=0.0, distance_lead=2.0):
|
||||
self.rate = rate
|
||||
self.civic = False
|
||||
self.brake_only = False
|
||||
|
||||
if not Plant.messaging_initialized:
|
||||
context = zmq.Context()
|
||||
Plant.logcan = messaging.pub_sock(context, service_list['can'].port)
|
||||
Plant.sendcan = messaging.sub_sock(context, service_list['sendcan'].port)
|
||||
Plant.model = messaging.pub_sock(context, service_list['model'].port)
|
||||
Plant.live100 = messaging.sub_sock(context, service_list['live100'].port)
|
||||
Plant.messaging_initialized = True
|
||||
|
||||
self.angle_steer = 0.
|
||||
self.gear_choice = 0
|
||||
self.speed, self.speed_prev = 0., 0.
|
||||
|
||||
self.esp_disabled = 0
|
||||
self.main_on = 1
|
||||
self.user_gas = 0
|
||||
self.computer_brake,self.user_brake = 0,0
|
||||
self.brake_pressed = 0
|
||||
self.distance, self.distance_prev = 0., 0.
|
||||
self.speed, self.speed_prev = speed, speed
|
||||
self.steer_error, self.brake_error, self.steer_not_allowed = 0, 0, 0
|
||||
self.gear_shifter = 4 # D gear
|
||||
self.pedal_gas = 0
|
||||
self.cruise_setting = 0
|
||||
|
||||
self.seatbelt, self.door_all_closed = True, True
|
||||
self.steer_torque, self.v_cruise, self.acc_status = 0, 0, 0 # v_cruise is reported from can, not the one used for controls
|
||||
|
||||
self.lead_relevancy = lead_relevancy
|
||||
|
||||
# lead car
|
||||
self.distance_lead, self.distance_lead_prev = distance_lead , distance_lead
|
||||
|
||||
self.rk = Ratekeeper(rate, print_delay_threshold=100)
|
||||
self.ts = 1./rate
|
||||
|
||||
self.cp = get_car_can_parser()
|
||||
|
||||
def speed_sensor(self, speed):
|
||||
if speed<0.3:
|
||||
return 0
|
||||
else:
|
||||
return speed
|
||||
|
||||
def current_time(self):
|
||||
return float(self.rk.frame) / self.rate
|
||||
|
||||
def step(self, v_lead=0.0, cruise_buttons=None, grade=0.0):
|
||||
# dbc_f, sgs, ivs, msgs, cks_msgs, frqs = initialize_can_struct(self.civic, self.brake_only)
|
||||
cp2 = get_can_parser(self.civic, self.brake_only)
|
||||
sgs = cp2._sgs
|
||||
msgs = cp2._msgs
|
||||
cks_msgs = cp2.msgs_ck
|
||||
|
||||
# ******** get messages sent to the car ********
|
||||
can_msgs = []
|
||||
for a in messaging.drain_sock(Plant.sendcan):
|
||||
can_msgs.extend(can_capnp_to_can_list(a.sendcan, [0,2]))
|
||||
self.cp.update_can(can_msgs)
|
||||
|
||||
# ******** get live100 messages for plotting ***
|
||||
live_msgs = []
|
||||
for a in messaging.drain_sock(Plant.live100):
|
||||
live_msgs.append(a.live100)
|
||||
|
||||
|
||||
if self.cp.vl[0x1fa]['COMPUTER_BRAKE_REQUEST']:
|
||||
brake = self.cp.vl[0x1fa]['COMPUTER_BRAKE']
|
||||
else:
|
||||
brake = 0.0
|
||||
|
||||
if self.cp.vl[0x200]['GAS_COMMAND'] > 0:
|
||||
gas = self.cp.vl[0x200]['GAS_COMMAND'] / 256.0
|
||||
else:
|
||||
gas = 0.0
|
||||
|
||||
if self.cp.vl[0xe4]['STEER_TORQUE_REQUEST']:
|
||||
steer_torque = self.cp.vl[0xe4]['STEER_TORQUE']*1.0/0xf00
|
||||
else:
|
||||
steer_torque = 0.0
|
||||
|
||||
distance_lead = self.distance_lead_prev + v_lead * self.ts
|
||||
|
||||
# ******** run the car ********
|
||||
speed, acceleration = car_plant(self.distance_prev, self.speed_prev, grade, gas, brake)
|
||||
standstill = (speed == 0)
|
||||
distance = self.distance_prev + speed * self.ts
|
||||
speed = self.speed_prev + self.ts * acceleration
|
||||
if speed <= 0:
|
||||
speed = 0
|
||||
acceleration = 0
|
||||
|
||||
# ******** lateral ********
|
||||
self.angle_steer -= steer_torque
|
||||
|
||||
# *** radar model ***
|
||||
if self.lead_relevancy:
|
||||
d_rel = np.maximum(0., self.distance_lead - distance)
|
||||
v_rel = v_lead - speed
|
||||
else:
|
||||
d_rel = 200.
|
||||
v_rel = 0.
|
||||
a_rel = 0
|
||||
lateral_pos_rel = 0.
|
||||
|
||||
# print at 5hz
|
||||
if (self.rk.frame%(self.rate/5)) == 0:
|
||||
print "%6.2f m %6.2f m/s %6.2f m/s2 %.2f ang gas: %.2f brake: %.2f steer: %5.2f lead_rel: %6.2f m %6.2f m/s" % (distance, speed, acceleration, self.angle_steer, gas, brake, steer_torque, d_rel, v_rel)
|
||||
|
||||
# ******** publish the car ********
|
||||
vls = [self.speed_sensor(speed), self.speed_sensor(speed), self.speed_sensor(speed), self.speed_sensor(speed),
|
||||
self.angle_steer, 0, self.gear_choice, speed!=0,
|
||||
0, 0, 0, 0,
|
||||
self.v_cruise, not self.seatbelt, self.seatbelt, self.brake_pressed,
|
||||
self.user_gas, cruise_buttons, self.esp_disabled, 0,
|
||||
self.user_brake, self.steer_error, self.speed_sensor(speed), self.brake_error,
|
||||
self.brake_error, self.gear_shifter, self.main_on, self.acc_status,
|
||||
self.pedal_gas, self.cruise_setting,
|
||||
# left_blinker, right_blinker, counter
|
||||
0,0,0,
|
||||
# interceptor_gas
|
||||
0,0]
|
||||
|
||||
|
||||
# TODO: publish each message at proper frequency
|
||||
can_msgs = []
|
||||
for msg in set(msgs):
|
||||
msg_struct = {}
|
||||
indxs = [i for i, x in enumerate(msgs) if msg == msgs[i]]
|
||||
for i in indxs:
|
||||
msg_struct[sgs[i]] = vls[i]
|
||||
if msg in cks_msgs:
|
||||
msg_struct["COUNTER"] = self.rk.frame % 4
|
||||
|
||||
msg_data = acura.encode(msg, msg_struct)
|
||||
|
||||
if msg in cks_msgs:
|
||||
msg_data = fix(msg_data, msg)
|
||||
|
||||
can_msgs.append([msg, 0, msg_data, 0])
|
||||
|
||||
# add the radar message
|
||||
# TODO: use the DBC
|
||||
def to_3_byte(x):
|
||||
return struct.pack("!H", int(x)).encode("hex")[1:]
|
||||
|
||||
def to_3s_byte(x):
|
||||
return struct.pack("!h", int(x)).encode("hex")[1:]
|
||||
radar_msg = to_3_byte(d_rel*16.0) + \
|
||||
to_3_byte(int(lateral_pos_rel*16.0)&0x3ff) + \
|
||||
to_3s_byte(int(v_rel*32.0)) + \
|
||||
"0f00000"
|
||||
can_msgs.append([0x445, 0, radar_msg.decode("hex"), 1])
|
||||
Plant.logcan.send(can_list_to_can_capnp(can_msgs).to_bytes())
|
||||
|
||||
# ******** publish a fake model going straight ********
|
||||
md = messaging.new_message()
|
||||
md.init('model')
|
||||
md.model.frameId = 0
|
||||
for x in [md.model.path, md.model.leftLane, md.model.rightLane]:
|
||||
x.points = [0.0]*50
|
||||
x.prob = 1.0
|
||||
x.std = 1.0
|
||||
# fake values?
|
||||
Plant.model.send(md.to_bytes())
|
||||
|
||||
|
||||
# ******** update prevs ********
|
||||
self.speed_prev = speed
|
||||
self.distance_prev = distance
|
||||
self.distance_lead_prev = distance_lead
|
||||
|
||||
self.rk.keep_time()
|
||||
return (distance, speed, acceleration, distance_lead, brake, gas, steer_torque, live_msgs)
|
||||
|
||||
# simple engage in standalone mode
|
||||
def plant_thread(rate=100):
|
||||
plant = Plant(rate)
|
||||
while 1:
|
||||
if plant.rk.frame%100 >= 20 and plant.rk.frame%100 <= 25:
|
||||
cruise_buttons = CruiseButtons.RES_ACCEL
|
||||
else:
|
||||
cruise_buttons = 0
|
||||
plant.step()
|
||||
|
||||
if __name__ == "__main__":
|
||||
plant_thread()
|
||||
|
||||
10
selfdrive/test/plant/runtest.sh
Executable file
10
selfdrive/test/plant/runtest.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
pushd ../../controls
|
||||
./controlsd.py &
|
||||
pid1=$!
|
||||
./radard.py &
|
||||
pid2=$!
|
||||
trap "trap - SIGTERM && kill $pid1 && kill $pid2" SIGINT SIGTERM EXIT
|
||||
popd
|
||||
mkdir -p out
|
||||
MPLBACKEND=svg ./runtracks.py out
|
||||
207
selfdrive/test/plant/runtracks.py
Executable file
207
selfdrive/test/plant/runtracks.py
Executable file
@@ -0,0 +1,207 @@
|
||||
#!/usr/bin/env python
|
||||
import sys
|
||||
import time, json
|
||||
|
||||
from selfdrive.test.plant import plant
|
||||
from selfdrive.config import Conversions as CV, CruiseButtons as CB
|
||||
from maneuver import *
|
||||
|
||||
maneuvers = [
|
||||
Maneuver(
|
||||
'while cruising at 40 mph, change cruise speed to 50mph',
|
||||
duration=30.,
|
||||
initial_speed = 40. * CV.MPH_TO_MS,
|
||||
cruise_button_presses = [(CB.DECEL_SET, 2.), (0, 2.3),
|
||||
(CB.RES_ACCEL, 10.), (0, 10.1),
|
||||
(CB.RES_ACCEL, 10.2), (0, 10.3)]
|
||||
),
|
||||
Maneuver(
|
||||
'while cruising at 60 mph, change cruise speed to 50mph',
|
||||
duration=30.,
|
||||
initial_speed=60. * CV.MPH_TO_MS,
|
||||
cruise_button_presses = [(CB.DECEL_SET, 2.), (0, 2.3),
|
||||
(CB.DECEL_SET, 10.), (0, 10.1),
|
||||
(CB.DECEL_SET, 10.2), (0, 10.3)]
|
||||
),
|
||||
Maneuver(
|
||||
'while cruising at 20mph, grade change +10%',
|
||||
duration=25.,
|
||||
initial_speed=20. * CV.MPH_TO_MS,
|
||||
cruise_button_presses = [(CB.DECEL_SET, 1.2), (0, 1.3)],
|
||||
grade_values = [0., 0., 1.0],
|
||||
grade_breakpoints = [0., 10., 11.]
|
||||
),
|
||||
Maneuver(
|
||||
'while cruising at 20mph, grade change -10%',
|
||||
duration=25.,
|
||||
initial_speed=20. * CV.MPH_TO_MS,
|
||||
cruise_button_presses = [(CB.DECEL_SET, 1.2), (0, 1.3)],
|
||||
grade_values = [0., 0., -1.0],
|
||||
grade_breakpoints = [0., 10., 11.]
|
||||
),
|
||||
Maneuver(
|
||||
'approaching a 40mph car while cruising at 60mph from 100m away',
|
||||
duration=30.,
|
||||
initial_speed = 60. * CV.MPH_TO_MS,
|
||||
lead_relevancy=True,
|
||||
initial_distance_lead=100.,
|
||||
speed_lead_values = [40.*CV.MPH_TO_MS, 40.*CV.MPH_TO_MS],
|
||||
speed_lead_breakpoints = [0., 100.],
|
||||
cruise_button_presses = [(CB.DECEL_SET, 1.2), (0, 1.3)]
|
||||
),
|
||||
Maneuver(
|
||||
'approaching a 0mph car while cruising at 40mph from 150m away',
|
||||
duration=30.,
|
||||
initial_speed = 40. * CV.MPH_TO_MS,
|
||||
lead_relevancy=True,
|
||||
initial_distance_lead=150.,
|
||||
speed_lead_values = [0.*CV.MPH_TO_MS, 0.*CV.MPH_TO_MS],
|
||||
speed_lead_breakpoints = [0., 100.],
|
||||
cruise_button_presses = [(CB.DECEL_SET, 1.2), (0, 1.3)]
|
||||
),
|
||||
Maneuver(
|
||||
'steady state following a car at 20m/s, then lead decel to 0mph at 1m/s^2',
|
||||
duration=50.,
|
||||
initial_speed = 20.,
|
||||
lead_relevancy=True,
|
||||
initial_distance_lead=35.,
|
||||
speed_lead_values = [20.*CV.MPH_TO_MS, 20.*CV.MPH_TO_MS, 0.*CV.MPH_TO_MS],
|
||||
speed_lead_breakpoints = [0., 15., 35.0],
|
||||
cruise_button_presses = [(CB.DECEL_SET, 1.2), (0, 1.3)]
|
||||
),
|
||||
Maneuver(
|
||||
'steady state following a car at 20m/s, then lead decel to 0mph at 2m/s^2',
|
||||
duration=50.,
|
||||
initial_speed = 20.,
|
||||
lead_relevancy=True,
|
||||
initial_distance_lead=35.,
|
||||
speed_lead_values = [20.*CV.MPH_TO_MS, 20.*CV.MPH_TO_MS, 0.*CV.MPH_TO_MS],
|
||||
speed_lead_breakpoints = [0., 15., 25.0],
|
||||
cruise_button_presses = [(CB.DECEL_SET, 1.2), (0, 1.3)]
|
||||
),
|
||||
Maneuver(
|
||||
'starting at 0mph, approaching a stopped car 100m away',
|
||||
duration=30.,
|
||||
initial_speed = 0.,
|
||||
lead_relevancy=True,
|
||||
initial_distance_lead=100.,
|
||||
cruise_button_presses = [(CB.DECEL_SET, 1.2), (0, 1.3),
|
||||
(CB.RES_ACCEL, 1.4), (0.0, 1.5),
|
||||
(CB.RES_ACCEL, 1.6), (0.0, 1.7),
|
||||
(CB.RES_ACCEL, 1.8), (0.0, 1.9)]
|
||||
),
|
||||
Maneuver(
|
||||
"following a car at 60mph, lead accel and decel at 0.5m/s^2 every 2s",
|
||||
duration=25.,
|
||||
initial_speed=30.,
|
||||
lead_relevancy=True,
|
||||
initial_distance_lead=49.,
|
||||
speed_lead_values=[30.,30.,29.,31.,29.,31.,29.],
|
||||
speed_lead_breakpoints=[0., 6., 8., 12.,16.,20.,24.],
|
||||
cruise_button_presses = [(CB.DECEL_SET, 1.2), (0, 1.3),
|
||||
(CB.RES_ACCEL, 1.4), (0.0, 1.5),
|
||||
(CB.RES_ACCEL, 1.6), (0.0, 1.7)]
|
||||
),
|
||||
Maneuver(
|
||||
"following a car at 10mph, stop and go at 1m/s2 lead dece1 and accel",
|
||||
duration=70.,
|
||||
initial_speed=10.,
|
||||
lead_relevancy=True,
|
||||
initial_distance_lead=20.,
|
||||
speed_lead_values=[10., 0., 0., 10., 0.,10.],
|
||||
speed_lead_breakpoints=[10., 20., 30., 40., 50., 60.],
|
||||
cruise_button_presses = [(CB.DECEL_SET, 1.2), (0, 1.3),
|
||||
(CB.RES_ACCEL, 1.4), (0.0, 1.5),
|
||||
(CB.RES_ACCEL, 1.6), (0.0, 1.7)]
|
||||
),
|
||||
Maneuver(
|
||||
"green light: stopped behind lead car, lead car accelerates at 1.5 m/s",
|
||||
duration=30.,
|
||||
initial_speed=0.,
|
||||
lead_relevancy=True,
|
||||
initial_distance_lead=4.,
|
||||
speed_lead_values=[0, 0 , 45],
|
||||
speed_lead_breakpoints=[0, 10., 40.],
|
||||
cruise_button_presses = [(CB.DECEL_SET, 1.2), (0, 1.3),
|
||||
(CB.RES_ACCEL, 1.4), (0.0, 1.5),
|
||||
(CB.RES_ACCEL, 1.6), (0.0, 1.7),
|
||||
(CB.RES_ACCEL, 1.8), (0.0, 1.9),
|
||||
(CB.RES_ACCEL, 2.0), (0.0, 2.1),
|
||||
(CB.RES_ACCEL, 2.2), (0.0, 2.3)]
|
||||
),
|
||||
Maneuver(
|
||||
"stop and go with 1m/s2 lead decel and accel, with full stops",
|
||||
duration=70.,
|
||||
initial_speed=0.,
|
||||
lead_relevancy=True,
|
||||
initial_distance_lead=20.,
|
||||
speed_lead_values=[10., 0., 0., 10., 0., 0.] ,
|
||||
speed_lead_breakpoints=[10., 20., 30., 40., 50., 60.],
|
||||
cruise_button_presses = [(CB.DECEL_SET, 1.2), (0, 1.3),
|
||||
(CB.RES_ACCEL, 1.4), (0.0, 1.5),
|
||||
(CB.RES_ACCEL, 1.6), (0.0, 1.7)]
|
||||
),
|
||||
Maneuver(
|
||||
"accelerate from 20 while lead vehicle decelerates from 40 to 20 at 1m/s2",
|
||||
duration=30.,
|
||||
initial_speed=10.,
|
||||
lead_relevancy=True,
|
||||
initial_distance_lead=10.,
|
||||
speed_lead_values=[20., 10.],
|
||||
speed_lead_breakpoints=[1., 11.],
|
||||
cruise_button_presses = [(CB.DECEL_SET, 1.2), (0, 1.3),
|
||||
(CB.RES_ACCEL, 1.4), (0.0, 1.5),
|
||||
(CB.RES_ACCEL, 1.6), (0.0, 1.7),
|
||||
(CB.RES_ACCEL, 1.8), (0.0, 1.9),
|
||||
(CB.RES_ACCEL, 2.0), (0.0, 2.1),
|
||||
(CB.RES_ACCEL, 2.2), (0.0, 2.3)]
|
||||
),
|
||||
Maneuver(
|
||||
"accelerate from 20 while lead vehicle decelerates from 40 to 0 at 2m/s2",
|
||||
duration=30.,
|
||||
initial_speed=10.,
|
||||
lead_relevancy=True,
|
||||
initial_distance_lead=10.,
|
||||
speed_lead_values=[20., 0.],
|
||||
speed_lead_breakpoints=[1., 11.],
|
||||
cruise_button_presses = [(CB.DECEL_SET, 1.2), (0, 1.3),
|
||||
(CB.RES_ACCEL, 1.4), (0.0, 1.5),
|
||||
(CB.RES_ACCEL, 1.6), (0.0, 1.7),
|
||||
(CB.RES_ACCEL, 1.8), (0.0, 1.9),
|
||||
(CB.RES_ACCEL, 2.0), (0.0, 2.1),
|
||||
(CB.RES_ACCEL, 2.2), (0.0, 2.3)]
|
||||
)
|
||||
]
|
||||
|
||||
css_style = """
|
||||
.maneuver_title {
|
||||
font-size: 24px;
|
||||
text-align: center;
|
||||
}
|
||||
.maneuver_graph {
|
||||
width: 100%;
|
||||
}
|
||||
"""
|
||||
|
||||
def main(output_dir):
|
||||
view_html = "<html><head><style>%s</style></head><body><table>" % (css_style,)
|
||||
for i, man in enumerate(maneuvers):
|
||||
view_html += "<tr><td class='maneuver_title' colspan=5><div>%s</div></td></tr><tr>" % (man.title,)
|
||||
for c in ['distance.svg', 'speeds.svg', 'acceleration.svg', 'pedals.svg', 'pid.svg']:
|
||||
view_html += "<td><img class='maneuver_graph' src='%s'/></td>" % (os.path.join("maneuver" + str(i+1).zfill(2), c), )
|
||||
view_html += "</tr>"
|
||||
|
||||
with open(os.path.join(output_dir, "index.html"), "w") as f:
|
||||
f.write(view_html)
|
||||
|
||||
for i, man in enumerate(maneuvers):
|
||||
score, plot = man.evaluate()
|
||||
plot.write_plot(output_dir, "maneuver" + str(i+1).zfill(2))
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) <= 1:
|
||||
print "Usage:", sys.argv[0], "<output_dir>"
|
||||
exit(1)
|
||||
|
||||
main(sys.argv[1])
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#include "common/visionipc.h"
|
||||
#include "common/modeldata.h"
|
||||
|
||||
#include "common/version.h"
|
||||
|
||||
#include "cereal/gen/c/log.capnp.h"
|
||||
|
||||
#include "touch.h"
|
||||
@@ -95,7 +97,6 @@ typedef struct UIState {
|
||||
|
||||
// base ui
|
||||
uint64_t last_base_update;
|
||||
uint64_t last_rx_bytes;
|
||||
uint64_t last_tx_bytes;
|
||||
char serial[4096];
|
||||
const char* dongle_id;
|
||||
@@ -133,10 +134,31 @@ typedef struct UIState {
|
||||
GLuint frame_front_tex;
|
||||
|
||||
UIScene scene;
|
||||
|
||||
|
||||
|
||||
bool awake;
|
||||
int awake_timeout;
|
||||
} UIState;
|
||||
|
||||
static void set_awake(UIState *s, bool awake) {
|
||||
if (awake) {
|
||||
// 30 second timeout
|
||||
s->awake_timeout = 30;
|
||||
}
|
||||
if (s->awake != awake) {
|
||||
s->awake = awake;
|
||||
|
||||
// TODO: actually turn off the screen and not just the backlight
|
||||
FILE *f = fopen("/sys/class/leds/lcd-backlight/brightness", "wb");
|
||||
if (f != NULL) {
|
||||
if (awake) {
|
||||
fprintf(f, "205");
|
||||
} else {
|
||||
fprintf(f, "0");
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool activity_running() {
|
||||
return system("dumpsys activity activities | grep mFocusedActivity > /dev/null") == 0;
|
||||
@@ -173,13 +195,13 @@ typedef struct Button {
|
||||
static const Button buttons[] = {
|
||||
{
|
||||
.label = "wifi",
|
||||
.x = 400, .y = 700, .w = 250, .h = 250,
|
||||
.x = 400, .y = 730, .w = 250, .h = 250,
|
||||
.pressed = wifi_pressed,
|
||||
.enabled = wifi_enabled,
|
||||
},
|
||||
{
|
||||
.label = "ap",
|
||||
.x = 1300, .y = 700, .w = 250, .h = 250,
|
||||
.x = 1300, .y = 730, .w = 250, .h = 250,
|
||||
.pressed = ap_pressed,
|
||||
.enabled = ap_enabled,
|
||||
}
|
||||
@@ -380,6 +402,9 @@ static void ui_init(UIState *s) {
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
assert(glGetError() == GL_NO_ERROR);
|
||||
|
||||
// set awake
|
||||
set_awake(s, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -837,6 +862,11 @@ static void ui_draw_vision(UIState *s) {
|
||||
}
|
||||
}
|
||||
|
||||
static void ui_draw_blank(UIState *s) {
|
||||
glClearColor(0.1, 0.1, 0.1, 1.0);
|
||||
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
static void ui_draw_base(UIState *s) {
|
||||
glClearColor(0.1, 0.1, 0.1, 1.0);
|
||||
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
@@ -886,8 +916,10 @@ static void ui_draw(UIState *s) {
|
||||
|
||||
if (s->vision_connected) {
|
||||
ui_draw_vision(s);
|
||||
} else {
|
||||
} else if (s->awake) {
|
||||
ui_draw_base(s);
|
||||
} else {
|
||||
ui_draw_blank(s);
|
||||
}
|
||||
|
||||
eglSwapBuffers(s->display, s->surface);
|
||||
@@ -963,9 +995,20 @@ static int pending_uploads() {
|
||||
int cnt = 0;
|
||||
struct dirent *entry = NULL;
|
||||
while ((entry = readdir(dirp))) {
|
||||
if (entry->d_name[0] != '.') {
|
||||
if (entry->d_name[0] == '.') continue;
|
||||
|
||||
char subdirn[255];
|
||||
snprintf(subdirn, 255, "/sdcard/realdata/%s", entry->d_name);
|
||||
DIR *subdirp = opendir(subdirn);
|
||||
if (!subdirp) continue;
|
||||
|
||||
struct dirent *subentry = NULL;
|
||||
while ((subentry = readdir(subdirp))) {
|
||||
if (subentry->d_name[0] == '.') continue;
|
||||
//snprintf(subdirn, 255, "/sdcard/realdata/%s/%s", entry->d_name, subentry->d_name);
|
||||
cnt++;
|
||||
}
|
||||
closedir(subdirp);
|
||||
}
|
||||
closedir(dirp);
|
||||
return cnt;
|
||||
@@ -1123,7 +1166,7 @@ static void ui_update(UIState *s) {
|
||||
s->scene.v_cruise = datad.vCruise;
|
||||
s->scene.v_ego = datad.vEgo;
|
||||
s->scene.angle_steers = datad.angleSteers;
|
||||
s->scene.engaged = (datad.hudLead == 1) || (datad.hudLead == 2);
|
||||
s->scene.engaged = datad.enabled;
|
||||
// printf("recv %f\n", datad.vEgo);
|
||||
|
||||
s->scene.frontview = datad.rearViewCam;
|
||||
@@ -1182,20 +1225,25 @@ static void ui_update(UIState *s) {
|
||||
char* bat_stat = read_file("/sys/class/power_supply/battery/status");
|
||||
|
||||
int tx_rate = 0;
|
||||
int rx_rate = 0;
|
||||
char* rx_bytes = read_file("/sys/class/net/rmnet_data0/statistics/rx_bytes");
|
||||
char* tx_bytes = read_file("/sys/class/net/rmnet_data0/statistics/tx_bytes");
|
||||
if (rx_bytes && tx_bytes) {
|
||||
uint64_t rx_bytes_n = atoll(rx_bytes);
|
||||
rx_rate = rx_bytes_n - s->last_rx_bytes;
|
||||
s->last_rx_bytes = rx_bytes_n;
|
||||
uint64_t tx_bytes_n = 0;
|
||||
char *tx_bytes;
|
||||
|
||||
uint64_t tx_bytes_n = atoll(tx_bytes);
|
||||
tx_rate = tx_bytes_n - s->last_tx_bytes;
|
||||
s->last_tx_bytes = tx_bytes_n;
|
||||
}
|
||||
if (rx_bytes) free(rx_bytes);
|
||||
if (tx_bytes) free(tx_bytes);
|
||||
// cellular bytes
|
||||
tx_bytes = read_file("/sys/class/net/rmnet_data0/statistics/tx_bytes");
|
||||
if (tx_bytes) { tx_bytes_n += atoll(tx_bytes); free(tx_bytes); }
|
||||
|
||||
// wifi bytes
|
||||
tx_bytes = read_file("/sys/class/net/wlan0/statistics/tx_bytes");
|
||||
if (tx_bytes) { tx_bytes_n += atoll(tx_bytes); free(tx_bytes); }
|
||||
|
||||
tx_rate = tx_bytes_n - s->last_tx_bytes;
|
||||
s->last_tx_bytes = tx_bytes_n;
|
||||
|
||||
// TODO: do this properly
|
||||
system("git rev-parse --abbrev-ref HEAD > /tmp/git_branch");
|
||||
char *git_branch = read_file("/tmp/git_branch");
|
||||
system("git rev-parse --short HEAD > /tmp/git_commit");
|
||||
char *git_commit = read_file("/tmp/git_commit");
|
||||
|
||||
int pending = pending_uploads();
|
||||
|
||||
@@ -1210,14 +1258,29 @@ static void ui_update(UIState *s) {
|
||||
s->board_connected = !system("lsusb | grep bbaa > /dev/null");
|
||||
|
||||
snprintf(s->base_text, sizeof(s->base_text),
|
||||
"serial: %s\n dongle id: %s\n battery: %s %s\npending: %d\nrx %.1fkiB/s tx %.1fkiB/s\nboard: %s",
|
||||
"version: v%s %s (%s)\nserial: %s\n dongle id: %s\n battery: %s %s\npending: %d -> %.1f kb/s\nboard: %s",
|
||||
openpilot_version, git_commit, git_branch,
|
||||
s->serial, s->dongle_id, bat_cap ? bat_cap : "(null)", bat_stat ? bat_stat : "(null)",
|
||||
pending, rx_rate / 1024.0, tx_rate / 1024.0, s->board_connected ? "found" : "NOT FOUND");
|
||||
pending, tx_rate / 1024.0, s->board_connected ? "found" : "NOT FOUND");
|
||||
|
||||
if (bat_cap) free(bat_cap);
|
||||
if (bat_stat) free(bat_stat);
|
||||
|
||||
if (git_branch) free(git_branch);
|
||||
if (git_commit) free(git_commit);
|
||||
|
||||
s->last_base_update = ts;
|
||||
|
||||
if (s->awake_timeout > 0) {
|
||||
s->awake_timeout--;
|
||||
} else {
|
||||
set_awake(s, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (s->vision_connected) {
|
||||
// always awake if vision is connected
|
||||
set_awake(s, true);
|
||||
}
|
||||
|
||||
if (!s->vision_connected) {
|
||||
@@ -1226,16 +1289,20 @@ static void ui_update(UIState *s) {
|
||||
int touch_x = -1, touch_y = -1;
|
||||
err = touch_poll(&s->touch, &touch_x, &touch_y);
|
||||
if (err == 1) {
|
||||
// press buttons
|
||||
for (int i=0; i<ARRAYSIZE(buttons); i++) {
|
||||
const Button *b = &buttons[i];
|
||||
if (touch_x >= b->x && touch_x < b->x+b->w
|
||||
&& touch_y >= b->y && touch_y < b->y+b->h) {
|
||||
if (b->pressed && !activity_running()) {
|
||||
b->pressed();
|
||||
break;
|
||||
if (s->awake) {
|
||||
// press buttons
|
||||
for (int i=0; i<ARRAYSIZE(buttons); i++) {
|
||||
const Button *b = &buttons[i];
|
||||
if (touch_x >= b->x && touch_x < b->x+b->w
|
||||
&& touch_y >= b->y && touch_y < b->y+b->h) {
|
||||
if (b->pressed && !activity_running()) {
|
||||
b->pressed();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
set_awake(s, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user