Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for LogReader package #1775

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion opendbc/car/car.capnp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Cxx = import "./include/c++.capnp";
using Cxx = import "/include/c++.capnp";
$Cxx.namespace("cereal");

@0x8e2af1e708af8b8d;
Expand Down
11 changes: 6 additions & 5 deletions opendbc/car/structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
from opendbc.car.common.basedir import BASEDIR

# TODO: remove car from cereal/__init__.py and always import from opendbc
try:
from cereal import car
except ImportError:
capnp.remove_import_hook()
car = capnp.load(os.path.join(BASEDIR, "car.capnp"))
capnp.remove_import_hook()
# try:
# from openpilot_logging.cereal import car
# # car = capnp.load(os.path.join(BASEDIR, "car.capnp"), imports=[BASEDIR])
# except ImportError:
car = capnp.load(os.path.join(BASEDIR, "car.capnp"), imports=[BASEDIR, os.path.join(BASEDIR, "../../openpilot_logging/cereal")])

CarState = car.CarState
RadarData = car.RadarData
Expand Down