openpilot v0.3.7 tweaks

old-commit-hash: 8385b27cad
commatwo_master
Vehicle Researcher 8 years ago
parent 90c3815a7f
commit 5ef591d9c2
  1. 1
      .gitignore
  2. 2
      opendbc
  3. 8
      selfdrive/crash.py
  4. 2
      selfdrive/manager.py
  5. 1
      selfdrive/tombstoned.py
  6. 32
      selfdrive/ui/ui.c
  7. 2
      selfdrive/visiond/visiond

1
.gitignore vendored

@ -4,6 +4,7 @@
.idea .idea
model2.png model2.png
*.DSYM
*.d *.d
*.pyc *.pyc
*.pyo *.pyo

@ -1 +1 @@
Subproject commit 063032ff2b9b878c2cc10301504bad9db54f655f Subproject commit e25689edc18276f3ef728f0cdf63939240fcebda

@ -2,6 +2,8 @@
import os import os
import sys import sys
from selfdrive.swaglog import cloudlog
if os.getenv("NOLOG") or os.getenv("NOCRASH"): if os.getenv("NOLOG") or os.getenv("NOCRASH"):
def capture_exception(*exc_info): def capture_exception(*exc_info):
pass pass
@ -18,7 +20,9 @@ else:
client = Client('https://1994756b5e6f41cf939a4c65de45f4f2:cefebaf3a8aa40d182609785f7189bd7@app.getsentry.com/77924', client = Client('https://1994756b5e6f41cf939a4c65de45f4f2:cefebaf3a8aa40d182609785f7189bd7@app.getsentry.com/77924',
install_sys_hook=False, transport=HTTPTransport) install_sys_hook=False, transport=HTTPTransport)
capture_exception = client.captureException def capture_exception(*args, **kwargs):
client.captureException(*args, **kwargs)
cloudlog.error("crash", exc_info=kwargs.get('exc_info', 1))
def bind_user(**kwargs): def bind_user(**kwargs):
client.user_context(kwargs) client.user_context(kwargs)
@ -31,6 +35,6 @@ else:
__excepthook__ = sys.excepthook __excepthook__ = sys.excepthook
def handle_exception(*exc_info): def handle_exception(*exc_info):
if exc_info[0] not in (KeyboardInterrupt, SystemExit): if exc_info[0] not in (KeyboardInterrupt, SystemExit):
client.captureException(exc_info=exc_info) capture_exception(exc_info=exc_info)
__excepthook__(*exc_info) __excepthook__(*exc_info)
sys.excepthook = handle_exception sys.excepthook = handle_exception

@ -36,8 +36,8 @@ import selfdrive.messaging as messaging
from selfdrive.thermal import read_thermal from selfdrive.thermal import read_thermal
from selfdrive.registration import register from selfdrive.registration import register
from selfdrive.version import version from selfdrive.version import version
import selfdrive.crash as crash
import common.crash as crash
from common.params import Params from common.params import Params
from selfdrive.loggerd.config import ROOT from selfdrive.loggerd.config import ROOT

@ -61,6 +61,7 @@ def report_tombstone(fn, client):
user={'id': os.environ.get('DONGLE_ID')}, user={'id': os.environ.get('DONGLE_ID')},
message=message, message=message,
) )
cloudlog.error({"tombstone": message})
def main(gctx): def main(gctx):

@ -32,6 +32,11 @@
#include "cereal/gen/c/log.capnp.h" #include "cereal/gen/c/log.capnp.h"
// Calibration status values from controlsd.py
#define CALIBRATION_UNCALIBRATED 0
#define CALIBRATION_CALIBRATED 1
#define CALIBRATION_INVALID 2
#define UI_BUF_COUNT 4 #define UI_BUF_COUNT 4
typedef struct UIScene { typedef struct UIScene {
@ -48,7 +53,6 @@ typedef struct UIScene {
float mpc_y[50]; float mpc_y[50];
bool world_objects_visible; bool world_objects_visible;
// TODO(mgraczyk): Remove and use full frame for everything.
mat3 warp_matrix; // transformed box -> frame. mat3 warp_matrix; // transformed box -> frame.
mat4 extrinsic_matrix; // Last row is 0 so we can use mat4. mat4 extrinsic_matrix; // Last row is 0 so we can use mat4.
@ -68,6 +72,10 @@ typedef struct UIScene {
char alert_text2[1024]; char alert_text2[1024];
float awareness_status; float awareness_status;
// Used to display calibration progress
int cal_status;
int cal_perc;
} UIScene; } UIScene;
typedef struct UIState { typedef struct UIState {
@ -844,6 +852,25 @@ static void ui_draw_vision(UIState *s) {
255 * scene->awareness_status, 0, 128)); 255 * scene->awareness_status, 0, 128));
nvgFill(s->vg); nvgFill(s->vg);
} }
// Draw calibration progress (if needed)
if (scene->cal_status == CALIBRATION_UNCALIBRATED && scene->cal_perc > 0) {
int rec_width = 1020;
int x_pos = 470;
nvgBeginPath(s->vg);
nvgStrokeWidth(s->vg, 14);
nvgRoundedRect(s->vg, (1920-rec_width)/2, 970, rec_width, 100, 20);
nvgStroke(s->vg);
nvgFillColor(s->vg, nvgRGBA(10,100,220,180));
nvgFill(s->vg);
nvgFontSize(s->vg, labelfontsize);
nvgTextAlign(s->vg, NVG_ALIGN_LEFT | NVG_ALIGN_BASELINE);
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 220));
char calib_status_str[32];
snprintf(calib_status_str, sizeof(calib_status_str), "Calibration In Progress: %d%%", scene->cal_perc);
nvgText(s->vg, x_pos, 1040, calib_status_str, NULL);
}
} }
nvgEndFrame(s->vg); nvgEndFrame(s->vg);
@ -1138,6 +1165,9 @@ static void ui_update(UIState *s) {
struct cereal_LiveCalibrationData datad; struct cereal_LiveCalibrationData datad;
cereal_read_LiveCalibrationData(&datad, eventd.liveCalibration); cereal_read_LiveCalibrationData(&datad, eventd.liveCalibration);
s->scene.cal_status = datad.calStatus;
s->scene.cal_perc = datad.calPerc;
// should we still even have this? // should we still even have this?
capn_list32 warpl = datad.warpMatrix2; capn_list32 warpl = datad.warpMatrix2;
capn_resolve(&warpl.p); // is this a bug? capn_resolve(&warpl.p); // is this a bug?

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:a5078532dfc830e278a83b885c19f8e7a2a7073ea3f3bb389f2323702f40cb6b oid sha256:973fdfae18bb0b5c33b107d06241d22e11f6794468c8327d413874aad5945ff0
size 13285152 size 13285152

Loading…
Cancel
Save