mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-07 00:23:42 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6170955afc |
-162
@@ -1,162 +0,0 @@
|
|||||||
# Credits and Code Provenance
|
|
||||||
|
|
||||||
StarPilot stands on work by comma.ai, FrogPilot, and many other open-source contributors. This
|
|
||||||
document records provenance that is not adequately represented by StarPilot's historical commit
|
|
||||||
authorship. It is not an assertion that an upstream contributor endorses, maintains, or is
|
|
||||||
responsible for StarPilot's adaptation.
|
|
||||||
|
|
||||||
## Ford support adapted from BluePilot
|
|
||||||
|
|
||||||
StarPilot commit [`3f6ccd104e826643887930b41ad3b4086b833d32`](https://github.com/firestar5683/StarPilot/commit/3f6ccd104e826643887930b41ad3b4086b833d32)
|
|
||||||
introduced a substantial adaptation of Ford work from BluePilot's `bp-7.0` branch. That commit's
|
|
||||||
message thanked the project, but it did not record a source revision or preserve the upstream
|
|
||||||
authors in the code. This file corrects that provenance gap without rewriting published history.
|
|
||||||
|
|
||||||
The exact checkout used for the original port was not recorded and therefore cannot now be proven.
|
|
||||||
At the time of the import,
|
|
||||||
[`3a838bba6d3d280592c2fd0496b3378977ae25f1`](https://github.com/BluePilotDev/bluepilot/commit/3a838bba6d3d280592c2fd0496b3378977ae25f1),
|
|
||||||
was the tip of the public `bp-7.0` line. Some imported platform lines instead trace to the
|
|
||||||
contemporaneous development line at
|
|
||||||
[`59e3f2f16a38ff0c16d173b0ccddded23aaa1cd8`](https://github.com/BluePilotDev/bluepilot/commit/59e3f2f16a38ff0c16d173b0ccddded23aaa1cd8).
|
|
||||||
Those histories were merged the next day as
|
|
||||||
[`e1d051d7ba270261b4455068bd68f1a58db15a4a`](https://github.com/BluePilotDev/bluepilot/commit/e1d051d7ba270261b4455068bd68f1a58db15a4a),
|
|
||||||
which is the complete `bp-7.0` snapshot used for this audit. This reconstruction is deliberately
|
|
||||||
recorded as a range rather than pretending that the missing original source SHA can be recovered.
|
|
||||||
|
|
||||||
### Upstream authors and work
|
|
||||||
|
|
||||||
- **Alan Polk (`alan-polk`)** is the principal upstream author of the Ford curvature controller,
|
|
||||||
angle-primary controller, manual-turn behavior, controller integration, and related panda safety
|
|
||||||
work. Important lineage commits include
|
|
||||||
[`db2bdff05`](https://github.com/BluePilotDev/bluepilot/commit/db2bdff05df103d71df62f45c2a3cb5211aba6e6),
|
|
||||||
[`d0aac605f`](https://github.com/BluePilotDev/bluepilot/commit/d0aac605f99d37e9da205e419f7989c1e9eaa386),
|
|
||||||
[`8f8d6d15f`](https://github.com/BluePilotDev/bluepilot/commit/8f8d6d15f0a590f42b78de964ffb0d0af7f5d63d), and
|
|
||||||
[`97867c1eb`](https://github.com/BluePilotDev/bluepilot/commit/97867c1eb57b7472f6fc3de62f0fef576e5a5497).
|
|
||||||
- **John Christman** contributed `bp-7.0` lateral integration, platform data, and the upstream
|
|
||||||
anti-stall work referenced by StarPilot's recovery logic, including
|
|
||||||
[`ec0ab181c`](https://github.com/BluePilotDev/bluepilot/commit/ec0ab181c344dccaae053e763bc6ce269551a2d8) and
|
|
||||||
[`9012f7666`](https://github.com/BluePilotDev/bluepilot/commit/9012f76666a5c90764fcaec40832b9a607488c27),
|
|
||||||
with additional vehicle data in
|
|
||||||
[`f0c6bf51f`](https://github.com/BluePilotDev/bluepilot/commit/f0c6bf51f19bb7b74226ead622cabef56e602125).
|
|
||||||
- **Jacob Neulight** contributed measured shadow-curvature and steering-pinion curvature/safety
|
|
||||||
work, including
|
|
||||||
[`699c17d9f`](https://github.com/BluePilotDev/bluepilot/commit/699c17d9fde62c690eed9d68eed7d731744d5137) and
|
|
||||||
[`26030f3cb`](https://github.com/BluePilotDev/bluepilot/commit/26030f3cb56a169ab0cf2b5a5ad15fa9af391b10).
|
|
||||||
- **Nathan Ingraham** contributed the separate high-speed damping adjustment in
|
|
||||||
[`1db52bc79`](https://github.com/BluePilotDev/bluepilot/commit/1db52bc79e607ddb00214254dd4d732615e27fe4) and
|
|
||||||
[`3610e3f18`](https://github.com/BluePilotDev/bluepilot/commit/3610e3f18a0ad37d793d7ada61dbc739ab1077a3).
|
|
||||||
- **Praeuner** contributed the damping-range update in
|
|
||||||
[`b600a8fdb`](https://github.com/BluePilotDev/bluepilot/commit/b600a8fdb985a2219fad4006ce9444b7071b52da).
|
|
||||||
- **tonesto7** contributed to the Ford integration and CAN-message history represented in the
|
|
||||||
imported branch, including
|
|
||||||
[`7f9212f7f`](https://github.com/BluePilotDev/bluepilot/commit/7f9212f7f8dc22c4a0a22443158554f4d3652a3c).
|
|
||||||
- **Haibin Wen and sunnypilot contributors** are named in file-level notices on upstream Ford
|
|
||||||
extension files that informed StarPilot's vehicle-state and lateral-limit integration. Their
|
|
||||||
published copyright and license notices are retained in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
|
||||||
- **Dirk Petersen, Alex Troxel, Kacer Aleks, and other BluePilot contributors** supplied Ford
|
|
||||||
fingerprints, VIN/platform data, tests, and integration changes that are represented in the
|
|
||||||
imported vehicle-support set. Examples include
|
|
||||||
[`3706b5645`](https://github.com/BluePilotDev/bluepilot/commit/3706b5645c270ad83cfecc3e92618924f0963166),
|
|
||||||
[`694bdbb7a`](https://github.com/BluePilotDev/bluepilot/commit/694bdbb7a9cc70af04d0118e891df96e47ded7c7), and
|
|
||||||
[`a02c06ef3`](https://github.com/BluePilotDev/bluepilot/commit/a02c06ef37acff518a511ba0a88a4dc65f506353).
|
|
||||||
|
|
||||||
This list identifies contributors whose work was found during the repository and blame audit. The
|
|
||||||
BluePilot repository and its Git history remain the authoritative record and may identify further
|
|
||||||
contributors.
|
|
||||||
|
|
||||||
### Local-to-upstream map
|
|
||||||
|
|
||||||
| StarPilot area | Upstream lineage | What StarPilot changed |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| `starpilot/car/ford/lateral.py` | `human_turn.py`, `lateral_curv_ext.py`, `lateral_angle_ext.py`, and `values_ext.py` at the reference snapshot above | Reorganized three extension/mixin implementations into one controller; integrated StarPilot Params; later added live-delay curvature lookahead, active-session driver override, measured-curvature handoff blending, PSCM acknowledgement, and local recovery/tuning behavior. |
|
|
||||||
| `starpilot/car/ford/fordcan.py` | `fordcan_ext.py` and the angle-mode safety protocol, especially `8f8d6d15f` | Reduced the extension to the Ford lateral CAN constructors used by StarPilot and adapted it to the local controller interface. |
|
|
||||||
| `opendbc_repo/opendbc/car/ford/` | Ford controller/state/interface/radar/platform changes in the `bp-7.0` snapshot | Integrated the changes directly into StarPilot's opendbc layout instead of retaining sunnypilot mixins; subsequent fixes and behavior differ by file. |
|
|
||||||
| `opendbc_repo/opendbc/safety/modes/ford.h` and Ford safety tests | BluePilot panda enforcement for four-signal curvature and angle-primary control, especially `8f8d6d15f`, plus shadow-curvature work | Adapted the flags and checks to StarPilot's smaller mode protocol and continued adding local regression coverage. |
|
|
||||||
| Ford Params and settings surfaces | BluePilot's mode and tuning concepts | Renamed and implemented in StarPilot's native Params/Galaxy architecture; no BluePilot or sunnypilot UI classes were retained. |
|
|
||||||
|
|
||||||
The local code has materially diverged, but the first four rows remain derivative in design and in
|
|
||||||
parts of their implementation. Future ports should cite the exact upstream commit in the importing
|
|
||||||
commit and at the relevant source boundary; when history can be retained cleanly, use a merge,
|
|
||||||
subtree, or cherry-pick with origin metadata rather than a single squashed attribution.
|
|
||||||
|
|
||||||
## Hyundai, Kia, and Genesis support adapted from sunnypilot
|
|
||||||
|
|
||||||
Portions of StarPilot's HKG angle steering, CAN integration, panda safety enforcement, safety tests,
|
|
||||||
firmware fingerprints, and cruise-button management are adapted from sunnypilot. Some upstream HKG
|
|
||||||
authorship is retained in StarPilot's Git history, and StarPilot commit
|
|
||||||
[`e33305151`](https://github.com/firestar5683/StarPilot/commit/e33305151ba852ea3350aa9f7a12d1c8bd137c43)
|
|
||||||
identified its ICBM/CSLC work as a sunnypilot port. Other substantial imports were committed locally
|
|
||||||
without recording an exact source revision, so this section documents the reconstructed lineage.
|
|
||||||
|
|
||||||
The exact checkout used for each historical import cannot now be proven. The reference snapshots
|
|
||||||
used for this audit are:
|
|
||||||
|
|
||||||
- [`sunnypilot/sunnypilot` `hkg-angle-steering-2025`](https://github.com/sunnypilot/sunnypilot/tree/hkg-angle-steering-2025)
|
|
||||||
at [`cfb38312d`](https://github.com/sunnypilot/sunnypilot/commit/cfb38312db33779f4727c983d372474a56ccb5d8),
|
|
||||||
whose opendbc submodule points to the next snapshot.
|
|
||||||
- [`sunnypilot/opendbc` `hkg-angle-steering-2025`](https://github.com/sunnypilot/opendbc/tree/hkg-angle-steering-2025)
|
|
||||||
at [`cc4b08625`](https://github.com/sunnypilot/opendbc/commit/cc4b08625a98e94b318cab15e45e05dad58042bd).
|
|
||||||
- [`sunnypilot/opendbc` `master`](https://github.com/sunnypilot/opendbc)
|
|
||||||
at [`f95f996f5`](https://github.com/sunnypilot/opendbc/commit/f95f996f5917dcbbf2e32fe51b606a24cf836af6),
|
|
||||||
used to audit later HKG fingerprints and extension history.
|
|
||||||
|
|
||||||
### Upstream authors and work
|
|
||||||
|
|
||||||
- **Haibin (Jason) Wen** contributed the original Kia EV9 HDA2/LFA2 angle-steering port, Hyundai
|
|
||||||
angle integration and signals, non-SCC platform support, and Intelligent Cruise Button Management.
|
|
||||||
Important lineage commits include
|
|
||||||
[`abe78de2c`](https://github.com/sunnypilot/opendbc/commit/abe78de2c2f9d8774d343c35c181d27e9d944392),
|
|
||||||
[`333de6f1a`](https://github.com/sunnypilot/opendbc/commit/333de6f1a2097a27709a652d5862bad05d83ed1f),
|
|
||||||
[`559a37426`](https://github.com/sunnypilot/opendbc/commit/559a37426976171ceb56c541bec9362abd8b8bd2), and
|
|
||||||
[`862828ad6`](https://github.com/sunnypilot/opendbc/commit/862828ad6f870fb23dd8670fe2a18dc19313217b).
|
|
||||||
- **Shane Smiskol** contributed foundational angle-command limiting, driver-override behavior, and
|
|
||||||
EPS-fault avoidance, including
|
|
||||||
[`228a397a3`](https://github.com/sunnypilot/opendbc/commit/228a397a37618de1ecbaf06b70efe3e0e0a8eec6) and
|
|
||||||
[`42d84ff6c`](https://github.com/sunnypilot/opendbc/commit/42d84ff6ca3d48529b195395d652ad777ad397ca).
|
|
||||||
- **DevTekVE** contributed substantial angle-controller integration, tuning, platform support, panda
|
|
||||||
safety logic, and tests, including
|
|
||||||
[`c77c7ec2e`](https://github.com/sunnypilot/opendbc/commit/c77c7ec2e39959b65c42e2d70aa943fccd606361),
|
|
||||||
[`7ded99dba`](https://github.com/sunnypilot/opendbc/commit/7ded99dba145c56754e8bbe47217eb174ec03396),
|
|
||||||
[`3819ca7f0`](https://github.com/sunnypilot/opendbc/commit/3819ca7f0d2576771924bd60f47d3e8676b5d583), and
|
|
||||||
[`8d134e98f`](https://github.com/sunnypilot/opendbc/commit/8d134e98f3151a1aec354f93e81c3a4269788991).
|
|
||||||
- **Nicholas Evans, dany7915, janpoo6427, Tinkerpet, royjr, Taylor Hoshino, Intelli, Joshua Mack,
|
|
||||||
Mark McCallister, Discountchubbs, and other sunnypilot contributors** supplied vehicle ports,
|
|
||||||
fingerprints, firmware data, safety-limit updates, and related integration represented in the
|
|
||||||
adapted HKG support.
|
|
||||||
|
|
||||||
This list identifies contributors found during the repository, commit, and blame audit. The
|
|
||||||
sunnypilot repositories and their Git histories remain the authoritative record and may identify
|
|
||||||
additional contributors.
|
|
||||||
|
|
||||||
### Local-to-upstream map
|
|
||||||
|
|
||||||
| StarPilot area | Upstream lineage | What StarPilot changed |
|
|
||||||
| --- | --- | --- |
|
|
||||||
| `opendbc_repo/opendbc/car/hyundai/carcontroller.py` | Angle controller and driver-override work in `sunnypilot/opendbc` `hkg-angle-steering-2025` | Integrated the controller into StarPilot's opendbc layout and added substantial local longitudinal, smoothing, recovery, and platform behavior. |
|
|
||||||
| `opendbc_repo/opendbc/car/hyundai/hyundaicanfd.py`, `interface.py`, and `values.py` | Angle commands, signal selection, safety flags, limits, and platform integration from the angle branch | Combined later upstream changes with StarPilot flags, Params, platform tuning, and local CAN/CAN-FD behavior. |
|
|
||||||
| `opendbc_repo/opendbc/safety/modes/hyundai_canfd.h` and its tests | Angle-command safety enforcement and regression tests from the angle branch | Extended and reorganized the safety mode and tests for StarPilot's current supported modes. |
|
|
||||||
| `opendbc_repo/opendbc/car/hyundai/fingerprints.py` and HKG platform data | sunnypilot HKG extension/fingerprint history on `master` plus angle-branch vehicle ports | Flattened extension data into the local opendbc tree and continued adding and updating platforms. |
|
|
||||||
| HKG cruise-button management and settings integration | sunnypilot ICBM/CSLC concepts and implementation history, including `862828ad6` and `2277e3d49` | Adapted the feature to StarPilot/FrogPilot controls and settings; later revisions changed or removed portions of the original integration. |
|
|
||||||
|
|
||||||
The current implementation is not a wholesale copy of either reference snapshot and has diverged
|
|
||||||
substantially. Its HKG angle-control and supporting safety architecture nevertheless remain
|
|
||||||
derivative in design and in identifiable portions of the implementation. The applicable upstream
|
|
||||||
notices are preserved in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
|
||||||
|
|
||||||
## Policy for future third-party ports
|
|
||||||
|
|
||||||
Before publishing a third-party port:
|
|
||||||
|
|
||||||
1. Read every repository-level and file-level license that may cover the source. Stop and ask the
|
|
||||||
rightsholder when the terms or their scope conflict.
|
|
||||||
2. Record the repository URL, exact commit SHA, source paths/symbols, authors found in the relevant
|
|
||||||
history, and the local destination in the importing commit and this file.
|
|
||||||
3. Preserve required copyright and license notices verbatim. Reorganization, translation, and
|
|
||||||
AI-assisted rewriting do not remove source provenance.
|
|
||||||
4. Retain authorship/history with a merge, subtree, or `cherry-pick -x` when practical. For a true
|
|
||||||
adaptation, keep the local adapter as commit author and use an `Adapted-from:` trailer and source
|
|
||||||
comments; do not add `Co-authored-by:` for a person without their agreement.
|
|
||||||
5. Describe material local deviations and make clear that upstream contributors do not support or
|
|
||||||
endorse the downstream version.
|
|
||||||
|
|
||||||
See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for licensing notices.
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
Copyright (c) 2018, Comma.ai, Inc.
|
Copyright (c) 2018, Comma.ai, Inc.
|
||||||
Copyright (c) 2026, firestar5683 and StarPilot contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
|||||||
@@ -21,20 +21,6 @@ but [has expanded to offer Quality-Of-Life improvements for all](#features)!
|
|||||||
StarPilot is built off of [FrogPilot](https://github.com/FrogAi/FrogPilot)
|
StarPilot is built off of [FrogPilot](https://github.com/FrogAi/FrogPilot)
|
||||||
and supports the major features FrogPilot offers.
|
and supports the major features FrogPilot offers.
|
||||||
|
|
||||||
Ford-specific lateral-control and vehicle-support work includes substantial adaptations from
|
|
||||||
[BluePilot](https://github.com/BluePilotDev/bluepilot/tree/bp-7.0), principally developed by
|
|
||||||
[Alan Polk](https://github.com/alan-polk) with additional BluePilot contributors. StarPilot's
|
|
||||||
implementation has since diverged, but that does not erase its lineage. See [CREDITS.md](CREDITS.md)
|
|
||||||
for the code-level provenance and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for applicable
|
|
||||||
upstream notices and terms. BluePilot and its contributors do not maintain or endorse StarPilot;
|
|
||||||
please direct support requests for this adaptation to the StarPilot project.
|
|
||||||
|
|
||||||
Hyundai, Kia, and Genesis angle steering and related vehicle support include substantial adaptations
|
|
||||||
from [sunnypilot](https://github.com/sunnypilot/sunnypilot/tree/hkg-angle-steering-2025) and its
|
|
||||||
[opendbc angle-steering branch](https://github.com/sunnypilot/opendbc/tree/hkg-angle-steering-2025).
|
|
||||||
StarPilot's implementation has diverged significantly; the upstream contributors do not maintain
|
|
||||||
this adaptation. Detailed code lineage is recorded in [CREDITS.md](CREDITS.md#hyundai-kia-and-genesis-support-adapted-from-sunnypilot).
|
|
||||||
|
|
||||||
StarPilot has a vibrant, welcoming community [discord](https://firestar.link/discord).
|
StarPilot has a vibrant, welcoming community [discord](https://firestar.link/discord).
|
||||||
Stop by to chat or ask questions!
|
Stop by to chat or ask questions!
|
||||||
|
|
||||||
@@ -91,9 +77,4 @@ Uses your comma's sysroot/toolchain
|
|||||||
* Custom long maneuver tests, specifically designed for regen-only vehicles
|
* Custom long maneuver tests, specifically designed for regen-only vehicles
|
||||||
|
|
||||||
## Third-Party Notices
|
## Third-Party Notices
|
||||||
|
|
||||||
* Portions of this software include modified versions of the Material Design Icons provided by Google under the Apache License 2.0. A copy of the license is included in the `LICENSE-MDI` file.
|
* Portions of this software include modified versions of the Material Design Icons provided by Google under the Apache License 2.0. A copy of the license is included in the `LICENSE-MDI` file.
|
||||||
* Ford support includes software adapted from BluePilot's `bp-7.0` branch. The source repository contains both a standard MIT notice and a separate custom SUNNYPILOT LLC notice; StarPilot preserves both in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
|
||||||
* Hyundai, Kia, and Genesis support includes software adapted directly from sunnypilot's HKG angle-steering branch and sunnypilot/opendbc. StarPilot preserves the applicable notices in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
|
||||||
|
|
||||||
> This project uses software from Haibin Wen and SUNNYPILOT LLC and is licensed under a custom license requiring permission for use.
|
|
||||||
|
|||||||
@@ -1,125 +0,0 @@
|
|||||||
# Third-Party Notices
|
|
||||||
|
|
||||||
This file supplements StarPilot's root `LICENSE`. StarPilot-original contributions are offered
|
|
||||||
under that MIT license. Third-party material remains subject to its original terms; inclusion here
|
|
||||||
does not relicense it or imply endorsement by an upstream project or contributor.
|
|
||||||
|
|
||||||
## BluePilot `bp-7.0` Ford support
|
|
||||||
|
|
||||||
Portions of StarPilot's Ford lateral control, CAN integration, panda safety logic, vehicle data,
|
|
||||||
and related tests are adapted from the public BluePilot repository:
|
|
||||||
|
|
||||||
- Source: <https://github.com/BluePilotDev/bluepilot/tree/bp-7.0>
|
|
||||||
- Audited `bp-7.0` snapshot: [`e1d051d7ba270261b4455068bd68f1a58db15a4a`](https://github.com/BluePilotDev/bluepilot/commit/e1d051d7ba270261b4455068bd68f1a58db15a4a)
|
|
||||||
- Historical reconstruction: [CREDITS.md](CREDITS.md#ford-support-adapted-from-bluepilot)
|
|
||||||
- Provenance and contributors: [CREDITS.md](CREDITS.md)
|
|
||||||
|
|
||||||
## sunnypilot Hyundai, Kia, and Genesis support
|
|
||||||
|
|
||||||
Portions of StarPilot's HKG angle steering, CAN integration, panda safety enforcement and tests,
|
|
||||||
firmware fingerprints, platform data, and cruise-button management are adapted directly from the
|
|
||||||
public sunnypilot repositories:
|
|
||||||
|
|
||||||
- Source: <https://github.com/sunnypilot/sunnypilot/tree/hkg-angle-steering-2025>
|
|
||||||
- Audited superproject snapshot: [`cfb38312db33779f4727c983d372474a56ccb5d8`](https://github.com/sunnypilot/sunnypilot/commit/cfb38312db33779f4727c983d372474a56ccb5d8)
|
|
||||||
- Source: <https://github.com/sunnypilot/opendbc/tree/hkg-angle-steering-2025>
|
|
||||||
- Audited angle-branch snapshot: [`cc4b08625a98e94b318cab15e45e05dad58042bd`](https://github.com/sunnypilot/opendbc/commit/cc4b08625a98e94b318cab15e45e05dad58042bd)
|
|
||||||
- Later HKG history was audited against `sunnypilot/opendbc` `master` at
|
|
||||||
[`f95f996f5917dcbbf2e32fe51b606a24cf836af6`](https://github.com/sunnypilot/opendbc/commit/f95f996f5917dcbbf2e32fe51b606a24cf836af6).
|
|
||||||
- Historical reconstruction and contributors: [CREDITS.md](CREDITS.md#hyundai-kia-and-genesis-support-adapted-from-sunnypilot)
|
|
||||||
|
|
||||||
## Applicable upstream license notices
|
|
||||||
|
|
||||||
The upstream repositories and branches identified above publish both `LICENSE` and `LICENSE.md`.
|
|
||||||
Their READMEs point to `LICENSE` for openpilot licensing, while some extension files point to
|
|
||||||
`LICENSE.md`. Because the scope of those two notices is not unambiguous, StarPilot preserves both
|
|
||||||
and treats the more restrictive notice conservatively for upstream-derived material. This is a
|
|
||||||
record of the published notices, not a legal conclusion about their scope.
|
|
||||||
|
|
||||||
### Upstream `LICENSE` notice (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2018, Comma.ai, Inc.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
||||||
associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
||||||
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
||||||
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or
|
|
||||||
substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
|
||||||
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
||||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
|
||||||
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
### Upstream `opendbc` `LICENSE` notice (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2020, Comma.ai, Inc.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
||||||
associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
||||||
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
||||||
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or
|
|
||||||
substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
|
||||||
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
||||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
|
||||||
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
||||||
### Upstream extension file notice
|
|
||||||
|
|
||||||
Several upstream Ford and HKG extension files carry this file-level notice:
|
|
||||||
|
|
||||||
> Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
|
|
||||||
>
|
|
||||||
> This file is part of sunnypilot and is licensed under the MIT License.
|
|
||||||
> See the LICENSE.md file in the root directory for more details.
|
|
||||||
|
|
||||||
StarPilot's Ford and HKG integrations were informed by extension files carrying this notice. The
|
|
||||||
reference to “MIT License” conflicts with the nonstandard restrictions in the referenced upstream
|
|
||||||
`LICENSE.md`; both texts are retained here rather than silently choosing between them.
|
|
||||||
|
|
||||||
### Upstream `LICENSE.md` notice (published as “Custom MIT License”)
|
|
||||||
|
|
||||||
The following notice is reproduced verbatim from the reference branch:
|
|
||||||
|
|
||||||
> # Custom MIT License
|
|
||||||
>
|
|
||||||
> Copyright (c) 2024, Haibin Wen, SUNNYPILOT LLC
|
|
||||||
>
|
|
||||||
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to view and modify the Software, subject to the following conditions:
|
|
||||||
>
|
|
||||||
> 1. **Permission Required**: Permission Required for Commercial, For-Profit, or Closed Source Use: Use of the Software, in whole or in part, for any commercial purposes, for-profit projects, or in closed source projects requires explicit written permission from the original author(s).
|
|
||||||
>
|
|
||||||
> 2. **Redistribution**: Any redistribution of the Software, modified or unmodified, must retain this license notice and the following acknowledgment:
|
|
||||||
> "This software is licensed under a custom license requiring permission for use."
|
|
||||||
>
|
|
||||||
> 3. **Visibility**: Any project that uses the Software must visibly mention the following acknowledgment:
|
|
||||||
> "This project uses software from Haibin Wen and SUNNYPILOT LLC and is licensed under a custom license requiring permission for use."
|
|
||||||
>
|
|
||||||
> 4. **No Warranty**: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
>
|
|
||||||
> Contact sunnypilot Support <support@sunnypilot.ai> for permission requests.
|
|
||||||
>
|
|
||||||
> ---
|
|
||||||
>
|
|
||||||
> Haibin Wen, SUNNYPILOT LLC
|
|
||||||
|
|
||||||
Required upstream acknowledgments:
|
|
||||||
|
|
||||||
> This software is licensed under a custom license requiring permission for use.
|
|
||||||
>
|
|
||||||
> This project uses software from Haibin Wen and SUNNYPILOT LLC and is licensed under a custom license requiring permission for use.
|
|
||||||
|
|
||||||
For commercial, for-profit, or closed-source use, consult the upstream notice and obtain any
|
|
||||||
permission it requires. The upstream repository's simultaneous publication of two differently
|
|
||||||
scoped notices should be clarified with the relevant copyright holders before relying on one to
|
|
||||||
the exclusion of the other.
|
|
||||||
Binary file not shown.
@@ -310,7 +310,6 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
|
|||||||
{"DeveloperSidebarMetric7", {PERSISTENT, INT, "7", "0", 3}},
|
{"DeveloperSidebarMetric7", {PERSISTENT, INT, "7", "0", 3}},
|
||||||
{"DeveloperUI", {PERSISTENT, BOOL, "0", "0", 3}},
|
{"DeveloperUI", {PERSISTENT, BOOL, "0", "0", 3}},
|
||||||
{"GalaxyDeveloperMode", {PERSISTENT | DONT_LOG, BOOL, "0", "0", 0, SETTINGS_SIMPLE}},
|
{"GalaxyDeveloperMode", {PERSISTENT | DONT_LOG, BOOL, "0", "0", 0, SETTINGS_SIMPLE}},
|
||||||
{"GalaxyMobileDefault", {PERSISTENT | DONT_LOG, BOOL, "0", "0", 0, SETTINGS_ADVANCED}},
|
|
||||||
{"DeveloperWidgets", {PERSISTENT, BOOL, "1", "0", 3}},
|
{"DeveloperWidgets", {PERSISTENT, BOOL, "1", "0", 3}},
|
||||||
{"DeviceManagement", {PERSISTENT, BOOL, "1", "0", 1, SETTINGS_SIMPLE}},
|
{"DeviceManagement", {PERSISTENT, BOOL, "1", "0", 1, SETTINGS_SIMPLE}},
|
||||||
{"DeviceShutdown", {PERSISTENT, INT, "6", "6", 1, SETTINGS_SIMPLE}},
|
{"DeviceShutdown", {PERSISTENT, INT, "6", "6", 1, SETTINGS_SIMPLE}},
|
||||||
@@ -373,8 +372,6 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
|
|||||||
{"ForceStandstill", {PERSISTENT, BOOL, "0", "0", 2, SETTINGS_SIMPLE}},
|
{"ForceStandstill", {PERSISTENT, BOOL, "0", "0", 2, SETTINGS_SIMPLE}},
|
||||||
{"FordLKASButtonControlMigrated", {PERSISTENT, BOOL, "0", "0"}},
|
{"FordLKASButtonControlMigrated", {PERSISTENT, BOOL, "0", "0"}},
|
||||||
{"ForceTorqueController", {PERSISTENT, BOOL, "0", "0", 3}},
|
{"ForceTorqueController", {PERSISTENT, BOOL, "0", "0", 3}},
|
||||||
// These Ford lateral tuning concepts descend from BluePilot bp-7.0. StarPilot's key names and
|
|
||||||
// settings integration are local; see /CREDITS.md and /THIRD_PARTY_NOTICES.md for provenance.
|
|
||||||
{"FordAngleBlend", {PERSISTENT, FLOAT, "0.5", "0.5", 2}},
|
{"FordAngleBlend", {PERSISTENT, FLOAT, "0.5", "0.5", 2}},
|
||||||
{"FordAngleHighSpeedDamping", {PERSISTENT, FLOAT, "1.0", "1.0", 2}},
|
{"FordAngleHighSpeedDamping", {PERSISTENT, FLOAT, "1.0", "1.0", 2}},
|
||||||
{"FordAngleHighSpeedFactor", {PERSISTENT, FLOAT, "1.0", "1.0", 2}},
|
{"FordAngleHighSpeedFactor", {PERSISTENT, FLOAT, "1.0", "1.0", 2}},
|
||||||
|
|||||||
Binary file not shown.
@@ -6,8 +6,6 @@ from opendbc.car.lateral import ISO_LATERAL_ACCEL, apply_std_steer_angle_limits
|
|||||||
from opendbc.car.ford import fordcan
|
from opendbc.car.ford import fordcan
|
||||||
from opendbc.car.ford.values import CarControllerParams, FordFlags, CAR
|
from opendbc.car.ford.values import CarControllerParams, FordFlags, CAR
|
||||||
from opendbc.car.interfaces import CarControllerBase, V_CRUISE_MAX
|
from opendbc.car.interfaces import CarControllerBase, V_CRUISE_MAX
|
||||||
# This Ford extension boundary substantially adapts BluePilot bp-7.0 work. See the root CREDITS.md
|
|
||||||
# (including Alan Polk's d0aac605f and db2bdff05) and THIRD_PARTY_NOTICES.md.
|
|
||||||
from openpilot.starpilot.car.ford import fordcan as starpilot_fordcan
|
from openpilot.starpilot.car.ford import fordcan as starpilot_fordcan
|
||||||
from openpilot.starpilot.car.ford.lateral import FordLateralController, FordLateralMode, FordLateralResult
|
from openpilot.starpilot.car.ford.lateral import FordLateralController, FordLateralMode, FordLateralResult
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
# Ford-specific additions first imported in StarPilot 3f6ccd104e substantially adapt BluePilot
|
|
||||||
# bp-7.0 vehicle-state work, including a sunnypilot extension with the Haibin Wen/contributors
|
|
||||||
# notice retained in THIRD_PARTY_NOTICES.md. See the repository root CREDITS.md for provenance.
|
|
||||||
from cereal import custom
|
from cereal import custom
|
||||||
from opendbc.can import CANDefine, CANParser
|
from opendbc.can import CANDefine, CANParser
|
||||||
from opendbc.car import Bus, create_button_events, structs
|
from opendbc.car import Bus, create_button_events, structs
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE."""
|
""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE."""
|
||||||
# Some Ford firmware entries first imported in StarPilot 3f6ccd104e came from BluePilot bp-7.0
|
|
||||||
# contributors. The exact authors and source revisions are recorded in the root CREDITS.md.
|
|
||||||
from opendbc.car.structs import CarParams
|
from opendbc.car.structs import CarParams
|
||||||
from opendbc.car.ford.values import CAR
|
from opendbc.car.ford.values import CAR
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# Ford-specific additions first imported in StarPilot 3f6ccd104e substantially adapt BluePilot
|
|
||||||
# bp-7.0 interface work. See the repository root CREDITS.md and THIRD_PARTY_NOTICES.md.
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from opendbc.car import Bus, get_safety_config, structs
|
from opendbc.car import Bus, get_safety_config, structs
|
||||||
from opendbc.car.carlog import carlog
|
from opendbc.car.carlog import carlog
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# Ford-specific additions first imported in StarPilot 3f6ccd104e substantially adapt BluePilot
|
|
||||||
# bp-7.0 radar work. See the repository root CREDITS.md and THIRD_PARTY_NOTICES.md.
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from collections import deque
|
from collections import deque
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# Ford platform data and limits first imported in StarPilot 3f6ccd104e substantially adapt
|
|
||||||
# BluePilot bp-7.0 contributor work. See the repository root CREDITS.md and THIRD_PARTY_NOTICES.md.
|
|
||||||
import copy
|
import copy
|
||||||
import re
|
import re
|
||||||
from dataclasses import dataclass, field, replace
|
from dataclasses import dataclass, field, replace
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import copy
|
import copy
|
||||||
import math
|
|
||||||
from cereal import custom
|
from cereal import custom
|
||||||
from opendbc.can import CANDefine, CANParser
|
from opendbc.can import CANDefine, CANParser
|
||||||
from opendbc.car import Bus, create_button_events, structs
|
from opendbc.car import Bus, create_button_events, structs
|
||||||
@@ -110,11 +109,8 @@ class CarState(CarStateBase):
|
|||||||
self.car_gps_supported = self.car_gps_config is not None
|
self.car_gps_supported = self.car_gps_config is not None
|
||||||
self.car_gps = None
|
self.car_gps = None
|
||||||
self._car_gps_timestamp_nanos = 0
|
self._car_gps_timestamp_nanos = 0
|
||||||
self._prev_gps_lat = None
|
|
||||||
self._prev_gps_lon = None
|
|
||||||
self._last_gps_bearing = None
|
|
||||||
|
|
||||||
def _update_car_gps(self, cp, v_ego: float = 0.0) -> None:
|
def _update_car_gps(self, cp) -> None:
|
||||||
if self.car_gps_config is None:
|
if self.car_gps_config is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -129,25 +125,6 @@ class CarState(CarStateBase):
|
|||||||
gps = self.car_gps_config.decoder(*(cp.vl[name] for name in self.car_gps_config.messages))
|
gps = self.car_gps_config.decoder(*(cp.vl[name] for name in self.car_gps_config.messages))
|
||||||
if gps is not None:
|
if gps is not None:
|
||||||
gps["timestamp_nanos"] = timestamp_nanos
|
gps["timestamp_nanos"] = timestamp_nanos
|
||||||
if gps["hasFix"]:
|
|
||||||
lat, lon = gps["latitude"], gps["longitude"]
|
|
||||||
if self._prev_gps_lat is not None and (lat, lon) != (self._prev_gps_lat, self._prev_gps_lon):
|
|
||||||
d_lat = (lat - self._prev_gps_lat) * 111139.0
|
|
||||||
d_lon = (lon - self._prev_gps_lon) * 111139.0 * math.cos(math.radians(lat))
|
|
||||||
if math.hypot(d_lat, d_lon) > 1.5 and v_ego > 1.0 and not self.moving_backward:
|
|
||||||
self._last_gps_bearing = math.degrees(math.atan2(d_lon, d_lat)) % 360.0
|
|
||||||
|
|
||||||
self._prev_gps_lat, self._prev_gps_lon = lat, lon
|
|
||||||
|
|
||||||
bearing = self._last_gps_bearing if self._last_gps_bearing is not None else 0.0
|
|
||||||
gps["speed"] = max(0.0, v_ego)
|
|
||||||
gps["bearingDeg"] = bearing
|
|
||||||
gps["bearingAccuracyDeg"] = 5.0 if (v_ego > 1.0 and self._last_gps_bearing is not None) else 180.0
|
|
||||||
heading_rad = math.radians(bearing)
|
|
||||||
gps["vNED"] = [v_ego * math.cos(heading_rad), v_ego * math.sin(heading_rad), 0.0]
|
|
||||||
else:
|
|
||||||
self._prev_gps_lat = self._prev_gps_lon = None
|
|
||||||
|
|
||||||
self.car_gps = gps
|
self.car_gps = gps
|
||||||
self._car_gps_timestamp_nanos = timestamp_nanos
|
self._car_gps_timestamp_nanos = timestamp_nanos
|
||||||
|
|
||||||
@@ -168,6 +145,8 @@ class CarState(CarStateBase):
|
|||||||
cam_cp = can_parsers[Bus.cam]
|
cam_cp = can_parsers[Bus.cam]
|
||||||
loopback_cp = can_parsers[Bus.loopback]
|
loopback_cp = can_parsers[Bus.loopback]
|
||||||
|
|
||||||
|
self._update_car_gps(pt_cp)
|
||||||
|
|
||||||
ret = structs.CarState()
|
ret = structs.CarState()
|
||||||
|
|
||||||
volt_like = {
|
volt_like = {
|
||||||
@@ -238,8 +217,6 @@ class CarState(CarStateBase):
|
|||||||
ret.standstill = abs(pt_cp.vl["EBCMWheelSpdRear"]["RLWheelSpd"]) <= STANDSTILL_THRESHOLD and \
|
ret.standstill = abs(pt_cp.vl["EBCMWheelSpdRear"]["RLWheelSpd"]) <= STANDSTILL_THRESHOLD and \
|
||||||
abs(pt_cp.vl["EBCMWheelSpdRear"]["RRWheelSpd"]) <= STANDSTILL_THRESHOLD
|
abs(pt_cp.vl["EBCMWheelSpdRear"]["RRWheelSpd"]) <= STANDSTILL_THRESHOLD
|
||||||
|
|
||||||
self._update_car_gps(pt_cp, ret.vEgo)
|
|
||||||
|
|
||||||
if pt_cp.vl["ECMPRDNL2"]["ManualMode"] == 1:
|
if pt_cp.vl["ECMPRDNL2"]["ManualMode"] == 1:
|
||||||
ret.gearShifter = self.parse_gear_shifter("T")
|
ret.gearShifter = self.parse_gear_shifter("T")
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -88,107 +88,6 @@ class TestBoltGps:
|
|||||||
assert gps["latitude"] == 0.0
|
assert gps["latitude"] == 0.0
|
||||||
assert gps["longitude"] == 0.0
|
assert gps["longitude"] == 0.0
|
||||||
|
|
||||||
def test_bolt_gps_accuracy_metrics(self):
|
|
||||||
gps = parse_chevrolet_bolt_can_gps({"GPSLatitude": 145292743.0, "GPSLongitude": -267520892.0})
|
|
||||||
assert gps is not None
|
|
||||||
assert gps["horizontalAccuracy"] == 6.0
|
|
||||||
assert gps["verticalAccuracy"] == 10.0
|
|
||||||
assert gps["speedAccuracy"] == 0.5
|
|
||||||
|
|
||||||
def test_bolt_gps_heading_and_speed_derivation(self):
|
|
||||||
cp = SimpleNamespace(
|
|
||||||
brand="gm",
|
|
||||||
carFingerprint=CAR.CHEVROLET_BOLT_CC_2018_2021,
|
|
||||||
flags=0,
|
|
||||||
networkLocation=structs.CarParams.NetworkLocation.gateway,
|
|
||||||
transmissionType=structs.CarParams.TransmissionType.direct,
|
|
||||||
enableBsm=False,
|
|
||||||
enableGasInterceptorDEPRECATED=False,
|
|
||||||
pcmCruise=False,
|
|
||||||
)
|
|
||||||
fpcp = custom.StarPilotCarParams.new_message()
|
|
||||||
cs = GMCarState(cp, fpcp)
|
|
||||||
|
|
||||||
# First position (stationary)
|
|
||||||
mock_cp = SimpleNamespace(
|
|
||||||
ts_nanos={"TCICOnStarGPSPosition": {"GPSLatitude": 1_000_000}},
|
|
||||||
vl={"TCICOnStarGPSPosition": {"GPSLatitude": 145292743.0, "GPSLongitude": -267520892.0}},
|
|
||||||
)
|
|
||||||
cs._update_car_gps(mock_cp, v_ego=0.0)
|
|
||||||
gps = cs.get_car_gps()
|
|
||||||
assert gps is not None
|
|
||||||
assert gps["speed"] == 0.0
|
|
||||||
assert gps["bearingDeg"] == 0.0
|
|
||||||
assert gps["bearingAccuracyDeg"] == 180.0
|
|
||||||
|
|
||||||
# Move East at 15 m/s
|
|
||||||
mock_cp.ts_nanos["TCICOnStarGPSPosition"]["GPSLatitude"] = 2_000_000_000
|
|
||||||
mock_cp.vl["TCICOnStarGPSPosition"]["GPSLongitude"] = -267520892.0 + 1000.0 # Eastward shift
|
|
||||||
cs._update_car_gps(mock_cp, v_ego=15.0)
|
|
||||||
gps = cs.get_car_gps()
|
|
||||||
assert gps is not None
|
|
||||||
assert gps["speed"] == 15.0
|
|
||||||
assert gps["bearingDeg"] == pytest.approx(90.0, abs=1.0)
|
|
||||||
assert gps["bearingAccuracyDeg"] == 5.0
|
|
||||||
assert gps["vNED"][1] > 0.0 # East velocity positive
|
|
||||||
|
|
||||||
# Stop moving (v_ego=0.0): heading should be retained, not reset to 0
|
|
||||||
mock_cp.ts_nanos["TCICOnStarGPSPosition"]["GPSLatitude"] = 3_000_000_000
|
|
||||||
cs._update_car_gps(mock_cp, v_ego=0.0)
|
|
||||||
gps = cs.get_car_gps()
|
|
||||||
assert gps is not None
|
|
||||||
assert gps["speed"] == 0.0
|
|
||||||
assert gps["bearingDeg"] == pytest.approx(90.0, abs=1.0)
|
|
||||||
|
|
||||||
# Reversing: coordinate changes while moving backward should not flip heading
|
|
||||||
cs.moving_backward = True
|
|
||||||
mock_cp.ts_nanos["TCICOnStarGPSPosition"]["GPSLatitude"] = 4_000_000_000
|
|
||||||
mock_cp.vl["TCICOnStarGPSPosition"]["GPSLongitude"] = -267520892.0 - 1000.0 # Westward shift
|
|
||||||
cs._update_car_gps(mock_cp, v_ego=3.0)
|
|
||||||
gps = cs.get_car_gps()
|
|
||||||
assert gps is not None
|
|
||||||
assert gps["bearingDeg"] == pytest.approx(90.0, abs=1.0)
|
|
||||||
|
|
||||||
# Drive True North: verify bearing is 0.0 deg and accuracy is 5.0 deg (not degraded to 180.0)
|
|
||||||
cs.moving_backward = False
|
|
||||||
mock_cp.ts_nanos["TCICOnStarGPSPosition"]["GPSLatitude"] = 5_000_000_000
|
|
||||||
mock_cp.vl["TCICOnStarGPSPosition"]["GPSLatitude"] = 145292743.0 + 1000.0 # Northward shift
|
|
||||||
cs._update_car_gps(mock_cp, v_ego=12.0)
|
|
||||||
gps = cs.get_car_gps()
|
|
||||||
assert gps is not None
|
|
||||||
assert gps["bearingDeg"] == pytest.approx(0.0, abs=1.0)
|
|
||||||
assert gps["bearingAccuracyDeg"] == 5.0
|
|
||||||
|
|
||||||
# Tunnel / fix loss: invalid coordinates cause hasFix=False and clear previous coordinates
|
|
||||||
mock_cp.ts_nanos["TCICOnStarGPSPosition"]["GPSLatitude"] = 6_000_000_000
|
|
||||||
mock_cp.vl["TCICOnStarGPSPosition"]["GPSLatitude"] = 0.0
|
|
||||||
mock_cp.vl["TCICOnStarGPSPosition"]["GPSLongitude"] = 0.0
|
|
||||||
cs._update_car_gps(mock_cp, v_ego=20.0)
|
|
||||||
gps = cs.get_car_gps()
|
|
||||||
assert gps is not None
|
|
||||||
assert not gps["hasFix"]
|
|
||||||
assert cs._prev_gps_lat is None and cs._prev_gps_lon is None
|
|
||||||
|
|
||||||
# Tunnel exit: GPS fix re-acquired 5 km away heading South
|
|
||||||
# The first sample after fix loss sets initial coordinates without calculating a phantom jump vector
|
|
||||||
mock_cp.ts_nanos["TCICOnStarGPSPosition"]["GPSLatitude"] = 7_000_000_000
|
|
||||||
mock_cp.vl["TCICOnStarGPSPosition"]["GPSLatitude"] = 145292743.0 - 50000.0
|
|
||||||
mock_cp.vl["TCICOnStarGPSPosition"]["GPSLongitude"] = -267520892.0
|
|
||||||
cs._update_car_gps(mock_cp, v_ego=20.0)
|
|
||||||
gps = cs.get_car_gps()
|
|
||||||
assert gps is not None
|
|
||||||
assert gps["hasFix"]
|
|
||||||
assert gps["bearingDeg"] == pytest.approx(0.0, abs=1.0)
|
|
||||||
assert cs._prev_gps_lat is not None
|
|
||||||
|
|
||||||
# Second sample: moving Southward -> bearing smoothly updates to 180 deg
|
|
||||||
mock_cp.ts_nanos["TCICOnStarGPSPosition"]["GPSLatitude"] = 8_000_000_000
|
|
||||||
mock_cp.vl["TCICOnStarGPSPosition"]["GPSLatitude"] = 145292743.0 - 51000.0
|
|
||||||
cs._update_car_gps(mock_cp, v_ego=20.0)
|
|
||||||
gps = cs.get_car_gps()
|
|
||||||
assert gps is not None
|
|
||||||
assert gps["bearingDeg"] == pytest.approx(180.0, abs=1.0)
|
|
||||||
|
|
||||||
@parameterized.expand(CHEVROLET_BOLT_GPS_CARS)
|
@parameterized.expand(CHEVROLET_BOLT_GPS_CARS)
|
||||||
def test_gps_message_is_added_to_powertrain_parser(self, car_model):
|
def test_gps_message_is_added_to_powertrain_parser(self, car_model):
|
||||||
cp = SimpleNamespace(
|
cp = SimpleNamespace(
|
||||||
|
|||||||
@@ -113,11 +113,11 @@ def parse_chevrolet_bolt_can_gps(position: Mapping[str, float]) -> CarGpsSample
|
|||||||
"altitude": 0.0,
|
"altitude": 0.0,
|
||||||
"speed": 0.0,
|
"speed": 0.0,
|
||||||
"bearingDeg": 0.0,
|
"bearingDeg": 0.0,
|
||||||
"horizontalAccuracy": 6.0,
|
"horizontalAccuracy": 100.0,
|
||||||
"unixTimestampMillis": int(datetime.now(UTC).timestamp() * 1000),
|
"unixTimestampMillis": int(datetime.now(UTC).timestamp() * 1000),
|
||||||
"verticalAccuracy": 10.0,
|
"verticalAccuracy": 100.0,
|
||||||
"bearingAccuracyDeg": 180.0,
|
"bearingAccuracyDeg": 180.0,
|
||||||
"speedAccuracy": 0.5,
|
"speedAccuracy": 100.0,
|
||||||
"hasFix": coordinates_valid,
|
"hasFix": coordinates_valid,
|
||||||
"satelliteCount": 0,
|
"satelliteCount": 0,
|
||||||
"vNED": [0.0, 0.0, 0.0],
|
"vNED": [0.0, 0.0, 0.0],
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
# Provenance: portions of HKG angle control are adapted from sunnypilot/opendbc's
|
|
||||||
# hkg-angle-steering-2025 branch at cc4b08625. See CREDITS.md and THIRD_PARTY_NOTICES.md.
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from opendbc.can import CANPacker
|
from opendbc.can import CANPacker
|
||||||
from opendbc.car import Bus, DT_CTRL, make_tester_present_msg, rate_limit, structs
|
from opendbc.car import Bus, DT_CTRL, make_tester_present_msg, rate_limit, structs
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ from collections import deque
|
|||||||
import copy
|
import copy
|
||||||
import math
|
import math
|
||||||
|
|
||||||
# Provenance: portions of HKG angle-state integration are adapted from sunnypilot/opendbc's
|
|
||||||
# hkg-angle-steering-2025 branch at cc4b08625. See CREDITS.md and THIRD_PARTY_NOTICES.md.
|
|
||||||
from cereal import custom
|
from cereal import custom
|
||||||
from opendbc.can import CANDefine, CANParser
|
from opendbc.can import CANDefine, CANParser
|
||||||
from opendbc.car import Bus, create_button_events, structs
|
from opendbc.car import Bus, create_button_events, structs
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE."""
|
""" AUTO-FORMATTED USING opendbc/car/debug/format_fingerprints.py, EDIT STRUCTURE THERE."""
|
||||||
# Provenance: portions of HKG firmware data are adapted from sunnypilot/opendbc master at
|
|
||||||
# f95f996f5 and its hkg-angle-steering-2025 branch at cc4b08625. See CREDITS.md.
|
|
||||||
from opendbc.car.structs import CarParams
|
from opendbc.car.structs import CarParams
|
||||||
from opendbc.car.hyundai.values import CAR
|
from opendbc.car.hyundai.values import CAR
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import copy
|
import copy
|
||||||
# Provenance: portions of HKG angle-command construction are adapted from sunnypilot/opendbc's
|
|
||||||
# hkg-angle-steering-2025 branch at cc4b08625. See CREDITS.md and THIRD_PARTY_NOTICES.md.
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from opendbc.car import CanBusBase, CanData
|
from opendbc.car import CanBusBase, CanData
|
||||||
from opendbc.car.common.conversions import Conversions as CV
|
from opendbc.car.common.conversions import Conversions as CV
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import time
|
import time
|
||||||
# Provenance: portions of HKG angle integration are adapted from sunnypilot/opendbc's
|
|
||||||
# hkg-angle-steering-2025 branch at cc4b08625. See CREDITS.md and THIRD_PARTY_NOTICES.md.
|
|
||||||
from opendbc.car import get_safety_config, structs, uds
|
from opendbc.car import get_safety_config, structs, uds
|
||||||
from opendbc.car.hyundai.hyundaicanfd import CanBus
|
from opendbc.car.hyundai.hyundaicanfd import CanBus
|
||||||
from opendbc.car.hyundai.values import HyundaiFlags, CAR, CarControllerParams, \
|
from opendbc.car.hyundai.values import HyundaiFlags, CAR, CarControllerParams, \
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ import re
|
|||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from enum import IntFlag
|
from enum import IntFlag
|
||||||
|
|
||||||
# Provenance: portions of HKG angle limits, flags, and platform data are adapted from
|
|
||||||
# sunnypilot/opendbc's hkg-angle-steering-2025 branch at cc4b08625. See CREDITS.md.
|
|
||||||
from opendbc.car import ACCELERATION_DUE_TO_GRAVITY, Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, uds
|
from opendbc.car import ACCELERATION_DUE_TO_GRAVITY, Bus, CarSpecs, DbcDict, PlatformConfig, Platforms, uds
|
||||||
from opendbc.car.lateral import AngleSteeringLimits, ISO_LATERAL_ACCEL
|
from opendbc.car.lateral import AngleSteeringLimits, ISO_LATERAL_ACCEL
|
||||||
from opendbc.car.common.conversions import Conversions as CV
|
from opendbc.car.common.conversions import Conversions as CV
|
||||||
|
|||||||
@@ -2,11 +2,6 @@
|
|||||||
|
|
||||||
#include "opendbc/safety/declarations.h"
|
#include "opendbc/safety/declarations.h"
|
||||||
|
|
||||||
// StarPilot's extended Ford curvature/angle enforcement below is substantially adapted from
|
|
||||||
// BluePilot bp-7.0 panda work, principally Alan Polk's 8f8d6d15f0a590f42b78de964ffb0d0af7f5d63d
|
|
||||||
// with shadow-curvature contributions from Jacob Neulight. See /CREDITS.md and
|
|
||||||
// /THIRD_PARTY_NOTICES.md. This comment does not attribute the surrounding upstream openpilot code.
|
|
||||||
|
|
||||||
// Safety-relevant CAN messages for Ford vehicles.
|
// Safety-relevant CAN messages for Ford vehicles.
|
||||||
#define FORD_EngBrakeData 0x165U // RX from PCM, for driver brake pedal and cruise state
|
#define FORD_EngBrakeData 0x165U // RX from PCM, for driver brake pedal and cruise state
|
||||||
#define FORD_EngVehicleSpThrottle 0x204U // RX from PCM, for driver throttle input
|
#define FORD_EngVehicleSpThrottle 0x204U // RX from PCM, for driver throttle input
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// Provenance: portions of HKG angle-command safety are adapted from sunnypilot/opendbc's
|
|
||||||
// hkg-angle-steering-2025 branch at cc4b08625. See CREDITS.md and THIRD_PARTY_NOTICES.md.
|
|
||||||
#include "opendbc/safety/declarations.h"
|
#include "opendbc/safety/declarations.h"
|
||||||
#include "opendbc/safety/modes/hyundai_common.h"
|
#include "opendbc/safety/modes/hyundai_common.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
# Provenance: portions of HKG angle-safety tests are adapted from sunnypilot/opendbc's
|
|
||||||
# hkg-angle-steering-2025 branch at cc4b08625. See CREDITS.md and THIRD_PARTY_NOTICES.md.
|
|
||||||
from parameterized import parameterized_class
|
from parameterized import parameterized_class
|
||||||
import unittest
|
import unittest
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
|
|||||||
extern const uint8_t gitversion[19];
|
extern const uint8_t gitversion[19];
|
||||||
const uint8_t gitversion[19] = "DEV-9cb1b6b1-DEBUG";
|
const uint8_t gitversion[19] = "DEV-cec1a0fb-DEBUG";
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
|||||||
DEV-9cb1b6b1-DEBUG
|
DEV-cec1a0fb-DEBUG
|
||||||
Binary file not shown.
@@ -72,7 +72,8 @@ class VCruiseHelper:
|
|||||||
return short_interval, long_interval
|
return short_interval, long_interval
|
||||||
|
|
||||||
def _uses_software_cruise(self) -> bool:
|
def _uses_software_cruise(self) -> bool:
|
||||||
return bool(self.gm_cc_only or self.redneck_non_pcm or not self.CP.pcmCruise)
|
return bool(self.gm_cc_only or self.redneck_non_pcm or
|
||||||
|
not self.CP.pcmCruise or getattr(self.CP, "openpilotLongitudinalControl", False))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def v_cruise_initialized(self):
|
def v_cruise_initialized(self):
|
||||||
|
|||||||
@@ -482,40 +482,49 @@ class TestVCruiseHelper:
|
|||||||
|
|
||||||
assert self.v_cruise_helper.v_cruise_kph == pytest.approx(initial_v_cruise_kph + IMPERIAL_INCREMENT)
|
assert self.v_cruise_helper.v_cruise_kph == pytest.approx(initial_v_cruise_kph + IMPERIAL_INCREMENT)
|
||||||
|
|
||||||
@pytest.mark.parametrize("openpilot_longitudinal", [False, True])
|
def test_openpilot_longitudinal_pcm_cruise_uses_custom_intervals(self):
|
||||||
def test_pcm_cruise_uses_pcm_speed(self, openpilot_longitudinal):
|
CP = car.CarParams(pcmCruise=True, openpilotLongitudinalControl=True)
|
||||||
CP = car.CarParams(pcmCruise=True, openpilotLongitudinalControl=openpilot_longitudinal)
|
|
||||||
helper = VCruiseHelper(CP)
|
helper = VCruiseHelper(CP)
|
||||||
toggles = SimpleNamespace(cruise_increase=5, cruise_increase_long=1, set_speed_limit=False)
|
toggles = SimpleNamespace(
|
||||||
pcm_speed_kph = 72.0
|
cruise_increase=5,
|
||||||
pcm_cluster_speed_kph = 71.0
|
cruise_increase_long=1,
|
||||||
|
is_metric=True,
|
||||||
|
set_speed_limit=False,
|
||||||
|
)
|
||||||
|
|
||||||
helper.initialize_v_cruise(car.CarState(vEgo=40 * CV.KPH_TO_MS), False, False, toggles)
|
helper.initialize_v_cruise(car.CarState(vEgo=40 * CV.KPH_TO_MS), False, False, toggles)
|
||||||
assert not helper.v_cruise_initialized
|
initial_v_cruise_kph = helper.v_cruise_kph
|
||||||
|
|
||||||
|
pressed_cs = car.CarState(cruiseState={"available": True})
|
||||||
|
pressed_cs.buttonEvents = [ButtonEvent(type=ButtonType.accelCruise, pressed=True)]
|
||||||
|
helper.update_v_cruise(pressed_cs, True, True, False, toggles)
|
||||||
|
|
||||||
|
released_cs = car.CarState(cruiseState={"available": True})
|
||||||
|
released_cs.buttonEvents = [ButtonEvent(type=ButtonType.accelCruise, pressed=False)]
|
||||||
|
helper.update_v_cruise(released_cs, True, True, False, toggles)
|
||||||
|
assert helper.v_cruise_kph == pytest.approx(initial_v_cruise_kph + 5)
|
||||||
|
|
||||||
|
pressed_cs.buttonEvents = [ButtonEvent(type=ButtonType.accelCruise, pressed=True)]
|
||||||
|
helper.update_v_cruise(pressed_cs, True, True, False, toggles)
|
||||||
|
for _ in range(50):
|
||||||
|
helper.update_v_cruise(car.CarState(cruiseState={"available": True}), True, True, False, toggles)
|
||||||
|
assert helper.v_cruise_kph == pytest.approx(initial_v_cruise_kph + 6)
|
||||||
|
|
||||||
|
def test_stock_pcm_cruise_still_uses_pcm_speed(self):
|
||||||
|
CP = car.CarParams(pcmCruise=True, openpilotLongitudinalControl=False)
|
||||||
|
helper = VCruiseHelper(CP)
|
||||||
|
toggles = SimpleNamespace(cruise_increase=5, cruise_increase_long=1)
|
||||||
|
pcm_speed_kph = 72.0
|
||||||
cs = car.CarState(
|
cs = car.CarState(
|
||||||
cruiseState={
|
cruiseState={
|
||||||
"available": True,
|
"available": True,
|
||||||
"speed": pcm_speed_kph * CV.KPH_TO_MS,
|
"speed": pcm_speed_kph * CV.KPH_TO_MS,
|
||||||
"speedCluster": pcm_cluster_speed_kph * CV.KPH_TO_MS,
|
"speedCluster": pcm_speed_kph * CV.KPH_TO_MS,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
helper.update_v_cruise(cs, True, True, False, toggles)
|
helper.update_v_cruise(cs, True, True, False, toggles)
|
||||||
assert helper.v_cruise_kph == pytest.approx(pcm_speed_kph)
|
assert helper.v_cruise_kph == pytest.approx(pcm_speed_kph)
|
||||||
assert helper.v_cruise_cluster_kph == pytest.approx(pcm_cluster_speed_kph)
|
|
||||||
|
|
||||||
next_pcm_speed_kph = 74.0
|
|
||||||
next_cs = car.CarState(
|
|
||||||
cruiseState={
|
|
||||||
"available": True,
|
|
||||||
"speed": next_pcm_speed_kph * CV.KPH_TO_MS,
|
|
||||||
"speedCluster": next_pcm_speed_kph * CV.KPH_TO_MS,
|
|
||||||
},
|
|
||||||
buttonEvents=[{"type": ButtonType.accelCruise, "pressed": False}],
|
|
||||||
)
|
|
||||||
helper.update_v_cruise(next_cs, True, True, False, toggles)
|
|
||||||
assert helper.v_cruise_kph == pytest.approx(next_pcm_speed_kph)
|
|
||||||
|
|
||||||
|
|
||||||
class TestVCruiseHelperRedneck:
|
class TestVCruiseHelperRedneck:
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user