parent
3a04a69cbe
commit
cf80f7a28b
242 changed files with 3877 additions and 2547 deletions
@ -0,0 +1,25 @@ |
|||||||
|
--- |
||||||
|
name: Bug report |
||||||
|
about: Create a report to help us improve openpilot |
||||||
|
title: '' |
||||||
|
labels: 'bug' |
||||||
|
assignees: '' |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
**Describe the bug** |
||||||
|
A clear and concise description of what the bug is. |
||||||
|
|
||||||
|
**How to reproduce or log data** |
||||||
|
Steps to reproduce the behavior, or a explorer/cabana link to the exact drive and timestamp of when the bug occurred. |
||||||
|
|
||||||
|
**Expected behavior** |
||||||
|
A clear and concise description of what you expected to happen. |
||||||
|
|
||||||
|
** Device/Version information (please complete the following information):** |
||||||
|
- Device: [e.g. EON/EON Gold] |
||||||
|
- Version: [e.g. 0.6.4], or commit hash when on devel |
||||||
|
- Car make/model [e.g. Toyota Prius 2016] |
||||||
|
|
||||||
|
**Additional context** |
||||||
|
Add any other context about the problem here. |
@ -0,0 +1,21 @@ |
|||||||
|
Choose one of the templates below: |
||||||
|
|
||||||
|
# Fingerprint |
||||||
|
This pull requests adds a fingerprint for <Make - Model - Year - Trim>. |
||||||
|
|
||||||
|
This is an explorer link to a drive with the stock system enabled: ... |
||||||
|
|
||||||
|
# Car support |
||||||
|
This pull requests adds support for <Make - Model - Year - Trim>. |
||||||
|
|
||||||
|
This is an explorer link to a drive with the stock system enabled: ... |
||||||
|
This is an explorer link to a drive with openpilot system enabled: ... |
||||||
|
|
||||||
|
# Feature |
||||||
|
This pull requests adds feature X |
||||||
|
|
||||||
|
## Description |
||||||
|
Explain what the feature does |
||||||
|
|
||||||
|
## Testing |
||||||
|
Explain how the feature was tested. Either by the added unit tests, or what tests were performed while driving. |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
@ -0,0 +1,23 @@ |
|||||||
|
import os |
||||||
|
import sysconfig |
||||||
|
from Cython.Distutils import build_ext |
||||||
|
|
||||||
|
def get_ext_filename_without_platform_suffix(filename): |
||||||
|
name, ext = os.path.splitext(filename) |
||||||
|
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX') |
||||||
|
|
||||||
|
if ext_suffix == ext: |
||||||
|
return filename |
||||||
|
|
||||||
|
ext_suffix = ext_suffix.replace(ext, '') |
||||||
|
idx = name.find(ext_suffix) |
||||||
|
|
||||||
|
if idx == -1: |
||||||
|
return filename |
||||||
|
else: |
||||||
|
return name[:idx] + ext |
||||||
|
|
||||||
|
class BuildExtWithoutPlatformSuffix(build_ext): |
||||||
|
def get_ext_filename(self, ext_name): |
||||||
|
filename = super().get_ext_filename(ext_name) |
||||||
|
return get_ext_filename_without_platform_suffix(filename) |
@ -1,5 +1,9 @@ |
|||||||
from distutils.core import setup, Extension |
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module |
||||||
|
|
||||||
from Cython.Build import cythonize |
from Cython.Build import cythonize |
||||||
|
|
||||||
|
from common.cython_hacks import BuildExtWithoutPlatformSuffix |
||||||
|
|
||||||
setup(name='Simple Kalman Implementation', |
setup(name='Simple Kalman Implementation', |
||||||
|
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix}, |
||||||
ext_modules=cythonize(Extension("simple_kalman_impl", ["simple_kalman_impl.pyx"]))) |
ext_modules=cythonize(Extension("simple_kalman_impl", ["simple_kalman_impl.pyx"]))) |
@ -0,0 +1,28 @@ |
|||||||
|
import os |
||||||
|
import subprocess |
||||||
|
from common.basedir import BASEDIR |
||||||
|
|
||||||
|
class Spinner(): |
||||||
|
def __enter__(self): |
||||||
|
self.spinner_proc = subprocess.Popen(["./spinner"], |
||||||
|
stdin=subprocess.PIPE, |
||||||
|
cwd=os.path.join(BASEDIR, "selfdrive", "ui", "spinner"), |
||||||
|
close_fds=True) |
||||||
|
return self |
||||||
|
|
||||||
|
def update(self, spinner_text): |
||||||
|
self.spinner_proc.stdin.write(spinner_text.encode('utf8') + b"\n") |
||||||
|
self.spinner_proc.stdin.flush() |
||||||
|
|
||||||
|
def __exit__(self, type, value, traceback): |
||||||
|
self.spinner_proc.stdin.close() |
||||||
|
self.spinner_proc.terminate() |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__": |
||||||
|
import time |
||||||
|
with Spinner() as s: |
||||||
|
s.update("Spinner text") |
||||||
|
time.sleep(5.0) |
||||||
|
|
@ -1,7 +1,7 @@ |
|||||||
{ |
{ |
||||||
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-4db25072191d24e204a816d73ac9e8c727822a26ed3baf01ecae18167fa2eb11.zip", |
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-7a0117425bc4a6673958d265312994e124654a566228f3cec2f0f9bc8120a9ab.zip", |
||||||
"ota_hash": "4db25072191d24e204a816d73ac9e8c727822a26ed3baf01ecae18167fa2eb11", |
"ota_hash": "7a0117425bc4a6673958d265312994e124654a566228f3cec2f0f9bc8120a9ab", |
||||||
"recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-31ef14206d3102edf18fb7417ef32ba2d9f37dd2f4443e234c374a70d1bf4662.img", |
"recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-3dc234d868c29a3739f6ca3bd47b1c2d3c570d9f478b6849a4fada129ee4af76.img", |
||||||
"recovery_len": 15136044, |
"recovery_len": 15848748, |
||||||
"recovery_hash": "31ef14206d3102edf18fb7417ef32ba2d9f37dd2f4443e234c374a70d1bf4662" |
"recovery_hash": "3dc234d868c29a3739f6ca3bd47b1c2d3c570d9f478b6849a4fada129ee4af76" |
||||||
} |
} |
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +1,9 @@ |
|||||||
from distutils.core import setup, Extension |
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module |
||||||
|
|
||||||
from Cython.Build import cythonize |
from Cython.Build import cythonize |
||||||
|
|
||||||
|
from common.cython_hacks import BuildExtWithoutPlatformSuffix |
||||||
|
|
||||||
setup(name='CAN Packer API Implementation', |
setup(name='CAN Packer API Implementation', |
||||||
|
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix}, |
||||||
ext_modules=cythonize(Extension("packer_impl", ["packer_impl.pyx"], language="c++", extra_compile_args=["-std=c++11"]))) |
ext_modules=cythonize(Extension("packer_impl", ["packer_impl.pyx"], language="c++", extra_compile_args=["-std=c++11"]))) |
||||||
|
@ -1 +0,0 @@ |
|||||||
PYTHONPATH=`realpath ../../../` python chryslercan_test.py |
|
@ -1,55 +1,57 @@ |
|||||||
from selfdrive.car.chrysler import chryslercan |
import unittest |
||||||
from selfdrive.can.packer import CANPacker |
|
||||||
|
|
||||||
from cereal import car |
from cereal import car |
||||||
|
from selfdrive.can.packer import CANPacker |
||||||
|
from selfdrive.car.chrysler import chryslercan |
||||||
|
|
||||||
VisualAlert = car.CarControl.HUDControl.VisualAlert |
VisualAlert = car.CarControl.HUDControl.VisualAlert |
||||||
|
GearShifter = car.CarState.GearShifter |
||||||
|
|
||||||
import unittest |
|
||||||
|
|
||||||
|
|
||||||
class TestChryslerCan(unittest.TestCase): |
class TestChryslerCan(unittest.TestCase): |
||||||
|
|
||||||
def test_checksum(self): |
def test_checksum(self): |
||||||
self.assertEqual(0x75, chryslercan.calc_checksum([0x01, 0x20])) |
self.assertEqual(0x75, chryslercan.calc_checksum(b"\x01\x20")) |
||||||
self.assertEqual(0xcc, chryslercan.calc_checksum([0x14, 0, 0, 0, 0x20])) |
self.assertEqual(0xcc, chryslercan.calc_checksum(b"\x14\x00\x00\x00\x20")) |
||||||
|
|
||||||
def test_hud(self): |
def test_hud(self): |
||||||
packer = CANPacker('chrysler_pacifica_2017_hybrid') |
packer = CANPacker('chrysler_pacifica_2017_hybrid') |
||||||
self.assertEqual( |
self.assertEqual( |
||||||
[0x2a6, 0, '0100010100000000'.decode('hex'), 0], |
[0x2a6, 0, b'\x01\x00\x01\x01\x00\x00\x00\x00', 0], |
||||||
chryslercan.create_lkas_hud( |
chryslercan.create_lkas_hud( |
||||||
packer, |
packer, |
||||||
'park', False, False, 1, 0)) |
GearShifter.park, False, False, 1, 0)) |
||||||
self.assertEqual( |
self.assertEqual( |
||||||
[0x2a6, 0, '0100010000000000'.decode('hex'), 0], |
[0x2a6, 0, b'\x01\x00\x01\x00\x00\x00\x00\x00', 0], |
||||||
chryslercan.create_lkas_hud( |
chryslercan.create_lkas_hud( |
||||||
packer, |
packer, |
||||||
'park', False, False, 5*4, 0)) |
GearShifter.park, False, False, 5*4, 0)) |
||||||
self.assertEqual( |
self.assertEqual( |
||||||
[0x2a6, 0, '0100010000000000'.decode('hex'), 0], |
[0x2a6, 0, b'\x01\x00\x01\x00\x00\x00\x00\x00', 0], |
||||||
chryslercan.create_lkas_hud( |
chryslercan.create_lkas_hud( |
||||||
packer, |
packer, |
||||||
'park', False, False, 99999, 0)) |
GearShifter.park, False, False, 99999, 0)) |
||||||
self.assertEqual( |
self.assertEqual( |
||||||
[0x2a6, 0, '0200060000000000'.decode('hex'), 0], |
[0x2a6, 0, b'\x02\x00\x06\x00\x00\x00\x00\x00', 0], |
||||||
chryslercan.create_lkas_hud( |
chryslercan.create_lkas_hud( |
||||||
packer, |
packer, |
||||||
'drive', True, False, 99999, 0)) |
GearShifter.drive, True, False, 99999, 0)) |
||||||
self.assertEqual( |
self.assertEqual( |
||||||
[0x2a6, 0, '0264060000000000'.decode('hex'), 0], |
[0x2a6, 0, b'\x02\x64\x06\x00\x00\x00\x00\x00', 0], |
||||||
chryslercan.create_lkas_hud( |
chryslercan.create_lkas_hud( |
||||||
packer, |
packer, |
||||||
'drive', True, False, 99999, 0x64)) |
GearShifter.drive, True, False, 99999, 0x64)) |
||||||
|
|
||||||
def test_command(self): |
def test_command(self): |
||||||
packer = CANPacker('chrysler_pacifica_2017_hybrid') |
packer = CANPacker('chrysler_pacifica_2017_hybrid') |
||||||
self.assertEqual( |
self.assertEqual( |
||||||
[0x292, 0, '140000001086'.decode('hex'), 0], |
[0x292, 0, b'\x14\x00\x00\x00\x10\x86', 0], |
||||||
chryslercan.create_lkas_command( |
chryslercan.create_lkas_command( |
||||||
packer, |
packer, |
||||||
0, True, 1)) |
0, True, 1)) |
||||||
self.assertEqual( |
self.assertEqual( |
||||||
[0x292, 0, '040000008083'.decode('hex'), 0], |
[0x292, 0, b'\x04\x00\x00\x00\x80\x83', 0], |
||||||
chryslercan.create_lkas_command( |
chryslercan.create_lkas_command( |
||||||
packer, |
packer, |
||||||
0, False, 8)) |
0, False, 8)) |
@ -1,18 +1,5 @@ |
|||||||
#!/usr/bin/env python |
#!/usr/bin/env python3 |
||||||
import os |
from selfdrive.car.interfaces import RadarInterfaceBase |
||||||
import time |
|
||||||
from cereal import car |
|
||||||
|
|
||||||
class RadarInterface(object): |
class RadarInterface(RadarInterfaceBase): |
||||||
def __init__(self, CP): |
pass |
||||||
# radar |
|
||||||
self.pts = {} |
|
||||||
self.delay = 0.1 |
|
||||||
|
|
||||||
def update(self, can_strings): |
|
||||||
ret = car.RadarData.new_message() |
|
||||||
|
|
||||||
if 'NO_RADAR_SLEEP' not in os.environ: |
|
||||||
time.sleep(0.05) # radard runs on RI updates |
|
||||||
|
|
||||||
return ret |
|
||||||
|
@ -0,0 +1,39 @@ |
|||||||
|
import os |
||||||
|
import time |
||||||
|
from cereal import car |
||||||
|
from selfdrive.car import gen_empty_fingerprint |
||||||
|
|
||||||
|
# generic car and radar interfaces |
||||||
|
|
||||||
|
class CarInterfaceBase(): |
||||||
|
def __init__(self, CP, CarController): |
||||||
|
pass |
||||||
|
|
||||||
|
@staticmethod |
||||||
|
def calc_accel_override(a_ego, a_target, v_ego, v_target): |
||||||
|
return 1. |
||||||
|
|
||||||
|
@staticmethod |
||||||
|
def get_params(candidate, fingerprint=gen_empty_fingerprint(), vin="", has_relay=False): |
||||||
|
raise NotImplementedError |
||||||
|
|
||||||
|
# returns a car.CarState, pass in car.CarControl |
||||||
|
def update(self, c, can_strings): |
||||||
|
raise NotImplementedError |
||||||
|
|
||||||
|
# return sendcan, pass in a car.CarControl |
||||||
|
def apply(self, c): |
||||||
|
raise NotImplementedError |
||||||
|
|
||||||
|
class RadarInterfaceBase(): |
||||||
|
def __init__(self, CP): |
||||||
|
self.pts = {} |
||||||
|
self.delay = 0 |
||||||
|
|
||||||
|
def update(self, can_strings): |
||||||
|
ret = car.RadarData.new_message() |
||||||
|
|
||||||
|
if 'NO_RADAR_SLEEP' not in os.environ: |
||||||
|
time.sleep(0.05) # radard runs on RI updates |
||||||
|
|
||||||
|
return ret |
@ -1,15 +1,5 @@ |
|||||||
#!/usr/bin/env python |
#!/usr/bin/env python3 |
||||||
from cereal import car |
from selfdrive.car.interfaces import RadarInterfaceBase |
||||||
import time |
|
||||||
|
|
||||||
|
class RadarInterface(RadarInterfaceBase): |
||||||
class RadarInterface(object): |
pass |
||||||
def __init__(self, CP): |
|
||||||
# radar |
|
||||||
self.pts = {} |
|
||||||
self.delay = 0.1 |
|
||||||
|
|
||||||
def update(self, can_strings): |
|
||||||
ret = car.RadarData.new_message() |
|
||||||
time.sleep(0.05) # radard runs on RI updates |
|
||||||
return ret |
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue