mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-28 01:52:06 +08:00
publish experimental mode state (#26512)
* publish experimental mode state * remove that old-commit-hash: 9c96b21367af3dda9b193a821fe2e175a63f4176
This commit is contained in:
+1
-1
Submodule cereal updated: afafa0a2a5...3bae09cf65
@@ -777,6 +777,7 @@ class Controls:
|
||||
controlsState.startMonoTime = int(start_time * 1e9)
|
||||
controlsState.forceDecel = bool(force_decel)
|
||||
controlsState.canErrorCounter = self.can_rcv_timeout_counter
|
||||
controlsState.experimentalMode = self.params.get_bool("ExperimentalMode") and self.CP.openpilotLongitudinalControl
|
||||
|
||||
lat_tuning = self.CP.lateralTuning.which()
|
||||
if self.joystick_mode:
|
||||
|
||||
@@ -446,6 +446,8 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
|
||||
painter.save();
|
||||
|
||||
const UIScene &scene = s->scene;
|
||||
SubMaster &sm = *(s->sm);
|
||||
|
||||
// lanelines
|
||||
for (int i = 0; i < std::size(scene.lane_line_vertices); ++i) {
|
||||
painter.setBrush(QColor::fromRgbF(1.0, 1.0, 1.0, std::clamp<float>(scene.lane_line_probs[i], 0.0, 0.7)));
|
||||
@@ -461,8 +463,8 @@ void AnnotatedCameraWidget::drawLaneLines(QPainter &painter, const UIState *s) {
|
||||
// paint path
|
||||
QLinearGradient bg(0, height(), 0, height() / 4);
|
||||
float start_hue, end_hue;
|
||||
if (scene.experimental_mode) {
|
||||
const auto &acceleration = (*s->sm)["modelV2"].getModelV2().getAcceleration();
|
||||
if (sm["controlsState"].getControlsState().getExperimentalMode()) {
|
||||
const auto &acceleration = sm["modelV2"].getModelV2().getAcceleration();
|
||||
float acceleration_future = 0;
|
||||
if (acceleration.getZ().size() > 16) {
|
||||
acceleration_future = acceleration.getX()[16]; // 2.5 seconds
|
||||
@@ -555,7 +557,7 @@ void AnnotatedCameraWidget::paintGL() {
|
||||
} else if (v_ego > 15) {
|
||||
wide_cam_requested = false;
|
||||
}
|
||||
wide_cam_requested = wide_cam_requested && s->scene.experimental_mode;
|
||||
wide_cam_requested = wide_cam_requested && sm["controlsState"].getControlsState().getExperimentalMode();
|
||||
// TODO: also detect when ecam vision stream isn't available
|
||||
// for replay of old routes, never go to widecam
|
||||
wide_cam_requested = wide_cam_requested && s->scene.calibration_wide_valid;
|
||||
|
||||
@@ -174,7 +174,6 @@ void ui_update_params(UIState *s) {
|
||||
auto params = Params();
|
||||
s->scene.is_metric = params.getBool("IsMetric");
|
||||
s->scene.map_on_left = params.getBool("NavSettingLeftSide");
|
||||
s->scene.experimental_mode = params.getBool("ExperimentalMode");
|
||||
}
|
||||
|
||||
void UIState::updateStatus() {
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ typedef struct UIScene {
|
||||
QPointF lead_vertices[2];
|
||||
|
||||
float light_sensor;
|
||||
bool started, ignition, is_metric, map_on_left, longitudinal_control, experimental_mode;
|
||||
bool started, ignition, is_metric, map_on_left, longitudinal_control;
|
||||
uint64_t started_frame;
|
||||
} UIScene;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user