Commit Graph

80 Commits

Author SHA1 Message Date
Adeeb Shihadeh
2d48c23ca5 fix blocking msgq poll (#64)
* remove unnecessary condition on msqg poll

* fix blocking msgq poll
2020-09-12 22:59:12 -07:00
Dean Lee
ba61dbdf46 Custom message builder (#72)
* add an simple class MessageBuilder

* remove member function toArray()

* fix extra spaces

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-09-12 20:25:57 -07:00
grekiki
177bc413f7 fix the isssue 41 (#87)
* fix the isssue

* Improve code style

* Improve code style2, remove failing test

* less changes

* style3
2020-09-11 14:45:47 +02:00
Willem Melching
1646e84af8 fix mac build 2020-09-09 17:39:55 +02:00
Adeeb Shihadeh
626679d1a5 allow prioritization of services in SubMaster (#84)
* allow blocking on a service in SubMaster update

* more descriptive name

* more generic

* fix

* fix mypy

* priority poller

* only use one poller
2020-09-01 16:17:24 -07:00
Willem Melching
78b8887198 larger shared memory size on computer for frames 2020-08-28 13:16:12 +02:00
Adeeb Shihadeh
b9a54adaf4 Add type hints to messaging (#82)
* start adding types to messaging lib

* more return types

* that could be none
2020-08-23 00:14:25 -07:00
Adeeb Shihadeh
9cd1934a9c parallelize cython extension build 2020-08-02 13:26:44 -07:00
Adeeb Shihadeh
10a25c8b98 expose frame and rcv_frame in C++ submaster (#76)
* expose rcv_frame in C++ submaster

* expose frame too
2020-08-01 16:59:46 -07:00
Adeeb Shihadeh
566152fc29 fix linter 2020-07-29 14:09:00 -07:00
Adeeb Shihadeh
87c10d3346 fix test file path 2020-07-29 13:57:24 -07:00
Adeeb Shihadeh
17c3ad78f2 test generated services.h 2020-07-29 13:45:03 -07:00
Adeeb Shihadeh
3020c2b925 simple service tests 2020-07-29 13:38:36 -07:00
Adeeb Shihadeh
430cc73a3b remove get_one_can 2020-07-28 23:15:03 -07:00
Adeeb Shihadeh
06c7f72a2c Tests for lower level messaging functions (#73)
* start messaging tests

* test drain sock

* recv with retry

* test retry blocking

* fix zmq
2020-07-27 17:30:45 -07:00
Adeeb Shihadeh
29099e87a1 Update catch2 and move to Dockerfile (#71)
* update catch2 and download in dockerfile instead of checking in

* fix dockerfile

* fix path
2020-07-27 02:14:06 -07:00
Adeeb Shihadeh
45cd21a468 Messaging unit tests (#66)
* pub sub unit test

* pub master test

* first submaster test case

* test init

* submaster conflate test

* more submaster

* all submaster except alive and valid

* fix ZMQ

* fix ZMQ for test_messaging

* single underscore

* fix key error

* more zmq sleep

* zmq needs even more sleep

* unused

* zmq sleep in submaster tests
2020-07-26 19:58:12 -07:00
George Hotz
9915b2086a fix mac build (#50)
* fix mac build

* remove duplicate line

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-06-11 17:49:19 -07:00
Adeeb Shihadeh
1aaf1bfd7c fix dereferencing of full_path after free 2020-06-08 12:21:07 -07:00
Adeeb Shihadeh
3ad1ac096b enable almost all flake8 checks 2020-06-01 01:55:43 -07:00
Adeeb Shihadeh
58878bfd26 whitespace fix 2020-05-31 17:49:11 -07:00
Adeeb Shihadeh
b25a7d6f6e fix flake8 complaint about too many blank lines 2020-05-31 17:18:57 -07:00
Adeeb Shihadeh
76eb23e062 two spaces before inline comment 2020-05-31 14:04:13 -07:00
Willem Melching
8e2d212a3d add pre-commit static analysis (#48) 2020-05-28 16:04:53 -07:00
Willem Melching
4bb1eb826d submaster always conflates 2020-05-21 15:06:50 -07:00
Dean Lee
30838d40a4 C++ implementation of SubMaster and PubMaster (#42)
* add class SubMaster&PubMaster

* add socketmaster.cc

* move to cereal_objects

* modify SubMaster

* modify SubMaster

* Code streamlining

* m createSocket

remove dup SubMessage

* Streamline code

Streamline code

Streamline code

alive if delay with LogMonoTime x

reduce code lines

add underscore to class variable,dont check getValid() in poll

add static function get_service(), assert if pub name is not in service list

remove paramater alive from recieve()

rename services to endpoints

is alive is freq_ <= (1e-5)

referer

use sockets_.find() in pushMaster::send to avoid create an empty entry

submaster only do poller, rm PubMaster,add PubMessage

add MessageContext

make SubMaster api same as python version

add class PubMessage

add empty line

fix type

fix typo

remove service_list_

Streamline code

 use cached heaparry to build&send msg

reduce lines

rename sockets_ to messages_

initialize member variable in class

don't use std::find

fix typo

* use global context,remove class PubMessage

remove SubMessage interface from header,add operator[]

undo format source

add new line at end of file

add missing header fiel

reve std::find

add empty line

better drain
2020-05-21 13:57:25 -07:00
Paweł Goliński
c1a6d75d1d Fix potential segfault in MSGQPubSocket::connect (#45) 2020-05-20 16:12:44 -07:00
Paweł Goliński
67fae6afcd Use ZMQ on MacOS (#46) 2020-05-20 16:11:48 -07:00
Willem Melching
9073b9b1b4 Library cleanup (#43)
* library cleanup

* no static libraries

* apks need static zmq

* Typo

* No hacky script
2020-05-12 18:50:24 -07:00
Tici
5908762051 gnustl_shared is only for android 2020-03-26 23:59:55 +00:00
Willem Melching
2e5cbfc831 Create and init message in one line with new_message in messaging (#35)
* change new_message in messaging to include service and optional list size parameter

* fix for line 35 in logmessaged.py, which doesn't init message

* more readable
2020-03-05 16:51:33 -08:00
George Hotz
01942b890d add TODO 2020-01-15 08:48:35 -08:00
George Hotz
b74a456a9b don't hardcode the lists 2020-01-15 08:40:13 -08:00
Willem Melching
c6b5c73b0b Switch default to msgq (#21)
* switch default to msgq

* SIGUSR1 is already used by the apks

* Don't return message upstream when exiting

* Remove debug print

* Remove more debug print
2020-01-13 09:47:03 -08:00
George Hotz
21cf3f557e build on mac 2019-12-14 19:34:01 -08:00
Willem Melching
2219f2bda8 Add warning about not using cython version of sec_since_boot 2019-12-05 15:10:55 -08:00
Riccardo
ad23834045 remove TODO 2019-12-05 12:06:36 -08:00
Willem Melching
3b753be905 Implement error handling and exceptions (#18)
* implement error handling and exceptions

* Add test for MultiplePublisherError

* add some more tests
2019-12-04 23:05:20 +01:00
Willem Melching
1ba646773e fix linter 2019-12-03 07:56:57 -08:00
George Hotz
347a86615c Switch from polling on FIFOs to signal (#12)
* uids are pids

* remove fifo, go for signal

* that's more what i'm saying

* oops, that's wrong

* add some todos

* make signal poll work

* bring randomness back

* fix case in msgq when subs get evicted while polling

* check for ready messages before poll starts

* No pr builds

* use nanosleep with remainder

* this should pass the test
2019-11-22 12:06:26 -08:00
Willem Melching
f6a8e394a2 add test with multiple subscribers 2019-11-21 13:14:31 -08:00
Comma Device
84b3af535e comment out the debugging 2019-11-21 21:02:12 +00:00
Willem Melching
66be37087a run python unittest in ci 2019-11-20 17:31:33 -08:00
Willem Melching
52c6db8719 Run scons in CI (#14)
* try to run scons in azure pipelines

* sudo

* install capnp

* does this run

* also clean test runner

* remove makefiles

* this should build
2019-11-20 16:32:42 -08:00
George Hotz
e3a6bded63 Revert "no more makefiles"
This reverts commit 223e37a57d.
2019-11-20 11:59:39 -08:00
Comma Device
487fbd06bf don't rely on BASEDIR, and add zmq library 2019-11-20 18:31:54 +00:00
Comma Device
223e37a57d no more makefiles 2019-11-20 18:05:32 +00:00
Comma Device
fe9fe2a200 scons builds the python lib now 2019-11-20 17:44:47 +00:00
Comma Device
2f81135e32 err, it can't build services.h 2019-11-20 17:19:05 +00:00
Comma Device
57b03f8b92 now we shouldn't need that yaml crap everywhere 2019-11-20 16:47:01 +00:00