From c72170ebef8ecf60d976ac23e92d424e97308ecd Mon Sep 17 00:00:00 2001 From: deanlee Date: Fri, 2 Aug 2024 04:14:36 +0800 Subject: [PATCH] update to new opendbc api --- 3rdparty/opendbc | 2 +- plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/3rdparty/opendbc b/3rdparty/opendbc index 93b983d49..a40652d34 160000 --- a/3rdparty/opendbc +++ b/3rdparty/opendbc @@ -1 +1 @@ -Subproject commit 93b983d49a2d6d5c67e15ce7650f55e4f121485d +Subproject commit a40652d341ea3161a6a10001fa74284d9d650f8c diff --git a/plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp b/plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp index cd78ea0b7..75f101662 100644 --- a/plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp +++ b/plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp @@ -175,6 +175,9 @@ bool RlogMessageParser::parseCanMessage( } std::set updated_busses; + std::vector can_data_list; + CanData &can_data = can_data_list.emplace_back(); + can_data.nanos = last_nanos; for(auto elem : listValue) { auto value = elem.as(); uint8_t bus = value.get("src").as(); @@ -185,12 +188,19 @@ bool RlogMessageParser::parseCanMessage( updated_busses.insert(bus); parsers[bus]->last_nanos = last_nanos; - parsers[bus]->UpdateCans(last_nanos, value); - parsers[bus]->UpdateValid(last_nanos); + + auto dat = cmsg.get("dat").as(); + if (dat.size() > 64) continue; // shouldn't ever happen + + auto &frame = can_data.frames.emplace_back(); + frame.src = bus; + frame.address = value.get("address").as(); + frame.dat.assign(dat.begin(), dat.end()); } + for (uint8_t bus : updated_busses) { std::vector signal_values; - parsers[bus]->query_latest(signal_values); + parsers[bus]->update(can_data_list, signal_values); for (auto& sg : signal_values) { // TODO: plot all updated values PJ::PlotData& _data_series = getSeries(topic_name + '/' + std::to_string(bus) + '/' +