Skip to content

Commit

Permalink
Merge branch 'master' into PA-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Edison-CBS committed Nov 3, 2023
2 parents 1abadc8 + 416c3d5 commit 2722aee
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:
Expand Down
16 changes: 16 additions & 0 deletions log.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ struct InitData {

commands @19 :Map(Text, Data);

wallTimeNanos @20 :UInt64;

enum DeviceType {
unknown @0;
neo @1;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
10 changes: 8 additions & 2 deletions messaging/impl_zmq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <iostream>
#include <cstdlib>
#include <cerrno>
#include <unistd.h>

#include "cereal/services.h"
#include "cereal/messaging/impl_zmq.h"
Expand Down Expand Up @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions messaging/impl_zmq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions visionipc/visionipc_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2722aee

Please sign in to comment.