From 32be07bf2260a5ea72fb89cd05b5f9d61cb0c4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20R=C4=85czy?= Date: Fri, 25 Aug 2023 13:41:32 -0700 Subject: [PATCH] Update cereal/opendbc (#58) * Update submodules * Fix rlog parser * Update mac workflow * Fix last_sec/first_sec * UpdateValid * mac ci comment --- .github/workflows/openpilot.yaml | 5 +++-- 3rdparty/cereal | 2 +- 3rdparty/opendbc | 2 +- plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp | 15 ++++++++++----- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/openpilot.yaml b/.github/workflows/openpilot.yaml index b477ce015..358ee6eb1 100644 --- a/.github/workflows/openpilot.yaml +++ b/.github/workflows/openpilot.yaml @@ -42,12 +42,13 @@ jobs: python-version: '3.8.x' - name: setup dependencies run: | - brew install cmake bzip2 capnp qt@5 zeromq protobuf gnu-tar + brew install cmake bzip2 capnp qt@5 zeromq protobuf@3 gnu-tar sudo pip3 install --no-cache-dir -r 3rdparty/opendbc/requirements.txt - name: build run: | export PYTHONPATH=$PWD/3rdparty - mkdir -p build && cd build && cmake .. && make -j8 + # force usage of protobuf@3 instead of protobuf + mkdir -p build && cd build && cmake -DCMAKE_PREFIX_PATH="$(brew --prefix)/opt/protobuf@3" .. && make -j8 - name: zip plugins run: eval "$ZIP" - name: upload diff --git a/3rdparty/cereal b/3rdparty/cereal index 4f5502c86..2077dd1a1 160000 --- a/3rdparty/cereal +++ b/3rdparty/cereal @@ -1 +1 @@ -Subproject commit 4f5502c8657813ccb538e9575ca1a7b258b17af9 +Subproject commit 2077dd1a1b0054713102aee8197434f8cfa07de7 diff --git a/3rdparty/opendbc b/3rdparty/opendbc index 3c8186027..f58456225 160000 --- a/3rdparty/opendbc +++ b/3rdparty/opendbc @@ -1 +1 @@ -Subproject commit 3c81860270e918d1a08f14a833522fd798aa39ca +Subproject commit f58456225fbdffdbdf8d0110f609aaeee63f47e1 diff --git a/plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp b/plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp index cfe426a47..9431eede9 100644 --- a/plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp +++ b/plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp @@ -4,6 +4,8 @@ #include #include +#include + #include #include @@ -178,19 +180,22 @@ bool RlogMessageParser::parseCanMessage( uint8_t bus = value.get("src").as(); if (parsers.find(bus) == parsers.end()) { parsers[bus] = std::make_shared(bus, dbc_name, true, true); - parsers[bus]->last_sec = 1; + parsers[bus]->first_sec = last_sec; } updated_busses.insert(bus); + parsers[bus]->last_sec = last_sec; parsers[bus]->UpdateCans(last_sec, value); + parsers[bus]->UpdateValid(last_sec); } for (uint8_t bus : updated_busses) { - parsers[bus]->last_sec = last_sec; - for (auto& sg : parsers[bus]->query_latest()) { + std::vector signal_values; + parsers[bus]->query_latest(signal_values); + for (auto& sg : signal_values) { // TODO: plot all updated values PJ::PlotData& _data_series = getSeries(topic_name + '/' + std::to_string(bus) + '/' + packer->lookup_message(sg.address)->name + '/' + sg.name); - _data_series.pushBack({time_stamp, (double)sg.value}); + _data_series.pushBack({time_stamp, (double) sg.value}); } // parser state @@ -201,7 +206,7 @@ bool RlogMessageParser::parseCanMessage( {(double)p->bus_timeout_threshold, "bus_timeout_threshold"}, {(double)p->first_sec, "first_sec"}, {(double)p->last_sec, "last_sec"}, - {(double)p->last_sec, "last_nonempty_sec"}, + {(double)p->last_nonempty_sec, "last_nonempty_sec"}, {(double)p->can_invalid_cnt, "can_invalid_cnt"}, }; for (auto k : parser_state) {