From acb24ff8c21d343f05a6eacb061d137144a67a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20R=C4=85czy?= Date: Mon, 2 Oct 2023 15:03:39 -0700 Subject: [PATCH 1/8] zmq: assert the same PID (#540) Enforce the same PID in ZMQ pub sockets --- messaging/impl_zmq.cc | 10 ++++++++-- messaging/impl_zmq.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/messaging/impl_zmq.cc b/messaging/impl_zmq.cc index aa95d94fb..7da9df1b8 100644 --- a/messaging/impl_zmq.cc +++ b/messaging/impl_zmq.cc @@ -3,6 +3,7 @@ #include #include #include +#include #include "cereal/services.h" #include "cereal/messaging/impl_zmq.h" @@ -108,14 +109,19 @@ int ZMQPubSocket::connect(Context *context, std::string endpoint, bool check_end full_endpoint += endpoint; } + // ZMQ pub sockets cannot be shared between processes, so we need to ensure pid stays the same + pid = getpid(); + return zmq_bind(sock, full_endpoint.c_str()); } -int ZMQPubSocket::sendMessage(Message *message){ +int ZMQPubSocket::sendMessage(Message *message) { + assert(pid == getpid()); return zmq_send(sock, message->getData(), message->getSize(), ZMQ_DONTWAIT); } -int ZMQPubSocket::send(char *data, size_t size){ +int ZMQPubSocket::send(char *data, size_t size) { + assert(pid == getpid()); return zmq_send(sock, data, size, ZMQ_DONTWAIT); } diff --git a/messaging/impl_zmq.h b/messaging/impl_zmq.h index 34864f633..903875f63 100644 --- a/messaging/impl_zmq.h +++ b/messaging/impl_zmq.h @@ -46,6 +46,7 @@ class ZMQPubSocket : public PubSocket { private: void * sock; std::string full_endpoint; + int pid = -1; public: int connect(Context *context, std::string endpoint, bool check_endpoint=true); int sendMessage(Message *message); From 4a07275487aa0280badd315f6c46b19fecb3fdbc Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 3 Oct 2023 11:34:38 -0700 Subject: [PATCH 2/8] pre-commit: autoupdate hooks (#541) 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 9c92fef35..e91d3ae9f 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.0.291 + rev: v0.0.292 hooks: - id: ruff - repo: local @@ -39,7 +39,7 @@ repos: - --linelength=240 - --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/comma,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+whitespace/tab,+readability/braces - repo: https://github.com/codespell-project/codespell - rev: v2.2.5 + rev: v2.2.6 hooks: - id: codespell args: From 24a522f6ba47aba12a9baea53020a8323673c79c Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sun, 15 Oct 2023 14:55:54 -0700 Subject: [PATCH 3/8] add initData.wallTimeNanos (#544) --- log.capnp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/log.capnp b/log.capnp index 4a59ca8d3..9777a3c32 100644 --- a/log.capnp +++ b/log.capnp @@ -46,6 +46,8 @@ struct InitData { commands @19 :Map(Text, Data); + wallTimeNanos @20 :UInt64; + enum DeviceType { unknown @0; neo @1; From f5b3915d14c0350f76d763c7d0fc0d6cc2c7aa8f Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Tue, 17 Oct 2023 00:01:03 +0800 Subject: [PATCH 4/8] vipc_client: remove `init_msgq` (#545) remove init_msgq --- visionipc/visionipc_client.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/visionipc/visionipc_client.h b/visionipc/visionipc_client.h index 8dff9b2e0..d67734d32 100644 --- a/visionipc/visionipc_client.h +++ b/visionipc/visionipc_client.h @@ -19,8 +19,6 @@ class VisionIpcClient { cl_device_id device_id = nullptr; cl_context ctx = nullptr; - void init_msgq(bool conflate); - public: bool connected = false; VisionStreamType type; From bc382148d0d418ad90e0008195da67aced30e208 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Thu, 19 Oct 2023 11:29:26 -0700 Subject: [PATCH 5/8] pre-commit: autoupdate hooks (#542) Update pre-commit hook versions Co-authored-by: adeebshihadeh --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e91d3ae9f..41735d278 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,17 +1,17 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-ast - id: check-yaml - id: check-executables-have-shebangs - id: check-shebang-scripts-are-executable - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.5.1 + rev: v1.6.0 hooks: - id: mypy - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.292 + rev: v0.1.0 hooks: - id: ruff - repo: local From c83ed644404d97110d58bd970f11af09ffc00a4c Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 24 Oct 2023 14:37:55 -0700 Subject: [PATCH 6/8] pre-commit: autoupdate hooks (#547) 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 41735d278..ef08cd040 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.0 + rev: v1.6.1 hooks: - id: mypy - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.0 + rev: v0.1.1 hooks: - id: ruff - repo: local From 1b43e697e5b02ff3248bad75ccc7076c9b29c50d Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Tue, 31 Oct 2023 11:34:20 -0700 Subject: [PATCH 7/8] pre-commit: autoupdate hooks (#549) 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 ef08cd040..ff4024930 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.1 + rev: v0.1.3 hooks: - id: ruff - repo: local From 416c3d531c90ce16498d782bf383625a857ee74c Mon Sep 17 00:00:00 2001 From: YassineYousfi Date: Thu, 2 Nov 2023 13:36:25 -0700 Subject: [PATCH 8/8] NLP driving - new model outputs (#550) add lat planner solution to modelv2 struct --- log.capnp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/log.capnp b/log.capnp index 9777a3c32..12e25b14f 100644 --- a/log.capnp +++ b/log.capnp @@ -874,6 +874,8 @@ struct ModelDataV2 { navEnabled @22 :Bool; locationMonoTime @24 :UInt64; + # e2e lateral planner + lateralPlannerSolution @25: LateralPlannerSolution; struct LeadDataV2 { prob @0 :Float32; # probability that car is your lead at time t @@ -940,6 +942,18 @@ struct ModelDataV2 { transStd @2 :List(Float32); # std m/s in device frame rotStd @3 :List(Float32); # std rad/s in device frame } + + struct LateralPlannerSolution { + x @0 :List(Float32); + y @1 :List(Float32); + yaw @2 :List(Float32); + yawRate @3 :List(Float32); + xStd @4 :List(Float32); + yStd @5 :List(Float32); + yawStd @6 :List(Float32); + yawRateStd @7 :List(Float32); + } + } struct EncodeIndex {