wip
This commit is contained in:
22
clearpilot_devqueue_amain.txt
Normal file
22
clearpilot_devqueue_amain.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
- If possible, debug what happened to frogpilot process on may 4th
|
||||||
|
- 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
|
||||||
|
- Move pac man ghost logo up 10%
|
||||||
|
- 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
|
||||||
|
- 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
|
||||||
10
clearpilot_feature_documentation.txt
Normal file
10
clearpilot_feature_documentation.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
- Pause lateral on lane change
|
||||||
|
- Updated color scheme
|
||||||
|
- Updated boot / ready logo
|
||||||
|
- Go straight to settings from drive
|
||||||
|
- Show full screen splasn on offroad until tapped
|
||||||
|
- Updated LFA icons on dashboard
|
||||||
|
- Removed a lot of icons from UI
|
||||||
|
- Monitor never fully fatals
|
||||||
|
- Engage / Disengage sounds silenced
|
||||||
|
-
|
||||||
@@ -277,6 +277,20 @@ class CarState(CarStateBase):
|
|||||||
self.cruise_buttons.extend(cp.vl_all[self.cruise_btns_msg_canfd]["CRUISE_BUTTONS"])
|
self.cruise_buttons.extend(cp.vl_all[self.cruise_btns_msg_canfd]["CRUISE_BUTTONS"])
|
||||||
self.prev_main_buttons = self.main_buttons[-1]
|
self.prev_main_buttons = self.main_buttons[-1]
|
||||||
self.main_buttons.extend(cp.vl_all[self.cruise_btns_msg_canfd]["ADAPTIVE_CRUISE_MAIN_BTN"])
|
self.main_buttons.extend(cp.vl_all[self.cruise_btns_msg_canfd]["ADAPTIVE_CRUISE_MAIN_BTN"])
|
||||||
|
|
||||||
|
# testme
|
||||||
|
# if ret.cruiseState.speed > 1 and self.main_enabled == False:
|
||||||
|
# self.main_enabled = True
|
||||||
|
|
||||||
|
# test if this blocks trying to engage while pressin brakes
|
||||||
|
if self.main_buttons[-1] != 0 and ret.brakePressed and self.main_enabled == False:
|
||||||
|
self.main_buttons[-1] = 0
|
||||||
|
# But enable always on lateral if self.main_enabled = false
|
||||||
|
# I think this may require an override variable?
|
||||||
|
# It looks like always on lat is only set when cruise control is enabled
|
||||||
|
# We need a temp version that enables or disables it if cruise is off via button
|
||||||
|
# and then the temp state removes when the button is pressed again
|
||||||
|
|
||||||
if self.prev_main_buttons == 0 and self.main_buttons[-1] != 0:
|
if self.prev_main_buttons == 0 and self.main_buttons[-1] != 0:
|
||||||
self.main_enabled = not self.main_enabled
|
self.main_enabled = not self.main_enabled
|
||||||
# if self.fix_main_enabled_check:
|
# if self.fix_main_enabled_check:
|
||||||
|
|||||||
@@ -31,15 +31,14 @@ def calculate_lane_width(lane, current_lane, road_edge):
|
|||||||
|
|
||||||
return min(distance_to_lane, distance_to_road_edge)
|
return min(distance_to_lane, distance_to_road_edge)
|
||||||
|
|
||||||
|
# Clearpilot added default value 0
|
||||||
def calculate_road_curvature(modelData, v_ego):
|
def calculate_road_curvature(modelData, v_ego):
|
||||||
|
try:
|
||||||
predicted_velocities = np.array(modelData.velocity.x)
|
predicted_velocities = np.array(modelData.velocity.x)
|
||||||
# clearpilot fix
|
|
||||||
# /data/openpilot/openpilot/selfdrive/frogpilot/controls/lib/frogpilot_functions.py:36: RuntimeWarning: divide by zero encountered in divide
|
|
||||||
# curvature_ratios = np.abs(np.array(modelData.acceleration.y)) / (predicted_velocities**2)
|
|
||||||
curvature_ratios = np.abs(np.array(modelData.acceleration.y)) / (predicted_velocities**2)
|
curvature_ratios = np.abs(np.array(modelData.acceleration.y)) / (predicted_velocities**2)
|
||||||
# /data/openpilot/openpilot/selfdrive/frogpilot/controls/lib/frogpilot_functions.py:37: RuntimeWarning: invalid value encountered in multiply
|
|
||||||
# return np.amax(curvature_ratios * (v_ego**2))
|
|
||||||
return np.amax(curvature_ratios * (v_ego**2))
|
return np.amax(curvature_ratios * (v_ego**2))
|
||||||
|
except:
|
||||||
|
return 0
|
||||||
|
|
||||||
class MovingAverageCalculator:
|
class MovingAverageCalculator:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -141,6 +140,10 @@ class FrogPilotFunctions:
|
|||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def prune_recordings():
|
||||||
|
return
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setup_frogpilot(cls):
|
def setup_frogpilot(cls):
|
||||||
remount_cmd = ['sudo', 'mount', '-o', 'remount,rw', '/persist']
|
remount_cmd = ['sudo', 'mount', '-o', 'remount,rw', '/persist']
|
||||||
|
|||||||
@@ -21,17 +21,19 @@ from openpilot.selfdrive.frogpilot.controls.lib.theme_manager import ThemeManage
|
|||||||
|
|
||||||
WIFI = log.DeviceState.NetworkType.wifi
|
WIFI = log.DeviceState.NetworkType.wifi
|
||||||
|
|
||||||
|
# clearpilot disabled
|
||||||
def automatic_update_check(params):
|
def automatic_update_check(params):
|
||||||
update_available = params.get_bool("UpdaterFetchAvailable")
|
return
|
||||||
update_ready = params.get_bool("UpdateAvailable")
|
# update_available = params.get_bool("UpdaterFetchAvailable")
|
||||||
update_state = params.get("UpdaterState", encoding='utf8')
|
# update_ready = params.get_bool("UpdateAvailable")
|
||||||
|
# update_state = params.get("UpdaterState", encoding='utf8')
|
||||||
|
|
||||||
if update_ready:
|
# if update_ready:
|
||||||
HARDWARE.reboot()
|
# HARDWARE.reboot()
|
||||||
elif update_available:
|
# elif update_available:
|
||||||
os.system("pkill -SIGHUP -f selfdrive.updated.updated")
|
# os.system("pkill -SIGHUP -f selfdrive.updated.updated")
|
||||||
elif update_state == "idle":
|
# elif update_state == "idle":
|
||||||
os.system("pkill -SIGUSR1 -f selfdrive.updated.updated")
|
# os.system("pkill -SIGUSR1 -f selfdrive.updated.updated")
|
||||||
|
|
||||||
def github_pinged(url="https://github.com", timeout=5):
|
def github_pinged(url="https://github.com", timeout=5):
|
||||||
try:
|
try:
|
||||||
@@ -40,15 +42,17 @@ def github_pinged(url="https://github.com", timeout=5):
|
|||||||
except (urllib.error.URLError, socket.timeout, http.client.RemoteDisconnected):
|
except (urllib.error.URLError, socket.timeout, http.client.RemoteDisconnected):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# clearpilot disabled
|
||||||
def time_checks(automatic_updates, deviceState, params):
|
def time_checks(automatic_updates, deviceState, params):
|
||||||
if github_pinged():
|
return
|
||||||
populate_models()
|
# if github_pinged():
|
||||||
|
# populate_models()
|
||||||
|
|
||||||
screen_off = deviceState.screenBrightnessPercent == 0
|
# screen_off = deviceState.screenBrightnessPercent == 0
|
||||||
wifi_connection = deviceState.networkType == WIFI
|
# wifi_connection = deviceState.networkType == WIFI
|
||||||
|
|
||||||
if automatic_updates and screen_off and wifi_connection:
|
# if automatic_updates and screen_off and wifi_connection:
|
||||||
automatic_update_check(params)
|
# automatic_update_check(params)
|
||||||
|
|
||||||
def frogpilot_thread():
|
def frogpilot_thread():
|
||||||
config_realtime_process(5, Priority.CTRL_LOW)
|
config_realtime_process(5, Priority.CTRL_LOW)
|
||||||
|
|||||||
@@ -400,6 +400,8 @@ def manager_thread(frogpilot_functions) -> None:
|
|||||||
if openpilot_crashed:
|
if openpilot_crashed:
|
||||||
frogpilot_functions.delete_logs()
|
frogpilot_functions.delete_logs()
|
||||||
|
|
||||||
|
frogpilot_functions.prune_logs()
|
||||||
|
|
||||||
started = sm['deviceState'].started
|
started = sm['deviceState'].started
|
||||||
|
|
||||||
if started and not started_prev:
|
if started and not started_prev:
|
||||||
|
|||||||
@@ -89,8 +89,8 @@ procs = [
|
|||||||
PythonProcess("radard", "selfdrive.controls.radard", only_onroad),
|
PythonProcess("radard", "selfdrive.controls.radard", only_onroad),
|
||||||
PythonProcess("thermald", "selfdrive.thermald.thermald", always_run),
|
PythonProcess("thermald", "selfdrive.thermald.thermald", always_run),
|
||||||
PythonProcess("tombstoned", "selfdrive.tombstoned", always_run, enabled=not PC),
|
PythonProcess("tombstoned", "selfdrive.tombstoned", always_run, enabled=not PC),
|
||||||
PythonProcess("updated", "selfdrive.updated.updated", always_run, enabled=not PC),
|
# PythonProcess("updated", "selfdrive.updated.updated", always_run, enabled=not PC),
|
||||||
PythonProcess("uploader", "system.loggerd.uploader", allow_uploads),
|
# PythonProcess("uploader", "system.loggerd.uploader", allow_uploads),
|
||||||
PythonProcess("statsd", "selfdrive.statsd", allow_logging),
|
PythonProcess("statsd", "selfdrive.statsd", allow_logging),
|
||||||
|
|
||||||
# debug procs
|
# debug procs
|
||||||
@@ -100,7 +100,7 @@ procs = [
|
|||||||
|
|
||||||
# FrogPilot processes
|
# FrogPilot processes
|
||||||
PythonProcess("fleet_manager", "selfdrive.frogpilot.fleetmanager.fleet_manager", always_run),
|
PythonProcess("fleet_manager", "selfdrive.frogpilot.fleetmanager.fleet_manager", always_run),
|
||||||
PythonProcess("frogpilot_process", "selfdrive.frogpilot.frogpilot_process", always_run),
|
# PythonProcess("frogpilot_process", "selfdrive.frogpilot.frogpilot_process", always_run),
|
||||||
PythonProcess("mapd", "selfdrive.frogpilot.navigation.mapd", always_run),
|
PythonProcess("mapd", "selfdrive.frogpilot.navigation.mapd", always_run),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -907,8 +907,8 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
|
|||||||
if (edgeColor != bg_colors[STATUS_DISENGAGED]) {
|
if (edgeColor != bg_colors[STATUS_DISENGAGED]) {
|
||||||
QLinearGradient edge_gradient;
|
QLinearGradient edge_gradient;
|
||||||
edge_gradient.setColorAt(0.0, QColor(edgeColor.red(), edgeColor.green(), edgeColor.blue(), static_cast<int>(255)));
|
edge_gradient.setColorAt(0.0, QColor(edgeColor.red(), edgeColor.green(), edgeColor.blue(), static_cast<int>(255)));
|
||||||
edge_gradient.setColorAt(0.5, QColor(edgeColor.red(), edgeColor.green(), edgeColor.blue(), static_cast<int>(255 * 0.7) ));
|
edge_gradient.setColorAt(0.5, QColor(edgeColor.red(), edgeColor.green(), edgeColor.blue(), static_cast<int>(255 * 0.8) ));
|
||||||
edge_gradient.setColorAt(1.0, QColor(edgeColor.red(), edgeColor.green(), edgeColor.blue(), static_cast<int>(255 * 0.5)));
|
edge_gradient.setColorAt(1.0, QColor(edgeColor.red(), edgeColor.green(), edgeColor.blue(), static_cast<int>(255 * 0.7)));
|
||||||
|
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.addPolygon(scene.track_vertices);
|
path.addPolygon(scene.track_vertices);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ void ReadyWindow::paintEvent(QPaintEvent *event) {
|
|||||||
|
|
||||||
// Calculate the top-left position to center the image in the window.
|
// Calculate the top-left position to center the image in the window.
|
||||||
int x = (this->width() - comma_img.width()) / 2;
|
int x = (this->width() - comma_img.width()) / 2;
|
||||||
int y = (this->height() - comma_img.height()) / 2;
|
int y = ((this->height() - comma_img.height()) / 20) * 9;
|
||||||
|
|
||||||
// Draw the pixmap at the calculated position.
|
// Draw the pixmap at the calculated position.
|
||||||
painter.drawPixmap(x, y, comma_img);
|
painter.drawPixmap(x, y, comma_img);
|
||||||
|
|||||||
@@ -33,18 +33,18 @@ typedef enum UIStatus {
|
|||||||
} UIStatus;
|
} UIStatus;
|
||||||
|
|
||||||
// Clearpilot new alpha constants
|
// Clearpilot new alpha constants
|
||||||
const float CENTER_LANE_ALPHA = 0.55;
|
const float CENTER_LANE_ALPHA = 0.75;
|
||||||
const float OTHER_LANE_ALPHA = 0.75;
|
const float OTHER_LANE_ALPHA = 0.75;
|
||||||
|
|
||||||
const int CENTER_LANE_WIDTH = 50;
|
const int CENTER_LANE_WIDTH = 75;
|
||||||
const int OTHER_LANE_WIDTH = 16;
|
const int OTHER_LANE_WIDTH = 16;
|
||||||
|
|
||||||
// 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(64, 85, 245, 0xd1), // When you nudge the steering wheel while engaged
|
[STATUS_OVERRIDE] = QColor(94, 112, 255, 0xd1), // When you nudge the steering wheel while engaged
|
||||||
[STATUS_ENGAGED] = QColor(64, 85, 245, 0xd1), // Bright Blue
|
[STATUS_ENGAGED] = QColor(94, 112, 255, 0xd1), // Bright Blue
|
||||||
[STATUS_ALWAYS_ON_LATERAL_ACTIVE] = QColor(162, 221, 235, 0xd1), // Lighter Blue
|
[STATUS_ALWAYS_ON_LATERAL_ACTIVE] = QColor(143, 204, 235, 0xd1), // Lighter Blue
|
||||||
[STATUS_TRAFFIC_MODE_ACTIVE] = QColor(0xc9, 0x22, 0x31, 0xd1), // ? unused?
|
[STATUS_TRAFFIC_MODE_ACTIVE] = QColor(0xc9, 0x22, 0x31, 0xd1), // ? unused?
|
||||||
[STATUS_EXPERIMENTAL_ACTIVE] = QColor(201, 41, 204, 0xd1), // Magenta
|
[STATUS_EXPERIMENTAL_ACTIVE] = QColor(201, 41, 204, 0xd1), // Magenta
|
||||||
[CENTER_LANE_COLOR] = QColor(150, 150, 150, 0xd1), // Gray
|
[CENTER_LANE_COLOR] = QColor(150, 150, 150, 0xd1), // Gray
|
||||||
|
|||||||
Reference in New Issue
Block a user