diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c92fef35..ff4024930 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.1 hooks: - id: mypy - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.291 + rev: v0.1.3 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: diff --git a/log.capnp b/log.capnp index 4a59ca8d3..12e25b14f 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; @@ -872,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 @@ -938,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 { 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); 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;