Skip to content

Commit 8cd4132

Browse files
author
James Bockman
committed
Release
0 parents  commit 8cd4132

14 files changed

Lines changed: 955 additions & 0 deletions

.gitignore

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*$py.class
4+
5+
# C extensions
6+
*.so
7+
8+
# Distribution / packaging
9+
.Python
10+
build/
11+
develop-eggs/
12+
dist/
13+
downloads/
14+
eggs/
15+
.eggs/
16+
lib/
17+
lib64/
18+
parts/
19+
sdist/
20+
var/
21+
wheels/
22+
share/python-wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.nox/
42+
.coverage
43+
.coverage.*
44+
.cache
45+
nosetests.xml
46+
coverage.xml
47+
*.cover
48+
*.py,cover
49+
.hypothesis/
50+
.pytest_cache/
51+
cover/
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Django stuff:
58+
*.log
59+
local_settings.py
60+
db.sqlite3
61+
db.sqlite3-journal
62+
63+
# Flask stuff:
64+
instance/
65+
.webassets-cache
66+
67+
# Scrapy stuff:
68+
.scrapy
69+
70+
# Sphinx documentation
71+
docs/_build/
72+
73+
# PyBuilder
74+
.pybuilder/
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
# For a library or package, you might want to ignore these files since the code is
86+
# intended to run in multiple environments; otherwise, check them in:
87+
# .python-version
88+
89+
# pipenv
90+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
91+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
92+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
93+
# install all needed dependencies.
94+
#Pipfile.lock
95+
96+
# UV
97+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
98+
# This is especially recommended for binary packages to ensure reproducibility, and is more
99+
# commonly ignored for libraries.
100+
#uv.lock
101+
102+
# poetry
103+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
104+
# This is especially recommended for binary packages to ensure reproducibility, and is more
105+
# commonly ignored for libraries.
106+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
107+
#poetry.lock
108+
109+
# pdm
110+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
111+
#pdm.lock
112+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
113+
# in version control.
114+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
115+
.pdm.toml
116+
.pdm-python
117+
.pdm-build/
118+
119+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
120+
__pypackages__/
121+
122+
# Celery stuff
123+
celerybeat-schedule
124+
celerybeat.pid
125+
126+
# SageMath parsed files
127+
*.sage.py
128+
129+
# Environments
130+
.env
131+
.venv
132+
env/
133+
venv/
134+
ENV/
135+
env.bak/
136+
venv.bak/
137+
138+
# Spyder project settings
139+
.spyderproject
140+
.spyproject
141+
142+
# Rope project settings
143+
.ropeproject
144+
145+
# mkdocs documentation
146+
/site
147+
148+
# mypy
149+
.mypy_cache/
150+
.dmypy.json
151+
dmypy.json
152+
153+
# Pyre type checker
154+
.pyre/
155+
156+
# pytype static type analyzer
157+
.pytype/
158+
159+
# Cython debug symbols
160+
cython_debug/
161+
162+
# PyCharm
163+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
164+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
165+
# and can be added to the global gitignore or merged into this file. For a more nuclear
166+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
167+
#.idea/
168+
169+
# PyPI configuration file
170+
.pypirc

AARC/AARC.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import sys
2+
import os
3+
import platform
4+
5+
if platform.architecture()[0] == "64bit":
6+
sysdir = os.path.dirname(__file__) + "/stdlib64"
7+
else:
8+
sysdir = os.path.dirname(__file__) + "/stdlib"
9+
sys.path.insert(0, sysdir)
10+
os.environ["PATH"] = os.environ["PATH"] + ";."
11+
12+
from server import AARCServer
13+
import ac
14+
15+
server = None
16+
17+
18+
def acMain(ac_version):
19+
global server
20+
app = ac.newApp("AARK")
21+
ac.setTitle(app, " Autonomous Racing")
22+
ac.setSize(app, 220, 40)
23+
ac.drawBackground(app, 0)
24+
25+
label = ac.addLabel(app, "")
26+
ac.setFontSize(label, 12)
27+
ac.setPosition(label, 5, 103)
28+
29+
server = AARCServer()
30+
server.start()
31+
32+
return "AARK"
33+
34+
35+
def acUpdate(deltaT):
36+
# Has to be here to allow application threads to receive execution context
37+
return
38+
39+
40+
def acShutdown(*args):
41+
return

AARC/server.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
from multiprocessing.connection import Listener
2+
from threading import Thread
3+
4+
import ac
5+
6+
ADDRESS = "localhost"
7+
PORT = 6337
8+
9+
10+
class AARCServer:
11+
"""
12+
Socket server that listens for client requests
13+
"""
14+
15+
def __init__(self):
16+
self.listener = Listener((ADDRESS, PORT))
17+
self.is_running = True
18+
19+
def send_state(self, connection):
20+
is_connected = True
21+
while is_connected:
22+
read = connection.recv_bytes()
23+
if read.decode("utf-8") == "reset_car":
24+
ac.ext_resetCar()
25+
26+
def run(self):
27+
while self.is_running:
28+
connection = self.listener.accept()
29+
worker = Thread(target=self.send_state, args=[connection], daemon=True)
30+
worker.start()
31+
32+
def start(self):
33+
self._server_thread = Thread(target=self.run, daemon=True)
34+
self._server_thread.start()

AARC/stdlib/_multiprocessing.pyd

12 KB
Binary file not shown.

AARC/stdlib/_socket.pyd

47.5 KB
Binary file not shown.

AARC/stdlib/select.pyd

9.5 KB
Binary file not shown.

AARC/stdlib/unicodedata.pyd

741 KB
Binary file not shown.

AARC/stdlib64/_multiprocessing.pyd

14 KB
Binary file not shown.

AARC/stdlib64/_socket.pyd

50 KB
Binary file not shown.

AARC/stdlib64/select.pyd

10.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)