Skip to content

Commit

Permalink
Update cereal/opendbc (#58)
Browse files Browse the repository at this point in the history
* Update submodules

* Fix rlog parser

* Update mac workflow

* Fix last_sec/first_sec

* UpdateValid

* mac ci comment
  • Loading branch information
fredyshox authored Aug 25, 2023
1 parent 6303141 commit 32be07b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/openpilot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion 3rdparty/cereal
2 changes: 1 addition & 1 deletion 3rdparty/opendbc
Submodule opendbc updated 73 files
+28 −0 .github/workflows/repo.yml
+42 −20 .github/workflows/tests.yml
+10 −20 .pre-commit-config.yaml
+8 −10 Dockerfile
+1 −0 SConstruct
+1 −1 acura_ilx_2016_can_generated.dbc
+1 −1 acura_rdx_2018_can_generated.dbc
+3 −3 acura_rdx_2020_can_generated.dbc
+16 −10 bmw_e9x_e8x.dbc
+4 −3 can/common.h
+4 −15 can/common.pxd
+0 −10 can/common_dbc.h
+8 −1 can/dbc.cc
+4 −3 can/packer.cc
+8 −13 can/packer_pyx.pyx
+37 −44 can/parser.cc
+37 −91 can/parser_pyx.pyx
+8 −0 can/tests/__init__.py
+2 −0 can/tests/test.dbc
+2 −8 can/tests/test_checksums.py
+10 −8 can/tests/test_dbc_exceptions.py
+6 −10 can/tests/test_dbc_parser.py
+7 −0 can/tests/test_define.py
+59 −67 can/tests/test_packer_parser.py
+0 −73 can/tests/test_parser.py
+55 −0 can/tests/test_parser_performance.py
+1 −1 generator/chrysler/_stellantis_common_ram.py
+2 −2 generator/generator.py
+2 −2 generator/honda/_bosch_2018.dbc
+1 −1 generator/honda/_bosch_adas_2018.dbc
+1 −1 generator/honda/_nidec_common.dbc
+13 −1 generator/honda/honda_civic_ex_2022_can.dbc
+1 −1 generator/honda/honda_crv_executive_2016_can.dbc
+1 −1 generator/honda/honda_crv_touring_2016_can.dbc
+1 −1 generator/hyundai/hyundai_kia_mando_corner_radar.py
+1 −1 generator/hyundai/hyundai_kia_mando_front_radar.py
+113 −0 generator/nissan/_nissan_common.dbc
+62 −0 generator/nissan/nissan_leaf_2018.dbc
+69 −0 generator/nissan/nissan_x_trail_2017.dbc
+23 −3 generator/subaru/_subaru_global.dbc
+9 −3 generator/subaru/subaru_global_2017.dbc
+30 −10 generator/toyota/_toyota_2017.dbc
+22 −2 generator/toyota/toyota_nodsu_pt.dbc
+3 −3 honda_accord_2018_can_generated.dbc
+15 −3 honda_civic_ex_2022_can_generated.dbc
+3 −3 honda_civic_hatchback_ex_2017_can_generated.dbc
+1 −1 honda_civic_touring_2016_can_generated.dbc
+1 −1 honda_clarity_hybrid_2018_can_generated.dbc
+3 −3 honda_crv_ex_2017_can_generated.dbc
+2 −2 honda_crv_executive_2016_can_generated.dbc
+2 −2 honda_crv_touring_2016_can_generated.dbc
+1 −1 honda_fit_ex_2018_can_generated.dbc
+1 −1 honda_fit_hybrid_2018_can_generated.dbc
+3 −3 honda_insight_ex_2019_can_generated.dbc
+1 −1 honda_odyssey_exl_2018_generated.dbc
+1 −1 honda_odyssey_extreme_edition_2018_china_can_generated.dbc
+53 −3 hyundai_canfd.dbc
+5 −0 hyundai_kia_generic.dbc
+118 −0 hyundai_santafe_2007.dbc
+4 −2 mazda_2017.dbc
+77 −0 mazda_rx8.dbc
+66 −97 nissan_leaf_2018_generated.dbc
+73 −104 nissan_x_trail_2017_generated.dbc
+104 −0 opel_omega_2001.dbc
+20 −0 pyproject.toml
+6 −7 requirements.txt
+32 −6 subaru_global_2017_generated.dbc
+23 −3 subaru_global_2020_hybrid_generated.dbc
+30 −10 toyota_new_mc_pt_generated.dbc
+52 −12 toyota_nodsu_pt_generated.dbc
+30 −10 toyota_tnga_k_pt_generated.dbc
+134 −44 vw_golf_mk4.dbc
+30 −18 vw_mqb_2010.dbc
15 changes: 10 additions & 5 deletions plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <sys/types.h>
#include <unistd.h>

#include <vector>

#include <QDir>
#include <QString>

Expand Down Expand Up @@ -178,19 +180,22 @@ bool RlogMessageParser::parseCanMessage(
uint8_t bus = value.get("src").as<uint8_t>();
if (parsers.find(bus) == parsers.end()) {
parsers[bus] = std::make_shared<CANParser>(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<SignalValue> 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
Expand All @@ -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) {
Expand Down

0 comments on commit 32be07b

Please sign in to comment.