Compare commits

...

8 Commits

Author SHA1 Message Date
Eric Brown a2b27fc469 Bump opendbc 2025-07-04 22:15:16 -06:00
firestar5683 1012d0e558 Fix Redneck and Pedal (#125) 2025-07-04 16:40:47 -06:00
Eric Brown 9cbe58f879 Enable debian 2025-05-22 10:14:31 -06:00
Eric Brown dedc14ea14 Add new readme
# Conflicts:
#	README.md
2025-05-22 10:14:24 -06:00
Eric Brown 6b6c20ab7f Fix unit test for v cruise helper 2025-05-22 10:13:54 -06:00
Eric Brown e5e212c8ca CC long tweaks 2025-05-22 10:13:54 -06:00
Eric Brown 92278391be Reconfigure CI 2025-05-22 10:13:54 -06:00
Eric Brown 3e5abf47d3 Update release configuration 2025-05-22 10:13:54 -06:00
12 changed files with 128 additions and 168 deletions
+42 -49
View File
@@ -30,46 +30,45 @@ env:
PYTEST: pytest --continue-on-collection-errors --cov --cov-report=xml --cov-append --durations=0 --durations-min=5 --hypothesis-seed 0 -n logical
jobs:
build_release:
name: build release
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
# build_release:
# name: build release
# runs-on:
# - ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
env:
STRIPPED_DIR: /tmp/releasepilot
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Getting LFS files
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e
with:
timeout_minutes: 2
max_attempts: 3
command: git lfs pull
- name: Build devel
timeout-minutes: 1
run: TARGET_DIR=$STRIPPED_DIR release/build_devel.sh
- uses: ./.github/workflows/setup-with-retry
- name: Build openpilot and run checks
timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 10 || 30) }} # allow more time when we missed the scons cache
run: |
cd $STRIPPED_DIR
${{ env.RUN }} "python3 system/manager/build.py"
- name: Run tests
timeout-minutes: 1
run: |
cd $STRIPPED_DIR
${{ env.RUN }} "release/check-dirty.sh"
- name: Check submodules
if: github.repository == 'commaai/openpilot'
timeout-minutes: 3
run: release/check-submodules.sh
# env:
# STRIPPED_DIR: /tmp/releasepilot
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - name: Getting LFS files
# uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e
# with:
# timeout_minutes: 2
# max_attempts: 3
# command: git lfs pull
# - name: Build devel
# timeout-minutes: 1
# run: TARGET_DIR=$STRIPPED_DIR release/build_devel.sh
# - uses: ./.github/workflows/setup-with-retry
# - name: Build openpilot and run checks
# timeout-minutes: ${{ ((steps.restore-scons-cache.outputs.cache-hit == 'true') && 10 || 30) }} # allow more time when we missed the scons cache
# run: |
# cd $STRIPPED_DIR
# ${{ env.RUN }} "python3 system/manager/build.py"
# - name: Run tests
# timeout-minutes: 1
# run: |
# cd $STRIPPED_DIR
# ${{ env.RUN }} "release/check-dirty.sh"
# - name: Check submodules
# if: github.repository == 'commaai/openpilot'
# timeout-minutes: 3
# run: release/check-submodules.sh
build:
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
- 'ubuntu-24.04'
steps:
- uses: actions/checkout@v4
with:
@@ -85,7 +84,7 @@ jobs:
build_mac:
name: build macOS
runs-on: ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-macos-8x14' || 'macos-latest' }}
runs-on: 'macos-latest'
steps:
- uses: actions/checkout@v4
with:
@@ -119,8 +118,7 @@ jobs:
static_analysis:
name: static analysis
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
- 'ubuntu-24.04'
env:
PYTHONWARNINGS: default
steps:
@@ -135,8 +133,7 @@ jobs:
unit_tests:
name: unit tests
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
- 'ubuntu-24.04'
steps:
- uses: actions/checkout@v4
with:
@@ -162,8 +159,7 @@ jobs:
process_replay:
name: process replay
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
- 'ubuntu-24.04'
steps:
- uses: actions/checkout@v4
with:
@@ -215,8 +211,7 @@ jobs:
test_cars:
name: cars
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
- 'ubuntu-24.04'
strategy:
fail-fast: false
matrix:
@@ -307,8 +302,7 @@ jobs:
simulator_driving:
name: simulator driving
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
- 'ubuntu-24.04'
if: (github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))
steps:
- uses: actions/checkout@v4
@@ -329,8 +323,7 @@ jobs:
# This job name needs to be the same as UI_JOB_NAME in ui_preview.yaml
name: Create UI Report
runs-on:
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-profile-amd64-8x16' || 'ubuntu-24.04' }}
- ${{ ((github.repository == 'commaai/openpilot') && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == 'commaai/openpilot'))) && 'namespace-experiments:docker.builds.local-cache=separate' || 'ubuntu-24.04' }}
- 'ubuntu-24.04'
if: false # FIXME: FrameReader is broken on CI runners
steps:
- uses: actions/checkout@v4
+35 -83
View File
@@ -1,110 +1,62 @@
<div align="center" style="text-align: center;">
# OPGM: openpilot for Unsupported GM Cars
<h1>openpilot</h1>
OPGM is a fork of [openpilot](https://github.com/commaai/openpilot/), the open source driver assistance system by comma.ai. This fork enables support for GM vehicles that are not officially supported upstream, while staying as close as possible to stock openpilot behavior.
<p>
<b>openpilot is an operating system for robotics.</b>
<br>
Currently, it upgrades the driver assistance system in 300+ supported cars.
</p>
> OPGM strives to be **"stock openpilot for unsupported GM cars."**
<h3>
<a href="https://docs.comma.ai">Docs</a>
<span> · </span>
<a href="https://docs.comma.ai/contributing/roadmap/">Roadmap</a>
<span> · </span>
<a href="https://github.com/commaai/openpilot/blob/master/docs/CONTRIBUTING.md">Contribute</a>
<span> · </span>
<a href="https://discord.comma.ai">Community</a>
<span> · </span>
<a href="https://comma.ai/shop">Try it on a comma 3X</a>
</h3>
To achieve this, OPGM follows these development guidelines:
Quick start: `bash <(curl -fsSL openpilot.comma.ai)`
1. **Non-GM code is never modified** by OPGM. Shared/common code is modified only when absolutely necessary.
2. **Upstream-supported GM vehicles** are only patched to enable additional functionality (e.g., stop-and-go support, lower min engagement speed).
3. **Control schemes already supported by upstream openpilot** must not be modified. Alternate control schemes, such as `pedal long` or `CC long`, are exempt from this rule.
[![openpilot tests](https://github.com/commaai/openpilot/actions/workflows/selfdrive_tests.yaml/badge.svg)](https://github.com/commaai/openpilot/actions/workflows/selfdrive_tests.yaml)
[![codecov](https://codecov.io/gh/commaai/openpilot/branch/master/graph/badge.svg)](https://codecov.io/gh/commaai/openpilot)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![X Follow](https://img.shields.io/twitter/follow/comma_ai)](https://x.com/comma_ai)
[![Discord](https://img.shields.io/discord/469524606043160576)](https://discord.comma.ai)
For general openpilot documentation, setup, and developer guidance, refer to the [official openpilot repo](https://github.com/commaai/openpilot/).
</div>
---
<table>
<tr>
<td><a href="https://youtu.be/NmBfgOanCyk" title="Video By Greer Viau"><img src="https://github.com/commaai/openpilot/assets/8762862/2f7112ae-f748-4f39-b617-fabd689c3772"></a></td>
<td><a href="https://youtu.be/VHKyqZ7t8Gw" title="Video By Logan LeGrand"><img src="https://github.com/commaai/openpilot/assets/8762862/92351544-2833-40d7-9e0b-7ef7ae37ec4c"></a></td>
<td><a href="https://youtu.be/SUIZYzxtMQs" title="A drive to Taco Bell"><img src="https://github.com/commaai/openpilot/assets/8762862/05ceefc5-2628-439c-a9b2-89ce77dc6f63"></a></td>
</tr>
</table>
## Features
- Support for GM Global A vehicles with LKAS but no ACC
- `pedal long`: Longitudinal control using a pedal interceptor
- Enables full regenerative braking on Bolt EV/EUV (even those with ACC)
- `CC long`: Non-ACC cruise control adjustment, aka [“redneck ACC”](https://www.youtube.com/watch?v=41wZ1EAmf94)
- ⚠️ Cannot reduce speed below stock cruise control limits (usually 24mph)
Using openpilot in a car
------
---
To use openpilot in a car, you need four things:
1. **Supported Device:** a comma 3/3X, available at [comma.ai/shop](https://comma.ai/shop/comma-3x).
2. **Software:** The setup procedure for the comma 3/3X allows users to enter a URL for custom software. Use the URL `openpilot.comma.ai` to install the release version.
3. **Supported Car:** Ensure that you have one of [the 275+ supported cars](docs/CARS.md).
4. **Car Harness:** You will also need a [car harness](https://comma.ai/shop/car-harness) to connect your comma 3/3X to your car.
## Supported Vehicles
We have detailed instructions for [how to install the harness and device in a car](https://comma.ai/setup). Note that it's possible to run openpilot on [other hardware](https://blog.comma.ai/self-driving-car-for-free/), although it's not plug-and-play.
Support is focused on GM Global A vehicles with factory LKAS. For the latest list, see [CARS.md](https://github.com/opgm/opendbc/blob/master/docs/CARS.md)
### Branches
| branch | URL | description |
|------------------|----------------------------------------|-------------------------------------------------------------------------------------|
| `release3` | openpilot.comma.ai | This is openpilot's release branch. |
| `release3-staging` | openpilot-test.comma.ai | This is the staging branch for releases. Use it to get new releases slightly early. |
| `nightly` | openpilot-nightly.comma.ai | This is the bleeding edge development branch. Do not expect this to be stable. |
| `nightly-dev` | installer.comma.ai/commaai/nightly-dev | Same as nightly, but includes experimental development features for some cars. |
| `secretgoodopenpilot` | installer.comma.ai/commaai/secretgoodopenpilot | This is a preview branch from the autonomy team where new driving models get merged earlier than master. |
If your vehicle isnt listed, but has LKAS and a front-facing camera, it might still be supported or supportable. See the “contributing” section below.
To start developing openpilot
------
---
openpilot is developed by [comma](https://comma.ai/) and by users like you. We welcome both pull requests and issues on [GitHub](http://github.com/commaai/openpilot).
## Installation
* Join the [community Discord](https://discord.comma.ai)
* Check out [the contributing docs](docs/CONTRIBUTING.md)
* Check out the [openpilot tools](tools/)
* Read about the [development workflow](docs/WORKFLOW.md)
* Code documentation lives at https://docs.comma.ai
* Information about running openpilot lives on the [community wiki](https://github.com/commaai/openpilot/wiki)
Hardware installation is the same as for any vehicle with the standard GM harness in upstream openpilot.
Want to get paid to work on openpilot? [comma is hiring](https://comma.ai/jobs#open-positions) and offers lots of [bounties](https://comma.ai/bounties) for external contributors.
For software installation, type `opgm/release` into the custom software field, or `opgm/nightly` if you want to live on the bleeding edge.
Safety and Testing
----
> **Note:** For EVs without ACC, a [pedal interceptor](https://www.etsy.com/listing/952895642/openpilot-comma-pedal-non-customizable?variation0=3013902165) is **strongly recommended** for a better experience.
* openpilot observes [ISO26262](https://en.wikipedia.org/wiki/ISO_26262) guidelines, see [SAFETY.md](docs/SAFETY.md) for more details.
* openpilot has software-in-the-loop [tests](.github/workflows/selfdrive_tests.yaml) that run on every commit.
* The code enforcing the safety model lives in panda and is written in C, see [code rigor](https://github.com/commaai/panda#code-rigor) for more details.
* panda has software-in-the-loop [safety tests](https://github.com/commaai/panda/tree/master/tests/safety).
* Internally, we have a hardware-in-the-loop Jenkins test suite that builds and unit tests the various processes.
* panda has additional hardware-in-the-loop [tests](https://github.com/commaai/panda/blob/master/Jenkinsfile).
* We run the latest openpilot in a testing closet containing 10 comma devices continuously replaying routes.
---
<details>
<summary>MIT Licensed</summary>
## Contributing
openpilot is released under the MIT license. Some parts of the software are released under other licenses as specified.
All development occurs on the `master` branch. Contributions are welcome: feel free to open a PR.
Any user of this software shall indemnify and hold harmless Comma.ai, Inc. and its directors, officers, employees, agents, stockholders, affiliates, subcontractors and customers from and against all allegations, claims, actions, suits, demands, damages, liabilities, obligations, losses, settlements, judgments, costs and expenses (including without limitation attorneys fees and costs) which arise out of, relate to or result from any use of this software by user.
Bug reports and vehicle porting discussions happen in the OPGM channel on the [openpilot community Discord](https://discord.gg/KGWEdwSnCU).
**THIS IS ALPHA QUALITY SOFTWARE FOR RESEARCH PURPOSES ONLY. THIS IS NOT A PRODUCT.
YOU ARE RESPONSIBLE FOR COMPLYING WITH LOCAL LAWS AND REGULATIONS.
NO WARRANTY EXPRESSED OR IMPLIED.**
</details>
---
<details>
<summary>User Data and comma Account</summary>
## Known Issues
By default, openpilot uploads the driving data to our servers. You can also access your data through [comma connect](https://connect.comma.ai/). We use your data to train better models and improve openpilot for everyone.
- Curve hugging and lane line drift are inherited from upstream openpilot.
- Upstream-supported GM cars (e.g. ACC Volt/Bolt) may fail to fingerprint automatically in OPGM.
openpilot is open source software: the user is free to disable data collection if they wish to do so.
---
openpilot logs the road-facing cameras, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs.
The driver-facing camera is only logged if you explicitly opt-in in settings. The microphone is not recorded.
## License
By using openpilot, you agree to [our Privacy Policy](https://comma.ai/privacy). You understand that use of this software or its related services will generate certain types of user data, which may be logged and stored at the sole discretion of comma. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma for the use of this data.
</details>
Licensed under the MIT License. See [LICENSE](LICENSE) for details.
+2 -2
View File
@@ -25,7 +25,7 @@ rm -rf $BUILD_DIR
mkdir -p $BUILD_DIR
cd $BUILD_DIR
git init
git remote add origin git@github.com:commaai/openpilot.git
git remote add origin git@github.com:opgm/openpilot.git
git checkout --orphan $RELEASE_BRANCH
# do the files copy
@@ -91,7 +91,7 @@ git commit --amend -m "openpilot v$VERSION"
# Run tests
cd $BUILD_DIR
RELEASE=1 pytest -n0 -s selfdrive/test/test_onroad.py
#RELEASE=1 pytest -n0 -s selfdrive/test/test_onroad.py
#pytest selfdrive/car/tests/test_car_interfaces.py
if [ ! -z "$RELEASE_BRANCH" ]; then
+2 -2
View File
@@ -1,4 +1,4 @@
export GIT_COMMITTER_NAME="Vehicle Researcher"
export GIT_COMMITTER_NAME="OPGM CI Automated"
export GIT_COMMITTER_EMAIL="user@comma.ai"
export GIT_AUTHOR_NAME="Vehicle Researcher"
export GIT_AUTHOR_NAME="OPGM CI Automated"
export GIT_AUTHOR_EMAIL="user@comma.ai"
+5 -1
View File
@@ -1,6 +1,7 @@
from cereal import car, log
import cereal.messaging as messaging
from opendbc.car import DT_CTRL, structs
from opendbc.car.gm.values import GMFlags
from opendbc.car.interfaces import MAX_CTRL_SPEED
from opendbc.car.volkswagen.values import CarControllerParams as VWCarControllerParams
@@ -103,11 +104,14 @@ class CarSpecificEvents:
if CS.vEgo < self.CP.minEnableSpeed and not (CS.standstill and CS.brake >= 20 and
self.CP.networkLocation == NetworkLocation.fwdCamera):
events.add(EventName.belowEngageSpeed)
if CS.cruiseState.standstill:
if CS.cruiseState.standstill and not self.CP.autoResumeSng:
events.add(EventName.resumeRequired)
if CS.vEgo < self.CP.minSteerSpeed:
events.add(EventName.belowSteerSpeed)
if (self.CP.flags & GMFlags.CC_LONG) and CS.vEgo < self.CP.minEnableSpeed and CS.cruiseState.enabled:
events.add(EventName.speedTooLow)
elif self.CP.brand == 'volkswagen':
events = self.create_common_events(CS, CS_prev, extra_gears=[GearShifter.eco, GearShifter.sport, GearShifter.manumatic],
pcm_enable=self.CP.pcmCruise)
+8 -2
View File
@@ -11,7 +11,7 @@ from openpilot.common.params import Params
from openpilot.common.realtime import config_realtime_process, Priority, Ratekeeper
from openpilot.common.swaglog import cloudlog, ForwardingHandler
from opendbc.car import DT_CTRL, structs
from opendbc.car import DT_CTRL, structs, ButtonType
from opendbc.car.can_definitions import CanData, CanRecvCallable, CanSendCallable
from opendbc.car.carlog import carlog
from opendbc.car.fw_versions import ObdCallback
@@ -73,6 +73,7 @@ class Car:
self.CC_prev = car.CarControl.new_message()
self.CS_prev = car.CarState.new_message()
self.initialized_prev = False
self.resume_prev_button = False
self.last_actuators_output = structs.CarControl.Actuators()
@@ -185,12 +186,17 @@ class Car:
self.v_cruise_helper.update_v_cruise(CS, self.sm['carControl'].enabled, self.is_metric)
if self.sm['carControl'].enabled and not self.CC_prev.enabled:
# Use CarState w/ buttons from the step selfdrived enables on
self.v_cruise_helper.initialize_v_cruise(self.CS_prev, self.experimental_mode)
self.v_cruise_helper.initialize_v_cruise(self.CS_prev, self.experimental_mode, self.resume_prev_button)
# TODO: mirror the carState.cruiseState struct?
CS.vCruise = float(self.v_cruise_helper.v_cruise_kph)
CS.vCruiseCluster = float(self.v_cruise_helper.v_cruise_cluster_kph)
if any(be.type in (ButtonType.accelCruise, ButtonType.resumeCruise) for be in CS.buttonEvents):
self.resume_prev_button = True
elif any(be.type in (ButtonType.decelCruise, ButtonType.setCruise) for be in CS.buttonEvents):
self.resume_prev_button = False
return CS, RD
def state_publish(self, CS: car.CarState, RD: structs.RadarDataT | None):
+7 -4
View File
@@ -2,6 +2,7 @@ import math
import numpy as np
from cereal import car
from opendbc.car.gm.values import CC_ONLY_CAR, GMFlags
from openpilot.common.conversions import Conversions as CV
@@ -31,6 +32,7 @@ CRUISE_INTERVAL_SIGN = {
class VCruiseHelper:
def __init__(self, CP):
self.CP = CP
self.gm_cc_only = self.CP.carFingerprint in CC_ONLY_CAR and self.CP.flags & GMFlags.CC_LONG.value
self.v_cruise_kph = V_CRUISE_UNSET
self.v_cruise_cluster_kph = V_CRUISE_UNSET
self.v_cruise_kph_last = 0
@@ -45,7 +47,7 @@ class VCruiseHelper:
self.v_cruise_kph_last = self.v_cruise_kph
if CS.cruiseState.available:
if not self.CP.pcmCruise:
if self.gm_cc_only or not self.CP.pcmCruise:
# if stock cruise is completely disabled, then we can use our own set speed logic
self._update_v_cruise_non_pcm(CS, enabled, is_metric)
self.v_cruise_cluster_kph = self.v_cruise_kph
@@ -123,14 +125,15 @@ class VCruiseHelper:
self.button_timers[b.type.raw] = 1 if b.pressed else 0
self.button_change_states[b.type.raw] = {"standstill": CS.cruiseState.standstill, "enabled": enabled}
def initialize_v_cruise(self, CS, experimental_mode: bool) -> None:
def initialize_v_cruise(self, CS, experimental_mode: bool, resume_prev_button: bool) -> None:
# initializing is handled by the PCM
if self.CP.pcmCruise:
if self.CP.pcmCruise and not self.gm_cc_only:
return
initial = V_CRUISE_INITIAL_EXPERIMENTAL_MODE if experimental_mode else V_CRUISE_INITIAL
if any(b.type in (ButtonType.accelCruise, ButtonType.resumeCruise) for b in CS.buttonEvents) and self.v_cruise_initialized:
if (any(b.type in (ButtonType.accelCruise, ButtonType.resumeCruise) for b in CS.buttonEvents)
and self.v_cruise_initialized or (self.gm_cc_only and resume_prev_button)):
self.v_cruise_kph = self.v_cruise_kph_last
else:
self.v_cruise_kph = int(round(np.clip(CS.vEgo * CV.MS_TO_KPH, initial, V_CRUISE_MAX)))
+1 -1
View File
@@ -59,7 +59,7 @@ class TestVCruiseHelper:
def enable(self, v_ego, experimental_mode):
# Simulates user pressing set with a current speed
self.v_cruise_helper.initialize_v_cruise(car.CarState(vEgo=v_ego), experimental_mode)
self.v_cruise_helper.initialize_v_cruise(car.CarState(vEgo=v_ego), experimental_mode, False)
def test_adjust_speed(self):
"""
+22 -22
View File
@@ -1,22 +1,22 @@
import os
from openpilot.common.basedir import BASEDIR
from opendbc.car.docs import generate_cars_md, get_all_car_docs
from openpilot.selfdrive.debug.dump_car_docs import dump_car_docs
from openpilot.selfdrive.debug.print_docs_diff import print_car_docs_diff
from openpilot.selfdrive.car.docs import CARS_MD_TEMPLATE
class TestCarDocs:
@classmethod
def setup_class(cls):
cls.all_cars = get_all_car_docs()
def test_generator(self):
generate_cars_md(self.all_cars, CARS_MD_TEMPLATE)
def test_docs_diff(self):
dump_path = os.path.join(BASEDIR, "selfdrive", "car", "tests", "cars_dump")
dump_car_docs(dump_path)
print_car_docs_diff(dump_path)
os.remove(dump_path)
# import os
#
# from openpilot.common.basedir import BASEDIR
# from opendbc.car.docs import generate_cars_md, get_all_car_docs
# from openpilot.selfdrive.debug.dump_car_docs import dump_car_docs
# from openpilot.selfdrive.debug.print_docs_diff import print_car_docs_diff
# from openpilot.selfdrive.car.docs import CARS_MD_TEMPLATE
#
#
# class TestCarDocs:
# @classmethod
# def setup_class(cls):
# cls.all_cars = get_all_car_docs()
#
# def test_generator(self):
# generate_cars_md(self.all_cars, CARS_MD_TEMPLATE)
#
# def test_docs_diff(self):
# dump_path = os.path.join(BASEDIR, "selfdrive", "car", "tests", "cars_dump")
# dump_car_docs(dump_path)
# print_car_docs_diff(dump_path)
# os.remove(dump_path)
+2
View File
@@ -113,6 +113,8 @@ class Controls:
pid_accel_limits = self.CI.get_pid_accel_limits(self.CP, CS.vEgo, CS.vCruise * CV.KPH_TO_MS)
actuators.accel = float(self.LoC.update(CC.longActive, CS, long_plan.aTarget, long_plan.shouldStop, pid_accel_limits))
if len(long_plan.speeds):
actuators.speed = long_plan.speeds[-1]
# Steering PID loop and lateral MPC
# Reset desired curvature to current to avoid violating the limits on engage
new_desired_curvature = model_v2.action.desiredCurvature if CC.latActive else self.curvature
+1 -1
View File
@@ -127,7 +127,7 @@ function op_check_os() {
if [ -f "/etc/os-release" ]; then
source /etc/os-release
case "$VERSION_CODENAME" in
"jammy" | "kinetic" | "noble" | "focal")
"jammy" | "kinetic" | "noble" | "focal" | "trixie")
echo -e " ↳ [${GREEN}${NC}] Ubuntu $VERSION_CODENAME detected."
;;
* )