mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-25 22:52:07 +08:00
d062a97a26
* WebRTCClient and WebRTCServer abstractions
* webrtc client implementation
* Interactive test scripts
* Send localDescriptions as offer/asnwer, as they are different
* Tracks need to be added after setting remote description for multi-cam streaming to work
* Remove WebRTCStreamingMetadata
* Wait for tracks
* Move stuff to separate files, rename some things
* Refactor everything, create WebRTCStreamBuilder for both offer and answers
* ta flight done time to grind
* wait for incoming tracks and channels
* Dummy track and frame reader track. Fix timing.
* dt based on camera type
* first trial of the new api
* Fix audio track
* methods for checking for incoming tracks
* Web migration part 2
* Fixes for stream api
* use rtc description for web.py
* experimental cereal proxy
* remove old code from bodyav
* fix is_started
* serialize session description
* fix audio
* messaging channel wrapper
* fix audiotrack
* h264 codec preference
* Add codec preference to tracks
* override sdp codecs
* add logging
* Move cli stuff to separate file
* slight cleanup
* Fix audio track
* create codec_mime inside force_codec function
* fix incoming media estimation
* move builders to __init__
* stream updates following builders
* Update example script
* web.py support for new builder
* web speaker fixes
* StreamingMediaInfo API
* Move things around
* should_add_data_channel rename
* is_connected_and_ready
* fix linter errors
* make cli executable
* remove dumb comments
* logging support
* fix parse_info_from_offer
* improve type annotations
* satisfy linters
* Support for waiting for disconnection
* Split device tracks into video/audio files. Move audio speaker to audio.py
* default dt for dummy video track
* Fix cli
* new speaker fixes
* Remove almost all functionality from web.py
* webrtcd
* continue refactoring web.py
* after handling joystick reset in controlsd with #30409, controls are not necessary anymore
* ping endpoint
* Update js files to at least support what worked previously
* Fixes after some tests on the body
* Streaming fixes
* Remove the use of WebRTCStreamBuilder. Subclass use is now required
* Add todo
* delete all streams on shutdown
* Replace lastPing with lastChannelMessageTime
* Update ping text only if rtc is still on
* That should affect the chart too
* Fix paths in web
* use protocol in SSLContext
* remove warnings since aiortc is not used directly anymore
* check if task is done in stop
* remove channel handler wrapper, since theres only one channel
* Move things around
* Moved webrtc abstractions to separate repository
* Moved webrtcd to tools/webrtc
* Update imports
* Add bodyrtc as dependency
* Add webrtcd to process_config
* Remove usage of DummyVideoStreamTrack
* Add main to webrtcd
* Move webrtcd to system
* Fix imports
* Move cereal proxy logic outside of runner
* Incoming proxy abstractions
* Add some tests
* Make it executable
* Fix process config
* Fix imports
* Additional tests. Add tests to pyproject.toml
* Update poetry lock
* New line
* Bump aiortc to 1.6.0
* Added teleoprtc_repo as submodule, and linked its source dir
* Add init file to webrtc module
* Handle aiortc warnings
* Ignore deprecation warnings
* Ignore resource warning too
* Ignore the warnings
* find free port for test_webrtcd
* Start process inside the test case
* random sleep test
* test 2
* Test endpoint function instead
* Update comment
* Add system/webrtc to release
* default arguments for body fields
* Add teleoprtc to release
* Bump teleoprtc
* Exclude teleoprtc from static analysis
* Use separate event loop for stream session tests
old-commit-hash: f058b5d64e
92 lines
4.5 KiB
Python
92 lines
4.5 KiB
Python
import os
|
|
|
|
from cereal import car
|
|
from openpilot.common.params import Params
|
|
from openpilot.system.hardware import PC, TICI
|
|
from openpilot.selfdrive.manager.process import PythonProcess, NativeProcess, DaemonProcess
|
|
|
|
WEBCAM = os.getenv("USE_WEBCAM") is not None
|
|
|
|
def driverview(started: bool, params: Params, CP: car.CarParams) -> bool:
|
|
return started or params.get_bool("IsDriverViewEnabled")
|
|
|
|
def notcar(started: bool, params: Params, CP: car.CarParams) -> bool:
|
|
return started and CP.notCar
|
|
|
|
def iscar(started: bool, params: Params, CP: car.CarParams) -> bool:
|
|
return started and not CP.notCar
|
|
|
|
def logging(started, params, CP: car.CarParams) -> bool:
|
|
run = (not CP.notCar) or not params.get_bool("DisableLogging")
|
|
return started and run
|
|
|
|
def ublox_available() -> bool:
|
|
return os.path.exists('/dev/ttyHS0') and not os.path.exists('/persist/comma/use-quectel-gps')
|
|
|
|
def ublox(started, params, CP: car.CarParams) -> bool:
|
|
use_ublox = ublox_available()
|
|
if use_ublox != params.get_bool("UbloxAvailable"):
|
|
params.put_bool("UbloxAvailable", use_ublox)
|
|
return started and use_ublox
|
|
|
|
def qcomgps(started, params, CP: car.CarParams) -> bool:
|
|
return started and not ublox_available()
|
|
|
|
def always_run(started, params, CP: car.CarParams) -> bool:
|
|
return True
|
|
|
|
def only_onroad(started: bool, params, CP: car.CarParams) -> bool:
|
|
return started
|
|
|
|
def only_offroad(started, params, CP: car.CarParams) -> bool:
|
|
return not started
|
|
|
|
procs = [
|
|
DaemonProcess("manage_athenad", "selfdrive.athena.manage_athenad", "AthenadPid"),
|
|
|
|
NativeProcess("camerad", "system/camerad", ["./camerad"], driverview),
|
|
NativeProcess("logcatd", "system/logcatd", ["./logcatd"], only_onroad),
|
|
NativeProcess("proclogd", "system/proclogd", ["./proclogd"], only_onroad),
|
|
PythonProcess("logmessaged", "system.logmessaged", always_run),
|
|
PythonProcess("micd", "system.micd", iscar),
|
|
PythonProcess("timezoned", "system.timezoned", always_run, enabled=not PC),
|
|
|
|
PythonProcess("dmonitoringmodeld", "selfdrive.modeld.dmonitoringmodeld", driverview, enabled=(not PC or WEBCAM)),
|
|
NativeProcess("encoderd", "system/loggerd", ["./encoderd"], only_onroad),
|
|
NativeProcess("stream_encoderd", "system/loggerd", ["./encoderd", "--stream"], notcar),
|
|
NativeProcess("loggerd", "system/loggerd", ["./loggerd"], logging),
|
|
NativeProcess("modeld", "selfdrive/modeld", ["./modeld"], only_onroad),
|
|
NativeProcess("mapsd", "selfdrive/navd", ["./mapsd"], only_onroad),
|
|
PythonProcess("navmodeld", "selfdrive.modeld.navmodeld", only_onroad),
|
|
NativeProcess("sensord", "system/sensord", ["./sensord"], only_onroad, enabled=not PC),
|
|
NativeProcess("ui", "selfdrive/ui", ["./ui"], always_run, watchdog_max_dt=(5 if not PC else None)),
|
|
NativeProcess("soundd", "selfdrive/ui/soundd", ["./soundd"], only_onroad),
|
|
NativeProcess("locationd", "selfdrive/locationd", ["./locationd"], only_onroad),
|
|
NativeProcess("boardd", "selfdrive/boardd", ["./boardd"], always_run, enabled=False),
|
|
PythonProcess("calibrationd", "selfdrive.locationd.calibrationd", only_onroad),
|
|
PythonProcess("torqued", "selfdrive.locationd.torqued", only_onroad),
|
|
PythonProcess("controlsd", "selfdrive.controls.controlsd", only_onroad),
|
|
PythonProcess("deleter", "system.loggerd.deleter", always_run),
|
|
PythonProcess("dmonitoringd", "selfdrive.monitoring.dmonitoringd", driverview, enabled=(not PC or WEBCAM)),
|
|
PythonProcess("qcomgpsd", "system.qcomgpsd.qcomgpsd", qcomgps, enabled=TICI),
|
|
PythonProcess("navd", "selfdrive.navd.navd", only_onroad),
|
|
PythonProcess("pandad", "selfdrive.boardd.pandad", always_run),
|
|
PythonProcess("paramsd", "selfdrive.locationd.paramsd", only_onroad),
|
|
NativeProcess("ubloxd", "system/ubloxd", ["./ubloxd"], ublox, enabled=TICI),
|
|
PythonProcess("pigeond", "system.sensord.pigeond", ublox, enabled=TICI),
|
|
PythonProcess("plannerd", "selfdrive.controls.plannerd", only_onroad),
|
|
PythonProcess("radard", "selfdrive.controls.radard", only_onroad),
|
|
PythonProcess("thermald", "selfdrive.thermald.thermald", always_run),
|
|
PythonProcess("tombstoned", "selfdrive.tombstoned", always_run, enabled=not PC),
|
|
PythonProcess("updated", "selfdrive.updated", only_offroad, enabled=not PC),
|
|
PythonProcess("uploader", "system.loggerd.uploader", always_run),
|
|
PythonProcess("statsd", "selfdrive.statsd", always_run),
|
|
|
|
# debug procs
|
|
NativeProcess("bridge", "cereal/messaging", ["./bridge"], notcar),
|
|
PythonProcess("webrtcd", "system.webrtc.webrtcd", notcar),
|
|
PythonProcess("webjoystick", "tools.bodyteleop.web", notcar),
|
|
]
|
|
|
|
managed_processes = {p.name: p for p in procs}
|