mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-19 00:02:08 +08:00
openpilot v0.8.10 release
This commit is contained in:
Vendored
+7
-8
@@ -70,7 +70,7 @@ pipeline {
|
||||
}
|
||||
steps {
|
||||
phone_steps("eon-build", [
|
||||
["build release2-staging & dashcam-staging", "cd release && PUSH=1 ./build_release2.sh"],
|
||||
["build release2-staging & dashcam-staging", "PUSH=1 $SOURCE_DIR/release/build_release.sh"],
|
||||
])
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ pipeline {
|
||||
}
|
||||
steps {
|
||||
phone_steps("tici", [
|
||||
["build release3-staging & dashcam3-staging", "PUSH=1 $SOURCE_DIR/release/build_release3.sh"],
|
||||
["build release3-staging & dashcam3-staging", "PUSH=1 $SOURCE_DIR/release/build_release.sh"],
|
||||
])
|
||||
}
|
||||
}
|
||||
@@ -170,13 +170,12 @@ pipeline {
|
||||
steps {
|
||||
phone_steps("eon", [
|
||||
["build", "cd selfdrive/manager && ./build.py"],
|
||||
["test athena", "nosetests -s selfdrive/athena/tests/test_athenad_old.py"],
|
||||
["test sounds", "nosetests -s selfdrive/ui/tests/test_sounds.py"],
|
||||
["test boardd loopback", "nosetests -s selfdrive/boardd/tests/test_boardd_loopback.py"],
|
||||
["test sounds", "python selfdrive/ui/tests/test_soundd.py"],
|
||||
["test boardd loopback", "python selfdrive/boardd/tests/test_boardd_loopback.py"],
|
||||
["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"],
|
||||
["test encoder", "python selfdrive/loggerd/tests/test_encoder.py"],
|
||||
["test logcatd", "python selfdrive/logcatd/tests/test_logcatd_android.py"],
|
||||
//["test updater", "python installer/updater/test_updater.py"],
|
||||
["test updater", "python selfdrive/hardware/eon/test_neos_updater.py"],
|
||||
])
|
||||
}
|
||||
}
|
||||
@@ -224,7 +223,7 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('camerad') {
|
||||
stage('EON camerad') {
|
||||
steps {
|
||||
phone_steps("eon-party", [
|
||||
["build", "cd selfdrive/manager && ./build.py"],
|
||||
@@ -234,7 +233,7 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage('Tici camerad') {
|
||||
stage('tici camerad') {
|
||||
steps {
|
||||
phone_steps("tici-party", [
|
||||
["build", "cd selfdrive/manager && ./build.py"],
|
||||
|
||||
@@ -4,18 +4,11 @@ Table of Contents
|
||||
=======================
|
||||
|
||||
* [What is openpilot?](#what-is-openpilot)
|
||||
* [Integration with Stock Features](#integration-with-stock-features)
|
||||
* [Supported Hardware](#supported-hardware)
|
||||
* [Supported Cars](#supported-cars)
|
||||
* [Community Maintained Cars and Features](#community-maintained-cars-and-features)
|
||||
* [Installation Instructions](#installation-instructions)
|
||||
* [Limitations of openpilot ALC and LDW](#limitations-of-openpilot-alc-and-ldw)
|
||||
* [Limitations of openpilot ACC and FCW](#limitations-of-openpilot-acc-and-fcw)
|
||||
* [Limitations of openpilot DM](#limitations-of-openpilot-dm)
|
||||
* [Running in a car](#running-in-a-car)
|
||||
* [Running on PC](#running-on-pc)
|
||||
* [Community and Contributing](#community-and-contributing)
|
||||
* [User Data and comma Account](#user-data-and-comma-account)
|
||||
* [Safety and Testing](#safety-and-testing)
|
||||
* [Testing on PC](#testing-on-pc)
|
||||
* [Community and Contributing](#community-and-contributing)
|
||||
* [Directory Structure](#directory-structure)
|
||||
* [Licensing](#licensing)
|
||||
|
||||
@@ -24,7 +17,7 @@ Table of Contents
|
||||
What is openpilot?
|
||||
------
|
||||
|
||||
[openpilot](http://github.com/commaai/openpilot) is an open source driver assistance system. Currently, openpilot performs the functions of Adaptive Cruise Control (ACC), Automated Lane Centering (ALC), Forward Collision Warning (FCW) and Lane Departure Warning (LDW) for a growing variety of supported [car makes, models and model years](#supported-cars). In addition, while openpilot is engaged, a camera based Driver Monitoring (DM) feature alerts distracted and asleep drivers.
|
||||
[openpilot](http://github.com/commaai/openpilot) is an open source driver assistance system. Currently, openpilot performs the functions of Adaptive Cruise Control (ACC), Automated Lane Centering (ALC), Forward Collision Warning (FCW) and Lane Departure Warning (LDW) for a growing variety of [supported car makes, models and model years](docs/CARS.md). In addition, while openpilot is engaged, a camera based Driver Monitoring (DM) feature alerts distracted and asleep drivers. See more about [the vehicle integration and limitations here](docs/INTEGRATION.md).
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
@@ -41,306 +34,32 @@ What is openpilot?
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Integration with Stock Features
|
||||
|
||||
Running in a car
|
||||
------
|
||||
|
||||
In all supported cars:
|
||||
* Stock Lane Keep Assist (LKA) and stock ALC are replaced by openpilot ALC, which only functions when openpilot is engaged by the user.
|
||||
* Stock LDW is replaced by openpilot LDW.
|
||||
To use openpilot in a car, you need four things
|
||||
* This software. It's free and available right here.
|
||||
* One of [the 140+ supported cars](docs/CARS.md). We support Honda, Toyota, Hyundai, Nissan, Kia, Chrysler, Lexus, Acura, Audi, VW, and more. If your car is not supported, but has adaptive cruise control and lane keeping assist, it's likely able to run openpilot.
|
||||
* A supported device to run this software. This can be a [comma two](https://comma.ai/shop/products/two), [comma three](https://comma.ai/shop/products/three), or if you like to experiment, a [Ubuntu computer with webcams](https://github.com/commaai/openpilot/tree/master/tools/webcam).
|
||||
* A way to connect to your car. With a comma two or three, you need only a [car harness](https://comma.ai/shop/products/car-harness). With an EON Gold or PC, you also need a [black panda](https://comma.ai/shop/products/panda).
|
||||
|
||||
Additionally, on specific supported cars (see ACC column in [supported cars](#supported-cars)):
|
||||
* Stock ACC is replaced by openpilot ACC.
|
||||
* openpilot FCW operates in addition to stock FCW.
|
||||
We have detailed instructions for [how to install the device in a car](https://comma.ai/setup).
|
||||
|
||||
openpilot should preserve all other vehicle's stock features, including, but are not limited to: FCW, Automatic Emergency Braking (AEB), auto high-beam, blind spot warning, and side collision warning.
|
||||
|
||||
Supported Hardware
|
||||
Running on PC
|
||||
------
|
||||
|
||||
At the moment, openpilot supports the EON Gold DevKit, [comma two](https://comma.ai/shop/products/two), and [comma three](https://comma.ai/shop/products/three). A [car harness](https://comma.ai/shop/products/car-harness) is recommended to connect your device to the car. For experimental purposes, openpilot can also run on an Ubuntu computer with external [webcams](https://github.com/commaai/openpilot/tree/master/tools/webcam).
|
||||
All of openpilot's services can run as normal on a PC, even without special hardware or a car. To develop or experiment with openpilot you can run openpilot on recorded or simulated data.
|
||||
|
||||
Supported Cars
|
||||
------
|
||||
With openpilot's tools you can plot logs, replay drives and watch the full-res camera streams. See [the tools README](tools/README.md) for more information.
|
||||
|
||||
| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below |
|
||||
| ----------| ------------------------------| ------------------| -----------------| -------------------| ------------------|
|
||||
| Acura | ILX 2016-19 | AcuraWatch Plus | openpilot | 25mph<sup>1</sup> | 25mph |
|
||||
| Acura | RDX 2016-18 | AcuraWatch Plus | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Acura | RDX 2019-21 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Accord 2018-20 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Accord Hybrid 2018-20 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Civic Hatchback 2017-21 | Honda Sensing | Stock | 0mph | 12mph |
|
||||
| Honda | Civic Coupe 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
|
||||
| Honda | Civic Coupe 2019-20 | All | Stock | 0mph | 2mph<sup>2</sup> |
|
||||
| Honda | Civic Sedan 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
|
||||
| Honda | Civic Sedan 2019-20 | All | Stock | 0mph | 2mph<sup>2</sup> |
|
||||
| Honda | CR-V 2015-16 | Touring | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | CR-V 2017-21 | Honda Sensing | Stock | 0mph | 12mph |
|
||||
| Honda | CR-V Hybrid 2017-2019 | Honda Sensing | Stock | 0mph | 12mph |
|
||||
| Honda | e 2020 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Fit 2018-19 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | HR-V 2019-20 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Insight 2019-21 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Inspire 2018 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Odyssey 2018-20 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 0mph |
|
||||
| Honda | Passport 2019 | All | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Pilot 2016-19 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Ridgeline 2017-21 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Hyundai | Palisade 2020-21 | All | Stock | 0mph | 0mph |
|
||||
| Hyundai | Sonata 2020-21 | All | Stock | 0mph | 0mph |
|
||||
| Lexus | CT Hybrid 2017-18 | LSS | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | ES 2019-21 | All | openpilot | 0mph | 0mph |
|
||||
| Lexus | ES Hybrid 2017-18 | LSS | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | ES Hybrid 2019-21 | All | openpilot | 0mph | 0mph |
|
||||
| Lexus | IS 2017-2019 | All | Stock | 22mph | 0mph |
|
||||
| Lexus | NX 2018 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | NX 2020 | All | openpilot | 0mph | 0mph |
|
||||
| Lexus | NX Hybrid 2018-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | RX 2016-18 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | RX 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Lexus | RX Hybrid 2016-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | RX Hybrid 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Lexus | UX Hybrid 2019-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Alphard 2020 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Avalon 2016-21 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Avalon Hybrid 2019-21 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Camry 2018-20 | All | Stock | 0mph<sup>4</sup> | 0mph |
|
||||
| Toyota | Camry 2021 | All | openpilot | 0mph<sup>4</sup> | 0mph |
|
||||
| Toyota | Camry Hybrid 2018-20 | All | Stock | 0mph<sup>4</sup> | 0mph |
|
||||
| Toyota | Camry Hybrid 2021 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | C-HR 2017-20 | All | Stock | 0mph | 0mph |
|
||||
| Toyota | C-HR Hybrid 2017-19 | All | Stock | 0mph | 0mph |
|
||||
| Toyota | Corolla 2017-19 | All | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Corolla 2020-22 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Corolla Hatchback 2019-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Corolla Hybrid 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Highlander 2017-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Highlander 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Highlander Hybrid 2017-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Highlander Hybrid 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Mirai 2021 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Prius 2016-20 | TSS-P | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Prius 2021 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Prius Prime 2017-20 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Prius Prime 2021 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Rav4 2016-18 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Rav4 2019-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Rav4 Hybrid 2016-18 | TSS-P | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Rav4 Hybrid 2019-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Sienna 2018-20 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
|
||||
<sup>1</sup>[Comma Pedal](https://github.com/commaai/openpilot/wiki/comma-pedal) is used to provide stop-and-go capability to some of the openpilot-supported cars that don't currently support stop-and-go. ***NOTE: The Comma Pedal is not officially supported by [comma](https://comma.ai).*** <br />
|
||||
<sup>2</sup>2019 Honda Civic 1.6L Diesel Sedan does not have ALC below 12mph. <br />
|
||||
<sup>3</sup>When disconnecting the Driver Support Unit (DSU), openpilot ACC will replace stock ACC. ***NOTE: disconnecting the DSU disables Automatic Emergency Braking (AEB).*** <br />
|
||||
<sup>4</sup>28mph for Camry 4CYL L, 4CYL LE and 4CYL SE which don't have Full-Speed Range Dynamic Radar Cruise Control. <br />
|
||||
|
||||
Community Maintained Cars and Features
|
||||
------
|
||||
|
||||
| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below |
|
||||
| ----------| ------------------------------| ------------------| -----------------| -------------------| -------------|
|
||||
| Audi | A3 2014-19 | Prestige | Stock | 0mph | 0mph |
|
||||
| Audi | A3 Sportback e-tron 2017-18 | Prestige | Stock | 0mph | 0mph |
|
||||
| Audi | Q2 2018 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Buick | Regal 2018<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Cadillac | ATS 2018<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Chevrolet | Malibu 2017<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Chevrolet | Volt 2017-18<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Chrysler | Pacifica 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph |
|
||||
| Chrysler | Pacifica 2020 | Adaptive Cruise | Stock | 0mph | 39mph |
|
||||
| Chrysler | Pacifica Hybrid 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph |
|
||||
| Chrysler | Pacifica Hybrid 2019-21 | Adaptive Cruise | Stock | 0mph | 39mph |
|
||||
| Genesis | G70 2018 | All | Stock | 0mph | 0mph |
|
||||
| Genesis | G80 2018 | All | Stock | 0mph | 0mph |
|
||||
| Genesis | G90 2018 | All | Stock | 0mph | 0mph |
|
||||
| GMC | Acadia 2018<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Holden | Astra 2017<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Hyundai | Elantra 2017-19 | SCC + LKAS | Stock | 19mph | 34mph |
|
||||
| Hyundai | Elantra 2021 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Elantra Hybrid 2021 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Genesis 2015-16 | SCC + LKAS | Stock | 19mph | 37mph |
|
||||
| Hyundai | Ioniq Electric 2019 | SCC + LKAS | Stock | 0mph | 32mph |
|
||||
| Hyundai | Ioniq Electric 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Ioniq PHEV 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Kona 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Kona EV 2018-19 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Kona Hybrid 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Santa Fe 2019-20 | All | Stock | 0mph | 0mph |
|
||||
| Hyundai | Sonata 2018-2019 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Sonata Hybrid 2021 | All | Stock | 0mph | 0mph |
|
||||
| Hyundai | Veloster 2019-20 | SCC + LKAS | Stock | 5mph | 0mph |
|
||||
| Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Stock | 0mph | 9mph |
|
||||
| Jeep | Grand Cherokee 2019-20 | Adaptive Cruise | Stock | 0mph | 39mph |
|
||||
| Kia | Forte 2018-21 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Niro EV 2019-21 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Niro Hybrid 2021 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Niro PHEV 2019 | SCC + LKAS | Stock | 10mph | 32mph |
|
||||
| Kia | Optima 2017 | SCC + LKAS | Stock | 0mph | 32mph |
|
||||
| Kia | Optima 2019 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Seltos 2021 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Sorento 2018-19 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Stinger 2018 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Ceed 2019 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Telluride 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Nissan | Altima 2019-20 | ProPILOT | Stock | 0mph | 0mph |
|
||||
| Nissan | Leaf 2018-20 | ProPILOT | Stock | 0mph | 0mph |
|
||||
| Nissan | Rogue 2018-20 | ProPILOT | Stock | 0mph | 0mph |
|
||||
| Nissan | X-Trail 2017 | ProPILOT | Stock | 0mph | 0mph |
|
||||
| SEAT | Ateca 2018 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| SEAT | Leon 2014-2020 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Škoda | Kodiaq 2018-19 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Škoda | Octavia 2015, 2018-19 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Škoda | Octavia RS 2016 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Škoda | Scala 2020 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Škoda | Superb 2015-18 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Subaru | Ascent 2019 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Subaru | Crosstrek 2018-19 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Subaru | Forester 2019-21 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Subaru | Impreza 2017-19 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Atlas 2018-19 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| e-Golf 2014, 2019-20 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf 2015-20 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf Alltrack 2017-18 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf GTE 2016 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf GTI 2018-20 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf R 2016-19 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf SportsVan 2016 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf SportWagen 2015 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Jetta 2018-20 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Jetta GLI 2021 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Passat 2016-17<sup>2</sup> | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| T-Cross 2021 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Tiguan 2020 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Touran 2017 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
|
||||
<sup>1</sup>Requires an [OBD-II car harness](https://comma.ai/shop/products/comma-car-harness) and [community built ASCM harness](https://github.com/commaai/openpilot/wiki/GM#hardware). ***NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).*** <br />
|
||||
<sup>2</sup>Only includes the MQB Passat sold outside of North America. The NMS Passat made in Chattanooga TN is not yet supported.
|
||||
|
||||
Community Maintained Cars and Features are not verified by comma to meet our [safety model](SAFETY.md). Be extra cautious using them. They are only available after enabling the toggle in `Settings->Developer->Enable Community Features`.
|
||||
|
||||
To promote a car from community maintained, it must meet a few requirements. We must own one from the brand, we must sell the harness for it, has full ISO26262 in both panda and openpilot, there must be a path forward for longitudinal control, it must have AEB still enabled, and it must support fingerprinting 2.0
|
||||
|
||||
Although they're not upstream, the community has openpilot running on other makes and models. See the 'Community Supported Models' section of each make [on our wiki](https://wiki.comma.ai/).
|
||||
|
||||
Installation Instructions
|
||||
------
|
||||
|
||||
Install openpilot on a supported device by entering ``https://openpilot.comma.ai`` during the installer setup.
|
||||
|
||||
Follow these [video instructions](https://youtu.be/lcjqxCymins) to properly mount the device on the windshield. Note: openpilot features an automatic pose calibration routine and openpilot performance should not be affected by small pitch and yaw misalignments caused by imprecise device mounting.
|
||||
|
||||
Before placing the device on your windshield, check the state and local laws and ordinances where you drive. Some state laws prohibit or restrict the placement of objects on the windshield of a motor vehicle.
|
||||
|
||||
You will be able to engage openpilot after reviewing the onboarding screens and finishing the calibration procedure.
|
||||
|
||||
Limitations of openpilot ALC and LDW
|
||||
------
|
||||
|
||||
openpilot ALC and openpilot LDW do not automatically drive the vehicle or reduce the amount of attention that must be paid to operate your vehicle. The driver must always keep control of the steering wheel and be ready to correct the openpilot ALC action at all times.
|
||||
|
||||
While changing lanes, openpilot is not capable of looking next to you or checking your blind spot. Only nudge the wheel to initiate a lane change after you have confirmed it's safe to do so.
|
||||
|
||||
Many factors can impact the performance of openpilot ALC and openpilot LDW, causing them to be unable to function as intended. These include, but are not limited to:
|
||||
|
||||
* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation.
|
||||
* The road facing camera is obstructed, covered or damaged by mud, ice, snow, etc.
|
||||
* Obstruction caused by applying excessive paint or adhesive products (such as wraps, stickers, rubber coating, etc.) onto the vehicle.
|
||||
* The device is mounted incorrectly.
|
||||
* When in sharp curves, like on-off ramps, intersections etc...; openpilot is designed to be limited in the amount of steering torque it can produce.
|
||||
* In the presence of restricted lanes or construction zones.
|
||||
* When driving on highly banked roads or in presence of strong cross-wind.
|
||||
* Extremely hot or cold temperatures.
|
||||
* Bright light (due to oncoming headlights, direct sunlight, etc.).
|
||||
* Driving on hills, narrow, or winding roads.
|
||||
|
||||
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. It is the driver's responsibility to be in control of the vehicle at all times.
|
||||
|
||||
Limitations of openpilot ACC and FCW
|
||||
------
|
||||
|
||||
openpilot ACC and openpilot FCW are not systems that allow careless or inattentive driving. It is still necessary for the driver to pay close attention to the vehicle’s surroundings and to be ready to re-take control of the gas and the brake at all times.
|
||||
|
||||
Many factors can impact the performance of openpilot ACC and openpilot FCW, causing them to be unable to function as intended. These include, but are not limited to:
|
||||
|
||||
* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation.
|
||||
* The road facing camera or radar are obstructed, covered, or damaged by mud, ice, snow, etc.
|
||||
* Obstruction caused by applying excessive paint or adhesive products (such as wraps, stickers, rubber coating, etc.) onto the vehicle.
|
||||
* The device is mounted incorrectly.
|
||||
* Approaching a toll booth, a bridge or a large metal plate.
|
||||
* When driving on roads with pedestrians, cyclists, etc...
|
||||
* In presence of traffic signs or stop lights, which are not detected by openpilot at this time.
|
||||
* When the posted speed limit is below the user selected set speed. openpilot does not detect speed limits at this time.
|
||||
* In presence of vehicles in the same lane that are not moving.
|
||||
* When abrupt braking maneuvers are required. openpilot is designed to be limited in the amount of deceleration and acceleration that it can produce.
|
||||
* When surrounding vehicles perform close cut-ins from neighbor lanes.
|
||||
* Driving on hills, narrow, or winding roads.
|
||||
* Extremely hot or cold temperatures.
|
||||
* Bright light (due to oncoming headlights, direct sunlight, etc.).
|
||||
* Interference from other equipment that generates radar waves.
|
||||
|
||||
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. It is the driver's responsibility to be in control of the vehicle at all times.
|
||||
|
||||
Limitations of openpilot DM
|
||||
------
|
||||
|
||||
openpilot DM should not be considered an exact measurement of the alertness of the driver.
|
||||
|
||||
Many factors can impact the performance of openpilot DM, causing it to be unable to function as intended. These include, but are not limited to:
|
||||
|
||||
* Low light conditions, such as driving at night or in dark tunnels.
|
||||
* Bright light (due to oncoming headlights, direct sunlight, etc.).
|
||||
* The driver's face is partially or completely outside field of view of the driver facing camera.
|
||||
* The driver facing camera is obstructed, covered, or damaged.
|
||||
|
||||
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. A driver should not rely on openpilot DM to assess their level of attention.
|
||||
|
||||
User Data and comma Account
|
||||
------
|
||||
|
||||
By default, openpilot uploads the driving data to our servers. You can also access your data by pairing with the comma connect app ([iOS](https://apps.apple.com/us/app/comma-connect/id1456551889), [Android](https://play.google.com/store/apps/details?id=ai.comma.connect&hl=en_US)). We use your data to train better models and improve openpilot for everyone.
|
||||
|
||||
openpilot is open source software: the user is free to disable data collection if they wish to do so.
|
||||
|
||||
openpilot logs the road facing camera, 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.
|
||||
|
||||
By using openpilot, you agree to [our Privacy Policy](https://connect.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.
|
||||
|
||||
Safety and Testing
|
||||
----
|
||||
|
||||
* openpilot observes ISO26262 guidelines, see [SAFETY.md](SAFETY.md) for more details.
|
||||
* openpilot has software in the loop [tests](.github/workflows/selfdrive_tests.yaml) that run on every commit.
|
||||
* The safety model code 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.
|
||||
|
||||
Testing on PC
|
||||
------
|
||||
For simplified development and experimentation, openpilot can be run in the CARLA driving simulator, which allows you to develop openpilot without a car. The whole setup should only take a few minutes.
|
||||
|
||||
Steps:
|
||||
1) Start the CARLA server on first terminal
|
||||
```
|
||||
bash -c "$(curl https://raw.githubusercontent.com/commaai/openpilot/master/tools/sim/start_carla.sh)"
|
||||
```
|
||||
2) Start openpilot on second terminal
|
||||
```
|
||||
bash -c "$(curl https://raw.githubusercontent.com/commaai/openpilot/master/tools/sim/start_openpilot_docker.sh)"
|
||||
```
|
||||
3) Press 1 to engage openpilot
|
||||
|
||||
See the full [README](tools/sim/README.md)
|
||||
|
||||
You should also take a look at the tools directory in master: lots of tools you can use to replay driving data, test, and develop openpilot from your PC.
|
||||
You can also run openpilot in simulation [with the CARLA simulator](tools/sim/README.md). This allows openpilot to drive around a virtual car on your Ubuntu machine. The whole setup should only take a few minutes, but does require a decent GPU.
|
||||
|
||||
|
||||
Community and Contributing
|
||||
------
|
||||
|
||||
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). Bug fixes and new car ports are encouraged.
|
||||
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). Bug fixes and new car ports are encouraged. Check out [the contributing docs](docs/CONTRIBUTING.md).
|
||||
|
||||
You can add support for your car by following guides we have written for [Brand](https://blog.comma.ai/how-to-write-a-car-port-for-openpilot/) and [Model](https://blog.comma.ai/openpilot-port-guide-for-toyota-models/) ports. Generally, a car with adaptive cruise control and lane keep assist is a good candidate. [Join our Discord](https://discord.comma.ai) to discuss car ports: most car makes have a dedicated channel.
|
||||
|
||||
@@ -348,16 +67,39 @@ Want to get paid to work on openpilot? [comma is hiring](https://comma.ai/jobs/)
|
||||
|
||||
And [follow us on Twitter](https://twitter.com/comma_ai).
|
||||
|
||||
User Data and comma Account
|
||||
------
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
Safety and Testing
|
||||
----
|
||||
|
||||
* openpilot observes ISO26262 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.
|
||||
|
||||
Directory Structure
|
||||
------
|
||||
.
|
||||
├── cereal # The messaging spec and libs used for all logs
|
||||
├── common # Library like functionality we've developed here
|
||||
├── installer/updater # Manages updates of NEOS
|
||||
├── docs # Documentation
|
||||
├── opendbc # Files showing how to interpret data from cars
|
||||
├── panda # Code used to communicate on CAN
|
||||
├── phonelibs # External libraries
|
||||
├── pyextra # Extra python packages not shipped in NEOS
|
||||
├── third_party # External libraries
|
||||
├── pyextra # Extra python packages
|
||||
└── selfdrive # Code needed to drive the car
|
||||
├── assets # Fonts, images, and sounds for UI
|
||||
├── athena # Allows communication with the app
|
||||
@@ -381,7 +123,7 @@ Licensing
|
||||
|
||||
openpilot is released under the MIT license. Some parts of the software are released under other licenses as specified.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
**THIS IS ALPHA QUALITY SOFTWARE FOR RESEARCH PURPOSES ONLY. THIS IS NOT A PRODUCT.
|
||||
YOU ARE RESPONSIBLE FOR COMPLYING WITH LOCAL LAWS AND REGULATIONS.
|
||||
|
||||
+31
@@ -1,3 +1,34 @@
|
||||
Version 0.8.10 (2021-11-01)
|
||||
========================
|
||||
* New driving model
|
||||
* Trained on one million minutes!!!
|
||||
* Fixed lead training making lead predictions significantly more accurate
|
||||
* Fixed several localizer dataset bugs and loss function bugs, overall improved accuracy
|
||||
* New driver monitoring model
|
||||
* Trained on latest data from both comma two and comma three
|
||||
* Increased model field of view by 40% on comma three
|
||||
* Improved model stability on masked users
|
||||
* Improved pose prediction with reworked ground-truth stack
|
||||
* Lateral and longitudinal planning MPCs now in ACADOS
|
||||
* Combined longitudinal MPCs
|
||||
* All longitudinal planning now happens in a single MPC system
|
||||
* Fixed instability in MPC problem to prevent sporadic CPU usage
|
||||
* AGNOS 2: minor stability improvements and builder repo open sourced
|
||||
* tools: new and improved replay thanks to deanlee!
|
||||
* Moved community-supported cars outside of the Community Features toggle
|
||||
* Improved FW fingerprinting reliability for Hyundai/Kia/Genesis
|
||||
* Added prerequisites for longitudinal control on Hyundai/Kia/Genesis and Honda Bosch
|
||||
* Audi S3 2015 support thanks to jyoung8607!
|
||||
* Honda Freed 2020 support thanks to belm0!
|
||||
* Hyundai Ioniq Hybrid 2020-2022 support thanks to sunnyhaibin!
|
||||
* Hyundai Santa Fe 2022 support thanks to sunnyhaibin!
|
||||
* Kia K5 2021 support thanks to sunnyhaibin!
|
||||
* Škoda Kamiq 2021 support thanks to jyoung8607!
|
||||
* Škoda Karoq 2019 support thanks to jyoung8607!
|
||||
* Volkswagen Arteon 2021 support thanks to jyoung8607!
|
||||
* Volkswagen California 2021 support thanks to jyoung8607!
|
||||
* Volkswagen Taos 2022 support thanks to jyoung8607!
|
||||
|
||||
Version 0.8.9 (2021-09-14)
|
||||
========================
|
||||
* Improved fan control on comma three
|
||||
|
||||
+51
-49
@@ -37,10 +37,6 @@ AddOption('--compile_db',
|
||||
action='store_true',
|
||||
help='build clang compilation database')
|
||||
|
||||
AddOption('--mpc-generate',
|
||||
action='store_true',
|
||||
help='regenerates the mpc sources')
|
||||
|
||||
AddOption('--snpe',
|
||||
action='store_true',
|
||||
help='use SNPE on PC')
|
||||
@@ -64,13 +60,21 @@ if arch == "aarch64" and TICI:
|
||||
arch = "larch64"
|
||||
|
||||
USE_WEBCAM = os.getenv("USE_WEBCAM") is not None
|
||||
USE_FRAME_STREAM = os.getenv("USE_FRAME_STREAM") is not None
|
||||
|
||||
lenv = {
|
||||
"PATH": os.environ['PATH'],
|
||||
"LD_LIBRARY_PATH": [Dir(f"#third_party/acados/{arch}/lib").abspath],
|
||||
"PYTHONPATH": Dir("#").abspath + ":" + Dir("#pyextra/").abspath,
|
||||
|
||||
"ACADOS_SOURCE_DIR": Dir("#third_party/acados/acados").abspath,
|
||||
"TERA_PATH": Dir("#").abspath + f"/third_party/acados/{arch}/t_renderer",
|
||||
}
|
||||
|
||||
rpath = lenv["LD_LIBRARY_PATH"].copy()
|
||||
|
||||
if arch == "aarch64" or arch == "larch64":
|
||||
lenv["LD_LIBRARY_PATH"] = '/data/data/com.termux/files/usr/lib'
|
||||
lenv["LD_LIBRARY_PATH"] += ['/data/data/com.termux/files/usr/lib']
|
||||
|
||||
if arch == "aarch64":
|
||||
# android
|
||||
@@ -78,7 +82,7 @@ if arch == "aarch64" or arch == "larch64":
|
||||
lenv["ANDROID_ROOT"] = os.environ['ANDROID_ROOT']
|
||||
|
||||
cpppath = [
|
||||
"#phonelibs/opencl/include",
|
||||
"#third_party/opencl/include",
|
||||
]
|
||||
|
||||
libpath = [
|
||||
@@ -86,13 +90,14 @@ if arch == "aarch64" or arch == "larch64":
|
||||
"/usr/lib",
|
||||
"/system/vendor/lib64",
|
||||
"/system/comma/usr/lib",
|
||||
"#phonelibs/nanovg",
|
||||
"#third_party/nanovg",
|
||||
f"#third_party/acados/{arch}/lib",
|
||||
]
|
||||
|
||||
if arch == "larch64":
|
||||
libpath += [
|
||||
"#phonelibs/snpe/larch64",
|
||||
"#phonelibs/libyuv/larch64/lib",
|
||||
"#third_party/snpe/larch64",
|
||||
"#third_party/libyuv/larch64/lib",
|
||||
"/usr/lib/aarch64-linux-gnu"
|
||||
]
|
||||
cpppath += [
|
||||
@@ -100,16 +105,16 @@ if arch == "aarch64" or arch == "larch64":
|
||||
]
|
||||
cflags = ["-DQCOM2", "-mcpu=cortex-a57"]
|
||||
cxxflags = ["-DQCOM2", "-mcpu=cortex-a57"]
|
||||
rpath = ["/usr/local/lib"]
|
||||
rpath += ["/usr/local/lib"]
|
||||
else:
|
||||
rpath = []
|
||||
libpath += [
|
||||
"#phonelibs/snpe/aarch64",
|
||||
"#phonelibs/libyuv/lib",
|
||||
"#third_party/snpe/aarch64",
|
||||
"#third_party/libyuv/lib",
|
||||
"/system/vendor/lib64"
|
||||
]
|
||||
cflags = ["-DQCOM", "-D_USING_LIBCXX", "-mcpu=cortex-a57"]
|
||||
cxxflags = ["-DQCOM", "-D_USING_LIBCXX", "-mcpu=cortex-a57"]
|
||||
rpath = []
|
||||
else:
|
||||
cflags = []
|
||||
cxxflags = []
|
||||
@@ -118,7 +123,7 @@ else:
|
||||
if arch == "Darwin":
|
||||
yuv_dir = "mac" if real_arch != "arm64" else "mac_arm64"
|
||||
libpath = [
|
||||
f"#phonelibs/libyuv/{yuv_dir}/lib",
|
||||
f"#third_party/libyuv/{yuv_dir}/lib",
|
||||
"/usr/local/lib",
|
||||
"/opt/homebrew/lib",
|
||||
"/usr/local/opt/openssl/lib",
|
||||
@@ -134,24 +139,22 @@ else:
|
||||
]
|
||||
else:
|
||||
libpath = [
|
||||
"#phonelibs/snpe/x86_64-linux-clang",
|
||||
"#phonelibs/libyuv/x64/lib",
|
||||
"#phonelibs/mapbox-gl-native-qt/x86_64",
|
||||
"#third_party/acados/x86_64/lib",
|
||||
"#third_party/snpe/x86_64-linux-clang",
|
||||
"#third_party/libyuv/x64/lib",
|
||||
"#third_party/mapbox-gl-native-qt/x86_64",
|
||||
"#cereal",
|
||||
"#selfdrive/common",
|
||||
"/usr/lib",
|
||||
"/usr/local/lib",
|
||||
]
|
||||
|
||||
rpath = [
|
||||
"phonelibs/snpe/x86_64-linux-clang",
|
||||
"cereal",
|
||||
"selfdrive/common"
|
||||
rpath += [
|
||||
Dir("#third_party/snpe/x86_64-linux-clang").abspath,
|
||||
Dir("#cereal").abspath,
|
||||
Dir("#selfdrive/common").abspath
|
||||
]
|
||||
|
||||
# allows shared libraries to work globally
|
||||
rpath = [os.path.join(os.getcwd(), x) for x in rpath]
|
||||
|
||||
if GetOption('asan'):
|
||||
ccflags = ["-fsanitize=address", "-fno-omit-frame-pointer"]
|
||||
ldflags = ["-fsanitize=address"]
|
||||
@@ -164,15 +167,12 @@ else:
|
||||
|
||||
# no --as-needed on mac linker
|
||||
if arch != "Darwin":
|
||||
ldflags += ["-Wl,--as-needed"]
|
||||
ldflags += ["-Wl,--as-needed", "-Wl,--no-undefined"]
|
||||
|
||||
# Enable swaglog include in submodules
|
||||
cflags += ["-DSWAGLOG"]
|
||||
cxxflags += ["-DSWAGLOG"]
|
||||
|
||||
# change pythonpath to this
|
||||
lenv["PYTHONPATH"] = Dir("#").path
|
||||
|
||||
env = Environment(
|
||||
ENV=lenv,
|
||||
CCFLAGS=[
|
||||
@@ -191,22 +191,25 @@ env = Environment(
|
||||
|
||||
CPPPATH=cpppath + [
|
||||
"#",
|
||||
"#phonelibs/catch2/include",
|
||||
"#phonelibs/bzip2",
|
||||
"#phonelibs/libyuv/include",
|
||||
"#phonelibs/openmax/include",
|
||||
"#phonelibs/json11",
|
||||
"#phonelibs/curl/include",
|
||||
"#phonelibs/libgralloc/include",
|
||||
"#phonelibs/android_frameworks_native/include",
|
||||
"#phonelibs/android_hardware_libhardware/include",
|
||||
"#phonelibs/android_system_core/include",
|
||||
"#phonelibs/linux/include",
|
||||
"#phonelibs/snpe/include",
|
||||
"#phonelibs/mapbox-gl-native-qt/include",
|
||||
"#phonelibs/nanovg",
|
||||
"#phonelibs/qrcode",
|
||||
"#phonelibs",
|
||||
"#third_party/acados/include",
|
||||
"#third_party/acados/include/blasfeo/include",
|
||||
"#third_party/acados/include/hpipm/include",
|
||||
"#third_party/catch2/include",
|
||||
"#third_party/bzip2",
|
||||
"#third_party/libyuv/include",
|
||||
"#third_party/openmax/include",
|
||||
"#third_party/json11",
|
||||
"#third_party/curl/include",
|
||||
"#third_party/libgralloc/include",
|
||||
"#third_party/android_frameworks_native/include",
|
||||
"#third_party/android_hardware_libhardware/include",
|
||||
"#third_party/android_system_core/include",
|
||||
"#third_party/linux/include",
|
||||
"#third_party/snpe/include",
|
||||
"#third_party/mapbox-gl-native-qt/include",
|
||||
"#third_party/nanovg",
|
||||
"#third_party/qrcode",
|
||||
"#third_party",
|
||||
"#cereal",
|
||||
"#opendbc/can",
|
||||
],
|
||||
@@ -221,7 +224,7 @@ env = Environment(
|
||||
CXXFLAGS=["-std=c++1z"] + cxxflags,
|
||||
LIBPATH=libpath + [
|
||||
"#cereal",
|
||||
"#phonelibs",
|
||||
"#third_party",
|
||||
"#opendbc/can",
|
||||
"#selfdrive/boardd",
|
||||
"#selfdrive/common",
|
||||
@@ -346,7 +349,7 @@ if GetOption("clazy"):
|
||||
qt_env['ENV']['CLAZY_IGNORE_DIRS'] = qt_dirs[0]
|
||||
qt_env['ENV']['CLAZY_CHECKS'] = ','.join(checks)
|
||||
|
||||
Export('env', 'qt_env', 'arch', 'real_arch', 'SHARED', 'USE_WEBCAM')
|
||||
Export('env', 'qt_env', 'arch', 'real_arch', 'SHARED', 'USE_WEBCAM', 'USE_FRAME_STREAM')
|
||||
|
||||
SConscript(['selfdrive/common/SConscript'])
|
||||
Import('_common', '_gpucommon', '_gpu_libs')
|
||||
@@ -400,7 +403,7 @@ SConscript(['cereal/SConscript'])
|
||||
SConscript(['panda/board/SConscript'])
|
||||
SConscript(['opendbc/can/SConscript'])
|
||||
|
||||
SConscript(['phonelibs/SConscript'])
|
||||
SConscript(['third_party/SConscript'])
|
||||
|
||||
SConscript(['common/SConscript'])
|
||||
SConscript(['common/kalman/SConscript'])
|
||||
@@ -410,8 +413,7 @@ SConscript(['selfdrive/camerad/SConscript'])
|
||||
SConscript(['selfdrive/modeld/SConscript'])
|
||||
|
||||
SConscript(['selfdrive/controls/lib/cluster/SConscript'])
|
||||
SConscript(['selfdrive/controls/lib/lateral_mpc/SConscript'])
|
||||
SConscript(['selfdrive/controls/lib/lead_mpc_lib/SConscript'])
|
||||
SConscript(['selfdrive/controls/lib/lateral_mpc_lib/SConscript'])
|
||||
SConscript(['selfdrive/controls/lib/longitudinal_mpc_lib/SConscript'])
|
||||
|
||||
SConscript(['selfdrive/boardd/SConscript'])
|
||||
|
||||
+1
-6
@@ -9,16 +9,11 @@ messaging_dir = Dir('messaging')
|
||||
# Build cereal
|
||||
|
||||
schema_files = ['log.capnp', 'car.capnp', 'legacy.capnp']
|
||||
env.Command(["gen/c/include/c++.capnp.h", "gen/c/include/java.capnp.h"], [], "mkdir -p " + gen_dir.path + "/c/include && touch $TARGETS")
|
||||
env.Command(["gen/c/include/c++.capnp.h"], [], "mkdir -p " + gen_dir.path + "/c/include && touch $TARGETS")
|
||||
env.Command([f'gen/cpp/{s}.c++' for s in schema_files] + [f'gen/cpp/{s}.h' for s in schema_files],
|
||||
schema_files,
|
||||
f"capnpc --src-prefix={cereal_dir.path} $SOURCES -o c++:{gen_dir.path}/cpp/")
|
||||
|
||||
if shutil.which('capnpc-java'):
|
||||
env.Command(['gen/java/Car.java', 'gen/java/Log.java'],
|
||||
schema_files,
|
||||
f"capnpc $SOURCES --src-prefix={cereal_dir.path} -o java:{gen_dir.path}/java/")
|
||||
|
||||
# TODO: remove non shared cereal and messaging
|
||||
cereal_objects = env.SharedObject([f'gen/cpp/{s}.c++' for s in schema_files])
|
||||
|
||||
|
||||
+17
-11
@@ -1,10 +1,6 @@
|
||||
using Cxx = import "./include/c++.capnp";
|
||||
$Cxx.namespace("cereal");
|
||||
|
||||
using Java = import "./include/java.capnp";
|
||||
$Java.package("ai.comma.openpilot.cereal");
|
||||
$Java.outerClassname("Car");
|
||||
|
||||
@0x8e2af1e708af8b8d;
|
||||
|
||||
# ******* events causing controls state machine transition *******
|
||||
@@ -88,7 +84,6 @@ struct CarEvent @0x9b1657f34caf3ad3 {
|
||||
startupNoCar @76;
|
||||
startupNoControl @77;
|
||||
startupMaster @78;
|
||||
startupFuzzyFingerprint @97;
|
||||
startupNoFw @104;
|
||||
fcw @79;
|
||||
steerSaturated @80;
|
||||
@@ -130,6 +125,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
|
||||
neosUpdateRequiredDEPRECATED @88;
|
||||
modelLagWarningDEPRECATED @93;
|
||||
startupOneplusDEPRECATED @82;
|
||||
startupFuzzyFingerprintDEPRECATED @97;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +144,7 @@ struct CarState {
|
||||
wheelSpeeds @2 :WheelSpeeds;
|
||||
|
||||
# gas pedal, 0.0-1.0
|
||||
gas @3 :Float32; # this is user + computer
|
||||
gas @3 :Float32; # this is user pedal only
|
||||
gasPressed @4 :Bool; # this is user pedal only
|
||||
|
||||
# brake pedal, 0.0-1.0
|
||||
@@ -379,14 +375,11 @@ struct CarParams {
|
||||
enableDsu @5 :Bool; # driving support unit
|
||||
enableApgs @6 :Bool; # advanced parking guidance system
|
||||
enableBsm @56 :Bool; # blind spot monitoring
|
||||
hasStockCamera @57 :Bool; # factory LKAS/LDW camera is present
|
||||
|
||||
minEnableSpeed @7 :Float32;
|
||||
minSteerSpeed @8 :Float32;
|
||||
maxSteeringAngleDeg @54 :Float32;
|
||||
safetyModel @9 :SafetyModel;
|
||||
safetyModelPassive @42 :SafetyModel = silent;
|
||||
safetyParam @10 :Int16;
|
||||
safetyConfigs @62 :List(SafetyConfig);
|
||||
|
||||
steerMaxBP @11 :List(Float32);
|
||||
steerMaxV @12 :List(Float32);
|
||||
@@ -419,9 +412,11 @@ struct CarParams {
|
||||
steerLimitTimer @47 :Float32; # time before steerLimitAlert is issued
|
||||
|
||||
vEgoStopping @29 :Float32; # Speed at which the car goes into stopping state
|
||||
vEgoStarting @59 :Float32; # Speed at which the car goes into starting state
|
||||
directAccelControl @30 :Bool; # Does the car have direct accel control or just gas/brake
|
||||
stoppingControl @31 :Bool; # Does the car allows full control even at lows speeds when stopping
|
||||
startAccel @32 :Float32; # Required acceleraton to overcome creep braking
|
||||
stopAccel @60 :Float32; # Required acceleraton to keep vehicle stationary
|
||||
steerRateCost @33 :Float32; # Lateral MPC cost on steering rate
|
||||
steerControlType @34 :SteerControlType;
|
||||
radarOffCan @35 :Bool; # True when radar objects aren't visible on CAN
|
||||
@@ -430,7 +425,8 @@ struct CarParams {
|
||||
startingAccelRate @53 :Float32; # m/s^2/s while trying to start
|
||||
|
||||
steerActuatorDelay @36 :Float32; # Steering wheel actuator delay in seconds
|
||||
longitudinalActuatorDelay @58 :Float32; # Gas/Brake actuator delay in seconds
|
||||
longitudinalActuatorDelayLowerBound @61 :Float32; # Gas/Brake actuator delay in seconds, lower bound
|
||||
longitudinalActuatorDelayUpperBound @58 :Float32; # Gas/Brake actuator delay in seconds, upper bound
|
||||
openpilotLongitudinalControl @37 :Bool; # is openpilot doing the longitudinal control?
|
||||
carVin @38 :Text; # VIN number queried during fingerprinting
|
||||
dashcamOnly @41: Bool;
|
||||
@@ -442,6 +438,11 @@ struct CarParams {
|
||||
fingerprintSource @49: FingerprintSource;
|
||||
networkLocation @50 :NetworkLocation; # Where Panda/C2 is integrated into the car's CAN network
|
||||
|
||||
struct SafetyConfig {
|
||||
safetyModel @0 :SafetyModel;
|
||||
safetyParam @1 :Int16;
|
||||
}
|
||||
|
||||
struct LateralParams {
|
||||
torqueBP @0 :List(Int32);
|
||||
torqueV @1 :List(Int32);
|
||||
@@ -520,6 +521,7 @@ struct CarParams {
|
||||
subaruLegacy @22; # pre-Global platform
|
||||
hyundaiLegacy @23;
|
||||
hyundaiCommunity @24;
|
||||
stellantis @25;
|
||||
}
|
||||
|
||||
enum SteerControlType {
|
||||
@@ -579,4 +581,8 @@ struct CarParams {
|
||||
|
||||
enableCameraDEPRECATED @4 :Bool;
|
||||
isPandaBlackDEPRECATED @39: Bool;
|
||||
hasStockCameraDEPRECATED @57 :Bool;
|
||||
safetyParamDEPRECATED @10 :Int16;
|
||||
safetyModelDEPRECATED @9 :SafetyModel;
|
||||
safetyModelPassiveDEPRECATED @42 :SafetyModel = silent;
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
# Copyright (c) 2013-2015 Sandstorm Development Group, Inc. and contributors
|
||||
# Licensed under the MIT License:
|
||||
#
|
||||
# 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.
|
||||
|
||||
@0xc5f1af96651f70ea;
|
||||
|
||||
annotation package @0x9ee4c8f803b3b596 (file) : Text;
|
||||
# Name of the package, such as "org.example.foo", in which the generated code will reside.
|
||||
|
||||
annotation outerClassname @0x9b066bb4881f7cd3 (file) : Text;
|
||||
# Name of the outer class that will wrap the generated code.
|
||||
@@ -1,10 +1,6 @@
|
||||
using Cxx = import "./include/c++.capnp";
|
||||
$Cxx.namespace("cereal");
|
||||
|
||||
using Java = import "./include/java.capnp";
|
||||
$Java.package("ai.comma.openpilot.cereal");
|
||||
$Java.outerClassname("Legacy");
|
||||
|
||||
@0x80ef1ec4889c2a63;
|
||||
|
||||
# legacy.capnp: a home for deprecated structs
|
||||
|
||||
+38
-24
@@ -1,10 +1,6 @@
|
||||
using Cxx = import "./include/c++.capnp";
|
||||
$Cxx.namespace("cereal");
|
||||
|
||||
using Java = import "./include/java.capnp";
|
||||
$Java.package("ai.comma.openpilot.cereal");
|
||||
$Java.outerClassname("Log");
|
||||
|
||||
using Car = import "car.capnp";
|
||||
using Legacy = import "legacy.capnp";
|
||||
|
||||
@@ -293,15 +289,11 @@ struct DeviceState @0xa4d8b5af2aa492eb {
|
||||
networkType @22 :NetworkType;
|
||||
networkInfo @31 :NetworkInfo;
|
||||
networkStrength @24 :NetworkStrength;
|
||||
offroadPowerUsageUwh @23 :UInt32;
|
||||
carBatteryCapacityUwh @25 :UInt32;
|
||||
lastAthenaPingTime @32 :UInt64;
|
||||
|
||||
fanSpeedPercentDesired @10 :UInt16;
|
||||
started @11 :Bool;
|
||||
startedMonoTime @13 :UInt64;
|
||||
|
||||
lastAthenaPingTime @32 :UInt64;
|
||||
|
||||
# system utilization
|
||||
freeSpacePercent @7 :Float32;
|
||||
memoryUsagePercent @19 :Int8;
|
||||
@@ -313,14 +305,21 @@ struct DeviceState @0xa4d8b5af2aa492eb {
|
||||
batteryCurrent @15 :Int32;
|
||||
chargingError @17 :Bool;
|
||||
chargingDisabled @18 :Bool;
|
||||
offroadPowerUsageUwh @23 :UInt32;
|
||||
carBatteryCapacityUwh @25 :UInt32;
|
||||
|
||||
# device thermals
|
||||
cpuTempC @26 :List(Float32);
|
||||
gpuTempC @27 :List(Float32);
|
||||
memoryTempC @28 :Float32;
|
||||
ambientTempC @30 :Float32;
|
||||
nvmeTempC @35 :List(Float32);
|
||||
modemTempC @36 :List(Float32);
|
||||
thermalStatus @14 :ThermalStatus;
|
||||
|
||||
fanSpeedPercentDesired @10 :UInt16;
|
||||
screenBrightnessPercent @37 :Int8;
|
||||
|
||||
enum ThermalStatus {
|
||||
green @0;
|
||||
yellow @1;
|
||||
@@ -371,20 +370,14 @@ struct DeviceState @0xa4d8b5af2aa492eb {
|
||||
}
|
||||
|
||||
struct PandaState @0xa7649e2575e4591e {
|
||||
# from can health
|
||||
voltage @0 :UInt32;
|
||||
current @1 :UInt32;
|
||||
ignitionLine @2 :Bool;
|
||||
controlsAllowed @3 :Bool;
|
||||
gasInterceptorDetected @4 :Bool;
|
||||
hasGps @6 :Bool;
|
||||
canSendErrs @7 :UInt32;
|
||||
canFwdErrs @8 :UInt32;
|
||||
canRxErrs @19 :UInt32;
|
||||
gmlanSendErrs @9 :UInt32;
|
||||
pandaType @10 :PandaType;
|
||||
fanSpeedRpm @11 :UInt16;
|
||||
usbPowerMode @12 :UsbPowerMode;
|
||||
ignitionCan @13 :Bool;
|
||||
safetyModel @14 :Car.CarParams.SafetyModel;
|
||||
safetyParam @20 :Int16;
|
||||
@@ -438,13 +431,6 @@ struct PandaState @0xa7649e2575e4591e {
|
||||
redPanda @7;
|
||||
}
|
||||
|
||||
enum UsbPowerMode {
|
||||
none @0;
|
||||
client @1;
|
||||
cdp @2;
|
||||
dcp @3;
|
||||
}
|
||||
|
||||
enum HarnessStatus {
|
||||
notConnected @0;
|
||||
normal @1;
|
||||
@@ -452,6 +438,26 @@ struct PandaState @0xa7649e2575e4591e {
|
||||
}
|
||||
|
||||
startedSignalDetectedDEPRECATED @5 :Bool;
|
||||
voltageDEPRECATED @0 :UInt32;
|
||||
currentDEPRECATED @1 :UInt32;
|
||||
hasGpsDEPRECATED @6 :Bool;
|
||||
fanSpeedRpmDEPRECATED @11 :UInt16;
|
||||
usbPowerModeDEPRECATED @12 :PeripheralState.UsbPowerMode;
|
||||
}
|
||||
|
||||
struct PeripheralState {
|
||||
pandaType @0 :PandaState.PandaType;
|
||||
voltage @1 :UInt32;
|
||||
current @2 :UInt32;
|
||||
fanSpeedRpm @3 :UInt16;
|
||||
usbPowerMode @4 :UsbPowerMode;
|
||||
|
||||
enum UsbPowerMode @0xa8883583b32c9877 {
|
||||
none @0;
|
||||
client @1;
|
||||
cdp @2;
|
||||
dcp @3;
|
||||
}
|
||||
}
|
||||
|
||||
struct RadarState @0x9a185389d6fdd05f {
|
||||
@@ -859,7 +865,7 @@ struct LateralPlan @0xe1e9318e2ae8b51e {
|
||||
desire @17 :Desire;
|
||||
laneChangeState @18 :LaneChangeState;
|
||||
laneChangeDirection @19 :LaneChangeDirection;
|
||||
|
||||
useLaneLines @29 :Bool;
|
||||
|
||||
# desired curvatures over next 2.5s in rad/m
|
||||
psis @26 :List(Float32);
|
||||
@@ -1248,6 +1254,7 @@ struct DriverState {
|
||||
distractedEyes @20 :Float32;
|
||||
eyesOnRoad @21 :Float32;
|
||||
phoneUse @22 :Float32;
|
||||
occludedProb @23 :Float32;
|
||||
|
||||
irPwrDEPRECATED @10 :Float32;
|
||||
descriptorDEPRECATED @1 :List(Float32);
|
||||
@@ -1295,6 +1302,10 @@ struct LiveParametersData {
|
||||
yawRate @7 :Float32;
|
||||
posenetSpeed @8 :Float32;
|
||||
posenetValid @9 :Bool;
|
||||
angleOffsetFastStd @10 :Float32;
|
||||
angleOffsetAverageStd @11 :Float32;
|
||||
stiffnessFactorStd @12 :Float32;
|
||||
steerRatioStd @13 :Float32;
|
||||
}
|
||||
|
||||
struct LiveMapDataDEPRECATED {
|
||||
@@ -1344,6 +1355,7 @@ struct ManagerState {
|
||||
name @0 :Text;
|
||||
pid @1 :Int32;
|
||||
running @2 :Bool;
|
||||
shouldBeRunning @4 :Bool;
|
||||
exitCode @3 :Int32;
|
||||
}
|
||||
}
|
||||
@@ -1377,7 +1389,8 @@ struct Event {
|
||||
can @5 :List(CanData);
|
||||
controlsState @7 :ControlsState;
|
||||
sensorEvents @11 :List(SensorEventData);
|
||||
pandaState @12 :PandaState;
|
||||
pandaStates @81 :List(PandaState);
|
||||
peripheralState @80 :PeripheralState;
|
||||
radarState @13 :RadarState;
|
||||
liveTracks @16 :List(LiveTracks);
|
||||
sendcan @17 :List(CanData);
|
||||
@@ -1457,5 +1470,6 @@ struct Event {
|
||||
kalmanOdometryDEPRECATED @65 :Legacy.KalmanOdometry;
|
||||
gpsLocationDEPRECATED @21 :GpsLocationData;
|
||||
uiLayoutStateDEPRECATED @57 :Legacy.UiLayoutState;
|
||||
pandaStateDEPRECATED @12 :PandaState;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -28,14 +28,15 @@ services = {
|
||||
"deviceState": (True, 2., 1),
|
||||
"can": (True, 100.),
|
||||
"controlsState": (True, 100., 10),
|
||||
"pandaState": (True, 2., 1),
|
||||
"pandaStates": (True, 2., 1),
|
||||
"peripheralState": (True, 2., 1),
|
||||
"radarState": (True, 20., 5),
|
||||
"roadEncodeIdx": (True, 20., 1),
|
||||
"liveTracks": (True, 20.),
|
||||
"sendcan": (True, 100.),
|
||||
"sendcan": (True, 100., 139),
|
||||
"logMessage": (True, 0.),
|
||||
"liveCalibration": (True, 4., 4),
|
||||
"androidLog": (True, 0., 1),
|
||||
"androidLog": (True, 0.),
|
||||
"carState": (True, 100., 10),
|
||||
"carControl": (True, 100., 10),
|
||||
"longitudinalPlan": (True, 20., 5),
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
@@ -15,6 +16,16 @@
|
||||
|
||||
#include "visionbuf.h"
|
||||
|
||||
// keep trying if x gets interrupted by a signal
|
||||
#define HANDLE_EINTR(x) \
|
||||
({ \
|
||||
decltype(x) ret; \
|
||||
int try_cnt = 0; \
|
||||
do { \
|
||||
ret = (x); \
|
||||
} while (ret == -1 && errno == EINTR && try_cnt++ < 100); \
|
||||
ret; \
|
||||
})
|
||||
|
||||
// just hard-code these for convenience
|
||||
// size_t device_page_size = 0;
|
||||
@@ -47,12 +58,12 @@ void VisionBuf::allocate(size_t len) {
|
||||
ion_alloc.heap_id_mask = 1 << ION_IOMMU_HEAP_ID;
|
||||
ion_alloc.flags = ION_FLAG_CACHED;
|
||||
|
||||
err = ioctl(ion_fd, ION_IOC_ALLOC, &ion_alloc);
|
||||
err = HANDLE_EINTR(ioctl(ion_fd, ION_IOC_ALLOC, &ion_alloc));
|
||||
assert(err == 0);
|
||||
|
||||
struct ion_fd_data ion_fd_data = {0};
|
||||
ion_fd_data.handle = ion_alloc.handle;
|
||||
err = ioctl(ion_fd, ION_IOC_SHARE, &ion_fd_data);
|
||||
err = HANDLE_EINTR(ioctl(ion_fd, ION_IOC_SHARE, &ion_fd_data));
|
||||
assert(err == 0);
|
||||
|
||||
void *addr = mmap(NULL, ion_alloc.len,
|
||||
@@ -78,7 +89,7 @@ void VisionBuf::import(){
|
||||
// Get handle
|
||||
struct ion_fd_data fd_data = {0};
|
||||
fd_data.fd = this->fd;
|
||||
err = ioctl(ion_fd, ION_IOC_IMPORT, &fd_data);
|
||||
err = HANDLE_EINTR(ioctl(ion_fd, ION_IOC_IMPORT, &fd_data));
|
||||
assert(err == 0);
|
||||
|
||||
this->handle = fd_data.handle;
|
||||
@@ -122,7 +133,7 @@ int VisionBuf::sync(int dir) {
|
||||
ION_IOC_INV_CACHES : ION_IOC_CLEAN_CACHES;
|
||||
|
||||
custom_data.arg = (unsigned long)&flush_data;
|
||||
return ioctl(ion_fd, ION_IOC_CUSTOM, &custom_data);
|
||||
return HANDLE_EINTR(ioctl(ion_fd, ION_IOC_CUSTOM, &custom_data));
|
||||
}
|
||||
|
||||
int VisionBuf::free() {
|
||||
@@ -140,5 +151,5 @@ int VisionBuf::free() {
|
||||
if (err != 0) return err;
|
||||
|
||||
struct ion_handle_data handle_data = {.handle = this->handle};
|
||||
return ioctl(ion_fd, ION_IOC_FREE, &handle_data);
|
||||
return HANDLE_EINTR(ioctl(ion_fd, ION_IOC_FREE, &handle_data));
|
||||
}
|
||||
|
||||
@@ -36,3 +36,4 @@ cdef extern from "visionipc_client.h":
|
||||
VisionIpcClient(string, VisionStreamType, bool, void*, void*)
|
||||
VisionBuf * recv(VisionIpcBufExtra *, int)
|
||||
bool connect(bool)
|
||||
bool is_connected()
|
||||
|
||||
@@ -72,6 +72,7 @@ bool VisionIpcClient::connect(bool blocking){
|
||||
if (device_id) buffers[i].init_cl(device_id, ctx);
|
||||
}
|
||||
|
||||
close(socket_fd);
|
||||
connected = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -29,4 +29,5 @@ public:
|
||||
~VisionIpcClient();
|
||||
VisionBuf * recv(VisionIpcBufExtra * extra=nullptr, const int timeout_ms=100);
|
||||
bool connect(bool blocking=true);
|
||||
bool is_connected() { return connected; }
|
||||
};
|
||||
|
||||
@@ -88,3 +88,6 @@ cdef class VisionIpcClient:
|
||||
|
||||
def connect(self, bool blocking):
|
||||
return self.client.connect(blocking)
|
||||
|
||||
def is_connected(self):
|
||||
return self.client.is_connected()
|
||||
|
||||
+6
-11
@@ -6,19 +6,14 @@ assert put_nonblocking
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
from common.params_pyx import keys # pylint: disable=no-name-in-module, import-error
|
||||
|
||||
params = Params()
|
||||
key = sys.argv[1]
|
||||
assert params.check_key(key), f"unknown param: {key}"
|
||||
|
||||
if len(sys.argv) == 3:
|
||||
name = sys.argv[1]
|
||||
val = sys.argv[2]
|
||||
assert name.encode("utf-8") in keys.keys(), f"unknown param: {name}"
|
||||
print(f"SET: {name} = {val}")
|
||||
params.put(name, val)
|
||||
print(f"SET: {key} = {val}")
|
||||
params.put(key, val)
|
||||
elif len(sys.argv) == 2:
|
||||
name = sys.argv[1]
|
||||
assert name.encode("utf-8") in keys.keys(), f"unknown param: {name}"
|
||||
print(f"GET: {name} = {params.get(name)}")
|
||||
else:
|
||||
for k in keys.keys():
|
||||
print(f"GET: {k} = {params.get(k)}")
|
||||
print(f"GET: {key} = {params.get(key)}")
|
||||
|
||||
@@ -131,7 +131,7 @@ def denormalize(img_pts, intrinsics=fcam_intrinsics, width=W, height=H):
|
||||
img_pts = np.array(img_pts)
|
||||
input_shape = img_pts.shape
|
||||
img_pts = np.atleast_2d(img_pts)
|
||||
img_pts = np.hstack((img_pts, np.ones((img_pts.shape[0], 1))))
|
||||
img_pts = np.hstack((img_pts, np.ones((img_pts.shape[0], 1), dtype=img_pts.dtype)))
|
||||
img_pts_denormalized = img_pts.dot(intrinsics.T)
|
||||
img_pts_denormalized[img_pts_denormalized[:, 0] > width] = np.nan
|
||||
img_pts_denormalized[img_pts_denormalized[:, 0] < 0] = np.nan
|
||||
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
Supported Cars
|
||||
------
|
||||
|
||||
| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below |
|
||||
| ----------| ------------------------------| ------------------| -----------------| -------------------| ------------------|
|
||||
| Acura | ILX 2016-19 | AcuraWatch Plus | openpilot | 25mph<sup>1</sup> | 25mph |
|
||||
| Acura | RDX 2016-18 | AcuraWatch Plus | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Acura | RDX 2019-21 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Accord 2018-20 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Accord Hybrid 2018-20 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Civic Hatchback 2017-21 | Honda Sensing | Stock | 0mph | 12mph |
|
||||
| Honda | Civic Coupe 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
|
||||
| Honda | Civic Coupe 2019-20 | All | Stock | 0mph | 2mph<sup>2</sup> |
|
||||
| Honda | Civic Sedan 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
|
||||
| Honda | Civic Sedan 2019-20 | All | Stock | 0mph | 2mph<sup>2</sup> |
|
||||
| Honda | CR-V 2015-16 | Touring | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | CR-V 2017-21 | Honda Sensing | Stock | 0mph | 12mph |
|
||||
| Honda | CR-V Hybrid 2017-2019 | Honda Sensing | Stock | 0mph | 12mph |
|
||||
| Honda | e 2020 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Fit 2018-19 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Freed 2020 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | HR-V 2019-20 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Insight 2019-21 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Inspire 2018 | All | Stock | 0mph | 3mph |
|
||||
| Honda | Odyssey 2018-20 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 0mph |
|
||||
| Honda | Passport 2019 | All | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Pilot 2016-21 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Honda | Ridgeline 2017-21 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
|
||||
| Hyundai | Palisade 2020-21 | All | Stock | 0mph | 0mph |
|
||||
| Hyundai | Sonata 2020-21 | All | Stock | 0mph | 0mph |
|
||||
| Lexus | CT Hybrid 2017-18 | LSS | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | ES 2019-21 | All | openpilot | 0mph | 0mph |
|
||||
| Lexus | ES Hybrid 2017-18 | LSS | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | ES Hybrid 2019-21 | All | openpilot | 0mph | 0mph |
|
||||
| Lexus | IS 2017-2019 | All | Stock | 22mph | 0mph |
|
||||
| Lexus | NX 2018 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | NX 2020 | All | openpilot | 0mph | 0mph |
|
||||
| Lexus | NX Hybrid 2018-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | RX 2016-18 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | RX 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Lexus | RX Hybrid 2016-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Lexus | RX Hybrid 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Lexus | UX Hybrid 2019-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Alphard 2020 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Avalon 2016-21 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Avalon Hybrid 2019-21 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Camry 2018-20 | All | Stock | 0mph<sup>4</sup> | 0mph |
|
||||
| Toyota | Camry 2021 | All | openpilot | 0mph<sup>4</sup> | 0mph |
|
||||
| Toyota | Camry Hybrid 2018-20 | All | Stock | 0mph<sup>4</sup> | 0mph |
|
||||
| Toyota | Camry Hybrid 2021-22 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | C-HR 2017-20 | All | Stock | 0mph | 0mph |
|
||||
| Toyota | C-HR Hybrid 2017-19 | All | Stock | 0mph | 0mph |
|
||||
| Toyota | Corolla 2017-19 | All | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Corolla 2020-22 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Corolla Hatchback 2019-22 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Corolla Hybrid 2020-22 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Highlander 2017-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Highlander 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Highlander Hybrid 2017-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Highlander Hybrid 2020-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Mirai 2021 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Prius 2016-20 | TSS-P | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Prius 2021 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Prius Prime 2017-20 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Prius Prime 2021 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Rav4 2016-18 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
|
||||
| Toyota | Rav4 2019-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Rav4 Hybrid 2016-18 | TSS-P | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
| Toyota | Rav4 Hybrid 2019-21 | All | openpilot | 0mph | 0mph |
|
||||
| Toyota | Sienna 2018-20 | All | Stock<sup>3</sup>| 0mph | 0mph |
|
||||
|
||||
<sup>1</sup>[Comma Pedal](https://github.com/commaai/openpilot/wiki/comma-pedal) is used to provide stop-and-go capability to some of the openpilot-supported cars that don't currently support stop-and-go. ***NOTE: The Comma Pedal is not officially supported by [comma](https://comma.ai).*** <br />
|
||||
<sup>2</sup>2019 Honda Civic 1.6L Diesel Sedan does not have ALC below 12mph. <br />
|
||||
<sup>3</sup>When disconnecting the Driver Support Unit (DSU), openpilot ACC will replace stock ACC. ***NOTE: disconnecting the DSU disables Automatic Emergency Braking (AEB).*** <br />
|
||||
<sup>4</sup>28mph for Camry 4CYL L, 4CYL LE and 4CYL SE which don't have Full-Speed Range Dynamic Radar Cruise Control. <br />
|
||||
|
||||
Community Maintained Cars and Features
|
||||
------
|
||||
|
||||
| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below |
|
||||
| ----------| ------------------------------| ------------------| -----------------| -------------------| -------------|
|
||||
| Audi | A3 2014-19 | ACC + Lane Assist | Stock | 0mph | 0mph |
|
||||
| Audi | A3 Sportback e-tron 2017-18 | ACC + Lane Assist | Stock | 0mph | 0mph |
|
||||
| Audi | Q2 2018 | ACC + Lane Assist | Stock | 0mph | 0mph |
|
||||
| Audi | S3 2015 | ACC + Lane Assist | Stock | 0mph | 0mph |
|
||||
| Buick | Regal 2018<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Cadillac | ATS 2018<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Chevrolet | Malibu 2017<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Chevrolet | Volt 2017-18<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Chrysler | Pacifica 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph |
|
||||
| Chrysler | Pacifica 2020 | Adaptive Cruise | Stock | 0mph | 39mph |
|
||||
| Chrysler | Pacifica Hybrid 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph |
|
||||
| Chrysler | Pacifica Hybrid 2019-21 | Adaptive Cruise | Stock | 0mph | 39mph |
|
||||
| Genesis | G70 2018 | All | Stock | 0mph | 0mph |
|
||||
| Genesis | G80 2018 | All | Stock | 0mph | 0mph |
|
||||
| Genesis | G90 2018 | All | Stock | 0mph | 0mph |
|
||||
| GMC | Acadia 2018<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Holden | Astra 2017<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Hyundai | Elantra 2017-19 | SCC + LKAS | Stock | 19mph | 34mph |
|
||||
| Hyundai | Elantra 2021 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Elantra Hybrid 2021 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Genesis 2015-16 | SCC + LKAS | Stock | 19mph | 37mph |
|
||||
| Hyundai | Ioniq Electric 2019 | SCC + LKAS | Stock | 0mph | 32mph |
|
||||
| Hyundai | Ioniq Electric 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Ioniq Hybrid 2017-19 | SCC + LKAS | Stock | 0mph | 32mph |
|
||||
| Hyundai | Ioniq Hybrid 2020-22 | SCC + LFA | Stock | 0mph | 0mph |
|
||||
| Hyundai | Ioniq PHEV 2020-21 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Kona 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Kona EV 2018-19 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Kona Hybrid 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Santa Fe 2019-20 | All | Stock | 0mph | 0mph |
|
||||
| Hyundai | Santa Fe 2021-22 | All | Stock | 0mph | 0mph |
|
||||
| Hyundai | Sonata 2018-2019 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Sonata Hybrid 2021-22 | All | Stock | 0mph | 0mph |
|
||||
| Hyundai | Veloster 2019-20 | SCC + LKAS | Stock | 5mph | 0mph |
|
||||
| Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Stock | 0mph | 9mph |
|
||||
| Jeep | Grand Cherokee 2019-20 | Adaptive Cruise | Stock | 0mph | 39mph |
|
||||
| Kia | Ceed 2019 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Forte 2018-21 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | K5 2021 | SCC + LFA | Stock | 0mph | 0mph |
|
||||
| Kia | Niro EV 2019-21 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Niro Hybrid 2021 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Niro PHEV 2019 | SCC + LKAS | Stock | 10mph | 32mph |
|
||||
| Kia | Optima 2017 | SCC + LKAS | Stock | 0mph | 32mph |
|
||||
| Kia | Optima 2019 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Seltos 2021 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Sorento 2018-19 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Stinger 2018 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Telluride 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Nissan | Altima 2019-20 | ProPILOT | Stock | 0mph | 0mph |
|
||||
| Nissan | Leaf 2018-22 | ProPILOT | Stock | 0mph | 0mph |
|
||||
| Nissan | Rogue 2018-20 | ProPILOT | Stock | 0mph | 0mph |
|
||||
| Nissan | X-Trail 2017 | ProPILOT | Stock | 0mph | 0mph |
|
||||
| SEAT | Ateca 2018 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| SEAT | Leon 2014-2020 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Škoda | Kamiq 2021<sup>2</sup> | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Škoda | Karoq 2019 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Škoda | Kodiaq 2018-19 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Škoda | Octavia 2015, 2018-19 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Škoda | Octavia RS 2016 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Škoda | Scala 2020 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Škoda | Superb 2015-18 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Subaru | Ascent 2019 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Subaru | Crosstrek 2018-19 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Subaru | Forester 2019-21 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Subaru | Impreza 2017-19 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Arteon 2021<sup>4</sup> | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Atlas 2018-19 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| California 2021<sup>4</sup> | Driver Assistance | Stock | 0mph | 32mph |
|
||||
| Volkswagen| e-Golf 2014, 2019-20 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf 2015-20 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf Alltrack 2017-18 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf GTE 2016 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf GTI 2018-20 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf R 2016-19 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf SportsVan 2016 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf SportWagen 2015 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Jetta 2018-20 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Jetta GLI 2021 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Passat 2016-18<sup>3</sup> | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| T-Cross 2021<sup>4</sup> | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Taos 2022<sup>4</sup> | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Tiguan 2020 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Touran 2017 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
|
||||
<sup>1</sup>Requires an [OBD-II car harness](https://comma.ai/shop/products/comma-car-harness) and [community built ASCM harness](https://github.com/commaai/openpilot/wiki/GM#hardware). ***NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).*** <br />
|
||||
<sup>2</sup>Not including the China market Kamiq, which is based on the (currently) unsupported PQ34 platform. <br />
|
||||
<sup>3</sup>Not including the USA/China market Passat, which is based on the (currently) unsupported PQ35/NMS platform. <br />
|
||||
<sup>4</sup>Model-years 2021 and beyond may have a new camera harness design, which isn't yet available from the comma store. Before ordering,
|
||||
remove the Lane Assist camera cover and check to see if the connector is black (older design) or light brown (newer design). For the newer design,
|
||||
in the interim, choose "VW J533 Development" from the vehicle drop-down for a harness that integrates at the CAN gateway inside the dashboard.<br />
|
||||
Community Maintained Cars and Features are not verified by comma to meet our [safety model](SAFETY.md). Be extra cautious using them. They are only available after enabling the toggle in `Settings->Developer->Enable Community Features`.
|
||||
|
||||
To promote a car from community maintained, it must meet a few requirements. We must own one from the brand, we must sell the harness for it, has full ISO26262 in both panda and openpilot, there must be a path forward for longitudinal control, it must have AEB still enabled, and it must support fingerprinting 2.0
|
||||
|
||||
Although they're not upstream, the community has openpilot running on other makes and models. See the 'Community Supported Models' section of each make [on our wiki](https://wiki.comma.ai/).
|
||||
@@ -6,6 +6,7 @@ Most open source development activity is coordinated through our [GitHub Discuss
|
||||
|
||||
## Getting Started
|
||||
|
||||
* Setup your [development environment](../tools/)
|
||||
* Join our [Discord](https://discord.comma.ai)
|
||||
* Make sure you have a [GitHub account](https://github.com/signup/free)
|
||||
* Fork [our repositories](https://github.com/commaai) on GitHub
|
||||
@@ -20,7 +21,7 @@ All PRs and commits are automatically checked by GitHub Actions. Check out `.git
|
||||
|
||||
Code is automatically checked for style by GitHub Actions as part of the automated tests. You can also run these tests yourself by running `pre-commit run --all`.
|
||||
|
||||
## Car Ports (openpilot)
|
||||
## Car Ports
|
||||
|
||||
We've released a [Model Port guide](https://blog.comma.ai/openpilot-port-guide-for-toyota-models/) for porting to Toyota/Lexus models.
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
Integration with Stock Features
|
||||
------
|
||||
|
||||
In all supported cars:
|
||||
* Stock Lane Keep Assist (LKA) and stock ALC are replaced by openpilot ALC, which only functions when openpilot is engaged by the user.
|
||||
* Stock LDW is replaced by openpilot LDW.
|
||||
|
||||
Additionally, on specific supported cars (see ACC column in [supported cars](CARS.md)):
|
||||
* Stock ACC is replaced by openpilot ACC.
|
||||
* openpilot FCW operates in addition to stock FCW.
|
||||
|
||||
openpilot should preserve all other vehicle's stock features, including, but are not limited to: FCW, Automatic Emergency Braking (AEB), auto high-beam, blind spot warning, and side collision warning.
|
||||
|
||||
Limitations of openpilot ALC and LDW
|
||||
------
|
||||
|
||||
openpilot ALC and openpilot LDW do not automatically drive the vehicle or reduce the amount of attention that must be paid to operate your vehicle. The driver must always keep control of the steering wheel and be ready to correct the openpilot ALC action at all times.
|
||||
|
||||
While changing lanes, openpilot is not capable of looking next to you or checking your blind spot. Only nudge the wheel to initiate a lane change after you have confirmed it's safe to do so.
|
||||
|
||||
Many factors can impact the performance of openpilot ALC and openpilot LDW, causing them to be unable to function as intended. These include, but are not limited to:
|
||||
|
||||
* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation.
|
||||
* The road facing camera is obstructed, covered or damaged by mud, ice, snow, etc.
|
||||
* Obstruction caused by applying excessive paint or adhesive products (such as wraps, stickers, rubber coating, etc.) onto the vehicle.
|
||||
* The device is mounted incorrectly.
|
||||
* When in sharp curves, like on-off ramps, intersections etc...; openpilot is designed to be limited in the amount of steering torque it can produce.
|
||||
* In the presence of restricted lanes or construction zones.
|
||||
* When driving on highly banked roads or in presence of strong cross-wind.
|
||||
* Extremely hot or cold temperatures.
|
||||
* Bright light (due to oncoming headlights, direct sunlight, etc.).
|
||||
* Driving on hills, narrow, or winding roads.
|
||||
|
||||
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. It is the driver's responsibility to be in control of the vehicle at all times.
|
||||
|
||||
Limitations of openpilot ACC and FCW
|
||||
------
|
||||
|
||||
openpilot ACC and openpilot FCW are not systems that allow careless or inattentive driving. It is still necessary for the driver to pay close attention to the vehicle’s surroundings and to be ready to re-take control of the gas and the brake at all times.
|
||||
|
||||
Many factors can impact the performance of openpilot ACC and openpilot FCW, causing them to be unable to function as intended. These include, but are not limited to:
|
||||
|
||||
* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation.
|
||||
* The road facing camera or radar are obstructed, covered, or damaged by mud, ice, snow, etc.
|
||||
* Obstruction caused by applying excessive paint or adhesive products (such as wraps, stickers, rubber coating, etc.) onto the vehicle.
|
||||
* The device is mounted incorrectly.
|
||||
* Approaching a toll booth, a bridge or a large metal plate.
|
||||
* When driving on roads with pedestrians, cyclists, etc...
|
||||
* In presence of traffic signs or stop lights, which are not detected by openpilot at this time.
|
||||
* When the posted speed limit is below the user selected set speed. openpilot does not detect speed limits at this time.
|
||||
* In presence of vehicles in the same lane that are not moving.
|
||||
* When abrupt braking maneuvers are required. openpilot is designed to be limited in the amount of deceleration and acceleration that it can produce.
|
||||
* When surrounding vehicles perform close cut-ins from neighbor lanes.
|
||||
* Driving on hills, narrow, or winding roads.
|
||||
* Extremely hot or cold temperatures.
|
||||
* Bright light (due to oncoming headlights, direct sunlight, etc.).
|
||||
* Interference from other equipment that generates radar waves.
|
||||
|
||||
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. It is the driver's responsibility to be in control of the vehicle at all times.
|
||||
|
||||
Limitations of openpilot DM
|
||||
------
|
||||
|
||||
openpilot DM should not be considered an exact measurement of the alertness of the driver.
|
||||
|
||||
Many factors can impact the performance of openpilot DM, causing it to be unable to function as intended. These include, but are not limited to:
|
||||
|
||||
* Low light conditions, such as driving at night or in dark tunnels.
|
||||
* Bright light (due to oncoming headlights, direct sunlight, etc.).
|
||||
* The driver's face is partially or completely outside field of view of the driver facing camera.
|
||||
* The driver facing camera is obstructed, covered, or damaged.
|
||||
|
||||
The list above does not represent an exhaustive list of situations that may interfere with proper operation of openpilot components. A driver should not rely on openpilot DM to assess their level of attention.
|
||||
@@ -1,99 +0,0 @@
|
||||
CC = clang
|
||||
CXX = clang++
|
||||
|
||||
PHONELIBS = ../../phonelibs
|
||||
|
||||
WARN_FLAGS = -Werror=implicit-function-declaration \
|
||||
-Werror=incompatible-pointer-types \
|
||||
-Werror=int-conversion \
|
||||
-Werror=return-type \
|
||||
-Werror=format-extra-args
|
||||
|
||||
CFLAGS = -std=gnu11 -g -fPIC -O2 $(WARN_FLAGS)
|
||||
CXXFLAGS = -std=c++1z -g -fPIC -O2 $(WARN_FLAGS)
|
||||
|
||||
CURL_FLAGS = -I$(PHONELIBS)/curl/include
|
||||
CURL_LIBS = $(PHONELIBS)/curl/lib/libcurl.a \
|
||||
$(PHONELIBS)/zlib/lib/libz.a
|
||||
|
||||
BORINGSSL_FLAGS = -I$(PHONELIBS)/boringssl/include
|
||||
BORINGSSL_LIBS = $(PHONELIBS)/boringssl/lib/libssl_static.a \
|
||||
$(PHONELIBS)/boringssl/lib/libcrypto_static.a \
|
||||
|
||||
NANOVG_FLAGS = -I$(PHONELIBS)/nanovg
|
||||
|
||||
JSON11_FLAGS = -I$(PHONELIBS)/json11
|
||||
|
||||
OPENGL_LIBS = -lGLESv3
|
||||
|
||||
FRAMEBUFFER_LIBS = -lutils -lgui -lEGL
|
||||
|
||||
.PHONY: all
|
||||
all: updater
|
||||
|
||||
OBJS = opensans_regular.ttf.o \
|
||||
opensans_semibold.ttf.o \
|
||||
opensans_bold.ttf.o \
|
||||
../../selfdrive/common/util.o \
|
||||
../../selfdrive/common/touch.o \
|
||||
../../selfdrive/common/framebuffer.o \
|
||||
$(PHONELIBS)/json11/json11.o \
|
||||
$(PHONELIBS)/nanovg/nanovg.o
|
||||
|
||||
DEPS := $(OBJS:.o=.d)
|
||||
|
||||
updater: updater.o $(OBJS)
|
||||
@echo "[ LINK ] $@"
|
||||
$(CXX) $(CPPFLAGS) -fPIC -o 'updater' $^ \
|
||||
$(FRAMEBUFFER_LIBS) \
|
||||
$(CURL_LIBS) \
|
||||
$(BORINGSSL_LIBS) \
|
||||
-L/system/vendor/lib64 \
|
||||
$(OPENGL_LIBS) \
|
||||
-lcutils -lm -llog
|
||||
strip updater
|
||||
|
||||
opensans_regular.ttf.o: ../../selfdrive/assets/fonts/opensans_regular.ttf
|
||||
@echo "[ bin2o ] $@"
|
||||
cd '$(dir $<)' && ld -r -b binary '$(notdir $<)' -o '$(abspath $@)'
|
||||
|
||||
opensans_bold.ttf.o: ../../selfdrive/assets/fonts/opensans_bold.ttf
|
||||
@echo "[ bin2o ] $@"
|
||||
cd '$(dir $<)' && ld -r -b binary '$(notdir $<)' -o '$(abspath $@)'
|
||||
|
||||
opensans_semibold.ttf.o: ../../selfdrive/assets/fonts/opensans_semibold.ttf
|
||||
@echo "[ bin2o ] $@"
|
||||
cd '$(dir $<)' && ld -r -b binary '$(notdir $<)' -o '$(abspath $@)'
|
||||
|
||||
%.o: %.c
|
||||
mkdir -p $(@D)
|
||||
@echo "[ CC ] $@"
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) \
|
||||
-I../.. \
|
||||
-I$(PHONELIBS)/android_frameworks_native/include \
|
||||
-I$(PHONELIBS)/android_system_core/include \
|
||||
-I$(PHONELIBS)/android_hardware_libhardware/include \
|
||||
$(NANOVG_FLAGS) \
|
||||
-c -o '$@' '$<'
|
||||
|
||||
%.o: %.cc
|
||||
mkdir -p $(@D)
|
||||
@echo "[ CXX ] $@"
|
||||
$(CXX) $(CPPFLAGS) $(CXXFLAGS) \
|
||||
-I../../selfdrive \
|
||||
-I../../ \
|
||||
-I$(PHONELIBS)/android_frameworks_native/include \
|
||||
-I$(PHONELIBS)/android_system_core/include \
|
||||
-I$(PHONELIBS)/android_hardware_libhardware/include \
|
||||
$(NANOVG_FLAGS) \
|
||||
$(JSON11_FLAGS) \
|
||||
$(CURL_FLAGS) \
|
||||
$(BORINGSSL_FLAGS) \
|
||||
-c -o '$@' '$<'
|
||||
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f $(OBJS) $(DEPS)
|
||||
|
||||
-include $(DEPS)
|
||||
Binary file not shown.
@@ -1,803 +0,0 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include <curl/curl.h>
|
||||
#include <openssl/sha.h>
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include <GLES3/gl3.h>
|
||||
#include "nanovg.h"
|
||||
#define NANOVG_GLES3_IMPLEMENTATION
|
||||
#include "json11.hpp"
|
||||
#include "nanovg_gl.h"
|
||||
#include "nanovg_gl_utils.h"
|
||||
|
||||
#include "selfdrive/common/framebuffer.h"
|
||||
#include "selfdrive/common/touch.h"
|
||||
#include "selfdrive/common/util.h"
|
||||
|
||||
#define USER_AGENT "NEOSUpdater-0.2"
|
||||
|
||||
#define MANIFEST_URL_NEOS_STAGING "https://github.com/commaai/eon-neos/raw/master/update.staging.json"
|
||||
#define MANIFEST_URL_NEOS_LOCAL "http://192.168.5.1:8000/neosupdate/update.local.json"
|
||||
#define MANIFEST_URL_NEOS "https://github.com/commaai/eon-neos/raw/master/update.json"
|
||||
const char *manifest_url = MANIFEST_URL_NEOS;
|
||||
|
||||
#define RECOVERY_DEV "/dev/block/bootdevice/by-name/recovery"
|
||||
#define RECOVERY_COMMAND "/cache/recovery/command"
|
||||
|
||||
#define UPDATE_DIR "/data/neoupdate"
|
||||
|
||||
extern const uint8_t bin_opensans_regular[] asm("_binary_opensans_regular_ttf_start");
|
||||
extern const uint8_t bin_opensans_regular_end[] asm("_binary_opensans_regular_ttf_end");
|
||||
extern const uint8_t bin_opensans_semibold[] asm("_binary_opensans_semibold_ttf_start");
|
||||
extern const uint8_t bin_opensans_semibold_end[] asm("_binary_opensans_semibold_ttf_end");
|
||||
extern const uint8_t bin_opensans_bold[] asm("_binary_opensans_bold_ttf_start");
|
||||
extern const uint8_t bin_opensans_bold_end[] asm("_binary_opensans_bold_ttf_end");
|
||||
|
||||
namespace {
|
||||
|
||||
std::string sha256_file(std::string fn, size_t limit=0) {
|
||||
SHA256_CTX ctx;
|
||||
SHA256_Init(&ctx);
|
||||
|
||||
FILE *file = fopen(fn.c_str(), "rb");
|
||||
if (!file) return "";
|
||||
|
||||
const size_t buf_size = 8192;
|
||||
std::unique_ptr<char[]> buffer( new char[ buf_size ] );
|
||||
|
||||
bool read_limit = (limit != 0);
|
||||
while (true) {
|
||||
size_t read_size = buf_size;
|
||||
if (read_limit) read_size = std::min(read_size, limit);
|
||||
size_t bytes_read = fread(buffer.get(), 1, read_size, file);
|
||||
if (!bytes_read) break;
|
||||
|
||||
SHA256_Update(&ctx, buffer.get(), bytes_read);
|
||||
|
||||
if (read_limit) {
|
||||
limit -= bytes_read;
|
||||
if (limit == 0) break;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t hash[SHA256_DIGEST_LENGTH];
|
||||
SHA256_Final(hash, &ctx);
|
||||
|
||||
fclose(file);
|
||||
|
||||
return util::tohex(hash, sizeof(hash));
|
||||
}
|
||||
|
||||
size_t download_string_write(void *ptr, size_t size, size_t nmeb, void *up) {
|
||||
size_t sz = size * nmeb;
|
||||
((std::string*)up)->append((char*)ptr, sz);
|
||||
return sz;
|
||||
}
|
||||
|
||||
std::string download_string(CURL *curl, std::string url) {
|
||||
std::string os;
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 0);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
|
||||
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_RESUME_FROM, 0);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, download_string_write);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &os);
|
||||
CURLcode res = curl_easy_perform(curl);
|
||||
if (res != CURLE_OK) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
size_t download_file_write(void *ptr, size_t size, size_t nmeb, void *up) {
|
||||
return fwrite(ptr, size, nmeb, (FILE*)up);
|
||||
}
|
||||
|
||||
int battery_capacity() {
|
||||
std::string bat_cap_s = util::read_file("/sys/class/power_supply/battery/capacity");
|
||||
return atoi(bat_cap_s.c_str());
|
||||
}
|
||||
|
||||
int battery_current() {
|
||||
std::string current_now_s = util::read_file("/sys/class/power_supply/battery/current_now");
|
||||
return atoi(current_now_s.c_str());
|
||||
}
|
||||
|
||||
bool check_battery() {
|
||||
int bat_cap = battery_capacity();
|
||||
int current_now = battery_current();
|
||||
return bat_cap > 35 || (current_now < 0 && bat_cap > 10);
|
||||
}
|
||||
|
||||
bool check_space() {
|
||||
struct statvfs stat;
|
||||
if (statvfs("/data/", &stat) != 0) {
|
||||
return false;
|
||||
}
|
||||
size_t space = stat.f_bsize * stat.f_bavail;
|
||||
return space > 2000000000ULL; // 2GB
|
||||
}
|
||||
|
||||
static void start_settings_activity(const char* name) {
|
||||
char launch_cmd[1024];
|
||||
snprintf(launch_cmd, sizeof(launch_cmd),
|
||||
"am start -W --ez :settings:show_fragment_as_subsetting true -n 'com.android.settings/.%s'", name);
|
||||
system(launch_cmd);
|
||||
}
|
||||
|
||||
bool is_settings_active() {
|
||||
FILE *fp;
|
||||
char sys_output[4096];
|
||||
|
||||
fp = popen("/bin/dumpsys window windows", "r");
|
||||
if (fp == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool active = false;
|
||||
while (fgets(sys_output, sizeof(sys_output), fp) != NULL) {
|
||||
if (strstr(sys_output, "mCurrentFocus=null") != NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (strstr(sys_output, "mCurrentFocus=Window") != NULL) {
|
||||
active = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pclose(fp);
|
||||
|
||||
return active;
|
||||
}
|
||||
|
||||
struct Updater {
|
||||
bool do_exit = false;
|
||||
|
||||
TouchState touch;
|
||||
|
||||
int fb_w, fb_h;
|
||||
|
||||
std::unique_ptr<FrameBuffer> fb;
|
||||
NVGcontext *vg = NULL;
|
||||
int font_regular;
|
||||
int font_semibold;
|
||||
int font_bold;
|
||||
|
||||
std::thread update_thread_handle;
|
||||
|
||||
std::mutex lock;
|
||||
|
||||
enum UpdateState {
|
||||
CONFIRMATION,
|
||||
LOW_BATTERY,
|
||||
RUNNING,
|
||||
ERROR,
|
||||
};
|
||||
UpdateState state;
|
||||
|
||||
std::string progress_text;
|
||||
float progress_frac;
|
||||
|
||||
std::string error_text;
|
||||
|
||||
std::string low_battery_text;
|
||||
std::string low_battery_title;
|
||||
std::string low_battery_context;
|
||||
std::string battery_cap_text;
|
||||
int min_battery_cap = 35;
|
||||
|
||||
// button
|
||||
int b_x, b_w, b_y, b_h;
|
||||
int balt_x;
|
||||
|
||||
// download stage writes these for the installation stage
|
||||
int recovery_len;
|
||||
std::string recovery_hash;
|
||||
std::string recovery_fn;
|
||||
std::string ota_fn;
|
||||
|
||||
CURL *curl = NULL;
|
||||
|
||||
void ui_init() {
|
||||
touch_init(&touch);
|
||||
|
||||
fb = std::make_unique<FrameBuffer>("updater", 0x00001000, false, &fb_w, &fb_h);
|
||||
|
||||
fb->set_power(HWC_POWER_MODE_NORMAL);
|
||||
|
||||
vg = nvgCreateGLES3(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG);
|
||||
assert(vg);
|
||||
|
||||
font_regular = nvgCreateFontMem(vg, "opensans_regular", (unsigned char*)bin_opensans_regular, (bin_opensans_regular_end - bin_opensans_regular), 0);
|
||||
assert(font_regular >= 0);
|
||||
|
||||
font_semibold = nvgCreateFontMem(vg, "opensans_semibold", (unsigned char*)bin_opensans_semibold, (bin_opensans_semibold_end - bin_opensans_semibold), 0);
|
||||
assert(font_semibold >= 0);
|
||||
|
||||
font_bold = nvgCreateFontMem(vg, "opensans_bold", (unsigned char*)bin_opensans_bold, (bin_opensans_bold_end - bin_opensans_bold), 0);
|
||||
assert(font_bold >= 0);
|
||||
|
||||
b_w = 640;
|
||||
balt_x = 200;
|
||||
b_x = fb_w-b_w-200;
|
||||
b_y = 720;
|
||||
b_h = 220;
|
||||
|
||||
if (download_stage(true)) {
|
||||
state = RUNNING;
|
||||
update_thread_handle = std::thread(&Updater::run_stages, this);
|
||||
} else {
|
||||
state = CONFIRMATION;
|
||||
}
|
||||
}
|
||||
|
||||
int download_file_xferinfo(curl_off_t dltotal, curl_off_t dlno,
|
||||
curl_off_t ultotal, curl_off_t ulnow) {
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
if (dltotal != 0) {
|
||||
progress_frac = (float) dlno / dltotal;
|
||||
}
|
||||
}
|
||||
// printf("info: %ld %ld %f\n", dltotal, dlno, progress_frac);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool download_file(std::string url, std::string out_fn) {
|
||||
FILE *of = fopen(out_fn.c_str(), "ab");
|
||||
assert(of);
|
||||
|
||||
CURLcode res;
|
||||
long last_resume_from = 0;
|
||||
|
||||
fseek(of, 0, SEEK_END);
|
||||
|
||||
int tries = 4;
|
||||
|
||||
bool ret = false;
|
||||
|
||||
while (true) {
|
||||
long resume_from = ftell(of);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 0);
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, USER_AGENT);
|
||||
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_RESUME_FROM, resume_from);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, download_file_write);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, of);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_XFERINFODATA, this);
|
||||
curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, &Updater::download_file_xferinfo);
|
||||
|
||||
CURLcode res = curl_easy_perform(curl);
|
||||
|
||||
long response_code = 0;
|
||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
|
||||
|
||||
// double content_length = 0.0;
|
||||
// curl_easy_getinfo(curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &content_length);
|
||||
|
||||
printf("download %s res %d, code %ld, resume from %ld\n", url.c_str(), res, response_code, resume_from);
|
||||
if (res == CURLE_OK) {
|
||||
ret = true;
|
||||
break;
|
||||
} else if (res == CURLE_HTTP_RETURNED_ERROR && response_code == 416) {
|
||||
// failed because the file is already complete?
|
||||
ret = true;
|
||||
break;
|
||||
} else if (resume_from == last_resume_from) {
|
||||
// failed and dind't make make forward progress. only retry a couple times
|
||||
tries--;
|
||||
if (tries <= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
last_resume_from = resume_from;
|
||||
}
|
||||
// printf("res %d\n", res);
|
||||
|
||||
// printf("- %ld %f\n", response_code, content_length);
|
||||
|
||||
fclose(of);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void set_progress(std::string text) {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
progress_text = text;
|
||||
}
|
||||
|
||||
void set_error(std::string text) {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
error_text = text;
|
||||
state = ERROR;
|
||||
}
|
||||
|
||||
void set_battery_low() {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
state = LOW_BATTERY;
|
||||
}
|
||||
|
||||
void set_running() {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
state = RUNNING;
|
||||
}
|
||||
|
||||
std::string download(std::string url, std::string hash, std::string name, bool dry_run) {
|
||||
std::string out_fn = UPDATE_DIR "/" + util::base_name(url);
|
||||
|
||||
std::string fn_hash = sha256_file(out_fn);
|
||||
if (dry_run) {
|
||||
return (hash.compare(fn_hash) != 0) ? "" : out_fn;
|
||||
}
|
||||
|
||||
// start or resume downloading if hash doesn't match
|
||||
if (hash.compare(fn_hash) != 0) {
|
||||
set_progress("Downloading " + name + "...");
|
||||
bool r = download_file(url, out_fn);
|
||||
if (!r) {
|
||||
set_error("failed to download " + name);
|
||||
unlink(out_fn.c_str());
|
||||
return "";
|
||||
}
|
||||
fn_hash = sha256_file(out_fn);
|
||||
}
|
||||
|
||||
set_progress("Verifying " + name + "...");
|
||||
printf("got %s hash: %s\n", name.c_str(), hash.c_str());
|
||||
if (fn_hash != hash) {
|
||||
set_error(name + " was corrupt");
|
||||
unlink(out_fn.c_str());
|
||||
return "";
|
||||
}
|
||||
return out_fn;
|
||||
}
|
||||
|
||||
bool download_stage(bool dry_run = false) {
|
||||
curl = curl_easy_init();
|
||||
assert(curl);
|
||||
|
||||
// ** quick checks before download **
|
||||
|
||||
if (!check_space()) {
|
||||
if (!dry_run) set_error("2GB of free space required to update");
|
||||
return false;
|
||||
}
|
||||
|
||||
mkdir(UPDATE_DIR, 0777);
|
||||
|
||||
set_progress("Finding latest version...");
|
||||
std::string manifest_s = download_string(curl, manifest_url);
|
||||
printf("manifest: %s\n", manifest_s.c_str());
|
||||
|
||||
std::string err;
|
||||
auto manifest = json11::Json::parse(manifest_s, err);
|
||||
if (manifest.is_null() || !err.empty()) {
|
||||
set_error("failed to load update manifest");
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string ota_url = manifest["ota_url"].string_value();
|
||||
std::string ota_hash = manifest["ota_hash"].string_value();
|
||||
|
||||
std::string recovery_url = manifest["recovery_url"].string_value();
|
||||
recovery_hash = manifest["recovery_hash"].string_value();
|
||||
recovery_len = manifest["recovery_len"].int_value();
|
||||
|
||||
// std::string installer_url = manifest["installer_url"].string_value();
|
||||
// std::string installer_hash = manifest["installer_hash"].string_value();
|
||||
|
||||
if (ota_url.empty() || ota_hash.empty()) {
|
||||
set_error("invalid update manifest");
|
||||
return false;
|
||||
}
|
||||
|
||||
// std::string installer_fn = download(installer_url, installer_hash, "installer");
|
||||
// if (installer_fn.empty()) {
|
||||
// //error'd
|
||||
// return;
|
||||
// }
|
||||
|
||||
// ** handle recovery download **
|
||||
if (recovery_url.empty() || recovery_hash.empty() || recovery_len == 0) {
|
||||
set_progress("Skipping recovery flash...");
|
||||
} else {
|
||||
// only download the recovery if it differs from what's flashed
|
||||
set_progress("Checking recovery...");
|
||||
std::string existing_recovery_hash = sha256_file(RECOVERY_DEV, recovery_len);
|
||||
printf("existing recovery hash: %s\n", existing_recovery_hash.c_str());
|
||||
|
||||
if (existing_recovery_hash != recovery_hash) {
|
||||
recovery_fn = download(recovery_url, recovery_hash, "recovery", dry_run);
|
||||
if (recovery_fn.empty()) {
|
||||
// error'd
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ** handle ota download **
|
||||
ota_fn = download(ota_url, ota_hash, "update", dry_run);
|
||||
if (ota_fn.empty()) {
|
||||
//error'd
|
||||
return false;
|
||||
}
|
||||
|
||||
// download sucessful
|
||||
return true;
|
||||
}
|
||||
|
||||
// thread that handles downloading and installing the update
|
||||
void run_stages() {
|
||||
printf("run_stages start\n");
|
||||
|
||||
|
||||
// ** download update **
|
||||
|
||||
if (!check_battery()) {
|
||||
set_battery_low();
|
||||
int battery_cap = battery_capacity();
|
||||
while(battery_cap < min_battery_cap) {
|
||||
battery_cap = battery_capacity();
|
||||
battery_cap_text = std::to_string(battery_cap);
|
||||
util::sleep_for(1000);
|
||||
}
|
||||
set_running();
|
||||
}
|
||||
|
||||
bool sucess = download_stage();
|
||||
if (!sucess) {
|
||||
return;
|
||||
}
|
||||
|
||||
// ** install update **
|
||||
|
||||
if (!check_battery()) {
|
||||
set_battery_low();
|
||||
int battery_cap = battery_capacity();
|
||||
while(battery_cap < min_battery_cap) {
|
||||
battery_cap = battery_capacity();
|
||||
battery_cap_text = std::to_string(battery_cap);
|
||||
util::sleep_for(1000);
|
||||
}
|
||||
set_running();
|
||||
}
|
||||
|
||||
if (!recovery_fn.empty()) {
|
||||
// flash recovery
|
||||
set_progress("Flashing recovery...");
|
||||
|
||||
FILE *flash_file = fopen(recovery_fn.c_str(), "rb");
|
||||
if (!flash_file) {
|
||||
set_error("failed to flash recovery");
|
||||
return;
|
||||
}
|
||||
|
||||
FILE *recovery_dev = fopen(RECOVERY_DEV, "w+b");
|
||||
if (!recovery_dev) {
|
||||
fclose(flash_file);
|
||||
set_error("failed to flash recovery");
|
||||
return;
|
||||
}
|
||||
|
||||
const size_t buf_size = 4096;
|
||||
std::unique_ptr<char[]> buffer( new char[ buf_size ] );
|
||||
|
||||
while (true) {
|
||||
size_t bytes_read = fread(buffer.get(), 1, buf_size, flash_file);
|
||||
if (!bytes_read) break;
|
||||
|
||||
size_t bytes_written = fwrite(buffer.get(), 1, bytes_read, recovery_dev);
|
||||
if (bytes_read != bytes_written) {
|
||||
fclose(recovery_dev);
|
||||
fclose(flash_file);
|
||||
set_error("failed to flash recovery: write failed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
fclose(recovery_dev);
|
||||
fclose(flash_file);
|
||||
|
||||
set_progress("Verifying flash...");
|
||||
std::string new_recovery_hash = sha256_file(RECOVERY_DEV, recovery_len);
|
||||
printf("new recovery hash: %s\n", new_recovery_hash.c_str());
|
||||
|
||||
if (new_recovery_hash != recovery_hash) {
|
||||
set_error("recovery flash corrupted");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// write arguments to recovery
|
||||
FILE *cmd_file = fopen(RECOVERY_COMMAND, "wb");
|
||||
if (!cmd_file) {
|
||||
set_error("failed to reboot into recovery");
|
||||
return;
|
||||
}
|
||||
fprintf(cmd_file, "--update_package=%s\n", ota_fn.c_str());
|
||||
fclose(cmd_file);
|
||||
|
||||
set_progress("Rebooting");
|
||||
|
||||
// remove the continue.sh so we come back into the setup.
|
||||
// maybe we should go directly into the installer, but what if we don't come back with internet? :/
|
||||
//unlink("/data/data/com.termux/files/continue.sh");
|
||||
|
||||
// TODO: this should be generic between android versions
|
||||
// IPowerManager.reboot(confirm=false, reason="recovery", wait=true)
|
||||
system("service call power 16 i32 0 s16 recovery i32 1");
|
||||
while (true) pause();
|
||||
|
||||
// execl("/system/bin/reboot", "recovery");
|
||||
// set_error("failed to reboot into recovery");
|
||||
}
|
||||
|
||||
void draw_ack_screen(const char *title, const char *message, const char *button, const char *altbutton) {
|
||||
nvgFillColor(vg, nvgRGBA(255,255,255,255));
|
||||
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
|
||||
|
||||
nvgFontFace(vg, "opensans_bold");
|
||||
nvgFontSize(vg, 120.0f);
|
||||
nvgTextBox(vg, 110, 220, fb_w-240, title, NULL);
|
||||
|
||||
nvgFontFace(vg, "opensans_regular");
|
||||
nvgFontSize(vg, 86.0f);
|
||||
nvgTextBox(vg, 130, 380, fb_w-260, message, NULL);
|
||||
|
||||
// draw button
|
||||
if (button) {
|
||||
nvgBeginPath(vg);
|
||||
nvgFillColor(vg, nvgRGBA(8, 8, 8, 255));
|
||||
nvgRoundedRect(vg, b_x, b_y, b_w, b_h, 20);
|
||||
nvgFill(vg);
|
||||
|
||||
nvgFillColor(vg, nvgRGBA(255, 255, 255, 255));
|
||||
nvgFontFace(vg, "opensans_semibold");
|
||||
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
|
||||
nvgText(vg, b_x+b_w/2, b_y+b_h/2, button, NULL);
|
||||
|
||||
nvgBeginPath(vg);
|
||||
nvgStrokeColor(vg, nvgRGBA(255, 255, 255, 50));
|
||||
nvgStrokeWidth(vg, 5);
|
||||
nvgRoundedRect(vg, b_x, b_y, b_w, b_h, 20);
|
||||
nvgStroke(vg);
|
||||
}
|
||||
|
||||
// draw button
|
||||
if (altbutton) {
|
||||
nvgBeginPath(vg);
|
||||
nvgFillColor(vg, nvgRGBA(8, 8, 8, 255));
|
||||
nvgRoundedRect(vg, balt_x, b_y, b_w, b_h, 20);
|
||||
nvgFill(vg);
|
||||
|
||||
nvgFillColor(vg, nvgRGBA(255, 255, 255, 255));
|
||||
nvgFontFace(vg, "opensans_semibold");
|
||||
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
|
||||
nvgText(vg, balt_x+b_w/2, b_y+b_h/2, altbutton, NULL);
|
||||
|
||||
nvgBeginPath(vg);
|
||||
nvgStrokeColor(vg, nvgRGBA(255, 255, 255, 50));
|
||||
nvgStrokeWidth(vg, 5);
|
||||
nvgRoundedRect(vg, balt_x, b_y, b_w, b_h, 20);
|
||||
nvgStroke(vg);
|
||||
}
|
||||
}
|
||||
|
||||
void draw_battery_screen() {
|
||||
low_battery_title = "Low Battery";
|
||||
low_battery_text = "Please connect EON to your charger. Update will continue once EON battery reaches 35%.";
|
||||
low_battery_context = "Current battery charge: " + battery_cap_text + "%";
|
||||
|
||||
nvgFillColor(vg, nvgRGBA(255,255,255,255));
|
||||
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
|
||||
|
||||
nvgFontFace(vg, "opensans_bold");
|
||||
nvgFontSize(vg, 120.0f);
|
||||
nvgTextBox(vg, 110, 220, fb_w-240, low_battery_title.c_str(), NULL);
|
||||
|
||||
nvgFontFace(vg, "opensans_regular");
|
||||
nvgFontSize(vg, 86.0f);
|
||||
nvgTextBox(vg, 130, 380, fb_w-260, low_battery_text.c_str(), NULL);
|
||||
|
||||
nvgFontFace(vg, "opensans_bold");
|
||||
nvgFontSize(vg, 86.0f);
|
||||
nvgTextBox(vg, 130, 700, fb_w-260, low_battery_context.c_str(), NULL);
|
||||
}
|
||||
|
||||
void draw_progress_screen() {
|
||||
// draw progress message
|
||||
nvgFontSize(vg, 64.0f);
|
||||
nvgFillColor(vg, nvgRGBA(255,255,255,255));
|
||||
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
|
||||
nvgFontFace(vg, "opensans_bold");
|
||||
nvgFontSize(vg, 86.0f);
|
||||
nvgTextBox(vg, 0, 380, fb_w, progress_text.c_str(), NULL);
|
||||
|
||||
// draw progress bar
|
||||
{
|
||||
int progress_width = 1000;
|
||||
int progress_x = fb_w/2-progress_width/2;
|
||||
int progress_y = 520;
|
||||
int progress_height = 50;
|
||||
|
||||
int powerprompt_y = 312;
|
||||
nvgFontFace(vg, "opensans_regular");
|
||||
nvgFontSize(vg, 64.0f);
|
||||
nvgText(vg, fb_w/2, 740, "Ensure your device remains connected to a power source.", NULL);
|
||||
|
||||
NVGpaint paint = nvgBoxGradient(
|
||||
vg, progress_x + 1, progress_y + 1,
|
||||
progress_width - 2, progress_height, 3, 4, nvgRGB(27, 27, 27), nvgRGB(27, 27, 27));
|
||||
nvgBeginPath(vg);
|
||||
nvgRoundedRect(vg, progress_x, progress_y, progress_width, progress_height, 12);
|
||||
nvgFillPaint(vg, paint);
|
||||
nvgFill(vg);
|
||||
|
||||
float value = std::min(std::max(0.0f, progress_frac), 1.0f);
|
||||
int bar_pos = ((progress_width - 2) * value);
|
||||
|
||||
paint = nvgBoxGradient(
|
||||
vg, progress_x, progress_y,
|
||||
bar_pos+1.5f, progress_height-1, 3, 4,
|
||||
nvgRGB(245, 245, 245), nvgRGB(105, 105, 105));
|
||||
|
||||
nvgBeginPath(vg);
|
||||
nvgRoundedRect(
|
||||
vg, progress_x+1, progress_y+1,
|
||||
bar_pos, progress_height-2, 12);
|
||||
nvgFillPaint(vg, paint);
|
||||
nvgFill(vg);
|
||||
}
|
||||
}
|
||||
|
||||
void ui_draw() {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
|
||||
nvgBeginFrame(vg, fb_w, fb_h, 1.0f);
|
||||
|
||||
switch (state) {
|
||||
case CONFIRMATION:
|
||||
draw_ack_screen("An update to NEOS is required.",
|
||||
"Your device will now be reset and upgraded. You may want to connect to wifi as download is around 1 GB. Existing data on device should not be lost.",
|
||||
"Continue",
|
||||
"Connect to WiFi");
|
||||
break;
|
||||
case LOW_BATTERY:
|
||||
draw_battery_screen();
|
||||
break;
|
||||
case RUNNING:
|
||||
draw_progress_screen();
|
||||
break;
|
||||
case ERROR:
|
||||
draw_ack_screen("There was an error", (error_text).c_str(), NULL, "Reboot");
|
||||
break;
|
||||
}
|
||||
|
||||
nvgEndFrame(vg);
|
||||
}
|
||||
|
||||
void ui_update() {
|
||||
std::lock_guard<std::mutex> guard(lock);
|
||||
|
||||
if (state == ERROR || state == CONFIRMATION) {
|
||||
int touch_x = -1, touch_y = -1;
|
||||
int res = touch_poll(&touch, &touch_x, &touch_y, 0);
|
||||
if (res == 1 && !is_settings_active()) {
|
||||
if (touch_x >= b_x && touch_x < b_x+b_w && touch_y >= b_y && touch_y < b_y+b_h) {
|
||||
if (state == CONFIRMATION) {
|
||||
state = RUNNING;
|
||||
update_thread_handle = std::thread(&Updater::run_stages, this);
|
||||
}
|
||||
}
|
||||
if (touch_x >= balt_x && touch_x < balt_x+b_w && touch_y >= b_y && touch_y < b_y+b_h) {
|
||||
if (state == CONFIRMATION) {
|
||||
start_settings_activity("Settings$WifiSettingsActivity");
|
||||
} else if (state == ERROR) {
|
||||
do_exit = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void go() {
|
||||
ui_init();
|
||||
|
||||
while (!do_exit) {
|
||||
ui_update();
|
||||
|
||||
glClearColor(0.08, 0.08, 0.08, 1.0);
|
||||
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||
|
||||
// background
|
||||
nvgBeginPath(vg);
|
||||
NVGpaint bg = nvgLinearGradient(vg, fb_w, 0, fb_w, fb_h,
|
||||
nvgRGBA(0, 0, 0, 0), nvgRGBA(0, 0, 0, 255));
|
||||
nvgFillPaint(vg, bg);
|
||||
nvgRect(vg, 0, 0, fb_w, fb_h);
|
||||
nvgFill(vg);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
ui_draw();
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
fb->swap();
|
||||
|
||||
assert(glGetError() == GL_NO_ERROR);
|
||||
|
||||
// no simple way to do 30fps vsync with surfaceflinger...
|
||||
util::sleep_for(30);
|
||||
}
|
||||
|
||||
if (update_thread_handle.joinable()) {
|
||||
update_thread_handle.join();
|
||||
}
|
||||
|
||||
// reboot
|
||||
system("service call power 16 i32 0 i32 0 i32 1");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
bool background_cache = false;
|
||||
if (argc > 1) {
|
||||
if (strcmp(argv[1], "local") == 0) {
|
||||
manifest_url = MANIFEST_URL_NEOS_LOCAL;
|
||||
} else if (strcmp(argv[1], "staging") == 0) {
|
||||
manifest_url = MANIFEST_URL_NEOS_STAGING;
|
||||
} else if (strcmp(argv[1], "bgcache") == 0) {
|
||||
manifest_url = argv[2];
|
||||
background_cache = true;
|
||||
} else {
|
||||
manifest_url = argv[1];
|
||||
}
|
||||
}
|
||||
|
||||
printf("updating from %s\n", manifest_url);
|
||||
Updater updater;
|
||||
|
||||
int err = 0;
|
||||
if (background_cache) {
|
||||
err = !updater.download_stage();
|
||||
} else {
|
||||
updater.go();
|
||||
}
|
||||
return err;
|
||||
}
|
||||
+5
-17
@@ -90,18 +90,11 @@ function two_init {
|
||||
|
||||
# Check for NEOS update
|
||||
if [ $(< /VERSION) != "$REQUIRED_NEOS_VERSION" ]; then
|
||||
if [ -f "$DIR/scripts/continue.sh" ]; then
|
||||
cp "$DIR/scripts/continue.sh" "/data/data/com.termux/files/continue.sh"
|
||||
fi
|
||||
|
||||
if [ ! -f "$BASEDIR/prebuilt" ]; then
|
||||
# Clean old build products, but preserve the scons cache
|
||||
cd $DIR
|
||||
git clean -xdf
|
||||
git submodule foreach --recursive git clean -xdf
|
||||
fi
|
||||
|
||||
"$DIR/installer/updater/updater" "file://$DIR/installer/updater/update.json"
|
||||
echo "Installing NEOS update"
|
||||
NEOS_PY="$DIR/selfdrive/hardware/eon/neos.py"
|
||||
MANIFEST="$DIR/selfdrive/hardware/eon/neos.json"
|
||||
$NEOS_PY --swap-if-ready $MANIFEST
|
||||
$DIR/selfdrive/hardware/eon/updater $NEOS_PY $MANIFEST
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -165,11 +158,6 @@ function launch {
|
||||
mv "${STAGING_ROOT}/finalized" $BASEDIR
|
||||
cd $BASEDIR
|
||||
|
||||
# Partial mitigation for symlink-related filesystem corruption
|
||||
# Ensure all files match the repo versions after update
|
||||
git reset --hard
|
||||
git submodule foreach --recursive git reset --hard
|
||||
|
||||
echo "Restarting launch script ${LAUNCHER_LOCATION}"
|
||||
unset REQUIRED_NEOS_VERSION
|
||||
unset AGNOS_VERSION
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ if [ -z "$REQUIRED_NEOS_VERSION" ]; then
|
||||
fi
|
||||
|
||||
if [ -z "$AGNOS_VERSION" ]; then
|
||||
export AGNOS_VERSION="1.5"
|
||||
export AGNOS_VERSION="2"
|
||||
fi
|
||||
|
||||
if [ -z "$PASSIVE" ]; then
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -281,6 +281,7 @@ BO_ 777 CAR_SPEED: 8 PCM
|
||||
SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ IMPERIAL_UNIT : 63|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY
|
||||
|
||||
+2
-21
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
import re
|
||||
import os
|
||||
import struct
|
||||
@@ -148,7 +149,7 @@ class dbc():
|
||||
ival = dd.get(s.name)
|
||||
if ival is not None:
|
||||
|
||||
ival = (ival / s.factor) - s.offset
|
||||
ival = (ival - s.offset) / s.factor
|
||||
ival = int(round(ival))
|
||||
|
||||
if s.is_signed and ival < 0:
|
||||
@@ -254,23 +255,3 @@ class dbc():
|
||||
def get_signals(self, msg):
|
||||
msg = self.lookup_msg_id(msg)
|
||||
return [sgs.name for sgs in self.msgs[msg][1]]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from opendbc import DBC_PATH
|
||||
|
||||
dbc_test = dbc(os.path.join(DBC_PATH, 'toyota_prius_2017_pt_generated.dbc'))
|
||||
msg = ('STEER_ANGLE_SENSOR', {'STEER_ANGLE': -6.0, 'STEER_RATE': 4, 'STEER_FRACTION': -0.2})
|
||||
encoded = dbc_test.encode(*msg)
|
||||
decoded = dbc_test.decode((0x25, 0, encoded))
|
||||
assert decoded == msg
|
||||
|
||||
dbc_test = dbc(os.path.join(DBC_PATH, 'hyundai_santa_fe_2019_ccan.dbc'))
|
||||
decoded = dbc_test.decode((0x2b0, 0, "\xfa\xfe\x00\x07\x12"))
|
||||
assert abs(decoded[1]['SAS_Angle'] - (-26.2)) < 0.001
|
||||
|
||||
msg = ('SAS11', {'SAS_Stat': 7.0, 'MsgCount': 0.0, 'SAS_Angle': -26.200000000000003, 'SAS_Speed': 0.0, 'CheckSum': 0.0})
|
||||
encoded = dbc_test.encode(*msg)
|
||||
decoded = dbc_test.decode((0x2b0, 0, encoded))
|
||||
|
||||
assert decoded == msg
|
||||
|
||||
@@ -54,7 +54,7 @@ def process(in_fn, out_fn):
|
||||
checksum_start_bit = 0
|
||||
counter_start_bit = None
|
||||
little_endian = True
|
||||
elif can_dbc.name.startswith(("chrysler_")):
|
||||
elif can_dbc.name.startswith(("chrysler_", "stellantis_")):
|
||||
checksum_type = "chrysler"
|
||||
checksum_size = 8
|
||||
counter_size = None
|
||||
|
||||
@@ -72,8 +72,13 @@ BO_ 201 ECMEngineStatus: 8 K20_ECM
|
||||
SG_ Brake_Pressed : 40|1@0+ (1,0) [0|1] "" NEO
|
||||
SG_ Standstill : 2|1@0+ (1,0) [0|1] "" NEO
|
||||
|
||||
BO_ 209 EBCMBrakePedalTorque: 7 K17_EBCM
|
||||
SG_ BrakePedalTorque : 3|12@0+ (1,0) [0|0] "" NEO
|
||||
BO_ 209 EBCMBrakePedalSensors: 7 K17_EBCM
|
||||
SG_ Counter1 : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ Counter2 : 23|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ BrakePedalPosition1 : 5|14@0+ (1,0) [0|16383] "" XXX
|
||||
SG_ BrakePedalPosition2 : 21|14@0- (-1,0) [0|16383] "" XXX
|
||||
SG_ BrakeNormalized1 : 39|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ BrakeNormalized2 : 47|8@0- (-1,0) [0|255] "" XXX
|
||||
|
||||
BO_ 241 EBCMBrakePedalPosition: 6 K17_EBCM
|
||||
SG_ BrakePedalPosition : 15|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
@@ -285,6 +285,7 @@ BO_ 777 CAR_SPEED: 8 PCM
|
||||
SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ IMPERIAL_UNIT : 63|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY
|
||||
|
||||
@@ -285,6 +285,7 @@ BO_ 777 CAR_SPEED: 8 PCM
|
||||
SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ IMPERIAL_UNIT : 63|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY
|
||||
|
||||
@@ -285,6 +285,7 @@ BO_ 777 CAR_SPEED: 8 PCM
|
||||
SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ IMPERIAL_UNIT : 63|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY
|
||||
|
||||
@@ -285,6 +285,7 @@ BO_ 777 CAR_SPEED: 8 PCM
|
||||
SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ IMPERIAL_UNIT : 63|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY
|
||||
|
||||
@@ -285,6 +285,7 @@ BO_ 777 CAR_SPEED: 8 PCM
|
||||
SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ IMPERIAL_UNIT : 63|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY
|
||||
|
||||
@@ -285,6 +285,7 @@ BO_ 777 CAR_SPEED: 8 PCM
|
||||
SG_ LOCK_STATUS : 55|2@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ IMPERIAL_UNIT : 63|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 780 ACC_HUD: 8 ADAS
|
||||
SG_ CRUISE_SPEED : 31|8@0+ (1,0) [0|255] "kph" BDY
|
||||
|
||||
@@ -0,0 +1,454 @@
|
||||
|
||||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BS_:
|
||||
|
||||
BU_: XXX
|
||||
|
||||
|
||||
BO_ 1280 RADAR_TRACK_500: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1281 RADAR_TRACK_501: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1282 RADAR_TRACK_502: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1283 RADAR_TRACK_503: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1284 RADAR_TRACK_504: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1285 RADAR_TRACK_505: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1286 RADAR_TRACK_506: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1287 RADAR_TRACK_507: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1288 RADAR_TRACK_508: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1289 RADAR_TRACK_509: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1290 RADAR_TRACK_50a: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1291 RADAR_TRACK_50b: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1292 RADAR_TRACK_50c: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1293 RADAR_TRACK_50d: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1294 RADAR_TRACK_50e: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1295 RADAR_TRACK_50f: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1296 RADAR_TRACK_510: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1297 RADAR_TRACK_511: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1298 RADAR_TRACK_512: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1299 RADAR_TRACK_513: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1300 RADAR_TRACK_514: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1301 RADAR_TRACK_515: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1302 RADAR_TRACK_516: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1303 RADAR_TRACK_517: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1304 RADAR_TRACK_518: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1305 RADAR_TRACK_519: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1306 RADAR_TRACK_51a: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1307 RADAR_TRACK_51b: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1308 RADAR_TRACK_51c: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1309 RADAR_TRACK_51d: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1310 RADAR_TRACK_51e: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
|
||||
BO_ 1311 RADAR_TRACK_51f: 8 RADAR
|
||||
SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX
|
||||
SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX
|
||||
SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX
|
||||
SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX
|
||||
SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX
|
||||
SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX
|
||||
SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "lexus_ct200h_2018_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "lexus_is_2018_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "lexus_nx300_2018_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "lexus_nx300h_2018_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "lexus_rx_350_2016_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "lexus_rx_hybrid_2017_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
+19
-33
@@ -498,32 +498,17 @@ BO_ 552 GEAR: 8 XXX
|
||||
SG_ GEAR_BOX : 36|4@0+ (1,0) [0|15] "" XXX
|
||||
|
||||
BO_ 543 CRZ_EVENTS: 8 XXX
|
||||
SG_ NEW_SIGNAL_3 : 34|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHKSUM : 63|8@0+ (1,0) [0|15] "" XXX
|
||||
SG_ NEW_SIGNAL_1 : 55|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ NEW_SIGNAL_5 : 47|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ NEW_SIGNAL_6 : 6|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_8 : 0|1@0+ (1,0) [0|31] "" XXX
|
||||
SG_ NEW_SIGNAL_9 : 1|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_10 : 2|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_12 : 10|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_13 : 9|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_18 : 12|1@0+ (1,0) [0|15] "" XXX
|
||||
SG_ NEW_SIGNAL_19 : 14|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_20 : 15|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_21 : 23|1@0+ (1,0) [0|15] "" XXX
|
||||
SG_ NEW_SIGNAL_24 : 31|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ GAS_PEDAL_PRESSED : 32|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ CRZ_STARTED : 18|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PLUS_ONE_CRZ : 17|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ PLUS_ONE_CRZ_2 : 19|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ GAS_MAYBE : 22|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NONACC_ACTIVE : 5|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CRUISE_ACTIVE_CAR_MOVING : 16|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NONACC_RELATED : 11|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ CTR : 51|4@0+ (1,0) [0|15] "" XXX
|
||||
SG_ CAS_CMD_MAYBE : 30|7@0- (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_4 : 43|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_21 : 23|1@0+ (1,0) [0|15] "" XXX
|
||||
SG_ GAS_MAYBE : 22|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ ACCEL_CMD : 46|8@0- (1,0) [0|15] "" XXX
|
||||
SG_ CRUISE_ACTIVE_CAR_MOVING : 16|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PLUS_ONE_CRZ : 17|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ CRZ_STARTED : 18|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CHKSUM : 63|8@0+ (1,0) [0|15] "" XXX
|
||||
SG_ PLUS_ONE_CRZ_2 : 19|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ ACCEL_CMD_LOW_RES : 29|8@0- (1,0) [0|255] "" XXX
|
||||
SG_ CRZ_SPEED : 7|16@0+ (0.005,-0.5) [0|328] "kph" XXX
|
||||
|
||||
BO_ 542 NEW_MSG_33: 8 XXX
|
||||
SG_ CTR : 48|4@1+ (1,0) [0|15] "" XXX
|
||||
@@ -564,32 +549,32 @@ BO_ 535 CURVE_CTRS: 8 XXX
|
||||
SG_ NEW_SIGNAL_4 : 9|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 540 CRZ_CTRL: 8 XXX
|
||||
SG_ NEW_SIGNAL_3 : 1|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_4 : 8|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_5 : 9|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_6 : 10|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_7 : 18|3@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_9 : 31|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_10 : 30|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ ACC_GAS_MAYBE : 23|1@0+ (1,0) [0|31] "" XXX
|
||||
SG_ ACC_GAS_MAYBE2 : 29|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CRZ_ACTIVE : 3|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ HANDS_OFF_STEERING : 48|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ HANDS_ON_STEER_WARN : 59|4@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_1 : 52|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_2 : 45|3@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_8 : 0|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_3 : 1|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CRZ_ACTIVE : 3|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_4 : 8|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_5 : 9|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ CRZ_AVAILABLE : 17|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ DISTANCE_SETTING : 20|3@0+ (1,0) [0|7] "" XXX
|
||||
|
||||
BO_ 539 CRZ_INFO: 8 XXX
|
||||
SG_ NEW_SIGNAL_1 : 17|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_2 : 16|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_5 : 34|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ NEW_SIGNAL_7 : 47|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ CTR1 : 55|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_3 : 37|1@0+ (1,0) [0|255] "" XXX
|
||||
SG_ ACC_ACTIVE : 33|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ ACCEL_CMD : 31|10@0- (1,0) [0|1] "" XXX
|
||||
SG_ ACCEL_CMD : 31|8@0- (1,0) [0|1] "" XXX
|
||||
SG_ CHKSUM : 63|8@0+ (1,0) [0|255] "" XXX
|
||||
SG_ NEW_SIGNAL_1 : 7|16@0+ (1,0) [0|65535] "" XXX
|
||||
|
||||
BO_ 121 EPB: 8 XXX
|
||||
SG_ NEW_SIGNAL_1 : 4|4@0+ (1,0) [0|255] "" XXX
|
||||
@@ -774,5 +759,6 @@ CM_ SG_ 552 MORE_GEAR "";
|
||||
CM_ SG_ 552 GEAR "0 Shifting, 1 P, 2 R, 3 N, 4 D";
|
||||
CM_ SG_ 552 GEAR_BOX "0 P, 14 R, 1 though 6 D for speeds, 15 Shift";
|
||||
CM_ SG_ 540 HANDS_ON_STEER_WARN "0 no warning, b warning";
|
||||
CM_ SG_ 540 DISTANCE_SETTING "Radar distance 0: disabled, 1: 4 bars, 2: 3 bars, 3: 2 bars, 4: 1 bar";
|
||||
CM_ SG_ 1143 REAR_CT_ALERT "Rear Cross Traffic Alert";
|
||||
VAL_ 552 GEAR 1 "P" 2 "R" 3 "N" 4 "D" ;
|
||||
|
||||
+26
-9
@@ -34,14 +34,14 @@ NS_ :
|
||||
BS_:
|
||||
|
||||
BU_:
|
||||
NEO
|
||||
MCU
|
||||
GTW
|
||||
EPAS
|
||||
DI
|
||||
ESP
|
||||
SBW
|
||||
STW
|
||||
NEO
|
||||
MCU
|
||||
GTW
|
||||
EPAS
|
||||
DI
|
||||
ESP
|
||||
SBW
|
||||
STW
|
||||
APP
|
||||
DAS
|
||||
XXX
|
||||
@@ -71,6 +71,17 @@ BO_ 1160 DAS_steeringControl: 4 NEO
|
||||
SG_ DAS_steeringAngleRequest : 6|15@0+ (0.1,-1638.35) [-1638.35|1638.35] "deg" EPAS
|
||||
SG_ DAS_steeringHapticRequest : 7|1@0+ (1,0) [0|0] "" EPAS
|
||||
|
||||
BO_ 697 DAS_control: 8 NEO
|
||||
SG_ DAS_setSpeed : 0|12@1+ (0.1,0) [0|409.4] "kph" NEO
|
||||
SG_ DAS_accState : 12|4@1+ (1,0) [0|0] "" NEO
|
||||
SG_ DAS_aebEvent : 16|2@1+ (1,0) [0|3] "" NEO
|
||||
SG_ DAS_jerkMin : 18|9@1+ (0.03,-15.232) [-15.232|0.098] "m/s^3" NEO
|
||||
SG_ DAS_jerkMax : 27|8@1+ (0.059,0) [0|15.045] "m/s^3" NEO
|
||||
SG_ DAS_accelMin : 35|9@1+ (0.04,-15) [-15|5.44] "m/s^2" NEO
|
||||
SG_ DAS_accelMax : 44|9@1+ (0.04,-15) [-15|5.44] "m/s^2" NEO
|
||||
SG_ DAS_controlCounter : 53|3@1+ (1,0) [0|0] "" NEO
|
||||
SG_ DAS_controlChecksum : 56|8@1+ (1,0) [0|0] "" NEO
|
||||
|
||||
BO_ 257 GTW_epasControl: 3 NEO
|
||||
SG_ GTW_epasControlChecksum : 23|8@0+ (1,0) [0|255] "" NEO
|
||||
SG_ GTW_epasControlCounter : 11|4@0+ (1,0) [0|15] "" NEO
|
||||
@@ -102,7 +113,6 @@ BO_ 3 STW_ANGL_STAT: 8 STW
|
||||
SG_ CRC_STW_ANGL_STAT : 63|8@0+ (1,0) [0|255] "" NEO
|
||||
|
||||
BO_ 14 STW_ANGLHP_STAT: 8 STW
|
||||
|
||||
SG_ StW_AnglHP : 5|14@0+ (0.1,-819.2) [-819.2|819] "deg" NEO
|
||||
SG_ StW_AnglHP_Spd : 21|14@0+ (0.5,-4096) [-4096|4095.5] "deg/s" NEO
|
||||
SG_ StW_AnglHP_Sens_Stat : 33|2@0+ (1,0) [0|0] "" NEO
|
||||
@@ -691,6 +701,13 @@ VAL_ 643 MPkBrk_Stat 1 "ENGG" 0 "RELS" ;
|
||||
VAL_ 643 RevGr_Engg 0 "DISENGG" 1 "ENGG" 2 "NDEF2" 3 "SNA" ;
|
||||
VAL_ 643 StW_Cond_Stat 3 "BLINK" 1 "NDEF1" 0 "OFF" 2 "ON" ;
|
||||
VAL_ 643 Trlr_Stat 2 "NDEF2" 0 "NONE" 1 "OK" 3 "SNA" ;
|
||||
VAL_ 697 DAS_setSpeed 4095 "SNA" ;
|
||||
VAL_ 697 DAS_accState 15 "FAULT_SNA" 13 "ACC_CANCEL_GENERIC_SILENT" 11 "APC_SELFPARK_START" 10 "APC_UNPARK_COMPLETE" 9 "APC_PAUSE" 8 "APC_ABORT" 7 "APC_COMPLETE" 6 "APC_FORWARD" 5 "APC_BACKWARD" 4 "ACC_ON" 3 "ACC_HOLD" 0 "ACC_CANCEL_GENERIC" ;
|
||||
VAL_ 697 DAS_aebEvent 3 "AEB_SNA" 2 "AEB_FAULT" 1 "AEB_ACTIVE" 0 "AEB_NOT_ACTIVE" ;
|
||||
VAL_ 697 DAS_jerkMin 511 "SNA" ;
|
||||
VAL_ 697 DAS_jerkMax 255 "SNA" ;
|
||||
VAL_ 697 DAS_accelMin 511 "SNA" ;
|
||||
VAL_ 697 DAS_accelMax 511 "SNA" ;
|
||||
VAL_ 792 BOOT_STATE 2 "Init" 3 "SNA" 0 "closed" 1 "open" ;
|
||||
VAL_ 792 CERRD 1 "CAN error detect" 0 "no Can error detected" ;
|
||||
VAL_ 792 DAY 1 "Init" 0 "SNA" ;
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "toyota_avalon_2017_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "toyota_camry_hybrid_2018_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "toyota_corolla_2017_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "toyota_highlander_2017_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "toyota_highlander_hybrid_2018_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
|
||||
CM_ "Imported file _toyota_nodsu_common.dbc starts here";
|
||||
BO_ 401 STEERING_LTA: 8 XXX
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
|
||||
CM_ "Imported file _toyota_nodsu_common.dbc starts here";
|
||||
BO_ 401 STEERING_LTA: 8 XXX
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "toyota_prius_2017_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "toyota_rav4_2017_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "toyota_rav4_hybrid_2017_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
@@ -165,10 +165,12 @@ BO_ 1020 SOLAR_SENSOR: 8 XXX
|
||||
SG_ LUX_SENSOR : 55|13@0+ (1,0) [0|0] "" XXX
|
||||
|
||||
BO_ 1041 ACC_HUD: 8 DSU
|
||||
SG_ PCS_INDICATOR : 7|2@0+ (1,0) [0|3] "" XXX
|
||||
SG_ FCW : 4|1@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X20 : 15|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X10 : 39|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ SET_ME_X80 : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
SG_ PCS_OFF : 40|1@0+ (1,0) [0|0] "" XXX
|
||||
SG_ PCS_SENSITIVITY : 55|8@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
BO_ 1042 LKAS_HUD: 8 XXX
|
||||
SG_ BARRIERS : 1|2@0+ (1,0) [0|3] "" XXX
|
||||
@@ -313,6 +315,8 @@ CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front
|
||||
CM_ SG_ 835 ACCEL_CMD_ALT "Copy of main ACCEL_CMD, but across 8 bits instead of 16 bits like ACCEL_CMD. Unsure if only informational or has an effect. Likely informational as existing openpilot sets this to 0 and no loss of functionality observed. Originally 'AT_RAW' in leaked toyota_2017_ref_pt.dbc file.";
|
||||
CM_ SG_ 921 UI_SET_SPEED "set speed shown in UI with user set unit";
|
||||
CM_ SG_ 951 BRAKE_LIGHTS_ACC "brake lights when ACC commands decel";
|
||||
CM_ SG_ 1041 PCS_INDICATOR "Pre-Collision System Indicator";
|
||||
CM_ SG_ 1041 PCS_SENSITIVITY "Pre-Collision System Sensitivity";
|
||||
CM_ SG_ 1042 SET_ME_1 "unclear what this is, but it's always 1 in drive traces";
|
||||
CM_ SG_ 1042 REPEATED_BEEPS "recommended for fcw and other important alerts";
|
||||
CM_ SG_ 1161 SPDVAL1 "Numbers 0-199 is displayed, 200-254 displays circle without number and 255 is for no limit.";
|
||||
@@ -338,6 +342,8 @@ VAL_ 614 DIRECTION_CMD 3 "right" 2 "center" 1 "left";
|
||||
VAL_ 643 STATE 0 "normal" 1 "adaptive_cruise_control" 3 "emergency_braking";
|
||||
VAL_ 835 ACC_TYPE 2 "permanent low speed lockout" 1 "ok";
|
||||
VAL_ 921 CRUISE_CONTROL_STATE 2 "disabled" 11 "hold" 10 "hold_waiting_user_cmd" 6 "enabled" 5 "faulted";
|
||||
VAL_ 1041 PCS_INDICATOR 2 "PCS Faulted" 1 "PCS Turned Off By User" 0 "PCS Enabled";
|
||||
VAL_ 1041 PCS_SENSITIVITY 64 "high sensitivity" 128 "mid sensitivity" 192 "low sensitivity" 0 "off";
|
||||
VAL_ 1042 LDA_ALERT 3 "hold with continuous beep" 2 "LDA unavailable" 1 "hold" 0 "none";
|
||||
VAL_ 1042 BARRIERS 3 "both" 2 "right" 1 "left" 0 "none";
|
||||
VAL_ 1042 RIGHT_LINE 3 "orange" 2 "faded" 1 "solid" 0 "none";
|
||||
@@ -388,6 +394,13 @@ BO_ 35 SECONDARY_STEER_ANGLE: 8 XXX
|
||||
|
||||
CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor that can replace the lower resolution sensor in most TSS1 Toyotas. Learn more: https://github.com/commaai/openpilot/wiki/Toyota-Lexus#zorro-steering-sensor-zss";
|
||||
|
||||
BO_ 767 SDSU: 8 XXX
|
||||
SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX
|
||||
|
||||
CM_ "BO_ SDSU: The sDSU is a modified DSU for use in TSS1 Toyotas. Learn more: https://github.com/wocsor/panda/tree/smart_dsu";
|
||||
|
||||
CM_ SG_ 767 FD_BUTTON "The follow distance button signal as forwarded by the sdsu";
|
||||
|
||||
CM_ "toyota_sienna_xle_2018_pt.dbc starts here";
|
||||
|
||||
|
||||
|
||||
+121
-111
@@ -4,49 +4,35 @@ import subprocess
|
||||
PREFIX = "arm-none-eabi-"
|
||||
BUILDER = "DEV"
|
||||
|
||||
common_flags = []
|
||||
build_projects = {}
|
||||
|
||||
if os.getenv("PEDAL"):
|
||||
PROJECT = "pedal"
|
||||
STARTUP_FILE = "stm32fx/startup_stm32f205xx.s"
|
||||
LINKER_SCRIPT = "stm32fx/stm32fx_flash.ld"
|
||||
APP_START_ADDRESS = "0x8004000"
|
||||
MAIN = "pedal/main.c"
|
||||
PROJECT_FLAGS = [
|
||||
"-mcpu=cortex-m3",
|
||||
"-msoft-float",
|
||||
"-DSTM32F2",
|
||||
"-DSTM32F205xx",
|
||||
"-O2",
|
||||
"-DPEDAL",
|
||||
]
|
||||
build_projects["pedal"] = {
|
||||
"MAIN": "pedal/main.c",
|
||||
"STARTUP_FILE": "stm32fx/startup_stm32f205xx.s",
|
||||
"LINKER_SCRIPT": "stm32fx/stm32fx_flash.ld",
|
||||
"APP_START_ADDRESS": "0x8004000",
|
||||
"PROJECT_FLAGS": [
|
||||
"-mcpu=cortex-m3",
|
||||
"-msoft-float",
|
||||
"-DSTM32F2",
|
||||
"-DSTM32F205xx",
|
||||
"-O2",
|
||||
"-DPEDAL",
|
||||
],
|
||||
}
|
||||
|
||||
if os.getenv("PEDAL_USB"):
|
||||
PROJECT = "pedal_usb"
|
||||
PROJECT_FLAGS.append("-DPEDAL_USB")
|
||||
build_projects["pedal_usb"] = build_projects.pop("pedal")
|
||||
build_projects["pedal_usb"]["PROJECT_FLAGS"].append("-DPEDAL_USB")
|
||||
|
||||
elif os.getenv("PANDA_H7"):
|
||||
PROJECT = "panda_h7"
|
||||
STARTUP_FILE = "stm32h7/startup_stm32h7x5xx.s"
|
||||
LINKER_SCRIPT = "stm32h7/stm32h7x5_flash.ld"
|
||||
APP_START_ADDRESS = "0x8020000"
|
||||
MAIN = "main.c"
|
||||
PROJECT_FLAGS = [
|
||||
"-mcpu=cortex-m7",
|
||||
"-mhard-float",
|
||||
"-DSTM32H7",
|
||||
"-DSTM32H725xx",
|
||||
"-mfpu=fpv5-d16",
|
||||
"-fsingle-precision-constant",
|
||||
"-Os",
|
||||
"-g",
|
||||
"-DPANDA",
|
||||
]
|
||||
|
||||
else:
|
||||
PROJECT = "panda"
|
||||
STARTUP_FILE = "stm32fx/startup_stm32f413xx.s"
|
||||
LINKER_SCRIPT = "stm32fx/stm32fx_flash.ld"
|
||||
APP_START_ADDRESS = "0x8004000"
|
||||
MAIN = "main.c"
|
||||
PROJECT_FLAGS = [
|
||||
build_projects["panda"] = {
|
||||
"MAIN": "main.c",
|
||||
"STARTUP_FILE": "stm32fx/startup_stm32f413xx.s",
|
||||
"LINKER_SCRIPT": "stm32fx/stm32fx_flash.ld",
|
||||
"APP_START_ADDRESS": "0x8004000",
|
||||
"PROJECT_FLAGS": [
|
||||
"-mcpu=cortex-m4",
|
||||
"-mhard-float",
|
||||
"-DSTM32F4",
|
||||
@@ -56,8 +42,48 @@ else:
|
||||
"-Os",
|
||||
"-g",
|
||||
"-DPANDA",
|
||||
]
|
||||
],
|
||||
}
|
||||
|
||||
# arm-none-eabi-gcc on comma two has no cortex-m7 support
|
||||
if not os.path.exists("/EON"):
|
||||
build_projects["panda_h7"] = {
|
||||
"MAIN": "main.c",
|
||||
"STARTUP_FILE": "stm32h7/startup_stm32h7x5xx.s",
|
||||
"LINKER_SCRIPT": "stm32h7/stm32h7x5_flash.ld",
|
||||
"APP_START_ADDRESS": "0x8020000",
|
||||
"PROJECT_FLAGS": [
|
||||
"-mcpu=cortex-m7",
|
||||
"-mhard-float",
|
||||
"-DSTM32H7",
|
||||
"-DSTM32H725xx",
|
||||
"-mfpu=fpv5-d16",
|
||||
"-fsingle-precision-constant",
|
||||
"-Os",
|
||||
"-g",
|
||||
"-DPANDA",
|
||||
],
|
||||
}
|
||||
|
||||
if os.getenv("RELEASE"):
|
||||
BUILD_TYPE = "RELEASE"
|
||||
cert_fn = os.getenv("CERT")
|
||||
assert cert_fn is not None, 'No certificate file specified. Please set CERT env variable'
|
||||
assert os.path.exists(cert_fn), 'Certificate file not found. Please specify absolute path'
|
||||
else:
|
||||
BUILD_TYPE = "DEBUG"
|
||||
cert_fn = File("../certs/debug").srcnode().abspath
|
||||
common_flags += ["-DALLOW_DEBUG"]
|
||||
|
||||
if os.getenv("DEBUG"):
|
||||
common_flags += ["-DDEBUG"]
|
||||
|
||||
includes = [
|
||||
"stm32fx/inc",
|
||||
"stm32h7/inc",
|
||||
"..",
|
||||
".",
|
||||
]
|
||||
|
||||
def get_version(builder, build_type):
|
||||
try:
|
||||
@@ -96,83 +122,67 @@ def get_key_header(name):
|
||||
]
|
||||
return r
|
||||
|
||||
|
||||
def objcopy(source, target, env, for_signature):
|
||||
return '$OBJCOPY -O binary %s %s' % (source[0], target[0])
|
||||
|
||||
|
||||
linkerscript_fn = File(LINKER_SCRIPT).srcnode().abspath
|
||||
|
||||
flags = [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-Wstrict-prototypes",
|
||||
"-Werror",
|
||||
"-mlittle-endian",
|
||||
"-mthumb",
|
||||
"-nostdlib",
|
||||
"-fno-builtin",
|
||||
f"-T{linkerscript_fn}",
|
||||
"-std=gnu11",
|
||||
] + PROJECT_FLAGS
|
||||
|
||||
|
||||
if os.getenv("RELEASE"):
|
||||
BUILD_TYPE = "RELEASE"
|
||||
cert_fn = os.getenv("CERT")
|
||||
assert cert_fn is not None, 'No certificate file specified. Please set CERT env variable'
|
||||
assert os.path.exists(cert_fn), 'Certificate file not found. Please specify absolute path'
|
||||
else:
|
||||
BUILD_TYPE = "DEBUG"
|
||||
cert_fn = File("../certs/debug").srcnode().abspath
|
||||
flags += ["-DALLOW_DEBUG"]
|
||||
|
||||
includes = [
|
||||
"stm32fx/inc",
|
||||
"stm32h7/inc",
|
||||
"..",
|
||||
".",
|
||||
]
|
||||
|
||||
panda_env = Environment(
|
||||
ENV=os.environ,
|
||||
CC=PREFIX + 'gcc',
|
||||
AS=PREFIX + 'gcc',
|
||||
OBJCOPY=PREFIX + 'objcopy',
|
||||
OBJDUMP=PREFIX + 'objdump',
|
||||
ASCOM="$AS $ASFLAGS -o $TARGET -c $SOURCES",
|
||||
CFLAGS=flags,
|
||||
ASFLAGS=flags,
|
||||
LINKFLAGS=flags,
|
||||
CPPPATH=includes,
|
||||
BUILDERS={
|
||||
'Objcopy': Builder(generator=objcopy, suffix='.bin', src_suffix='.elf')
|
||||
}
|
||||
)
|
||||
|
||||
# Common autogenerated includes
|
||||
version = f'const uint8_t gitversion[] = "{get_version(BUILDER, BUILD_TYPE)}";'
|
||||
gitversion = panda_env.Textfile("obj/gitversion.h", [version, ""])
|
||||
Ignore('bootstub.o', gitversion)
|
||||
Requires('bootstub.o', gitversion)
|
||||
Ignore('main.o', gitversion)
|
||||
Requires('main.o', gitversion)
|
||||
with open("obj/gitversion.h", "w") as f:
|
||||
f.write(f'const uint8_t gitversion[] = "{get_version(BUILDER, BUILD_TYPE)}";\n')
|
||||
|
||||
certs = [get_key_header(n) for n in ["debug", "release"]]
|
||||
certheader = panda_env.Textfile("obj/cert.h", certs + [""])
|
||||
with open("obj/cert.h", "w") as f:
|
||||
for cert in certs:
|
||||
f.write("\n".join(cert) + "\n")
|
||||
|
||||
startup = panda_env.Object(STARTUP_FILE)
|
||||
for project_name in build_projects:
|
||||
project = build_projects[project_name]
|
||||
linkerscript_fn = File(project["LINKER_SCRIPT"]).srcnode().abspath
|
||||
|
||||
# Bootstub
|
||||
crypto = ["../crypto/rsa.c", "../crypto/sha.c"]
|
||||
bootstub_elf = panda_env.Program(f"obj/bootstub.{PROJECT}.elf", [startup] + crypto + ["bootstub.c"])
|
||||
bootstub_bin = panda_env.Objcopy(f"obj/bootstub.{PROJECT}.bin", bootstub_elf)
|
||||
flags = [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-Wstrict-prototypes",
|
||||
"-Werror",
|
||||
"-mlittle-endian",
|
||||
"-mthumb",
|
||||
"-nostdlib",
|
||||
"-fno-builtin",
|
||||
f"-T{linkerscript_fn}",
|
||||
"-std=gnu11",
|
||||
] + project["PROJECT_FLAGS"] + common_flags
|
||||
|
||||
# Build main
|
||||
main_elf = panda_env.Program(f"obj/{PROJECT}.elf", [startup, MAIN],
|
||||
LINKFLAGS=[f"-Wl,--section-start,.isr_vector={APP_START_ADDRESS}"] + flags)
|
||||
main_bin = panda_env.Objcopy(f"obj/{PROJECT}.bin", main_elf)
|
||||
project_env = Environment(
|
||||
ENV=os.environ,
|
||||
CC=PREFIX + 'gcc',
|
||||
AS=PREFIX + 'gcc',
|
||||
OBJCOPY=PREFIX + 'objcopy',
|
||||
OBJDUMP=PREFIX + 'objdump',
|
||||
ASCOM="$AS $ASFLAGS -o $TARGET -c $SOURCES",
|
||||
CFLAGS=flags,
|
||||
ASFLAGS=flags,
|
||||
LINKFLAGS=flags,
|
||||
CPPPATH=includes,
|
||||
BUILDERS={
|
||||
'Objcopy': Builder(generator=objcopy, suffix='.bin', src_suffix='.elf')
|
||||
}
|
||||
)
|
||||
startup = project_env.Object(project["STARTUP_FILE"])
|
||||
|
||||
# Sign main
|
||||
sign_py = File("../crypto/sign.py").srcnode().abspath
|
||||
panda_bin_signed = panda_env.Command(f"obj/{PROJECT}.bin.signed", main_bin, f"SETLEN=1 {sign_py} $SOURCE $TARGET {cert_fn}")
|
||||
# Bootstub
|
||||
crypto_obj = [
|
||||
project_env.Object(f"rsa-{project_name}", "../crypto/rsa.c"),
|
||||
project_env.Object(f"sha-{project_name}", "../crypto/sha.c")
|
||||
]
|
||||
bootstub_obj = project_env.Object(f"bootstub-{project_name}", "bootstub.c")
|
||||
bootstub_elf = project_env.Program(f"obj/bootstub.{project_name}.elf", [startup] + crypto_obj + [bootstub_obj])
|
||||
bootstub_bin = project_env.Objcopy(f"obj/bootstub.{project_name}.bin", bootstub_elf)
|
||||
|
||||
# Build main
|
||||
main_obj = project_env.Object(f"main-{project_name}", project["MAIN"])
|
||||
main_elf = project_env.Program(f"obj/{project_name}.elf", [startup, main_obj],
|
||||
LINKFLAGS=[f"-Wl,--section-start,.isr_vector={project['APP_START_ADDRESS']}"] + flags)
|
||||
main_bin = project_env.Objcopy(f"obj/{project_name}.bin", main_elf)
|
||||
|
||||
# Sign main
|
||||
sign_py = File("../crypto/sign.py").srcnode().abspath
|
||||
panda_bin_signed = project_env.Command(f"obj/{project_name}.bin.signed", main_bin, f"SETLEN=1 {sign_py} $SOURCE $TARGET {cert_fn}")
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
void puts(const char *a){ UNUSED(a); }
|
||||
void puth(uint8_t i){ UNUSED(i); }
|
||||
void puth2(uint8_t i){ UNUSED(i); }
|
||||
void puth4(uint8_t i){ UNUSED(i); }
|
||||
typedef struct board board;
|
||||
typedef struct harness_configuration harness_configuration;
|
||||
// No CAN support on bootloader
|
||||
|
||||
@@ -2,6 +2,5 @@
|
||||
set -e
|
||||
|
||||
scons -u
|
||||
PANDA_H7=1 scons -u
|
||||
PEDAL=1 scons -u
|
||||
PEDAL=1 PEDAL_USB=1 scons -u
|
||||
|
||||
@@ -141,9 +141,7 @@ void process_can(uint8_t can_number) {
|
||||
CAN->sTxMailBox[0].TDTR = to_send.RDTR;
|
||||
CAN->sTxMailBox[0].TIR = to_send.RIR;
|
||||
|
||||
if (can_tx_check_min_slots_free(MAX_CAN_MSGS_PER_BULK_TRANSFER)) {
|
||||
usb_outep3_resume_if_paused();
|
||||
}
|
||||
usb_cb_ep3_out_complete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,21 @@ bool can_push(can_ring *q, CAN_FIFOMailBox_TypeDef *elem) {
|
||||
if (!ret) {
|
||||
can_overflow_cnt++;
|
||||
#ifdef DEBUG
|
||||
puts("can_push failed!\n");
|
||||
puts("can_push to ");
|
||||
if (q == &can_rx_q) {
|
||||
puts("can_rx_q");
|
||||
} else if (q == &can_tx1_q) {
|
||||
puts("can_tx1_q");
|
||||
} else if (q == &can_tx2_q) {
|
||||
puts("can_tx2_q");
|
||||
} else if (q == &can_tx3_q) {
|
||||
puts("can_tx3_q");
|
||||
} else if (q == &can_txgmlan_q) {
|
||||
puts("can_txgmlan_q");
|
||||
} else {
|
||||
puts("unknown");
|
||||
}
|
||||
puts(" failed!\n");
|
||||
#endif
|
||||
}
|
||||
return ret;
|
||||
@@ -125,6 +139,8 @@ void can_clear(can_ring *q) {
|
||||
q->w_ptr = 0;
|
||||
q->r_ptr = 0;
|
||||
EXIT_CRITICAL();
|
||||
// handle TX buffer full with zero ECUs awake on the bus
|
||||
usb_cb_ep3_out_complete();
|
||||
}
|
||||
|
||||
// assign CAN numbering
|
||||
|
||||
@@ -74,9 +74,7 @@ void process_can(uint8_t can_number) {
|
||||
to_push.RDHR = to_send.RDHR;
|
||||
can_send_errs += can_push(&can_rx_q, &to_push) ? 0U : 1U;
|
||||
|
||||
if (can_tx_check_min_slots_free(MAX_CAN_MSGS_PER_BULK_TRANSFER)) {
|
||||
usb_outep3_resume_if_paused();
|
||||
}
|
||||
usb_cb_ep3_out_complete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -181,18 +181,23 @@ void putui(uint32_t i) {
|
||||
puts(&str[idx + 1U]);
|
||||
}
|
||||
|
||||
void puth(unsigned int i) {
|
||||
void puthx(uint32_t i, uint8_t len) {
|
||||
const char c[] = "0123456789abcdef";
|
||||
for (int pos = 28; pos != -4; pos -= 4) {
|
||||
for (int pos = ((int)len * 4) - 4; pos > -4; pos -= 4) {
|
||||
putch(c[(i >> (unsigned int)(pos)) & 0xFU]);
|
||||
}
|
||||
}
|
||||
|
||||
void puth(unsigned int i) {
|
||||
puthx(i, 8U);
|
||||
}
|
||||
|
||||
void puth2(unsigned int i) {
|
||||
const char c[] = "0123456789abcdef";
|
||||
for (int pos = 4; pos != -4; pos -= 4) {
|
||||
putch(c[(i >> (unsigned int)(pos)) & 0xFU]);
|
||||
}
|
||||
puthx(i, 2U);
|
||||
}
|
||||
|
||||
void puth4(unsigned int i) {
|
||||
puthx(i, 4U);
|
||||
}
|
||||
|
||||
void hexdump(const void *a, int l) {
|
||||
|
||||
@@ -823,9 +823,11 @@ void usb_irqhandler(void) {
|
||||
// USBx_OUTEP(3)->DOEPTSIZ = (1U << 19) | 0x40U;
|
||||
// USBx_OUTEP(3)->DOEPCTL |= USB_OTG_DOEPCTL_CNAK;
|
||||
} else if ((USBx_OUTEP(3)->DOEPINT) != 0) {
|
||||
puts("OUTEP3 error ");
|
||||
puth(USBx_OUTEP(3)->DOEPINT);
|
||||
puts("\n");
|
||||
#ifdef DEBUG_USB
|
||||
puts("OUTEP3 error ");
|
||||
puth(USBx_OUTEP(3)->DOEPINT);
|
||||
puts("\n");
|
||||
#endif
|
||||
} else {
|
||||
// USBx_OUTEP(3)->DOEPINT is 0, ok to skip
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env sh
|
||||
set -e
|
||||
|
||||
PANDA_GEN3=1 scons -u
|
||||
scons -u
|
||||
PYTHONPATH=.. python3 -c "from python import Panda; Panda().flash('obj/panda_h7.bin.signed')"
|
||||
|
||||
+4
-3
@@ -679,9 +679,10 @@ void tick_handler(void) {
|
||||
}
|
||||
#ifdef DEBUG
|
||||
puts("** blink ");
|
||||
puth(can_rx_q.r_ptr); puts(" "); puth(can_rx_q.w_ptr); puts(" ");
|
||||
puth(can_tx1_q.r_ptr); puts(" "); puth(can_tx1_q.w_ptr); puts(" ");
|
||||
puth(can_tx2_q.r_ptr); puts(" "); puth(can_tx2_q.w_ptr); puts("\n");
|
||||
puts("rx:"); puth4(can_rx_q.r_ptr); puts("-"); puth4(can_rx_q.w_ptr); puts(" ");
|
||||
puts("tx1:"); puth4(can_tx1_q.r_ptr); puts("-"); puth4(can_tx1_q.w_ptr); puts(" ");
|
||||
puts("tx2:"); puth4(can_tx2_q.r_ptr); puts("-"); puth4(can_tx2_q.w_ptr); puts(" ");
|
||||
puts("tx3:"); puth4(can_tx3_q.r_ptr); puts("-"); puth4(can_tx3_q.w_ptr); puts("\n");
|
||||
#endif
|
||||
|
||||
// Tick drivers
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
void puts(const char *a);
|
||||
void puth(unsigned int i);
|
||||
void puth2(unsigned int i);
|
||||
void puth4(unsigned int i);
|
||||
typedef struct board board;
|
||||
typedef struct harness_configuration harness_configuration;
|
||||
void can_flip_buses(uint8_t bus1, uint8_t bus2);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
void puts(const char *a);
|
||||
void puth(unsigned int i);
|
||||
void puth2(unsigned int i);
|
||||
void puth4(unsigned int i);
|
||||
typedef struct board board;
|
||||
typedef struct harness_configuration harness_configuration;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ set -e
|
||||
|
||||
DFU_UTIL="dfu-util"
|
||||
|
||||
PANDA_H7=1 scons -u
|
||||
scons -u
|
||||
|
||||
PYTHONPATH=.. python3 -c "from python import Panda; Panda().reset(enter_bootstub=True); Panda().reset(enter_bootloader=True)" || true
|
||||
sleep 1
|
||||
|
||||
@@ -323,8 +323,12 @@ static const addr_checks* honda_bosch_giraffe_init(int16_t param) {
|
||||
honda_hw = HONDA_BG_HW;
|
||||
// Checking for alternate brake override from safety parameter
|
||||
honda_alt_brake_msg = GET_FLAG(param, HONDA_PARAM_ALT_BRAKE);
|
||||
|
||||
// radar disabled so allow gas/brakes
|
||||
#ifdef ALLOW_DEBUG
|
||||
honda_bosch_long = GET_FLAG(param, HONDA_PARAM_BOSCH_LONG);
|
||||
#endif
|
||||
|
||||
honda_rx_checks = (addr_checks){honda_addr_checks, HONDA_ADDR_CHECKS_LEN};
|
||||
return &honda_rx_checks;
|
||||
}
|
||||
@@ -335,8 +339,12 @@ static const addr_checks* honda_bosch_harness_init(int16_t param) {
|
||||
honda_hw = HONDA_BH_HW;
|
||||
// Checking for alternate brake override from safety parameter
|
||||
honda_alt_brake_msg = GET_FLAG(param, HONDA_PARAM_ALT_BRAKE);
|
||||
|
||||
// radar disabled so allow gas/brakes
|
||||
#ifdef ALLOW_DEBUG
|
||||
honda_bosch_long = GET_FLAG(param, HONDA_PARAM_BOSCH_LONG);
|
||||
#endif
|
||||
|
||||
honda_rx_checks = (addr_checks){honda_bh_addr_checks, HONDA_BH_ADDR_CHECKS_LEN};
|
||||
return &honda_rx_checks;
|
||||
}
|
||||
|
||||
@@ -6,15 +6,28 @@ const int HYUNDAI_MAX_RATE_DOWN = 7;
|
||||
const int HYUNDAI_DRIVER_TORQUE_ALLOWANCE = 50;
|
||||
const int HYUNDAI_DRIVER_TORQUE_FACTOR = 2;
|
||||
const int HYUNDAI_STANDSTILL_THRSLD = 30; // ~1kph
|
||||
|
||||
const int HYUNDAI_MAX_ACCEL = 200; // 1/100 m/s2
|
||||
const int HYUNDAI_MIN_ACCEL = -350; // 1/100 m/s2
|
||||
|
||||
const CanMsg HYUNDAI_TX_MSGS[] = {
|
||||
{832, 0, 8}, // LKAS11 Bus 0
|
||||
{1265, 0, 4}, // CLU11 Bus 0
|
||||
{1157, 0, 4}, // LFAHDA_MFC Bus 0
|
||||
// {1056, 0, 8}, // SCC11, Bus 0
|
||||
// {1057, 0, 8}, // SCC12, Bus 0
|
||||
// {1290, 0, 8}, // SCC13, Bus 0
|
||||
// {905, 0, 8}, // SCC14, Bus 0
|
||||
// {1186, 0, 8} // 4a2SCC, Bus 0
|
||||
};
|
||||
|
||||
const CanMsg HYUNDAI_LONG_TX_MSGS[] = {
|
||||
{832, 0, 8}, // LKAS11 Bus 0
|
||||
{1265, 0, 4}, // CLU11 Bus 0
|
||||
{1157, 0, 4}, // LFAHDA_MFC Bus 0
|
||||
{1056, 0, 8}, // SCC11 Bus 0
|
||||
{1057, 0, 8}, // SCC12 Bus 0
|
||||
{1290, 0, 8}, // SCC13 Bus 0
|
||||
{905, 0, 8}, // SCC14 Bus 0
|
||||
{1186, 0, 2}, // FRT_RADAR11 Bus 0
|
||||
{909, 0, 8}, // FCA11 Bus 0
|
||||
{1155, 0, 8}, // FCA12 Bus 0
|
||||
{2000, 0, 8}, // radar UDS TX addr Bus 0 (for radar disable)
|
||||
};
|
||||
|
||||
AddrCheckStruct hyundai_addr_checks[] = {
|
||||
@@ -26,6 +39,15 @@ AddrCheckStruct hyundai_addr_checks[] = {
|
||||
};
|
||||
#define HYUNDAI_ADDR_CHECK_LEN (sizeof(hyundai_addr_checks) / sizeof(hyundai_addr_checks[0]))
|
||||
|
||||
AddrCheckStruct hyundai_long_addr_checks[] = {
|
||||
{.msg = {{608, 0, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U},
|
||||
{881, 0, 8, .expected_timestep = 10000U}, { 0 }}},
|
||||
{.msg = {{902, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
|
||||
{.msg = {{916, 0, 8, .check_checksum = true, .max_counter = 7U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
|
||||
{.msg = {{1265, 0, 4, .check_checksum = false, .max_counter = 15U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
|
||||
};
|
||||
#define HYUNDAI_LONG_ADDR_CHECK_LEN (sizeof(hyundai_long_addr_checks) / sizeof(hyundai_long_addr_checks[0]))
|
||||
|
||||
// older hyundai models have less checks due to missing counters and checksums
|
||||
AddrCheckStruct hyundai_legacy_addr_checks[] = {
|
||||
{.msg = {{608, 0, 8, .check_checksum = true, .max_counter = 3U, .expected_timestep = 10000U},
|
||||
@@ -38,10 +60,12 @@ AddrCheckStruct hyundai_legacy_addr_checks[] = {
|
||||
|
||||
const int HYUNDAI_PARAM_EV_GAS = 1;
|
||||
const int HYUNDAI_PARAM_HYBRID_GAS = 2;
|
||||
const int HYUNDAI_PARAM_LONGITUDINAL = 4;
|
||||
|
||||
bool hyundai_legacy = false;
|
||||
bool hyundai_ev_gas_signal = false;
|
||||
bool hyundai_hybrid_gas_signal = false;
|
||||
bool hyundai_longitudinal = false;
|
||||
|
||||
addr_checks hyundai_rx_checks = {hyundai_addr_checks, HYUNDAI_ADDR_CHECK_LEN};
|
||||
|
||||
@@ -57,6 +81,8 @@ static uint8_t hyundai_get_counter(CAN_FIFOMailBox_TypeDef *to_push) {
|
||||
cnt = (GET_BYTE(to_push, 1) >> 5) & 0x7;
|
||||
} else if (addr == 1057) {
|
||||
cnt = GET_BYTE(to_push, 7) & 0xF;
|
||||
} else if (addr == 1265) {
|
||||
cnt = (GET_BYTE(to_push, 3) >> 4) & 0xF;
|
||||
} else {
|
||||
cnt = 0;
|
||||
}
|
||||
@@ -132,17 +158,35 @@ static int hyundai_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
|
||||
update_sample(&torque_driver, torque_driver_new);
|
||||
}
|
||||
|
||||
// enter controls on rising edge of ACC, exit controls on ACC off
|
||||
if (addr == 1057) {
|
||||
// 2 bits: 13-14
|
||||
int cruise_engaged = (GET_BYTES_04(to_push) >> 13) & 0x3;
|
||||
if (cruise_engaged && !cruise_engaged_prev) {
|
||||
controls_allowed = 1;
|
||||
if (hyundai_longitudinal) {
|
||||
// ACC steering wheel buttons
|
||||
if (addr == 1265) {
|
||||
int button = GET_BYTE(to_push, 0) & 0x7;
|
||||
switch (button) {
|
||||
case 1: // resume
|
||||
case 2: // set
|
||||
controls_allowed = 1;
|
||||
break;
|
||||
case 4: // cancel
|
||||
controls_allowed = 0;
|
||||
break;
|
||||
default:
|
||||
break; // any other button is irrelevant
|
||||
}
|
||||
}
|
||||
if (!cruise_engaged) {
|
||||
controls_allowed = 0;
|
||||
} else {
|
||||
// enter controls on rising edge of ACC, exit controls on ACC off
|
||||
if (addr == 1057) {
|
||||
// 2 bits: 13-14
|
||||
int cruise_engaged = (GET_BYTES_04(to_push) >> 13) & 0x3;
|
||||
if (cruise_engaged && !cruise_engaged_prev) {
|
||||
controls_allowed = 1;
|
||||
}
|
||||
if (!cruise_engaged) {
|
||||
controls_allowed = 0;
|
||||
}
|
||||
cruise_engaged_prev = cruise_engaged;
|
||||
}
|
||||
cruise_engaged_prev = cruise_engaged;
|
||||
}
|
||||
|
||||
// read gas pressed signal
|
||||
@@ -167,7 +211,14 @@ static int hyundai_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
|
||||
brake_pressed = (GET_BYTE(to_push, 6) >> 7) != 0;
|
||||
}
|
||||
|
||||
generic_rx_checks((addr == 832));
|
||||
bool stock_ecu_detected = (addr == 832);
|
||||
|
||||
// If openpilot is controlling longitudinal we need to ensure the radar is turned off
|
||||
// Enforce by checking we don't see SCC12
|
||||
if (hyundai_longitudinal && (addr == 1057)) {
|
||||
stock_ecu_detected = true;
|
||||
}
|
||||
generic_rx_checks(stock_ecu_detected);
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
@@ -177,14 +228,53 @@ static int hyundai_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
|
||||
int tx = 1;
|
||||
int addr = GET_ADDR(to_send);
|
||||
|
||||
if (!msg_allowed(to_send, HYUNDAI_TX_MSGS, sizeof(HYUNDAI_TX_MSGS)/sizeof(HYUNDAI_TX_MSGS[0]))) {
|
||||
tx = 0;
|
||||
if (hyundai_longitudinal) {
|
||||
tx = msg_allowed(to_send, HYUNDAI_LONG_TX_MSGS, sizeof(HYUNDAI_LONG_TX_MSGS)/sizeof(HYUNDAI_LONG_TX_MSGS[0]));
|
||||
} else {
|
||||
tx = msg_allowed(to_send, HYUNDAI_TX_MSGS, sizeof(HYUNDAI_TX_MSGS)/sizeof(HYUNDAI_TX_MSGS[0]));
|
||||
}
|
||||
|
||||
if (relay_malfunction) {
|
||||
tx = 0;
|
||||
}
|
||||
|
||||
// FCA11: Block any potential actuation
|
||||
if (addr == 909) {
|
||||
int CR_VSM_DecCmd = GET_BYTE(to_send, 1);
|
||||
int FCA_CmdAct = (GET_BYTE(to_send, 2) >> 5) & 1;
|
||||
int CF_VSM_DecCmdAct = (GET_BYTE(to_send, 3) >> 7) & 1;
|
||||
|
||||
if ((CR_VSM_DecCmd != 0) || (FCA_CmdAct != 0) || (CF_VSM_DecCmdAct != 0)) {
|
||||
tx = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// ACCEL: safety check
|
||||
if (addr == 1057) {
|
||||
int desired_accel_raw = (((GET_BYTE(to_send, 4) & 0x7) << 8) | GET_BYTE(to_send, 3)) - 1023;
|
||||
int desired_accel_val = ((GET_BYTE(to_send, 5) << 3) | (GET_BYTE(to_send, 4) >> 5)) - 1023;
|
||||
|
||||
int aeb_decel_cmd = GET_BYTE(to_send, 2);
|
||||
int aeb_req = (GET_BYTE(to_send, 6) >> 6) & 1;
|
||||
|
||||
bool violation = 0;
|
||||
|
||||
if (!controls_allowed) {
|
||||
if ((desired_accel_raw != 0) || (desired_accel_val != 0)) {
|
||||
violation = 1;
|
||||
}
|
||||
}
|
||||
violation |= max_limit_check(desired_accel_raw, HYUNDAI_MAX_ACCEL, HYUNDAI_MIN_ACCEL);
|
||||
violation |= max_limit_check(desired_accel_val, HYUNDAI_MAX_ACCEL, HYUNDAI_MIN_ACCEL);
|
||||
|
||||
violation |= (aeb_decel_cmd != 0);
|
||||
violation |= (aeb_req != 0);
|
||||
|
||||
if (violation) {
|
||||
tx = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// LKA STEER: safety check
|
||||
if (addr == 832) {
|
||||
int desired_torque = ((GET_BYTES_04(to_send) >> 16) & 0x7ff) - 1024;
|
||||
@@ -232,6 +322,13 @@ static int hyundai_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) {
|
||||
}
|
||||
}
|
||||
|
||||
// UDS: Only tester present ("\x02\x3E\x80\x00\x00\x00\x00\x00") allowed on diagnostics address
|
||||
if (addr == 2000) {
|
||||
if ((GET_BYTES_04(to_send) != 0x00803E02) || (GET_BYTES_48(to_send) != 0x0)) {
|
||||
tx = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// FORCE CANCEL: safety check only relevant when spamming the cancel button.
|
||||
// ensuring that only the cancel button press is sent (VAL 4) when controls are off.
|
||||
// This avoids unintended engagements while still allowing resume spam
|
||||
@@ -268,7 +365,16 @@ static const addr_checks* hyundai_init(int16_t param) {
|
||||
hyundai_legacy = false;
|
||||
hyundai_ev_gas_signal = GET_FLAG(param, HYUNDAI_PARAM_EV_GAS);
|
||||
hyundai_hybrid_gas_signal = !hyundai_ev_gas_signal && GET_FLAG(param, HYUNDAI_PARAM_HYBRID_GAS);
|
||||
hyundai_rx_checks = (addr_checks){hyundai_addr_checks, HYUNDAI_ADDR_CHECK_LEN};
|
||||
|
||||
#ifdef ALLOW_DEBUG
|
||||
hyundai_longitudinal = GET_FLAG(param, HYUNDAI_PARAM_LONGITUDINAL);
|
||||
#endif
|
||||
|
||||
if (hyundai_longitudinal) {
|
||||
hyundai_rx_checks = (addr_checks){hyundai_long_addr_checks, HYUNDAI_LONG_ADDR_CHECK_LEN};
|
||||
} else {
|
||||
hyundai_rx_checks = (addr_checks){hyundai_addr_checks, HYUNDAI_ADDR_CHECK_LEN};
|
||||
}
|
||||
return &hyundai_rx_checks;
|
||||
}
|
||||
|
||||
@@ -277,6 +383,7 @@ static const addr_checks* hyundai_legacy_init(int16_t param) {
|
||||
relay_malfunction_reset();
|
||||
|
||||
hyundai_legacy = true;
|
||||
hyundai_longitudinal = false;
|
||||
hyundai_ev_gas_signal = GET_FLAG(param, HYUNDAI_PARAM_EV_GAS);
|
||||
hyundai_hybrid_gas_signal = !hyundai_ev_gas_signal && GET_FLAG(param, HYUNDAI_PARAM_HYBRID_GAS);
|
||||
hyundai_rx_checks = (addr_checks){hyundai_legacy_addr_checks, HYUNDAI_LEGACY_ADDR_CHECK_LEN};
|
||||
|
||||
@@ -18,8 +18,8 @@ const CanMsg SUBARU_TX_MSGS[] = {{0x122, 0, 8}, {0x221, 0, 8}, {0x322, 0, 8}};
|
||||
AddrCheckStruct subaru_addr_checks[] = {
|
||||
{.msg = {{ 0x40, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
|
||||
{.msg = {{0x119, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
|
||||
{.msg = {{0x139, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
|
||||
{.msg = {{0x13a, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
|
||||
{.msg = {{0x13c, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
|
||||
{.msg = {{0x240, 0, 8, .check_checksum = true, .max_counter = 15U, .expected_timestep = 50000U}, { 0 }, { 0 }}},
|
||||
};
|
||||
#define SUBARU_ADDR_CHECK_LEN (sizeof(subaru_addr_checks) / sizeof(subaru_addr_checks[0]))
|
||||
@@ -89,8 +89,8 @@ static int subaru_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
|
||||
vehicle_moving = subaru_speed > SUBARU_STANDSTILL_THRSLD;
|
||||
}
|
||||
|
||||
if (addr == 0x139) {
|
||||
brake_pressed = (GET_BYTES_48(to_push) & 0xFFF0) > 0;
|
||||
if (addr == 0x13c) {
|
||||
brake_pressed = ((GET_BYTE(to_push, 7) >> 6) & 1);
|
||||
}
|
||||
|
||||
if (addr == 0x40) {
|
||||
|
||||
@@ -37,7 +37,7 @@ addr_checks volkswagen_mqb_rx_checks = {volkswagen_mqb_addr_checks, VOLKSWAGEN_M
|
||||
#define MSG_MOTOR_2 0x288 // RX from ECU, for CC state and brake switch state
|
||||
#define MSG_MOTOR_3 0x380 // RX from ECU, for driver throttle input
|
||||
#define MSG_GRA_NEU 0x38A // TX by OP, ACC control buttons for cancel/resume
|
||||
#define MSG_BREMSE_3 0x4A0 // RX from ABS, for wheel speeds
|
||||
#define MSG_BREMSE_1 0x1A0 // RX from ABS, for ego speed
|
||||
#define MSG_LDW_1 0x5BE // TX by OP, Lane line recognition and text alerts
|
||||
|
||||
// Transmit of GRA_Neu is allowed on bus 0 and 2 to keep compatibility with gateway and camera integration
|
||||
@@ -48,7 +48,7 @@ AddrCheckStruct volkswagen_pq_addr_checks[] = {
|
||||
{.msg = {{MSG_LENKHILFE_3, 0, 6, .check_checksum = true, .max_counter = 15U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
|
||||
{.msg = {{MSG_MOTOR_2, 0, 8, .check_checksum = false, .max_counter = 0U, .expected_timestep = 20000U}, { 0 }, { 0 }}},
|
||||
{.msg = {{MSG_MOTOR_3, 0, 8, .check_checksum = false, .max_counter = 0U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
|
||||
{.msg = {{MSG_BREMSE_3, 0, 8, .check_checksum = false, .max_counter = 0U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
|
||||
{.msg = {{MSG_BREMSE_1, 0, 8, .check_checksum = false, .max_counter = 0U, .expected_timestep = 10000U}, { 0 }, { 0 }}},
|
||||
};
|
||||
#define VOLKSWAGEN_PQ_ADDR_CHECKS_LEN (sizeof(volkswagen_pq_addr_checks) / sizeof(volkswagen_pq_addr_checks[0]))
|
||||
addr_checks volkswagen_pq_rx_checks = {volkswagen_pq_addr_checks, VOLKSWAGEN_PQ_ADDR_CHECKS_LEN};
|
||||
@@ -208,15 +208,12 @@ static int volkswagen_pq_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) {
|
||||
if (valid && (GET_BUS(to_push) == 0)) {
|
||||
int addr = GET_ADDR(to_push);
|
||||
|
||||
// Update in-motion state by sampling front wheel speeds
|
||||
// Signal: Bremse_3.Radgeschw__VL_4_1 (front left)
|
||||
// Signal: Bremse_3.Radgeschw__VR_4_1 (front right)
|
||||
if (addr == MSG_BREMSE_3) {
|
||||
int wheel_speed_fl = (GET_BYTE(to_push, 0) | (GET_BYTE(to_push, 1) << 8)) >> 1;
|
||||
int wheel_speed_fr = (GET_BYTE(to_push, 2) | (GET_BYTE(to_push, 3) << 8)) >> 1;
|
||||
// Check for average front speed in excess of 0.3m/s, 1.08km/h
|
||||
// DBC speed scale 0.01: 0.3m/s = 108, sum both wheels to compare
|
||||
vehicle_moving = (wheel_speed_fl + wheel_speed_fr) > 216;
|
||||
// Update in-motion state from speed value.
|
||||
// Signal: Bremse_1.Geschwindigkeit_neu__Bremse_1_
|
||||
if (addr == MSG_BREMSE_1) {
|
||||
int speed = ((GET_BYTE(to_push, 2) & 0xFE) >> 1) | (GET_BYTE(to_push, 3) << 7);
|
||||
// DBC speed scale 0.01: 0.3m/s = 108.
|
||||
vehicle_moving = speed > 108;
|
||||
}
|
||||
|
||||
// Update driver input torque samples
|
||||
|
||||
@@ -6,7 +6,7 @@ from panda.python.uds import UdsClient, MessageTimeoutError, NegativeResponseErr
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--rxoffset', default="0x8")
|
||||
parser.add_argument('--rxoffset', default="")
|
||||
parser.add_argument('--nonstandard', action='store_true')
|
||||
parser.add_argument('--debug', action='store_true')
|
||||
parser.add_argument('--addr')
|
||||
@@ -32,7 +32,6 @@ if __name__ == "__main__":
|
||||
|
||||
panda = Panda()
|
||||
panda.set_safety_mode(Panda.SAFETY_ELM327)
|
||||
panda.set_power_save(0)
|
||||
print("querying addresses ...")
|
||||
with tqdm(addrs) as t:
|
||||
for addr in t:
|
||||
@@ -40,8 +39,11 @@ if __name__ == "__main__":
|
||||
if addr == 0x7df or addr == 0x18db33f1:
|
||||
continue
|
||||
t.set_description(hex(addr))
|
||||
panda.send_heartbeat()
|
||||
|
||||
uds_client = UdsClient(panda, addr, addr + int(args.rxoffset, base=16), bus=1 if panda.has_obd() else 0, timeout=0.2, debug=args.debug)
|
||||
bus = 1 if panda.has_obd() else 0
|
||||
rx_addr = addr + int(args.rxoffset, base=16) if args.rxoffset else None
|
||||
uds_client = UdsClient(panda, addr, rx_addr, bus, timeout=0.2, debug=args.debug)
|
||||
# Check for anything alive at this address, and switch to the highest
|
||||
# available diagnostic session without security access
|
||||
try:
|
||||
|
||||
@@ -150,6 +150,7 @@ class Panda(object):
|
||||
|
||||
FLAG_HONDA_ALT_BRAKE = 1
|
||||
FLAG_HONDA_BOSCH_LONG = 2
|
||||
FLAG_HYUNDAI_LONG = 4
|
||||
|
||||
def __init__(self, serial=None, claim=True):
|
||||
self._serial = serial
|
||||
@@ -452,10 +453,11 @@ class Panda(object):
|
||||
self._handle.controlWrite(Panda.REQUEST_OUT, 0xda, int(bootmode), 0, b'')
|
||||
time.sleep(0.2)
|
||||
|
||||
def set_safety_mode(self, mode=SAFETY_SILENT, disable_heartbeat=True):
|
||||
def set_safety_mode(self, mode=SAFETY_SILENT, disable_checks=True):
|
||||
self._handle.controlWrite(Panda.REQUEST_OUT, 0xdc, mode, 0, b'')
|
||||
if disable_heartbeat:
|
||||
if disable_checks:
|
||||
self.set_heartbeat_disabled()
|
||||
self.set_power_save(0)
|
||||
|
||||
def set_can_forwarding(self, from_bus, to_bus):
|
||||
# TODO: This feature may not work correctly with saturated buses
|
||||
|
||||
@@ -34,7 +34,7 @@ def flash_release(path=None, st_serial=None):
|
||||
zf = ZipFile(path)
|
||||
zf.printdir()
|
||||
|
||||
version = zf.read("version").decode()
|
||||
version = zf.read("version").decode().strip()
|
||||
status("0. Preparing to flash " + str(version))
|
||||
|
||||
code_bootstub = zf.read("bootstub.panda.bin")
|
||||
|
||||
+31
-19
@@ -4,6 +4,7 @@ import struct
|
||||
from collections import deque
|
||||
from typing import Callable, NamedTuple, Tuple, List, Deque, Generator, Optional, cast
|
||||
from enum import IntEnum
|
||||
from functools import partial
|
||||
|
||||
class SERVICE_TYPE(IntEnum):
|
||||
DIAGNOSTIC_SESSION_CONTROL = 0x10
|
||||
@@ -376,39 +377,43 @@ class IsoTpMessage():
|
||||
self.rx_done = False
|
||||
|
||||
if self.debug:
|
||||
print(f"ISO-TP: REQUEST - 0x{bytes.hex(self.tx_dat)}")
|
||||
print(f"ISO-TP: REQUEST - {hex(self._can_client.tx_addr)} 0x{bytes.hex(self.tx_dat)}")
|
||||
self._tx_first_frame()
|
||||
|
||||
def _tx_first_frame(self) -> None:
|
||||
if self.tx_len < self.max_len:
|
||||
# single frame (send all bytes)
|
||||
if self.debug:
|
||||
print("ISO-TP: TX - single frame")
|
||||
print(f"ISO-TP: TX - single frame - {hex(self._can_client.tx_addr)}")
|
||||
msg = (bytes([self.tx_len]) + self.tx_dat).ljust(self.max_len, b"\x00")
|
||||
self.tx_done = True
|
||||
else:
|
||||
# first frame (send first 6 bytes)
|
||||
if self.debug:
|
||||
print("ISO-TP: TX - first frame")
|
||||
print(f"ISO-TP: TX - first frame - {hex(self._can_client.tx_addr)}")
|
||||
msg = (struct.pack("!H", 0x1000 | self.tx_len) + self.tx_dat[:self.max_len - 2]).ljust(self.max_len - 2, b"\x00")
|
||||
self._can_client.send([msg])
|
||||
|
||||
def recv(self) -> Optional[bytes]:
|
||||
start_time = time.time()
|
||||
def recv(self, timeout=None) -> Optional[bytes]:
|
||||
if timeout is None:
|
||||
timeout = self.timeout
|
||||
|
||||
start_time = time.monotonic()
|
||||
try:
|
||||
while True:
|
||||
for msg in self._can_client.recv():
|
||||
self._isotp_rx_next(msg)
|
||||
start_time = time.monotonic()
|
||||
if self.tx_done and self.rx_done:
|
||||
return self.rx_dat
|
||||
# no timeout indicates non-blocking
|
||||
if self.timeout == 0:
|
||||
if timeout == 0:
|
||||
return None
|
||||
if time.time() - start_time > self.timeout:
|
||||
if time.monotonic() - start_time > timeout:
|
||||
raise MessageTimeoutError("timeout waiting for response")
|
||||
finally:
|
||||
if self.debug and self.rx_dat:
|
||||
print(f"ISO-TP: RESPONSE - 0x{bytes.hex(self.rx_dat)}")
|
||||
print(f"ISO-TP: RESPONSE - {hex(self._can_client.rx_addr)} 0x{bytes.hex(self.rx_dat)}")
|
||||
|
||||
def _isotp_rx_next(self, rx_data: bytes) -> None:
|
||||
# single rx_frame
|
||||
@@ -418,7 +423,7 @@ class IsoTpMessage():
|
||||
self.rx_idx = 0
|
||||
self.rx_done = True
|
||||
if self.debug:
|
||||
print(f"ISO-TP: RX - single frame - idx={self.rx_idx} done={self.rx_done}")
|
||||
print(f"ISO-TP: RX - single frame - {hex(self._can_client.rx_addr)} idx={self.rx_idx} done={self.rx_done}")
|
||||
return
|
||||
|
||||
# first rx_frame
|
||||
@@ -428,9 +433,9 @@ class IsoTpMessage():
|
||||
self.rx_idx = 0
|
||||
self.rx_done = False
|
||||
if self.debug:
|
||||
print(f"ISO-TP: RX - first frame - idx={self.rx_idx} done={self.rx_done}")
|
||||
print(f"ISO-TP: RX - first frame - {hex(self._can_client.rx_addr)} idx={self.rx_idx} done={self.rx_done}")
|
||||
if self.debug:
|
||||
print("ISO-TP: TX - flow control continue")
|
||||
print(f"ISO-TP: TX - flow control continue - {hex(self._can_client.tx_addr)}")
|
||||
# send flow control message (send all bytes)
|
||||
msg = b"\x30\x00\x00".ljust(self.max_len, b"\x00")
|
||||
self._can_client.send([msg])
|
||||
@@ -446,7 +451,7 @@ class IsoTpMessage():
|
||||
if self.rx_len == len(self.rx_dat):
|
||||
self.rx_done = True
|
||||
if self.debug:
|
||||
print(f"ISO-TP: RX - consecutive frame - idx={self.rx_idx} done={self.rx_done}")
|
||||
print(f"ISO-TP: RX - consecutive frame - {hex(self._can_client.rx_addr)} idx={self.rx_idx} done={self.rx_done}")
|
||||
return
|
||||
|
||||
# flow control
|
||||
@@ -456,7 +461,7 @@ class IsoTpMessage():
|
||||
assert rx_data[0] == 0x30 or rx_data[0] == 0x31, "isotp - rx: flow-control transfer state indicator invalid"
|
||||
if rx_data[0] == 0x30:
|
||||
if self.debug:
|
||||
print("ISO-TP: RX - flow control continue")
|
||||
print(f"ISO-TP: RX - flow control continue - {hex(self._can_client.tx_addr)}")
|
||||
delay_ts = rx_data[2] & 0x7F
|
||||
# scale is 1 milliseconds if first bit == 0, 100 micro seconds if first bit == 1
|
||||
delay_div = 1000. if rx_data[2] & 0x80 == 0 else 10000.
|
||||
@@ -478,11 +483,11 @@ class IsoTpMessage():
|
||||
if end >= self.tx_len:
|
||||
self.tx_done = True
|
||||
if self.debug:
|
||||
print(f"ISO-TP: TX - consecutive frame - idx={self.tx_idx} done={self.tx_done}")
|
||||
print(f"ISO-TP: TX - consecutive frame - {hex(self._can_client.tx_addr)} idx={self.tx_idx} done={self.tx_done}")
|
||||
elif rx_data[0] == 0x31:
|
||||
# wait (do nothing until next flow control message)
|
||||
if self.debug:
|
||||
print("ISO-TP: TX - flow control wait")
|
||||
print(f"ISO-TP: TX - flow control wait - {hex(self._can_client.tx_addr)}")
|
||||
|
||||
FUNCTIONAL_ADDRS = [0x7DF, 0x18DB33F1]
|
||||
|
||||
@@ -503,13 +508,16 @@ def get_rx_addr_for_tx_addr(tx_addr, rx_offset=0x8):
|
||||
|
||||
|
||||
class UdsClient():
|
||||
def __init__(self, panda, tx_addr: int, rx_addr: int = None, bus: int = 0, timeout: float = 1, debug: bool = False):
|
||||
def __init__(self, panda, tx_addr: int, rx_addr: int = None, bus: int = 0, timeout: float = 1, debug: bool = False,
|
||||
tx_timeout: float = 1, response_pending_timeout: float = 10):
|
||||
self.bus = bus
|
||||
self.tx_addr = tx_addr
|
||||
self.rx_addr = rx_addr if rx_addr is not None else get_rx_addr_for_tx_addr(tx_addr)
|
||||
self.timeout = timeout
|
||||
self.debug = debug
|
||||
self._can_client = CanClient(panda.can_send, panda.can_recv, self.tx_addr, self.rx_addr, self.bus, debug=self.debug)
|
||||
can_send_with_timeout = partial(panda.can_send, timeout=int(tx_timeout*1000))
|
||||
self._can_client = CanClient(can_send_with_timeout, panda.can_recv, self.tx_addr, self.rx_addr, self.bus, debug=self.debug)
|
||||
self.response_pending_timeout = response_pending_timeout
|
||||
|
||||
# generic uds request
|
||||
def _uds_request(self, service_type: SERVICE_TYPE, subfunction: int = None, data: bytes = None) -> bytes:
|
||||
@@ -522,12 +530,15 @@ class UdsClient():
|
||||
# send request, wait for response
|
||||
isotp_msg = IsoTpMessage(self._can_client, self.timeout, self.debug)
|
||||
isotp_msg.send(req)
|
||||
response_pending = False
|
||||
while True:
|
||||
resp = isotp_msg.recv()
|
||||
timeout = self.response_pending_timeout if response_pending else self.timeout
|
||||
resp = isotp_msg.recv(timeout)
|
||||
|
||||
if resp is None:
|
||||
continue
|
||||
|
||||
response_pending = False
|
||||
resp_sid = resp[0] if len(resp) > 0 else None
|
||||
|
||||
# negative response
|
||||
@@ -544,6 +555,7 @@ class UdsClient():
|
||||
error_desc = resp[3:].hex()
|
||||
# wait for another message if response pending
|
||||
if error_code == 0x78:
|
||||
response_pending = True
|
||||
if self.debug:
|
||||
print("UDS-RX: response pending")
|
||||
continue
|
||||
@@ -654,7 +666,7 @@ class UdsClient():
|
||||
resp = self._uds_request(SERVICE_TYPE.READ_DATA_BY_IDENTIFIER, subfunction=None, data=data)
|
||||
resp_id = struct.unpack('!H', resp[0:2])[0] if len(resp) >= 2 else None
|
||||
if resp_id != data_identifier_type:
|
||||
raise ValueError('invalid response data identifier: {}'.format(hex(resp_id)))
|
||||
raise ValueError('invalid response data identifier: {} expected: {}'.format(hex(resp_id), hex(data_identifier_type)))
|
||||
return resp[2:]
|
||||
|
||||
def read_memory_by_address(self, memory_address: int, memory_size: int, memory_address_bytes: int = 4, memory_size_bytes: int = 1):
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file EXAMPLES/example1.cpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Very simple example for testing qpOASES (using QProblem class).
|
||||
*/
|
||||
|
||||
|
||||
#include <QProblem.hpp>
|
||||
|
||||
|
||||
/** Example for qpOASES main function using the QProblem class. */
|
||||
int main( )
|
||||
{
|
||||
/* Setup data of first QP. */
|
||||
real_t H[2*2] = { 1.0, 0.0, 0.0, 0.5 };
|
||||
real_t A[1*2] = { 1.0, 1.0 };
|
||||
real_t g[2] = { 1.5, 1.0 };
|
||||
real_t lb[2] = { 0.5, -2.0 };
|
||||
real_t ub[2] = { 5.0, 2.0 };
|
||||
real_t lbA[1] = { -1.0 };
|
||||
real_t ubA[1] = { 2.0 };
|
||||
|
||||
/* Setup data of second QP. */
|
||||
real_t g_new[2] = { 1.0, 1.5 };
|
||||
real_t lb_new[2] = { 0.0, -1.0 };
|
||||
real_t ub_new[2] = { 5.0, -0.5 };
|
||||
real_t lbA_new[1] = { -2.0 };
|
||||
real_t ubA_new[1] = { 1.0 };
|
||||
|
||||
|
||||
/* Setting up QProblem object. */
|
||||
QProblem example( 2,1 );
|
||||
|
||||
/* Solve first QP. */
|
||||
int nWSR = 10;
|
||||
example.init( H,g,A,lb,ub,lbA,ubA, nWSR,0 );
|
||||
|
||||
/* Solve second QP. */
|
||||
nWSR = 10;
|
||||
example.hotstart( g_new,lb_new,ub_new,lbA_new,ubA_new, nWSR,0 );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file EXAMPLES/example1b.cpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Very simple example for testing qpOASES using the QProblemB class.
|
||||
*/
|
||||
|
||||
|
||||
#include <QProblemB.hpp>
|
||||
|
||||
|
||||
/** Example for qpOASES main function using the QProblemB class. */
|
||||
int main( )
|
||||
{
|
||||
/* Setup data of first QP. */
|
||||
real_t H[2*2] = { 1.0, 0.0, 0.0, 0.5 };
|
||||
real_t g[2] = { 1.5, 1.0 };
|
||||
real_t lb[2] = { 0.5, -2.0 };
|
||||
real_t ub[2] = { 5.0, 2.0 };
|
||||
|
||||
/* Setup data of second QP. */
|
||||
real_t g_new[2] = { 1.0, 1.5 };
|
||||
real_t lb_new[2] = { 0.0, -1.0 };
|
||||
real_t ub_new[2] = { 5.0, -0.5 };
|
||||
|
||||
|
||||
/* Setting up QProblemB object. */
|
||||
QProblemB example( 2 );
|
||||
|
||||
/* Solve first QP. */
|
||||
int nWSR = 10;
|
||||
example.init( H,g,lb,ub, nWSR,0 );
|
||||
|
||||
/* Solve second QP. */
|
||||
nWSR = 10;
|
||||
example.hotstart( g_new,lb_new,ub_new, nWSR,0 );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,189 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file INCLUDE/Bounds.hpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Declaration of the Bounds class designed to manage working sets of
|
||||
* bounds within a QProblem.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef QPOASES_BOUNDS_HPP
|
||||
#define QPOASES_BOUNDS_HPP
|
||||
|
||||
|
||||
#include <SubjectTo.hpp>
|
||||
|
||||
|
||||
|
||||
/** This class manages working sets of bounds by storing
|
||||
* index sets and other status information.
|
||||
*
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*/
|
||||
class Bounds : public SubjectTo
|
||||
{
|
||||
/*
|
||||
* PUBLIC MEMBER FUNCTIONS
|
||||
*/
|
||||
public:
|
||||
/** Default constructor. */
|
||||
Bounds( );
|
||||
|
||||
/** Copy constructor (deep copy). */
|
||||
Bounds( const Bounds& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
/** Destructor. */
|
||||
~Bounds( );
|
||||
|
||||
/** Assignment operator (deep copy). */
|
||||
Bounds& operator=( const Bounds& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
|
||||
/** Pseudo-constructor takes the number of bounds.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue init( int n /**< Number of bounds. */
|
||||
);
|
||||
|
||||
|
||||
/** Initially adds number of a new (i.e. not yet in the list) bound to
|
||||
* given index set.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_SETUP_BOUND_FAILED \n
|
||||
RET_INDEX_OUT_OF_BOUNDS \n
|
||||
RET_INVALID_ARGUMENTS */
|
||||
returnValue setupBound( int _number, /**< Number of new bound. */
|
||||
SubjectToStatus _status /**< Status of new bound. */
|
||||
);
|
||||
|
||||
/** Initially adds all numbers of new (i.e. not yet in the list) bounds to
|
||||
* to the index set of free bounds; the order depends on the SujectToType
|
||||
* of each index.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_SETUP_BOUND_FAILED */
|
||||
returnValue setupAllFree( );
|
||||
|
||||
|
||||
/** Moves index of a bound from index list of fixed to that of free bounds.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_MOVING_BOUND_FAILED \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
returnValue moveFixedToFree( int _number /**< Number of bound to be freed. */
|
||||
);
|
||||
|
||||
/** Moves index of a bound from index list of free to that of fixed bounds.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_MOVING_BOUND_FAILED \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
returnValue moveFreeToFixed( int _number, /**< Number of bound to be fixed. */
|
||||
SubjectToStatus _status /**< Status of bound to be fixed. */
|
||||
);
|
||||
|
||||
/** Swaps the indices of two free bounds within the index set.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_SWAPINDEX_FAILED */
|
||||
returnValue swapFree( int number1, /**< Number of first constraint or bound. */
|
||||
int number2 /**< Number of second constraint or bound. */
|
||||
);
|
||||
|
||||
|
||||
/** Returns number of variables.
|
||||
* \return Number of variables. */
|
||||
inline int getNV( ) const;
|
||||
|
||||
/** Returns number of implicitly fixed variables.
|
||||
* \return Number of implicitly fixed variables. */
|
||||
inline int getNFV( ) const;
|
||||
|
||||
/** Returns number of bounded (but possibly free) variables.
|
||||
* \return Number of bounded (but possibly free) variables. */
|
||||
inline int getNBV( ) const;
|
||||
|
||||
/** Returns number of unbounded variables.
|
||||
* \return Number of unbounded variables. */
|
||||
inline int getNUV( ) const;
|
||||
|
||||
|
||||
/** Sets number of implicitly fixed variables.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setNFV( int n /**< Number of implicitly fixed variables. */
|
||||
);
|
||||
|
||||
/** Sets number of bounded (but possibly free) variables.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setNBV( int n /**< Number of bounded (but possibly free) variables. */
|
||||
);
|
||||
|
||||
/** Sets number of unbounded variables.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setNUV( int n /**< Number of unbounded variables */
|
||||
);
|
||||
|
||||
|
||||
/** Returns number of free variables.
|
||||
* \return Number of free variables. */
|
||||
inline int getNFR( );
|
||||
|
||||
/** Returns number of fixed variables.
|
||||
* \return Number of fixed variables. */
|
||||
inline int getNFX( );
|
||||
|
||||
|
||||
/** Returns a pointer to free variables index list.
|
||||
* \return Pointer to free variables index list. */
|
||||
inline Indexlist* getFree( );
|
||||
|
||||
/** Returns a pointer to fixed variables index list.
|
||||
* \return Pointer to fixed variables index list. */
|
||||
inline Indexlist* getFixed( );
|
||||
|
||||
|
||||
/*
|
||||
* PROTECTED MEMBER VARIABLES
|
||||
*/
|
||||
protected:
|
||||
int nV; /**< Number of variables (nV = nFV + nBV + nUV). */
|
||||
int nFV; /**< Number of implicitly fixed variables. */
|
||||
int nBV; /**< Number of bounded (but possibly free) variables. */
|
||||
int nUV; /**< Number of unbounded variables. */
|
||||
|
||||
Indexlist free; /**< Index list of free variables. */
|
||||
Indexlist fixed; /**< Index list of fixed variables. */
|
||||
};
|
||||
|
||||
#include <Bounds.ipp>
|
||||
|
||||
#endif /* QPOASES_BOUNDS_HPP */
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file INCLUDE/Constants.hpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2008
|
||||
*
|
||||
* Definition of all global constants.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef QPOASES_CONSTANTS_HPP
|
||||
#define QPOASES_CONSTANTS_HPP
|
||||
|
||||
#ifndef QPOASES_CUSTOM_INTERFACE
|
||||
#include "acado_qpoases_interface.hpp"
|
||||
#else
|
||||
#define XSTR(x) #x
|
||||
#define STR(x) XSTR(x)
|
||||
#include STR(QPOASES_CUSTOM_INTERFACE)
|
||||
#endif
|
||||
|
||||
/** Maximum number of variables within a QP formulation.
|
||||
Note: this value has to be positive! */
|
||||
const int NVMAX = QPOASES_NVMAX;
|
||||
|
||||
/** Maximum number of constraints within a QP formulation.
|
||||
Note: this value has to be positive! */
|
||||
const int NCMAX = QPOASES_NCMAX;
|
||||
|
||||
/** Redefinition of NCMAX used for memory allocation, to avoid zero sized arrays
|
||||
and compiler errors. */
|
||||
const int NCMAX_ALLOC = (NCMAX == 0) ? 1 : NCMAX;
|
||||
|
||||
/**< Maximum number of working set recalculations.
|
||||
Note: this value has to be positive! */
|
||||
const int NWSRMAX = QPOASES_NWSRMAX;
|
||||
|
||||
/** Desired KKT tolerance of QP solution; a warning RET_INACCURATE_SOLUTION is
|
||||
* issued if this tolerance is not met.
|
||||
* Note: this value has to be positive! */
|
||||
const real_t DESIREDACCURACY = (real_t) 1.0e-3;
|
||||
|
||||
/** Critical KKT tolerance of QP solution; an error is issued if this
|
||||
* tolerance is not met.
|
||||
* Note: this value has to be positive! */
|
||||
const real_t CRITICALACCURACY = (real_t) 1.0e-2;
|
||||
|
||||
|
||||
|
||||
/** Numerical value of machine precision (min eps, s.t. 1+eps > 1).
|
||||
Note: this value has to be positive! */
|
||||
const real_t EPS = (real_t) QPOASES_EPS;
|
||||
|
||||
/** Numerical value of zero (for situations in which it would be
|
||||
* unreasonable to compare with 0.0).
|
||||
* Note: this value has to be positive! */
|
||||
const real_t ZERO = (real_t) 1.0e-50;
|
||||
|
||||
/** Numerical value of infinity (e.g. for non-existing bounds).
|
||||
* Note: this value has to be positive! */
|
||||
const real_t INFTY = (real_t) 1.0e12;
|
||||
|
||||
|
||||
/** Lower/upper (constraints') bound tolerance (an inequality constraint
|
||||
* whose lower and upper bound differ by less than BOUNDTOL is regarded
|
||||
* to be an equality constraint).
|
||||
* Note: this value has to be positive! */
|
||||
const real_t BOUNDTOL = (real_t) 1.0e-10;
|
||||
|
||||
/** Offset for relaxing (constraints') bounds at beginning of an initial homotopy.
|
||||
* Note: this value has to be positive! */
|
||||
const real_t BOUNDRELAXATION = (real_t) 1.0e3;
|
||||
|
||||
|
||||
/** Factor that determines physical lengths of index lists.
|
||||
* Note: this value has to be greater than 1! */
|
||||
const int INDEXLISTFACTOR = 5;
|
||||
|
||||
|
||||
#endif /* QPOASES_CONSTANTS_HPP */
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,181 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file INCLUDE/Constraints.hpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Declaration of the Constraints class designed to manage working sets of
|
||||
* constraints within a QProblem.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef QPOASES_CONSTRAINTS_HPP
|
||||
#define QPOASES_CONSTRAINTS_HPP
|
||||
|
||||
|
||||
#include <SubjectTo.hpp>
|
||||
|
||||
|
||||
|
||||
/** This class manages working sets of constraints by storing
|
||||
* index sets and other status information.
|
||||
*
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*/
|
||||
class Constraints : public SubjectTo
|
||||
{
|
||||
/*
|
||||
* PUBLIC MEMBER FUNCTIONS
|
||||
*/
|
||||
public:
|
||||
/** Default constructor. */
|
||||
Constraints( );
|
||||
|
||||
/** Copy constructor (deep copy). */
|
||||
Constraints( const Constraints& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
/** Destructor. */
|
||||
~Constraints( );
|
||||
|
||||
/** Assignment operator (deep copy). */
|
||||
Constraints& operator=( const Constraints& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
|
||||
/** Pseudo-constructor takes the number of constraints.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue init( int n /**< Number of constraints. */
|
||||
);
|
||||
|
||||
|
||||
/** Initially adds number of a new (i.e. not yet in the list) constraint to
|
||||
* a given index set.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_SETUP_CONSTRAINT_FAILED \n
|
||||
RET_INDEX_OUT_OF_BOUNDS \n
|
||||
RET_INVALID_ARGUMENTS */
|
||||
returnValue setupConstraint( int _number, /**< Number of new constraint. */
|
||||
SubjectToStatus _status /**< Status of new constraint. */
|
||||
);
|
||||
|
||||
/** Initially adds all enabled numbers of new (i.e. not yet in the list) constraints to
|
||||
* to the index set of inactive constraints; the order depends on the SujectToType
|
||||
* of each index. Only disabled constraints are added to index set of disabled constraints!
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_SETUP_CONSTRAINT_FAILED */
|
||||
returnValue setupAllInactive( );
|
||||
|
||||
|
||||
/** Moves index of a constraint from index list of active to that of inactive constraints.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_MOVING_CONSTRAINT_FAILED */
|
||||
returnValue moveActiveToInactive( int _number /**< Number of constraint to become inactive. */
|
||||
);
|
||||
|
||||
/** Moves index of a constraint from index list of inactive to that of active constraints.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_MOVING_CONSTRAINT_FAILED */
|
||||
returnValue moveInactiveToActive( int _number, /**< Number of constraint to become active. */
|
||||
SubjectToStatus _status /**< Status of constraint to become active. */
|
||||
);
|
||||
|
||||
|
||||
/** Returns the number of constraints.
|
||||
* \return Number of constraints. */
|
||||
inline int getNC( ) const;
|
||||
|
||||
/** Returns the number of implicit equality constraints.
|
||||
* \return Number of implicit equality constraints. */
|
||||
inline int getNEC( ) const;
|
||||
|
||||
/** Returns the number of "real" inequality constraints.
|
||||
* \return Number of "real" inequality constraints. */
|
||||
inline int getNIC( ) const;
|
||||
|
||||
/** Returns the number of unbounded constraints (i.e. without any bounds).
|
||||
* \return Number of unbounded constraints (i.e. without any bounds). */
|
||||
inline int getNUC( ) const;
|
||||
|
||||
|
||||
/** Sets number of implicit equality constraints.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setNEC( int n /**< Number of implicit equality constraints. */
|
||||
);
|
||||
|
||||
/** Sets number of "real" inequality constraints.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setNIC( int n /**< Number of "real" inequality constraints. */
|
||||
);
|
||||
|
||||
/** Sets number of unbounded constraints (i.e. without any bounds).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setNUC( int n /**< Number of unbounded constraints (i.e. without any bounds). */
|
||||
);
|
||||
|
||||
|
||||
/** Returns the number of active constraints.
|
||||
* \return Number of constraints. */
|
||||
inline int getNAC( );
|
||||
|
||||
/** Returns the number of inactive constraints.
|
||||
* \return Number of constraints. */
|
||||
inline int getNIAC( );
|
||||
|
||||
|
||||
/** Returns a pointer to active constraints index list.
|
||||
* \return Pointer to active constraints index list. */
|
||||
inline Indexlist* getActive( );
|
||||
|
||||
/** Returns a pointer to inactive constraints index list.
|
||||
* \return Pointer to inactive constraints index list. */
|
||||
inline Indexlist* getInactive( );
|
||||
|
||||
|
||||
/*
|
||||
* PROTECTED MEMBER VARIABLES
|
||||
*/
|
||||
protected:
|
||||
int nC; /**< Number of constraints (nC = nEC + nIC + nUC). */
|
||||
int nEC; /**< Number of implicit equality constraints. */
|
||||
int nIC; /**< Number of "real" inequality constraints. */
|
||||
int nUC; /**< Number of unbounded constraints (i.e. without any bounds). */
|
||||
|
||||
Indexlist active; /**< Index list of active constraints. */
|
||||
Indexlist inactive; /**< Index list of inactive constraints. */
|
||||
};
|
||||
|
||||
|
||||
#include <Constraints.ipp>
|
||||
|
||||
#endif /* QPOASES_CONSTRAINTS_HPP */
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,126 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file INCLUDE/CyclingManager.hpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Declaration of the CyclingManager class designed to detect
|
||||
* and handle possible cycling during QP iterations.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef QPOASES_CYCLINGMANAGER_HPP
|
||||
#define QPOASES_CYCLINGMANAGER_HPP
|
||||
|
||||
|
||||
#include <Utils.hpp>
|
||||
|
||||
|
||||
|
||||
/** This class is intended to detect and handle possible cycling during QP iterations.
|
||||
* As cycling seems to occur quite rarely, this class is NOT FULLY IMPLEMENTED YET!
|
||||
*
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*/
|
||||
class CyclingManager
|
||||
{
|
||||
/*
|
||||
* PUBLIC MEMBER FUNCTIONS
|
||||
*/
|
||||
public:
|
||||
/** Default constructor. */
|
||||
CyclingManager( );
|
||||
|
||||
/** Copy constructor (deep copy). */
|
||||
CyclingManager( const CyclingManager& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
/** Destructor. */
|
||||
~CyclingManager( );
|
||||
|
||||
/** Copy asingment operator (deep copy). */
|
||||
CyclingManager& operator=( const CyclingManager& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
|
||||
/** Pseudo-constructor which takes the number of bounds/constraints.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue init( int _nV, /**< Number of bounds to be managed. */
|
||||
int _nC /**< Number of constraints to be managed. */
|
||||
);
|
||||
|
||||
|
||||
/** Stores index of a bound/constraint that might cause cycling.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
returnValue setCyclingStatus( int number, /**< Number of bound/constraint. */
|
||||
BooleanType isBound, /**< Flag that indicates if given number corresponds to a
|
||||
* bound (BT_TRUE) or a constraint (BT_FALSE). */
|
||||
CyclingStatus _status /**< Cycling status of bound/constraint. */
|
||||
);
|
||||
|
||||
/** Returns if bound/constraint might cause cycling.
|
||||
* \return BT_TRUE: bound/constraint might cause cycling \n
|
||||
BT_FALSE: otherwise */
|
||||
CyclingStatus getCyclingStatus( int number, /**< Number of bound/constraint. */
|
||||
BooleanType isBound /**< Flag that indicates if given number corresponds to
|
||||
* a bound (BT_TRUE) or a constraint (BT_FALSE). */
|
||||
) const;
|
||||
|
||||
|
||||
/** Clears all previous cycling information.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue clearCyclingData( );
|
||||
|
||||
|
||||
/** Returns if cycling was detected.
|
||||
* \return BT_TRUE iff cycling was detected. */
|
||||
inline BooleanType isCyclingDetected( ) const;
|
||||
|
||||
|
||||
/*
|
||||
* PROTECTED MEMBER VARIABLES
|
||||
*/
|
||||
protected:
|
||||
int nV; /**< Number of managed bounds. */
|
||||
int nC; /**< Number of managed constraints. */
|
||||
|
||||
CyclingStatus status[NVMAX+NCMAX]; /**< Array to store cycling status of all bounds/constraints. */
|
||||
|
||||
BooleanType cyclingDetected; /**< Flag if cycling was detected. */
|
||||
};
|
||||
|
||||
|
||||
#include <CyclingManager.ipp>
|
||||
|
||||
#endif /* QPOASES_CYCLINGMANAGER_HPP */
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file INCLUDE/EXTRAS/SolutionAnalysis.hpp
|
||||
* \author Milan Vukov, Boris Houska, Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2012
|
||||
*
|
||||
* Solution analysis class, based on a class in the standard version of the qpOASES
|
||||
*/
|
||||
|
||||
|
||||
//
|
||||
|
||||
#ifndef QPOASES_SOLUTIONANALYSIS_HPP
|
||||
#define QPOASES_SOLUTIONANALYSIS_HPP
|
||||
|
||||
#include <QProblem.hpp>
|
||||
|
||||
/** Enables the computation of variance as is in the standard version of qpOASES */
|
||||
#define QPOASES_USE_OLD_VERSION 0
|
||||
|
||||
#if QPOASES_USE_OLD_VERSION
|
||||
#define KKT_DIM (2 * NVMAX + NCMAX)
|
||||
#endif
|
||||
|
||||
class SolutionAnalysis
|
||||
{
|
||||
public:
|
||||
|
||||
/** Default constructor. */
|
||||
SolutionAnalysis( );
|
||||
|
||||
/** Copy constructor (deep copy). */
|
||||
SolutionAnalysis( const SolutionAnalysis& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
/** Destructor. */
|
||||
~SolutionAnalysis( );
|
||||
|
||||
/** Copy asingment operator (deep copy). */
|
||||
SolutionAnalysis& operator=( const SolutionAnalysis& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
/** A routine for computation of inverse of the Hessian matrix. */
|
||||
returnValue getHessianInverse(
|
||||
QProblem* qp, /** QP */
|
||||
real_t* hessianInverse /** Inverse of the Hessian matrix*/
|
||||
);
|
||||
|
||||
/** A routine for computation of inverse of the Hessian matrix. */
|
||||
returnValue getHessianInverse( QProblemB* qp, /** QP */
|
||||
real_t* hessianInverse /** Inverse of the Hessian matrix*/
|
||||
);
|
||||
|
||||
#if QPOASES_USE_OLD_VERSION
|
||||
returnValue getVarianceCovariance(
|
||||
QProblem* qp,
|
||||
real_t* g_b_bA_VAR,
|
||||
real_t* Primal_Dual_VAR
|
||||
);
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
real_t delta_g_cov[ NVMAX ]; /** A covariance-vector of g */
|
||||
real_t delta_lb_cov[ NVMAX ]; /** A covariance-vector of lb */
|
||||
real_t delta_ub_cov[ NVMAX ]; /** A covariance-vector of ub */
|
||||
real_t delta_lbA_cov[ NCMAX_ALLOC ]; /** A covariance-vector of lbA */
|
||||
real_t delta_ubA_cov[ NCMAX_ALLOC ]; /** A covariance-vector of ubA */
|
||||
|
||||
#if QPOASES_USE_OLD_VERSION
|
||||
real_t K[KKT_DIM * KKT_DIM]; /** A matrix to store an intermediate result */
|
||||
#endif
|
||||
|
||||
int FR_idx[ NVMAX ]; /** Index array for free variables */
|
||||
int FX_idx[ NVMAX ]; /** Index array for fixed variables */
|
||||
int AC_idx[ NCMAX_ALLOC ]; /** Index array for active constraints */
|
||||
|
||||
real_t delta_xFR[ NVMAX ]; /** QP reaction, primal, w.r.t. free */
|
||||
real_t delta_xFX[ NVMAX ]; /** QP reaction, primal, w.r.t. fixed */
|
||||
real_t delta_yAC[ NVMAX ]; /** QP reaction, dual, w.r.t. active */
|
||||
real_t delta_yFX[ NVMAX ]; /** QP reaction, dual, w.r.t. fixed*/
|
||||
};
|
||||
|
||||
#endif // QPOASES_SOLUTIONANALYSIS_HPP
|
||||
@@ -1,154 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file INCLUDE/Indexlist.hpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Declaration of the Indexlist class designed to manage index lists of
|
||||
* constraints and bounds within a SubjectTo object.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef QPOASES_INDEXLIST_HPP
|
||||
#define QPOASES_INDEXLIST_HPP
|
||||
|
||||
|
||||
#include <Utils.hpp>
|
||||
|
||||
|
||||
/** This class manages index lists.
|
||||
*
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*/
|
||||
class Indexlist
|
||||
{
|
||||
/*
|
||||
* PUBLIC MEMBER FUNCTIONS
|
||||
*/
|
||||
public:
|
||||
/** Default constructor. */
|
||||
Indexlist( );
|
||||
|
||||
/** Copy constructor (deep copy). */
|
||||
Indexlist( const Indexlist& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
/** Destructor. */
|
||||
~Indexlist( );
|
||||
|
||||
/** Assingment operator (deep copy). */
|
||||
Indexlist& operator=( const Indexlist& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
/** Pseudo-constructor.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue init( );
|
||||
|
||||
|
||||
/** Creates an array of all numbers within the index set in correct order.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEXLIST_CORRUPTED */
|
||||
returnValue getNumberArray( int* const numberarray /**< Output: Array of numbers (NULL on error). */
|
||||
) const;
|
||||
|
||||
|
||||
/** Determines the index within the index list at with a given number is stored.
|
||||
* \return >= 0: Index of given number. \n
|
||||
-1: Number not found. */
|
||||
int getIndex( int givennumber /**< Number whose index shall be determined. */
|
||||
) const;
|
||||
|
||||
/** Determines the physical index within the index list at with a given number is stored.
|
||||
* \return >= 0: Index of given number. \n
|
||||
-1: Number not found. */
|
||||
int getPhysicalIndex( int givennumber /**< Number whose physical index shall be determined. */
|
||||
) const;
|
||||
|
||||
/** Returns the number stored at a given physical index.
|
||||
* \return >= 0: Number stored at given physical index. \n
|
||||
-RET_INDEXLIST_OUTOFBOUNDS */
|
||||
int getNumber( int physicalindex /**< Physical index of the number to be returned. */
|
||||
) const;
|
||||
|
||||
|
||||
/** Returns the current length of the index list.
|
||||
* \return Current length of the index list. */
|
||||
inline int getLength( );
|
||||
|
||||
/** Returns last number within the index list.
|
||||
* \return Last number within the index list. */
|
||||
inline int getLastNumber( ) const;
|
||||
|
||||
|
||||
/** Adds number to index list.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEXLIST_MUST_BE_REORDERD \n
|
||||
RET_INDEXLIST_EXCEEDS_MAX_LENGTH */
|
||||
returnValue addNumber( int addnumber /**< Number to be added. */
|
||||
);
|
||||
|
||||
/** Removes number from index list.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue removeNumber( int removenumber /**< Number to be removed. */
|
||||
);
|
||||
|
||||
/** Swaps two numbers within index list.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue swapNumbers( int number1,/**< First number for swapping. */
|
||||
int number2 /**< Second number for swapping. */
|
||||
);
|
||||
|
||||
/** Determines if a given number is contained in the index set.
|
||||
* \return BT_TRUE iff number is contain in the index set */
|
||||
inline BooleanType isMember( int _number /**< Number to be tested for membership. */
|
||||
) const;
|
||||
|
||||
|
||||
/*
|
||||
* PROTECTED MEMBER VARIABLES
|
||||
*/
|
||||
protected:
|
||||
int number[INDEXLISTFACTOR*(NVMAX+NCMAX)]; /**< Array to store numbers of constraints or bounds. */
|
||||
int next[INDEXLISTFACTOR*(NVMAX+NCMAX)]; /**< Array to store physical index of successor. */
|
||||
int previous[INDEXLISTFACTOR*(NVMAX+NCMAX)]; /**< Array to store physical index of predecossor. */
|
||||
int length; /**< Length of index list. */
|
||||
int first; /**< Physical index of first element. */
|
||||
int last; /**< Physical index of last element. */
|
||||
int lastusedindex; /**< Physical index of last entry in index list. */
|
||||
int physicallength; /**< Physical length of index list. */
|
||||
};
|
||||
|
||||
|
||||
#include <Indexlist.ipp>
|
||||
|
||||
#endif /* QPOASES_INDEXLIST_HPP */
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,415 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file INCLUDE/MessageHandling.hpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Declaration of the MessageHandling class including global return values.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef QPOASES_MESSAGEHANDLING_HPP
|
||||
#define QPOASES_MESSAGEHANDLING_HPP
|
||||
|
||||
// #define PC_DEBUG
|
||||
|
||||
#ifdef PC_DEBUG
|
||||
#include <stdio.h>
|
||||
|
||||
/** Defines an alias for FILE from stdio.h. */
|
||||
#define myFILE FILE
|
||||
/** Defines an alias for stderr from stdio.h. */
|
||||
#define myStderr stderr
|
||||
/** Defines an alias for stdout from stdio.h. */
|
||||
#define myStdout stdout
|
||||
#else
|
||||
/** Defines an alias for FILE from stdio.h. */
|
||||
#define myFILE int
|
||||
/** Defines an alias for stderr from stdio.h. */
|
||||
#define myStderr 0
|
||||
/** Defines an alias for stdout from stdio.h. */
|
||||
#define myStdout 0
|
||||
#endif
|
||||
|
||||
|
||||
#include <Types.hpp>
|
||||
#include <Constants.hpp>
|
||||
|
||||
|
||||
/** Defines symbols for global return values. \n
|
||||
* Important: All return values are assumed to be nonnegative! */
|
||||
enum returnValue
|
||||
{
|
||||
TERMINAL_LIST_ELEMENT = -1, /**< Terminal list element, internal usage only! */
|
||||
/* miscellaneous */
|
||||
SUCCESSFUL_RETURN = 0, /**< Successful return. */
|
||||
RET_DIV_BY_ZERO, /**< Division by zero. */
|
||||
RET_INDEX_OUT_OF_BOUNDS, /**< Index out of bounds. */
|
||||
RET_INVALID_ARGUMENTS, /**< At least one of the arguments is invalid. */
|
||||
RET_ERROR_UNDEFINED, /**< Error number undefined. */
|
||||
RET_WARNING_UNDEFINED, /**< Warning number undefined. */
|
||||
RET_INFO_UNDEFINED, /**< Info number undefined. */
|
||||
RET_EWI_UNDEFINED, /**< Error/warning/info number undefined. */
|
||||
RET_AVAILABLE_WITH_LINUX_ONLY, /**< This function is available under Linux only. */
|
||||
RET_UNKNOWN_BUG, /**< The error occured is not yet known. */
|
||||
RET_PRINTLEVEL_CHANGED, /**< 10 Print level changed. */
|
||||
RET_NOT_YET_IMPLEMENTED, /**< Requested function is not yet implemented in this version of qpOASES. */
|
||||
/* Indexlist */
|
||||
RET_INDEXLIST_MUST_BE_REORDERD, /**< Index list has to be reordered. */
|
||||
RET_INDEXLIST_EXCEEDS_MAX_LENGTH, /**< Index list exceeds its maximal physical length. */
|
||||
RET_INDEXLIST_CORRUPTED, /**< Index list corrupted. */
|
||||
RET_INDEXLIST_OUTOFBOUNDS, /**< Physical index is out of bounds. */
|
||||
RET_INDEXLIST_ADD_FAILED, /**< Adding indices from another index set failed. */
|
||||
RET_INDEXLIST_INTERSECT_FAILED, /**< Intersection with another index set failed. */
|
||||
/* SubjectTo / Bounds / Constraints */
|
||||
RET_INDEX_ALREADY_OF_DESIRED_STATUS, /**< Index is already of desired status. */
|
||||
RET_ADDINDEX_FAILED, /**< Cannot swap between different indexsets. */
|
||||
RET_SWAPINDEX_FAILED, /**< 20 Adding index to index set failed. */
|
||||
RET_NOTHING_TO_DO, /**< Nothing to do. */
|
||||
RET_SETUP_BOUND_FAILED, /**< Setting up bound index failed. */
|
||||
RET_SETUP_CONSTRAINT_FAILED, /**< Setting up constraint index failed. */
|
||||
RET_MOVING_BOUND_FAILED, /**< Moving bound between index sets failed. */
|
||||
RET_MOVING_CONSTRAINT_FAILED, /**< Moving constraint between index sets failed. */
|
||||
/* QProblem */
|
||||
RET_QP_ALREADY_INITIALISED, /**< QProblem has already been initialised. */
|
||||
RET_NO_INIT_WITH_STANDARD_SOLVER, /**< Initialisation via extern QP solver is not yet implemented. */
|
||||
RET_RESET_FAILED, /**< Reset failed. */
|
||||
RET_INIT_FAILED, /**< Initialisation failed. */
|
||||
RET_INIT_FAILED_TQ, /**< 30 Initialisation failed due to TQ factorisation. */
|
||||
RET_INIT_FAILED_CHOLESKY, /**< Initialisation failed due to Cholesky decomposition. */
|
||||
RET_INIT_FAILED_HOTSTART, /**< Initialisation failed! QP could not be solved! */
|
||||
RET_INIT_FAILED_INFEASIBILITY, /**< Initial QP could not be solved due to infeasibility! */
|
||||
RET_INIT_FAILED_UNBOUNDEDNESS, /**< Initial QP could not be solved due to unboundedness! */
|
||||
RET_INIT_SUCCESSFUL, /**< Initialisation done. */
|
||||
RET_OBTAINING_WORKINGSET_FAILED, /**< Failed to obtain working set for auxiliary QP. */
|
||||
RET_SETUP_WORKINGSET_FAILED, /**< Failed to setup working set for auxiliary QP. */
|
||||
RET_SETUP_AUXILIARYQP_FAILED, /**< Failed to setup auxiliary QP for initialised homotopy. */
|
||||
RET_NO_EXTERN_SOLVER, /**< No extern QP solver available. */
|
||||
RET_QP_UNBOUNDED, /**< 40 QP is unbounded. */
|
||||
RET_QP_INFEASIBLE, /**< QP is infeasible. */
|
||||
RET_QP_NOT_SOLVED, /**< Problems occured while solving QP with standard solver. */
|
||||
RET_QP_SOLVED, /**< QP successfully solved. */
|
||||
RET_UNABLE_TO_SOLVE_QP, /**< Problems occured while solving QP. */
|
||||
RET_INITIALISATION_STARTED, /**< Starting problem initialisation. */
|
||||
RET_HOTSTART_FAILED, /**< Unable to perform homotopy due to internal error. */
|
||||
RET_HOTSTART_FAILED_TO_INIT, /**< Unable to initialise problem. */
|
||||
RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED, /**< Unable to perform homotopy as previous QP is not solved. */
|
||||
RET_ITERATION_STARTED, /**< Iteration... */
|
||||
RET_SHIFT_DETERMINATION_FAILED, /**< 50 Determination of shift of the QP data failed. */
|
||||
RET_STEPDIRECTION_DETERMINATION_FAILED, /**< Determination of step direction failed. */
|
||||
RET_STEPLENGTH_DETERMINATION_FAILED, /**< Determination of step direction failed. */
|
||||
RET_OPTIMAL_SOLUTION_FOUND, /**< Optimal solution of neighbouring QP found. */
|
||||
RET_HOMOTOPY_STEP_FAILED, /**< Unable to perform homotopy step. */
|
||||
RET_HOTSTART_STOPPED_INFEASIBILITY, /**< Premature homotopy termination because QP is infeasible. */
|
||||
RET_HOTSTART_STOPPED_UNBOUNDEDNESS, /**< Premature homotopy termination because QP is unbounded. */
|
||||
RET_WORKINGSET_UPDATE_FAILED, /**< Unable to update working sets according to initial guesses. */
|
||||
RET_MAX_NWSR_REACHED, /**< Maximum number of working set recalculations performed. */
|
||||
RET_CONSTRAINTS_NOT_SPECIFIED, /**< Problem does comprise constraints! You also have to specify new constraints' bounds. */
|
||||
RET_INVALID_FACTORISATION_FLAG, /**< 60 Invalid factorisation flag. */
|
||||
RET_UNABLE_TO_SAVE_QPDATA, /**< Unable to save QP data. */
|
||||
RET_STEPDIRECTION_FAILED_TQ, /**< Abnormal termination due to TQ factorisation. */
|
||||
RET_STEPDIRECTION_FAILED_CHOLESKY, /**< Abnormal termination due to Cholesky factorisation. */
|
||||
RET_CYCLING_DETECTED, /**< Cycling detected. */
|
||||
RET_CYCLING_NOT_RESOLVED, /**< Cycling cannot be resolved, QP probably infeasible. */
|
||||
RET_CYCLING_RESOLVED, /**< Cycling probably resolved. */
|
||||
RET_STEPSIZE, /**< For displaying performed stepsize. */
|
||||
RET_STEPSIZE_NONPOSITIVE, /**< For displaying non-positive stepsize. */
|
||||
RET_SETUPSUBJECTTOTYPE_FAILED, /**< Setup of SubjectToTypes failed. */
|
||||
RET_ADDCONSTRAINT_FAILED, /**< 70 Addition of constraint to working set failed. */
|
||||
RET_ADDCONSTRAINT_FAILED_INFEASIBILITY, /**< Addition of constraint to working set failed (due to QP infeasibility). */
|
||||
RET_ADDBOUND_FAILED, /**< Addition of bound to working set failed. */
|
||||
RET_ADDBOUND_FAILED_INFEASIBILITY, /**< Addition of bound to working set failed (due to QP infeasibility). */
|
||||
RET_REMOVECONSTRAINT_FAILED, /**< Removal of constraint from working set failed. */
|
||||
RET_REMOVEBOUND_FAILED, /**< Removal of bound from working set failed. */
|
||||
RET_REMOVE_FROM_ACTIVESET, /**< Removing from active set... */
|
||||
RET_ADD_TO_ACTIVESET, /**< Adding to active set... */
|
||||
RET_REMOVE_FROM_ACTIVESET_FAILED, /**< Removing from active set failed. */
|
||||
RET_ADD_TO_ACTIVESET_FAILED, /**< Adding to active set failed. */
|
||||
RET_CONSTRAINT_ALREADY_ACTIVE, /**< 80 Constraint is already active. */
|
||||
RET_ALL_CONSTRAINTS_ACTIVE, /**< All constraints are active, no further constraint can be added. */
|
||||
RET_LINEARLY_DEPENDENT, /**< New bound/constraint is linearly dependent. */
|
||||
RET_LINEARLY_INDEPENDENT, /**< New bound/constraint is linearly independent. */
|
||||
RET_LI_RESOLVED, /**< Linear independence of active contraint matrix successfully resolved. */
|
||||
RET_ENSURELI_FAILED, /**< Failed to ensure linear indepence of active contraint matrix. */
|
||||
RET_ENSURELI_FAILED_TQ, /**< Abnormal termination due to TQ factorisation. */
|
||||
RET_ENSURELI_FAILED_NOINDEX, /**< No index found, QP probably infeasible. */
|
||||
RET_ENSURELI_FAILED_CYCLING, /**< Cycling detected, QP probably infeasible. */
|
||||
RET_BOUND_ALREADY_ACTIVE, /**< Bound is already active. */
|
||||
RET_ALL_BOUNDS_ACTIVE, /**< 90 All bounds are active, no further bound can be added. */
|
||||
RET_CONSTRAINT_NOT_ACTIVE, /**< Constraint is not active. */
|
||||
RET_BOUND_NOT_ACTIVE, /**< Bound is not active. */
|
||||
RET_HESSIAN_NOT_SPD, /**< Projected Hessian matrix not positive definite. */
|
||||
RET_MATRIX_SHIFT_FAILED, /**< Unable to update matrices or to transform vectors. */
|
||||
RET_MATRIX_FACTORISATION_FAILED, /**< Unable to calculate new matrix factorisations. */
|
||||
RET_PRINT_ITERATION_FAILED, /**< Unable to print information on current iteration. */
|
||||
RET_NO_GLOBAL_MESSAGE_OUTPUTFILE, /**< No global message output file initialised. */
|
||||
/* Utils */
|
||||
RET_UNABLE_TO_OPEN_FILE, /**< Unable to open file. */
|
||||
RET_UNABLE_TO_WRITE_FILE, /**< Unable to write into file. */
|
||||
RET_UNABLE_TO_READ_FILE, /**< 100 Unable to read from file. */
|
||||
RET_FILEDATA_INCONSISTENT, /**< File contains inconsistent data. */
|
||||
/* SolutionAnalysis */
|
||||
RET_NO_SOLUTION, /**< QP solution does not satisfy KKT optimality conditions. */
|
||||
RET_INACCURATE_SOLUTION /**< KKT optimality conditions not satisfied to sufficient accuracy. */
|
||||
};
|
||||
|
||||
|
||||
|
||||
/** This class handles all kinds of messages (errors, warnings, infos) initiated
|
||||
* by qpOASES modules and stores the correspoding global preferences.
|
||||
*
|
||||
* \author Hans Joachim Ferreau (special thanks to Leonard Wirsching)
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*/
|
||||
class MessageHandling
|
||||
{
|
||||
/*
|
||||
* INTERNAL DATA STRUCTURES
|
||||
*/
|
||||
public:
|
||||
/** Data structure for entries in global message list. */
|
||||
typedef struct {
|
||||
returnValue key; /**< Global return value. */
|
||||
const char* data; /**< Corresponding message. */
|
||||
VisibilityStatus globalVisibilityStatus; /**< Determines if message can be printed.
|
||||
* If this value is set to VS_HIDDEN, no message is printed! */
|
||||
} ReturnValueList;
|
||||
|
||||
|
||||
/*
|
||||
* PUBLIC MEMBER FUNCTIONS
|
||||
*/
|
||||
public:
|
||||
/** Default constructor. */
|
||||
MessageHandling( );
|
||||
|
||||
/** Constructor which takes the desired output file. */
|
||||
MessageHandling( myFILE* _outputFile /**< Output file. */
|
||||
);
|
||||
|
||||
/** Constructor which takes the desired visibility states. */
|
||||
MessageHandling( VisibilityStatus _errorVisibility, /**< Visibility status for error messages. */
|
||||
VisibilityStatus _warningVisibility,/**< Visibility status for warning messages. */
|
||||
VisibilityStatus _infoVisibility /**< Visibility status for info messages. */
|
||||
);
|
||||
|
||||
/** Constructor which takes the desired output file and desired visibility states. */
|
||||
MessageHandling( myFILE* _outputFile, /**< Output file. */
|
||||
VisibilityStatus _errorVisibility, /**< Visibility status for error messages. */
|
||||
VisibilityStatus _warningVisibility,/**< Visibility status for warning messages. */
|
||||
VisibilityStatus _infoVisibility /**< Visibility status for info messages. */
|
||||
);
|
||||
|
||||
/** Copy constructor (deep copy). */
|
||||
MessageHandling( const MessageHandling& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
/** Destructor. */
|
||||
~MessageHandling( );
|
||||
|
||||
/** Assignment operator (deep copy). */
|
||||
MessageHandling& operator=( const MessageHandling& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
|
||||
/** Prints an error message(a simplified macro THROWERROR is also provided). \n
|
||||
* Errors are definied as abnormal events which cause an immediate termination of the current (sub) function.
|
||||
* Errors of a sub function should be commented by the calling function by means of a warning message
|
||||
* (if this error does not cause an error of the calling function, either)!
|
||||
* \return Error number returned by sub function call
|
||||
*/
|
||||
returnValue throwError(
|
||||
returnValue Enumber, /**< Error number returned by sub function call. */
|
||||
const char* additionaltext, /**< Additional error text (0, if none). */
|
||||
const char* functionname, /**< Name of function which caused the error. */
|
||||
const char* filename, /**< Name of file which caused the error. */
|
||||
const unsigned long linenumber, /**< Number of line which caused the error.incompatible binary file */
|
||||
VisibilityStatus localVisibilityStatus /**< Determines (locally) if error message can be printed to myStderr.
|
||||
* If GLOBAL visibility status of the message is set to VS_HIDDEN,
|
||||
* no message is printed, anyway! */
|
||||
);
|
||||
|
||||
/** Prints a warning message (a simplified macro THROWWARNING is also provided).
|
||||
* Warnings are definied as abnormal events which does NOT cause an immediate termination of the current (sub) function.
|
||||
* \return Warning number returned by sub function call
|
||||
*/
|
||||
returnValue throwWarning(
|
||||
returnValue Wnumber, /**< Warning number returned by sub function call. */
|
||||
const char* additionaltext, /**< Additional warning text (0, if none). */
|
||||
const char* functionname, /**< Name of function which caused the warning. */
|
||||
const char* filename, /**< Name of file which caused the warning. */
|
||||
const unsigned long linenumber, /**< Number of line which caused the warning. */
|
||||
VisibilityStatus localVisibilityStatus /**< Determines (locally) if warning message can be printed to myStderr.
|
||||
* If GLOBAL visibility status of the message is set to VS_HIDDEN,
|
||||
* no message is printed, anyway! */
|
||||
);
|
||||
|
||||
/** Prints a info message (a simplified macro THROWINFO is also provided).
|
||||
* \return Info number returned by sub function call
|
||||
*/
|
||||
returnValue throwInfo(
|
||||
returnValue Inumber, /**< Info number returned by sub function call. */
|
||||
const char* additionaltext, /**< Additional warning text (0, if none). */
|
||||
const char* functionname, /**< Name of function which submitted the info. */
|
||||
const char* filename, /**< Name of file which submitted the info. */
|
||||
const unsigned long linenumber, /**< Number of line which submitted the info. */
|
||||
VisibilityStatus localVisibilityStatus /**< Determines (locally) if info message can be printed to myStderr.
|
||||
* If GLOBAL visibility status of the message is set to VS_HIDDEN,
|
||||
* no message is printed, anyway! */
|
||||
);
|
||||
|
||||
|
||||
/** Resets all preferences to default values.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue reset( );
|
||||
|
||||
|
||||
/** Prints a complete list of all messages to output file.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue listAllMessages( );
|
||||
|
||||
|
||||
/** Returns visibility status for error messages.
|
||||
* \return Visibility status for error messages. */
|
||||
inline VisibilityStatus getErrorVisibilityStatus( ) const;
|
||||
|
||||
/** Returns visibility status for warning messages.
|
||||
* \return Visibility status for warning messages. */
|
||||
inline VisibilityStatus getWarningVisibilityStatus( ) const;
|
||||
|
||||
/** Returns visibility status for info messages.
|
||||
* \return Visibility status for info messages. */
|
||||
inline VisibilityStatus getInfoVisibilityStatus( ) const;
|
||||
|
||||
/** Returns pointer to output file.
|
||||
* \return Pointer to output file. */
|
||||
inline myFILE* getOutputFile( ) const;
|
||||
|
||||
/** Returns error count value.
|
||||
* \return Error count value. */
|
||||
inline int getErrorCount( ) const;
|
||||
|
||||
|
||||
/** Changes visibility status for error messages. */
|
||||
inline void setErrorVisibilityStatus( VisibilityStatus _errorVisibility /**< New visibility status for error messages. */
|
||||
);
|
||||
|
||||
/** Changes visibility status for warning messages. */
|
||||
inline void setWarningVisibilityStatus( VisibilityStatus _warningVisibility /**< New visibility status for warning messages. */
|
||||
);
|
||||
|
||||
/** Changes visibility status for info messages. */
|
||||
inline void setInfoVisibilityStatus( VisibilityStatus _infoVisibility /**< New visibility status for info messages. */
|
||||
);
|
||||
|
||||
/** Changes output file for messages. */
|
||||
inline void setOutputFile( myFILE* _outputFile /**< New output file for messages. */
|
||||
);
|
||||
|
||||
/** Changes error count.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
* RET_INVALID_ARGUMENT */
|
||||
inline returnValue setErrorCount( int _errorCount /**< New error count value. */
|
||||
);
|
||||
|
||||
/** Return the error code string. */
|
||||
static const char* getErrorString(int error);
|
||||
|
||||
/*
|
||||
* PROTECTED MEMBER FUNCTIONS
|
||||
*/
|
||||
protected:
|
||||
/** Prints a info message to myStderr (auxiliary function).
|
||||
* \return Error/warning/info number returned by sub function call
|
||||
*/
|
||||
returnValue throwMessage(
|
||||
returnValue RETnumber, /**< Error/warning/info number returned by sub function call. */
|
||||
const char* additionaltext, /**< Additional warning text (0, if none). */
|
||||
const char* functionname, /**< Name of function which caused the error/warning/info. */
|
||||
const char* filename, /**< Name of file which caused the error/warning/info. */
|
||||
const unsigned long linenumber, /**< Number of line which caused the error/warning/info. */
|
||||
VisibilityStatus localVisibilityStatus, /**< Determines (locally) if info message can be printed to myStderr.
|
||||
* If GLOBAL visibility status of the message is set to VS_HIDDEN,
|
||||
* no message is printed, anyway! */
|
||||
const char* RETstring /**< Leading string of error/warning/info message. */
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* PROTECTED MEMBER VARIABLES
|
||||
*/
|
||||
protected:
|
||||
VisibilityStatus errorVisibility; /**< Error messages visible? */
|
||||
VisibilityStatus warningVisibility; /**< Warning messages visible? */
|
||||
VisibilityStatus infoVisibility; /**< Info messages visible? */
|
||||
|
||||
myFILE* outputFile; /**< Output file for messages. */
|
||||
|
||||
int errorCount; /**< Counts number of errors (for nicer output only). */
|
||||
};
|
||||
|
||||
|
||||
#ifndef __FUNCTION__
|
||||
/** Ensures that __FUNCTION__ macro is defined. */
|
||||
#define __FUNCTION__ 0
|
||||
#endif
|
||||
|
||||
#ifndef __FILE__
|
||||
/** Ensures that __FILE__ macro is defined. */
|
||||
#define __FILE__ 0
|
||||
#endif
|
||||
|
||||
#ifndef __LINE__
|
||||
/** Ensures that __LINE__ macro is defined. */
|
||||
#define __LINE__ 0
|
||||
#endif
|
||||
|
||||
|
||||
/** Short version of throwError with default values, only returnValue is needed */
|
||||
#define THROWERROR(retval) ( getGlobalMessageHandler( )->throwError((retval),0,__FUNCTION__,__FILE__,__LINE__,VS_VISIBLE) )
|
||||
|
||||
/** Short version of throwWarning with default values, only returnValue is needed */
|
||||
#define THROWWARNING(retval) ( getGlobalMessageHandler( )->throwWarning((retval),0,__FUNCTION__,__FILE__,__LINE__,VS_VISIBLE) )
|
||||
|
||||
/** Short version of throwInfo with default values, only returnValue is needed */
|
||||
#define THROWINFO(retval) ( getGlobalMessageHandler( )->throwInfo((retval),0,__FUNCTION__,__FILE__,__LINE__,VS_VISIBLE) )
|
||||
|
||||
|
||||
/** Returns a pointer to global message handler.
|
||||
* \return Pointer to global message handler.
|
||||
*/
|
||||
MessageHandling* getGlobalMessageHandler( );
|
||||
|
||||
|
||||
#include <MessageHandling.ipp>
|
||||
|
||||
#endif /* QPOASES_MESSAGEHANDLING_HPP */
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,666 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file INCLUDE/QProblem.hpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Declaration of the QProblem class which is able to use the newly
|
||||
* developed online active set strategy for parametric quadratic programming.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef QPOASES_QPROBLEM_HPP
|
||||
#define QPOASES_QPROBLEM_HPP
|
||||
|
||||
|
||||
#include <QProblemB.hpp>
|
||||
#include <Constraints.hpp>
|
||||
#include <CyclingManager.hpp>
|
||||
|
||||
|
||||
/** A class for setting up and solving quadratic programs. The main feature is
|
||||
* the possibily to use the newly developed online active set strategy for
|
||||
* parametric quadratic programming.
|
||||
*
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*/
|
||||
class QProblem : public QProblemB
|
||||
{
|
||||
/* allow SolutionAnalysis class to access private members */
|
||||
friend class SolutionAnalysis;
|
||||
|
||||
/*
|
||||
* PUBLIC MEMBER FUNCTIONS
|
||||
*/
|
||||
public:
|
||||
/** Default constructor. */
|
||||
QProblem( );
|
||||
|
||||
/** Constructor which takes the QP dimensions only. */
|
||||
QProblem( int _nV, /**< Number of variables. */
|
||||
int _nC /**< Number of constraints. */
|
||||
);
|
||||
|
||||
/** Copy constructor (deep copy). */
|
||||
QProblem( const QProblem& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
/** Destructor. */
|
||||
~QProblem( );
|
||||
|
||||
/** Assignment operator (deep copy). */
|
||||
QProblem& operator=( const QProblem& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
|
||||
/** Clears all data structures of QProblemB except for QP data.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_RESET_FAILED */
|
||||
returnValue reset( );
|
||||
|
||||
|
||||
/** Initialises a QProblem with given QP data and solves it
|
||||
* using an initial homotopy with empty working set (at most nWSR iterations).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INIT_FAILED \n
|
||||
RET_INIT_FAILED_CHOLESKY \n
|
||||
RET_INIT_FAILED_TQ \n
|
||||
RET_INIT_FAILED_HOTSTART \n
|
||||
RET_INIT_FAILED_INFEASIBILITY \n
|
||||
RET_INIT_FAILED_UNBOUNDEDNESS \n
|
||||
RET_MAX_NWSR_REACHED \n
|
||||
RET_INVALID_ARGUMENTS \n
|
||||
RET_INACCURATE_SOLUTION \n
|
||||
RET_NO_SOLUTION */
|
||||
returnValue init( const real_t* const _H, /**< Hessian matrix. */
|
||||
const real_t* const _g, /**< Gradient vector. */
|
||||
const real_t* const _A, /**< Constraint matrix. */
|
||||
const real_t* const _lb, /**< Lower bound vector (on variables). \n
|
||||
If no lower bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const _ub, /**< Upper bound vector (on variables). \n
|
||||
If no upper bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const _lbA, /**< Lower constraints' bound vector. \n
|
||||
If no lower constraints' bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const _ubA, /**< Upper constraints' bound vector. \n
|
||||
If no lower constraints' bounds exist, a NULL pointer can be passed. */
|
||||
int& nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy.
|
||||
Output: Number of performed working set recalculations. */
|
||||
const real_t* const yOpt = 0, /**< Initial guess for dual solution vector. */
|
||||
real_t* const cputime = 0 /**< Output: CPU time required to initialise QP. */
|
||||
);
|
||||
|
||||
|
||||
/** Initialises a QProblem with given QP data and solves it
|
||||
* using an initial homotopy with empty working set (at most nWSR iterations).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INIT_FAILED \n
|
||||
RET_INIT_FAILED_CHOLESKY \n
|
||||
RET_INIT_FAILED_TQ \n
|
||||
RET_INIT_FAILED_HOTSTART \n
|
||||
RET_INIT_FAILED_INFEASIBILITY \n
|
||||
RET_INIT_FAILED_UNBOUNDEDNESS \n
|
||||
RET_MAX_NWSR_REACHED \n
|
||||
RET_INVALID_ARGUMENTS \n
|
||||
RET_INACCURATE_SOLUTION \n
|
||||
RET_NO_SOLUTION */
|
||||
returnValue init( const real_t* const _H, /**< Hessian matrix. */
|
||||
const real_t* const _R, /**< Cholesky factorization of the Hessian matrix. */
|
||||
const real_t* const _g, /**< Gradient vector. */
|
||||
const real_t* const _A, /**< Constraint matrix. */
|
||||
const real_t* const _lb, /**< Lower bound vector (on variables). \n
|
||||
If no lower bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const _ub, /**< Upper bound vector (on variables). \n
|
||||
If no upper bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const _lbA, /**< Lower constraints' bound vector. \n
|
||||
If no lower constraints' bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const _ubA, /**< Upper constraints' bound vector. \n
|
||||
If no lower constraints' bounds exist, a NULL pointer can be passed. */
|
||||
int& nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy.
|
||||
Output: Number of performed working set recalculations. */
|
||||
const real_t* const yOpt = 0, /**< Initial guess for dual solution vector. */
|
||||
real_t* const cputime = 0 /**< Output: CPU time required to initialise QP. */
|
||||
);
|
||||
|
||||
|
||||
/** Solves QProblem using online active set strategy.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_MAX_NWSR_REACHED \n
|
||||
RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n
|
||||
RET_HOTSTART_FAILED \n
|
||||
RET_SHIFT_DETERMINATION_FAILED \n
|
||||
RET_STEPDIRECTION_DETERMINATION_FAILED \n
|
||||
RET_STEPLENGTH_DETERMINATION_FAILED \n
|
||||
RET_HOMOTOPY_STEP_FAILED \n
|
||||
RET_HOTSTART_STOPPED_INFEASIBILITY \n
|
||||
RET_HOTSTART_STOPPED_UNBOUNDEDNESS \n
|
||||
RET_INACCURATE_SOLUTION \n
|
||||
RET_NO_SOLUTION */
|
||||
returnValue hotstart( const real_t* const g_new, /**< Gradient of neighbouring QP to be solved. */
|
||||
const real_t* const lb_new, /**< Lower bounds of neighbouring QP to be solved. \n
|
||||
If no lower bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const ub_new, /**< Upper bounds of neighbouring QP to be solved. \n
|
||||
If no upper bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const lbA_new, /**< Lower constraints' bounds of neighbouring QP to be solved. \n
|
||||
If no lower constraints' bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const ubA_new, /**< Upper constraints' bounds of neighbouring QP to be solved. \n
|
||||
If no upper constraints' bounds exist, a NULL pointer can be passed. */
|
||||
int& nWSR, /**< Input: Maximum number of working set recalculations; \n
|
||||
Output: Number of performed working set recalculations. */
|
||||
real_t* const cputime /**< Output: CPU time required to solve QP (or to perform nWSR iterations). */
|
||||
);
|
||||
|
||||
|
||||
/** Returns constraint matrix of the QP (deep copy).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue getA( real_t* const _A /**< Array of appropriate dimension for copying constraint matrix.*/
|
||||
) const;
|
||||
|
||||
/** Returns a single row of constraint matrix of the QP (deep copy).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
inline returnValue getA( int number, /**< Number of entry to be returned. */
|
||||
real_t* const row /**< Array of appropriate dimension for copying (number)th constraint. */
|
||||
) const;
|
||||
|
||||
/** Returns lower constraints' bound vector of the QP (deep copy).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue getLBA( real_t* const _lbA /**< Array of appropriate dimension for copying lower constraints' bound vector.*/
|
||||
) const;
|
||||
|
||||
/** Returns single entry of lower constraints' bound vector of the QP.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
inline returnValue getLBA( int number, /**< Number of entry to be returned. */
|
||||
real_t& value /**< Output: lbA[number].*/
|
||||
) const;
|
||||
|
||||
/** Returns upper constraints' bound vector of the QP (deep copy).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue getUBA( real_t* const _ubA /**< Array of appropriate dimension for copying upper constraints' bound vector.*/
|
||||
) const;
|
||||
|
||||
/** Returns single entry of upper constraints' bound vector of the QP.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
inline returnValue getUBA( int number, /**< Number of entry to be returned. */
|
||||
real_t& value /**< Output: ubA[number].*/
|
||||
) const;
|
||||
|
||||
|
||||
/** Returns current constraints object of the QP (deep copy).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue getConstraints( Constraints* const _constraints /** Output: Constraints object. */
|
||||
) const;
|
||||
|
||||
|
||||
/** Returns the number of constraints.
|
||||
* \return Number of constraints. */
|
||||
inline int getNC( ) const;
|
||||
|
||||
/** Returns the number of (implicitly defined) equality constraints.
|
||||
* \return Number of (implicitly defined) equality constraints. */
|
||||
inline int getNEC( ) const;
|
||||
|
||||
/** Returns the number of active constraints.
|
||||
* \return Number of active constraints. */
|
||||
inline int getNAC( );
|
||||
|
||||
/** Returns the number of inactive constraints.
|
||||
* \return Number of inactive constraints. */
|
||||
inline int getNIAC( );
|
||||
|
||||
/** Returns the dimension of null space.
|
||||
* \return Dimension of null space. */
|
||||
int getNZ( );
|
||||
|
||||
|
||||
/** Returns the dual solution vector (deep copy).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_QP_NOT_SOLVED */
|
||||
returnValue getDualSolution( real_t* const yOpt /**< Output: Dual solution vector (if QP has been solved). */
|
||||
) const;
|
||||
|
||||
|
||||
/*
|
||||
* PROTECTED MEMBER FUNCTIONS
|
||||
*/
|
||||
protected:
|
||||
/** Determines type of constraints and bounds (i.e. implicitly fixed, unbounded etc.).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_SETUPSUBJECTTOTYPE_FAILED */
|
||||
returnValue setupSubjectToType( );
|
||||
|
||||
/** Computes the Cholesky decomposition R of the projected Hessian (i.e. R^T*R = Z^T*H*Z).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
* RET_INDEXLIST_CORRUPTED */
|
||||
returnValue setupCholeskyDecompositionProjected( );
|
||||
|
||||
/** Initialises TQ factorisation of A (i.e. A*Q = [0 T]) if NO constraint is active.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEXLIST_CORRUPTED */
|
||||
returnValue setupTQfactorisation( );
|
||||
|
||||
|
||||
/** Solves a QProblem whose QP data is assumed to be stored in the member variables.
|
||||
* A guess for its primal/dual optimal solution vectors and the corresponding
|
||||
* working sets of bounds and constraints can be provided.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INIT_FAILED \n
|
||||
RET_INIT_FAILED_CHOLESKY \n
|
||||
RET_INIT_FAILED_TQ \n
|
||||
RET_INIT_FAILED_HOTSTART \n
|
||||
RET_INIT_FAILED_INFEASIBILITY \n
|
||||
RET_INIT_FAILED_UNBOUNDEDNESS \n
|
||||
RET_MAX_NWSR_REACHED */
|
||||
returnValue solveInitialQP( const real_t* const xOpt, /**< Optimal primal solution vector.
|
||||
* A NULL pointer can be passed. */
|
||||
const real_t* const yOpt, /**< Optimal dual solution vector.
|
||||
* A NULL pointer can be passed. */
|
||||
const Bounds* const guessedBounds, /**< Guessed working set of bounds for solution (xOpt,yOpt).
|
||||
* A NULL pointer can be passed. */
|
||||
const Constraints* const guessedConstraints, /**< Optimal working set of constraints for solution (xOpt,yOpt).
|
||||
* A NULL pointer can be passed. */
|
||||
int& nWSR, /**< Input: Maximum number of working set recalculations; \n
|
||||
* Output: Number of performed working set recalculations. */
|
||||
real_t* const cputime /**< Output: CPU time required to solve QP (or to perform nWSR iterations). */
|
||||
);
|
||||
|
||||
/** Obtains the desired working set for the auxiliary initial QP in
|
||||
* accordance with the user specifications
|
||||
* (assumes that member AX has already been initialised!)
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_OBTAINING_WORKINGSET_FAILED \n
|
||||
RET_INVALID_ARGUMENTS */
|
||||
returnValue obtainAuxiliaryWorkingSet( const real_t* const xOpt, /**< Optimal primal solution vector.
|
||||
* If a NULL pointer is passed, all entries are assumed to be zero. */
|
||||
const real_t* const yOpt, /**< Optimal dual solution vector.
|
||||
* If a NULL pointer is passed, all entries are assumed to be zero. */
|
||||
const Bounds* const guessedBounds, /**< Guessed working set of bounds for solution (xOpt,yOpt). */
|
||||
const Constraints* const guessedConstraints, /**< Guessed working set for solution (xOpt,yOpt). */
|
||||
Bounds* auxiliaryBounds, /**< Input: Allocated bound object. \n
|
||||
* Ouput: Working set of constraints for auxiliary QP. */
|
||||
Constraints* auxiliaryConstraints /**< Input: Allocated bound object. \n
|
||||
* Ouput: Working set for auxiliary QP. */
|
||||
) const;
|
||||
|
||||
/** Setups bound and constraints data structures according to auxiliaryBounds/Constraints.
|
||||
* (If the working set shall be setup afresh, make sure that
|
||||
* bounds and constraints data structure have been resetted
|
||||
* and the TQ factorisation has been initialised!)
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_SETUP_WORKINGSET_FAILED \n
|
||||
RET_INVALID_ARGUMENTS \n
|
||||
RET_UNKNOWN BUG */
|
||||
returnValue setupAuxiliaryWorkingSet( const Bounds* const auxiliaryBounds, /**< Working set of bounds for auxiliary QP. */
|
||||
const Constraints* const auxiliaryConstraints, /**< Working set of constraints for auxiliary QP. */
|
||||
BooleanType setupAfresh /**< Flag indicating if given working set shall be
|
||||
* setup afresh or by updating the current one. */
|
||||
);
|
||||
|
||||
/** Setups the optimal primal/dual solution of the auxiliary initial QP.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue setupAuxiliaryQPsolution( const real_t* const xOpt, /**< Optimal primal solution vector.
|
||||
* If a NULL pointer is passed, all entries are set to zero. */
|
||||
const real_t* const yOpt /**< Optimal dual solution vector.
|
||||
* If a NULL pointer is passed, all entries are set to zero. */
|
||||
);
|
||||
|
||||
/** Setups gradient of the auxiliary initial QP for given
|
||||
* optimal primal/dual solution and given initial working set
|
||||
* (assumes that members X, Y and BOUNDS, CONSTRAINTS have already been initialised!).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue setupAuxiliaryQPgradient( );
|
||||
|
||||
/** Setups (constraints') bounds of the auxiliary initial QP for given
|
||||
* optimal primal/dual solution and given initial working set
|
||||
* (assumes that members X, Y and BOUNDS, CONSTRAINTS have already been initialised!).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_UNKNOWN BUG */
|
||||
returnValue setupAuxiliaryQPbounds( const Bounds* const auxiliaryBounds, /**< Working set of bounds for auxiliary QP. */
|
||||
const Constraints* const auxiliaryConstraints, /**< Working set of constraints for auxiliary QP. */
|
||||
BooleanType useRelaxation /**< Flag indicating if inactive (constraints') bounds shall be relaxed. */
|
||||
);
|
||||
|
||||
|
||||
/** Adds a constraint to active set.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_ADDCONSTRAINT_FAILED \n
|
||||
RET_ADDCONSTRAINT_FAILED_INFEASIBILITY \n
|
||||
RET_ENSURELI_FAILED */
|
||||
returnValue addConstraint( int number, /**< Number of constraint to be added to active set. */
|
||||
SubjectToStatus C_status, /**< Status of new active constraint. */
|
||||
BooleanType updateCholesky /**< Flag indicating if Cholesky decomposition shall be updated. */
|
||||
);
|
||||
|
||||
/** Checks if new active constraint to be added is linearly dependent from
|
||||
* from row of the active constraints matrix.
|
||||
* \return RET_LINEARLY_DEPENDENT \n
|
||||
RET_LINEARLY_INDEPENDENT \n
|
||||
RET_INDEXLIST_CORRUPTED */
|
||||
returnValue addConstraint_checkLI( int number /**< Number of constraint to be added to active set. */
|
||||
);
|
||||
|
||||
/** Ensures linear independence of constraint matrix when a new constraint is added.
|
||||
* To this end a bound or constraint is removed simultaneously if necessary.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_LI_RESOLVED \n
|
||||
RET_ENSURELI_FAILED \n
|
||||
RET_ENSURELI_FAILED_TQ \n
|
||||
RET_ENSURELI_FAILED_NOINDEX \n
|
||||
RET_REMOVE_FROM_ACTIVESET */
|
||||
returnValue addConstraint_ensureLI( int number, /**< Number of constraint to be added to active set. */
|
||||
SubjectToStatus C_status /**< Status of new active bound. */
|
||||
);
|
||||
|
||||
/** Adds a bound to active set.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_ADDBOUND_FAILED \n
|
||||
RET_ADDBOUND_FAILED_INFEASIBILITY \n
|
||||
RET_ENSURELI_FAILED */
|
||||
returnValue addBound( int number, /**< Number of bound to be added to active set. */
|
||||
SubjectToStatus B_status, /**< Status of new active bound. */
|
||||
BooleanType updateCholesky /**< Flag indicating if Cholesky decomposition shall be updated. */
|
||||
);
|
||||
|
||||
/** Checks if new active bound to be added is linearly dependent from
|
||||
* from row of the active constraints matrix.
|
||||
* \return RET_LINEARLY_DEPENDENT \n
|
||||
RET_LINEARLY_INDEPENDENT */
|
||||
returnValue addBound_checkLI( int number /**< Number of bound to be added to active set. */
|
||||
);
|
||||
|
||||
/** Ensures linear independence of constraint matrix when a new bound is added.
|
||||
* To this end a bound or constraint is removed simultaneously if necessary.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_LI_RESOLVED \n
|
||||
RET_ENSURELI_FAILED \n
|
||||
RET_ENSURELI_FAILED_TQ \n
|
||||
RET_ENSURELI_FAILED_NOINDEX \n
|
||||
RET_REMOVE_FROM_ACTIVESET */
|
||||
returnValue addBound_ensureLI( int number, /**< Number of bound to be added to active set. */
|
||||
SubjectToStatus B_status /**< Status of new active bound. */
|
||||
);
|
||||
|
||||
/** Removes a constraint from active set.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_CONSTRAINT_NOT_ACTIVE \n
|
||||
RET_REMOVECONSTRAINT_FAILED \n
|
||||
RET_HESSIAN_NOT_SPD */
|
||||
returnValue removeConstraint( int number, /**< Number of constraint to be removed from active set. */
|
||||
BooleanType updateCholesky /**< Flag indicating if Cholesky decomposition shall be updated. */
|
||||
);
|
||||
|
||||
/** Removes a bounds from active set.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_BOUND_NOT_ACTIVE \n
|
||||
RET_HESSIAN_NOT_SPD \n
|
||||
RET_REMOVEBOUND_FAILED */
|
||||
returnValue removeBound( int number, /**< Number of bound to be removed from active set. */
|
||||
BooleanType updateCholesky /**< Flag indicating if Cholesky decomposition shall be updated. */
|
||||
);
|
||||
|
||||
|
||||
/** Solves the system Ra = b or R^Ta = b where R is an upper triangular matrix.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_DIV_BY_ZERO */
|
||||
returnValue backsolveR( const real_t* const b, /**< Right hand side vector. */
|
||||
BooleanType transposed, /**< Indicates if the transposed system shall be solved. */
|
||||
real_t* const a /**< Output: Solution vector */
|
||||
);
|
||||
|
||||
/** Solves the system Ra = b or R^Ta = b where R is an upper triangular matrix. \n
|
||||
* Special variant for the case that this function is called from within "removeBound()".
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_DIV_BY_ZERO */
|
||||
returnValue backsolveR( const real_t* const b, /**< Right hand side vector. */
|
||||
BooleanType transposed, /**< Indicates if the transposed system shall be solved. */
|
||||
BooleanType removingBound, /**< Indicates if function is called from "removeBound()". */
|
||||
real_t* const a /**< Output: Solution vector */
|
||||
);
|
||||
|
||||
|
||||
/** Solves the system Ta = b or T^Ta = b where T is a reverse upper triangular matrix.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_DIV_BY_ZERO */
|
||||
returnValue backsolveT( const real_t* const b, /**< Right hand side vector. */
|
||||
BooleanType transposed, /**< Indicates if the transposed system shall be solved. */
|
||||
real_t* const a /**< Output: Solution vector */
|
||||
);
|
||||
|
||||
|
||||
/** Determines step direction of the shift of the QP data.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue hotstart_determineDataShift(const int* const FX_idx, /**< Index array of fixed variables. */
|
||||
const int* const AC_idx, /**< Index array of active constraints. */
|
||||
const real_t* const g_new, /**< New gradient vector. */
|
||||
const real_t* const lbA_new,/**< New lower constraints' bounds. */
|
||||
const real_t* const ubA_new,/**< New upper constraints' bounds. */
|
||||
const real_t* const lb_new, /**< New lower bounds. */
|
||||
const real_t* const ub_new, /**< New upper bounds. */
|
||||
real_t* const delta_g, /**< Output: Step direction of gradient vector. */
|
||||
real_t* const delta_lbA, /**< Output: Step direction of lower constraints' bounds. */
|
||||
real_t* const delta_ubA, /**< Output: Step direction of upper constraints' bounds. */
|
||||
real_t* const delta_lb, /**< Output: Step direction of lower bounds. */
|
||||
real_t* const delta_ub, /**< Output: Step direction of upper bounds. */
|
||||
BooleanType& Delta_bC_isZero,/**< Output: Indicates if active constraints' bounds are to be shifted. */
|
||||
BooleanType& Delta_bB_isZero/**< Output: Indicates if active bounds are to be shifted. */
|
||||
);
|
||||
|
||||
/** Determines step direction of the homotopy path.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_STEPDIRECTION_FAILED_TQ \n
|
||||
RET_STEPDIRECTION_FAILED_CHOLESKY */
|
||||
returnValue hotstart_determineStepDirection(const int* const FR_idx, /**< Index array of free variables. */
|
||||
const int* const FX_idx, /**< Index array of fixed variables. */
|
||||
const int* const AC_idx, /**< Index array of active constraints. */
|
||||
const real_t* const delta_g, /**< Step direction of gradient vector. */
|
||||
const real_t* const delta_lbA, /**< Step direction of lower constraints' bounds. */
|
||||
const real_t* const delta_ubA, /**< Step direction of upper constraints' bounds. */
|
||||
const real_t* const delta_lb, /**< Step direction of lower bounds. */
|
||||
const real_t* const delta_ub, /**< Step direction of upper bounds. */
|
||||
BooleanType Delta_bC_isZero, /**< Indicates if active constraints' bounds are to be shifted. */
|
||||
BooleanType Delta_bB_isZero, /**< Indicates if active bounds are to be shifted. */
|
||||
real_t* const delta_xFX, /**< Output: Primal homotopy step direction of fixed variables. */
|
||||
real_t* const delta_xFR, /**< Output: Primal homotopy step direction of free variables. */
|
||||
real_t* const delta_yAC, /**< Output: Dual homotopy step direction of active constraints' multiplier. */
|
||||
real_t* const delta_yFX /**< Output: Dual homotopy step direction of fixed variables' multiplier. */
|
||||
);
|
||||
|
||||
/** Determines the maximum possible step length along the homotopy path.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue hotstart_determineStepLength( const int* const FR_idx, /**< Index array of free variables. */
|
||||
const int* const FX_idx, /**< Index array of fixed variables. */
|
||||
const int* const AC_idx, /**< Index array of active constraints. */
|
||||
const int* const IAC_idx, /**< Index array of inactive constraints. */
|
||||
const real_t* const delta_lbA, /**< Step direction of lower constraints' bounds. */
|
||||
const real_t* const delta_ubA, /**< Step direction of upper constraints' bounds. */
|
||||
const real_t* const delta_lb, /**< Step direction of lower bounds. */
|
||||
const real_t* const delta_ub, /**< Step direction of upper bounds. */
|
||||
const real_t* const delta_xFX, /**< Primal homotopy step direction of fixed variables. */
|
||||
const real_t* const delta_xFR, /**< Primal homotopy step direction of free variables. */
|
||||
const real_t* const delta_yAC, /**< Dual homotopy step direction of active constraints' multiplier. */
|
||||
const real_t* const delta_yFX, /**< Dual homotopy step direction of fixed variables' multiplier. */
|
||||
real_t* const delta_Ax, /**< Output: Step in vector Ax. */
|
||||
int& BC_idx, /**< Output: Index of blocking constraint. */
|
||||
SubjectToStatus& BC_status, /**< Output: Status of blocking constraint. */
|
||||
BooleanType& BC_isBound /**< Output: Indicates if blocking constraint is a bound. */
|
||||
);
|
||||
|
||||
/** Performs a step along the homotopy path (and updates active set).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_OPTIMAL_SOLUTION_FOUND \n
|
||||
RET_REMOVE_FROM_ACTIVESET_FAILED \n
|
||||
RET_ADD_TO_ACTIVESET_FAILED \n
|
||||
RET_QP_INFEASIBLE */
|
||||
returnValue hotstart_performStep( const int* const FR_idx, /**< Index array of free variables. */
|
||||
const int* const FX_idx, /**< Index array of fixed variables. */
|
||||
const int* const AC_idx, /**< Index array of active constraints. */
|
||||
const int* const IAC_idx, /**< Index array of inactive constraints. */
|
||||
const real_t* const delta_g, /**< Step direction of gradient vector. */
|
||||
const real_t* const delta_lbA, /**< Step direction of lower constraints' bounds. */
|
||||
const real_t* const delta_ubA, /**< Step direction of upper constraints' bounds. */
|
||||
const real_t* const delta_lb, /**< Step direction of lower bounds. */
|
||||
const real_t* const delta_ub, /**< Step direction of upper bounds. */
|
||||
const real_t* const delta_xFX, /**< Primal homotopy step direction of fixed variables. */
|
||||
const real_t* const delta_xFR, /**< Primal homotopy step direction of free variables. */
|
||||
const real_t* const delta_yAC, /**< Dual homotopy step direction of active constraints' multiplier. */
|
||||
const real_t* const delta_yFX, /**< Dual homotopy step direction of fixed variables' multiplier. */
|
||||
const real_t* const delta_Ax, /**< Step in vector Ax. */
|
||||
int BC_idx, /**< Index of blocking constraint. */
|
||||
SubjectToStatus BC_status, /**< Status of blocking constraint. */
|
||||
BooleanType BC_isBound /**< Indicates if blocking constraint is a bound. */
|
||||
);
|
||||
|
||||
|
||||
/** Checks if lower/upper (constraints') bounds remain consistent
|
||||
* (i.e. if lb <= ub and lbA <= ubA ) during the current step.
|
||||
* \return BT_TRUE iff (constraints") bounds remain consistent
|
||||
*/
|
||||
BooleanType areBoundsConsistent( const real_t* const delta_lb, /**< Step direction of lower bounds. */
|
||||
const real_t* const delta_ub, /**< Step direction of upper bounds. */
|
||||
const real_t* const delta_lbA, /**< Step direction of lower constraints' bounds. */
|
||||
const real_t* const delta_ubA /**< Step direction of upper constraints' bounds. */
|
||||
) const;
|
||||
|
||||
|
||||
/** Setups internal QP data.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INVALID_ARGUMENTS */
|
||||
returnValue setupQPdata( const real_t* const _H, /**< Hessian matrix. */
|
||||
const real_t* const _R, /**< Cholesky factorization of the Hessian matrix. */
|
||||
const real_t* const _g, /**< Gradient vector. */
|
||||
const real_t* const _A, /**< Constraint matrix. */
|
||||
const real_t* const _lb, /**< Lower bound vector (on variables). \n
|
||||
If no lower bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const _ub, /**< Upper bound vector (on variables). \n
|
||||
If no upper bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const _lbA, /**< Lower constraints' bound vector. \n
|
||||
If no lower constraints' bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const _ubA /**< Upper constraints' bound vector. \n
|
||||
If no lower constraints' bounds exist, a NULL pointer can be passed. */
|
||||
);
|
||||
|
||||
|
||||
#ifdef PC_DEBUG /* Define print functions only for debugging! */
|
||||
|
||||
/** Prints concise information on the current iteration.
|
||||
* \return SUCCESSFUL_RETURN \n */
|
||||
returnValue printIteration( int iteration, /**< Number of current iteration. */
|
||||
int BC_idx, /**< Index of blocking constraint. */
|
||||
SubjectToStatus BC_status, /**< Status of blocking constraint. */
|
||||
BooleanType BC_isBound /**< Indicates if blocking constraint is a bound. */
|
||||
);
|
||||
|
||||
/** Prints concise information on the current iteration.
|
||||
* NOTE: ONLY DEFINED FOR SUPPRESSING A COMPILER WARNING!!
|
||||
* \return SUCCESSFUL_RETURN \n */
|
||||
returnValue printIteration( int iteration, /**< Number of current iteration. */
|
||||
int BC_idx, /**< Index of blocking bound. */
|
||||
SubjectToStatus BC_status /**< Status of blocking bound. */
|
||||
);
|
||||
|
||||
#endif /* PC_DEBUG */
|
||||
|
||||
|
||||
/** Determines the maximum violation of the KKT optimality conditions
|
||||
* of the current iterate within the QProblem object.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
* RET_INACCURATE_SOLUTION \n
|
||||
* RET_NO_SOLUTION */
|
||||
returnValue checkKKTconditions( );
|
||||
|
||||
|
||||
/** Sets constraint matrix of the QP. \n
|
||||
(Remark: Also internal vector Ax is recomputed!)
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setA( const real_t* const A_new /**< New constraint matrix (with correct dimension!). */
|
||||
);
|
||||
|
||||
/** Changes single row of constraint matrix of the QP. \n
|
||||
(Remark: Also correponding component of internal vector Ax is recomputed!)
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
inline returnValue setA( int number, /**< Number of row to be changed. */
|
||||
const real_t* const value /**< New (number)th constraint (with correct dimension!). */
|
||||
);
|
||||
|
||||
|
||||
/** Sets constraints' lower bound vector of the QP.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setLBA( const real_t* const lbA_new /**< New constraints' lower bound vector (with correct dimension!). */
|
||||
);
|
||||
|
||||
/** Changes single entry of lower constraints' bound vector of the QP.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
inline returnValue setLBA( int number, /**< Number of entry to be changed. */
|
||||
real_t value /**< New value for entry of lower constraints' bound vector (with correct dimension!). */
|
||||
);
|
||||
|
||||
/** Sets constraints' upper bound vector of the QP.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setUBA( const real_t* const ubA_new /**< New constraints' upper bound vector (with correct dimension!). */
|
||||
);
|
||||
|
||||
/** Changes single entry of upper constraints' bound vector of the QP.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
inline returnValue setUBA( int number, /**< Number of entry to be changed. */
|
||||
real_t value /**< New value for entry of upper constraints' bound vector (with correct dimension!). */
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* PROTECTED MEMBER VARIABLES
|
||||
*/
|
||||
protected:
|
||||
real_t A[NCMAX_ALLOC*NVMAX]; /**< Constraint matrix. */
|
||||
real_t lbA[NCMAX_ALLOC]; /**< Lower constraints' bound vector. */
|
||||
real_t ubA[NCMAX_ALLOC]; /**< Upper constraints' bound vector. */
|
||||
|
||||
Constraints constraints; /**< Data structure for problem's constraints. */
|
||||
|
||||
real_t T[NVMAX*NVMAX]; /**< Reverse triangular matrix, A = [0 T]*Q'. */
|
||||
real_t Q[NVMAX*NVMAX]; /**< Orthonormal quadratic matrix, A = [0 T]*Q'. */
|
||||
int sizeT; /**< Matrix T is stored in a (sizeT x sizeT) array. */
|
||||
|
||||
real_t Ax[NCMAX_ALLOC]; /**< Stores the current product A*x (for increased efficiency only). */
|
||||
|
||||
CyclingManager cyclingManager; /**< Data structure for storing (possible) cycling information (NOT YET IMPLEMENTED!). */
|
||||
};
|
||||
|
||||
|
||||
#include <QProblem.ipp>
|
||||
|
||||
#endif /* QPOASES_QPROBLEM_HPP */
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,628 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file INCLUDE/QProblemB.hpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Declaration of the QProblemB class which is able to use the newly
|
||||
* developed online active set strategy for parametric quadratic programming
|
||||
* for problems with (simple) bounds only.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef QPOASES_QPROBLEMB_HPP
|
||||
#define QPOASES_QPROBLEMB_HPP
|
||||
|
||||
|
||||
#include <Bounds.hpp>
|
||||
|
||||
|
||||
|
||||
class SolutionAnalysis;
|
||||
|
||||
/** Class for setting up and solving quadratic programs with (simple) bounds only.
|
||||
* The main feature is the possibily to use the newly developed online active set strategy
|
||||
* for parametric quadratic programming.
|
||||
*
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*/
|
||||
class QProblemB
|
||||
{
|
||||
/* allow SolutionAnalysis class to access private members */
|
||||
friend class SolutionAnalysis;
|
||||
|
||||
/*
|
||||
* PUBLIC MEMBER FUNCTIONS
|
||||
*/
|
||||
public:
|
||||
/** Default constructor. */
|
||||
QProblemB( );
|
||||
|
||||
/** Constructor which takes the QP dimension only. */
|
||||
QProblemB( int _nV /**< Number of variables. */
|
||||
);
|
||||
|
||||
/** Copy constructor (deep copy). */
|
||||
QProblemB( const QProblemB& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
/** Destructor. */
|
||||
~QProblemB( );
|
||||
|
||||
/** Assignment operator (deep copy). */
|
||||
QProblemB& operator=( const QProblemB& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
|
||||
/** Clears all data structures of QProblemB except for QP data.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_RESET_FAILED */
|
||||
returnValue reset( );
|
||||
|
||||
|
||||
/** Initialises a QProblemB with given QP data and solves it
|
||||
* using an initial homotopy with empty working set (at most nWSR iterations).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INIT_FAILED \n
|
||||
RET_INIT_FAILED_CHOLESKY \n
|
||||
RET_INIT_FAILED_HOTSTART \n
|
||||
RET_INIT_FAILED_INFEASIBILITY \n
|
||||
RET_INIT_FAILED_UNBOUNDEDNESS \n
|
||||
RET_MAX_NWSR_REACHED \n
|
||||
RET_INVALID_ARGUMENTS \n
|
||||
RET_INACCURATE_SOLUTION \n
|
||||
RET_NO_SOLUTION */
|
||||
returnValue init( const real_t* const _H, /**< Hessian matrix. */
|
||||
const real_t* const _g, /**< Gradient vector. */
|
||||
const real_t* const _lb, /**< Lower bounds (on variables). \n
|
||||
If no lower bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const _ub, /**< Upper bounds (on variables). \n
|
||||
If no upper bounds exist, a NULL pointer can be passed. */
|
||||
int& nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. \n
|
||||
Output: Number of performed working set recalculations. */
|
||||
const real_t* const yOpt = 0, /**< Initial guess for dual solution vector. */
|
||||
real_t* const cputime = 0 /**< Output: CPU time required to initialise QP. */
|
||||
);
|
||||
|
||||
|
||||
/** Initialises a QProblemB with given QP data and solves it
|
||||
* using an initial homotopy with empty working set (at most nWSR iterations).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INIT_FAILED \n
|
||||
RET_INIT_FAILED_CHOLESKY \n
|
||||
RET_INIT_FAILED_HOTSTART \n
|
||||
RET_INIT_FAILED_INFEASIBILITY \n
|
||||
RET_INIT_FAILED_UNBOUNDEDNESS \n
|
||||
RET_MAX_NWSR_REACHED \n
|
||||
RET_INVALID_ARGUMENTS \n
|
||||
RET_INACCURATE_SOLUTION \n
|
||||
RET_NO_SOLUTION */
|
||||
returnValue init( const real_t* const _H, /**< Hessian matrix. */
|
||||
const real_t* const _R, /**< Cholesky factorization of the Hessian matrix. */
|
||||
const real_t* const _g, /**< Gradient vector. */
|
||||
const real_t* const _lb, /**< Lower bounds (on variables). \n
|
||||
If no lower bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const _ub, /**< Upper bounds (on variables). \n
|
||||
If no upper bounds exist, a NULL pointer can be passed. */
|
||||
int& nWSR, /**< Input: Maximum number of working set recalculations when using initial homotopy. \n
|
||||
Output: Number of performed working set recalculations. */
|
||||
const real_t* const yOpt = 0, /**< Initial guess for dual solution vector. */
|
||||
real_t* const cputime = 0 /**< Output: CPU time required to initialise QP. */
|
||||
);
|
||||
|
||||
|
||||
/** Solves an initialised QProblemB using online active set strategy.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_MAX_NWSR_REACHED \n
|
||||
RET_HOTSTART_FAILED_AS_QP_NOT_INITIALISED \n
|
||||
RET_HOTSTART_FAILED \n
|
||||
RET_SHIFT_DETERMINATION_FAILED \n
|
||||
RET_STEPDIRECTION_DETERMINATION_FAILED \n
|
||||
RET_STEPLENGTH_DETERMINATION_FAILED \n
|
||||
RET_HOMOTOPY_STEP_FAILED \n
|
||||
RET_HOTSTART_STOPPED_INFEASIBILITY \n
|
||||
RET_HOTSTART_STOPPED_UNBOUNDEDNESS \n
|
||||
RET_INACCURATE_SOLUTION \n
|
||||
RET_NO_SOLUTION */
|
||||
returnValue hotstart( const real_t* const g_new, /**< Gradient of neighbouring QP to be solved. */
|
||||
const real_t* const lb_new, /**< Lower bounds of neighbouring QP to be solved. \n
|
||||
If no lower bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const ub_new, /**< Upper bounds of neighbouring QP to be solved. \n
|
||||
If no upper bounds exist, a NULL pointer can be passed. */
|
||||
int& nWSR, /**< Input: Maximum number of working set recalculations; \n
|
||||
Output: Number of performed working set recalculations. */
|
||||
real_t* const cputime /**< Output: CPU time required to solve QP (or to perform nWSR iterations). */
|
||||
);
|
||||
|
||||
|
||||
/** Returns Hessian matrix of the QP (deep copy).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue getH( real_t* const _H /**< Array of appropriate dimension for copying Hessian matrix.*/
|
||||
) const;
|
||||
|
||||
/** Returns gradient vector of the QP (deep copy).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue getG( real_t* const _g /**< Array of appropriate dimension for copying gradient vector.*/
|
||||
) const;
|
||||
|
||||
/** Returns lower bound vector of the QP (deep copy).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue getLB( real_t* const _lb /**< Array of appropriate dimension for copying lower bound vector.*/
|
||||
) const;
|
||||
|
||||
/** Returns single entry of lower bound vector of the QP.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
inline returnValue getLB( int number, /**< Number of entry to be returned. */
|
||||
real_t& value /**< Output: lb[number].*/
|
||||
) const;
|
||||
|
||||
/** Returns upper bound vector of the QP (deep copy).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue getUB( real_t* const _ub /**< Array of appropriate dimension for copying upper bound vector.*/
|
||||
) const;
|
||||
|
||||
/** Returns single entry of upper bound vector of the QP.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
inline returnValue getUB( int number, /**< Number of entry to be returned. */
|
||||
real_t& value /**< Output: ub[number].*/
|
||||
) const;
|
||||
|
||||
|
||||
/** Returns current bounds object of the QP (deep copy).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue getBounds( Bounds* const _bounds /** Output: Bounds object. */
|
||||
) const;
|
||||
|
||||
|
||||
/** Returns the number of variables.
|
||||
* \return Number of variables. */
|
||||
inline int getNV( ) const;
|
||||
|
||||
/** Returns the number of free variables.
|
||||
* \return Number of free variables. */
|
||||
inline int getNFR( );
|
||||
|
||||
/** Returns the number of fixed variables.
|
||||
* \return Number of fixed variables. */
|
||||
inline int getNFX( );
|
||||
|
||||
/** Returns the number of implicitly fixed variables.
|
||||
* \return Number of implicitly fixed variables. */
|
||||
inline int getNFV( ) const;
|
||||
|
||||
/** Returns the dimension of null space.
|
||||
* \return Dimension of null space. */
|
||||
int getNZ( );
|
||||
|
||||
|
||||
/** Returns the optimal objective function value.
|
||||
* \return finite value: Optimal objective function value (QP was solved) \n
|
||||
+infinity: QP was not yet solved */
|
||||
real_t getObjVal( ) const;
|
||||
|
||||
/** Returns the objective function value at an arbitrary point x.
|
||||
* \return Objective function value at point x */
|
||||
real_t getObjVal( const real_t* const _x /**< Point at which the objective function shall be evaluated. */
|
||||
) const;
|
||||
|
||||
/** Returns the primal solution vector.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_QP_NOT_SOLVED */
|
||||
returnValue getPrimalSolution( real_t* const xOpt /**< Output: Primal solution vector (if QP has been solved). */
|
||||
) const;
|
||||
|
||||
/** Returns the dual solution vector.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_QP_NOT_SOLVED */
|
||||
returnValue getDualSolution( real_t* const yOpt /**< Output: Dual solution vector (if QP has been solved). */
|
||||
) const;
|
||||
|
||||
|
||||
/** Returns status of the solution process.
|
||||
* \return Status of solution process. */
|
||||
inline QProblemStatus getStatus( ) const;
|
||||
|
||||
|
||||
/** Returns if the QProblem object is initialised.
|
||||
* \return BT_TRUE: QProblemB initialised \n
|
||||
BT_FALSE: QProblemB not initialised */
|
||||
inline BooleanType isInitialised( ) const;
|
||||
|
||||
/** Returns if the QP has been solved.
|
||||
* \return BT_TRUE: QProblemB solved \n
|
||||
BT_FALSE: QProblemB not solved */
|
||||
inline BooleanType isSolved( ) const;
|
||||
|
||||
/** Returns if the QP is infeasible.
|
||||
* \return BT_TRUE: QP infeasible \n
|
||||
BT_FALSE: QP feasible (or not known to be infeasible!) */
|
||||
inline BooleanType isInfeasible( ) const;
|
||||
|
||||
/** Returns if the QP is unbounded.
|
||||
* \return BT_TRUE: QP unbounded \n
|
||||
BT_FALSE: QP unbounded (or not known to be unbounded!) */
|
||||
inline BooleanType isUnbounded( ) const;
|
||||
|
||||
|
||||
/** Returns the print level.
|
||||
* \return Print level. */
|
||||
inline PrintLevel getPrintLevel( ) const;
|
||||
|
||||
/** Changes the print level.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue setPrintLevel( PrintLevel _printlevel /**< New print level. */
|
||||
);
|
||||
|
||||
|
||||
/** Returns Hessian type flag (type is not determined due to this call!).
|
||||
* \return Hessian type. */
|
||||
inline HessianType getHessianType( ) const;
|
||||
|
||||
/** Changes the print level.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setHessianType( HessianType _hessianType /**< New Hessian type. */
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* PROTECTED MEMBER FUNCTIONS
|
||||
*/
|
||||
protected:
|
||||
/** Checks if Hessian happens to be the identity matrix,
|
||||
* and sets corresponding status flag (otherwise the flag remains unaltered!).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue checkForIdentityHessian( );
|
||||
|
||||
/** Determines type of constraints and bounds (i.e. implicitly fixed, unbounded etc.).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_SETUPSUBJECTTOTYPE_FAILED */
|
||||
returnValue setupSubjectToType( );
|
||||
|
||||
/** Computes the Cholesky decomposition R of the (simply projected) Hessian (i.e. R^T*R = Z^T*H*Z).
|
||||
* It only works in the case where Z is a simple projection matrix!
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
* RET_INDEXLIST_CORRUPTED */
|
||||
returnValue setupCholeskyDecomposition( );
|
||||
|
||||
|
||||
/** Solves a QProblemB whose QP data is assumed to be stored in the member variables.
|
||||
* A guess for its primal/dual optimal solution vectors and the corresponding
|
||||
* optimal working set can be provided.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INIT_FAILED \n
|
||||
RET_INIT_FAILED_CHOLESKY \n
|
||||
RET_INIT_FAILED_HOTSTART \n
|
||||
RET_INIT_FAILED_INFEASIBILITY \n
|
||||
RET_INIT_FAILED_UNBOUNDEDNESS \n
|
||||
RET_MAX_NWSR_REACHED */
|
||||
returnValue solveInitialQP( const real_t* const xOpt, /**< Optimal primal solution vector.
|
||||
* A NULL pointer can be passed. */
|
||||
const real_t* const yOpt, /**< Optimal dual solution vector.
|
||||
* A NULL pointer can be passed. */
|
||||
const Bounds* const guessedBounds, /**< Guessed working set for solution (xOpt,yOpt).
|
||||
* A NULL pointer can be passed. */
|
||||
int& nWSR, /**< Input: Maximum number of working set recalculations; \n
|
||||
* Output: Number of performed working set recalculations. */
|
||||
real_t* const cputime /**< Output: CPU time required to solve QP (or to perform nWSR iterations). */
|
||||
);
|
||||
|
||||
|
||||
/** Obtains the desired working set for the auxiliary initial QP in
|
||||
* accordance with the user specifications
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_OBTAINING_WORKINGSET_FAILED \n
|
||||
RET_INVALID_ARGUMENTS */
|
||||
returnValue obtainAuxiliaryWorkingSet( const real_t* const xOpt, /**< Optimal primal solution vector.
|
||||
* If a NULL pointer is passed, all entries are assumed to be zero. */
|
||||
const real_t* const yOpt, /**< Optimal dual solution vector.
|
||||
* If a NULL pointer is passed, all entries are assumed to be zero. */
|
||||
const Bounds* const guessedBounds, /**< Guessed working set for solution (xOpt,yOpt). */
|
||||
Bounds* auxiliaryBounds /**< Input: Allocated bound object. \n
|
||||
* Ouput: Working set for auxiliary QP. */
|
||||
) const;
|
||||
|
||||
/** Setups bound data structure according to auxiliaryBounds.
|
||||
* (If the working set shall be setup afresh, make sure that
|
||||
* bounds data structure has been resetted!)
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_SETUP_WORKINGSET_FAILED \n
|
||||
RET_INVALID_ARGUMENTS \n
|
||||
RET_UNKNOWN BUG */
|
||||
returnValue setupAuxiliaryWorkingSet( const Bounds* const auxiliaryBounds, /**< Working set for auxiliary QP. */
|
||||
BooleanType setupAfresh /**< Flag indicating if given working set shall be
|
||||
* setup afresh or by updating the current one. */
|
||||
);
|
||||
|
||||
/** Setups the optimal primal/dual solution of the auxiliary initial QP.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue setupAuxiliaryQPsolution( const real_t* const xOpt, /**< Optimal primal solution vector.
|
||||
* If a NULL pointer is passed, all entries are set to zero. */
|
||||
const real_t* const yOpt /**< Optimal dual solution vector.
|
||||
* If a NULL pointer is passed, all entries are set to zero. */
|
||||
);
|
||||
|
||||
/** Setups gradient of the auxiliary initial QP for given
|
||||
* optimal primal/dual solution and given initial working set
|
||||
* (assumes that members X, Y and BOUNDS have already been initialised!).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue setupAuxiliaryQPgradient( );
|
||||
|
||||
/** Setups bounds of the auxiliary initial QP for given
|
||||
* optimal primal/dual solution and given initial working set
|
||||
* (assumes that members X, Y and BOUNDS have already been initialised!).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_UNKNOWN BUG */
|
||||
returnValue setupAuxiliaryQPbounds( BooleanType useRelaxation /**< Flag indicating if inactive bounds shall be relaxed. */
|
||||
);
|
||||
|
||||
|
||||
/** Adds a bound to active set (specialised version for the case where no constraints exist).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_ADDBOUND_FAILED */
|
||||
returnValue addBound( int number, /**< Number of bound to be added to active set. */
|
||||
SubjectToStatus B_status, /**< Status of new active bound. */
|
||||
BooleanType updateCholesky /**< Flag indicating if Cholesky decomposition shall be updated. */
|
||||
);
|
||||
|
||||
/** Removes a bounds from active set (specialised version for the case where no constraints exist).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_HESSIAN_NOT_SPD \n
|
||||
RET_REMOVEBOUND_FAILED */
|
||||
returnValue removeBound( int number, /**< Number of bound to be removed from active set. */
|
||||
BooleanType updateCholesky /**< Flag indicating if Cholesky decomposition shall be updated. */
|
||||
);
|
||||
|
||||
|
||||
/** Solves the system Ra = b or R^Ta = b where R is an upper triangular matrix.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_DIV_BY_ZERO */
|
||||
returnValue backsolveR( const real_t* const b, /**< Right hand side vector. */
|
||||
BooleanType transposed, /**< Indicates if the transposed system shall be solved. */
|
||||
real_t* const a /**< Output: Solution vector */
|
||||
);
|
||||
|
||||
/** Solves the system Ra = b or R^Ta = b where R is an upper triangular matrix. \n
|
||||
* Special variant for the case that this function is called from within "removeBound()".
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_DIV_BY_ZERO */
|
||||
returnValue backsolveR( const real_t* const b, /**< Right hand side vector. */
|
||||
BooleanType transposed, /**< Indicates if the transposed system shall be solved. */
|
||||
BooleanType removingBound, /**< Indicates if function is called from "removeBound()". */
|
||||
real_t* const a /**< Output: Solution vector */
|
||||
);
|
||||
|
||||
|
||||
/** Determines step direction of the shift of the QP data.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue hotstart_determineDataShift(const int* const FX_idx, /**< Index array of fixed variables. */
|
||||
const real_t* const g_new, /**< New gradient vector. */
|
||||
const real_t* const lb_new, /**< New lower bounds. */
|
||||
const real_t* const ub_new, /**< New upper bounds. */
|
||||
real_t* const delta_g, /**< Output: Step direction of gradient vector. */
|
||||
real_t* const delta_lb, /**< Output: Step direction of lower bounds. */
|
||||
real_t* const delta_ub, /**< Output: Step direction of upper bounds. */
|
||||
BooleanType& Delta_bB_isZero/**< Output: Indicates if active bounds are to be shifted. */
|
||||
);
|
||||
|
||||
|
||||
/** Checks if lower/upper bounds remain consistent
|
||||
* (i.e. if lb <= ub) during the current step.
|
||||
* \return BT_TRUE iff bounds remain consistent
|
||||
*/
|
||||
BooleanType areBoundsConsistent( const real_t* const delta_lb, /**< Step direction of lower bounds. */
|
||||
const real_t* const delta_ub /**< Step direction of upper bounds. */
|
||||
) const;
|
||||
|
||||
|
||||
/** Setups internal QP data.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INVALID_ARGUMENTS */
|
||||
returnValue setupQPdata( const real_t* const _H, /**< Hessian matrix. */
|
||||
const real_t* const _R, /**< Cholesky factorization of the Hessian matrix. */
|
||||
const real_t* const _g, /**< Gradient vector. */
|
||||
const real_t* const _lb, /**< Lower bounds (on variables). \n
|
||||
If no lower bounds exist, a NULL pointer can be passed. */
|
||||
const real_t* const _ub /**< Upper bounds (on variables). \n
|
||||
If no upper bounds exist, a NULL pointer can be passed. */
|
||||
);
|
||||
|
||||
|
||||
/** Sets Hessian matrix of the QP.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setH( const real_t* const H_new /**< New Hessian matrix (with correct dimension!). */
|
||||
);
|
||||
|
||||
/** Changes gradient vector of the QP.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setG( const real_t* const g_new /**< New gradient vector (with correct dimension!). */
|
||||
);
|
||||
|
||||
/** Changes lower bound vector of the QP.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setLB( const real_t* const lb_new /**< New lower bound vector (with correct dimension!). */
|
||||
);
|
||||
|
||||
/** Changes single entry of lower bound vector of the QP.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
inline returnValue setLB( int number, /**< Number of entry to be changed. */
|
||||
real_t value /**< New value for entry of lower bound vector. */
|
||||
);
|
||||
|
||||
/** Changes upper bound vector of the QP.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline returnValue setUB( const real_t* const ub_new /**< New upper bound vector (with correct dimension!). */
|
||||
);
|
||||
|
||||
/** Changes single entry of upper bound vector of the QP.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
inline returnValue setUB( int number, /**< Number of entry to be changed. */
|
||||
real_t value /**< New value for entry of upper bound vector. */
|
||||
);
|
||||
|
||||
|
||||
/** Computes parameters for the Givens matrix G for which [x,y]*G = [z,0]
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline void computeGivens( real_t xold, /**< Matrix entry to be normalised. */
|
||||
real_t yold, /**< Matrix entry to be annihilated. */
|
||||
real_t& xnew, /**< Output: Normalised matrix entry. */
|
||||
real_t& ynew, /**< Output: Annihilated matrix entry. */
|
||||
real_t& c, /**< Output: Cosine entry of Givens matrix. */
|
||||
real_t& s /**< Output: Sine entry of Givens matrix. */
|
||||
) const;
|
||||
|
||||
/** Applies Givens matrix determined by c and s (cf. computeGivens).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
inline void applyGivens( real_t c, /**< Cosine entry of Givens matrix. */
|
||||
real_t s, /**< Sine entry of Givens matrix. */
|
||||
real_t xold, /**< Matrix entry to be transformed corresponding to
|
||||
* the normalised entry of the original matrix. */
|
||||
real_t yold, /**< Matrix entry to be transformed corresponding to
|
||||
* the annihilated entry of the original matrix. */
|
||||
real_t& xnew, /**< Output: Transformed matrix entry corresponding to
|
||||
* the normalised entry of the original matrix. */
|
||||
real_t& ynew /**< Output: Transformed matrix entry corresponding to
|
||||
* the annihilated entry of the original matrix. */
|
||||
) const;
|
||||
|
||||
|
||||
/*
|
||||
* PRIVATE MEMBER FUNCTIONS
|
||||
*/
|
||||
private:
|
||||
/** Determines step direction of the homotopy path.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_STEPDIRECTION_FAILED_CHOLESKY */
|
||||
returnValue hotstart_determineStepDirection(const int* const FR_idx, /**< Index array of free variables. */
|
||||
const int* const FX_idx, /**< Index array of fixed variables. */
|
||||
const real_t* const delta_g, /**< Step direction of gradient vector. */
|
||||
const real_t* const delta_lb, /**< Step direction of lower bounds. */
|
||||
const real_t* const delta_ub, /**< Step direction of upper bounds. */
|
||||
BooleanType Delta_bB_isZero, /**< Indicates if active bounds are to be shifted. */
|
||||
real_t* const delta_xFX, /**< Output: Primal homotopy step direction of fixed variables. */
|
||||
real_t* const delta_xFR, /**< Output: Primal homotopy step direction of free variables. */
|
||||
real_t* const delta_yFX /**< Output: Dual homotopy step direction of fixed variables' multiplier. */
|
||||
);
|
||||
|
||||
/** Determines the maximum possible step length along the homotopy path.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue hotstart_determineStepLength( const int* const FR_idx, /**< Index array of free variables. */
|
||||
const int* const FX_idx, /**< Index array of fixed variables. */
|
||||
const real_t* const delta_lb, /**< Step direction of lower bounds. */
|
||||
const real_t* const delta_ub, /**< Step direction of upper bounds. */
|
||||
const real_t* const delta_xFR, /**< Primal homotopy step direction of free variables. */
|
||||
const real_t* const delta_yFX, /**< Dual homotopy step direction of fixed variables' multiplier. */
|
||||
int& BC_idx, /**< Output: Index of blocking constraint. */
|
||||
SubjectToStatus& BC_status /**< Output: Status of blocking constraint. */
|
||||
);
|
||||
|
||||
/** Performs a step along the homotopy path (and updates active set).
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_OPTIMAL_SOLUTION_FOUND \n
|
||||
RET_REMOVE_FROM_ACTIVESET_FAILED \n
|
||||
RET_ADD_TO_ACTIVESET_FAILED \n
|
||||
RET_QP_INFEASIBLE */
|
||||
returnValue hotstart_performStep( const int* const FR_idx, /**< Index array of free variables. */
|
||||
const int* const FX_idx, /**< Index array of fixed variables. */
|
||||
const real_t* const delta_g, /**< Step direction of gradient vector. */
|
||||
const real_t* const delta_lb, /**< Step direction of lower bounds. */
|
||||
const real_t* const delta_ub, /**< Step direction of upper bounds. */
|
||||
const real_t* const delta_xFX, /**< Primal homotopy step direction of fixed variables. */
|
||||
const real_t* const delta_xFR, /**< Primal homotopy step direction of free variables. */
|
||||
const real_t* const delta_yFX, /**< Dual homotopy step direction of fixed variables' multiplier. */
|
||||
int BC_idx, /**< Index of blocking constraint. */
|
||||
SubjectToStatus BC_status /**< Status of blocking constraint. */
|
||||
);
|
||||
|
||||
|
||||
#ifdef PC_DEBUG /* Define print functions only for debugging! */
|
||||
|
||||
/** Prints concise information on the current iteration.
|
||||
* \return SUCCESSFUL_RETURN \n */
|
||||
returnValue printIteration( int iteration, /**< Number of current iteration. */
|
||||
int BC_idx, /**< Index of blocking bound. */
|
||||
SubjectToStatus BC_status /**< Status of blocking bound. */
|
||||
);
|
||||
|
||||
#endif /* PC_DEBUG */
|
||||
|
||||
|
||||
/** Determines the maximum violation of the KKT optimality conditions
|
||||
* of the current iterate within the QProblemB object.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
* RET_INACCURATE_SOLUTION \n
|
||||
* RET_NO_SOLUTION */
|
||||
returnValue checkKKTconditions( );
|
||||
|
||||
|
||||
/*
|
||||
* PROTECTED MEMBER VARIABLES
|
||||
*/
|
||||
protected:
|
||||
real_t H[NVMAX*NVMAX]; /**< Hessian matrix. */
|
||||
BooleanType hasHessian; /**< Flag indicating whether H contains Hessian or corresponding Cholesky factor R; \sa init. */
|
||||
|
||||
real_t g[NVMAX]; /**< Gradient. */
|
||||
real_t lb[NVMAX]; /**< Lower bound vector (on variables). */
|
||||
real_t ub[NVMAX]; /**< Upper bound vector (on variables). */
|
||||
|
||||
Bounds bounds; /**< Data structure for problem's bounds. */
|
||||
|
||||
real_t R[NVMAX*NVMAX]; /**< Cholesky decomposition of H (i.e. H = R^T*R). */
|
||||
BooleanType hasCholesky; /**< Flag indicating whether Cholesky decomposition has already been setup. */
|
||||
|
||||
real_t x[NVMAX]; /**< Primal solution vector. */
|
||||
real_t y[NVMAX+NCMAX]; /**< Dual solution vector. */
|
||||
|
||||
real_t tau; /**< Last homotopy step length. */
|
||||
|
||||
QProblemStatus status; /**< Current status of the solution process. */
|
||||
|
||||
BooleanType infeasible; /**< QP infeasible? */
|
||||
BooleanType unbounded; /**< QP unbounded? */
|
||||
|
||||
HessianType hessianType; /**< Type of Hessian matrix. */
|
||||
|
||||
PrintLevel printlevel; /**< Print level. */
|
||||
|
||||
int count; /**< Counts the number of hotstart function calls (internal usage only!). */
|
||||
};
|
||||
|
||||
|
||||
#include <QProblemB.ipp>
|
||||
|
||||
#endif /* QPOASES_QPROBLEMB_HPP */
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,178 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file INCLUDE/SubjectTo.hpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Declaration of the SubjectTo class designed to manage working sets of
|
||||
* constraints and bounds within a QProblem.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef QPOASES_SUBJECTTO_HPP
|
||||
#define QPOASES_SUBJECTTO_HPP
|
||||
|
||||
|
||||
#include <Indexlist.hpp>
|
||||
|
||||
|
||||
|
||||
/** This class manages working sets of constraints and bounds by storing
|
||||
* index sets and other status information.
|
||||
*
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*/
|
||||
class SubjectTo
|
||||
{
|
||||
/*
|
||||
* PUBLIC MEMBER FUNCTIONS
|
||||
*/
|
||||
public:
|
||||
/** Default constructor. */
|
||||
SubjectTo( );
|
||||
|
||||
/** Copy constructor (deep copy). */
|
||||
SubjectTo( const SubjectTo& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
/** Destructor. */
|
||||
~SubjectTo( );
|
||||
|
||||
/** Assignment operator (deep copy). */
|
||||
SubjectTo& operator=( const SubjectTo& rhs /**< Rhs object. */
|
||||
);
|
||||
|
||||
|
||||
/** Pseudo-constructor takes the number of constraints or bounds.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue init( int n /**< Number of constraints or bounds. */
|
||||
);
|
||||
|
||||
|
||||
/** Returns type of (constraints') bound.
|
||||
* \return Type of (constraints') bound \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
inline SubjectToType getType( int i /**< Number of (constraints') bound. */
|
||||
) const ;
|
||||
|
||||
/** Returns status of (constraints') bound.
|
||||
* \return Status of (constraints') bound \n
|
||||
ST_UNDEFINED */
|
||||
inline SubjectToStatus getStatus( int i /**< Number of (constraints') bound. */
|
||||
) const;
|
||||
|
||||
|
||||
/** Sets type of (constraints') bound.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
inline returnValue setType( int i, /**< Number of (constraints') bound. */
|
||||
SubjectToType value /**< Type of (constraints') bound. */
|
||||
);
|
||||
|
||||
/** Sets status of (constraints') bound.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_INDEX_OUT_OF_BOUNDS */
|
||||
inline returnValue setStatus( int i, /**< Number of (constraints') bound. */
|
||||
SubjectToStatus value /**< Status of (constraints') bound. */
|
||||
);
|
||||
|
||||
|
||||
/** Sets status of lower (constraints') bounds. */
|
||||
inline void setNoLower( BooleanType _status /**< Status of lower (constraints') bounds. */
|
||||
);
|
||||
|
||||
/** Sets status of upper (constraints') bounds. */
|
||||
inline void setNoUpper( BooleanType _status /**< Status of upper (constraints') bounds. */
|
||||
);
|
||||
|
||||
|
||||
/** Returns status of lower (constraints') bounds.
|
||||
* \return BT_TRUE if there is no lower (constraints') bound on any variable. */
|
||||
inline BooleanType isNoLower( ) const;
|
||||
|
||||
/** Returns status of upper bounds.
|
||||
* \return BT_TRUE if there is no upper (constraints') bound on any variable. */
|
||||
inline BooleanType isNoUpper( ) const;
|
||||
|
||||
|
||||
/*
|
||||
* PROTECTED MEMBER FUNCTIONS
|
||||
*/
|
||||
protected:
|
||||
/** Adds the index of a new constraint or bound to index set.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_ADDINDEX_FAILED */
|
||||
returnValue addIndex( Indexlist* const indexlist, /**< Index list to which the new index shall be added. */
|
||||
int newnumber, /**< Number of new constraint or bound. */
|
||||
SubjectToStatus newstatus /**< Status of new constraint or bound. */
|
||||
);
|
||||
|
||||
/** Removes the index of a constraint or bound from index set.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_UNKNOWN_BUG */
|
||||
returnValue removeIndex( Indexlist* const indexlist, /**< Index list from which the new index shall be removed. */
|
||||
int removenumber /**< Number of constraint or bound to be removed. */
|
||||
);
|
||||
|
||||
/** Swaps the indices of two constraints or bounds within the index set.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_SWAPINDEX_FAILED */
|
||||
returnValue swapIndex( Indexlist* const indexlist, /**< Index list in which the indices shold be swapped. */
|
||||
int number1, /**< Number of first constraint or bound. */
|
||||
int number2 /**< Number of second constraint or bound. */
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* PROTECTED MEMBER VARIABLES
|
||||
*/
|
||||
protected:
|
||||
SubjectToType type[NVMAX+NCMAX]; /**< Type of constraints/bounds. */
|
||||
SubjectToStatus status[NVMAX+NCMAX]; /**< Status of constraints/bounds. */
|
||||
|
||||
BooleanType noLower; /**< This flag indicates if there is no lower bound on any variable. */
|
||||
BooleanType noUpper; /**< This flag indicates if there is no upper bound on any variable. */
|
||||
|
||||
|
||||
/*
|
||||
* PRIVATE MEMBER VARIABLES
|
||||
*/
|
||||
private:
|
||||
int size;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#include <SubjectTo.ipp>
|
||||
|
||||
#endif /* QPOASES_SUBJECTTO_HPP */
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,131 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file INCLUDE/Types.hpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2008
|
||||
*
|
||||
* Declaration of all non-built-in types (except for classes).
|
||||
*/
|
||||
|
||||
|
||||
#ifndef QPOASES_TYPES_HPP
|
||||
#define QPOASES_TYPES_HPP
|
||||
|
||||
|
||||
|
||||
/** Define real_t for facilitating switching between double and float. */
|
||||
// typedef double real_t;
|
||||
|
||||
|
||||
/** Summarises all possible logical values. */
|
||||
enum BooleanType
|
||||
{
|
||||
BT_FALSE, /**< Logical value for "false". */
|
||||
BT_TRUE /**< Logical value for "true". */
|
||||
};
|
||||
|
||||
|
||||
/** Summarises all possible print levels. Print levels are used to describe
|
||||
* the desired amount of output during runtime of qpOASES. */
|
||||
enum PrintLevel
|
||||
{
|
||||
PL_NONE, /**< No output. */
|
||||
PL_LOW, /**< Print error messages only. */
|
||||
PL_MEDIUM, /**< Print error and warning messages as well as concise info messages. */
|
||||
PL_HIGH /**< Print all messages with full details. */
|
||||
};
|
||||
|
||||
|
||||
/** Defines visibility status of a message. */
|
||||
enum VisibilityStatus
|
||||
{
|
||||
VS_VISIBLE, /**< Message visible. */
|
||||
VS_HIDDEN /**< Message not visible. */
|
||||
};
|
||||
|
||||
|
||||
/** Summarises all possible states of the (S)QProblem(B) object during the
|
||||
solution process of a QP sequence. */
|
||||
enum QProblemStatus
|
||||
{
|
||||
QPS_NOTINITIALISED, /**< QProblem object is freshly instantiated or reset. */
|
||||
QPS_PREPARINGAUXILIARYQP, /**< An auxiliary problem is currently setup, either at the very beginning
|
||||
* via an initial homotopy or after changing the QP matrices. */
|
||||
QPS_AUXILIARYQPSOLVED, /**< An auxilary problem was solved, either at the very beginning
|
||||
* via an initial homotopy or after changing the QP matrices. */
|
||||
QPS_PERFORMINGHOMOTOPY, /**< A homotopy according to the main idea of the online active
|
||||
* set strategy is performed. */
|
||||
QPS_HOMOTOPYQPSOLVED, /**< An intermediate QP along the homotopy path was solved. */
|
||||
QPS_SOLVED /**< The solution of the actual QP was found. */
|
||||
};
|
||||
|
||||
|
||||
/** Summarises all possible types of bounds and constraints. */
|
||||
enum SubjectToType
|
||||
{
|
||||
ST_UNBOUNDED, /**< Bound/constraint is unbounded. */
|
||||
ST_BOUNDED, /**< Bound/constraint is bounded but not fixed. */
|
||||
ST_EQUALITY, /**< Bound/constraint is fixed (implicit equality bound/constraint). */
|
||||
ST_UNKNOWN /**< Type of bound/constraint unknown. */
|
||||
};
|
||||
|
||||
|
||||
/** Summarises all possible states of bounds and constraints. */
|
||||
enum SubjectToStatus
|
||||
{
|
||||
ST_INACTIVE, /**< Bound/constraint is inactive. */
|
||||
ST_LOWER, /**< Bound/constraint is at its lower bound. */
|
||||
ST_UPPER, /**< Bound/constraint is at its upper bound. */
|
||||
ST_UNDEFINED /**< Status of bound/constraint undefined. */
|
||||
};
|
||||
|
||||
|
||||
/** Summarises all possible cycling states of bounds and constraints. */
|
||||
enum CyclingStatus
|
||||
{
|
||||
CYC_NOT_INVOLVED, /**< Bound/constraint is not involved in current cycling. */
|
||||
CYC_PREV_ADDED, /**< Bound/constraint has previously been added during the current cycling. */
|
||||
CYC_PREV_REMOVED /**< Bound/constraint has previously been removed during the current cycling. */
|
||||
};
|
||||
|
||||
|
||||
/** Summarises all possible types of the QP's Hessian matrix. */
|
||||
enum HessianType
|
||||
{
|
||||
HST_SEMIDEF, /**< Hessian is positive semi-definite. */
|
||||
HST_POSDEF_NULLSPACE, /**< Hessian is positive definite on null space of active bounds/constraints. */
|
||||
HST_POSDEF, /**< Hessian is (strictly) positive definite. */
|
||||
HST_IDENTITY /**< Hessian is identity matrix. */
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* QPOASES_TYPES_HPP */
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,197 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file INCLUDE/Utils.hpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Declaration of global utility functions for working with qpOASES.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef QPOASES_UTILS_HPP
|
||||
#define QPOASES_UTILS_HPP
|
||||
|
||||
|
||||
#include <MessageHandling.hpp>
|
||||
|
||||
|
||||
#ifdef PC_DEBUG /* Define print functions only for debugging! */
|
||||
|
||||
/** Prints a vector.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue print( const real_t* const v, /**< Vector to be printed. */
|
||||
int n /**< Length of vector. */
|
||||
);
|
||||
|
||||
/** Prints a permuted vector.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue print( const real_t* const v, /**< Vector to be printed. */
|
||||
int n, /**< Length of vector. */
|
||||
const int* const V_idx /**< Pemutation vector. */
|
||||
);
|
||||
|
||||
/** Prints a named vector.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue print( const real_t* const v, /**< Vector to be printed. */
|
||||
int n, /**< Length of vector. */
|
||||
const char* name /** Name of vector. */
|
||||
);
|
||||
|
||||
/** Prints a matrix.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue print( const real_t* const M, /**< Matrix to be printed. */
|
||||
int nrow, /**< Row number of matrix. */
|
||||
int ncol /**< Column number of matrix. */
|
||||
);
|
||||
|
||||
/** Prints a permuted matrix.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue print( const real_t* const M, /**< Matrix to be printed. */
|
||||
int nrow, /**< Row number of matrix. */
|
||||
int ncol , /**< Column number of matrix. */
|
||||
const int* const ROW_idx, /**< Row pemutation vector. */
|
||||
const int* const COL_idx /**< Column pemutation vector. */
|
||||
);
|
||||
|
||||
/** Prints a named matrix.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue print( const real_t* const M, /**< Matrix to be printed. */
|
||||
int nrow, /**< Row number of matrix. */
|
||||
int ncol, /**< Column number of matrix. */
|
||||
const char* name /** Name of matrix. */
|
||||
);
|
||||
|
||||
/** Prints an index array.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue print( const int* const index, /**< Index array to be printed. */
|
||||
int n /**< Length of index array. */
|
||||
);
|
||||
|
||||
/** Prints a named index array.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue print( const int* const index, /**< Index array to be printed. */
|
||||
int n, /**< Length of index array. */
|
||||
const char* name /**< Name of index array. */
|
||||
);
|
||||
|
||||
|
||||
/** Prints a string to desired output target (useful also for MATLAB output!).
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue myPrintf( const char* s /**< String to be written. */
|
||||
);
|
||||
|
||||
|
||||
/** Prints qpOASES copyright notice.
|
||||
* \return SUCCESSFUL_RETURN */
|
||||
returnValue printCopyrightNotice( );
|
||||
|
||||
|
||||
/** Reads a real_t matrix from file.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_UNABLE_TO_OPEN_FILE \n
|
||||
RET_UNABLE_TO_READ_FILE */
|
||||
returnValue readFromFile( real_t* data, /**< Matrix to be read from file. */
|
||||
int nrow, /**< Row number of matrix. */
|
||||
int ncol, /**< Column number of matrix. */
|
||||
const char* datafilename /**< Data file name. */
|
||||
);
|
||||
|
||||
/** Reads a real_t vector from file.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_UNABLE_TO_OPEN_FILE \n
|
||||
RET_UNABLE_TO_READ_FILE */
|
||||
returnValue readFromFile( real_t* data, /**< Vector to be read from file. */
|
||||
int n, /**< Length of vector. */
|
||||
const char* datafilename /**< Data file name. */
|
||||
);
|
||||
|
||||
/** Reads an integer (column) vector from file.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_UNABLE_TO_OPEN_FILE \n
|
||||
RET_UNABLE_TO_READ_FILE */
|
||||
returnValue readFromFile( int* data, /**< Vector to be read from file. */
|
||||
int n, /**< Length of vector. */
|
||||
const char* datafilename /**< Data file name. */
|
||||
);
|
||||
|
||||
|
||||
/** Writes a real_t matrix into a file.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_UNABLE_TO_OPEN_FILE */
|
||||
returnValue writeIntoFile( const real_t* const data, /**< Matrix to be written into file. */
|
||||
int nrow, /**< Row number of matrix. */
|
||||
int ncol, /**< Column number of matrix. */
|
||||
const char* datafilename, /**< Data file name. */
|
||||
BooleanType append /**< Indicates if data shall be appended if the file already exists (otherwise it is overwritten). */
|
||||
);
|
||||
|
||||
/** Writes a real_t vector into a file.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_UNABLE_TO_OPEN_FILE */
|
||||
returnValue writeIntoFile( const real_t* const data, /**< Vector to be written into file. */
|
||||
int n, /**< Length of vector. */
|
||||
const char* datafilename, /**< Data file name. */
|
||||
BooleanType append /**< Indicates if data shall be appended if the file already exists (otherwise it is overwritten). */
|
||||
);
|
||||
|
||||
/** Writes an integer (column) vector into a file.
|
||||
* \return SUCCESSFUL_RETURN \n
|
||||
RET_UNABLE_TO_OPEN_FILE */
|
||||
returnValue writeIntoFile( const int* const integer, /**< Integer vector to be written into file. */
|
||||
int n, /**< Length of vector. */
|
||||
const char* datafilename, /**< Data file name. */
|
||||
BooleanType append /**< Indicates if integer shall be appended if the file already exists (otherwise it is overwritten). */
|
||||
);
|
||||
|
||||
#endif /* PC_DEBUG */
|
||||
|
||||
|
||||
/** Returns the current system time.
|
||||
* \return current system time */
|
||||
real_t getCPUtime( );
|
||||
|
||||
|
||||
/** Returns the Euclidean norm of a vector.
|
||||
* \return 0: successful */
|
||||
real_t getNorm( const real_t* const v, /**< Vector. */
|
||||
int n /**< Vector's dimension. */
|
||||
);
|
||||
|
||||
/** Returns the absolute value of a real_t.
|
||||
* \return Absolute value of a real_t */
|
||||
inline real_t getAbs( real_t x /**< Input argument. */
|
||||
);
|
||||
|
||||
|
||||
|
||||
#include <Utils.ipp>
|
||||
|
||||
#endif /* QPOASES_UTILS_HPP */
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,504 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
##
|
||||
## qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
## Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
##
|
||||
## qpOASES is free software; you can redistribute it and/or
|
||||
## modify it under the terms of the GNU Lesser General Public
|
||||
## License as published by the Free Software Foundation; either
|
||||
## version 2.1 of the License, or (at your option) any later version.
|
||||
##
|
||||
## qpOASES is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
## Lesser General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU Lesser General Public
|
||||
## License along with qpOASES; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
##
|
||||
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
=============
|
||||
|
||||
qpOASES is an open-source C++ implementation of the recently proposed
|
||||
online active set strategy (see [1], [2]), which was inspired by important
|
||||
observations from the field of parametric quadratic programming. It has
|
||||
several theoretical features that make it particularly suited for model
|
||||
predictive control (MPC) applications.
|
||||
|
||||
The software package qpOASES implements these ideas and has already been
|
||||
successfully used for closed-loop control of a real-world Diesel engine [3].
|
||||
|
||||
|
||||
References:
|
||||
|
||||
[1] H.J. Ferreau. An Online Active Set Strategy for Fast Solution of
|
||||
Parametric Quadratic Programs with Applications to Predictive Engine Control.
|
||||
Diplom thesis, University of Heidelberg, 2006.
|
||||
|
||||
[2] H.J. Ferreau, H.G. Bock, M. Diehl. An online active set strategy to
|
||||
overcome the limitations of explicit MPC. International Journal of Robust
|
||||
and Nonlinear Control, 18 (8), pp. 816-830, 2008.
|
||||
|
||||
[3] H.J. Ferreau, P. Ortner, P. Langthaler, L. del Re, M. Diehl. Predictive
|
||||
Control of a Real-World Diesel Engine using an Extended Online Active Set
|
||||
Strategy. Annual Reviews in Control, 31 (2), pp. 293-301, 2007.
|
||||
|
||||
|
||||
|
||||
GETTING STARTED
|
||||
================
|
||||
|
||||
1. For installation, usage and additional information on this software package
|
||||
see the qpOASES User's Manual located at ./DOC/manual.pdf!
|
||||
|
||||
|
||||
2. The file ./LICENSE.txt contains a copy of the GNU Lesser General Public
|
||||
License. Please read it carefully before using qpOASES!
|
||||
|
||||
|
||||
3. The whole software package can be downloaded from
|
||||
|
||||
http://homes.esat.kuleuven.be/~optec/software/qpOASES/
|
||||
|
||||
On this webpage you will also find a list of frequently asked questions.
|
||||
|
||||
|
||||
|
||||
CONTACT THE AUTHORS
|
||||
====================
|
||||
|
||||
If you have got questions, remarks or comments on qpOASES
|
||||
please contact the main author:
|
||||
|
||||
Hans Joachim Ferreau
|
||||
Katholieke Universiteit Leuven
|
||||
Department of Electrical Engineering (ESAT)
|
||||
Kasteelpark Arenberg 10, bus 2446
|
||||
B-3001 Leuven-Heverlee, Belgium
|
||||
|
||||
Phone: +32 16 32 03 63
|
||||
E-mail: joachim.ferreau@esat.kuleuven.be
|
||||
qpOASES@esat.kuleuven.be
|
||||
|
||||
Also bug reports and source code extensions are most welcome!
|
||||
|
||||
|
||||
|
||||
##
|
||||
## end of file
|
||||
##
|
||||
@@ -1,16 +0,0 @@
|
||||
Import('env', 'interface_dir')
|
||||
|
||||
qp_files = [
|
||||
Glob("SRC/*.cpp"),
|
||||
Glob("SRC/EXTRAS/*.cpp"),
|
||||
]
|
||||
|
||||
cpp_path = [
|
||||
".",
|
||||
"INCLUDE",
|
||||
"INCLUDE/EXTRAS",
|
||||
"SRC/",
|
||||
interface_dir,
|
||||
]
|
||||
|
||||
env.Library('qpoases', qp_files, CPPPATH=cpp_path)
|
||||
@@ -1,252 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file SRC/Bounds.cpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Implementation of the Bounds class designed to manage working sets of
|
||||
* bounds within a QProblem.
|
||||
*/
|
||||
|
||||
|
||||
#include <Bounds.hpp>
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* P U B L I C *
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* B o u n d s
|
||||
*/
|
||||
Bounds::Bounds( ) : SubjectTo( ),
|
||||
nV( 0 ),
|
||||
nFV( 0 ),
|
||||
nBV( 0 ),
|
||||
nUV( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* B o u n d s
|
||||
*/
|
||||
Bounds::Bounds( const Bounds& rhs ) : SubjectTo( rhs ),
|
||||
nV( rhs.nV ),
|
||||
nFV( rhs.nFV ),
|
||||
nBV( rhs.nBV ),
|
||||
nUV( rhs.nUV )
|
||||
{
|
||||
free = rhs.free;
|
||||
fixed = rhs.fixed;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ~ B o u n d s
|
||||
*/
|
||||
Bounds::~Bounds( )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* o p e r a t o r =
|
||||
*/
|
||||
Bounds& Bounds::operator=( const Bounds& rhs )
|
||||
{
|
||||
if ( this != &rhs )
|
||||
{
|
||||
SubjectTo::operator=( rhs );
|
||||
|
||||
nV = rhs.nV;
|
||||
nFV = rhs.nFV;
|
||||
nBV = rhs.nBV;
|
||||
nUV = rhs.nUV;
|
||||
|
||||
free = rhs.free;
|
||||
fixed = rhs.fixed;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* i n i t
|
||||
*/
|
||||
returnValue Bounds::init( int n )
|
||||
{
|
||||
nV = n;
|
||||
nFV = 0;
|
||||
nBV = 0;
|
||||
nUV = 0;
|
||||
|
||||
free.init( );
|
||||
fixed.init( );
|
||||
|
||||
return SubjectTo::init( n );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* s e t u p B o u n d
|
||||
*/
|
||||
returnValue Bounds::setupBound( int _number, SubjectToStatus _status
|
||||
)
|
||||
{
|
||||
/* consistency check */
|
||||
if ( ( _number < 0 ) || ( _number >= getNV( ) ) )
|
||||
return THROWERROR( RET_INDEX_OUT_OF_BOUNDS );
|
||||
|
||||
/* Add bound index to respective index list. */
|
||||
switch ( _status )
|
||||
{
|
||||
case ST_INACTIVE:
|
||||
if ( this->addIndex( this->getFree( ),_number,_status ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_SETUP_BOUND_FAILED );
|
||||
break;
|
||||
|
||||
case ST_LOWER:
|
||||
if ( this->addIndex( this->getFixed( ),_number,_status ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_SETUP_BOUND_FAILED );
|
||||
break;
|
||||
|
||||
case ST_UPPER:
|
||||
if ( this->addIndex( this->getFixed( ),_number,_status ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_SETUP_BOUND_FAILED );
|
||||
break;
|
||||
|
||||
default:
|
||||
return THROWERROR( RET_INVALID_ARGUMENTS );
|
||||
}
|
||||
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* s e t u p A l l F r e e
|
||||
*/
|
||||
returnValue Bounds::setupAllFree( )
|
||||
{
|
||||
int i;
|
||||
|
||||
/* 1) Place unbounded variables at the beginning of the index list of free variables. */
|
||||
for( i=0; i<nV; ++i )
|
||||
{
|
||||
if ( getType( i ) == ST_UNBOUNDED )
|
||||
{
|
||||
if ( setupBound( i,ST_INACTIVE ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_SETUP_BOUND_FAILED );
|
||||
}
|
||||
}
|
||||
|
||||
/* 2) Add remaining (i.e. bounded but possibly free) variables to the index list of free variables. */
|
||||
for( i=0; i<nV; ++i )
|
||||
{
|
||||
if ( getType( i ) == ST_BOUNDED )
|
||||
{
|
||||
if ( setupBound( i,ST_INACTIVE ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_SETUP_BOUND_FAILED );
|
||||
}
|
||||
}
|
||||
|
||||
/* 3) Place implicitly fixed variables at the end of the index list of free variables. */
|
||||
for( i=0; i<nV; ++i )
|
||||
{
|
||||
if ( getType( i ) == ST_EQUALITY )
|
||||
{
|
||||
if ( setupBound( i,ST_INACTIVE ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_SETUP_BOUND_FAILED );
|
||||
}
|
||||
}
|
||||
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* m o v e F i x e d T o F r e e
|
||||
*/
|
||||
returnValue Bounds::moveFixedToFree( int _number )
|
||||
{
|
||||
/* consistency check */
|
||||
if ( ( _number < 0 ) || ( _number >= getNV( ) ) )
|
||||
return THROWERROR( RET_INDEX_OUT_OF_BOUNDS );
|
||||
|
||||
/* Move index from indexlist of fixed variables to that of free ones. */
|
||||
if ( this->removeIndex( this->getFixed( ),_number ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_MOVING_BOUND_FAILED );
|
||||
|
||||
if ( this->addIndex( this->getFree( ),_number,ST_INACTIVE ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_MOVING_BOUND_FAILED );
|
||||
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* m o v e F r e e T o F i x e d
|
||||
*/
|
||||
returnValue Bounds::moveFreeToFixed( int _number, SubjectToStatus _status
|
||||
)
|
||||
{
|
||||
/* consistency check */
|
||||
if ( ( _number < 0 ) || ( _number >= getNV( ) ) )
|
||||
return THROWERROR( RET_INDEX_OUT_OF_BOUNDS );
|
||||
|
||||
/* Move index from indexlist of free variables to that of fixed ones. */
|
||||
if ( this->removeIndex( this->getFree( ),_number ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_MOVING_BOUND_FAILED );
|
||||
|
||||
if ( this->addIndex( this->getFixed( ),_number,_status ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_MOVING_BOUND_FAILED );
|
||||
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* s w a p F r e e
|
||||
*/
|
||||
returnValue Bounds::swapFree( int number1, int number2
|
||||
)
|
||||
{
|
||||
/* consistency check */
|
||||
if ( ( number1 < 0 ) || ( number1 >= getNV( ) ) || ( number2 < 0 ) || ( number2 >= getNV( ) ) )
|
||||
return THROWERROR( RET_INDEX_OUT_OF_BOUNDS );
|
||||
|
||||
/* Swap index within indexlist of free variables. */
|
||||
return this->swapIndex( this->getFree( ),number1,number2 );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,144 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file SRC/Bounds.ipp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Implementation of inlined member functions of the Bounds class designed
|
||||
* to manage working sets of bounds within a QProblem.
|
||||
*/
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* P U B L I C *
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* g e t N V
|
||||
*/
|
||||
inline int Bounds::getNV( ) const
|
||||
{
|
||||
return nV;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t N F X
|
||||
*/
|
||||
inline int Bounds::getNFV( ) const
|
||||
{
|
||||
return nFV;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t N B V
|
||||
*/
|
||||
inline int Bounds::getNBV( ) const
|
||||
{
|
||||
return nBV;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t N U V
|
||||
*/
|
||||
inline int Bounds::getNUV( ) const
|
||||
{
|
||||
return nUV;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* s e t N F X
|
||||
*/
|
||||
inline returnValue Bounds::setNFV( int n )
|
||||
{
|
||||
nFV = n;
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* s e t N B V
|
||||
*/
|
||||
inline returnValue Bounds::setNBV( int n )
|
||||
{
|
||||
nBV = n;
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* s e t N U V
|
||||
*/
|
||||
inline returnValue Bounds::setNUV( int n )
|
||||
{
|
||||
nUV = n;
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t N F R
|
||||
*/
|
||||
inline int Bounds::getNFR( )
|
||||
{
|
||||
return free.getLength( );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t N F X
|
||||
*/
|
||||
inline int Bounds::getNFX( )
|
||||
{
|
||||
return fixed.getLength( );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t F r e e
|
||||
*/
|
||||
inline Indexlist* Bounds::getFree( )
|
||||
{
|
||||
return &free;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t F i x e d
|
||||
*/
|
||||
inline Indexlist* Bounds::getFixed( )
|
||||
{
|
||||
return &fixed;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,248 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file SRC/Constraints.cpp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Implementation of the Constraints class designed to manage working sets of
|
||||
* constraints within a QProblem.
|
||||
*/
|
||||
|
||||
|
||||
#include <Constraints.hpp>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* P U B L I C *
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* C o n s t r a i n t s
|
||||
*/
|
||||
Constraints::Constraints( ) : SubjectTo( ),
|
||||
nC( 0 ),
|
||||
nEC( 0 ),
|
||||
nIC( 0 ),
|
||||
nUC( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* C o n s t r a i n t s
|
||||
*/
|
||||
Constraints::Constraints( const Constraints& rhs ) : SubjectTo( rhs ),
|
||||
nC( rhs.nC ),
|
||||
nEC( rhs.nEC ),
|
||||
nIC( rhs.nIC ),
|
||||
nUC( rhs.nUC )
|
||||
{
|
||||
active = rhs.active;
|
||||
inactive = rhs.inactive;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ~ C o n s t r a i n t s
|
||||
*/
|
||||
Constraints::~Constraints( )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* o p e r a t o r =
|
||||
*/
|
||||
Constraints& Constraints::operator=( const Constraints& rhs )
|
||||
{
|
||||
if ( this != &rhs )
|
||||
{
|
||||
SubjectTo::operator=( rhs );
|
||||
|
||||
nC = rhs.nC;
|
||||
nEC = rhs.nEC;
|
||||
nIC = rhs.nIC;
|
||||
nUC = rhs.nUC;
|
||||
|
||||
active = rhs.active;
|
||||
inactive = rhs.inactive;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* i n i t
|
||||
*/
|
||||
returnValue Constraints::init( int n )
|
||||
{
|
||||
nC = n;
|
||||
nEC = 0;
|
||||
nIC = 0;
|
||||
nUC = 0;
|
||||
|
||||
active.init( );
|
||||
inactive.init( );
|
||||
|
||||
return SubjectTo::init( n );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* s e t u p C o n s t r a i n t
|
||||
*/
|
||||
returnValue Constraints::setupConstraint( int _number, SubjectToStatus _status
|
||||
)
|
||||
{
|
||||
/* consistency check */
|
||||
if ( ( _number < 0 ) || ( _number >= getNC( ) ) )
|
||||
return THROWERROR( RET_INDEX_OUT_OF_BOUNDS );
|
||||
|
||||
/* Add constraint index to respective index list. */
|
||||
switch ( _status )
|
||||
{
|
||||
case ST_INACTIVE:
|
||||
if ( this->addIndex( this->getInactive( ),_number,_status ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_SETUP_CONSTRAINT_FAILED );
|
||||
break;
|
||||
|
||||
case ST_LOWER:
|
||||
if ( this->addIndex( this->getActive( ),_number,_status ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_SETUP_CONSTRAINT_FAILED );
|
||||
break;
|
||||
|
||||
case ST_UPPER:
|
||||
if ( this->addIndex( this->getActive( ),_number,_status ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_SETUP_CONSTRAINT_FAILED );
|
||||
break;
|
||||
|
||||
default:
|
||||
return THROWERROR( RET_INVALID_ARGUMENTS );
|
||||
}
|
||||
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* s e t u p A l l I n a c t i v e
|
||||
*/
|
||||
returnValue Constraints::setupAllInactive( )
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
/* 1) Place unbounded constraints at the beginning of the index list of inactive constraints. */
|
||||
for( i=0; i<nC; ++i )
|
||||
{
|
||||
if ( getType( i ) == ST_UNBOUNDED )
|
||||
{
|
||||
if ( setupConstraint( i,ST_INACTIVE ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_SETUP_CONSTRAINT_FAILED );
|
||||
}
|
||||
}
|
||||
|
||||
/* 2) Add remaining (i.e. "real" inequality) constraints to the index list of inactive constraints. */
|
||||
for( i=0; i<nC; ++i )
|
||||
{
|
||||
if ( getType( i ) == ST_BOUNDED )
|
||||
{
|
||||
if ( setupConstraint( i,ST_INACTIVE ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_SETUP_CONSTRAINT_FAILED );
|
||||
}
|
||||
}
|
||||
|
||||
/* 3) Place implicit equality constraints at the end of the index list of inactive constraints. */
|
||||
for( i=0; i<nC; ++i )
|
||||
{
|
||||
if ( getType( i ) == ST_EQUALITY )
|
||||
{
|
||||
if ( setupConstraint( i,ST_INACTIVE ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_SETUP_CONSTRAINT_FAILED );
|
||||
}
|
||||
}
|
||||
|
||||
/* 4) Moreover, add all constraints of unknown type. */
|
||||
for( i=0; i<nC; ++i )
|
||||
{
|
||||
if ( getType( i ) == ST_UNKNOWN )
|
||||
{
|
||||
if ( setupConstraint( i,ST_INACTIVE ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_SETUP_CONSTRAINT_FAILED );
|
||||
}
|
||||
}
|
||||
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* m o v e A c t i v e T o I n a c t i v e
|
||||
*/
|
||||
returnValue Constraints::moveActiveToInactive( int _number )
|
||||
{
|
||||
/* consistency check */
|
||||
if ( ( _number < 0 ) || ( _number >= getNC( ) ) )
|
||||
return THROWERROR( RET_INDEX_OUT_OF_BOUNDS );
|
||||
|
||||
/* Move index from indexlist of active constraints to that of inactive ones. */
|
||||
if ( this->removeIndex( this->getActive( ),_number ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_MOVING_BOUND_FAILED );
|
||||
|
||||
if ( this->addIndex( this->getInactive( ),_number,ST_INACTIVE ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_MOVING_BOUND_FAILED );
|
||||
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* m o v e I n a c t i v e T o A c t i v e
|
||||
*/
|
||||
returnValue Constraints::moveInactiveToActive( int _number, SubjectToStatus _status
|
||||
)
|
||||
{
|
||||
/* consistency check */
|
||||
if ( ( _number < 0 ) || ( _number >= getNC( ) ) )
|
||||
return THROWERROR( RET_INDEX_OUT_OF_BOUNDS );
|
||||
|
||||
/* Move index from indexlist of inactive constraints to that of active ones. */
|
||||
if ( this->removeIndex( this->getInactive( ),_number ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_MOVING_BOUND_FAILED );
|
||||
|
||||
if ( this->addIndex( this->getActive( ),_number,_status ) != SUCCESSFUL_RETURN )
|
||||
return THROWERROR( RET_MOVING_BOUND_FAILED );
|
||||
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
@@ -1,144 +0,0 @@
|
||||
/*
|
||||
* This file is part of qpOASES.
|
||||
*
|
||||
* qpOASES -- An Implementation of the Online Active Set Strategy.
|
||||
* Copyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.
|
||||
*
|
||||
* qpOASES is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* qpOASES is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with qpOASES; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file SRC/Constraints.ipp
|
||||
* \author Hans Joachim Ferreau
|
||||
* \version 1.3embedded
|
||||
* \date 2007-2008
|
||||
*
|
||||
* Declaration of inlined member functions of the Constraints class designed
|
||||
* to manage working sets of constraints within a QProblem.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* P U B L I C *
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* g e t N C
|
||||
*/
|
||||
inline int Constraints::getNC( ) const
|
||||
{
|
||||
return nC;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t N E C
|
||||
*/
|
||||
inline int Constraints::getNEC( ) const
|
||||
{
|
||||
return nEC;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t N I C
|
||||
*/
|
||||
inline int Constraints::getNIC( ) const
|
||||
{
|
||||
return nIC;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t N U C
|
||||
*/
|
||||
inline int Constraints::getNUC( ) const
|
||||
{
|
||||
return nUC;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* s e t N E C
|
||||
*/
|
||||
inline returnValue Constraints::setNEC( int n )
|
||||
{
|
||||
nEC = n;
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* s e t N I C
|
||||
*/
|
||||
inline returnValue Constraints::setNIC( int n )
|
||||
{
|
||||
nIC = n;
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* s e t N U C
|
||||
*/
|
||||
inline returnValue Constraints::setNUC( int n )
|
||||
{
|
||||
nUC = n;
|
||||
return SUCCESSFUL_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t N A C
|
||||
*/
|
||||
inline int Constraints::getNAC( )
|
||||
{
|
||||
return active.getLength( );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t N I A C
|
||||
*/
|
||||
inline int Constraints::getNIAC( )
|
||||
{
|
||||
return inactive.getLength( );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t A c t i v e
|
||||
*/
|
||||
inline Indexlist* Constraints::getActive( )
|
||||
{
|
||||
return &active;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* g e t I n a c t i v e
|
||||
*/
|
||||
inline Indexlist* Constraints::getInactive( )
|
||||
{
|
||||
return &inactive;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* end of file
|
||||
*/
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user