From fe49fbf8ec56733c0cbab45cde31df916f7a9fd3 Mon Sep 17 00:00:00 2001 From: royjr Date: Thu, 30 Mar 2023 15:18:32 -0400 Subject: [PATCH 1/9] Honda Bosch Radarless: update stopAccel to match actuation limits (#27740) * civic22_stop_faster * limit stopAccel to current safety model * Update selfdrive/car/honda/interface.py * Update selfdrive/car/honda/interface.py --------- Co-authored-by: Shane Smiskol --- selfdrive/car/honda/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index 7314afd50a..51ddf1ac92 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -74,7 +74,7 @@ class CarInterface(CarInterfaceBase): ret.longitudinalTuning.kiV = [0.05] ret.longitudinalActuatorDelayUpperBound = 0.5 # s if candidate in HONDA_BOSCH_RADARLESS: - ret.stopAccel = -4.0 + ret.stopAccel = -3.5 # stock uses -4.0 m/s^2 once stopped but limited by safety model else: # default longitudinal tuning for all hondas ret.longitudinalTuning.kpBP = [0., 5., 35.] From 51c3f43205048948d49d1c969c71ebb46c3fc53e Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 30 Mar 2023 12:19:48 -0700 Subject: [PATCH 2/9] Honda Bosch Radarless: use CarControllerParams variable --- selfdrive/car/honda/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index 51ddf1ac92..3a40f03dd9 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -74,7 +74,7 @@ class CarInterface(CarInterfaceBase): ret.longitudinalTuning.kiV = [0.05] ret.longitudinalActuatorDelayUpperBound = 0.5 # s if candidate in HONDA_BOSCH_RADARLESS: - ret.stopAccel = -3.5 # stock uses -4.0 m/s^2 once stopped but limited by safety model + ret.stopAccel = CarControllerParams.BOSCH_ACCEL_MIN # stock uses -4.0 m/s^2 once stopped but limited by safety model else: # default longitudinal tuning for all hondas ret.longitudinalTuning.kpBP = [0., 5., 35.] From f3664b658b0b375cb95d6511d345d5869ae64a24 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Fri, 31 Mar 2023 03:24:41 +0800 Subject: [PATCH 3/9] add libncurses5 to ubuntu_setup.sh (#27751) --- tools/ubuntu_setup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/ubuntu_setup.sh b/tools/ubuntu_setup.sh index 71bad2e8a2..97b706de5b 100755 --- a/tools/ubuntu_setup.sh +++ b/tools/ubuntu_setup.sh @@ -53,6 +53,8 @@ function install_ubuntu_common_requirements() { libgles2-mesa-dev \ libglfw3-dev \ libglib2.0-0 \ + libncurses5-dev \ + libncursesw5-dev \ libomp-dev \ libopencv-dev \ libpng16-16 \ From cf299002f73d121ed2e7afb69f9ff68567ac62cd Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Thu, 30 Mar 2023 21:36:34 +0200 Subject: [PATCH 4/9] cabana: allow zooming to smaller ranges (#27748) * cabana: allow zooming to smaller ranges * remove comment --- tools/cabana/chartswidget.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/cabana/chartswidget.cc b/tools/cabana/chartswidget.cc index 24415c6f95..148e075414 100644 --- a/tools/cabana/chartswidget.cc +++ b/tools/cabana/chartswidget.cc @@ -713,8 +713,7 @@ void ChartView::mouseReleaseEvent(QMouseEvent *event) { if (rubber->width() <= 0) { // no rubber dragged, seek to mouse position can->seekTo(min); - } else if ((max_rounded - min_rounded) >= 0.5) { - // zoom in if selected range is greater than 0.5s + } else if (rubber->width() > 10) { emit zoomIn(min_rounded, max_rounded); } else { update(); From 469accbec105e376b88d75a387bb244f0cfd11eb Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Thu, 30 Mar 2023 21:36:54 +0200 Subject: [PATCH 5/9] cabana: show string value for val/desc (#27747) --- tools/cabana/signalview.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/cabana/signalview.cc b/tools/cabana/signalview.cc index 3f8a38825a..020e2ec285 100644 --- a/tools/cabana/signalview.cc +++ b/tools/cabana/signalview.cc @@ -62,10 +62,21 @@ void SignalModel::updateState(const QHash *msgs) { auto &dat = can->lastMessage(msg_id).dat; int row = 0; for (auto item : root->children) { - item->sig_val = QString::number(get_raw_value((uint8_t *)dat.constData(), dat.size(), *item->sig), 'f', item->sig->precision); + double value = get_raw_value((uint8_t *)dat.constData(), dat.size(), *item->sig); + item->sig_val = QString::number(value, 'f', item->sig->precision); + + // Show unit if (!item->sig->unit.isEmpty()) { item->sig_val += " " + item->sig->unit; } + + // Show enum string + for (auto &[val, desc] : item->sig->val_desc) { + if (std::abs(value - val.toInt()) < 1e-6) { + item->sig_val = desc; + } + } + emit dataChanged(index(row, 1), index(row, 1), {Qt::DisplayRole}); ++row; } From ecd82f04087eb58df7de9b503133aae1d8de15d5 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Thu, 30 Mar 2023 21:37:29 +0200 Subject: [PATCH 6/9] cabana: fix drawing sparkline at half width on hi-dpi screen (#27746) --- tools/cabana/signalview.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cabana/signalview.cc b/tools/cabana/signalview.cc index 020e2ec285..e3c19faa13 100644 --- a/tools/cabana/signalview.cc +++ b/tools/cabana/signalview.cc @@ -400,7 +400,7 @@ void SignalItemDelegate::drawSparkline(QPainter *painter, const QStyleOptionView int h_margin = option.widget->style()->pixelMetric(QStyle::PM_FocusFrameHMargin); int v_margin = std::max(option.widget->style()->pixelMetric(QStyle::PM_FocusFrameVMargin) + 2, 4); - const double xscale = (option.rect.width() - 175.0 * option.widget->devicePixelRatioF() - h_margin * 2) / settings.sparkline_range; + const double xscale = (option.rect.width() - 175.0 - h_margin * 2) / settings.sparkline_range; const double yscale = (option.rect.height() - v_margin * 2) / (max - min); const int left = option.rect.left(); const int top = option.rect.top() + v_margin; From bec8cb1e30c91b150008ef600b42abaf48e1641a Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Thu, 30 Mar 2023 21:37:49 +0200 Subject: [PATCH 7/9] cabana: fix parts of chart widget not being redrawn (#27742) * cabana: fix parts of chart widget not being redrawn * revert others --- tools/cabana/chartswidget.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/cabana/chartswidget.cc b/tools/cabana/chartswidget.cc index 148e075414..09ee9f1cff 100644 --- a/tools/cabana/chartswidget.cc +++ b/tools/cabana/chartswidget.cc @@ -528,7 +528,7 @@ void ChartView::updatePlot(double cur, double min, double max) { updateAxisY(); updateSeriesPoints(); } - update(); + scene()->invalidate({}, QGraphicsScene::ForegroundLayer); } void ChartView::updateSeriesPoints() { @@ -716,7 +716,7 @@ void ChartView::mouseReleaseEvent(QMouseEvent *event) { } else if (rubber->width() > 10) { emit zoomIn(min_rounded, max_rounded); } else { - update(); + scene()->invalidate({}, QGraphicsScene::ForegroundLayer); } event->accept(); } else if (!can->liveStreaming() && event->button() == Qt::RightButton) { @@ -774,7 +774,7 @@ void ChartView::mouseMoveEvent(QMouseEvent *ev) { text_list.push_front(QString::number(chart()->mapToValue({x, 0}).x(), 'f', 3)); QPointF tooltip_pt(x + 12, plot_area.top() - 20); QToolTip::showText(mapToGlobal(tooltip_pt.toPoint()), text_list.join("
"), this, plot_area.toRect()); - update(); + scene()->invalidate({}, QGraphicsScene::ForegroundLayer); } else { QToolTip::hideText(); } @@ -787,7 +787,7 @@ void ChartView::mouseMoveEvent(QMouseEvent *ev) { if (rubber_rect != rubber->geometry()) { rubber->setGeometry(rubber_rect); } - update(); + scene()->invalidate({}, QGraphicsScene::ForegroundLayer); } } From 5ec7da96a60fd7712a9f7c8c5e53e0104204becc Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 30 Mar 2023 12:43:00 -0700 Subject: [PATCH 8/9] ci: always upload process replay ref logs --- .github/workflows/selfdrive_tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/selfdrive_tests.yaml b/.github/workflows/selfdrive_tests.yaml index 5873e7aee6..0f782107ec 100644 --- a/.github/workflows/selfdrive_tests.yaml +++ b/.github/workflows/selfdrive_tests.yaml @@ -261,7 +261,7 @@ jobs: name: process_replay_diff.txt path: selfdrive/test/process_replay/diff.txt - name: Upload reference logs - if: ${{ failure() && steps.print-diff.outcome == 'success' && github.event_name == 'pull_request' && github.repository == 'commaai/openpilot' && env.AZURE_TOKEN != '' }} + if: ${{ failure() && steps.print-diff.outcome == 'success' && github.repository == 'commaai/openpilot' && env.AZURE_TOKEN != '' }} run: | ${{ env.RUN }} "CI=1 AZURE_TOKEN='$AZURE_TOKEN' python selfdrive/test/process_replay/test_processes.py -j$(nproc) --upload-only" - name: "Upload coverage to Codecov" From dd4e07fe7b67ef6db8095a7f654acdc8d6010be6 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Fri, 31 Mar 2023 04:00:06 +0800 Subject: [PATCH 9/9] cabana: fill rows with Qt::BDiagPattern if messag size is incorrect (#27750) --- tools/cabana/binaryview.cc | 10 +++++++--- tools/cabana/binaryview.h | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/cabana/binaryview.cc b/tools/cabana/binaryview.cc index 84225bb96c..d0576615c9 100644 --- a/tools/cabana/binaryview.cc +++ b/tools/cabana/binaryview.cc @@ -273,6 +273,10 @@ void BinaryViewModel::refresh() { row_count = can->lastMessage(msg_id).dat.size(); items.resize(row_count * column_count); } + int valid_rows = std::min(can->lastMessage(msg_id).dat.size(), row_count); + for (int i = 0; i < valid_rows * column_count; ++i) { + items[i].valid = true; + } endResetModel(); updateState(); } @@ -307,9 +311,6 @@ void BinaryViewModel::updateState() { items[i * column_count + 8].val = toHex(binary[i]); items[i * column_count + 8].bg_color = last_msg.colors[i]; } - for (int i = binary.size() * column_count; i < items.size(); ++i) { - items[i].val = "-"; - } for (int i = 0; i < items.size(); ++i) { if (i >= prev_items.size() || prev_items[i].val != items[i].val || prev_items[i].bg_color != items[i].bg_color) { @@ -376,6 +377,9 @@ void BinaryItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op } } + if (!item->valid) { + painter->fillRect(option.rect, QBrush(Qt::darkGray, Qt::BDiagPattern)); + } painter->drawText(option.rect, Qt::AlignCenter, item->val); if (item->is_msb || item->is_lsb) { painter->setFont(small_font); diff --git a/tools/cabana/binaryview.h b/tools/cabana/binaryview.h index 8598fe490b..aa1f8c656b 100644 --- a/tools/cabana/binaryview.h +++ b/tools/cabana/binaryview.h @@ -42,8 +42,9 @@ public: QColor bg_color = QColor(102, 86, 169, 0); bool is_msb = false; bool is_lsb = false; - QString val = "-"; + QString val; QList sigs; + bool valid = false; }; std::vector items;