mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-22 14:32:07 +08:00
@@ -104,7 +104,6 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"DoReboot", CLEAR_ON_MANAGER_START},
|
||||
{"DoShutdown", CLEAR_ON_MANAGER_START},
|
||||
{"DoUninstall", CLEAR_ON_MANAGER_START},
|
||||
{"EndToEndToggle", PERSISTENT},
|
||||
{"ForcePowerDown", CLEAR_ON_MANAGER_START},
|
||||
{"GitBranch", PERSISTENT},
|
||||
{"GitCommit", PERSISTENT},
|
||||
|
||||
@@ -16,7 +16,7 @@ def plannerd_thread(sm=None, pm=None):
|
||||
CP = car.CarParams.from_bytes(params.get("CarParams", block=True))
|
||||
cloudlog.info("plannerd got CarParams: %s", CP.carName)
|
||||
|
||||
use_lanelines = not params.get_bool('EndToEndToggle')
|
||||
use_lanelines = False
|
||||
wide_camera = params.get_bool('WideCameraOnly')
|
||||
|
||||
cloudlog.event("e2e mode", on=use_lanelines)
|
||||
|
||||
@@ -1 +1 @@
|
||||
49e231ccf06ef35994a3ec907af959c28e3c0870
|
||||
3636d7168bc67916eb3cb856cce4166c520fdfb0
|
||||
|
||||
@@ -57,12 +57,6 @@ TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) {
|
||||
"Upload data from the driver facing camera and help improve the driver monitoring algorithm.",
|
||||
"../assets/offroad/icon_monitoring.png",
|
||||
},
|
||||
{
|
||||
"EndToEndToggle",
|
||||
"\U0001f96c Disable use of lanelines (Alpha) \U0001f96c",
|
||||
"In this mode openpilot will ignore lanelines and just drive how it thinks a human would.",
|
||||
"../assets/offroad/icon_road.png",
|
||||
},
|
||||
{
|
||||
"DisengageOnAccelerator",
|
||||
"Disengage On Accelerator Pedal",
|
||||
|
||||
+12
-17
@@ -311,24 +311,19 @@ void NvgWindow::drawLaneLines(QPainter &painter, const UIState *s) {
|
||||
|
||||
// paint path
|
||||
QLinearGradient bg(0, height(), 0, height() / 4);
|
||||
if (scene.end_to_end) {
|
||||
const auto &orientation = (*s->sm)["modelV2"].getModelV2().getOrientation();
|
||||
float orientation_future = 0;
|
||||
if (orientation.getZ().size() > 16) {
|
||||
orientation_future = std::abs(orientation.getZ()[16]); // 2.5 seconds
|
||||
}
|
||||
// straight: 112, in turns: 70
|
||||
float curve_hue = fmax(70, 112 - (orientation_future * 420));
|
||||
// FIXME: painter.drawPolygon can be slow if hue is not rounded
|
||||
curve_hue = int(curve_hue * 100 + 0.5) / 100;
|
||||
|
||||
bg.setColorAt(0.0, QColor::fromHslF(148 / 360., 0.94, 0.51, 0.4));
|
||||
bg.setColorAt(0.75 / 1.5, QColor::fromHslF(curve_hue / 360., 1.0, 0.68, 0.35));
|
||||
bg.setColorAt(1.0, QColor::fromHslF(curve_hue / 360., 1.0, 0.68, 0.0));
|
||||
} else {
|
||||
bg.setColorAt(0, whiteColor());
|
||||
bg.setColorAt(1, whiteColor(0));
|
||||
const auto &orientation = (*s->sm)["modelV2"].getModelV2().getOrientation();
|
||||
float orientation_future = 0;
|
||||
if (orientation.getZ().size() > 16) {
|
||||
orientation_future = std::abs(orientation.getZ()[16]); // 2.5 seconds
|
||||
}
|
||||
// straight: 112, in turns: 70
|
||||
float curve_hue = fmax(70, 112 - (orientation_future * 420));
|
||||
// FIXME: painter.drawPolygon can be slow if hue is not rounded
|
||||
curve_hue = int(curve_hue * 100 + 0.5) / 100;
|
||||
|
||||
bg.setColorAt(0.0, QColor::fromHslF(148 / 360., 0.94, 0.51, 0.4));
|
||||
bg.setColorAt(0.75 / 1.5, QColor::fromHslF(curve_hue / 360., 1.0, 0.68, 0.35));
|
||||
bg.setColorAt(1.0, QColor::fromHslF(curve_hue / 360., 1.0, 0.68, 0.0));
|
||||
painter.setBrush(bg);
|
||||
painter.drawPolygon(scene.track_vertices.v, scene.track_vertices.cnt);
|
||||
|
||||
|
||||
+1
-2
@@ -114,7 +114,7 @@ static void update_model(UIState *s, const cereal::ModelDataV2::Reader &model) {
|
||||
max_distance = std::clamp((float)(lead_d - fmin(lead_d * 0.35, 10.)), 0.0f, max_distance);
|
||||
}
|
||||
max_idx = get_path_length_idx(model_position, max_distance);
|
||||
update_line_data(s, model_position, scene.end_to_end ? 0.9 : 0.5, 1.22, &scene.track_vertices, max_idx, false);
|
||||
update_line_data(s, model_position, 0.9, 1.22, &scene.track_vertices, max_idx, false);
|
||||
}
|
||||
|
||||
static void update_sockets(UIState *s) {
|
||||
@@ -221,7 +221,6 @@ void UIState::updateStatus() {
|
||||
if (scene.started) {
|
||||
status = STATUS_DISENGAGED;
|
||||
scene.started_frame = sm->frame;
|
||||
scene.end_to_end = Params().getBool("EndToEndToggle");
|
||||
wide_camera = Params().getBool("WideCameraOnly");
|
||||
}
|
||||
started_prev = scene.started;
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ typedef struct UIScene {
|
||||
QPointF lead_vertices[2];
|
||||
|
||||
float light_sensor, accel_sensor, gyro_sensor;
|
||||
bool started, ignition, is_metric, longitudinal_control, end_to_end;
|
||||
bool started, ignition, is_metric, longitudinal_control;
|
||||
uint64_t started_frame;
|
||||
} UIScene;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user