Closed sshane closed 1 month ago
https://github.com/commaai/opendbc/pull/1288
The approach of this PR is to move car.capnp
to opendbc/car
while keeping all other capnp files unchanged. In opendbc
, the following code is used to avoid the duplicate ID error:
try:
from cereal import car
except ImportError:
capnp.remove_import_hook()
car = capnp.load(os.path.join(OPENDBC_CAR_PATH, "car.capnp"))
This ensures that car.capnp can be imported properly without conflicts
@deanlee interested in this? We want to replace the dataclasses with car.capnp again, but it can live in opendbc. The duplication of the structs is starting to get annoying and is error-prone if one place is forgotten to be updated.
There are some issues we need to resolve:
OnroadEventDEPRECATED
.