From 3acaeee6ded8e4fca7e3ff3e7464f62b7a553105 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 7 Nov 2023 10:58:38 -0800 Subject: [PATCH 01/29] pre-commit: autoupdate hooks (#551) Update pre-commit hook versions Co-authored-by: adeebshihadeh --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ff4024930..057e80e88 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: hooks: - id: mypy - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.3 + rev: v0.1.4 hooks: - id: ruff - repo: local From 5b8413efb11590bfba90e77dd41186304db8fbe7 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 18 Nov 2023 22:54:03 -0800 Subject: [PATCH 02/29] pre-commit: autoupdate hooks (#553) Update pre-commit hook versions Co-authored-by: adeebshihadeh --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 057e80e88..232f81ad7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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.6.1 + rev: v1.7.0 hooks: - id: mypy - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.4 + rev: v0.1.5 hooks: - id: ruff - repo: local From 2cb2bfb0154874775e56715ecf81f0e6b00538e9 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 21 Nov 2023 15:10:09 -0800 Subject: [PATCH 03/29] pre-commit: autoupdate hooks (#554) Update pre-commit hook versions Co-authored-by: adeebshihadeh --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 232f81ad7..b1d2dfa17 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: hooks: - id: mypy - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.5 + rev: v0.1.6 hooks: - id: ruff - repo: local From 204a1177633394dec12a83153ba13a20f59025cf Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 28 Nov 2023 14:21:42 -0800 Subject: [PATCH 04/29] pre-commit: autoupdate hooks (#555) Update pre-commit hook versions Co-authored-by: adeebshihadeh --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b1d2dfa17..ea3ee3008 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: - id: check-executables-have-shebangs - id: check-shebang-scripts-are-executable - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.7.0 + rev: v1.7.1 hooks: - id: mypy - repo: https://github.com/astral-sh/ruff-pre-commit From 3ba99bbbea6c7c96a3c8af840a543dcd4434e47b Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 1 Dec 2023 21:35:53 -0800 Subject: [PATCH 05/29] carEvents -> onroadEvents (#556) --- log.capnp | 2 +- services.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/log.capnp b/log.capnp index 12e25b14f..419182b44 100644 --- a/log.capnp +++ b/log.capnp @@ -2226,7 +2226,7 @@ struct Event { liveTorqueParameters @94 :LiveTorqueParametersData; cameraOdometry @63 :CameraOdometry; thumbnail @66: Thumbnail; - carEvents @68: List(Car.CarEvent); + events @68: List(Car.CarEvent); carParams @69: Car.CarParams; driverMonitoringState @71: DriverMonitoringState; liveLocationKalman @72 :LiveLocationKalman; diff --git a/services.py b/services.py index 9c08e6352..6436e3181 100755 --- a/services.py +++ b/services.py @@ -60,7 +60,7 @@ def __init__(self, port: int, should_log: bool, frequency: float, decimation: Op "cameraOdometry": (True, 20., 5), "lateralPlan": (True, 20., 5), "thumbnail": (True, 0.2, 1), - "carEvents": (True, 1., 1), + "onroadEvents": (True, 1., 1), "carParams": (True, 0.02, 1), "roadCameraState": (True, 20., 20), "driverCameraState": (True, 20., 20), From 65b34b4d152bcea6d49b821bf1da7189f6086b0f Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 1 Dec 2023 22:35:50 -0800 Subject: [PATCH 06/29] onroadEvents --- log.capnp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log.capnp b/log.capnp index 419182b44..11d7fc72f 100644 --- a/log.capnp +++ b/log.capnp @@ -2226,7 +2226,7 @@ struct Event { liveTorqueParameters @94 :LiveTorqueParametersData; cameraOdometry @63 :CameraOdometry; thumbnail @66: Thumbnail; - events @68: List(Car.CarEvent); + onroadEvents @68: List(Car.CarEvent); carParams @69: Car.CarParams; driverMonitoringState @71: DriverMonitoringState; liveLocationKalman @72 :LiveLocationKalman; From 60d1ee0490a33830168b30a1e92f8d4e43cfbb15 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 1 Dec 2023 22:36:37 -0800 Subject: [PATCH 07/29] SubMaster: ensure msg is always a reader (#557) * SubMaster: ensure msg is always a reader * fix --- messaging/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messaging/__init__.py b/messaging/__init__.py index 57675212f..b09db307d 100644 --- a/messaging/__init__.py +++ b/messaging/__init__.py @@ -187,7 +187,7 @@ def __init__(self, services: List[str], poll: Optional[List[str]] = None, except capnp.lib.capnp.KjException: # pylint: disable=c-extension-no-member data = new_message(s, 0) # lists - self.data[s] = getattr(data, s) + self.data[s] = getattr(data.as_reader(), s) self.logMonoTime[s] = 0 self.valid[s] = data.valid From 3038eacad1e0c5f727f7bd903a91167e460ae8fb Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 2 Dec 2023 10:18:11 -0800 Subject: [PATCH 08/29] new message defaults to invalid (#558) --- messaging/__init__.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/messaging/__init__.py b/messaging/__init__.py index b09db307d..cc149047d 100644 --- a/messaging/__init__.py +++ b/messaging/__init__.py @@ -41,15 +41,13 @@ def log_from_bytes(dat: bytes) -> capnp.lib.capnp._DynamicStructReader: return msg -def new_message(service: Optional[str] = None, size: Optional[int] = None) -> capnp.lib.capnp._DynamicStructBuilder: +def new_message(service: str, size: Optional[int] = None) -> capnp.lib.capnp._DynamicStructBuilder: dat = log.Event.new_message() dat.logMonoTime = int(time.monotonic() * 1e9) - dat.valid = True - if service is not None: - if size is None: - dat.init(service) - else: - dat.init(service, size) + if size is None: + dat.init(service) + else: + dat.init(service, size) return dat From 8cbd294489e07fc1dc8ee9e7abc46861718843cb Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 2 Dec 2023 10:52:02 -0800 Subject: [PATCH 09/29] explicitly set to invalid --- messaging/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/messaging/__init__.py b/messaging/__init__.py index cc149047d..139f9d3c1 100644 --- a/messaging/__init__.py +++ b/messaging/__init__.py @@ -43,6 +43,7 @@ def log_from_bytes(dat: bytes) -> capnp.lib.capnp._DynamicStructReader: def new_message(service: str, size: Optional[int] = None) -> capnp.lib.capnp._DynamicStructBuilder: dat = log.Event.new_message() + dat.valid = False dat.logMonoTime = int(time.monotonic() * 1e9) if size is None: dat.init(service) From c1c0ea2c7a793ed12f3e6b512547616e7b2a390d Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 2 Dec 2023 11:03:07 -0800 Subject: [PATCH 10/29] update the test --- messaging/tests/test_messaging.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messaging/tests/test_messaging.py b/messaging/tests/test_messaging.py index f9c85e0dc..ee1344de7 100755 --- a/messaging/tests/test_messaging.py +++ b/messaging/tests/test_messaging.py @@ -123,7 +123,7 @@ def test_new_message(self, evt): except capnp.lib.capnp.KjException: msg = messaging.new_message(evt, random.randrange(200)) self.assertLess(time.monotonic() - msg.logMonoTime, 0.1) - self.assertTrue(msg.valid) + self.assertFalse(msg.valid) self.assertEqual(evt, msg.which()) @parameterized.expand(events) From 8fae7b4de9acf985ed7572f55f72d97b9decf430 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 2 Dec 2023 22:15:48 -0800 Subject: [PATCH 11/29] SubMaster: add ignore_valid arg --- messaging/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/messaging/__init__.py b/messaging/__init__.py index 139f9d3c1..1348bf0b9 100644 --- a/messaging/__init__.py +++ b/messaging/__init__.py @@ -153,7 +153,7 @@ def recv_one_retry(sock: SubSocket) -> capnp.lib.capnp._DynamicStructReader: class SubMaster: def __init__(self, services: List[str], poll: Optional[List[str]] = None, ignore_alive: Optional[List[str]] = None, ignore_avg_freq: Optional[List[str]] = None, - addr: str = "127.0.0.1"): + ignore_valid: Optional[List[str]] = None, addr: str = "127.0.0.1"): self.frame = -1 self.updated = {s: False for s in services} self.rcv_time = {s: 0. for s in services} @@ -173,6 +173,7 @@ def __init__(self, services: List[str], poll: Optional[List[str]] = None, self.ignore_average_freq = [] if ignore_avg_freq is None else ignore_avg_freq self.ignore_alive = [] if ignore_alive is None else ignore_alive + self.ignore_valid = [] if ignore_valid is None else ignore_valid self.simulation = bool(int(os.getenv("SIMULATION", "0"))) for s in services: @@ -265,7 +266,7 @@ def all_freq_ok(self, service_list=None) -> bool: def all_valid(self, service_list=None) -> bool: if service_list is None: # check all service_list = self.valid.keys() - return all(self.valid[s] for s in service_list) + return all(self.valid[s] for s in service_list if s not in self.ignore_valid) def all_checks(self, service_list=None) -> bool: if service_list is None: # check all From 51fd6728f1091d6a8c9753a85fad761d6c42c5c6 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 2 Dec 2023 22:35:51 -0800 Subject: [PATCH 12/29] not ready for this one yet --- messaging/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/messaging/__init__.py b/messaging/__init__.py index 1348bf0b9..041fa8878 100644 --- a/messaging/__init__.py +++ b/messaging/__init__.py @@ -189,7 +189,8 @@ def __init__(self, services: List[str], poll: Optional[List[str]] = None, self.data[s] = getattr(data.as_reader(), s) self.logMonoTime[s] = 0 - self.valid[s] = data.valid + # TODO: this should default to False + self.valid[s] = True def __getitem__(self, s: str) -> capnp.lib.capnp._DynamicStructReader: return self.data[s] From 033dad2b370dac411479de19381f6e0253e51e01 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 2 Dec 2023 22:45:54 -0800 Subject: [PATCH 13/29] add kwargs for new_message --- messaging/__init__.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/messaging/__init__.py b/messaging/__init__.py index 041fa8878..6a4740366 100644 --- a/messaging/__init__.py +++ b/messaging/__init__.py @@ -41,14 +41,18 @@ def log_from_bytes(dat: bytes) -> capnp.lib.capnp._DynamicStructReader: return msg -def new_message(service: str, size: Optional[int] = None) -> capnp.lib.capnp._DynamicStructBuilder: - dat = log.Event.new_message() - dat.valid = False - dat.logMonoTime = int(time.monotonic() * 1e9) - if size is None: - dat.init(service) - else: - dat.init(service, size) +def new_message(service: Optional[str], size: Optional[int] = None, **kwargs) -> capnp.lib.capnp._DynamicStructBuilder: + args = { + 'valid': False, + 'logMonoTime': int(time.monotonic() * 1e9), + **kwargs + } + dat = log.Event.new_message(**args) + if service is not None: + if size is None: + dat.init(service) + else: + dat.init(service, size) return dat From 4fb8352484c4ef074bee775975c0d1d1e8f57a78 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sun, 3 Dec 2023 14:05:10 -0800 Subject: [PATCH 14/29] add carParams.passive --- car.capnp | 1 + 1 file changed, 1 insertion(+) diff --git a/car.capnp b/car.capnp index 29949a148..e6476fb8e 100644 --- a/car.capnp +++ b/car.capnp @@ -484,6 +484,7 @@ struct CarParams { openpilotLongitudinalControl @37 :Bool; # is openpilot doing the longitudinal control? carVin @38 :Text; # VIN number queried during fingerprinting dashcamOnly @41: Bool; + passive @73: Bool; # is openpilot in control? transmissionType @43 :TransmissionType; carFw @44 :List(CarFw); From a3a6e4969e58875f7cdfc9e6cc6b1af3ee2392b5 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Fri, 8 Dec 2023 16:33:27 -0800 Subject: [PATCH 15/29] add os04c10 --- log.capnp | 1 + 1 file changed, 1 insertion(+) diff --git a/log.capnp b/log.capnp index 11d7fc72f..b88edae95 100644 --- a/log.capnp +++ b/log.capnp @@ -166,6 +166,7 @@ struct FrameData { unknown @0; ar0231 @1; ox03c10 @2; + os04c10 @3; } frameLengthDEPRECATED @3 :Int32; From d11688a90a1cebacb3fe00dcfbba5f27551b2d89 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 9 Dec 2023 12:52:05 -0800 Subject: [PATCH 16/29] pre-commit: autoupdate hooks (#559) Update pre-commit hook versions Co-authored-by: adeebshihadeh --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ea3ee3008..68691b298 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: hooks: - id: mypy - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.6 + rev: v0.1.7 hooks: - id: ruff - repo: local From 8ae5c51a6515c171f3a82c9511a18d79a9e55c07 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 14 Dec 2023 16:37:40 -0800 Subject: [PATCH 17/29] deprecate gas interceptor detected (#563) --- log.capnp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log.capnp b/log.capnp index b88edae95..d5f147706 100644 --- a/log.capnp +++ b/log.capnp @@ -409,7 +409,6 @@ struct DeviceState @0xa4d8b5af2aa492eb { struct PandaState @0xa7649e2575e4591e { ignitionLine @2 :Bool; - gasInterceptorDetected @4 :Bool; rxBufferOverflow @7 :UInt32; txBufferOverflow @8 :UInt32; gmlanSendErrs @9 :UInt32; @@ -542,6 +541,7 @@ struct PandaState @0xa7649e2575e4591e { } } + gasInterceptorDetectedDEPRECATED @4 :Bool; startedSignalDetectedDEPRECATED @5 :Bool; hasGpsDEPRECATED @6 :Bool; fanSpeedRpmDEPRECATED @11 :UInt16; From 9bce87fac76e25514667e22ea419b698cef47531 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 19 Dec 2023 14:27:12 +0800 Subject: [PATCH 18/29] visionipc: new helper function `get_ipc_path` (#564) new helper function ipc_get_path --- visionipc/visionipc_client.cc | 13 ++++--------- visionipc/visionipc_client.h | 3 --- visionipc/visionipc_server.cc | 20 +++++++++++--------- visionipc/visionipc_server.h | 2 +- 4 files changed, 16 insertions(+), 22 deletions(-) diff --git a/visionipc/visionipc_client.cc b/visionipc/visionipc_client.cc index 169afbb36..e3c6d0d1c 100644 --- a/visionipc/visionipc_client.cc +++ b/visionipc/visionipc_client.cc @@ -3,24 +3,19 @@ #include #include +#include #include "cereal/visionipc/ipc.h" #include "cereal/visionipc/visionipc_client.h" #include "cereal/visionipc/visionipc_server.h" #include "cereal/logger/logger.h" static int connect_to_vipc_server(const std::string &name, bool blocking) { - char* prefix = std::getenv("OPENPILOT_PREFIX"); - std::string path = "/tmp/"; - if (prefix) { - path = path + std::string(prefix) + "_"; - } - path = path + "visionipc_" + name; - - int socket_fd = ipc_connect(path.c_str()); + const std::string ipc_path = get_ipc_path(name); + int socket_fd = ipc_connect(ipc_path.c_str()); while (socket_fd < 0 && blocking) { std::cout << "VisionIpcClient connecting" << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(100)); - socket_fd = ipc_connect(path.c_str()); + socket_fd = ipc_connect(ipc_path.c_str()); } return socket_fd; } diff --git a/visionipc/visionipc_client.h b/visionipc/visionipc_client.h index d67734d32..970bac3a7 100644 --- a/visionipc/visionipc_client.h +++ b/visionipc/visionipc_client.h @@ -2,11 +2,8 @@ #include #include -#include -#include #include "cereal/messaging/messaging.h" -#include "cereal/visionipc/visionipc.h" #include "cereal/visionipc/visionbuf.h" class VisionIpcClient { diff --git a/visionipc/visionipc_server.cc b/visionipc/visionipc_server.cc index c51e13ea1..da9d11f91 100644 --- a/visionipc/visionipc_server.cc +++ b/visionipc/visionipc_server.cc @@ -22,6 +22,14 @@ std::string get_endpoint_name(std::string name, VisionStreamType type){ } } +std::string get_ipc_path(const std::string& name) { + std::string path = "/tmp/"; + if (char* prefix = std::getenv("OPENPILOT_PREFIX")) { + path += std::string(prefix) + "_"; + } + return path + "visionipc_" + name; +} + VisionIpcServer::VisionIpcServer(std::string name, cl_device_id device_id, cl_context ctx) : name(name), device_id(device_id), ctx(ctx) { msg_ctx = Context::create(); @@ -83,14 +91,8 @@ void VisionIpcServer::start_listener(){ void VisionIpcServer::listener(){ std::cout << "Starting listener for: " << name << std::endl; - char* prefix = std::getenv("OPENPILOT_PREFIX"); - std::string path = "/tmp/"; - if (prefix) { - path = path + std::string(prefix) + "_"; - } - path = path + "visionipc_" + name; - - int sock = ipc_bind(path.c_str()); + const std::string ipc_path = get_ipc_path(name); + int sock = ipc_bind(ipc_path.c_str()); assert(sock >= 0); while (!should_exit){ @@ -160,7 +162,7 @@ void VisionIpcServer::listener(){ std::cout << "Stopping listener for: " << name << std::endl; close(sock); - unlink(path.c_str()); + unlink(ipc_path.c_str()); } diff --git a/visionipc/visionipc_server.h b/visionipc/visionipc_server.h index 6ad86f146..c494b1fcf 100644 --- a/visionipc/visionipc_server.h +++ b/visionipc/visionipc_server.h @@ -6,10 +6,10 @@ #include #include "cereal/messaging/messaging.h" -#include "cereal/visionipc/visionipc.h" #include "cereal/visionipc/visionbuf.h" std::string get_endpoint_name(std::string name, VisionStreamType type); +std::string get_ipc_path(const std::string &name); class VisionIpcServer { private: From bceb8b942d3e622c2476e197102950efc4fe0bfd Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 21 Dec 2023 21:46:37 -0800 Subject: [PATCH 19/29] pre-commit: autoupdate hooks (#565) Update pre-commit hook versions Co-authored-by: adeebshihadeh --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 68691b298..8a1774120 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: hooks: - id: mypy - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.7 + rev: v0.1.8 hooks: - id: ruff - repo: local From e29625c30bb2a4a34ce21134d0e5a91b2d4fa1b1 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 26 Dec 2023 20:30:26 -0800 Subject: [PATCH 20/29] pre-commit: autoupdate hooks (#566) Update pre-commit hook versions Co-authored-by: adeebshihadeh --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8a1774120..2ff884418 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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.8.0 hooks: - id: mypy - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.8 + rev: v0.1.9 hooks: - id: ruff - repo: local From ea3bb8d0105360800fd61df303ef23819539c668 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sun, 7 Jan 2024 21:57:16 -0800 Subject: [PATCH 21/29] add camera request id (#567) --- log.capnp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/log.capnp b/log.capnp index d5f147706..55beda223 100644 --- a/log.capnp +++ b/log.capnp @@ -130,8 +130,8 @@ struct InitData { struct FrameData { frameId @0 :UInt32; - encodeId @1 :UInt32; # DEPRECATED frameIdSensor @25 :UInt32; + requestId @28 :UInt32; frameType @7 :FrameType; @@ -169,6 +169,7 @@ struct FrameData { os04c10 @3; } + encodeIdDEPRECATED @1 :UInt32; frameLengthDEPRECATED @3 :Int32; globalGainDEPRECATED @5 :Int32; androidCaptureResultDEPRECATED @9 :AndroidCaptureResult; From d81d86e7cd83d1eb40314964a4d194231381d557 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sun, 7 Jan 2024 22:12:48 -0800 Subject: [PATCH 22/29] comment was a lie --- log.capnp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log.capnp b/log.capnp index 55beda223..e601e8203 100644 --- a/log.capnp +++ b/log.capnp @@ -132,6 +132,7 @@ struct FrameData { frameId @0 :UInt32; frameIdSensor @25 :UInt32; requestId @28 :UInt32; + encodeId @1 :UInt32; frameType @7 :FrameType; @@ -169,7 +170,6 @@ struct FrameData { os04c10 @3; } - encodeIdDEPRECATED @1 :UInt32; frameLengthDEPRECATED @3 :Int32; globalGainDEPRECATED @5 :Int32; androidCaptureResultDEPRECATED @9 :AndroidCaptureResult; From 20b65eeb1f6c580cdd7d63e53639f4fc48bc2f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Sch=C3=A4fer?= Date: Wed, 17 Jan 2024 15:25:24 -0800 Subject: [PATCH 23/29] Deprecate curv rate (#571) --- log.capnp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log.capnp b/log.capnp index e601e8203..1f27e0698 100644 --- a/log.capnp +++ b/log.capnp @@ -668,7 +668,6 @@ struct ControlsState @0x97ff69c53601abf1 { aTarget @35 :Float32; curvature @37 :Float32; # path curvature from vehicle model desiredCurvature @61 :Float32; # lag adjusted curvatures used by lateral controllers - desiredCurvatureRate @62 :Float32; forceDecel @51 :Bool; # UI alerts @@ -826,6 +825,7 @@ struct ControlsState @0x97ff69c53601abf1 { steerOverrideDEPRECATED @20 :Bool; steeringAngleDesiredDegDEPRECATED @29 :Float32; canMonoTimesDEPRECATED @21 :List(UInt64); + desiredCurvatureRateDEPRECATED @62 :Float32; } # All SI units and in device frame From fd1843960f4ba55bb2857593857d05ca463ac377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Sch=C3=A4fer?= Date: Sun, 21 Jan 2024 12:10:24 -0800 Subject: [PATCH 24/29] Delete lateralPlan (#573) * Add action * Add lane change state * planner error dead * Deperacte mote * Fix bugs * Fails the replay test * Typo --- car.capnp | 2 +- log.capnp | 34 ++++++++++++++++++++++++++++++++-- services.py | 1 - 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/car.capnp b/car.capnp index e6476fb8e..af91986d4 100644 --- a/car.capnp +++ b/car.capnp @@ -51,7 +51,6 @@ struct CarEvent @0x9b1657f34caf3ad3 { parkBrake @29; manualRestart @30; lowSpeedLockout @31; - plannerError @32; joystickDebug @34; steerTempUnavailableSilent @35; resumeRequired @36; @@ -142,6 +141,7 @@ struct CarEvent @0x9b1657f34caf3ad3 { startupFuzzyFingerprintDEPRECATED @97; noTargetDEPRECATED @25; brakeUnavailableDEPRECATED @2; + plannerErrorDEPRECATED @32; } } diff --git a/log.capnp b/log.capnp index 1f27e0698..1be5c878b 100644 --- a/log.capnp +++ b/log.capnp @@ -299,6 +299,29 @@ struct GpsLocationData { } } +enum Desire { + none @0; + turnLeft @1; + turnRight @2; + laneChangeLeft @3; + laneChangeRight @4; + keepLeft @5; + keepRight @6; +} + +enum LaneChangeState { + off @0; + preLaneChange @1; + laneChangeStarting @2; + laneChangeFinishing @3; +} + +enum LaneChangeDirection { + none @0; + left @1; + right @2; +} + struct CanData { address @0 :UInt32; busTime @1 :UInt16; @@ -877,7 +900,8 @@ struct ModelDataV2 { locationMonoTime @24 :UInt64; # e2e lateral planner - lateralPlannerSolution @25: LateralPlannerSolution; + lateralPlannerSolutionDEPRECATED @25: LateralPlannerSolution; + action @26: Action; struct LeadDataV2 { prob @0 :Float32; # probability that car is your lead at time t @@ -915,6 +939,9 @@ struct ModelDataV2 { desireState @5 :List(Float32); disengagePredictions @6 :DisengagePredictions; hardBrakePredicted @7 :Bool; + laneChangeState @8 :LaneChangeState; + laneChangeDirection @9 :LaneChangeDirection; + # deprecated brakeDisengageProbDEPRECATED @2 :Float32; @@ -956,6 +983,9 @@ struct ModelDataV2 { yawRateStd @7 :List(Float32); } + struct Action { + desiredCurvature @0 :Float32; + } } struct EncodeIndex { @@ -2216,7 +2246,6 @@ struct Event { carState @22 :Car.CarState; carControl @23 :Car.CarControl; longitudinalPlan @24 :LongitudinalPlan; - lateralPlan @64 :LateralPlan; uiPlan @106 :UiPlan; ubloxGnss @34 :UbloxGnss; ubloxRaw @39 :Data; @@ -2337,5 +2366,6 @@ struct Event { pandaStateDEPRECATED @12 :PandaState; driverStateDEPRECATED @59 :DriverStateDEPRECATED; sensorEventsDEPRECATED @11 :List(SensorEventData); + lateralPlan @64 :LateralPlan; } } diff --git a/services.py b/services.py index 6436e3181..8ab8f5eeb 100755 --- a/services.py +++ b/services.py @@ -58,7 +58,6 @@ def __init__(self, port: int, should_log: bool, frequency: float, decimation: Op "liveLocationKalman": (True, 20., 5), "liveParameters": (True, 20., 5), "cameraOdometry": (True, 20., 5), - "lateralPlan": (True, 20., 5), "thumbnail": (True, 0.2, 1), "onroadEvents": (True, 1., 1), "carParams": (True, 0.02, 1), From 775e7f84da5eb283d604e94f9bf4582ffa741c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Sch=C3=A4fer?= Date: Sun, 21 Jan 2024 12:29:45 -0800 Subject: [PATCH 25/29] Deprecate lat planner (#574) --- log.capnp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log.capnp b/log.capnp index 1be5c878b..ea5da7496 100644 --- a/log.capnp +++ b/log.capnp @@ -2366,6 +2366,6 @@ struct Event { pandaStateDEPRECATED @12 :PandaState; driverStateDEPRECATED @59 :DriverStateDEPRECATED; sensorEventsDEPRECATED @11 :List(SensorEventData); - lateralPlan @64 :LateralPlan; + lateralPlanDEPRECATED @64 :LateralPlan; } } From 8ae59093eabdcd662621bd1c862a0dd19f0b9adb Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 23 Jan 2024 19:01:44 -0800 Subject: [PATCH 26/29] add quatro --- log.capnp | 1 + 1 file changed, 1 insertion(+) diff --git a/log.capnp b/log.capnp index ea5da7496..9a2014193 100644 --- a/log.capnp +++ b/log.capnp @@ -518,6 +518,7 @@ struct PandaState @0xa7649e2575e4591e { redPanda @7; redPandaV2 @8; tres @9; + quatro @9; } enum HarnessStatus { From 16edae3d50d6d7003acf6079a844085eebd21bd5 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 23 Jan 2024 19:09:00 -0800 Subject: [PATCH 27/29] bump ordinal --- log.capnp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log.capnp b/log.capnp index 9a2014193..84605477a 100644 --- a/log.capnp +++ b/log.capnp @@ -518,7 +518,7 @@ struct PandaState @0xa7649e2575e4591e { redPanda @7; redPandaV2 @8; tres @9; - quatro @9; + quatro @10; } enum HarnessStatus { From a6ade85c9dd6652fde547b9e089a297f67606dcf Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Wed, 24 Jan 2024 13:06:40 -0800 Subject: [PATCH 28/29] spelling --- log.capnp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log.capnp b/log.capnp index 84605477a..9a1835e42 100644 --- a/log.capnp +++ b/log.capnp @@ -518,7 +518,7 @@ struct PandaState @0xa7649e2575e4591e { redPanda @7; redPandaV2 @8; tres @9; - quatro @10; + cuatro @10; } enum HarnessStatus { From c54369f8ad4e0bcb18c96feb4334755c6f65e8f1 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 1 Feb 2024 21:24:05 -0800 Subject: [PATCH 29/29] add frame width + height to encodeData (#578) * add frame width + height to encodeData * fix * lol --- log.capnp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/log.capnp b/log.capnp index 9a1835e42..276cb85e5 100644 --- a/log.capnp +++ b/log.capnp @@ -2200,6 +2200,8 @@ struct EncodeData { data @1 :Data; header @2 :Data; unixTimestampNanos @3 :UInt64; + width @4 :UInt32; + height @5 :UInt32; } struct UserFlag {