Skip to content

Commit

Permalink
WIP: ubuntu 22.04 support
Browse files Browse the repository at this point in the history
  • Loading branch information
wocsor committed Jul 15, 2024
1 parent ae09afa commit 430132f
Show file tree
Hide file tree
Showing 14 changed files with 2,265 additions and 2,850 deletions.
140 changes: 57 additions & 83 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,116 +4,90 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
opencv-python= "*"
ipython = "*"
networkx = "~=2.3"
azure-core = "*"
azure-common = "*"
azure-nspkg = "~=3.0"
av = "*"
azure-storage-blob = "~=2.1"
azure-storage-common = "~=2.1"
azure-storage-nspkg = "~=3.1"
boto = "*"
"boto3" = "*"
control = "*"
datadog = "*"
elasticsearch = "*"
gunicorn = "*"
"h5py" = "*"
hexdump = "*"
imageio = "*"
ipykernel = "*"
joblib = "*"
json-logging-py = "*"
jupyter = "*"
"mpld3" = "*"
msgpack-python = "*"
numpy = "*"
osmium = "*"
pycurl = "*"
git-pylint-commit-hook = "*"
pymongo = "*"
"pynmea2" = "*"
python-logstash = "*"
redis = "*"
"s2sphere" = "*"
"subprocess32" = "*"
tenacity = "*"
keras_applications = "*"
PyMySQL = "~=0.9"
Werkzeug = "*"
"backports.lzma" = "*"
Flask-Cors = "*"
Flask-SocketIO = "*"
"GeoAlchemy2" = "*"
Pygments = "*"
reverse_geocoder = "*"
Shapely = "*"
SQLAlchemy = "*"
scipy = "*"
coverage = "*"
dictdiffer = "*"
fastcluster = "*"
simplejson = "*"
seaborn = "*"
pyproj = "*"
mock = "*"
hexdump = "*"
hypothesis = "==6.46.7"
inputs = "*"
lru-dict = "*"
markdown-it-py = "*"
matplotlib = "*"
dictdiffer = "*"
aenum = "*"
coverage = "*"
azure-cli-core = "*"
mypy = "*"
myst-parser = "*"
natsort = "*"
numpy = "*"
opencv-python-headless = "*"
parameterized = "*"
paramiko = "*"
aiohttp = "*"
lru-dict = "*"
scikit-image = "*"
pygame = "==2.0.0.dev8"
pprofile = "*"
pyprof2calltree = "*"
pre-commit = "*"
mypy = "*"
parameterized = "*"
pycurl = "*"
pygame = "*"
pyprof2calltree = "*"
pytest = "*"
pytest-xdist = "*"
reverse_geocoder = "*"
scipy = "*"
sphinx = "*"
sphinx-sitemap = "*"
sphinx-rtd-theme = "*"
breathe = "*"
subprocess32 = "*"
tenacity = "*"
mpld3 = "*"
carla = {version = "==0.9.13", markers="platform_system != 'Darwin'"}
ft4222 = "*"
hypothesis = "*"
pandas = "*"
tabulate = "*"

[packages]
atomicwrites = "*"
casadi = {version = "*", markers="platform_system != 'Darwin'"}
cffi = "*"
crcmod = "*"
cryptography = "*"
Cython = "*"
flake8 = "*"
Flask = "*"
future-fstrings = "*" # for acados
gunicorn = "*"
hexdump = "*"
Jinja2 = "*"
json-rpc = "*"
libusb1 = "*"
nose = "*"
numpy = "*"
protobuf = "==3.20.1"
onnx = "*"
onnxruntime-gpu = {version = "*", markers="platform_system != 'Darwin'"}
pillow = "*"
psutil = "*"
pycapnp = "==1.0.0"
cryptography = "*"
pycapnp = "==1.1.0"
pycryptodome = "*"
PyJWT = "*"
pylint = "*"
pyopencl = "*"
pyserial = "*"
python-dateutil = "*"
PyYAML = "*"
pyzmq = "*"
requests = "*"
scons = "*"
sentry-sdk = "*"
setproctitle = "*"
six = "*"
smbus2 = "*"
sympy = "!=1.6.1"
timezonefinder = "*"
tqdm = "*"
Cython = "*"
PyYAML = "*"
websocket_client = "*"
urllib3 = "*"
gunicorn = "*"
utm = "*"
json-rpc = "*"
Flask = "*"
nose = "*"
flake8 = "*"
pylint = "*"
pillow = "*"
scons = "*"
cysignals = "*"
pycryptodome = "*"
"Jinja2" = "*"
PyJWT = "*"
pyserial = "*"
onnx = "*"
onnxruntime = "*"
timezonefinder = "*"
sentry-sdk = "*"
websocket_client = "*"
hatanaka = "==2.4"

[requires]
python_version = "3.8"
4,788 changes: 2,091 additions & 2,697 deletions Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cereal
2 changes: 1 addition & 1 deletion panda
Submodule panda updated 223 files
1 change: 1 addition & 0 deletions phonelibs/libyuv/libyuv
Submodule libyuv added at 4a14cb
Binary file modified phonelibs/libyuv/x64/lib/libyuv.a
Binary file not shown.
3 changes: 3 additions & 0 deletions selfdrive/boardd/boardd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#define CUTOFF_IL 200
#define SATURATE_IL 1600
#define NIBBLE_TO_HEX(n) ((n) < 10 ? (n) + '0' : ((n) - 10) + 'a')
#define UNUSED(x) (void)x

Panda * panda = nullptr;
std::atomic<bool> safety_setter_thread_running(false);
Expand Down Expand Up @@ -159,6 +160,8 @@ bool usb_connect() {
if (!connected_once) {
tmp_panda->set_usb_power_mode(cereal::PandaState::UsbPowerMode::CDP);
}
#else
UNUSED(connected_once);
#endif

if (tmp_panda->has_rtc){
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/common/modeldata.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ const int TRAJECTORY_SIZE = 33;
const float MIN_DRAW_DISTANCE = 10.0;
const float MAX_DRAW_DISTANCE = 100.0;

const double T_IDXS[TRAJECTORY_SIZE] = {0. , 0.00976562, 0.0390625 , 0.08789062, 0.15625 ,
const double T_IDXS[33] = {0. , 0.00976562, 0.0390625 , 0.08789062, 0.15625 ,
0.24414062, 0.3515625 , 0.47851562, 0.625 , 0.79101562,
0.9765625 , 1.18164062, 1.40625 , 1.65039062, 1.9140625 ,
2.19726562, 2.5 , 2.82226562, 3.1640625 , 3.52539062,
3.90625 , 4.30664062, 4.7265625 , 5.16601562, 5.625 ,
6.10351562, 6.6015625 , 7.11914062, 7.65625 , 8.21289062,
8.7890625 , 9.38476562, 10.};
const double X_IDXS[TRAJECTORY_SIZE] = { 0. , 0.1875, 0.75 , 1.6875, 3. , 4.6875,
const double X_IDXS[33] = { 0. , 0.1875, 0.75 , 1.6875, 3. , 4.6875,
6.75 , 9.1875, 12. , 15.1875, 18.75 , 22.6875,
27. , 31.6875, 36.75 , 42.1875, 48. , 54.1875,
60.75 , 67.6875, 75. , 82.6875, 90.75 , 99.1875,
Expand Down
4 changes: 2 additions & 2 deletions selfdrive/common/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ class Params {
inline std::string get(const std::string &key, bool block = false) {
return get(key.c_str(), block);
}

/*
template <class T>
std::optional<T> get(const char *key, bool block = false) {
std::istringstream iss(get(key, block));
T value{};
iss >> value;
return iss.fail() ? std::nullopt : std::optional(value);
}

*/
inline bool getBool(const std::string &key) {
return getBool(key.c_str());
}
Expand Down
3 changes: 3 additions & 0 deletions selfdrive/controls/lib/longitudinal_mpc/longitudinal_mpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#define N ACADO_N /* Number of intervals in the horizon. */

#define UNUSED(x) (void)x

ACADOvariables acadoVariables;
ACADOworkspace acadoWorkspace;

Expand Down Expand Up @@ -85,6 +87,7 @@ void init_with_simulation(double v_ego, double x_l_0, double v_l_0, double a_l_0

double dt = 0.2;
double t = 0.;
UNUSED(t);

for (i = 0; i < N + 1; ++i){
if (i > 4){
Expand Down
3 changes: 3 additions & 0 deletions selfdrive/modeld/dmonitoringmodeld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
#include "selfdrive/common/util.h"
#include "selfdrive/modeld/models/dmonitoring.h"

#define UNUSED(x) (void)x

ExitHandler do_exit;

void run_model(DMonitoringModelState &model, VisionIpcClient &vipc_client) {
PubMaster pm({"driverState"});
double last = 0;
UNUSED(last);

while (!do_exit) {
VisionIpcBufExtra extra = {};
Expand Down
3 changes: 3 additions & 0 deletions selfdrive/modeld/modeld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ bool live_calib_seen;
mat3 cur_transform;
std::mutex transform_lock;

#define UNUSED(x) (void)x

void calibration_thread(bool wide_camera) {
set_thread_name("calibration");
set_realtime_priority(50);
Expand Down Expand Up @@ -79,6 +81,7 @@ void run_model(ModelState &model, VisionIpcClient &vipc_client) {

uint32_t frame_id = 0, last_vipc_frame_id = 0;
double last = 0;
UNUSED(last);
int desire = -1;
uint32_t run_count = 0;

Expand Down
16 changes: 11 additions & 5 deletions tools/openpilot_env.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
if [ -z "$OPENPILOT_ENV" ]; then
export PYTHONPATH="$HOME/openpilot"
export PATH="$HOME/.pyenv/bin:$PATH"

unamestr=`uname`
if [[ "$unamestr" == 'Linux' ]]; then
export PATH="$HOME/.pyenv/bin:$PATH"
# Pyenv suggests we place the below two lines in .profile before we source
# .bashrc, but there is no simple way to guarantee we do this correctly
# programmatically across heterogeneous systems. For end-user convenience,
# we add the lines here as a workaround.
# https://github.com/pyenv/pyenv/issues/1906
export PYENV_ROOT="$HOME/.pyenv"

if [[ "$(uname)" == 'Linux' ]]; then
eval "$(pyenv virtualenv-init -)"
elif [[ "$unamestr" == 'Darwin' ]]; then
elif [[ "$(uname)" == 'Darwin' ]]; then
# msgq doesn't work on mac
export ZMQ=1
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
fi
eval "$(pyenv init --path)"
eval "$(pyenv init -)"

export OPENPILOT_ENV=1
Expand Down
Loading

0 comments on commit 430132f

Please sign in to comment.