mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 19:23:56 +08:00
* dockerize carla + openpilot
* separate dockerfile
* bring back CI dockerfile
* cleanup bridge
* add op docker build and start script
* build container in CI
* fix camerad hack
* remove most magic numbers from bridge.py
* openpilot-sim docker build and run scripts
* fix dmonitoring hacks
* revert controlsd hacks
* clean up build scripts
* singular
* fix path
* fix image name
* modify sim readme
* sim readme and start script changes
* dockerfile with working opengl
* working opengl + passing panda build_st in docker
* fix bug in sim docker file
* bugfix sim docker file
* bugfix all op-sim docker issues
* modify readme + run script
* IT DRIVES
* clean this up
* more cleanup
* cleanup docker stuff
* more cleanup
* start with openpilot-base
* install carla python package
* Script is not in lib
* chmod
* everything should be running in docker now, the code may not be nice though
* works locally...
* rhdChecked is deprecated
* Checkout using git lfs when building sim container
* try to pass the tests
* pull latest docker
* gps should not throw an error on openpilot launch in bridge.py
* fixed a coding style error
* Only start ubloxd in car
* fixed more style problems
* revert typo
* Use enviromental variable to prevent errors in a simulator
* Remove unused import
* Attempt to fix missing enviromental variable
* fix typo
* less work for users, auto tmux engagement
* less work for users, auto tmux engagement
* fix check for nvidia
* clean up nvidia check
* remove typo, shorted dockerfile
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Bruce Wayne <batman@workstation-eu-gregor.eu.local>
Co-authored-by: Gregor Kikelj <gregor1234567890@gmail.com>
old-commit-hash: c5dfbe7a72
63 lines
1.4 KiB
Python
63 lines
1.4 KiB
Python
import sys
|
|
import termios
|
|
import time
|
|
from termios import (BRKINT, CS8, CSIZE, ECHO, ICANON, ICRNL, IEXTEN, INPCK,
|
|
ISIG, ISTRIP, IXON, PARENB, VMIN, VTIME)
|
|
from typing import Any
|
|
|
|
# Indexes for termios list.
|
|
IFLAG = 0
|
|
OFLAG = 1
|
|
CFLAG = 2
|
|
LFLAG = 3
|
|
ISPEED = 4
|
|
OSPEED = 5
|
|
CC = 6
|
|
|
|
def getch():
|
|
fd = sys.stdin.fileno()
|
|
old_settings = termios.tcgetattr(fd)
|
|
try:
|
|
# set
|
|
mode = termios.tcgetattr(fd)
|
|
mode[IFLAG] = mode[IFLAG] & ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON)
|
|
#mode[OFLAG] = mode[OFLAG] & ~(OPOST)
|
|
mode[CFLAG] = mode[CFLAG] & ~(CSIZE | PARENB)
|
|
mode[CFLAG] = mode[CFLAG] | CS8
|
|
mode[LFLAG] = mode[LFLAG] & ~(ECHO | ICANON | IEXTEN | ISIG)
|
|
mode[CC][VMIN] = 1
|
|
mode[CC][VTIME] = 0
|
|
termios.tcsetattr(fd, termios.TCSAFLUSH, mode)
|
|
|
|
ch = sys.stdin.read(1)
|
|
finally:
|
|
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
|
|
return ch
|
|
|
|
def keyboard_poll_thread(q):
|
|
while True:
|
|
c = getch()
|
|
# print("got %s" % c)
|
|
if c == '1':
|
|
q.put(str("cruise_up"))
|
|
if c == '2':
|
|
q.put(str("cruise_down"))
|
|
if c == '3':
|
|
q.put(str("cruise_cancel"))
|
|
if c == 'q':
|
|
exit(0)
|
|
|
|
def test(q):
|
|
while 1:
|
|
print("hello")
|
|
time.sleep(1.0)
|
|
|
|
if __name__ == '__main__':
|
|
from multiprocessing import Process, Queue
|
|
q : Any = Queue()
|
|
p = Process(target=test, args=(q,))
|
|
p.daemon = True
|
|
p.start()
|
|
|
|
keyboard_poll_thread(q)
|