dragonpilot - 基於 openpilot 的開源駕駛輔助系統
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Dragonpilot Team e55a27c37e dragonpilot 2022-09-01T09:01:29 for EON/C2 3 years ago
..
include dragonpilot 2022-08-11T09:38:43 for EON/C2 3 years ago
logger dragonpilot 2022-08-11T09:38:43 for EON/C2 3 years ago
messaging dragonpilot 2022-08-26T01:39:55 for EON/C2 3 years ago
site_scons/site_tools dragonpilot 2022-08-11T09:38:43 for EON/C2 3 years ago
visionipc dragonpilot 2022-09-01T09:01:29 for EON/C2 3 years ago
.gitignore dragonpilot 2022-08-19T01:11:48 for EON/C2 3 years ago
Dockerfile dragonpilot 2022-08-11T09:38:43 for EON/C2 3 years ago
LICENSE dragonpilot 2022-08-11T09:38:43 for EON/C2 3 years ago
README.md dragonpilot 2022-08-11T09:38:43 for EON/C2 3 years ago
__init__.py dragonpilot 2022-08-11T09:38:43 for EON/C2 3 years ago
car.capnp dragonpilot 2022-08-30T07:26:22 for EON/C2 3 years ago
codecov.yml dragonpilot 2022-08-11T09:38:43 for EON/C2 3 years ago
dp.capnp dragonpilot 2022-09-01T09:01:29 for EON/C2 3 years ago
generate_javascript.sh dragonpilot 2022-08-11T09:38:43 for EON/C2 3 years ago
legacy.capnp dragonpilot 2022-08-11T09:38:43 for EON/C2 3 years ago
libcereal_shared.so dragonpilot 2022-09-01T09:01:29 for EON/C2 3 years ago
log.capnp dragonpilot 2022-08-30T07:26:22 for EON/C2 3 years ago
maptile.capnp dragonpilot 2022-08-11T09:38:43 for EON/C2 3 years ago
services.h dragonpilot 2022-08-26T01:39:55 for EON/C2 3 years ago
services.py dragonpilot 2022-08-26T01:39:55 for EON/C2 3 years ago

README.md

What is cereal? cereal tests codecov

cereal is both a messaging spec for robotics systems as well as generic high performance IPC pub sub messaging with a single publisher and multiple subscribers.

Imagine this use case:

  • A sensor process reads gyro measurements directly from an IMU and publishes a sensorEvents packet
  • A calibration process subscribes to the sensorEvents packet to use the IMU
  • A localization process subscribes to the sensorEvents packet to use the IMU also

Messaging Spec

You'll find the message types in log.capnp. It uses Cap'n proto and defines one struct called Event.

All Events have a logMonoTime and a valid. Then a big union defines the packet type.

Message definition Best Practices

  • All fields must describe quantities in SI units, unless otherwise specified in the field name.

  • In the context of the message they are in, field names should be completely unambiguous.

  • All values should be easy to plot and be human-readable with minimal parsing.

Pub Sub Backends

cereal supports two backends, one based on zmq and another called msgq, a custom pub sub based on shared memory that doesn't require the bytes to pass through the kernel.

Example

import cereal.messaging as messaging

# in subscriber
sm = messaging.SubMaster(['sensorEvents'])
while 1:
  sm.update()
  print(sm['sensorEvents'])

# in publisher
pm = messaging.PubMaster(['sensorEvents'])
dat = messaging.new_message('sensorEvents', size=1)
dat.sensorEvents[0] = {"gyro": {"v": [0.1, -0.1, 0.1]}}
pm.send('sensorEvents', dat)