mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-12-03 16:23:47 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cc2fd49db5 | |||
| 89881bd50b | |||
| 1d8788e9d5 | |||
| 5966b94504 | |||
| 64bce9668c |
@@ -194,7 +194,7 @@ jobs:
|
||||
find . -name '__pycache__' -type d -exec rm -rf {} +
|
||||
find . -name 'SConstruct' -delete
|
||||
find . -name 'SConscript' -delete
|
||||
rm -rf .sconsign.dblite Jenkinsfile tools/release/ release/
|
||||
rm -rf .sconsign.dblite tools/release/ release/
|
||||
rm -f openpilot/selfdrive/modeld/models/*.onnx*
|
||||
rm -f openpilot/sunnypilot/modeld*/models/*.onnx*
|
||||
find openpilot/third_party/ -name '*x86*' -exec rm -r {} +
|
||||
|
||||
@@ -3,8 +3,6 @@ name: Build dev
|
||||
env:
|
||||
DEFAULT_SOURCE_BRANCH: "master"
|
||||
DEFAULT_TARGET_BRANCH: "master-dev"
|
||||
LFS_URL: 'https://gitlab.com/sunnypilot/public/sunnypilot-new-lfs.git/info/lfs'
|
||||
LFS_PUSH_URL: 'ssh://git@gitlab.com/sunnypilot/public/sunnypilot-new-lfs.git'
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -66,15 +64,6 @@ jobs:
|
||||
git config --global user.name 'github-actions[bot]'
|
||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
|
||||
- name: Set up SSH
|
||||
uses: webfactory/ssh-agent@v0.9.0
|
||||
with:
|
||||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
|
||||
- name: Add GitLab public keys
|
||||
run: |
|
||||
ssh-keyscan -H gitlab.com >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
@@ -167,13 +156,6 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Update LFS Config
|
||||
run: |
|
||||
echo '[lfs]' > .lfsconfig
|
||||
echo ' url = ${{ env.LFS_URL }}' >> .lfsconfig
|
||||
echo ' pushurl = ${{ env.LFS_PUSH_URL }}' >> .lfsconfig
|
||||
echo ' locksverify = false' >> .lfsconfig
|
||||
|
||||
- name: Restore workflows from source
|
||||
run: |
|
||||
TARGET_BRANCH="${{ inputs.target_branch || env.DEFAULT_TARGET_BRANCH }}"
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
[lfs]
|
||||
url = https://gitlab.com/commaai/openpilot-lfs.git/info/lfs
|
||||
pushurl = ssh://git@gitlab.com/commaai/openpilot-lfs.git
|
||||
locksverify = false
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:962396e7909556af6a9c7bfb7ad6db01a8d2c8da0760379eb71efda004cb3548
|
||||
size 69699272
|
||||
oid sha256:cb378ef6182cc184bce539bd3868f4e4cf537e90d7520b3be58919e6cf4f3de1
|
||||
size 89835686
|
||||
|
||||
@@ -52,7 +52,13 @@ std::vector<std::string> PandaSafety::fetchCarParams() {
|
||||
if (!params_.getBool("ControlsReady")) {
|
||||
return {};
|
||||
}
|
||||
return {params_.get("CarParams"), params_.get("CarParamsSP")};
|
||||
|
||||
std::string car_params = params_.get("CarParams");
|
||||
std::string car_params_sp = params_.get("CarParamsSP");
|
||||
if (car_params.empty() || car_params_sp.empty()) {
|
||||
return {};
|
||||
}
|
||||
return {car_params, car_params_sp};
|
||||
}
|
||||
|
||||
// TODO-SP: Use structs instead of vector
|
||||
|
||||
@@ -8,6 +8,8 @@ import numpy as np
|
||||
|
||||
from openpilot.common.transformations.camera import DEVICE_CAMERAS
|
||||
|
||||
MAX_CAMERA_OFFSET = 0.35 # m, the settings' range
|
||||
|
||||
|
||||
class CameraOffsetHelper:
|
||||
def __init__(self):
|
||||
@@ -34,6 +36,13 @@ class CameraOffsetHelper:
|
||||
def set_offset(self, offset):
|
||||
self.camera_offset = offset
|
||||
|
||||
def load_offset(self, params):
|
||||
offset = params.get("CameraOffset", return_default=True)
|
||||
if offset is None or not np.isfinite(offset) or abs(offset) > MAX_CAMERA_OFFSET + 1e-6: # older sunnypilot stored whole centimeters
|
||||
offset = 0.0
|
||||
params.put("CameraOffset", offset)
|
||||
self.set_offset(offset)
|
||||
|
||||
def update(self, model_transform_main, model_transform_extra, sm, main_wide_camera):
|
||||
self.actual_camera_offset = (0.9 * self.actual_camera_offset) + (0.1 * self.camera_offset)
|
||||
dc = DEVICE_CAMERAS[(str(sm['deviceState'].deviceType), str(sm['narrowRoadCameraState'].sensor))]
|
||||
|
||||
@@ -424,7 +424,7 @@ def main(demo=False):
|
||||
if sm.frame % 60 == 0:
|
||||
model.lat_delay = get_lat_delay(params, sm["lateralDelay"].lateralDelay)
|
||||
model.PLANPLUS_CONTROL = params.get("PlanplusControl", return_default=True)
|
||||
camera_offset_helper.set_offset(params.get("CameraOffset", return_default=True))
|
||||
camera_offset_helper.load_offset(params)
|
||||
blendful_enabled = params.get_bool("Blendful")
|
||||
lat_delay = model.lat_delay + model.LAT_SMOOTH_SECONDS
|
||||
if sm.updated["extrinsicsCalibration"] and sm.seen['narrowRoadCameraState'] and sm.seen['deviceState']:
|
||||
|
||||
@@ -27,6 +27,18 @@ class TestCameraOffset(OpenpilotTestCase):
|
||||
self.camera_offset = CameraOffsetHelper()
|
||||
self.dc = DEVICE_CAMERAS[('mici', 'os04c10')]
|
||||
|
||||
def test_load_offset_resets_out_of_range(self):
|
||||
class Params:
|
||||
def __init__(self, v): self.v = v
|
||||
def get(self, key, return_default=False): return self.v
|
||||
def put(self, key, v): self.v = v
|
||||
|
||||
for stored, used in ((0.2, 0.2), (-0.35, -0.35), (4.0, 0.0), (-35.0, 0.0), (float('nan'), 0.0), (None, 0.0)):
|
||||
params = Params(stored)
|
||||
self.camera_offset.load_offset(params)
|
||||
assert self.camera_offset.camera_offset == used
|
||||
assert params.v == (stored if used == stored else 0.0)
|
||||
|
||||
def test_smoothing(self):
|
||||
self.camera_offset.set_offset(0.2)
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ def generate_model(driving_pkl: Path) -> dict:
|
||||
artifact_data = {
|
||||
"file_name": driving_pkl.name,
|
||||
"download_uri": {
|
||||
"url": "https://gitlab.com/sunnypilot/public/docs.sunnypilot.ai/-/raw/main/",
|
||||
"url": "",
|
||||
"sha256": tinygrad_hash
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user