Commit Graph

171 Commits

Author SHA1 Message Date
ZwX1616 51cbf6294e
Submaster (python): set alive when first seen for simulation=1 (#613)
* now should be the same as cc

* need updated

* clear about redefine
2024-05-21 23:00:43 -07:00
Adeeb Shihadeh 591e389bf8 cleaup duplicated loop 2024-05-12 14:19:45 -07:00
Adeeb Shihadeh 861144c136
update to ubuntu 24.04 (#609)
* update to ubuntu 24.04

* Update .github/workflows/repo.yml

* Update tests.yml

* fix build

* clang rt

* system python

* those are way too slow
2024-04-28 13:40:31 -07:00
Adeeb Shihadeh bd31b25aac
SubMaster: adjust avg frequency check (#587)
* SubMaster: adjust avg frequency check

* cleanup
2024-02-14 14:59:29 -08:00
Adeeb Shihadeh 70b68f6e3a
SubMaster: add seen property (#586) 2024-02-12 14:55:21 -08:00
Adeeb Shihadeh 9b573c2be3
SubMaster: poll a single service (#585)
* SubMaster: poll a single service

* smarter min/max

* cleanup

---------

Co-authored-by: Comma Device <device@comma.ai>
2024-02-11 21:29:31 -08:00
Comma Device 2dd7162455 fix avg freq 2024-02-09 22:42:33 -08:00
Adeeb Shihadeh 286a01db05
SubMaster: improved avg frequency check (#583)
* check poll freq

* better check

* cleanup

* mypy fixes

* little more

* mypy fix
2024-02-09 21:50:29 -08:00
Adeeb Shihadeh e2811732e6
more submaster fixups (#584)
* clean that up

* debug

* fix

* oops
2024-02-09 21:34:50 -08:00
Adeeb Shihadeh 3f1499f98d fix avg freq check 2024-02-09 19:42:01 -08:00
Adeeb Shihadeh 2fc7baf9cf
messaging cleanup (#582)
* messaging cleanup

* little more
2024-02-09 16:16:02 -08:00
Adeeb Shihadeh bcdf5dfa0b SubMaster cleanup 2024-02-08 21:37:36 -08:00
Adeeb Shihadeh f3ceee7987 more type hints 2024-02-08 15:47:52 -08:00
Adeeb Shihadeh 033dad2b37 add kwargs for new_message 2023-12-02 22:45:54 -08:00
Adeeb Shihadeh 51fd6728f1 not ready for this one yet 2023-12-02 22:35:51 -08:00
Adeeb Shihadeh 8fae7b4de9 SubMaster: add ignore_valid arg 2023-12-02 22:15:48 -08:00
Adeeb Shihadeh c1c0ea2c7a update the test 2023-12-02 11:03:07 -08:00
Adeeb Shihadeh 8cbd294489 explicitly set to invalid 2023-12-02 10:52:02 -08:00
Adeeb Shihadeh 3038eacad1
new message defaults to invalid (#558) 2023-12-02 10:18:11 -08:00
Adeeb Shihadeh 60d1ee0490
SubMaster: ensure msg is always a reader (#557)
* SubMaster: ensure msg is always a reader

* fix
2023-12-01 22:36:37 -08:00
Kacper Rączy acb24ff8c2
zmq: assert the same PID (#540)
Enforce the same PID in ZMQ pub sockets
2023-10-02 15:03:39 -07:00
Shane Smiskol aed84aeedf
services: capitalize constant service list (#534)
* rename services

* keep more unique name

* type this
2023-09-21 18:01:44 -07:00
Justin Newberry 4291784b4d
Messaging: DT Param on wait_for_readers_to_update (#529)
* dt param

* same as the others
2023-09-05 11:02:17 -07:00
Dean Lee bf8db88407
cpplint: more filters (#522)
more filters
2023-08-24 11:31:53 -07:00
Adeeb Shihadeh fa580de1b4
make services a map (#520) 2023-08-23 13:26:00 -07:00
Adeeb Shihadeh 3cac040c5b use time.monotonic() instead of importing from openpilot 2023-08-20 17:20:28 -07:00
Shane Smiskol 8dd787e9a6
mypy: check untyped definitions (#517)
* add cereal mypy.ini

* mypy doesn't use unittest asserts yet

* Argument 1 to "len" has incompatible type "object"; expected "Sized"  [arg-type]

* type ports

* int|none

* final thing

* move to pyproject.toml

* clean p
2023-08-17 20:19:01 -07:00
Justin Newberry 227c7ca55f
Ruff: propogate config from OP (#513) 2023-08-14 12:53:17 -07:00
Justin Newberry f01d677e1d
CI: pylint to ruff (#512)
* pylint to ruff

* fix ruff
2023-08-07 15:55:35 -07:00
Mitchell Goff ba3238ef9c
Added MessageBuilder methods to serialize to an existing buffer (#511) 2023-08-07 13:45:35 -07:00
Maxime Desroches aed9fd278a
Update pycapnp (#499)
* context

* cython

* -Wno-parentheses-equality

* -Wno-everything

* remove werror
2023-07-18 13:09:49 -07:00
Adeeb Shihadeh cf9c5cbb91 PubMaster: add wait_for_readers_to_update helper 2023-07-17 09:49:39 -07:00
Kacper Rączy a2f1f0cb8d
SubMaster: replace SIMULATION constant with property (#495)
* Add simulation property to python submaster

* decode bstrings before formatting error messages
2023-07-11 19:30:00 -07:00
Kacper Rączy 457753aa6a
tests: fix recv_one_or_none test (#447)
* Fixed recv_one_or_none test

* Remove sleep

* Add skipIf to test_recv_one_or_none on ZMQ

* Add zmq_expected_failure decorator
2023-07-05 11:38:43 -07:00
Adeeb Shihadeh 11d560b9b9 sm: fix avg freq check 2023-06-22 23:29:20 -07:00
Adeeb Shihadeh 1f9d582a8d
SubMaster: fix recv_dts initial state (#487)
* SubMaster: fix recv_dts initial state

* any len
2023-06-22 22:45:05 -07:00
Kacper Rączy f495c6bb90
macOS: stub implementation of event API (#476)
* Add runtime checks for event API on macOS

* Fix stub ppoll impl

* Fix lint issues

* Remove assert from event_state_shm_mmap

* Add variable args in ppoll macro

* Skip fake socket tests on macOS

* Add missing newline

* PPOLL and ppoll_impl definitions

* Update macro signature

* Fix issues on linux

* Stub empty implementation of event for macos

* Go back to shorter fds/timeout initialization

* Complete stub implementation of event api

* Fix unused variable warning

* Remove extra space
2023-06-19 17:09:29 -07:00
Kacper Rączy c27be716ec
connect: add error messages when Socket connect fails (#456)
* Throw runtime_error in Socket::create

* Add messages to MessagingError

* Fix cython bindings

* Write a message to stderr instead of throwing runtime_error
2023-06-02 15:14:08 -07:00
Kacper Rączy 4e063ca166
FakeSubSocket and FakePubSocket for IPC synchronization (#439)
* Implementation of FakeSubSocket and FakePubSocket using eventfd with support for one-in/one-out synchronization

* Expose FakeEvent to Python

* Add demo showcasing synchronization between processes

* Fix linter errors

* Expose more FakeEvent APIs in Python bindings

* Add FakePoller implementation

* Remove suffix from poll env vars

* Set poller timeout to zero when events are enabled

* Replace poll with ppoll. Add invalidation methods

* Fix lint issues

* Fix comment indent

* Remove fake_demo

* Remove FakePubSocket. Simpler FakePoller implementation. Ability to wait for multiple events

* Rename FakeEvent to Event and move it to event.cc

* Rename event purpose constants in py

* Add support for timeout in wait methods

* Add tests for events and fake sockets

* Fix lint errors

* Add zmq sleeps

* Temporarly disable TestFakeSockets on ZMQ

* Add exception type specifiers to test_fake

* Event Manager implementation

* Fix fake sockets tests

* Update EventManager API

* Add test for enable/disable

* Add tests for cereal prefix

* Remove EventPurpose from python bindings

* Fix lint issues

* event_state_shm_mmap implementation shared by EventManager and FakeSubSocket

* Rename EventManager to SocketEventHandle

* More renames
2023-05-23 19:38:52 +02:00
Adeeb Shihadeh d3de9ddd26
messaging: remove extern C (#443) 2023-05-10 10:59:18 -07:00
Adeeb Shihadeh 959ff79963
add cpplint (#401)
* add cpplint

* include what you use

* whitespace fixes

* passes
2022-12-31 16:33:09 -08:00
Adeeb Shihadeh 6e58b293ee
include from project root (#402) 2022-12-31 14:19:29 -08:00
ntegan1 4ec689c0c4
fix set but unused warning (#390)
* fix set but unused warning

* re-run ci maybe
2022-11-30 11:36:17 -08:00
Willem Melching 72fb965dcf
Add missing time.h include (#385)
add missing time.h include
2022-11-21 16:10:55 -08:00
Adeeb Shihadeh 1d25fc3f20
msgq: bump num readers up a bit (#379) 2022-10-24 17:53:32 -07:00
Kurt Nistelberger e310f4860d
Sensor events splitup (#357)
* change from sensorEvents to separated events

* fix numbering

* remove sensorEvent

* update after rebase

* .

* move bmx gyro and accel to its own channels

* address PR comments

* .

* inc frequency in tests

* .

* rename sensorEventsDEPRECATED sensorEvents

* readd sensorEvents in services.py

* .

Co-authored-by: Kurt Nistelberger <kurt.nistelberger@gmail.com>
2022-09-27 15:28:22 -07:00
Adeeb Shihadeh 452a9d8028
msgq: remove special queue size for camera states (#343) 2022-08-20 22:34:44 -07:00
Adeeb Shihadeh 98f795fd73 bridge: break early for do_exit 2022-06-11 18:16:47 -07:00
Adeeb Shihadeh 78870ba056 bridge: don't get stuck retrying while exiting 2022-06-11 17:51:23 -07:00
Shane Smiskol 9c0c517bc8
SubMaster: add poll argument to C++ class (#307)
* add poll to c++ submaster

* one line

* clean up

one line

* Update messaging/socketmaster.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Update messaging/socketmaster.cc

* comment makes more sense

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-05-20 14:24:38 -07:00