wip
This commit is contained in:
@@ -1,137 +1,149 @@
|
|||||||
|
|
||||||
- test that lkas button crashes controlsd, it should
|
|
||||||
- test that lkas button creates an alert, it should
|
- test that lkas button crashes controlsd, it should
|
||||||
|
- test that lkas button creates an alert, it should
|
||||||
- hyundai clsc https://github.com/garrettpall/openpilot/commit/5528198aa73d3d017d16ec4ca38306b11e5da0a8
|
|
||||||
|
- hyundai clsc https://github.com/garrettpall/openpilot/commit/5528198aa73d3d017d16ec4ca38306b11e5da0a8
|
||||||
- test tools/replay to get UI working offline
|
|
||||||
- add debug elements to ui with a boolean at top of onroad.cc to enable/disable:
|
- get ui to work on its own using no video feed, custom ui state inputs
|
||||||
- curviture
|
- dress up ui
|
||||||
- current speed limit
|
|
||||||
- current cruise speed
|
- add debug elements to ui with a boolean at top of onroad.cc to enable/disable:
|
||||||
- current experimental mode speed
|
- curviture
|
||||||
- current distance to lead based on radar
|
- current speed limit
|
||||||
- current distance to lead based on model draw distance
|
- current cruise speed
|
||||||
- current speed of lead
|
- current experimental mode speed
|
||||||
|
- current distance to lead based on radar
|
||||||
- make side lanes 10% wider and the disengage mode 10% brighter
|
- current distance to lead based on model draw distance
|
||||||
- make 25% of side lanes 50% darker than base
|
- current speed of lead
|
||||||
|
|
||||||
- hello world alert triggered by lkas btn
|
- when changing lanes and lateral disabled, draw a narrow single 'line' down center
|
||||||
- hello world bootstrap dashboard
|
- of computed path, and don't show side lane boundaries
|
||||||
|
|
||||||
- button stuff:
|
- make side lanes 10% wider and the disengage mode 10% brighter
|
||||||
- read paddle left (for full nudgeless lane change + blinker, reset to drive)
|
- make 25% of side lanes 50% darker than base
|
||||||
- read paddle right ("")
|
|
||||||
- read current drive mode, reset paddle mode to drive
|
- hello world alert triggered by lkas btn
|
||||||
- write pause, res, accel, mode, drive
|
- hello world bootstrap dashboard
|
||||||
|
|
||||||
wishlist: read / write info switcher, hvac, windows
|
- button stuff:
|
||||||
wishlist: allow lane assist (not lane keep) on disengage
|
- read paddle left (for full nudgeless lane change + blinker, reset to drive)
|
||||||
|
- read paddle right ("")
|
||||||
test:
|
- read current drive mode, reset paddle mode to drive
|
||||||
- disable all canbus
|
- write pause, res, accel, mode, drive
|
||||||
- set speed limit during stock long
|
|
||||||
|
wishlist: read / write info switcher, hvac, windows
|
||||||
OP -> Oscar
|
wishlist: allow lane assist (not lane keep) on disengage
|
||||||
- oscar - global clearpilot state var
|
|
||||||
- oscar.cs - clearpilot car state (populated by op variables for cp.planner)
|
test:
|
||||||
- oscar.ce - clearpilot car event queue (array that can be pushed to from car)
|
- disable all canbus
|
||||||
- oscar.ceh - event queue history (for debug)
|
- set speed limit during stock long
|
||||||
- oscar.clog - error and console.log style one off messages to transmit to logs or watching consoles
|
|
||||||
Oscar -> OP
|
OP -> Oscar
|
||||||
- oscar.ps - clearpilot planner state (data from cp)
|
- oscar - global clearpilot state var
|
||||||
- oscar.pe - clearpilot planner event (one time events from planner to be processed by openpilot)
|
- oscar.cs - clearpilot car state (populated by op variables for cp.planner)
|
||||||
- oscar.peh - planner event history (for debug)
|
- oscar.ce - clearpilot car event queue (array that can be pushed to from car)
|
||||||
- oscar.plog - retransmits clog as well as additional data for UI based log consoles
|
- oscar.ceh - event queue history (for debug)
|
||||||
|
- oscar.clog - error and console.log style one off messages to transmit to logs or watching consoles
|
||||||
- oscar - clearpilot's planner - nodejs process that synchronizes state between all processes and makes decisions
|
Oscar -> OP
|
||||||
|
- oscar.ps - clearpilot planner state (data from cp)
|
||||||
- settings menu
|
- oscar.pe - clearpilot planner event (one time events from planner to be processed by openpilot)
|
||||||
- - branch selector - release, stage, dev. Stage is my personal release branch. Should always be able to easilly switch to stage while im in a development state.
|
- oscar.peh - planner event history (for debug)
|
||||||
|
- oscar.plog - retransmits clog as well as additional data for UI based log consoles
|
||||||
- unfuck the directory structure. new structure:
|
|
||||||
-
|
- oscar - clearpilot's planner - nodejs process that synchronizes state between all processes and makes decisions
|
||||||
|
|
||||||
-------
|
- settings menu
|
||||||
|
- - branch selector - release, stage, dev. Stage is my personal release branch. Should always be able to easilly switch to stage while im in a development state.
|
||||||
- make functions
|
|
||||||
--- get_curvature
|
- unfuck the directory structure. new structure:
|
||||||
--- get_wheel_angle
|
-
|
||||||
--- get_distance_to_left_lane
|
|
||||||
--- get_distance_to_right_lane
|
-------
|
||||||
--- are hands on wheel
|
|
||||||
--- distance traveled for lane change
|
- make functions
|
||||||
--- distance to lead
|
--- get_curvature
|
||||||
- put these on a debug.
|
--- get_wheel_angle
|
||||||
|
--- get_distance_to_left_lane
|
||||||
- Design alternate settings webview
|
--- get_distance_to_right_lane
|
||||||
- get speed limit display working
|
--- are hands on wheel
|
||||||
- get calculated experimental speed display working
|
--- distance traveled for lane change
|
||||||
- get button press emulation working
|
--- distance to lead
|
||||||
- get experimental mode working
|
- put these on a debug.
|
||||||
- get speed limit set working
|
|
||||||
- dev enable lateral on blinker but no wheel pressure or no wheel presence
|
- Design alternate settings webview
|
||||||
- bluetooth dummy device
|
- get speed limit display working
|
||||||
|
- get calculated experimental speed display working
|
||||||
- Test if activation fix works for op long, submit to frog maintain
|
- get button press emulation working
|
||||||
- (test) disable all turn signal output commands - they are causing issues
|
- get experimental mode working
|
||||||
- test "create_acc_cancel" on canfd on cc engaged on boot
|
- get speed limit set working
|
||||||
- Create clearpilot process. manages behaviors.
|
- dev enable lateral on blinker but no wheel pressure or no wheel presence
|
||||||
- experiment with reduced jerk values
|
- bluetooth dummy device
|
||||||
- test toggle stop all canbus output
|
|
||||||
- check if acc_cancel events are being made on idle in stock long, if so, its a bug.
|
- Test if activation fix works for op long, submit to frog maintain
|
||||||
|
- (test) disable all turn signal output commands - they are causing issues
|
||||||
- Warn if significantly slower traffic
|
- test "create_acc_cancel" on canfd on cc engaged on boot
|
||||||
|
- Create clearpilot process. manages behaviors.
|
||||||
behaviors:
|
- experiment with reduced jerk values
|
||||||
|
- test toggle stop all canbus output
|
||||||
- lane change wrong way reenable lateral
|
- check if acc_cancel events are being made on idle in stock long, if so, its a bug.
|
||||||
- blinker signal wheel angle minor enable lateral
|
|
||||||
- wheel angle sharp only engage lateral if over lane edge unless hands not on wheel
|
- Warn if significantly slower traffic
|
||||||
- no lateral on turn signal - only enforce if model curvature > 10 degrees, hands on wheel, or wheel override (maybe curve not necessary?)
|
|
||||||
|
behaviors:
|
||||||
- debug mode activated bu lkas
|
|
||||||
|
- getting head mode - turn off babysitter with an alert on the screen that it is off, suspend for 10 minutes
|
||||||
- See where disk free is going with NCDU and add smarter log rotation
|
- in this mode it should be extra grouchy if a curve is detected, slowdown is detected, or lane lines are weak
|
||||||
- Maybe this has logs where it could show what happened to frogpilot process?
|
|
||||||
- Test supress cruise icon on long paused
|
- lane change wrong way reenable lateral
|
||||||
- increase center lane brightness 50% and make it blueish
|
- blinker signal wheel angle minor enable lateral
|
||||||
- make drive mode color much brighter and 30% more white
|
- wheel angle sharp only engage lateral if over lane edge unless hands not on wheel
|
||||||
- maintain lateral on icon on stop on dash
|
- no lateral on turn signal - only enforce if model curvature > 10 degrees, hands on wheel, or wheel override (maybe curve not necessary?)
|
||||||
- prevent engagement if disengaged and brakes are applied, just enable lateral
|
|
||||||
- edit manager to log all stderr output
|
|
||||||
- find a way to disable all logging unless debug mode enabled (screen setting)
|
- basic lane keep - nudge wheel slightly if over line and still going straight and hands on wheel
|
||||||
- set up dash cam recordings
|
|
||||||
- disable dash cam and record in real logger mode if debug mode is entered
|
- debug mode activated bu lkas
|
||||||
|
|
||||||
- Integrate here maps api for traffic data
|
- See where disk free is going with NCDU and add smarter log rotation
|
||||||
- maybe even speed limit data? and location data?
|
- Maybe this has logs where it could show what happened to frogpilot process?
|
||||||
|
- Test supress cruise icon on long paused
|
||||||
- write a debug function for python that cats data to a screen terminal and optionally a log file
|
- increase center lane brightness 50% and make it blueish
|
||||||
- if cruise already engaged when boot, just enable lateral
|
- make drive mode color much brighter and 30% more white
|
||||||
- reengage lateral if changing lanes and changing the wrong way
|
- maintain lateral on icon on stop on dash
|
||||||
- speed limit display / over speed display / trigger set
|
- prevent engagement if disengaged and brakes are applied, just enable lateral
|
||||||
- hack the buttons so we can press them
|
- edit manager to log all stderr output
|
||||||
- auto set speed limit
|
- find a way to disable all logging unless debug mode enabled (screen setting)
|
||||||
- conditional experimenal mode
|
- set up dash cam recordings
|
||||||
- ui conditional experimental mode, orange lines, show large font of desired speed in lower left
|
- disable dash cam and record in real logger mode if debug mode is entered
|
||||||
- hold down button to turn off screen, remember setting
|
|
||||||
- bluetooth dummy device
|
- Integrate here maps api for traffic data
|
||||||
- dash cam
|
- maybe even speed limit data? and location data?
|
||||||
- change disk used on sidebar to disk free / percent used
|
|
||||||
-
|
- write a debug function for python that cats data to a screen terminal and optionally a log file
|
||||||
- warn if lead is going more than 30 under my speed or 20 if auto mode is off
|
- if cruise already engaged when boot, just enable lateral
|
||||||
|
- reengage lateral if changing lanes and changing the wrong way
|
||||||
- mark os version different than release, forcing a os reinstall
|
- speed limit display / over speed display / trigger set
|
||||||
- no prompt on os reinstall
|
- hack the buttons so we can press them
|
||||||
|
- auto set speed limit
|
||||||
|
- conditional experimenal mode
|
||||||
Test features wizard:
|
- ui conditional experimental mode, orange lines, show large font of desired speed in lower left
|
||||||
- read paddles
|
- hold down button to turn off screen, remember setting
|
||||||
- read speed
|
- bluetooth dummy device
|
||||||
- adjust speed
|
- dash cam
|
||||||
- cancel / resume
|
- change disk used on sidebar to disk free / percent used
|
||||||
- reset drive mode
|
-
|
||||||
- read radar distance
|
- warn if lead is going more than 30 under my speed or 20 if auto mode is off
|
||||||
- activate blinkers
|
|
||||||
|
- mark os version different than release, forcing a os reinstall
|
||||||
|
- no prompt on os reinstall
|
||||||
|
|
||||||
|
|
||||||
|
Test features wizard:
|
||||||
|
- read paddles
|
||||||
|
- read speed
|
||||||
|
- adjust speed
|
||||||
|
- cancel / resume
|
||||||
|
- reset drive mode
|
||||||
|
- read radar distance
|
||||||
|
- activate blinkers
|
||||||
|
|||||||
BIN
selfdrive/clearpilot/resource/debug_ui_scene.png
Normal file
BIN
selfdrive/clearpilot/resource/debug_ui_scene.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
@@ -30,6 +30,7 @@ HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) {
|
|||||||
sidebar = new Sidebar(this);
|
sidebar = new Sidebar(this);
|
||||||
main_layout->addWidget(sidebar);
|
main_layout->addWidget(sidebar);
|
||||||
QObject::connect(sidebar, &Sidebar::openSettings, this, &HomeWindow::openSettings);
|
QObject::connect(sidebar, &Sidebar::openSettings, this, &HomeWindow::openSettings);
|
||||||
|
QObject::connect(sidebar, &Sidebar::openOnroad, this, &HomeWindow::openOnroad);
|
||||||
|
|
||||||
slayout = new QStackedLayout();
|
slayout = new QStackedLayout();
|
||||||
main_layout->addLayout(slayout);
|
main_layout->addLayout(slayout);
|
||||||
@@ -42,9 +43,6 @@ HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) {
|
|||||||
QObject::connect(onroad, &OnroadWindow::mapPanelRequested, this, [=] { sidebar->hide(); });
|
QObject::connect(onroad, &OnroadWindow::mapPanelRequested, this, [=] { sidebar->hide(); });
|
||||||
slayout->addWidget(onroad);
|
slayout->addWidget(onroad);
|
||||||
|
|
||||||
body = new BodyWindow(this);
|
|
||||||
slayout->addWidget(body);
|
|
||||||
|
|
||||||
// CLEARPILOT
|
// CLEARPILOT
|
||||||
ready = new ReadyWindow(this);
|
ready = new ReadyWindow(this);
|
||||||
slayout->addWidget(ready);
|
slayout->addWidget(ready);
|
||||||
@@ -62,6 +60,11 @@ HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) {
|
|||||||
QObject::connect(uiState(), &UIState::offroadTransition, sidebar, &Sidebar::offroadTransition);
|
QObject::connect(uiState(), &UIState::offroadTransition, sidebar, &Sidebar::offroadTransition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Debug function to activate onroad UI
|
||||||
|
void HomeWindow::openOnroad() {
|
||||||
|
sidebar->setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
void HomeWindow::showSidebar(bool show) {
|
void HomeWindow::showSidebar(bool show) {
|
||||||
sidebar->setVisible(show);
|
sidebar->setVisible(show);
|
||||||
}
|
}
|
||||||
@@ -72,26 +75,15 @@ void HomeWindow::showMapPanel(bool show) {
|
|||||||
|
|
||||||
void HomeWindow::updateState(const UIState &s) {
|
void HomeWindow::updateState(const UIState &s) {
|
||||||
// const SubMaster &sm = *(s.sm);
|
// const SubMaster &sm = *(s.sm);
|
||||||
|
|
||||||
// CLEARPILOT
|
|
||||||
// switch to the generic robot UI
|
|
||||||
// if (onroad->isVisible() && !body->isEnabled() && sm["carParams"].getCarParams().getNotCar()) {
|
|
||||||
// body->setEnabled(true);
|
|
||||||
// slayout->setCurrentWidget(body);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (s.scene.started) {
|
if (s.scene.started) {
|
||||||
showDriverView(s.scene.driver_camera_timer >= 10, true);
|
showDriverView(s.scene.driver_camera_timer >= 10, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void HomeWindow::offroadTransition(bool offroad) {
|
void HomeWindow::offroadTransition(bool offroad) {
|
||||||
body->setEnabled(false);
|
|
||||||
if (offroad) {
|
if (offroad) {
|
||||||
sidebar->setVisible(false);
|
sidebar->setVisible(false);
|
||||||
slayout->setCurrentWidget(ready);
|
slayout->setCurrentWidget(ready);
|
||||||
// slayout->setCurrentWidget(home);
|
|
||||||
// this->showDriverView(true, true); // Temp
|
|
||||||
} else {
|
} else {
|
||||||
sidebar->setVisible(false);
|
sidebar->setVisible(false);
|
||||||
slayout->setCurrentWidget(onroad);
|
slayout->setCurrentWidget(onroad);
|
||||||
@@ -119,13 +111,6 @@ void HomeWindow::mousePressEvent(QMouseEvent* e) {
|
|||||||
// CLEARPILOT todo - tap on main goes straight to settings
|
// CLEARPILOT todo - tap on main goes straight to settings
|
||||||
// Unless we click a debug widget.
|
// Unless we click a debug widget.
|
||||||
|
|
||||||
// Handle sidebar collapsing
|
|
||||||
// if ((onroad->isVisible() || body->isVisible()) && (!sidebar->isVisible() || e->x() > sidebar->width())) {
|
|
||||||
// sidebar->setVisible(!sidebar->isVisible() && !onroad->isMapVisible());
|
|
||||||
// uiState()->scene.map_open = onroad->isMapVisible();
|
|
||||||
// params.putBool("Sidebar", sidebar->isVisible());
|
|
||||||
// }
|
|
||||||
|
|
||||||
// CLEARPILOT - click ready shows home
|
// CLEARPILOT - click ready shows home
|
||||||
if (!onroad->isVisible() && ready->isVisible()) {
|
if (!onroad->isVisible() && ready->isVisible()) {
|
||||||
sidebar->setVisible(true);
|
sidebar->setVisible(true);
|
||||||
@@ -141,14 +126,6 @@ void HomeWindow::mousePressEvent(QMouseEvent* e) {
|
|||||||
void HomeWindow::mouseDoubleClickEvent(QMouseEvent* e) {
|
void HomeWindow::mouseDoubleClickEvent(QMouseEvent* e) {
|
||||||
HomeWindow::mousePressEvent(e);
|
HomeWindow::mousePressEvent(e);
|
||||||
const SubMaster &sm = *(uiState()->sm);
|
const SubMaster &sm = *(uiState()->sm);
|
||||||
if (sm["carParams"].getCarParams().getNotCar()) {
|
|
||||||
if (onroad->isVisible()) {
|
|
||||||
slayout->setCurrentWidget(body);
|
|
||||||
} else if (body->isVisible()) {
|
|
||||||
slayout->setCurrentWidget(onroad);
|
|
||||||
}
|
|
||||||
showSidebar(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// OffroadHome: the offroad home page
|
// OffroadHome: the offroad home page
|
||||||
@@ -250,8 +227,10 @@ void OffroadHome::refresh() {
|
|||||||
date->setText(QLocale(uiState()->language.mid(5)).toString(QDateTime::currentDateTime(), "dddd, MMMM d"));
|
date->setText(QLocale(uiState()->language.mid(5)).toString(QDateTime::currentDateTime(), "dddd, MMMM d"));
|
||||||
version->setText(getBrand() + " v" + getVersion().left(14).trimmed() + " - " + model);
|
version->setText(getBrand() + " v" + getVersion().left(14).trimmed() + " - " + model);
|
||||||
|
|
||||||
bool updateAvailable = update_widget->refresh();
|
// bool updateAvailable = update_widget->refresh();
|
||||||
|
|
||||||
int alerts = alerts_widget->refresh();
|
int alerts = alerts_widget->refresh();
|
||||||
|
|
||||||
if (alerts > 0 && !alerts_widget->isVisible()) {
|
if (alerts > 0 && !alerts_widget->isVisible()) {
|
||||||
alerts_widget->setVisible(true);
|
alerts_widget->setVisible(true);
|
||||||
} else if (alerts == 0 && alerts_widget->isVisible()) {
|
} else if (alerts == 0 && alerts_widget->isVisible()) {
|
||||||
@@ -260,20 +239,19 @@ void OffroadHome::refresh() {
|
|||||||
|
|
||||||
// pop-up new notification
|
// pop-up new notification
|
||||||
// CLEARPILOT temp disabled update notifications
|
// CLEARPILOT temp disabled update notifications
|
||||||
int idx = center_layout->currentIndex();
|
// int idx = center_layout->currentIndex();
|
||||||
if (!updateAvailable && !alerts && false) {
|
// if (!updateAvailable && !alerts && false) {
|
||||||
idx = 0;
|
// idx = 0;
|
||||||
} else if (updateAvailable && (!update_notif->isVisible() || (!alerts && idx == 2))) {
|
// } else if (updateAvailable && (!update_notif->isVisible() || (!alerts && idx == 2))) {
|
||||||
idx = 1;
|
// idx = 1;
|
||||||
} else if (alerts && (!alert_notif->isVisible() || (!updateAvailable && idx == 1))) {
|
// } else if (alerts && (!alert_notif->isVisible() || (!updateAvailable && idx == 1))) {
|
||||||
idx = 2;
|
// idx = 2;
|
||||||
}
|
// }
|
||||||
center_layout->setCurrentIndex(idx);
|
// center_layout->setCurrentIndex(idx);
|
||||||
|
|
||||||
// CLEARPILOT temp disabled update notifications
|
// CLEARPILOT temp disabled update notifications
|
||||||
// update_notif->setVisible(updateAvailable);
|
// update_notif->setVisible(updateAvailable);
|
||||||
// alert_notif->setVisible(alerts);
|
// alert_notif->setVisible(alerts);
|
||||||
update_notif->setVisible(false);
|
|
||||||
alert_notif->setVisible(false);
|
alert_notif->setVisible(false);
|
||||||
if (alerts) {
|
if (alerts) {
|
||||||
alert_notif->setText(QString::number(alerts) + (alerts > 1 ? tr(" ALERTS") : tr(" ALERT")));
|
alert_notif->setText(QString::number(alerts) + (alerts > 1 ? tr(" ALERTS") : tr(" ALERT")));
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
#include "common/params.h"
|
#include "common/params.h"
|
||||||
#include "selfdrive/ui/qt/offroad/driverview.h"
|
#include "selfdrive/ui/qt/offroad/driverview.h"
|
||||||
#include "selfdrive/ui/qt/body.h"
|
|
||||||
#include "selfdrive/ui/qt/ready.h"
|
#include "selfdrive/ui/qt/ready.h"
|
||||||
#include "selfdrive/ui/qt/onroad.h"
|
#include "selfdrive/ui/qt/onroad.h"
|
||||||
#include "selfdrive/ui/qt/sidebar.h"
|
#include "selfdrive/ui/qt/sidebar.h"
|
||||||
@@ -70,7 +69,6 @@ private:
|
|||||||
Sidebar *sidebar;
|
Sidebar *sidebar;
|
||||||
OffroadHome *home;
|
OffroadHome *home;
|
||||||
OnroadWindow *onroad;
|
OnroadWindow *onroad;
|
||||||
BodyWindow *body;
|
|
||||||
DriverViewWindow *driver_view;
|
DriverViewWindow *driver_view;
|
||||||
QStackedLayout *slayout;
|
QStackedLayout *slayout;
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ Sidebar::Sidebar(QWidget *parent) : QFrame(parent), onroad(false), flag_pressed(
|
|||||||
home_img = loadPixmap("../assets/images/button_home.png", home_btn.size());
|
home_img = loadPixmap("../assets/images/button_home.png", home_btn.size());
|
||||||
flag_img = loadPixmap("../assets/images/button_flag.png", home_btn.size());
|
flag_img = loadPixmap("../assets/images/button_flag.png", home_btn.size());
|
||||||
settings_img = loadPixmap("../assets/images/button_settings.png", settings_btn.size(), Qt::IgnoreAspectRatio);
|
settings_img = loadPixmap("../assets/images/button_settings.png", settings_btn.size(), Qt::IgnoreAspectRatio);
|
||||||
|
currentColors = QColor(255, 255, 255);
|
||||||
|
|
||||||
connect(this, &Sidebar::valueChanged, [=] { update(); });
|
connect(this, &Sidebar::valueChanged, [=] { update(); });
|
||||||
|
|
||||||
@@ -49,52 +50,6 @@ Sidebar::Sidebar(QWidget *parent) : QFrame(parent), onroad(false), flag_pressed(
|
|||||||
isStorageLeft = params.getBool("ShowStorageLeft");
|
isStorageLeft = params.getBool("ShowStorageLeft");
|
||||||
isStorageUsed = params.getBool("ShowStorageUsed");
|
isStorageUsed = params.getBool("ShowStorageUsed");
|
||||||
|
|
||||||
holidayThemeConfiguration = {
|
|
||||||
{0, {"stock", {QColor(255, 255, 255)}}},
|
|
||||||
{1, {"april_fools", {QColor(255, 165, 0)}}},
|
|
||||||
{2, {"christmas", {QColor(0, 72, 255)}}},
|
|
||||||
{3, {"cinco_de_mayo", {QColor(0, 104, 71)}}},
|
|
||||||
{4, {"easter", {QColor(200, 150, 200)}}},
|
|
||||||
{5, {"fourth_of_july", {QColor(0, 72, 255)}}},
|
|
||||||
{6, {"halloween", {QColor(255, 0, 0)}}},
|
|
||||||
{7, {"new_years_day", {QColor(23, 134, 68)}}},
|
|
||||||
{8, {"st_patricks_day", {QColor(0, 128, 0)}}},
|
|
||||||
{9, {"thanksgiving", {QColor(255, 0, 0)}}},
|
|
||||||
{10, {"valentines_day", {QColor(23, 134, 68)}}},
|
|
||||||
{11, {"world_frog_day", {QColor(23, 134, 68)}}},
|
|
||||||
};
|
|
||||||
|
|
||||||
for (auto &[key, themeData] : holidayThemeConfiguration) {
|
|
||||||
QString &themeName = themeData.first;
|
|
||||||
QString base = themeName == "stock" ? "../assets/images" : QString("../frogpilot/assets/holiday_themes/%1/images").arg(themeName);
|
|
||||||
std::vector<QString> paths = {base + "/button_home.png", base + "/button_flag.png", base + "/button_settings.png"};
|
|
||||||
|
|
||||||
holiday_home_imgs[key] = loadPixmap(paths[0], home_btn.size());
|
|
||||||
holiday_flag_imgs[key] = loadPixmap(paths[1], home_btn.size());
|
|
||||||
holiday_settings_imgs[key] = loadPixmap(paths[2], settings_btn.size(), Qt::IgnoreAspectRatio);
|
|
||||||
}
|
|
||||||
|
|
||||||
themeConfiguration = {
|
|
||||||
{0, {"stock", {QColor(255, 255, 255)}}},
|
|
||||||
{1, {"frog_theme", {QColor(255, 255, 255)}}},
|
|
||||||
{2, {"tesla_theme", {QColor(255, 255, 255)}}},
|
|
||||||
{3, {"stalin_theme", {QColor(255, 255, 255)}}}
|
|
||||||
};
|
|
||||||
|
|
||||||
for (auto &[key, themeData] : themeConfiguration) {
|
|
||||||
QString &themeName = themeData.first;
|
|
||||||
QString base = themeName == "stock" ? "../assets/images" : QString("../frogpilot/assets/custom_themes/%1/images").arg(themeName);
|
|
||||||
std::vector<QString> paths = {base + "/button_home.png", base + "/button_flag.png", base + "/button_settings.png"};
|
|
||||||
|
|
||||||
home_imgs[key] = loadPixmap(paths[0], home_btn.size());
|
|
||||||
flag_imgs[key] = loadPixmap(paths[1], home_btn.size());
|
|
||||||
settings_imgs[key] = loadPixmap(paths[2], settings_btn.size(), Qt::IgnoreAspectRatio);
|
|
||||||
}
|
|
||||||
|
|
||||||
home_img = home_imgs[scene.custom_icons];
|
|
||||||
flag_img = flag_imgs[scene.custom_icons];
|
|
||||||
settings_img = settings_imgs[scene.custom_icons];
|
|
||||||
currentColors = themeConfiguration[scene.custom_colors].second;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sidebar::mousePressEvent(QMouseEvent *event) {
|
void Sidebar::mousePressEvent(QMouseEvent *event) {
|
||||||
@@ -163,9 +118,14 @@ void Sidebar::mouseReleaseEvent(QMouseEvent *event) {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
if (home_btn.contains(event->pos())) {
|
if (home_btn.contains(event->pos())) {
|
||||||
|
|
||||||
|
// ?? remove?
|
||||||
MessageBuilder msg;
|
MessageBuilder msg;
|
||||||
msg.initEvent().initUserFlag();
|
msg.initEvent().initUserFlag();
|
||||||
pm->send("userFlag", msg);
|
pm->send("userFlag", msg);
|
||||||
|
|
||||||
|
emit openOnroad();
|
||||||
|
|
||||||
} else if (settings_btn.contains(event->pos())) {
|
} else if (settings_btn.contains(event->pos())) {
|
||||||
emit openSettings();
|
emit openSettings();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void openSettings(int index = 0, const QString ¶m = "");
|
void openSettings(int index = 0, const QString ¶m = "");
|
||||||
|
void openOnroad(int index = 0, const QString ¶m = "");
|
||||||
void valueChanged();
|
void valueChanged();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ typedef enum UIStatus {
|
|||||||
STATUS_TRAFFIC_MODE_ACTIVE,
|
STATUS_TRAFFIC_MODE_ACTIVE,
|
||||||
STATUS_EXPERIMENTAL_ACTIVE,
|
STATUS_EXPERIMENTAL_ACTIVE,
|
||||||
CENTER_LANE_COLOR,
|
CENTER_LANE_COLOR,
|
||||||
|
CHANGE_LANE_PATH_COLOR,
|
||||||
} UIStatus;
|
} UIStatus;
|
||||||
|
|
||||||
// Clearpilot new alpha constants
|
// Clearpilot new alpha constants
|
||||||
@@ -39,16 +40,18 @@ const float OTHER_LANE_ALPHA = 0.75;
|
|||||||
const int CENTER_LANE_WIDTH = 70;
|
const int CENTER_LANE_WIDTH = 70;
|
||||||
const int OTHER_LANE_WIDTH = 16;
|
const int OTHER_LANE_WIDTH = 16;
|
||||||
|
|
||||||
|
const ACTIVE_COLOR = QColor(189, 199, 252, 0xd1);
|
||||||
|
|
||||||
// Clearpilot custom colors
|
// Clearpilot custom colors
|
||||||
const QColor bg_colors [] = {
|
const QColor bg_colors [] = {
|
||||||
[STATUS_DISENGAGED] = QColor(0x17, 0x33, 0x49, 0xc8),
|
[STATUS_DISENGAGED] = QColor(0x17, 0x33, 0x49, 0xc8),
|
||||||
[STATUS_OVERRIDE] = QColor(94, 112, 255, 0xd1),
|
[STATUS_OVERRIDE] = ACTIVE_COLOR,
|
||||||
[STATUS_ENGAGED] = QColor(76, 97, 255, 0xd1),
|
[STATUS_ENGAGED] = ACTIVE_COLOR,
|
||||||
[STATUS_ALWAYS_ON_LATERAL_ACTIVE] = QColor(209, 215, 250, 0xd1),
|
[STATUS_ALWAYS_ON_LATERAL_ACTIVE] = ACTIVE_COLOR,
|
||||||
// [STATUS_ALWAYS_ON_LATERAL_ACTIVE] = QColor(184, 193, 255, 0xd1),
|
[STATUS_TRAFFIC_MODE_ACTIVE] = ACTIVE_COLOR,
|
||||||
[STATUS_TRAFFIC_MODE_ACTIVE] = QColor(0xc9, 0x22, 0x31, 0xd1), // ? unused?
|
[STATUS_EXPERIMENTAL_ACTIVE] = QColor(201, 41, 204, 0xd1),
|
||||||
[STATUS_EXPERIMENTAL_ACTIVE] = QColor(201, 41, 204, 0xd1), // Magenta
|
[CENTER_LANE_COLOR] = QColor(150, 150, 150, 0xd1),
|
||||||
[CENTER_LANE_COLOR] = QColor(150, 150, 150, 0xd1), // Gray
|
[CHANGE_LANE_PATH_COLOR] = QColor(245, 241, 93, 0xd1),
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::map<cereal::ControlsState::AlertStatus, QColor> alert_colors = {
|
static std::map<cereal::ControlsState::AlertStatus, QColor> alert_colors = {
|
||||||
|
|||||||
Reference in New Issue
Block a user