Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam committed Mar 22, 2024
2 parents 02c0254 + 6bfd39a commit 9e20c0e
Show file tree
Hide file tree
Showing 12 changed files with 208 additions and 121 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ env:
RUN: docker run -e PYTHONWARNINGS=error --shm-size 1G --name cereal cereal /bin/sh -c
RUN_NAMED: docker run -e PYTHONWARNINGS=error --shm-size 1G --rm cereal /bin/sh -c
CI_RUN: docker run -e GITHUB_ACTION -e GITHUB_REF -e GITHUB_HEAD_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID --rm cerealci /bin/bash -c
BUILD: |
docker pull $(grep -ioP '(?<=^from)\s+\S+' Dockerfile) || true
docker pull $DOCKER_REGISTRY/cereal:latest || true
docker build --cache-from $DOCKER_REGISTRY/cereal:latest -t cereal -f Dockerfile .
BUILD: docker buildx build --pull --load --cache-to type=inline --cache-from $DOCKER_REGISTRY/cereal:latest -t cereal -f Dockerfile .
PYTHONWARNINGS: error

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ repos:
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
rev: v1.9.0
hooks:
- id: mypy
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.7
rev: v0.3.3
hooks:
- id: ruff
- repo: local
Expand Down
18 changes: 10 additions & 8 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if GetOption('extras'):
# TODO: remove non shared cereal and messaging
cereal_objects = env.SharedObject([f'gen/cpp/{s}.c++' for s in schema_files])

env.Library('cereal', cereal_objects)
cereal = env.Library('cereal', cereal_objects)
env.SharedLibrary('cereal_shared', cereal_objects)

# Build messaging
Expand All @@ -39,14 +39,13 @@ messaging_objects = env.SharedObject([
'messaging/socketmaster.cc',
])

messaging_lib = env.Library('messaging', messaging_objects)
messaging = env.Library('messaging', messaging_objects)
Depends('messaging/impl_zmq.cc', services_h)

env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=[messaging_lib, 'zmq', common])
env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=[messaging, 'zmq', common])
Depends('messaging/bridge.cc', services_h)

envCython.Program('messaging/messaging_pyx.so', 'messaging/messaging_pyx.pyx', LIBS=envCython["LIBS"]+[messaging_lib, "zmq", common])

messaging_python = envCython.Program('messaging/messaging_pyx.so', 'messaging/messaging_pyx.pyx', LIBS=envCython["LIBS"]+[messaging, "zmq", common])

# Build Vision IPC
vipc_sources = [
Expand All @@ -62,11 +61,11 @@ else:
vipc_sources += ['visionipc/visionbuf_cl.cc']

vipc_objects = env.SharedObject(vipc_sources)
vipc = env.Library('visionipc', vipc_objects)
visionipc = env.Library('visionipc', vipc_objects)


vipc_frameworks = []
vipc_libs = envCython["LIBS"] + [vipc, messaging_lib, common, "zmq"]
vipc_libs = envCython["LIBS"] + [visionipc, messaging, common, "zmq"]
if arch == "Darwin":
vipc_frameworks.append('OpenCL')
else:
Expand All @@ -75,7 +74,10 @@ envCython.Program('visionipc/visionipc_pyx.so', 'visionipc/visionipc_pyx.pyx',
LIBS=vipc_libs, FRAMEWORKS=vipc_frameworks)

if GetOption('extras'):
env.Program('messaging/test_runner', ['messaging/test_runner.cc', 'messaging/msgq_tests.cc'], LIBS=[messaging_lib, common])
env.Program('messaging/test_runner', ['messaging/test_runner.cc', 'messaging/msgq_tests.cc'], LIBS=[messaging, common])

env.Program('visionipc/test_runner', ['visionipc/test_runner.cc', 'visionipc/visionipc_tests.cc'],
LIBS=['pthread'] + vipc_libs, FRAMEWORKS=vipc_frameworks)


Export('cereal', 'messaging', 'messaging_python', 'visionipc')
1 change: 0 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# pylint: skip-file
import os
import capnp
from typing import TYPE_CHECKING
Expand Down
23 changes: 16 additions & 7 deletions car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ struct CarEvent @0x9b1657f34caf3ad3 {
parkBrake @29;
manualRestart @30;
lowSpeedLockout @31;
plannerError @32;
joystickDebug @34;
steerTempUnavailableSilent @35;
resumeRequired @36;
Expand Down Expand Up @@ -142,6 +141,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
startupFuzzyFingerprintDEPRECATED @97;
noTargetDEPRECATED @25;
brakeUnavailableDEPRECATED @2;
plannerErrorDEPRECATED @32;
}
}

Expand Down Expand Up @@ -323,14 +323,12 @@ struct CarControl {
# Actuator commands as computed by controlsd
actuators @6 :Actuators;

# moved to CarOutput
actuatorsOutputDEPRECATED @10 :Actuators;

leftBlinker @15: Bool;
rightBlinker @16: Bool;

# Any car specific rate limits or quirks applied by
# the CarController are reflected in actuatorsOutput
# and matches what is sent to the car
actuatorsOutput @10 :Actuators;

orientationNED @13 :List(Float32);
angularVelocity @14 :List(Float32);

Expand Down Expand Up @@ -380,6 +378,7 @@ struct CarControl {
leftLaneVisible @7: Bool;
rightLaneDepart @8: Bool;
leftLaneDepart @9: Bool;
leadDistanceBars @10: Int8; # 1-3: 1 is closest, 3 is farthest. some ports may utilize 2-4 bars instead

enum VisualAlert {
# these are the choices from the Honda
Expand Down Expand Up @@ -418,6 +417,13 @@ struct CarControl {
pitchDEPRECATED @9 :Float32;
}

struct CarOutput {
# Any car specific rate limits or quirks applied by
# the CarController are reflected in actuatorsOutput
# and matches what is sent to the car
actuatorsOutput @0 :CarControl.Actuators;
}

# ****** car param ******

struct CarParams {
Expand Down Expand Up @@ -596,12 +602,15 @@ struct CarParams {
body @27;
hyundaiCanfd @28;
volkswagenMqbEvo @29;
chryslerCusw @30;
psa @31;
}

enum SteerControlType {
torque @0;
angle @1;
curvature @2;

curvatureDEPRECATED @2;
}

enum TransmissionType {
Expand Down
Loading

0 comments on commit 9e20c0e

Please sign in to comment.