mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-20 05:22:03 +08:00
ish confirmed working
This commit is contained in:
@@ -361,7 +361,7 @@ BO_ 705 GAS_PEDAL: 8 XXX
|
||||
SG_ GAS_PEDAL : 55|8@0+ (0.005,0) [0|1] "" XXX
|
||||
|
||||
BO_ 608 STEER_TORQUE_SENSOR: 8 XXX
|
||||
SG_ STEER_TORQUE_EPS : 47|16@0- (0.66,0) [-20000|20000] "" XXX
|
||||
SG_ STEER_TORQUE_EPS : 47|16@0- (1.30,0) [-20000|20000] "" XXX
|
||||
SG_ STEER_TORQUE_DRIVER : 15|16@0- (1,0) [-32768|32767] "" XXX
|
||||
SG_ STEER_OVERRIDE : 0|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
|
||||
Binary file not shown.
@@ -54,7 +54,8 @@ static void toyota_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
|
||||
}
|
||||
|
||||
// enter controls on rising edge of ACC, exit controls on ACC off
|
||||
if (addr == 0x1D2) {
|
||||
controls_allowed = 1;
|
||||
if (false) {
|
||||
// 5th bit is CRUISE_ACTIVE
|
||||
int cruise_engaged = GET_BYTE(to_push, 0) & 0x20;
|
||||
if (!cruise_engaged) {
|
||||
|
||||
@@ -240,10 +240,10 @@ class CarState(object):
|
||||
|
||||
if self.dragon_toyota_stock_dsu and self.generic_toggle and self.main_on:
|
||||
enable_acc = True
|
||||
if not self.gear_shifter == 'drive' or not self.seatbelt or not self.door_all_closed:
|
||||
enable_acc = False
|
||||
#if not self.gear_shifter == 'drive' or not self.seatbelt or not self.door_all_closed:
|
||||
# enable_acc = False
|
||||
self.pcm_acc_active = enable_acc
|
||||
if self.standstill:
|
||||
self.pcm_acc_status = 7
|
||||
else:
|
||||
self.pcm_acc_status = 1
|
||||
self.pcm_acc_status = 1
|
||||
|
||||
+17
-14
@@ -1810,7 +1810,9 @@ static void ui_draw_vision(UIState *s) {
|
||||
glScissor(ui_viz_rx, s->fb_h-(box_y+box_h), ui_viz_rw, box_h);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
draw_frame(s);
|
||||
if (s->dragon_driving_ui) {
|
||||
draw_frame(s);
|
||||
}
|
||||
glViewport(0, 0, s->fb_w, s->fb_h);
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
|
||||
@@ -1818,21 +1820,22 @@ static void ui_draw_vision(UIState *s) {
|
||||
|
||||
nvgBeginFrame(s->vg, s->fb_w, s->fb_h, 1.0f);
|
||||
nvgSave(s->vg);
|
||||
|
||||
// Draw augmented elements
|
||||
const int inner_height = viz_w*9/16;
|
||||
nvgScissor(s->vg, ui_viz_rx, box_y, ui_viz_rw, box_h);
|
||||
nvgTranslate(s->vg, ui_viz_rx+ui_viz_ro, box_y + (box_h-inner_height)/2.0);
|
||||
nvgScale(s->vg, (float)viz_w / s->fb_w, (float)inner_height / s->fb_h);
|
||||
if (!scene->frontview && !scene->fullview) {
|
||||
ui_draw_world(s);
|
||||
if (s->dragon_driving_ui) {
|
||||
// Draw augmented elements
|
||||
const int inner_height = viz_w*9/16;
|
||||
nvgScissor(s->vg, ui_viz_rx, box_y, ui_viz_rw, box_h);
|
||||
nvgTranslate(s->vg, ui_viz_rx+ui_viz_ro, box_y + (box_h-inner_height)/2.0);
|
||||
nvgScale(s->vg, (float)viz_w / s->fb_w, (float)inner_height / s->fb_h);
|
||||
if (!scene->frontview && !scene->fullview) {
|
||||
ui_draw_world(s);
|
||||
}
|
||||
}
|
||||
|
||||
nvgRestore(s->vg);
|
||||
|
||||
// Set Speed, Current Speed, Status/Events
|
||||
ui_draw_vision_header(s);
|
||||
|
||||
if (s->dragon_driving_ui) {
|
||||
// Set Speed, Current Speed, Status/Events
|
||||
ui_draw_vision_header(s);
|
||||
}
|
||||
if (s->scene.alert_size != ALERTSIZE_NONE) {
|
||||
// Controls Alerts
|
||||
ui_draw_vision_alert(s, s->scene.alert_size, s->status,
|
||||
@@ -1852,7 +1855,7 @@ static void ui_draw_blank(UIState *s) {
|
||||
}
|
||||
|
||||
static void ui_draw(UIState *s) {
|
||||
if (s->dragon_driving_ui && s->vision_connected && s->plus_state == 0) {
|
||||
if (s->vision_connected && s->plus_state == 0) {
|
||||
ui_draw_vision(s);
|
||||
} else {
|
||||
ui_draw_blank(s);
|
||||
|
||||
Reference in New Issue
Block a user