Skip to content

Commit

Permalink
Sync: commaai/openpilot:master into sunnypilot/sunnypilot:master (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyhaibin authored Feb 24, 2024
2 parents 4ab41dd + 8945fff commit b8773a1
Show file tree
Hide file tree
Showing 87 changed files with 850 additions and 576 deletions.
10 changes: 9 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ repos:
- --explicit-package-bases
exclude: '^(third_party/)|(cereal/)|(opendbc/)|(panda/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(teleoprtc/)|(teleoprtc_repo/)|(xx/)'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.1
rev: v0.2.2
hooks:
- id: ruff
exclude: '^(third_party/)|(cereal/)|(panda/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(teleoprtc/)|(teleoprtc_repo/)'
Expand Down Expand Up @@ -74,6 +74,14 @@ repos:
# https://google.github.io/styleguide/cppguide.html
# relevant rules are whitelisted, see all options with: cpplint --filter=
- --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/comma,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+whitespace/tab,+readability/braces
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.16.0
hooks:
- id: cython-lint
exclude: '^(third_party/)|(cereal/)|(body/)|(rednose/)|(rednose_repo/)|(opendbc/)|(panda/)|(generated/)'
args:
- --max-line-length=240
- --ignore=E111, E302, E305
- repo: local
hooks:
- id: test_translations
Expand Down
9 changes: 7 additions & 2 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Version 0.9.6 (2024-02-22)
Version 0.9.7 (2024-XX-XX)
========================
* New driving model

Version 0.9.6 (2024-02-27)
========================
* New driving model
* Vision model trained on more data
Expand All @@ -9,8 +13,9 @@ Version 0.9.6 (2024-02-22)
* AGNOS 9
* comma body streaming and controls over WebRTC
* Improved fuzzy fingerprinting for many makes and models
* Alpha longitudinal support for new Toyota models
* Chevrolet Equinox 2019-22 support thanks to JasonJShuler and nworb-cire!
* Dodge Duranago 2020-21 support
* Dodge Durango 2020-21 support
* Hyundai Staria 2023 support thanks to sunnyhaibin!
* Kia Niro Plug-in Hybrid 2022 support thanks to sunnyhaibin!
* Lexus LC 2024 support thanks to nelsonjchen!
Expand Down
2 changes: 1 addition & 1 deletion cereal
1 change: 1 addition & 0 deletions common/params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"ForcePowerDown", PERSISTENT},
{"GitBranch", PERSISTENT},
{"GitCommit", PERSISTENT},
{"GitCommitDate", PERSISTENT},
{"GitDiff", PERSISTENT},
{"GithubSshKeys", PERSISTENT},
{"GithubUsername", PERSISTENT},
Expand Down
2 changes: 1 addition & 1 deletion common/params_pyx.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cdef extern from "common/params.h":


def ensure_bytes(v):
return v.encode() if isinstance(v, str) else v;
return v.encode() if isinstance(v, str) else v

class UnknownKeyName(Exception):
pass
Expand Down
2 changes: 1 addition & 1 deletion common/transformations/transformations.pxd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#cython: language_level=3
# cython: language_level=3
from libcpp cimport bool

cdef extern from "orientation.cc":
Expand Down
7 changes: 3 additions & 4 deletions common/transformations/transformations.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ from openpilot.common.transformations.transformations cimport ecef2geodetic as e
from openpilot.common.transformations.transformations cimport LocalCoord_c


import cython
import numpy as np
cimport numpy as np

Expand All @@ -34,14 +33,14 @@ cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m):
return Matrix3(<double*>m.data)

cdef ECEF list2ecef(ecef):
cdef ECEF e;
cdef ECEF e
e.x = ecef[0]
e.y = ecef[1]
e.z = ecef[2]
return e

cdef NED list2ned(ned):
cdef NED n;
cdef NED n
n.n = ned[0]
n.e = ned[1]
n.d = ned[2]
Expand All @@ -61,7 +60,7 @@ def euler2quat_single(euler):

def quat2euler_single(quat):
cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3])
cdef Vector3 e = quat2euler_c(q);
cdef Vector3 e = quat2euler_c(q)
return [e(0), e(1), e(2)]

def quat2rot_single(quat):
Expand Down
2 changes: 1 addition & 1 deletion common/version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define COMMA_VERSION "0.9.6.0"
#define COMMA_VERSION "0.9.6.1"
47 changes: 24 additions & 23 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import contextlib
import gc
import os
import pytest
Expand Down Expand Up @@ -25,42 +26,42 @@ def pytest_runtest_call(item):
yield


@pytest.fixture(scope="function", autouse=True)
def openpilot_function_fixture(request):
@contextlib.contextmanager
def clean_env():
starting_env = dict(os.environ)
yield
os.environ.clear()
os.environ.update(starting_env)

random.seed(0)

# setup a clean environment for each test
with OpenpilotPrefix(shared_download_cache=request.node.get_closest_marker("shared_download_cache") is not None) as prefix:
prefix = os.environ["OPENPILOT_PREFIX"]
@pytest.fixture(scope="function", autouse=True)
def openpilot_function_fixture(request):
random.seed(0)

yield
with clean_env():
# setup a clean environment for each test
with OpenpilotPrefix(shared_download_cache=request.node.get_closest_marker("shared_download_cache") is not None) as prefix:
prefix = os.environ["OPENPILOT_PREFIX"]

# ensure the test doesn't change the prefix
assert "OPENPILOT_PREFIX" in os.environ and prefix == os.environ["OPENPILOT_PREFIX"]
yield

os.environ.clear()
os.environ.update(starting_env)
# ensure the test doesn't change the prefix
assert "OPENPILOT_PREFIX" in os.environ and prefix == os.environ["OPENPILOT_PREFIX"]

# cleanup any started processes
manager.manager_cleanup()
# cleanup any started processes
manager.manager_cleanup()

# some processes disable gc for performance, re-enable here
if not gc.isenabled():
gc.enable()
gc.collect()
# some processes disable gc for performance, re-enable here
if not gc.isenabled():
gc.enable()
gc.collect()

# If you use setUpClass, the environment variables won't be cleared properly,
# so we need to hook both the function and class pytest fixtures
@pytest.fixture(scope="class", autouse=True)
def openpilot_class_fixture():
starting_env = dict(os.environ)

yield

os.environ.clear()
os.environ.update(starting_env)
with clean_env():
yield


@pytest.fixture(scope="function")
Expand Down
Loading

0 comments on commit b8773a1

Please sign in to comment.