This commit is contained in:
Your Name
2024-05-17 09:49:46 -05:00
parent 1ff14d346f
commit 22f88bb093
7 changed files with 184 additions and 232 deletions

View File

@@ -1,137 +1,149 @@
- 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
- test tools/replay to get UI working offline
- add debug elements to ui with a boolean at top of onroad.cc to enable/disable:
- curviture
- current speed limit
- current cruise speed
- current experimental mode speed
- current distance to lead based on radar
- current distance to lead based on model draw distance
- current speed of lead
- make side lanes 10% wider and the disengage mode 10% brighter
- make 25% of side lanes 50% darker than base
- hello world alert triggered by lkas btn
- hello world bootstrap dashboard
- button stuff:
- read paddle left (for full nudgeless lane change + blinker, reset to drive)
- read paddle right ("")
- read current drive mode, reset paddle mode to drive
- write pause, res, accel, mode, drive
wishlist: read / write info switcher, hvac, windows
wishlist: allow lane assist (not lane keep) on disengage
test:
- disable all canbus
- set speed limit during stock long
OP -> Oscar
- oscar - global clearpilot state var
- oscar.cs - clearpilot car state (populated by op variables for cp.planner)
- oscar.ce - clearpilot car event queue (array that can be pushed to from car)
- 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 -> OP
- oscar.ps - clearpilot planner state (data from cp)
- oscar.pe - clearpilot planner event (one time events from planner to be processed by openpilot)
- oscar.peh - planner event history (for debug)
- oscar.plog - retransmits clog as well as additional data for UI based log consoles
- 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.
- unfuck the directory structure. new structure:
-
-------
- make functions
--- get_curvature
--- get_wheel_angle
--- get_distance_to_left_lane
--- get_distance_to_right_lane
--- are hands on wheel
--- distance traveled for lane change
--- distance to lead
- put these on a debug.
- Design alternate settings webview
- get speed limit display working
- get calculated experimental speed display working
- get button press emulation working
- get experimental mode working
- get speed limit set working
- dev enable lateral on blinker but no wheel pressure or no wheel presence
- bluetooth dummy device
- Test if activation fix works for op long, submit to frog maintain
- (test) disable all turn signal output commands - they are causing issues
- test "create_acc_cancel" on canfd on cc engaged on boot
- Create clearpilot process. manages behaviors.
- experiment with reduced jerk values
- test toggle stop all canbus output
- check if acc_cancel events are being made on idle in stock long, if so, its a bug.
- Warn if significantly slower traffic
behaviors:
- lane change wrong way reenable lateral
- blinker signal wheel angle minor enable lateral
- wheel angle sharp only engage lateral if over lane edge unless hands not on wheel
- no lateral on turn signal - only enforce if model curvature > 10 degrees, hands on wheel, or wheel override (maybe curve not necessary?)
- debug mode activated bu lkas
- See where disk free is going with NCDU and add smarter log rotation
- Maybe this has logs where it could show what happened to frogpilot process?
- Test supress cruise icon on long paused
- increase center lane brightness 50% and make it blueish
- make drive mode color much brighter and 30% more white
- maintain lateral on icon on stop on dash
- 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)
- set up dash cam recordings
- disable dash cam and record in real logger mode if debug mode is entered
- Integrate here maps api for traffic data
- maybe even speed limit data? and location data?
- write a debug function for python that cats data to a screen terminal and optionally a log file
- if cruise already engaged when boot, just enable lateral
- reengage lateral if changing lanes and changing the wrong way
- speed limit display / over speed display / trigger set
- hack the buttons so we can press them
- auto set speed limit
- conditional experimenal mode
- ui conditional experimental mode, orange lines, show large font of desired speed in lower left
- hold down button to turn off screen, remember setting
- bluetooth dummy device
- dash cam
- change disk used on sidebar to disk free / percent used
-
- warn if lead is going more than 30 under my speed or 20 if auto mode is off
- 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
- 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
- get ui to work on its own using no video feed, custom ui state inputs
- dress up ui
- add debug elements to ui with a boolean at top of onroad.cc to enable/disable:
- curviture
- current speed limit
- current cruise speed
- current experimental mode speed
- current distance to lead based on radar
- current distance to lead based on model draw distance
- current speed of lead
- when changing lanes and lateral disabled, draw a narrow single 'line' down center
- of computed path, and don't show side lane boundaries
- make side lanes 10% wider and the disengage mode 10% brighter
- make 25% of side lanes 50% darker than base
- hello world alert triggered by lkas btn
- hello world bootstrap dashboard
- button stuff:
- read paddle left (for full nudgeless lane change + blinker, reset to drive)
- read paddle right ("")
- read current drive mode, reset paddle mode to drive
- write pause, res, accel, mode, drive
wishlist: read / write info switcher, hvac, windows
wishlist: allow lane assist (not lane keep) on disengage
test:
- disable all canbus
- set speed limit during stock long
OP -> Oscar
- oscar - global clearpilot state var
- oscar.cs - clearpilot car state (populated by op variables for cp.planner)
- oscar.ce - clearpilot car event queue (array that can be pushed to from car)
- 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 -> OP
- oscar.ps - clearpilot planner state (data from cp)
- oscar.pe - clearpilot planner event (one time events from planner to be processed by openpilot)
- oscar.peh - planner event history (for debug)
- oscar.plog - retransmits clog as well as additional data for UI based log consoles
- 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.
- unfuck the directory structure. new structure:
-
-------
- make functions
--- get_curvature
--- get_wheel_angle
--- get_distance_to_left_lane
--- get_distance_to_right_lane
--- are hands on wheel
--- distance traveled for lane change
--- distance to lead
- put these on a debug.
- Design alternate settings webview
- get speed limit display working
- get calculated experimental speed display working
- get button press emulation working
- get experimental mode working
- get speed limit set working
- dev enable lateral on blinker but no wheel pressure or no wheel presence
- bluetooth dummy device
- Test if activation fix works for op long, submit to frog maintain
- (test) disable all turn signal output commands - they are causing issues
- test "create_acc_cancel" on canfd on cc engaged on boot
- Create clearpilot process. manages behaviors.
- experiment with reduced jerk values
- test toggle stop all canbus output
- check if acc_cancel events are being made on idle in stock long, if so, its a bug.
- Warn if significantly slower traffic
behaviors:
- getting head mode - turn off babysitter with an alert on the screen that it is off, suspend for 10 minutes
- in this mode it should be extra grouchy if a curve is detected, slowdown is detected, or lane lines are weak
- lane change wrong way reenable lateral
- blinker signal wheel angle minor enable lateral
- wheel angle sharp only engage lateral if over lane edge unless hands not on wheel
- no lateral on turn signal - only enforce if model curvature > 10 degrees, hands on wheel, or wheel override (maybe curve not necessary?)
- basic lane keep - nudge wheel slightly if over line and still going straight and hands on wheel
- debug mode activated bu lkas
- See where disk free is going with NCDU and add smarter log rotation
- Maybe this has logs where it could show what happened to frogpilot process?
- Test supress cruise icon on long paused
- increase center lane brightness 50% and make it blueish
- make drive mode color much brighter and 30% more white
- maintain lateral on icon on stop on dash
- 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)
- set up dash cam recordings
- disable dash cam and record in real logger mode if debug mode is entered
- Integrate here maps api for traffic data
- maybe even speed limit data? and location data?
- write a debug function for python that cats data to a screen terminal and optionally a log file
- if cruise already engaged when boot, just enable lateral
- reengage lateral if changing lanes and changing the wrong way
- speed limit display / over speed display / trigger set
- hack the buttons so we can press them
- auto set speed limit
- conditional experimenal mode
- ui conditional experimental mode, orange lines, show large font of desired speed in lower left
- hold down button to turn off screen, remember setting
- bluetooth dummy device
- dash cam
- change disk used on sidebar to disk free / percent used
-
- warn if lead is going more than 30 under my speed or 20 if auto mode is off
- 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

@@ -30,6 +30,7 @@ HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) {
sidebar = new Sidebar(this);
main_layout->addWidget(sidebar);
QObject::connect(sidebar, &Sidebar::openSettings, this, &HomeWindow::openSettings);
QObject::connect(sidebar, &Sidebar::openOnroad, this, &HomeWindow::openOnroad);
slayout = new QStackedLayout();
main_layout->addLayout(slayout);
@@ -42,9 +43,6 @@ HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) {
QObject::connect(onroad, &OnroadWindow::mapPanelRequested, this, [=] { sidebar->hide(); });
slayout->addWidget(onroad);
body = new BodyWindow(this);
slayout->addWidget(body);
// CLEARPILOT
ready = new ReadyWindow(this);
slayout->addWidget(ready);
@@ -62,6 +60,11 @@ HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) {
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) {
sidebar->setVisible(show);
}
@@ -72,26 +75,15 @@ void HomeWindow::showMapPanel(bool show) {
void HomeWindow::updateState(const UIState &s) {
// 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) {
showDriverView(s.scene.driver_camera_timer >= 10, true);
}
}
void HomeWindow::offroadTransition(bool offroad) {
body->setEnabled(false);
if (offroad) {
sidebar->setVisible(false);
slayout->setCurrentWidget(ready);
// slayout->setCurrentWidget(home);
// this->showDriverView(true, true); // Temp
} else {
sidebar->setVisible(false);
slayout->setCurrentWidget(onroad);
@@ -119,13 +111,6 @@ void HomeWindow::mousePressEvent(QMouseEvent* e) {
// CLEARPILOT todo - tap on main goes straight to settings
// 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
if (!onroad->isVisible() && ready->isVisible()) {
sidebar->setVisible(true);
@@ -141,14 +126,6 @@ void HomeWindow::mousePressEvent(QMouseEvent* e) {
void HomeWindow::mouseDoubleClickEvent(QMouseEvent* e) {
HomeWindow::mousePressEvent(e);
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
@@ -250,8 +227,10 @@ void OffroadHome::refresh() {
date->setText(QLocale(uiState()->language.mid(5)).toString(QDateTime::currentDateTime(), "dddd, MMMM d"));
version->setText(getBrand() + " v" + getVersion().left(14).trimmed() + " - " + model);
bool updateAvailable = update_widget->refresh();
// bool updateAvailable = update_widget->refresh();
int alerts = alerts_widget->refresh();
if (alerts > 0 && !alerts_widget->isVisible()) {
alerts_widget->setVisible(true);
} else if (alerts == 0 && alerts_widget->isVisible()) {
@@ -260,20 +239,19 @@ void OffroadHome::refresh() {
// pop-up new notification
// CLEARPILOT temp disabled update notifications
int idx = center_layout->currentIndex();
if (!updateAvailable && !alerts && false) {
idx = 0;
} else if (updateAvailable && (!update_notif->isVisible() || (!alerts && idx == 2))) {
idx = 1;
} else if (alerts && (!alert_notif->isVisible() || (!updateAvailable && idx == 1))) {
idx = 2;
}
center_layout->setCurrentIndex(idx);
// int idx = center_layout->currentIndex();
// if (!updateAvailable && !alerts && false) {
// idx = 0;
// } else if (updateAvailable && (!update_notif->isVisible() || (!alerts && idx == 2))) {
// idx = 1;
// } else if (alerts && (!alert_notif->isVisible() || (!updateAvailable && idx == 1))) {
// idx = 2;
// }
// center_layout->setCurrentIndex(idx);
// CLEARPILOT temp disabled update notifications
// update_notif->setVisible(updateAvailable);
// alert_notif->setVisible(alerts);
update_notif->setVisible(false);
alert_notif->setVisible(false);
if (alerts) {
alert_notif->setText(QString::number(alerts) + (alerts > 1 ? tr(" ALERTS") : tr(" ALERT")));

View File

@@ -9,7 +9,6 @@
#include "common/params.h"
#include "selfdrive/ui/qt/offroad/driverview.h"
#include "selfdrive/ui/qt/body.h"
#include "selfdrive/ui/qt/ready.h"
#include "selfdrive/ui/qt/onroad.h"
#include "selfdrive/ui/qt/sidebar.h"
@@ -70,7 +69,6 @@ private:
Sidebar *sidebar;
OffroadHome *home;
OnroadWindow *onroad;
BodyWindow *body;
DriverViewWindow *driver_view;
QStackedLayout *slayout;

View File

@@ -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());
flag_img = loadPixmap("../assets/images/button_flag.png", home_btn.size());
settings_img = loadPixmap("../assets/images/button_settings.png", settings_btn.size(), Qt::IgnoreAspectRatio);
currentColors = QColor(255, 255, 255);
connect(this, &Sidebar::valueChanged, [=] { update(); });
@@ -49,52 +50,6 @@ Sidebar::Sidebar(QWidget *parent) : QFrame(parent), onroad(false), flag_pressed(
isStorageLeft = params.getBool("ShowStorageLeft");
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) {
@@ -163,9 +118,14 @@ void Sidebar::mouseReleaseEvent(QMouseEvent *event) {
update();
}
if (home_btn.contains(event->pos())) {
// ?? remove?
MessageBuilder msg;
msg.initEvent().initUserFlag();
pm->send("userFlag", msg);
emit openOnroad();
} else if (settings_btn.contains(event->pos())) {
emit openSettings();
}

View File

@@ -28,6 +28,7 @@ public:
signals:
void openSettings(int index = 0, const QString &param = "");
void openOnroad(int index = 0, const QString &param = "");
void valueChanged();
public slots:

View File

@@ -30,6 +30,7 @@ typedef enum UIStatus {
STATUS_TRAFFIC_MODE_ACTIVE,
STATUS_EXPERIMENTAL_ACTIVE,
CENTER_LANE_COLOR,
CHANGE_LANE_PATH_COLOR,
} UIStatus;
// Clearpilot new alpha constants
@@ -39,16 +40,18 @@ const float OTHER_LANE_ALPHA = 0.75;
const int CENTER_LANE_WIDTH = 70;
const int OTHER_LANE_WIDTH = 16;
const ACTIVE_COLOR = QColor(189, 199, 252, 0xd1);
// Clearpilot custom colors
const QColor bg_colors [] = {
[STATUS_DISENGAGED] = QColor(0x17, 0x33, 0x49, 0xc8),
[STATUS_OVERRIDE] = QColor(94, 112, 255, 0xd1),
[STATUS_ENGAGED] = QColor(76, 97, 255, 0xd1),
[STATUS_ALWAYS_ON_LATERAL_ACTIVE] = QColor(209, 215, 250, 0xd1),
// [STATUS_ALWAYS_ON_LATERAL_ACTIVE] = QColor(184, 193, 255, 0xd1),
[STATUS_TRAFFIC_MODE_ACTIVE] = QColor(0xc9, 0x22, 0x31, 0xd1), // ? unused?
[STATUS_EXPERIMENTAL_ACTIVE] = QColor(201, 41, 204, 0xd1), // Magenta
[CENTER_LANE_COLOR] = QColor(150, 150, 150, 0xd1), // Gray
[STATUS_OVERRIDE] = ACTIVE_COLOR,
[STATUS_ENGAGED] = ACTIVE_COLOR,
[STATUS_ALWAYS_ON_LATERAL_ACTIVE] = ACTIVE_COLOR,
[STATUS_TRAFFIC_MODE_ACTIVE] = ACTIVE_COLOR,
[STATUS_EXPERIMENTAL_ACTIVE] = QColor(201, 41, 204, 0xd1),
[CENTER_LANE_COLOR] = QColor(150, 150, 150, 0xd1),
[CHANGE_LANE_PATH_COLOR] = QColor(245, 241, 93, 0xd1),
};
static std::map<cereal::ControlsState::AlertStatus, QColor> alert_colors = {