diff --git a/.gitignore b/.gitignore index 3e91531d0..3da75aaea 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ venv/ .overlay_init .overlay_consistent .sconsign.dblite -.vscode* model2.png a.out .hypothesis diff --git a/CHANGELOGS.md b/CHANGELOGS.md index 4994ef84d..d72566d19 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -1,4 +1,4 @@ -dragonpilot beta3 2024.02.13 +dragonpilot beta3 2024.03.12 ======================= * Comma 0.9.6 release * New driving model (Los Angles V2) diff --git a/RELEASES.md b/RELEASES.md index cf8d5eaea..4ec4c4fad 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,4 +1,9 @@ -Version 0.9.6 (2024-02-XX) +Version 0.9.7 (2024-XX-XX) +======================== +* New driving model +* Support for hybrid variants of supported Ford models + +Version 0.9.6 (2024-02-27) ======================== * New driving model * Vision model trained on more data @@ -6,9 +11,15 @@ Version 0.9.6 (2024-02-XX) * Directly outputs curvature for lateral control * New driver monitoring model * Trained on larger dataset +* Model path UI + * Shows where driving model wants to be + * Shows what model is seeing more clearly, but more jittery * AGNOS 9 * comma body streaming and controls over WebRTC * Improved fuzzy fingerprinting for many makes and models +* Alpha longitudinal support for new Toyota models +* Chevrolet Equinox 2019-22 support thanks to JasonJShuler and nworb-cire! +* Dodge Durango 2020-21 support * Hyundai Staria 2023 support thanks to sunnyhaibin! * Kia Niro Plug-in Hybrid 2022 support thanks to sunnyhaibin! * Lexus LC 2024 support thanks to nelsonjchen! diff --git a/body/board/obj/body.bin b/body/board/obj/body.bin index 4282ad02f..fd820f401 100755 Binary files a/body/board/obj/body.bin and b/body/board/obj/body.bin differ diff --git a/body/board/obj/body.bin.signed b/body/board/obj/body.bin.signed index 12f1dd45a..bd54526e9 100644 Binary files a/body/board/obj/body.bin.signed and b/body/board/obj/body.bin.signed differ diff --git a/body/board/obj/body.elf b/body/board/obj/body.elf index c47f75e97..43e9a083f 100755 Binary files a/body/board/obj/body.elf and b/body/board/obj/body.elf differ diff --git a/body/board/obj/bootstub.body.bin b/body/board/obj/bootstub.body.bin index 58975a024..d42c239b3 100755 Binary files a/body/board/obj/bootstub.body.bin and b/body/board/obj/bootstub.body.bin differ diff --git a/body/board/obj/bootstub.body.elf b/body/board/obj/bootstub.body.elf index d892921ef..e4a3314a0 100755 Binary files a/body/board/obj/bootstub.body.elf and b/body/board/obj/bootstub.body.elf differ diff --git a/body/board/obj/gitversion.h b/body/board/obj/gitversion.h index 7a95160a1..d3c95cf06 100644 --- a/body/board/obj/gitversion.h +++ b/body/board/obj/gitversion.h @@ -1 +1 @@ -const uint8_t gitversion[8] = "2ade7461"; +const uint8_t gitversion[8] = "abf3d716"; diff --git a/cereal/__init__.py b/cereal/__init__.py index 4e26ffb2e..89c5cf38e 100644 --- a/cereal/__init__.py +++ b/cereal/__init__.py @@ -1,4 +1,3 @@ -# pylint: skip-file import os import capnp diff --git a/cereal/car.capnp b/cereal/car.capnp index 2560a6722..756a80705 100644 --- a/cereal/car.capnp +++ b/cereal/car.capnp @@ -323,14 +323,12 @@ struct CarControl { # Actuator commands as computed by controlsd actuators @6 :Actuators; + # moved to CarOutput + actuatorsOutputDEPRECATED @10 :Actuators; + leftBlinker @15: Bool; rightBlinker @16: Bool; - # Any car specific rate limits or quirks applied by - # the CarController are reflected in actuatorsOutput - # and matches what is sent to the car - actuatorsOutput @10 :Actuators; - orientationNED @13 :List(Float32); angularVelocity @14 :List(Float32); @@ -418,6 +416,13 @@ struct CarControl { pitchDEPRECATED @9 :Float32; } +struct CarOutput { + # Any car specific rate limits or quirks applied by + # the CarController are reflected in actuatorsOutput + # and matches what is sent to the car + actuatorsOutput @0 :CarControl.Actuators; +} + # ****** car param ****** struct CarParams { @@ -596,6 +601,7 @@ struct CarParams { body @27; hyundaiCanfd @28; volkswagenMqbEvo @29; + chryslerCusw @30; } enum SteerControlType { diff --git a/cereal/gen/cpp/car.capnp.c++ b/cereal/gen/cpp/car.capnp.c++ index 8f2292887..18b3d3bd1 100644 --- a/cereal/gen/cpp/car.capnp.c++ +++ b/cereal/gen/cpp/car.capnp.c++ @@ -2494,7 +2494,7 @@ const ::capnp::_::RawSchema s_8ff333ebac1fdf36 = { 0, 7, i_8ff333ebac1fdf36, nullptr, nullptr, { &s_8ff333ebac1fdf36, nullptr, nullptr, 0, 0, nullptr }, false }; #endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<311> b_f78829049ab814af = { +static const ::capnp::_::AlignedData<313> b_f78829049ab814af = { { 0, 0, 0, 0, 5, 0, 6, 0, 175, 20, 184, 154, 4, 41, 136, 247, 10, 0, 0, 0, 1, 0, 3, 0, @@ -2594,55 +2594,55 @@ static const ::capnp::_::AlignedData<311> b_f78829049ab814af = { 0, 0, 0, 0, 0, 0, 0, 0, 28, 2, 0, 0, 3, 0, 1, 0, 40, 2, 0, 0, 2, 0, 1, 0, - 6, 0, 0, 0, 3, 0, 0, 0, + 4, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 37, 2, 0, 0, 130, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 36, 2, 0, 0, 3, 0, 1, 0, - 48, 2, 0, 0, 2, 0, 1, 0, - 1, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 1, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 45, 2, 0, 0, 82, 0, 0, 0, + 37, 2, 0, 0, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 2, 0, 0, 3, 0, 1, 0, 56, 2, 0, 0, 2, 0, 1, 0, - 2, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 1, 0, 12, 0, 0, 0, + 1, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 53, 2, 0, 0, 90, 0, 0, 0, + 53, 2, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 2, 0, 0, 3, 0, 1, 0, 64, 2, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 61, 2, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 2, 0, 0, 3, 0, 1, 0, + 72, 2, 0, 0, 2, 0, 1, 0, 7, 0, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 2, 0, 0, 122, 0, 0, 0, + 69, 2, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 60, 2, 0, 0, 3, 0, 1, 0, - 88, 2, 0, 0, 2, 0, 1, 0, + 68, 2, 0, 0, 3, 0, 1, 0, + 96, 2, 0, 0, 2, 0, 1, 0, 8, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 85, 2, 0, 0, 130, 0, 0, 0, + 93, 2, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 84, 2, 0, 0, 3, 0, 1, 0, - 112, 2, 0, 0, 2, 0, 1, 0, - 4, 0, 0, 0, 4, 0, 0, 0, + 92, 2, 0, 0, 3, 0, 1, 0, + 120, 2, 0, 0, 2, 0, 1, 0, + 5, 0, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 109, 2, 0, 0, 98, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 108, 2, 0, 0, 3, 0, 1, 0, - 120, 2, 0, 0, 2, 0, 1, 0, - 5, 0, 0, 0, 5, 0, 0, 0, - 0, 0, 1, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 117, 2, 0, 0, 106, 0, 0, 0, + 117, 2, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 116, 2, 0, 0, 3, 0, 1, 0, 128, 2, 0, 0, 2, 0, 1, 0, + 6, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 125, 2, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 124, 2, 0, 0, 3, 0, 1, 0, + 136, 2, 0, 0, 2, 0, 1, 0, 101, 110, 97, 98, 108, 101, 100, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2736,7 +2736,9 @@ static const ::capnp::_::AlignedData<311> b_f78829049ab814af = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 99, 116, 117, 97, 116, 111, 114, - 115, 79, 117, 116, 112, 117, 116, 0, + 115, 79, 117, 116, 112, 117, 116, 68, + 69, 80, 82, 69, 67, 65, 84, 69, + 68, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 40, 40, 67, 25, 169, 117, 114, 233, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2817,7 +2819,7 @@ static const ::capnp::_::RawSchema* const d_f78829049ab814af[] = { static const uint16_t m_f78829049ab814af[] = {7, 6, 10, 14, 2, 4, 0, 1, 5, 11, 15, 12, 13, 9, 16, 8, 3}; static const uint16_t i_f78829049ab814af[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; const ::capnp::_::RawSchema s_f78829049ab814af = { - 0xf78829049ab814af, b_f78829049ab814af.words, 311, d_f78829049ab814af, m_f78829049ab814af, + 0xf78829049ab814af, b_f78829049ab814af.words, 313, d_f78829049ab814af, m_f78829049ab814af, 3, 17, i_f78829049ab814af, nullptr, nullptr, { &s_f78829049ab814af, nullptr, nullptr, 0, 0, nullptr }, false }; #endif // !CAPNP_LITE @@ -3503,6 +3505,53 @@ const ::capnp::_::RawSchema s_f5a5e26c954e339e = { }; #endif // !CAPNP_LITE CAPNP_DEFINE_ENUM(AudibleAlert_f5a5e26c954e339e, f5a5e26c954e339e); +static const ::capnp::_::AlignedData<33> b_d817d6655115ca85 = { + { 0, 0, 0, 0, 5, 0, 6, 0, + 133, 202, 21, 81, 101, 214, 23, 216, + 10, 0, 0, 0, 1, 0, 0, 0, + 141, 139, 175, 8, 231, 241, 42, 142, + 1, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 162, 0, 0, 0, + 29, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 46, 99, 97, 112, 110, + 112, 58, 67, 97, 114, 79, 117, 116, + 112, 117, 116, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 4, 0, 0, 0, 3, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 3, 0, 1, 0, + 24, 0, 0, 0, 2, 0, 1, 0, + 97, 99, 116, 117, 97, 116, 111, 114, + 115, 79, 117, 116, 112, 117, 116, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 40, 40, 67, 25, 169, 117, 114, 233, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, } +}; +::capnp::word const* const bp_d817d6655115ca85 = b_d817d6655115ca85.words; +#if !CAPNP_LITE +static const ::capnp::_::RawSchema* const d_d817d6655115ca85[] = { + &s_e97275a919432828, +}; +static const uint16_t m_d817d6655115ca85[] = {0}; +static const uint16_t i_d817d6655115ca85[] = {0}; +const ::capnp::_::RawSchema s_d817d6655115ca85 = { + 0xd817d6655115ca85, b_d817d6655115ca85.words, 33, d_d817d6655115ca85, m_d817d6655115ca85, + 1, 1, i_d817d6655115ca85, nullptr, nullptr, { &s_d817d6655115ca85, nullptr, nullptr, 0, 0, nullptr }, false +}; +#endif // !CAPNP_LITE static const ::capnp::_::AlignedData<1284> b_8c69372490aaa9da = { { 0, 0, 0, 0, 5, 0, 6, 0, 218, 169, 170, 144, 36, 55, 105, 140, @@ -5850,7 +5899,7 @@ const ::capnp::_::RawSchema s_9d151e3f28616a12 = { 0, 8, i_9d151e3f28616a12, nullptr, nullptr, { &s_9d151e3f28616a12, nullptr, nullptr, 0, 0, nullptr }, false }; #endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<158> b_95551e5b1edaf451 = { +static const ::capnp::_::AlignedData<163> b_95551e5b1edaf451 = { { 0, 0, 0, 0, 5, 0, 6, 0, 81, 244, 218, 30, 91, 30, 85, 149, 20, 0, 0, 0, 2, 0, 0, 0, @@ -5860,7 +5909,7 @@ static const ::capnp::_::AlignedData<158> b_95551e5b1edaf451 = { 21, 0, 0, 0, 2, 1, 0, 0, 33, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 29, 0, 0, 0, 215, 2, 0, 0, + 29, 0, 0, 0, 239, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 97, 114, 46, 99, 97, 112, 110, @@ -5868,96 +5917,99 @@ static const ::capnp::_::AlignedData<158> b_95551e5b1edaf451 = { 97, 109, 115, 46, 83, 97, 102, 101, 116, 121, 77, 111, 100, 101, 108, 0, 0, 0, 0, 0, 1, 0, 1, 0, - 120, 0, 0, 0, 1, 0, 2, 0, + 124, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 97, 1, 0, 0, 58, 0, 0, 0, + 109, 1, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 89, 1, 0, 0, 90, 0, 0, 0, + 101, 1, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, - 85, 1, 0, 0, 58, 0, 0, 0, + 97, 1, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, - 77, 1, 0, 0, 58, 0, 0, 0, + 89, 1, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 69, 1, 0, 0, 26, 0, 0, 0, + 81, 1, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, - 61, 1, 0, 0, 146, 0, 0, 0, + 73, 1, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, - 61, 1, 0, 0, 42, 0, 0, 0, + 73, 1, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, - 53, 1, 0, 0, 74, 0, 0, 0, + 65, 1, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, - 49, 1, 0, 0, 66, 0, 0, 0, + 61, 1, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, - 41, 1, 0, 0, 74, 0, 0, 0, + 53, 1, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, - 37, 1, 0, 0, 50, 0, 0, 0, + 49, 1, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, - 29, 1, 0, 0, 58, 0, 0, 0, + 41, 1, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, - 21, 1, 0, 0, 82, 0, 0, 0, + 33, 1, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, - 17, 1, 0, 0, 50, 0, 0, 0, + 29, 1, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, - 9, 1, 0, 0, 58, 0, 0, 0, + 21, 1, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 0, 90, 0, 0, 0, + 13, 1, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, - 253, 0, 0, 0, 90, 0, 0, 0, + 9, 1, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, - 249, 0, 0, 0, 82, 0, 0, 0, + 5, 1, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, - 245, 0, 0, 0, 58, 0, 0, 0, + 1, 1, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, - 237, 0, 0, 0, 74, 0, 0, 0, + 249, 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, - 233, 0, 0, 0, 90, 0, 0, 0, + 245, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, - 229, 0, 0, 0, 106, 0, 0, 0, + 241, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, - 225, 0, 0, 0, 130, 0, 0, 0, + 237, 0, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, - 221, 0, 0, 0, 114, 0, 0, 0, + 233, 0, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, - 217, 0, 0, 0, 138, 0, 0, 0, + 229, 0, 0, 0, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, - 217, 0, 0, 0, 114, 0, 0, 0, + 229, 0, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, - 213, 0, 0, 0, 58, 0, 0, 0, + 225, 0, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, - 205, 0, 0, 0, 42, 0, 0, 0, + 217, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, - 197, 0, 0, 0, 106, 0, 0, 0, + 209, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, - 193, 0, 0, 0, 138, 0, 0, 0, + 205, 0, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 30, 0, 0, 0, 0, 0, 0, 0, + 205, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 115, 105, 108, 101, 110, 116, 0, 0, 104, 111, 110, 100, 97, 78, 105, 100, @@ -6008,14 +6060,16 @@ static const ::capnp::_::AlignedData<158> b_95551e5b1edaf451 = { 97, 110, 102, 100, 0, 0, 0, 0, 118, 111, 108, 107, 115, 119, 97, 103, 101, 110, 77, 113, 98, 69, 118, 111, - 0, 0, 0, 0, 0, 0, 0, 0, } + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 104, 114, 121, 115, 108, 101, 114, + 67, 117, 115, 119, 0, 0, 0, 0, } }; ::capnp::word const* const bp_95551e5b1edaf451 = b_95551e5b1edaf451.words; #if !CAPNP_LITE -static const uint16_t m_95551e5b1edaf451[] = {17, 27, 7, 9, 3, 6, 4, 18, 12, 20, 5, 1, 26, 8, 28, 24, 23, 13, 14, 19, 0, 11, 22, 10, 2, 16, 15, 25, 29, 21}; +static const uint16_t m_95551e5b1edaf451[] = {17, 27, 7, 9, 30, 3, 6, 4, 18, 12, 20, 5, 1, 26, 8, 28, 24, 23, 13, 14, 19, 0, 11, 22, 10, 2, 16, 15, 25, 29, 21}; const ::capnp::_::RawSchema s_95551e5b1edaf451 = { - 0x95551e5b1edaf451, b_95551e5b1edaf451.words, 158, nullptr, m_95551e5b1edaf451, - 0, 30, nullptr, nullptr, nullptr, { &s_95551e5b1edaf451, nullptr, nullptr, 0, 0, nullptr }, false + 0x95551e5b1edaf451, b_95551e5b1edaf451.words, 163, nullptr, m_95551e5b1edaf451, + 0, 31, nullptr, nullptr, nullptr, { &s_95551e5b1edaf451, nullptr, nullptr, 0, 0, nullptr }, false }; #endif // !CAPNP_LITE CAPNP_DEFINE_ENUM(SafetyModel_95551e5b1edaf451, 95551e5b1edaf451); @@ -6763,6 +6817,18 @@ constexpr ::capnp::_::RawSchema const* CarControl::HUDControl::_capnpPrivate::sc #endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL #endif // !CAPNP_LITE +// CarOutput +#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL +constexpr uint16_t CarOutput::_capnpPrivate::dataWordSize; +constexpr uint16_t CarOutput::_capnpPrivate::pointerCount; +#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL +#if !CAPNP_LITE +#if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL +constexpr ::capnp::Kind CarOutput::_capnpPrivate::kind; +constexpr ::capnp::_::RawSchema const* CarOutput::_capnpPrivate::schema; +#endif // !CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL +#endif // !CAPNP_LITE + // CarParams #if CAPNP_NEED_REDUNDANT_CONSTEXPR_DECL constexpr uint16_t CarParams::_capnpPrivate::dataWordSize; diff --git a/cereal/gen/cpp/car.capnp.h b/cereal/gen/cpp/car.capnp.h index 0bebd3fa7..efed81e40 100644 --- a/cereal/gen/cpp/car.capnp.h +++ b/cereal/gen/cpp/car.capnp.h @@ -223,6 +223,7 @@ enum class AudibleAlert_f5a5e26c954e339e: uint16_t { PROMPT_DISTRACTED, }; CAPNP_DECLARE_ENUM(AudibleAlert, f5a5e26c954e339e); +CAPNP_DECLARE_SCHEMA(d817d6655115ca85); CAPNP_DECLARE_SCHEMA(8c69372490aaa9da); CAPNP_DECLARE_SCHEMA(e836349c6056b0c9); CAPNP_DECLARE_SCHEMA(b581b23b1c89dda3); @@ -263,6 +264,7 @@ enum class SafetyModel_95551e5b1edaf451: uint16_t { BODY, HYUNDAI_CANFD, VOLKSWAGEN_MQB_EVO, + CHRYSLER_CUSW, }; CAPNP_DECLARE_ENUM(SafetyModel, 95551e5b1edaf451); CAPNP_DECLARE_SCHEMA(d661512be2def77f); @@ -517,6 +519,21 @@ struct CarControl::HUDControl { }; }; +struct CarOutput { + CarOutput() = delete; + + class Reader; + class Builder; + class Pipeline; + + struct _capnpPrivate { + CAPNP_DECLARE_STRUCT_HEADER(d817d6655115ca85, 0, 1) + #if !CAPNP_LITE + static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } + #endif // !CAPNP_LITE + }; +}; + struct CarParams { CarParams() = delete; @@ -1694,8 +1711,8 @@ public: inline float getPitchDEPRECATED() const; - inline bool hasActuatorsOutput() const; - inline ::cereal::CarControl::Actuators::Reader getActuatorsOutput() const; + inline bool hasActuatorsOutputDEPRECATED() const; + inline ::cereal::CarControl::Actuators::Reader getActuatorsOutputDEPRECATED() const; inline bool getLatActive() const; @@ -1781,12 +1798,12 @@ public: inline float getPitchDEPRECATED(); inline void setPitchDEPRECATED(float value); - inline bool hasActuatorsOutput(); - inline ::cereal::CarControl::Actuators::Builder getActuatorsOutput(); - inline void setActuatorsOutput( ::cereal::CarControl::Actuators::Reader value); - inline ::cereal::CarControl::Actuators::Builder initActuatorsOutput(); - inline void adoptActuatorsOutput(::capnp::Orphan< ::cereal::CarControl::Actuators>&& value); - inline ::capnp::Orphan< ::cereal::CarControl::Actuators> disownActuatorsOutput(); + inline bool hasActuatorsOutputDEPRECATED(); + inline ::cereal::CarControl::Actuators::Builder getActuatorsOutputDEPRECATED(); + inline void setActuatorsOutputDEPRECATED( ::cereal::CarControl::Actuators::Reader value); + inline ::cereal::CarControl::Actuators::Builder initActuatorsOutputDEPRECATED(); + inline void adoptActuatorsOutputDEPRECATED(::capnp::Orphan< ::cereal::CarControl::Actuators>&& value); + inline ::capnp::Orphan< ::cereal::CarControl::Actuators> disownActuatorsOutputDEPRECATED(); inline bool getLatActive(); inline void setLatActive(bool value); @@ -1837,7 +1854,7 @@ public: inline ::cereal::CarControl::CruiseControl::Pipeline getCruiseControl(); inline ::cereal::CarControl::HUDControl::Pipeline getHudControl(); inline ::cereal::CarControl::Actuators::Pipeline getActuators(); - inline ::cereal::CarControl::Actuators::Pipeline getActuatorsOutput(); + inline ::cereal::CarControl::Actuators::Pipeline getActuatorsOutputDEPRECATED(); private: ::capnp::AnyPointer::Pipeline _typeless; friend class ::capnp::PipelineHook; @@ -2179,6 +2196,88 @@ private: }; #endif // !CAPNP_LITE +class CarOutput::Reader { +public: + typedef CarOutput Reads; + + Reader() = default; + inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} + + inline ::capnp::MessageSize totalSize() const { + return _reader.totalSize().asPublic(); + } + +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { + return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); + } +#endif // !CAPNP_LITE + + inline bool hasActuatorsOutput() const; + inline ::cereal::CarControl::Actuators::Reader getActuatorsOutput() const; + +private: + ::capnp::_::StructReader _reader; + template + friend struct ::capnp::ToDynamic_; + template + friend struct ::capnp::_::PointerHelpers; + template + friend struct ::capnp::List; + friend class ::capnp::MessageBuilder; + friend class ::capnp::Orphanage; +}; + +class CarOutput::Builder { +public: + typedef CarOutput Builds; + + Builder() = delete; // Deleted to discourage incorrect usage. + // You can explicitly initialize to nullptr instead. + inline Builder(decltype(nullptr)) {} + inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} + inline operator Reader() const { return Reader(_builder.asReader()); } + inline Reader asReader() const { return *this; } + + inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } +#if !CAPNP_LITE + inline ::kj::StringTree toString() const { return asReader().toString(); } +#endif // !CAPNP_LITE + + inline bool hasActuatorsOutput(); + inline ::cereal::CarControl::Actuators::Builder getActuatorsOutput(); + inline void setActuatorsOutput( ::cereal::CarControl::Actuators::Reader value); + inline ::cereal::CarControl::Actuators::Builder initActuatorsOutput(); + inline void adoptActuatorsOutput(::capnp::Orphan< ::cereal::CarControl::Actuators>&& value); + inline ::capnp::Orphan< ::cereal::CarControl::Actuators> disownActuatorsOutput(); + +private: + ::capnp::_::StructBuilder _builder; + template + friend struct ::capnp::ToDynamic_; + friend class ::capnp::Orphanage; + template + friend struct ::capnp::_::PointerHelpers; +}; + +#if !CAPNP_LITE +class CarOutput::Pipeline { +public: + typedef CarOutput Pipelines; + + inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} + inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) + : _typeless(kj::mv(typeless)) {} + + inline ::cereal::CarControl::Actuators::Pipeline getActuatorsOutput(); +private: + ::capnp::AnyPointer::Pipeline _typeless; + friend class ::capnp::PipelineHook; + template + friend struct ::capnp::ToDynamic_; +}; +#endif // !CAPNP_LITE + class CarParams::Reader { public: typedef CarParams Reads; @@ -5385,41 +5484,41 @@ inline void CarControl::Builder::setPitchDEPRECATED(float value) { ::capnp::bounded<5>() * ::capnp::ELEMENTS, value); } -inline bool CarControl::Reader::hasActuatorsOutput() const { +inline bool CarControl::Reader::hasActuatorsOutputDEPRECATED() const { return !_reader.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); } -inline bool CarControl::Builder::hasActuatorsOutput() { +inline bool CarControl::Builder::hasActuatorsOutputDEPRECATED() { return !_builder.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS).isNull(); } -inline ::cereal::CarControl::Actuators::Reader CarControl::Reader::getActuatorsOutput() const { +inline ::cereal::CarControl::Actuators::Reader CarControl::Reader::getActuatorsOutputDEPRECATED() const { return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::get(_reader.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS)); } -inline ::cereal::CarControl::Actuators::Builder CarControl::Builder::getActuatorsOutput() { +inline ::cereal::CarControl::Actuators::Builder CarControl::Builder::getActuatorsOutputDEPRECATED() { return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::get(_builder.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS)); } #if !CAPNP_LITE -inline ::cereal::CarControl::Actuators::Pipeline CarControl::Pipeline::getActuatorsOutput() { +inline ::cereal::CarControl::Actuators::Pipeline CarControl::Pipeline::getActuatorsOutputDEPRECATED() { return ::cereal::CarControl::Actuators::Pipeline(_typeless.getPointerField(3)); } #endif // !CAPNP_LITE -inline void CarControl::Builder::setActuatorsOutput( ::cereal::CarControl::Actuators::Reader value) { +inline void CarControl::Builder::setActuatorsOutputDEPRECATED( ::cereal::CarControl::Actuators::Reader value) { ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::set(_builder.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS), value); } -inline ::cereal::CarControl::Actuators::Builder CarControl::Builder::initActuatorsOutput() { +inline ::cereal::CarControl::Actuators::Builder CarControl::Builder::initActuatorsOutputDEPRECATED() { return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::init(_builder.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS)); } -inline void CarControl::Builder::adoptActuatorsOutput( +inline void CarControl::Builder::adoptActuatorsOutputDEPRECATED( ::capnp::Orphan< ::cereal::CarControl::Actuators>&& value) { ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::adopt(_builder.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS), kj::mv(value)); } -inline ::capnp::Orphan< ::cereal::CarControl::Actuators> CarControl::Builder::disownActuatorsOutput() { +inline ::capnp::Orphan< ::cereal::CarControl::Actuators> CarControl::Builder::disownActuatorsOutputDEPRECATED() { return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::disown(_builder.getPointerField( ::capnp::bounded<3>() * ::capnp::POINTERS)); } @@ -5892,6 +5991,45 @@ inline void CarControl::HUDControl::Builder::setLeftLaneDepart(bool value) { ::capnp::bounded<6>() * ::capnp::ELEMENTS, value); } +inline bool CarOutput::Reader::hasActuatorsOutput() const { + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool CarOutput::Builder::hasActuatorsOutput() { + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarControl::Actuators::Reader CarOutput::Reader::getActuatorsOutput() const { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::CarControl::Actuators::Builder CarOutput::Builder::getActuatorsOutput() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +#if !CAPNP_LITE +inline ::cereal::CarControl::Actuators::Pipeline CarOutput::Pipeline::getActuatorsOutput() { + return ::cereal::CarControl::Actuators::Pipeline(_typeless.getPointerField(0)); +} +#endif // !CAPNP_LITE +inline void CarOutput::Builder::setActuatorsOutput( ::cereal::CarControl::Actuators::Reader value) { + ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarControl::Actuators::Builder CarOutput::Builder::initActuatorsOutput() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void CarOutput::Builder::adoptActuatorsOutput( + ::capnp::Orphan< ::cereal::CarControl::Actuators>&& value) { + ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarControl::Actuators> CarOutput::Builder::disownActuatorsOutput() { + return ::capnp::_::PointerHelpers< ::cereal::CarControl::Actuators>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + inline bool CarParams::Reader::hasCarName() const { return !_reader.getPointerField( ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); diff --git a/cereal/gen/cpp/log.capnp.c++ b/cereal/gen/cpp/log.capnp.c++ index 08189a1ee..73f358232 100644 --- a/cereal/gen/cpp/log.capnp.c++ +++ b/cereal/gen/cpp/log.capnp.c++ @@ -204,17 +204,17 @@ const ::capnp::_::RawSchema s_d692e23d1a247d99 = { }; #endif // !CAPNP_LITE CAPNP_DEFINE_ENUM(LongitudinalPersonality_d692e23d1a247d99, d692e23d1a247d99); -static const ::capnp::_::AlignedData<444> b_e71008caeb3fb65c = { +static const ::capnp::_::AlignedData<460> b_e71008caeb3fb65c = { { 0, 0, 0, 0, 5, 0, 6, 0, 92, 182, 63, 235, 202, 8, 16, 231, 10, 0, 0, 0, 1, 0, 2, 0, 91, 40, 164, 37, 126, 241, 177, 243, - 17, 0, 7, 0, 0, 0, 0, 0, + 18, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 154, 0, 0, 0, 29, 0, 0, 0, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 129, 0, 0, 0, 159, 4, 0, 0, + 129, 0, 0, 0, 215, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 111, 103, 46, 99, 97, 112, 110, @@ -247,154 +247,161 @@ static const ::capnp::_::AlignedData<444> b_e71008caeb3fb65c = { 97, 0, 0, 0, 0, 0, 0, 0, 73, 111, 115, 66, 117, 105, 108, 100, 73, 110, 102, 111, 0, 0, 0, 0, - 84, 0, 0, 0, 3, 0, 4, 0, + 88, 0, 0, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 2, 0, 0, 90, 0, 0, 0, + 89, 2, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 60, 2, 0, 0, 3, 0, 1, 0, - 88, 2, 0, 0, 2, 0, 1, 0, - 16, 0, 0, 0, 1, 0, 0, 0, + 88, 2, 0, 0, 3, 0, 1, 0, + 116, 2, 0, 0, 2, 0, 1, 0, + 17, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 85, 2, 0, 0, 122, 0, 0, 0, + 113, 2, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 84, 2, 0, 0, 3, 0, 1, 0, - 96, 2, 0, 0, 2, 0, 1, 0, + 112, 2, 0, 0, 3, 0, 1, 0, + 124, 2, 0, 0, 2, 0, 1, 0, 3, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 93, 2, 0, 0, 74, 0, 0, 0, + 121, 2, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 92, 2, 0, 0, 3, 0, 1, 0, - 104, 2, 0, 0, 2, 0, 1, 0, + 120, 2, 0, 0, 3, 0, 1, 0, + 132, 2, 0, 0, 2, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 101, 2, 0, 0, 90, 0, 0, 0, + 129, 2, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 100, 2, 0, 0, 3, 0, 1, 0, - 112, 2, 0, 0, 2, 0, 1, 0, + 128, 2, 0, 0, 3, 0, 1, 0, + 140, 2, 0, 0, 2, 0, 1, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 109, 2, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 104, 2, 0, 0, 3, 0, 1, 0, - 116, 2, 0, 0, 2, 0, 1, 0, - 17, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 1, 0, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 113, 2, 0, 0, 138, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 116, 2, 0, 0, 3, 0, 1, 0, - 128, 2, 0, 0, 2, 0, 1, 0, - 18, 0, 0, 0, 5, 0, 0, 0, - 0, 0, 1, 0, 6, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 125, 2, 0, 0, 202, 0, 0, 0, + 137, 2, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 2, 0, 0, 3, 0, 1, 0, - 160, 2, 0, 0, 2, 0, 1, 0, - 19, 0, 0, 0, 6, 0, 0, 0, + 144, 2, 0, 0, 2, 0, 1, 0, + 18, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 141, 2, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 2, 0, 0, 3, 0, 1, 0, + 156, 2, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 2, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 2, 0, 0, 3, 0, 1, 0, + 188, 2, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 157, 2, 0, 0, 226, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 164, 2, 0, 0, 3, 0, 1, 0, - 176, 2, 0, 0, 2, 0, 1, 0, - 10, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 1, 0, 8, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 173, 2, 0, 0, 82, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 172, 2, 0, 0, 3, 0, 1, 0, - 184, 2, 0, 0, 2, 0, 1, 0, - 11, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 1, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 181, 2, 0, 0, 50, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 176, 2, 0, 0, 3, 0, 1, 0, - 188, 2, 0, 0, 2, 0, 1, 0, - 6, 0, 0, 0, 8, 0, 0, 0, - 0, 0, 1, 0, 10, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 185, 2, 0, 0, 82, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 184, 2, 0, 0, 3, 0, 1, 0, - 196, 2, 0, 0, 2, 0, 1, 0, - 7, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 1, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 193, 2, 0, 0, 82, 0, 0, 0, + 185, 2, 0, 0, 226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 2, 0, 0, 3, 0, 1, 0, 204, 2, 0, 0, 2, 0, 1, 0, - 12, 0, 0, 0, 17, 0, 0, 0, - 0, 0, 1, 0, 12, 0, 0, 0, + 11, 0, 0, 0, 7, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 201, 2, 0, 0, 66, 0, 0, 0, + 201, 2, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 196, 2, 0, 0, 3, 0, 1, 0, - 208, 2, 0, 0, 2, 0, 1, 0, - 8, 0, 0, 0, 10, 0, 0, 0, - 0, 0, 1, 0, 13, 0, 0, 0, + 200, 2, 0, 0, 3, 0, 1, 0, + 212, 2, 0, 0, 2, 0, 1, 0, + 12, 0, 0, 0, 16, 0, 0, 0, + 0, 0, 1, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 205, 2, 0, 0, 82, 0, 0, 0, + 209, 2, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 2, 0, 0, 3, 0, 1, 0, 216, 2, 0, 0, 2, 0, 1, 0, - 20, 0, 0, 0, 11, 0, 0, 0, - 0, 0, 1, 0, 14, 0, 0, 0, + 6, 0, 0, 0, 8, 0, 0, 0, + 0, 0, 1, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 213, 2, 0, 0, 186, 0, 0, 0, + 213, 2, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 216, 2, 0, 0, 3, 0, 1, 0, - 228, 2, 0, 0, 2, 0, 1, 0, - 1, 0, 0, 0, 12, 0, 0, 0, - 0, 0, 1, 0, 15, 0, 0, 0, + 212, 2, 0, 0, 3, 0, 1, 0, + 224, 2, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 9, 0, 0, 0, + 0, 0, 1, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 225, 2, 0, 0, 114, 0, 0, 0, + 221, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 2, 0, 0, 3, 0, 1, 0, + 232, 2, 0, 0, 2, 0, 1, 0, + 13, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 2, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 2, 0, 0, 3, 0, 1, 0, 236, 2, 0, 0, 2, 0, 1, 0, - 9, 0, 0, 0, 13, 0, 0, 0, + 9, 0, 0, 0, 10, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 233, 2, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 232, 2, 0, 0, 3, 0, 1, 0, + 244, 2, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 11, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 2, 0, 0, 186, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 244, 2, 0, 0, 3, 0, 1, 0, + 0, 3, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 12, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 253, 2, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 2, 0, 0, 3, 0, 1, 0, + 8, 3, 0, 0, 2, 0, 1, 0, + 10, 0, 0, 0, 13, 0, 0, 0, 0, 0, 1, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 233, 2, 0, 0, 146, 0, 0, 0, + 5, 3, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 236, 2, 0, 0, 3, 0, 1, 0, - 64, 3, 0, 0, 2, 0, 1, 0, - 13, 0, 0, 0, 14, 0, 0, 0, + 8, 3, 0, 0, 3, 0, 1, 0, + 92, 3, 0, 0, 2, 0, 1, 0, + 14, 0, 0, 0, 14, 0, 0, 0, 0, 0, 1, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 3, 0, 0, 58, 0, 0, 0, + 89, 3, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 56, 3, 0, 0, 3, 0, 1, 0, - 140, 3, 0, 0, 2, 0, 1, 0, + 84, 3, 0, 0, 3, 0, 1, 0, + 168, 3, 0, 0, 2, 0, 1, 0, 2, 0, 0, 0, 15, 0, 0, 0, 0, 0, 1, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 137, 3, 0, 0, 82, 0, 0, 0, + 165, 3, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 136, 3, 0, 0, 3, 0, 1, 0, - 148, 3, 0, 0, 2, 0, 1, 0, - 14, 0, 0, 0, 16, 0, 0, 0, + 164, 3, 0, 0, 3, 0, 1, 0, + 176, 3, 0, 0, 2, 0, 1, 0, + 15, 0, 0, 0, 16, 0, 0, 0, 0, 0, 1, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 145, 3, 0, 0, 74, 0, 0, 0, + 173, 3, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 144, 3, 0, 0, 3, 0, 1, 0, - 228, 3, 0, 0, 2, 0, 1, 0, - 15, 0, 0, 0, 1, 0, 0, 0, + 172, 3, 0, 0, 3, 0, 1, 0, + 0, 4, 0, 0, 2, 0, 1, 0, + 16, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 225, 3, 0, 0, 114, 0, 0, 0, + 253, 3, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 224, 3, 0, 0, 3, 0, 1, 0, - 236, 3, 0, 0, 2, 0, 1, 0, + 252, 3, 0, 0, 3, 0, 1, 0, + 8, 4, 0, 0, 2, 0, 1, 0, + 7, 0, 0, 0, 17, 0, 0, 0, + 0, 0, 1, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 4, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 4, 0, 0, 3, 0, 1, 0, + 16, 4, 0, 0, 2, 0, 1, 0, 107, 101, 114, 110, 101, 108, 65, 114, 103, 115, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, @@ -647,6 +654,15 @@ static const ::capnp::_::AlignedData<444> b_e71008caeb3fb65c = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 103, 105, 116, 67, 111, 109, 109, 105, + 116, 68, 97, 116, 101, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, } }; @@ -661,19 +677,19 @@ static const ::capnp::_::RawSchema* const d_e71008caeb3fb65c[] = { &s_f8b13ce2183eb696, &s_fe2919d5c21f426c, }; -static const uint16_t m_e71008caeb3fb65c[] = {5, 16, 6, 7, 19, 3, 9, 2, 1, 11, 10, 13, 14, 0, 15, 18, 8, 17, 12, 4, 20}; -static const uint16_t i_e71008caeb3fb65c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}; +static const uint16_t m_e71008caeb3fb65c[] = {5, 16, 6, 7, 19, 3, 9, 2, 1, 11, 10, 21, 13, 14, 0, 15, 18, 8, 17, 12, 4, 20}; +static const uint16_t i_e71008caeb3fb65c[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21}; KJ_CONSTEXPR(const) ::capnp::_::RawBrandedSchema::Dependency bd_e71008caeb3fb65c[] = { { 16777232, ::cereal::Map< ::capnp::Text, ::capnp::Text>::_capnpPrivate::brand() }, { 16777233, ::cereal::Map< ::capnp::Text, ::capnp::Data>::_capnpPrivate::brand() }, { 16777235, ::cereal::Map< ::capnp::Text, ::capnp::Data>::_capnpPrivate::brand() }, }; const ::capnp::_::RawSchema s_e71008caeb3fb65c = { - 0xe71008caeb3fb65c, b_e71008caeb3fb65c.words, 444, d_e71008caeb3fb65c, m_e71008caeb3fb65c, - 7, 21, i_e71008caeb3fb65c, nullptr, nullptr, { &s_e71008caeb3fb65c, nullptr, bd_e71008caeb3fb65c, 0, sizeof(bd_e71008caeb3fb65c) / sizeof(bd_e71008caeb3fb65c[0]), nullptr }, true + 0xe71008caeb3fb65c, b_e71008caeb3fb65c.words, 460, d_e71008caeb3fb65c, m_e71008caeb3fb65c, + 7, 22, i_e71008caeb3fb65c, nullptr, nullptr, { &s_e71008caeb3fb65c, nullptr, bd_e71008caeb3fb65c, 0, sizeof(bd_e71008caeb3fb65c) / sizeof(bd_e71008caeb3fb65c[0]), nullptr }, true }; #endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<48> b_9d5d7238eba86608 = { +static const ::capnp::_::AlignedData<52> b_9d5d7238eba86608 = { { 0, 0, 0, 0, 5, 0, 6, 0, 8, 102, 168, 235, 56, 114, 93, 157, 19, 0, 0, 0, 2, 0, 0, 0, @@ -683,7 +699,7 @@ static const ::capnp::_::AlignedData<48> b_9d5d7238eba86608 = { 21, 0, 0, 0, 242, 0, 0, 0, 33, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 29, 0, 0, 0, 175, 0, 0, 0, + 29, 0, 0, 0, 199, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 111, 103, 46, 99, 97, 112, 110, @@ -691,27 +707,30 @@ static const ::capnp::_::AlignedData<48> b_9d5d7238eba86608 = { 116, 97, 46, 68, 101, 118, 105, 99, 101, 84, 121, 112, 101, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, - 28, 0, 0, 0, 1, 0, 2, 0, + 32, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 77, 0, 0, 0, 66, 0, 0, 0, + 89, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 69, 0, 0, 0, 34, 0, 0, 0, + 81, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, - 61, 0, 0, 0, 106, 0, 0, 0, + 73, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, - 57, 0, 0, 0, 74, 0, 0, 0, + 69, 0, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 53, 0, 0, 0, 42, 0, 0, 0, + 65, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, - 45, 0, 0, 0, 26, 0, 0, 0, + 57, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, - 37, 0, 0, 0, 42, 0, 0, 0, + 49, 0, 0, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 41, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, 110, 107, 110, 111, 119, 110, 0, 110, 101, 111, 0, 0, 0, 0, 0, @@ -721,14 +740,15 @@ static const ::capnp::_::AlignedData<48> b_9d5d7238eba86608 = { 0, 0, 0, 0, 0, 0, 0, 0, 116, 105, 99, 105, 0, 0, 0, 0, 112, 99, 0, 0, 0, 0, 0, 0, - 116, 105, 122, 105, 0, 0, 0, 0, } + 116, 105, 122, 105, 0, 0, 0, 0, + 109, 105, 99, 105, 0, 0, 0, 0, } }; ::capnp::word const* const bp_9d5d7238eba86608 = b_9d5d7238eba86608.words; #if !CAPNP_LITE -static const uint16_t m_9d5d7238eba86608[] = {2, 3, 1, 5, 4, 6, 0}; +static const uint16_t m_9d5d7238eba86608[] = {2, 3, 7, 1, 5, 4, 6, 0}; const ::capnp::_::RawSchema s_9d5d7238eba86608 = { - 0x9d5d7238eba86608, b_9d5d7238eba86608.words, 48, nullptr, m_9d5d7238eba86608, - 0, 7, nullptr, nullptr, nullptr, { &s_9d5d7238eba86608, nullptr, nullptr, 0, 0, nullptr }, false + 0x9d5d7238eba86608, b_9d5d7238eba86608.words, 52, nullptr, m_9d5d7238eba86608, + 0, 8, nullptr, nullptr, nullptr, { &s_9d5d7238eba86608, nullptr, nullptr, 0, 0, nullptr }, false }; #endif // !CAPNP_LITE CAPNP_DEFINE_ENUM(DeviceType_9d5d7238eba86608, 9d5d7238eba86608); @@ -3008,7 +3028,7 @@ const ::capnp::_::RawSchema s_e49b3ce8f7f48d0d = { }; #endif // !CAPNP_LITE CAPNP_DEFINE_ENUM(SensorSource_e49b3ce8f7f48d0d, e49b3ce8f7f48d0d); -static const ::capnp::_::AlignedData<233> b_e946524859add50e = { +static const ::capnp::_::AlignedData<234> b_e946524859add50e = { { 0, 0, 0, 0, 5, 0, 6, 0, 14, 213, 173, 89, 72, 82, 70, 233, 10, 0, 0, 0, 1, 0, 8, 0, @@ -3076,52 +3096,52 @@ static const ::capnp::_::AlignedData<233> b_e946524859add50e = { 6, 0, 0, 0, 9, 0, 0, 0, 0, 0, 1, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 133, 1, 0, 0, 74, 0, 0, 0, + 133, 1, 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 132, 1, 0, 0, 3, 0, 1, 0, - 144, 1, 0, 0, 2, 0, 1, 0, + 136, 1, 0, 0, 3, 0, 1, 0, + 148, 1, 0, 0, 2, 0, 1, 0, 7, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 141, 1, 0, 0, 162, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 144, 1, 0, 0, 3, 0, 1, 0, - 156, 1, 0, 0, 2, 0, 1, 0, - 8, 0, 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 8, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 153, 1, 0, 0, 58, 0, 0, 0, + 145, 1, 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 1, 0, 0, 3, 0, 1, 0, 160, 1, 0, 0, 2, 0, 1, 0, + 8, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 1, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 157, 1, 0, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 1, 0, 0, 3, 0, 1, 0, + 164, 1, 0, 0, 2, 0, 1, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 157, 1, 0, 0, 42, 0, 0, 0, + 161, 1, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 152, 1, 0, 0, 3, 0, 1, 0, - 180, 1, 0, 0, 2, 0, 1, 0, + 156, 1, 0, 0, 3, 0, 1, 0, + 184, 1, 0, 0, 2, 0, 1, 0, 10, 0, 0, 0, 12, 0, 0, 0, 0, 0, 1, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 177, 1, 0, 0, 138, 0, 0, 0, + 181, 1, 0, 0, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 180, 1, 0, 0, 3, 0, 1, 0, - 192, 1, 0, 0, 2, 0, 1, 0, + 184, 1, 0, 0, 3, 0, 1, 0, + 196, 1, 0, 0, 2, 0, 1, 0, 11, 0, 0, 0, 13, 0, 0, 0, 0, 0, 1, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 189, 1, 0, 0, 154, 0, 0, 0, + 193, 1, 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 192, 1, 0, 0, 3, 0, 1, 0, - 204, 1, 0, 0, 2, 0, 1, 0, + 196, 1, 0, 0, 3, 0, 1, 0, + 208, 1, 0, 0, 2, 0, 1, 0, 12, 0, 0, 0, 14, 0, 0, 0, 0, 0, 1, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 201, 1, 0, 0, 114, 0, 0, 0, + 205, 1, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 200, 1, 0, 0, 3, 0, 1, 0, - 212, 1, 0, 0, 2, 0, 1, 0, + 204, 1, 0, 0, 3, 0, 1, 0, + 216, 1, 0, 0, 2, 0, 1, 0, 102, 108, 97, 103, 115, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3174,8 +3194,9 @@ static const ::capnp::_::AlignedData<233> b_e946524859add50e = { 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 97, 99, 99, 117, 114, 97, 99, 121, - 0, 0, 0, 0, 0, 0, 0, 0, + 104, 111, 114, 105, 122, 111, 110, 116, + 97, 108, 65, 99, 99, 117, 114, 97, + 99, 121, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3248,10 +3269,10 @@ static const ::capnp::_::AlignedData<233> b_e946524859add50e = { static const ::capnp::_::RawSchema* const d_e946524859add50e[] = { &s_d3ff79f25c734863, }; -static const uint16_t m_e946524859add50e[] = {6, 3, 11, 5, 0, 1, 2, 8, 4, 12, 7, 9, 10}; +static const uint16_t m_e946524859add50e[] = {3, 11, 5, 0, 6, 1, 2, 8, 4, 12, 7, 9, 10}; static const uint16_t i_e946524859add50e[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; const ::capnp::_::RawSchema s_e946524859add50e = { - 0xe946524859add50e, b_e946524859add50e.words, 233, d_e946524859add50e, m_e946524859add50e, + 0xe946524859add50e, b_e946524859add50e.words, 234, d_e946524859add50e, m_e946524859add50e, 1, 13, i_e946524859add50e, nullptr, nullptr, { &s_e946524859add50e, nullptr, nullptr, 0, 0, nullptr }, false }; #endif // !CAPNP_LITE @@ -3565,7 +3586,7 @@ const ::capnp::_::RawSchema s_8785009a964c7c59 = { 0, 4, i_8785009a964c7c59, nullptr, nullptr, { &s_8785009a964c7c59, nullptr, nullptr, 0, 0, nullptr }, false }; #endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<809> b_a4d8b5af2aa492eb = { +static const ::capnp::_::AlignedData<810> b_a4d8b5af2aa492eb = { { 0, 0, 0, 0, 5, 0, 6, 0, 235, 146, 164, 42, 175, 181, 216, 164, 10, 0, 0, 0, 1, 0, 12, 0, @@ -3607,49 +3628,49 @@ static const ::capnp::_::AlignedData<809> b_a4d8b5af2aa492eb = { 78, 101, 116, 119, 111, 114, 107, 83, 116, 97, 116, 115, 0, 0, 0, 0, 180, 0, 0, 0, 3, 0, 4, 0, - 28, 0, 0, 0, 0, 0, 0, 0, + 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 4, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 4, 0, 0, 3, 0, 1, 0, 232, 4, 0, 0, 2, 0, 1, 0, - 29, 0, 0, 0, 1, 0, 0, 0, + 28, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 229, 4, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 4, 0, 0, 3, 0, 1, 0, 240, 4, 0, 0, 2, 0, 1, 0, - 30, 0, 0, 0, 2, 0, 0, 0, + 29, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 237, 4, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, 4, 0, 0, 3, 0, 1, 0, 248, 4, 0, 0, 2, 0, 1, 0, - 31, 0, 0, 0, 3, 0, 0, 0, + 30, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 245, 4, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 4, 0, 0, 3, 0, 1, 0, 0, 5, 0, 0, 2, 0, 1, 0, - 32, 0, 0, 0, 4, 0, 0, 0, + 31, 0, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253, 4, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252, 4, 0, 0, 3, 0, 1, 0, 8, 5, 0, 0, 2, 0, 1, 0, - 33, 0, 0, 0, 5, 0, 0, 0, + 32, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 0, 0, 3, 0, 1, 0, 16, 5, 0, 0, 2, 0, 1, 0, - 34, 0, 0, 0, 3, 0, 0, 0, + 33, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 5, 0, 0, 114, 0, 0, 0, @@ -3663,21 +3684,21 @@ static const ::capnp::_::AlignedData<809> b_a4d8b5af2aa492eb = { 0, 0, 0, 0, 0, 0, 0, 0, 24, 5, 0, 0, 3, 0, 1, 0, 36, 5, 0, 0, 2, 0, 1, 0, - 40, 0, 0, 0, 10, 0, 0, 0, + 39, 0, 0, 0, 10, 0, 0, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 5, 0, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 5, 0, 0, 3, 0, 1, 0, 52, 5, 0, 0, 2, 0, 1, 0, - 37, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 5, 0, 0, 194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 5, 0, 0, 3, 0, 1, 0, 64, 5, 0, 0, 2, 0, 1, 0, - 26, 0, 0, 0, 11, 0, 0, 0, + 25, 0, 0, 0, 11, 0, 0, 0, 0, 0, 1, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 5, 0, 0, 186, 0, 0, 0, @@ -3691,7 +3712,7 @@ static const ::capnp::_::AlignedData<809> b_a4d8b5af2aa492eb = { 0, 0, 0, 0, 0, 0, 0, 0, 68, 5, 0, 0, 3, 0, 1, 0, 80, 5, 0, 0, 2, 0, 1, 0, - 44, 0, 0, 0, 193, 0, 0, 0, + 43, 0, 0, 0, 193, 0, 0, 0, 0, 0, 1, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 5, 0, 0, 162, 0, 0, 0, @@ -3705,35 +3726,35 @@ static const ::capnp::_::AlignedData<809> b_a4d8b5af2aa492eb = { 0, 0, 0, 0, 0, 0, 0, 0, 88, 5, 0, 0, 3, 0, 1, 0, 100, 5, 0, 0, 2, 0, 1, 0, - 25, 0, 0, 0, 13, 0, 0, 0, + 24, 0, 0, 0, 13, 0, 0, 0, 0, 0, 1, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 5, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 5, 0, 0, 3, 0, 1, 0, 108, 5, 0, 0, 2, 0, 1, 0, - 41, 0, 0, 0, 7, 0, 0, 0, + 40, 0, 0, 0, 7, 0, 0, 0, 0, 0, 1, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 105, 5, 0, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 5, 0, 0, 3, 0, 1, 0, 124, 5, 0, 0, 2, 0, 1, 0, - 38, 0, 0, 0, 10, 0, 0, 0, + 37, 0, 0, 0, 10, 0, 0, 0, 0, 0, 1, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121, 5, 0, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 5, 0, 0, 3, 0, 1, 0, 140, 5, 0, 0, 2, 0, 1, 0, - 42, 0, 0, 0, 194, 0, 0, 0, + 41, 0, 0, 0, 194, 0, 0, 0, 0, 0, 1, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 137, 5, 0, 0, 194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, 5, 0, 0, 3, 0, 1, 0, 152, 5, 0, 0, 2, 0, 1, 0, - 43, 0, 0, 0, 195, 0, 0, 0, + 42, 0, 0, 0, 195, 0, 0, 0, 0, 0, 1, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 149, 5, 0, 0, 218, 0, 0, 0, @@ -3747,14 +3768,14 @@ static const ::capnp::_::AlignedData<809> b_a4d8b5af2aa492eb = { 0, 0, 0, 0, 0, 0, 0, 0, 168, 5, 0, 0, 3, 0, 1, 0, 180, 5, 0, 0, 2, 0, 1, 0, - 36, 0, 0, 0, 44, 0, 0, 0, + 35, 0, 0, 0, 44, 0, 0, 0, 0, 0, 1, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 177, 5, 0, 0, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 184, 5, 0, 0, 3, 0, 1, 0, 196, 5, 0, 0, 2, 0, 1, 0, - 35, 0, 0, 0, 23, 0, 0, 0, + 34, 0, 0, 0, 23, 0, 0, 0, 0, 0, 1, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 193, 5, 0, 0, 114, 0, 0, 0, @@ -3810,118 +3831,118 @@ static const ::capnp::_::AlignedData<809> b_a4d8b5af2aa492eb = { 0, 0, 0, 0, 0, 0, 0, 0, 32, 6, 0, 0, 3, 0, 1, 0, 44, 6, 0, 0, 2, 0, 1, 0, - 39, 0, 0, 0, 16, 0, 0, 0, + 38, 0, 0, 0, 16, 0, 0, 0, 0, 0, 1, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 6, 0, 0, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 6, 0, 0, 3, 0, 1, 0, 56, 6, 0, 0, 2, 0, 1, 0, - 19, 0, 0, 0, 17, 0, 0, 0, + 44, 0, 0, 0, 17, 0, 0, 0, 0, 0, 1, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 53, 6, 0, 0, 106, 0, 0, 0, + 53, 6, 0, 0, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 52, 6, 0, 0, 3, 0, 1, 0, - 64, 6, 0, 0, 2, 0, 1, 0, + 56, 6, 0, 0, 3, 0, 1, 0, + 68, 6, 0, 0, 2, 0, 1, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 6, 0, 0, 98, 0, 0, 0, + 65, 6, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 60, 6, 0, 0, 3, 0, 1, 0, - 72, 6, 0, 0, 2, 0, 1, 0, + 64, 6, 0, 0, 3, 0, 1, 0, + 76, 6, 0, 0, 2, 0, 1, 0, 5, 0, 0, 0, 9, 0, 0, 0, 0, 0, 1, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 69, 6, 0, 0, 154, 0, 0, 0, + 73, 6, 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 72, 6, 0, 0, 3, 0, 1, 0, - 84, 6, 0, 0, 2, 0, 1, 0, + 76, 6, 0, 0, 3, 0, 1, 0, + 88, 6, 0, 0, 2, 0, 1, 0, 10, 0, 0, 0, 45, 0, 0, 0, 0, 0, 1, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 81, 6, 0, 0, 130, 0, 0, 0, + 85, 6, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 80, 6, 0, 0, 3, 0, 1, 0, - 92, 6, 0, 0, 2, 0, 1, 0, + 84, 6, 0, 0, 3, 0, 1, 0, + 96, 6, 0, 0, 2, 0, 1, 0, 11, 0, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 89, 6, 0, 0, 130, 0, 0, 0, + 93, 6, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 88, 6, 0, 0, 3, 0, 1, 0, - 116, 6, 0, 0, 2, 0, 1, 0, - 20, 0, 0, 0, 5, 0, 0, 0, + 92, 6, 0, 0, 3, 0, 1, 0, + 120, 6, 0, 0, 2, 0, 1, 0, + 19, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 113, 6, 0, 0, 82, 0, 0, 0, + 117, 6, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 112, 6, 0, 0, 3, 0, 1, 0, - 140, 6, 0, 0, 2, 0, 1, 0, - 21, 0, 0, 0, 6, 0, 0, 0, + 116, 6, 0, 0, 3, 0, 1, 0, + 144, 6, 0, 0, 2, 0, 1, 0, + 20, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 137, 6, 0, 0, 90, 0, 0, 0, + 141, 6, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 136, 6, 0, 0, 3, 0, 1, 0, - 164, 6, 0, 0, 2, 0, 1, 0, - 27, 0, 0, 0, 80, 0, 0, 0, + 140, 6, 0, 0, 3, 0, 1, 0, + 168, 6, 0, 0, 2, 0, 1, 0, + 26, 0, 0, 0, 80, 0, 0, 0, 0, 0, 1, 0, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 161, 6, 0, 0, 194, 0, 0, 0, + 165, 6, 0, 0, 194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 164, 6, 0, 0, 3, 0, 1, 0, - 176, 6, 0, 0, 2, 0, 1, 0, - 24, 0, 0, 0, 7, 0, 0, 0, + 168, 6, 0, 0, 3, 0, 1, 0, + 180, 6, 0, 0, 2, 0, 1, 0, + 23, 0, 0, 0, 7, 0, 0, 0, 0, 0, 1, 0, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 173, 6, 0, 0, 106, 0, 0, 0, + 177, 6, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 172, 6, 0, 0, 3, 0, 1, 0, - 200, 6, 0, 0, 2, 0, 1, 0, - 22, 0, 0, 0, 8, 0, 0, 0, + 176, 6, 0, 0, 3, 0, 1, 0, + 204, 6, 0, 0, 2, 0, 1, 0, + 21, 0, 0, 0, 8, 0, 0, 0, 0, 0, 1, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 197, 6, 0, 0, 82, 0, 0, 0, + 201, 6, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 196, 6, 0, 0, 3, 0, 1, 0, - 224, 6, 0, 0, 2, 0, 1, 0, + 200, 6, 0, 0, 3, 0, 1, 0, + 228, 6, 0, 0, 2, 0, 1, 0, 14, 0, 0, 0, 21, 0, 0, 0, 0, 0, 1, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 221, 6, 0, 0, 90, 0, 0, 0, + 225, 6, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 220, 6, 0, 0, 3, 0, 1, 0, - 232, 6, 0, 0, 2, 0, 1, 0, + 224, 6, 0, 0, 3, 0, 1, 0, + 236, 6, 0, 0, 2, 0, 1, 0, 4, 0, 0, 0, 196, 0, 0, 0, 0, 0, 1, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 229, 6, 0, 0, 122, 0, 0, 0, + 233, 6, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 228, 6, 0, 0, 3, 0, 1, 0, - 240, 6, 0, 0, 2, 0, 1, 0, + 232, 6, 0, 0, 3, 0, 1, 0, + 244, 6, 0, 0, 2, 0, 1, 0, 15, 0, 0, 0, 22, 0, 0, 0, 0, 0, 1, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 237, 6, 0, 0, 114, 0, 0, 0, + 241, 6, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 236, 6, 0, 0, 3, 0, 1, 0, - 248, 6, 0, 0, 2, 0, 1, 0, + 240, 6, 0, 0, 3, 0, 1, 0, + 252, 6, 0, 0, 2, 0, 1, 0, 3, 0, 0, 0, 9, 0, 0, 0, 0, 0, 1, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 245, 6, 0, 0, 106, 0, 0, 0, + 249, 6, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 244, 6, 0, 0, 3, 0, 1, 0, - 0, 7, 0, 0, 2, 0, 1, 0, - 23, 0, 0, 0, 23, 0, 0, 0, + 248, 6, 0, 0, 3, 0, 1, 0, + 4, 7, 0, 0, 2, 0, 1, 0, + 22, 0, 0, 0, 23, 0, 0, 0, 0, 0, 1, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 253, 6, 0, 0, 74, 0, 0, 0, + 1, 7, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 252, 6, 0, 0, 3, 0, 1, 0, - 8, 7, 0, 0, 2, 0, 1, 0, + 0, 7, 0, 0, 3, 0, 1, 0, + 12, 7, 0, 0, 2, 0, 1, 0, 99, 112, 117, 48, 68, 69, 80, 82, 69, 67, 65, 84, 69, 68, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, @@ -4219,7 +4240,8 @@ static const ::capnp::_::AlignedData<809> b_a4d8b5af2aa492eb = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 109, 98, 105, 101, 110, 116, 84, - 101, 109, 112, 67, 0, 0, 0, 0, + 101, 109, 112, 67, 68, 69, 80, 82, + 69, 67, 65, 84, 69, 68, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -4389,7 +4411,7 @@ static const ::capnp::_::RawSchema* const d_a4d8b5af2aa492eb[] = { static const uint16_t m_a4d8b5af2aa492eb[] = {30, 6, 15, 8, 9, 29, 16, 25, 18, 17, 0, 1, 2, 3, 26, 34, 20, 10, 7, 5, 27, 33, 32, 44, 4, 28, 19, 36, 31, 41, 43, 24, 22, 35, 23, 21, 39, 40, 37, 42, 11, 13, 14, 38, 12}; static const uint16_t i_a4d8b5af2aa492eb[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44}; const ::capnp::_::RawSchema s_a4d8b5af2aa492eb = { - 0xa4d8b5af2aa492eb, b_a4d8b5af2aa492eb.words, 809, d_a4d8b5af2aa492eb, m_a4d8b5af2aa492eb, + 0xa4d8b5af2aa492eb, b_a4d8b5af2aa492eb.words, 810, d_a4d8b5af2aa492eb, m_a4d8b5af2aa492eb, 6, 45, i_a4d8b5af2aa492eb, nullptr, nullptr, { &s_a4d8b5af2aa492eb, nullptr, nullptr, 0, 0, nullptr }, false }; #endif // !CAPNP_LITE @@ -22702,7 +22724,7 @@ const ::capnp::_::RawSchema s_b1fb80811a673270 = { 0, 25, i_b1fb80811a673270, nullptr, nullptr, { &s_b1fb80811a673270, nullptr, nullptr, 0, 0, nullptr }, false }; #endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<99> b_c95fb49a7bdc4618 = { +static const ::capnp::_::AlignedData<104> b_c95fb49a7bdc4618 = { { 0, 0, 0, 0, 5, 0, 6, 0, 24, 70, 220, 123, 154, 180, 95, 201, 10, 0, 0, 0, 1, 0, 5, 0, @@ -22720,43 +22742,44 @@ static const ::capnp::_::AlignedData<99> b_c95fb49a7bdc4618 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 20, 0, 0, 0, 3, 0, 4, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 125, 0, 0, 0, 114, 0, 0, 0, + 125, 0, 0, 0, 194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 124, 0, 0, 0, 3, 0, 1, 0, - 136, 0, 0, 0, 2, 0, 1, 0, - 1, 0, 0, 0, 1, 0, 0, 0, + 128, 0, 0, 0, 3, 0, 1, 0, + 140, 0, 0, 0, 2, 0, 1, 0, + 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 133, 0, 0, 0, 122, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 132, 0, 0, 0, 3, 0, 1, 0, - 144, 0, 0, 0, 2, 0, 1, 0, - 2, 0, 0, 0, 2, 0, 0, 0, - 0, 0, 1, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 141, 0, 0, 0, 146, 0, 0, 0, + 137, 0, 0, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 0, 0, 0, 3, 0, 1, 0, 156, 0, 0, 0, 2, 0, 1, 0, - 3, 0, 0, 0, 3, 0, 0, 0, + 3, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 1, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 0, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 3, 0, 1, 0, + 172, 0, 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 153, 0, 0, 0, 114, 0, 0, 0, + 169, 0, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 152, 0, 0, 0, 3, 0, 1, 0, - 164, 0, 0, 0, 2, 0, 1, 0, + 168, 0, 0, 0, 3, 0, 1, 0, + 180, 0, 0, 0, 2, 0, 1, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 161, 0, 0, 0, 146, 0, 0, 0, + 177, 0, 0, 0, 226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 164, 0, 0, 0, 3, 0, 1, 0, - 176, 0, 0, 0, 2, 0, 1, 0, + 184, 0, 0, 0, 3, 0, 1, 0, + 196, 0, 0, 0, 2, 0, 1, 0, 98, 111, 111, 116, 84, 105, 109, 101, - 78, 97, 110, 111, 115, 0, 0, 0, + 78, 97, 110, 111, 115, 68, 69, 80, + 82, 69, 67, 65, 84, 69, 68, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -22765,7 +22788,9 @@ static const ::capnp::_::AlignedData<99> b_c95fb49a7bdc4618 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 111, 110, 111, 116, 111, 110, 105, - 99, 78, 97, 110, 111, 115, 0, 0, + 99, 78, 97, 110, 111, 115, 68, 69, + 80, 82, 69, 67, 65, 84, 69, 68, + 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -22775,7 +22800,8 @@ static const ::capnp::_::AlignedData<99> b_c95fb49a7bdc4618 = { 0, 0, 0, 0, 0, 0, 0, 0, 109, 111, 110, 111, 116, 111, 110, 105, 99, 82, 97, 119, 78, 97, 110, 111, - 115, 0, 0, 0, 0, 0, 0, 0, + 115, 68, 69, 80, 82, 69, 67, 65, + 84, 68, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -22794,7 +22820,8 @@ static const ::capnp::_::AlignedData<99> b_c95fb49a7bdc4618 = { 0, 0, 0, 0, 0, 0, 0, 0, 109, 111, 100, 101, 109, 85, 112, 116, 105, 109, 101, 77, 105, 108, 108, 105, - 115, 0, 0, 0, 0, 0, 0, 0, + 115, 68, 69, 80, 82, 69, 67, 65, + 84, 69, 68, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -22808,7 +22835,7 @@ static const ::capnp::_::AlignedData<99> b_c95fb49a7bdc4618 = { static const uint16_t m_c95fb49a7bdc4618[] = {0, 4, 1, 2, 3}; static const uint16_t i_c95fb49a7bdc4618[] = {0, 1, 2, 3, 4}; const ::capnp::_::RawSchema s_c95fb49a7bdc4618 = { - 0xc95fb49a7bdc4618, b_c95fb49a7bdc4618.words, 99, nullptr, m_c95fb49a7bdc4618, + 0xc95fb49a7bdc4618, b_c95fb49a7bdc4618.words, 104, nullptr, m_c95fb49a7bdc4618, 0, 5, i_c95fb49a7bdc4618, nullptr, nullptr, { &s_c95fb49a7bdc4618, nullptr, nullptr, 0, 0, nullptr }, false }; #endif // !CAPNP_LITE @@ -27418,912 +27445,919 @@ const ::capnp::_::RawSchema s_dc24138990726023 = { 0, 4, i_dc24138990726023, nullptr, nullptr, { &s_dc24138990726023, nullptr, nullptr, 0, 0, nullptr }, false }; #endif // !CAPNP_LITE -static const ::capnp::_::AlignedData<2164> b_d314cfd957229c11 = { +static const ::capnp::_::AlignedData<2180> b_d314cfd957229c11 = { { 0, 0, 0, 0, 5, 0, 6, 0, 17, 156, 34, 87, 217, 207, 20, 211, 10, 0, 0, 0, 1, 0, 2, 0, 91, 40, 164, 37, 126, 241, 177, 243, - 1, 0, 7, 0, 0, 0, 125, 0, + 1, 0, 7, 0, 0, 0, 126, 0, 4, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 130, 0, 0, 0, 25, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 21, 0, 0, 0, 207, 27, 0, 0, + 21, 0, 0, 0, 7, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 111, 103, 46, 99, 97, 112, 110, 112, 58, 69, 118, 101, 110, 116, 0, 0, 0, 0, 0, 1, 0, 1, 0, - 252, 1, 0, 0, 3, 0, 4, 0, + 0, 2, 0, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 213, 13, 0, 0, 98, 0, 0, 0, + 241, 13, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 212, 13, 0, 0, 3, 0, 1, 0, - 224, 13, 0, 0, 2, 0, 1, 0, + 240, 13, 0, 0, 3, 0, 1, 0, + 252, 13, 0, 0, 2, 0, 1, 0, 2, 0, 255, 255, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 221, 13, 0, 0, 74, 0, 0, 0, + 249, 13, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 220, 13, 0, 0, 3, 0, 1, 0, - 232, 13, 0, 0, 2, 0, 1, 0, - 43, 0, 254, 255, 0, 0, 0, 0, + 248, 13, 0, 0, 3, 0, 1, 0, + 4, 14, 0, 0, 2, 0, 1, 0, + 44, 0, 254, 255, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 229, 13, 0, 0, 130, 0, 0, 0, + 1, 14, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 228, 13, 0, 0, 3, 0, 1, 0, - 240, 13, 0, 0, 2, 0, 1, 0, + 0, 14, 0, 0, 3, 0, 1, 0, + 12, 14, 0, 0, 2, 0, 1, 0, 5, 0, 253, 255, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 237, 13, 0, 0, 66, 0, 0, 0, + 9, 14, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 232, 13, 0, 0, 3, 0, 1, 0, - 244, 13, 0, 0, 2, 0, 1, 0, - 95, 0, 252, 255, 0, 0, 0, 0, + 4, 14, 0, 0, 3, 0, 1, 0, + 16, 14, 0, 0, 2, 0, 1, 0, + 96, 0, 252, 255, 0, 0, 0, 0, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 241, 13, 0, 0, 178, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 244, 13, 0, 0, 3, 0, 1, 0, - 0, 14, 0, 0, 2, 0, 1, 0, - 6, 0, 251, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 5, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 253, 13, 0, 0, 34, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 248, 13, 0, 0, 3, 0, 1, 0, - 20, 14, 0, 0, 2, 0, 1, 0, - 59, 0, 250, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 6, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 17, 14, 0, 0, 98, 0, 0, 0, + 13, 14, 0, 0, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 14, 0, 0, 3, 0, 1, 0, 28, 14, 0, 0, 2, 0, 1, 0, + 6, 0, 251, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 25, 14, 0, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 20, 14, 0, 0, 3, 0, 1, 0, + 48, 14, 0, 0, 2, 0, 1, 0, + 60, 0, 250, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 14, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 44, 14, 0, 0, 3, 0, 1, 0, + 56, 14, 0, 0, 2, 0, 1, 0, 7, 0, 249, 255, 0, 0, 0, 0, 0, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 25, 14, 0, 0, 114, 0, 0, 0, + 53, 14, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 24, 14, 0, 0, 3, 0, 1, 0, - 36, 14, 0, 0, 2, 0, 1, 0, - 96, 0, 248, 255, 0, 0, 0, 0, + 52, 14, 0, 0, 3, 0, 1, 0, + 64, 14, 0, 0, 2, 0, 1, 0, + 97, 0, 248, 255, 0, 0, 0, 0, 0, 0, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 33, 14, 0, 0, 162, 0, 0, 0, + 61, 14, 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 36, 14, 0, 0, 3, 0, 1, 0, - 64, 14, 0, 0, 2, 0, 1, 0, - 89, 0, 247, 255, 0, 0, 0, 0, + 64, 14, 0, 0, 3, 0, 1, 0, + 92, 14, 0, 0, 2, 0, 1, 0, + 90, 0, 247, 255, 0, 0, 0, 0, 0, 0, 1, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 14, 0, 0, 50, 0, 0, 0, + 89, 14, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 56, 14, 0, 0, 3, 0, 1, 0, - 68, 14, 0, 0, 2, 0, 1, 0, - 120, 0, 246, 255, 0, 0, 0, 0, + 84, 14, 0, 0, 3, 0, 1, 0, + 96, 14, 0, 0, 2, 0, 1, 0, + 121, 0, 246, 255, 0, 0, 0, 0, 0, 0, 1, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 65, 14, 0, 0, 154, 0, 0, 0, + 93, 14, 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 14, 0, 0, 3, 0, 1, 0, - 80, 14, 0, 0, 2, 0, 1, 0, - 125, 0, 245, 255, 0, 0, 0, 0, + 96, 14, 0, 0, 3, 0, 1, 0, + 108, 14, 0, 0, 2, 0, 1, 0, + 126, 0, 245, 255, 0, 0, 0, 0, 0, 0, 1, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 77, 14, 0, 0, 186, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 80, 14, 0, 0, 3, 0, 1, 0, - 108, 14, 0, 0, 2, 0, 1, 0, - 123, 0, 244, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 12, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 105, 14, 0, 0, 170, 0, 0, 0, + 105, 14, 0, 0, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 14, 0, 0, 3, 0, 1, 0, - 120, 14, 0, 0, 2, 0, 1, 0, - 18, 0, 243, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 13, 0, 0, 0, + 136, 14, 0, 0, 2, 0, 1, 0, + 124, 0, 244, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 117, 14, 0, 0, 90, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 116, 14, 0, 0, 3, 0, 1, 0, - 128, 14, 0, 0, 2, 0, 1, 0, - 94, 0, 242, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 14, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 125, 14, 0, 0, 138, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 14, 0, 0, 3, 0, 1, 0, - 140, 14, 0, 0, 2, 0, 1, 0, - 46, 0, 241, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 15, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 137, 14, 0, 0, 114, 0, 0, 0, + 133, 14, 0, 0, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 136, 14, 0, 0, 3, 0, 1, 0, 148, 14, 0, 0, 2, 0, 1, 0, - 19, 0, 240, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 16, 0, 0, 0, + 18, 0, 243, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145, 14, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 14, 0, 0, 3, 0, 1, 0, - 172, 14, 0, 0, 2, 0, 1, 0, + 156, 14, 0, 0, 2, 0, 1, 0, + 95, 0, 242, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 153, 14, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 14, 0, 0, 3, 0, 1, 0, + 168, 14, 0, 0, 2, 0, 1, 0, + 47, 0, 241, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 14, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 14, 0, 0, 3, 0, 1, 0, + 176, 14, 0, 0, 2, 0, 1, 0, + 19, 0, 240, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 14, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 172, 14, 0, 0, 3, 0, 1, 0, + 200, 14, 0, 0, 2, 0, 1, 0, 20, 0, 239, 255, 0, 0, 0, 0, 0, 0, 1, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 169, 14, 0, 0, 66, 0, 0, 0, + 197, 14, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 164, 14, 0, 0, 3, 0, 1, 0, - 192, 14, 0, 0, 2, 0, 1, 0, - 60, 0, 238, 255, 0, 0, 0, 0, + 192, 14, 0, 0, 3, 0, 1, 0, + 220, 14, 0, 0, 2, 0, 1, 0, + 61, 0, 238, 255, 0, 0, 0, 0, 0, 0, 1, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 189, 14, 0, 0, 90, 0, 0, 0, + 217, 14, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 188, 14, 0, 0, 3, 0, 1, 0, - 200, 14, 0, 0, 2, 0, 1, 0, + 216, 14, 0, 0, 3, 0, 1, 0, + 228, 14, 0, 0, 2, 0, 1, 0, 21, 0, 237, 255, 0, 0, 0, 0, 0, 0, 1, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 197, 14, 0, 0, 130, 0, 0, 0, + 225, 14, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 196, 14, 0, 0, 3, 0, 1, 0, - 208, 14, 0, 0, 2, 0, 1, 0, - 54, 0, 236, 255, 0, 0, 0, 0, + 224, 14, 0, 0, 3, 0, 1, 0, + 236, 14, 0, 0, 2, 0, 1, 0, + 55, 0, 236, 255, 0, 0, 0, 0, 0, 0, 1, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 205, 14, 0, 0, 90, 0, 0, 0, + 233, 14, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 204, 14, 0, 0, 3, 0, 1, 0, - 216, 14, 0, 0, 2, 0, 1, 0, - 30, 0, 235, 255, 0, 0, 0, 0, + 232, 14, 0, 0, 3, 0, 1, 0, + 244, 14, 0, 0, 2, 0, 1, 0, + 31, 0, 235, 255, 0, 0, 0, 0, 0, 0, 1, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 213, 14, 0, 0, 98, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 212, 14, 0, 0, 3, 0, 1, 0, - 224, 14, 0, 0, 2, 0, 1, 0, - 22, 0, 234, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 22, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 221, 14, 0, 0, 74, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 220, 14, 0, 0, 3, 0, 1, 0, - 232, 14, 0, 0, 2, 0, 1, 0, - 23, 0, 233, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 23, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 229, 14, 0, 0, 90, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 228, 14, 0, 0, 3, 0, 1, 0, - 240, 14, 0, 0, 2, 0, 1, 0, - 24, 0, 232, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 24, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 237, 14, 0, 0, 138, 0, 0, 0, + 241, 14, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 14, 0, 0, 3, 0, 1, 0, 252, 14, 0, 0, 2, 0, 1, 0, - 97, 0, 231, 255, 0, 0, 0, 0, + 22, 0, 234, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 14, 0, 0, 74, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 14, 0, 0, 3, 0, 1, 0, + 4, 15, 0, 0, 2, 0, 1, 0, + 23, 0, 233, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 23, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 15, 0, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 3, 0, 1, 0, + 12, 15, 0, 0, 2, 0, 1, 0, + 25, 0, 232, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 24, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 15, 0, 0, 138, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 15, 0, 0, 3, 0, 1, 0, + 24, 15, 0, 0, 2, 0, 1, 0, + 98, 0, 231, 255, 0, 0, 0, 0, 0, 0, 1, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 249, 14, 0, 0, 186, 0, 0, 0, + 21, 15, 0, 0, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 252, 14, 0, 0, 3, 0, 1, 0, - 8, 15, 0, 0, 2, 0, 1, 0, - 98, 0, 230, 255, 0, 0, 0, 0, + 24, 15, 0, 0, 3, 0, 1, 0, + 36, 15, 0, 0, 2, 0, 1, 0, + 99, 0, 230, 255, 0, 0, 0, 0, 0, 0, 1, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 15, 0, 0, 186, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 8, 15, 0, 0, 3, 0, 1, 0, - 36, 15, 0, 0, 2, 0, 1, 0, - 112, 0, 229, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 27, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 33, 15, 0, 0, 162, 0, 0, 0, + 33, 15, 0, 0, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 15, 0, 0, 3, 0, 1, 0, - 48, 15, 0, 0, 2, 0, 1, 0, - 99, 0, 228, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 28, 0, 0, 0, + 64, 15, 0, 0, 2, 0, 1, 0, + 113, 0, 229, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 45, 15, 0, 0, 154, 0, 0, 0, + 61, 15, 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 48, 15, 0, 0, 3, 0, 1, 0, + 64, 15, 0, 0, 3, 0, 1, 0, 76, 15, 0, 0, 2, 0, 1, 0, - 100, 0, 227, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 29, 0, 0, 0, + 100, 0, 228, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, 15, 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 76, 15, 0, 0, 3, 0, 1, 0, 104, 15, 0, 0, 2, 0, 1, 0, - 106, 0, 226, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 30, 0, 0, 0, + 101, 0, 227, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 101, 15, 0, 0, 178, 0, 0, 0, + 101, 15, 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 15, 0, 0, 3, 0, 1, 0, - 116, 15, 0, 0, 2, 0, 1, 0, - 28, 0, 225, 255, 0, 0, 0, 0, + 132, 15, 0, 0, 2, 0, 1, 0, + 107, 0, 226, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 30, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 129, 15, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 132, 15, 0, 0, 3, 0, 1, 0, + 144, 15, 0, 0, 2, 0, 1, 0, + 29, 0, 225, 255, 0, 0, 0, 0, 0, 0, 1, 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 113, 15, 0, 0, 74, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 112, 15, 0, 0, 3, 0, 1, 0, - 124, 15, 0, 0, 2, 0, 1, 0, - 107, 0, 224, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 121, 15, 0, 0, 154, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 124, 15, 0, 0, 3, 0, 1, 0, - 136, 15, 0, 0, 2, 0, 1, 0, - 57, 0, 223, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 33, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 133, 15, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 15, 0, 0, 3, 0, 1, 0, - 140, 15, 0, 0, 2, 0, 1, 0, - 26, 0, 222, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 34, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 137, 15, 0, 0, 82, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 136, 15, 0, 0, 3, 0, 1, 0, - 148, 15, 0, 0, 2, 0, 1, 0, - 58, 0, 221, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 35, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 145, 15, 0, 0, 58, 0, 0, 0, + 141, 15, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, 15, 0, 0, 3, 0, 1, 0, 152, 15, 0, 0, 2, 0, 1, 0, - 90, 0, 220, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 36, 0, 0, 0, + 108, 0, 224, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 149, 15, 0, 0, 146, 0, 0, 0, + 149, 15, 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 152, 15, 0, 0, 3, 0, 1, 0, 164, 15, 0, 0, 2, 0, 1, 0, - 91, 0, 219, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 37, 0, 0, 0, + 58, 0, 223, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 33, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 161, 15, 0, 0, 242, 0, 0, 0, + 161, 15, 0, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 156, 15, 0, 0, 3, 0, 1, 0, + 168, 15, 0, 0, 2, 0, 1, 0, + 27, 0, 222, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 34, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 165, 15, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 164, 15, 0, 0, 3, 0, 1, 0, + 176, 15, 0, 0, 2, 0, 1, 0, + 59, 0, 221, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 35, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 173, 15, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 168, 15, 0, 0, 3, 0, 1, 0, 180, 15, 0, 0, 2, 0, 1, 0, - 108, 0, 218, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 38, 0, 0, 0, + 91, 0, 220, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 177, 15, 0, 0, 162, 0, 0, 0, + 177, 15, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 15, 0, 0, 3, 0, 1, 0, 192, 15, 0, 0, 2, 0, 1, 0, - 27, 0, 217, 255, 0, 0, 0, 0, + 92, 0, 219, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 37, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 189, 15, 0, 0, 242, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 15, 0, 0, 3, 0, 1, 0, + 208, 15, 0, 0, 2, 0, 1, 0, + 109, 0, 218, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 38, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 15, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 15, 0, 0, 3, 0, 1, 0, + 220, 15, 0, 0, 2, 0, 1, 0, + 28, 0, 217, 255, 0, 0, 0, 0, 0, 0, 1, 0, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 189, 15, 0, 0, 74, 0, 0, 0, + 217, 15, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 188, 15, 0, 0, 3, 0, 1, 0, - 200, 15, 0, 0, 2, 0, 1, 0, - 103, 0, 216, 255, 0, 0, 0, 0, + 216, 15, 0, 0, 3, 0, 1, 0, + 228, 15, 0, 0, 2, 0, 1, 0, + 104, 0, 216, 255, 0, 0, 0, 0, 0, 0, 1, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 197, 15, 0, 0, 218, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 204, 15, 0, 0, 3, 0, 1, 0, - 216, 15, 0, 0, 2, 0, 1, 0, - 104, 0, 215, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 41, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 213, 15, 0, 0, 202, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 220, 15, 0, 0, 3, 0, 1, 0, - 232, 15, 0, 0, 2, 0, 1, 0, - 105, 0, 214, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 42, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 229, 15, 0, 0, 178, 0, 0, 0, + 225, 15, 0, 0, 218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 15, 0, 0, 3, 0, 1, 0, 244, 15, 0, 0, 2, 0, 1, 0, - 109, 0, 213, 255, 0, 0, 0, 0, + 105, 0, 215, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 41, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 241, 15, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 248, 15, 0, 0, 3, 0, 1, 0, + 4, 16, 0, 0, 2, 0, 1, 0, + 106, 0, 214, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 16, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 16, 0, 0, 3, 0, 1, 0, + 16, 16, 0, 0, 2, 0, 1, 0, + 110, 0, 213, 255, 0, 0, 0, 0, 0, 0, 1, 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 241, 15, 0, 0, 194, 0, 0, 0, + 13, 16, 0, 0, 194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 244, 15, 0, 0, 3, 0, 1, 0, - 16, 16, 0, 0, 2, 0, 1, 0, - 110, 0, 212, 255, 0, 0, 0, 0, + 16, 16, 0, 0, 3, 0, 1, 0, + 44, 16, 0, 0, 2, 0, 1, 0, + 111, 0, 212, 255, 0, 0, 0, 0, 0, 0, 1, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 13, 16, 0, 0, 234, 0, 0, 0, + 41, 16, 0, 0, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 20, 16, 0, 0, 3, 0, 1, 0, - 32, 16, 0, 0, 2, 0, 1, 0, - 93, 0, 211, 255, 0, 0, 0, 0, + 48, 16, 0, 0, 3, 0, 1, 0, + 60, 16, 0, 0, 2, 0, 1, 0, + 94, 0, 211, 255, 0, 0, 0, 0, 0, 0, 1, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 29, 16, 0, 0, 226, 0, 0, 0, + 57, 16, 0, 0, 226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 36, 16, 0, 0, 3, 0, 1, 0, - 48, 16, 0, 0, 2, 0, 1, 0, - 111, 0, 210, 255, 0, 0, 0, 0, + 64, 16, 0, 0, 3, 0, 1, 0, + 76, 16, 0, 0, 2, 0, 1, 0, + 112, 0, 210, 255, 0, 0, 0, 0, 0, 0, 1, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 45, 16, 0, 0, 2, 1, 0, 0, + 73, 16, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 52, 16, 0, 0, 3, 0, 1, 0, - 64, 16, 0, 0, 2, 0, 1, 0, - 113, 0, 209, 255, 0, 0, 0, 0, + 80, 16, 0, 0, 3, 0, 1, 0, + 92, 16, 0, 0, 2, 0, 1, 0, + 114, 0, 209, 255, 0, 0, 0, 0, 0, 0, 1, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 16, 0, 0, 202, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 68, 16, 0, 0, 3, 0, 1, 0, - 96, 16, 0, 0, 2, 0, 1, 0, - 29, 0, 208, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 48, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 93, 16, 0, 0, 162, 0, 0, 0, + 89, 16, 0, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 16, 0, 0, 3, 0, 1, 0, - 108, 16, 0, 0, 2, 0, 1, 0, - 114, 0, 207, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 49, 0, 0, 0, + 124, 16, 0, 0, 2, 0, 1, 0, + 30, 0, 208, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 105, 16, 0, 0, 154, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 108, 16, 0, 0, 3, 0, 1, 0, - 120, 16, 0, 0, 2, 0, 1, 0, - 101, 0, 206, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 50, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 117, 16, 0, 0, 226, 0, 0, 0, + 121, 16, 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 16, 0, 0, 3, 0, 1, 0, 136, 16, 0, 0, 2, 0, 1, 0, - 92, 0, 205, 255, 0, 0, 0, 0, + 115, 0, 207, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 49, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 133, 16, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 136, 16, 0, 0, 3, 0, 1, 0, + 148, 16, 0, 0, 2, 0, 1, 0, + 102, 0, 206, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 145, 16, 0, 0, 226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 152, 16, 0, 0, 3, 0, 1, 0, + 164, 16, 0, 0, 2, 0, 1, 0, + 93, 0, 205, 255, 0, 0, 0, 0, 0, 0, 1, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 133, 16, 0, 0, 234, 0, 0, 0, + 161, 16, 0, 0, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 140, 16, 0, 0, 3, 0, 1, 0, - 152, 16, 0, 0, 2, 0, 1, 0, - 68, 0, 204, 255, 0, 0, 0, 0, + 168, 16, 0, 0, 3, 0, 1, 0, + 180, 16, 0, 0, 2, 0, 1, 0, + 69, 0, 204, 255, 0, 0, 0, 0, 0, 0, 1, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 149, 16, 0, 0, 106, 0, 0, 0, + 177, 16, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 148, 16, 0, 0, 3, 0, 1, 0, - 160, 16, 0, 0, 2, 0, 1, 0, - 115, 0, 203, 255, 0, 0, 0, 0, + 176, 16, 0, 0, 3, 0, 1, 0, + 188, 16, 0, 0, 2, 0, 1, 0, + 116, 0, 203, 255, 0, 0, 0, 0, 0, 0, 1, 0, 53, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 157, 16, 0, 0, 178, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 160, 16, 0, 0, 3, 0, 1, 0, - 172, 16, 0, 0, 2, 0, 1, 0, - 116, 0, 202, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 54, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 169, 16, 0, 0, 178, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 172, 16, 0, 0, 3, 0, 1, 0, - 184, 16, 0, 0, 2, 0, 1, 0, - 117, 0, 201, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 55, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 181, 16, 0, 0, 218, 0, 0, 0, + 185, 16, 0, 0, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 188, 16, 0, 0, 3, 0, 1, 0, 200, 16, 0, 0, 2, 0, 1, 0, - 118, 0, 200, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 56, 0, 0, 0, + 117, 0, 202, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 197, 16, 0, 0, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 16, 0, 0, 3, 0, 1, 0, 212, 16, 0, 0, 2, 0, 1, 0, - 122, 0, 199, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 57, 0, 0, 0, + 118, 0, 201, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 209, 16, 0, 0, 194, 0, 0, 0, + 209, 16, 0, 0, 218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 212, 16, 0, 0, 3, 0, 1, 0, - 224, 16, 0, 0, 2, 0, 1, 0, - 119, 0, 198, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 58, 0, 0, 0, + 216, 16, 0, 0, 3, 0, 1, 0, + 228, 16, 0, 0, 2, 0, 1, 0, + 119, 0, 200, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 221, 16, 0, 0, 234, 0, 0, 0, + 225, 16, 0, 0, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 228, 16, 0, 0, 3, 0, 1, 0, 240, 16, 0, 0, 2, 0, 1, 0, - 124, 0, 197, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 59, 0, 0, 0, + 123, 0, 199, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 237, 16, 0, 0, 178, 0, 0, 0, + 237, 16, 0, 0, 194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 16, 0, 0, 3, 0, 1, 0, 252, 16, 0, 0, 2, 0, 1, 0, + 120, 0, 198, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 58, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 16, 0, 0, 234, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 17, 0, 0, 3, 0, 1, 0, + 12, 17, 0, 0, 2, 0, 1, 0, + 125, 0, 197, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 59, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 9, 17, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 17, 0, 0, 3, 0, 1, 0, + 24, 17, 0, 0, 2, 0, 1, 0, 4, 0, 196, 255, 0, 0, 0, 0, 0, 0, 1, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 249, 16, 0, 0, 42, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 244, 16, 0, 0, 3, 0, 1, 0, - 0, 17, 0, 0, 2, 0, 1, 0, - 32, 0, 195, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 61, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 253, 16, 0, 0, 122, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 252, 16, 0, 0, 3, 0, 1, 0, - 8, 17, 0, 0, 2, 0, 1, 0, - 102, 0, 194, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 62, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 5, 17, 0, 0, 178, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 8, 17, 0, 0, 3, 0, 1, 0, - 20, 17, 0, 0, 2, 0, 1, 0, - 34, 0, 193, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 63, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 17, 17, 0, 0, 122, 0, 0, 0, + 21, 17, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 0, 0, 3, 0, 1, 0, 28, 17, 0, 0, 2, 0, 1, 0, - 126, 0, 192, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 64, 0, 0, 0, + 33, 0, 195, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 25, 17, 0, 0, 178, 0, 0, 0, + 25, 17, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 28, 17, 0, 0, 3, 0, 1, 0, - 40, 17, 0, 0, 2, 0, 1, 0, - 121, 0, 191, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 65, 0, 0, 0, + 24, 17, 0, 0, 3, 0, 1, 0, + 36, 17, 0, 0, 2, 0, 1, 0, + 103, 0, 194, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 37, 17, 0, 0, 202, 0, 0, 0, + 33, 17, 0, 0, 178, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 36, 17, 0, 0, 3, 0, 1, 0, + 48, 17, 0, 0, 2, 0, 1, 0, + 35, 0, 193, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 63, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 17, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 17, 0, 0, 3, 0, 1, 0, 56, 17, 0, 0, 2, 0, 1, 0, - 35, 0, 190, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 66, 0, 0, 0, + 127, 0, 192, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 53, 17, 0, 0, 82, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 52, 17, 0, 0, 3, 0, 1, 0, - 64, 17, 0, 0, 2, 0, 1, 0, - 1, 0, 0, 0, 80, 0, 0, 0, - 0, 0, 1, 0, 67, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, - 61, 17, 0, 0, 50, 0, 0, 0, + 53, 17, 0, 0, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 17, 0, 0, 3, 0, 1, 0, 68, 17, 0, 0, 2, 0, 1, 0, - 36, 0, 189, 255, 0, 0, 0, 0, + 122, 0, 191, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 65, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 65, 17, 0, 0, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 72, 17, 0, 0, 3, 0, 1, 0, + 84, 17, 0, 0, 2, 0, 1, 0, + 36, 0, 190, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 66, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 81, 17, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 80, 17, 0, 0, 3, 0, 1, 0, + 92, 17, 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 80, 0, 0, 0, + 0, 0, 1, 0, 67, 0, 0, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 89, 17, 0, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 84, 17, 0, 0, 3, 0, 1, 0, + 96, 17, 0, 0, 2, 0, 1, 0, + 37, 0, 189, 255, 0, 0, 0, 0, 0, 0, 1, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 65, 17, 0, 0, 106, 0, 0, 0, + 93, 17, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 64, 17, 0, 0, 3, 0, 1, 0, - 92, 17, 0, 0, 2, 0, 1, 0, - 37, 0, 188, 255, 0, 0, 0, 0, + 92, 17, 0, 0, 3, 0, 1, 0, + 120, 17, 0, 0, 2, 0, 1, 0, + 38, 0, 188, 255, 0, 0, 0, 0, 0, 0, 1, 0, 69, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 89, 17, 0, 0, 82, 0, 0, 0, + 117, 17, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 88, 17, 0, 0, 3, 0, 1, 0, - 100, 17, 0, 0, 2, 0, 1, 0, - 44, 0, 187, 255, 0, 0, 0, 0, + 116, 17, 0, 0, 3, 0, 1, 0, + 128, 17, 0, 0, 2, 0, 1, 0, + 45, 0, 187, 255, 0, 0, 0, 0, 0, 0, 1, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 97, 17, 0, 0, 146, 0, 0, 0, + 125, 17, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 100, 17, 0, 0, 3, 0, 1, 0, - 112, 17, 0, 0, 2, 0, 1, 0, - 38, 0, 186, 255, 0, 0, 0, 0, + 128, 17, 0, 0, 3, 0, 1, 0, + 140, 17, 0, 0, 2, 0, 1, 0, + 39, 0, 186, 255, 0, 0, 0, 0, 0, 0, 1, 0, 71, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 109, 17, 0, 0, 178, 0, 0, 0, + 137, 17, 0, 0, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 112, 17, 0, 0, 3, 0, 1, 0, - 124, 17, 0, 0, 2, 0, 1, 0, - 39, 0, 185, 255, 0, 0, 0, 0, + 140, 17, 0, 0, 3, 0, 1, 0, + 152, 17, 0, 0, 2, 0, 1, 0, + 40, 0, 185, 255, 0, 0, 0, 0, 0, 0, 1, 0, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 121, 17, 0, 0, 154, 0, 0, 0, + 149, 17, 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 124, 17, 0, 0, 3, 0, 1, 0, - 136, 17, 0, 0, 2, 0, 1, 0, + 152, 17, 0, 0, 3, 0, 1, 0, + 164, 17, 0, 0, 2, 0, 1, 0, 3, 0, 184, 255, 0, 0, 0, 0, 0, 0, 1, 0, 73, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 133, 17, 0, 0, 74, 0, 0, 0, + 161, 17, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 132, 17, 0, 0, 3, 0, 1, 0, - 144, 17, 0, 0, 2, 0, 1, 0, - 45, 0, 183, 255, 0, 0, 0, 0, + 160, 17, 0, 0, 3, 0, 1, 0, + 172, 17, 0, 0, 2, 0, 1, 0, + 46, 0, 183, 255, 0, 0, 0, 0, 0, 0, 1, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 141, 17, 0, 0, 162, 0, 0, 0, + 169, 17, 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 144, 17, 0, 0, 3, 0, 1, 0, - 156, 17, 0, 0, 2, 0, 1, 0, - 40, 0, 182, 255, 0, 0, 0, 0, + 172, 17, 0, 0, 3, 0, 1, 0, + 184, 17, 0, 0, 2, 0, 1, 0, + 41, 0, 182, 255, 0, 0, 0, 0, 0, 0, 1, 0, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 153, 17, 0, 0, 66, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 148, 17, 0, 0, 3, 0, 1, 0, - 160, 17, 0, 0, 2, 0, 1, 0, - 47, 0, 181, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 76, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 157, 17, 0, 0, 130, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 156, 17, 0, 0, 3, 0, 1, 0, - 168, 17, 0, 0, 2, 0, 1, 0, - 48, 0, 180, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 77, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 165, 17, 0, 0, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 168, 17, 0, 0, 3, 0, 1, 0, - 180, 17, 0, 0, 2, 0, 1, 0, - 55, 0, 179, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 78, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 177, 17, 0, 0, 106, 0, 0, 0, + 181, 17, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 176, 17, 0, 0, 3, 0, 1, 0, 188, 17, 0, 0, 2, 0, 1, 0, - 56, 0, 178, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 79, 0, 0, 0, + 48, 0, 181, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 185, 17, 0, 0, 114, 0, 0, 0, + 185, 17, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 184, 17, 0, 0, 3, 0, 1, 0, 196, 17, 0, 0, 2, 0, 1, 0, + 49, 0, 180, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 77, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 193, 17, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 17, 0, 0, 3, 0, 1, 0, + 208, 17, 0, 0, 2, 0, 1, 0, + 56, 0, 179, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 78, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 17, 0, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 204, 17, 0, 0, 3, 0, 1, 0, + 216, 17, 0, 0, 2, 0, 1, 0, + 57, 0, 178, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 79, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 213, 17, 0, 0, 114, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 212, 17, 0, 0, 3, 0, 1, 0, + 224, 17, 0, 0, 2, 0, 1, 0, 17, 0, 177, 255, 0, 0, 0, 0, 0, 0, 1, 0, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 193, 17, 0, 0, 130, 0, 0, 0, + 221, 17, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 192, 17, 0, 0, 3, 0, 1, 0, - 204, 17, 0, 0, 2, 0, 1, 0, + 220, 17, 0, 0, 3, 0, 1, 0, + 232, 17, 0, 0, 2, 0, 1, 0, 16, 0, 176, 255, 0, 0, 0, 0, 0, 0, 1, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 201, 17, 0, 0, 98, 0, 0, 0, + 229, 17, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 200, 17, 0, 0, 3, 0, 1, 0, - 228, 17, 0, 0, 2, 0, 1, 0, - 62, 0, 175, 255, 0, 0, 0, 0, + 228, 17, 0, 0, 3, 0, 1, 0, + 0, 18, 0, 0, 2, 0, 1, 0, + 63, 0, 175, 255, 0, 0, 0, 0, 0, 0, 1, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 225, 17, 0, 0, 122, 0, 0, 0, + 253, 17, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 224, 17, 0, 0, 3, 0, 1, 0, - 236, 17, 0, 0, 2, 0, 1, 0, - 63, 0, 174, 255, 0, 0, 0, 0, + 252, 17, 0, 0, 3, 0, 1, 0, + 8, 18, 0, 0, 2, 0, 1, 0, + 64, 0, 174, 255, 0, 0, 0, 0, 0, 0, 1, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 233, 17, 0, 0, 74, 0, 0, 0, + 5, 18, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 232, 17, 0, 0, 3, 0, 1, 0, - 244, 17, 0, 0, 2, 0, 1, 0, - 64, 0, 173, 255, 0, 0, 0, 0, + 4, 18, 0, 0, 3, 0, 1, 0, + 16, 18, 0, 0, 2, 0, 1, 0, + 65, 0, 173, 255, 0, 0, 0, 0, 0, 0, 1, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 241, 17, 0, 0, 106, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 240, 17, 0, 0, 3, 0, 1, 0, - 252, 17, 0, 0, 2, 0, 1, 0, - 61, 0, 172, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 85, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 249, 17, 0, 0, 130, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 248, 17, 0, 0, 3, 0, 1, 0, - 4, 18, 0, 0, 2, 0, 1, 0, - 69, 0, 171, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 86, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 18, 0, 0, 122, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 18, 0, 0, 3, 0, 1, 0, - 12, 18, 0, 0, 2, 0, 1, 0, - 70, 0, 170, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 87, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 9, 18, 0, 0, 138, 0, 0, 0, + 13, 18, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 18, 0, 0, 3, 0, 1, 0, 24, 18, 0, 0, 2, 0, 1, 0, - 71, 0, 169, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 88, 0, 0, 0, + 62, 0, 172, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 21, 18, 0, 0, 154, 0, 0, 0, + 21, 18, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 24, 18, 0, 0, 3, 0, 1, 0, - 36, 18, 0, 0, 2, 0, 1, 0, - 72, 0, 168, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 89, 0, 0, 0, + 20, 18, 0, 0, 3, 0, 1, 0, + 32, 18, 0, 0, 2, 0, 1, 0, + 70, 0, 171, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 33, 18, 0, 0, 130, 0, 0, 0, + 29, 18, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 32, 18, 0, 0, 3, 0, 1, 0, - 44, 18, 0, 0, 2, 0, 1, 0, - 49, 0, 167, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 90, 0, 0, 0, + 28, 18, 0, 0, 3, 0, 1, 0, + 40, 18, 0, 0, 2, 0, 1, 0, + 71, 0, 170, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 41, 18, 0, 0, 122, 0, 0, 0, + 37, 18, 0, 0, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 18, 0, 0, 3, 0, 1, 0, 52, 18, 0, 0, 2, 0, 1, 0, - 31, 0, 166, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 91, 0, 0, 0, + 72, 0, 169, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 49, 18, 0, 0, 138, 0, 0, 0, + 49, 18, 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52, 18, 0, 0, 3, 0, 1, 0, 64, 18, 0, 0, 2, 0, 1, 0, - 41, 0, 165, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 92, 0, 0, 0, + 73, 0, 168, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 18, 0, 0, 114, 0, 0, 0, + 61, 18, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 18, 0, 0, 3, 0, 1, 0, 72, 18, 0, 0, 2, 0, 1, 0, - 66, 0, 164, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 93, 0, 0, 0, + 50, 0, 167, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 69, 18, 0, 0, 74, 0, 0, 0, + 69, 18, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 18, 0, 0, 3, 0, 1, 0, 80, 18, 0, 0, 2, 0, 1, 0, - 33, 0, 163, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 94, 0, 0, 0, + 32, 0, 166, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 77, 18, 0, 0, 170, 0, 0, 0, + 77, 18, 0, 0, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 18, 0, 0, 3, 0, 1, 0, 92, 18, 0, 0, 2, 0, 1, 0, - 12, 0, 162, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 95, 0, 0, 0, + 42, 0, 165, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 89, 18, 0, 0, 106, 0, 0, 0, + 89, 18, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 18, 0, 0, 3, 0, 1, 0, 100, 18, 0, 0, 2, 0, 1, 0, - 13, 0, 161, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 96, 0, 0, 0, + 67, 0, 164, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 97, 18, 0, 0, 98, 0, 0, 0, + 97, 18, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 18, 0, 0, 3, 0, 1, 0, 108, 18, 0, 0, 2, 0, 1, 0, - 14, 0, 160, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 97, 0, 0, 0, + 34, 0, 163, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 105, 18, 0, 0, 146, 0, 0, 0, + 105, 18, 0, 0, 170, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 18, 0, 0, 3, 0, 1, 0, 120, 18, 0, 0, 2, 0, 1, 0, - 10, 0, 159, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 98, 0, 0, 0, + 12, 0, 162, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 117, 18, 0, 0, 114, 0, 0, 0, + 117, 18, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 116, 18, 0, 0, 3, 0, 1, 0, 128, 18, 0, 0, 2, 0, 1, 0, - 8, 0, 158, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 99, 0, 0, 0, + 13, 0, 161, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 125, 18, 0, 0, 82, 0, 0, 0, + 125, 18, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 18, 0, 0, 3, 0, 1, 0, 136, 18, 0, 0, 2, 0, 1, 0, - 9, 0, 157, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 100, 0, 0, 0, + 14, 0, 160, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 97, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 133, 18, 0, 0, 90, 0, 0, 0, + 133, 18, 0, 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 132, 18, 0, 0, 3, 0, 1, 0, - 144, 18, 0, 0, 2, 0, 1, 0, - 11, 0, 156, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 101, 0, 0, 0, + 136, 18, 0, 0, 3, 0, 1, 0, + 148, 18, 0, 0, 2, 0, 1, 0, + 10, 0, 159, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 141, 18, 0, 0, 122, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 140, 18, 0, 0, 3, 0, 1, 0, - 152, 18, 0, 0, 2, 0, 1, 0, - 67, 0, 155, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 102, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 149, 18, 0, 0, 66, 0, 0, 0, + 145, 18, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 18, 0, 0, 3, 0, 1, 0, 156, 18, 0, 0, 2, 0, 1, 0, - 53, 0, 154, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 103, 0, 0, 0, + 8, 0, 158, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 153, 18, 0, 0, 90, 0, 0, 0, + 153, 18, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 152, 18, 0, 0, 3, 0, 1, 0, 164, 18, 0, 0, 2, 0, 1, 0, - 42, 0, 153, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 104, 0, 0, 0, + 9, 0, 157, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 161, 18, 0, 0, 74, 0, 0, 0, + 161, 18, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 18, 0, 0, 3, 0, 1, 0, 172, 18, 0, 0, 2, 0, 1, 0, - 65, 0, 152, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 105, 0, 0, 0, + 11, 0, 156, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 169, 18, 0, 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 168, 18, 0, 0, 3, 0, 1, 0, 180, 18, 0, 0, 2, 0, 1, 0, - 25, 0, 151, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 106, 0, 0, 0, + 68, 0, 155, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 177, 18, 0, 0, 58, 0, 0, 0, + 177, 18, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 18, 0, 0, 3, 0, 1, 0, 184, 18, 0, 0, 2, 0, 1, 0, - 79, 0, 150, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 107, 0, 0, 0, + 54, 0, 154, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 181, 18, 0, 0, 98, 0, 0, 0, + 181, 18, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 18, 0, 0, 3, 0, 1, 0, 192, 18, 0, 0, 2, 0, 1, 0, - 80, 0, 149, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 108, 0, 0, 0, + 43, 0, 153, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 189, 18, 0, 0, 162, 0, 0, 0, + 189, 18, 0, 0, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 192, 18, 0, 0, 3, 0, 1, 0, - 204, 18, 0, 0, 2, 0, 1, 0, - 81, 0, 148, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 109, 0, 0, 0, + 188, 18, 0, 0, 3, 0, 1, 0, + 200, 18, 0, 0, 2, 0, 1, 0, + 66, 0, 152, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 201, 18, 0, 0, 122, 0, 0, 0, + 197, 18, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 196, 18, 0, 0, 3, 0, 1, 0, + 208, 18, 0, 0, 2, 0, 1, 0, + 26, 0, 151, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 106, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 205, 18, 0, 0, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 200, 18, 0, 0, 3, 0, 1, 0, 212, 18, 0, 0, 2, 0, 1, 0, - 82, 0, 147, 255, 0, 0, 0, 0, + 80, 0, 150, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 107, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 209, 18, 0, 0, 98, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 208, 18, 0, 0, 3, 0, 1, 0, + 220, 18, 0, 0, 2, 0, 1, 0, + 81, 0, 149, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 108, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 217, 18, 0, 0, 162, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 220, 18, 0, 0, 3, 0, 1, 0, + 232, 18, 0, 0, 2, 0, 1, 0, + 82, 0, 148, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 109, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 229, 18, 0, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 228, 18, 0, 0, 3, 0, 1, 0, + 240, 18, 0, 0, 2, 0, 1, 0, + 83, 0, 147, 255, 0, 0, 0, 0, 0, 0, 1, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 209, 18, 0, 0, 138, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 212, 18, 0, 0, 3, 0, 1, 0, - 224, 18, 0, 0, 2, 0, 1, 0, - 83, 0, 146, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 111, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 221, 18, 0, 0, 146, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 224, 18, 0, 0, 3, 0, 1, 0, - 236, 18, 0, 0, 2, 0, 1, 0, - 84, 0, 145, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 112, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 233, 18, 0, 0, 130, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 232, 18, 0, 0, 3, 0, 1, 0, - 244, 18, 0, 0, 2, 0, 1, 0, - 85, 0, 144, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 113, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 241, 18, 0, 0, 130, 0, 0, 0, + 237, 18, 0, 0, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 240, 18, 0, 0, 3, 0, 1, 0, 252, 18, 0, 0, 2, 0, 1, 0, - 86, 0, 143, 255, 0, 0, 0, 0, + 84, 0, 146, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 111, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 249, 18, 0, 0, 146, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 252, 18, 0, 0, 3, 0, 1, 0, + 8, 19, 0, 0, 2, 0, 1, 0, + 85, 0, 145, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 112, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 5, 19, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 19, 0, 0, 3, 0, 1, 0, + 16, 19, 0, 0, 2, 0, 1, 0, + 86, 0, 144, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 113, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 13, 19, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 12, 19, 0, 0, 3, 0, 1, 0, + 24, 19, 0, 0, 2, 0, 1, 0, + 87, 0, 143, 255, 0, 0, 0, 0, 0, 0, 1, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 249, 18, 0, 0, 130, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 248, 18, 0, 0, 3, 0, 1, 0, - 4, 19, 0, 0, 2, 0, 1, 0, - 87, 0, 142, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 115, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 1, 19, 0, 0, 130, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 19, 0, 0, 3, 0, 1, 0, - 12, 19, 0, 0, 2, 0, 1, 0, - 88, 0, 141, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 116, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 9, 19, 0, 0, 130, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 8, 19, 0, 0, 3, 0, 1, 0, - 20, 19, 0, 0, 2, 0, 1, 0, - 50, 0, 140, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 117, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 17, 19, 0, 0, 194, 0, 0, 0, + 21, 19, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 19, 0, 0, 3, 0, 1, 0, 32, 19, 0, 0, 2, 0, 1, 0, - 51, 0, 139, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 118, 0, 0, 0, + 88, 0, 142, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 29, 19, 0, 0, 226, 0, 0, 0, + 29, 19, 0, 0, 130, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 28, 19, 0, 0, 3, 0, 1, 0, + 40, 19, 0, 0, 2, 0, 1, 0, + 89, 0, 141, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 116, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 19, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 19, 0, 0, 3, 0, 1, 0, 48, 19, 0, 0, 2, 0, 1, 0, - 52, 0, 138, 255, 0, 0, 0, 0, + 51, 0, 140, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 117, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 45, 19, 0, 0, 194, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 19, 0, 0, 3, 0, 1, 0, + 60, 19, 0, 0, 2, 0, 1, 0, + 52, 0, 139, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 118, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 57, 19, 0, 0, 226, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 64, 19, 0, 0, 3, 0, 1, 0, + 76, 19, 0, 0, 2, 0, 1, 0, + 53, 0, 138, 255, 0, 0, 0, 0, 0, 0, 1, 0, 119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 45, 19, 0, 0, 210, 0, 0, 0, + 73, 19, 0, 0, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 52, 19, 0, 0, 3, 0, 1, 0, - 64, 19, 0, 0, 2, 0, 1, 0, - 73, 0, 137, 255, 0, 0, 0, 0, + 80, 19, 0, 0, 3, 0, 1, 0, + 92, 19, 0, 0, 2, 0, 1, 0, + 74, 0, 137, 255, 0, 0, 0, 0, 0, 0, 1, 0, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 61, 19, 0, 0, 202, 0, 0, 0, + 89, 19, 0, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 68, 19, 0, 0, 3, 0, 1, 0, - 80, 19, 0, 0, 2, 0, 1, 0, - 74, 0, 136, 255, 0, 0, 0, 0, + 96, 19, 0, 0, 3, 0, 1, 0, + 108, 19, 0, 0, 2, 0, 1, 0, + 75, 0, 136, 255, 0, 0, 0, 0, 0, 0, 1, 0, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 77, 19, 0, 0, 234, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 84, 19, 0, 0, 3, 0, 1, 0, - 96, 19, 0, 0, 2, 0, 1, 0, - 75, 0, 135, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 122, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 93, 19, 0, 0, 218, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 100, 19, 0, 0, 3, 0, 1, 0, - 112, 19, 0, 0, 2, 0, 1, 0, - 15, 0, 134, 255, 0, 0, 0, 0, - 0, 0, 1, 0, 123, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 109, 19, 0, 0, 154, 0, 0, 0, + 105, 19, 0, 0, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 19, 0, 0, 3, 0, 1, 0, 124, 19, 0, 0, 2, 0, 1, 0, - 76, 0, 133, 255, 0, 0, 0, 0, + 76, 0, 135, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 121, 19, 0, 0, 218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 19, 0, 0, 3, 0, 1, 0, + 140, 19, 0, 0, 2, 0, 1, 0, + 15, 0, 134, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 123, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 137, 19, 0, 0, 154, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 140, 19, 0, 0, 3, 0, 1, 0, + 152, 19, 0, 0, 2, 0, 1, 0, + 77, 0, 133, 255, 0, 0, 0, 0, 0, 0, 1, 0, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 121, 19, 0, 0, 186, 0, 0, 0, + 149, 19, 0, 0, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 124, 19, 0, 0, 3, 0, 1, 0, - 136, 19, 0, 0, 2, 0, 1, 0, - 77, 0, 132, 255, 0, 0, 0, 0, + 152, 19, 0, 0, 3, 0, 1, 0, + 164, 19, 0, 0, 2, 0, 1, 0, + 78, 0, 132, 255, 0, 0, 0, 0, 0, 0, 1, 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 133, 19, 0, 0, 186, 0, 0, 0, + 161, 19, 0, 0, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 136, 19, 0, 0, 3, 0, 1, 0, - 148, 19, 0, 0, 2, 0, 1, 0, - 78, 0, 131, 255, 0, 0, 0, 0, + 164, 19, 0, 0, 3, 0, 1, 0, + 176, 19, 0, 0, 2, 0, 1, 0, + 79, 0, 131, 255, 0, 0, 0, 0, 0, 0, 1, 0, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 145, 19, 0, 0, 186, 0, 0, 0, + 173, 19, 0, 0, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 148, 19, 0, 0, 3, 0, 1, 0, - 160, 19, 0, 0, 2, 0, 1, 0, + 176, 19, 0, 0, 3, 0, 1, 0, + 188, 19, 0, 0, 2, 0, 1, 0, + 24, 0, 130, 255, 0, 0, 0, 0, + 0, 0, 1, 0, 127, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 185, 19, 0, 0, 82, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 184, 19, 0, 0, 3, 0, 1, 0, + 196, 19, 0, 0, 2, 0, 1, 0, 108, 111, 103, 77, 111, 110, 111, 84, 105, 109, 101, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, @@ -29581,6 +29615,15 @@ static const ::capnp::_::AlignedData<2164> b_d314cfd957229c11 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 99, 97, 114, 79, 117, 116, 112, 117, + 116, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, + 133, 202, 21, 81, 101, 214, 23, 216, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, } }; @@ -29644,6 +29687,7 @@ static const ::capnp::_::RawSchema* const d_d314cfd957229c11[] = { &s_d4df5a192382ba0b, &s_d500d30c5803fa4f, &s_d7700859ed1f5b76, + &s_d817d6655115ca85, &s_d9058dcb967c2753, &s_da96579883444c35, &s_db98be6565516acb, @@ -29674,11 +29718,11 @@ static const ::capnp::_::RawSchema* const d_d314cfd957229c11[] = { &s_fe346a9de48d9b50, &s_fe35ad896ffaeacf, }; -static const uint16_t m_d314cfd957229c11[] = {98, 101, 30, 20, 55, 42, 60, 63, 5, 23, 69, 22, 28, 35, 7, 110, 112, 113, 114, 115, 116, 124, 125, 126, 6, 70, 87, 76, 71, 59, 92, 85, 26, 10, 91, 21, 48, 3, 41, 40, 99, 100, 1, 65, 64, 109, 32, 96, 19, 8, 46, 25, 72, 51, 44, 37, 107, 62, 36, 61, 94, 16, 14, 122, 119, 120, 117, 121, 118, 49, 18, 0, 24, 108, 95, 78, 105, 103, 9, 75, 82, 111, 104, 83, 38, 84, 27, 68, 54, 58, 56, 47, 53, 45, 12, 81, 80, 33, 89, 90, 31, 13, 2, 86, 15, 17, 4, 11, 73, 97, 123, 52, 66, 43, 34, 39, 102, 57, 50, 106, 79, 93, 67, 74, 88, 77, 29}; -static const uint16_t i_d314cfd957229c11[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 0, 67}; +static const uint16_t m_d314cfd957229c11[] = {98, 101, 30, 20, 55, 42, 60, 63, 5, 23, 127, 69, 22, 28, 35, 7, 110, 112, 113, 114, 115, 116, 124, 125, 126, 6, 70, 87, 76, 71, 59, 92, 85, 26, 10, 91, 21, 48, 3, 41, 40, 99, 100, 1, 65, 64, 109, 32, 96, 19, 8, 46, 25, 72, 51, 44, 37, 107, 62, 36, 61, 94, 16, 14, 122, 119, 120, 117, 121, 118, 49, 18, 0, 24, 108, 95, 78, 105, 103, 9, 75, 82, 111, 104, 83, 38, 84, 27, 68, 54, 58, 56, 47, 53, 45, 12, 81, 80, 33, 89, 90, 31, 13, 2, 86, 15, 17, 4, 11, 73, 97, 123, 52, 66, 43, 34, 39, 102, 57, 50, 106, 79, 93, 67, 74, 88, 77, 29}; +static const uint16_t i_d314cfd957229c11[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 0, 67}; const ::capnp::_::RawSchema s_d314cfd957229c11 = { - 0xd314cfd957229c11, b_d314cfd957229c11.words, 2164, d_d314cfd957229c11, m_d314cfd957229c11, - 86, 127, i_d314cfd957229c11, nullptr, nullptr, { &s_d314cfd957229c11, nullptr, nullptr, 0, 0, nullptr }, true + 0xd314cfd957229c11, b_d314cfd957229c11.words, 2180, d_d314cfd957229c11, m_d314cfd957229c11, + 87, 128, i_d314cfd957229c11, nullptr, nullptr, { &s_d314cfd957229c11, nullptr, nullptr, 0, 0, nullptr }, true }; #endif // !CAPNP_LITE } // namespace schemas diff --git a/cereal/gen/cpp/log.capnp.h b/cereal/gen/cpp/log.capnp.h index ea3164bf3..334713af5 100644 --- a/cereal/gen/cpp/log.capnp.h +++ b/cereal/gen/cpp/log.capnp.h @@ -41,6 +41,7 @@ enum class DeviceType_9d5d7238eba86608: uint16_t { TICI, PC, TIZI, + MICI, }; CAPNP_DECLARE_ENUM(DeviceType, 9d5d7238eba86608); CAPNP_DECLARE_SCHEMA(e673e8725cdff0ad); @@ -589,7 +590,7 @@ struct InitData { struct IosBuildInfo; struct _capnpPrivate { - CAPNP_DECLARE_STRUCT_HEADER(e71008caeb3fb65c, 2, 17) + CAPNP_DECLARE_STRUCT_HEADER(e71008caeb3fb65c, 2, 18) #if !CAPNP_LITE static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } #endif // !CAPNP_LITE @@ -2516,6 +2517,7 @@ struct Event { CUSTOM_RESERVED_RAW_DATA0, CUSTOM_RESERVED_RAW_DATA1, CUSTOM_RESERVED_RAW_DATA2, + CAR_OUTPUT, }; struct _capnpPrivate { @@ -2806,6 +2808,9 @@ public: inline ::uint64_t getWallTimeNanos() const; + inline bool hasGitCommitDate() const; + inline ::capnp::Text::Reader getGitCommitDate() const; + private: ::capnp::_::StructReader _reader; template @@ -2966,6 +2971,13 @@ public: inline ::uint64_t getWallTimeNanos(); inline void setWallTimeNanos( ::uint64_t value); + inline bool hasGitCommitDate(); + inline ::capnp::Text::Builder getGitCommitDate(); + inline void setGitCommitDate( ::capnp::Text::Reader value); + inline ::capnp::Text::Builder initGitCommitDate(unsigned int size); + inline void adoptGitCommitDate(::capnp::Orphan< ::capnp::Text>&& value); + inline ::capnp::Orphan< ::capnp::Text> disownGitCommitDate(); + private: ::capnp::_::StructBuilder _builder; template @@ -4622,7 +4634,7 @@ public: inline float getBearingDeg() const; - inline float getAccuracy() const; + inline float getHorizontalAccuracy() const; inline ::int64_t getUnixTimestampMillis() const; @@ -4683,8 +4695,8 @@ public: inline float getBearingDeg(); inline void setBearingDeg(float value); - inline float getAccuracy(); - inline void setAccuracy(float value); + inline float getHorizontalAccuracy(); + inline void setHorizontalAccuracy(float value); inline ::int64_t getUnixTimestampMillis(); inline void setUnixTimestampMillis( ::int64_t value); @@ -4911,7 +4923,7 @@ public: inline float getBatteryTempCDEPRECATED() const; - inline float getAmbientTempC() const; + inline float getAmbientTempCDEPRECATED() const; inline bool hasNetworkInfo() const; inline ::cereal::DeviceState::NetworkInfo::Reader getNetworkInfo() const; @@ -5080,8 +5092,8 @@ public: inline float getBatteryTempCDEPRECATED(); inline void setBatteryTempCDEPRECATED(float value); - inline float getAmbientTempC(); - inline void setAmbientTempC(float value); + inline float getAmbientTempCDEPRECATED(); + inline void setAmbientTempCDEPRECATED(float value); inline bool hasNetworkInfo(); inline ::cereal::DeviceState::NetworkInfo::Builder getNetworkInfo(); @@ -15195,15 +15207,15 @@ public: } #endif // !CAPNP_LITE - inline ::uint64_t getBootTimeNanos() const; + inline ::uint64_t getBootTimeNanosDEPRECATED() const; - inline ::uint64_t getMonotonicNanos() const; + inline ::uint64_t getMonotonicNanosDEPRECATED() const; - inline ::uint64_t getMonotonicRawNanos() const; + inline ::uint64_t getMonotonicRawNanosDEPRECATD() const; inline ::uint64_t getWallTimeNanos() const; - inline ::uint64_t getModemUptimeMillis() const; + inline ::uint64_t getModemUptimeMillisDEPRECATED() const; private: ::capnp::_::StructReader _reader; @@ -15233,20 +15245,20 @@ public: inline ::kj::StringTree toString() const { return asReader().toString(); } #endif // !CAPNP_LITE - inline ::uint64_t getBootTimeNanos(); - inline void setBootTimeNanos( ::uint64_t value); + inline ::uint64_t getBootTimeNanosDEPRECATED(); + inline void setBootTimeNanosDEPRECATED( ::uint64_t value); - inline ::uint64_t getMonotonicNanos(); - inline void setMonotonicNanos( ::uint64_t value); + inline ::uint64_t getMonotonicNanosDEPRECATED(); + inline void setMonotonicNanosDEPRECATED( ::uint64_t value); - inline ::uint64_t getMonotonicRawNanos(); - inline void setMonotonicRawNanos( ::uint64_t value); + inline ::uint64_t getMonotonicRawNanosDEPRECATD(); + inline void setMonotonicRawNanosDEPRECATD( ::uint64_t value); inline ::uint64_t getWallTimeNanos(); inline void setWallTimeNanos( ::uint64_t value); - inline ::uint64_t getModemUptimeMillis(); - inline void setModemUptimeMillis( ::uint64_t value); + inline ::uint64_t getModemUptimeMillisDEPRECATED(); + inline void setModemUptimeMillisDEPRECATED( ::uint64_t value); private: ::capnp::_::StructBuilder _builder; @@ -19247,6 +19259,10 @@ public: inline bool hasCustomReservedRawData2() const; inline ::capnp::Data::Reader getCustomReservedRawData2() const; + inline bool isCarOutput() const; + inline bool hasCarOutput() const; + inline ::cereal::CarOutput::Reader getCarOutput() const; + private: ::capnp::_::StructReader _reader; template @@ -20282,6 +20298,14 @@ public: inline void adoptCustomReservedRawData2(::capnp::Orphan< ::capnp::Data>&& value); inline ::capnp::Orphan< ::capnp::Data> disownCustomReservedRawData2(); + inline bool isCarOutput(); + inline bool hasCarOutput(); + inline ::cereal::CarOutput::Builder getCarOutput(); + inline void setCarOutput( ::cereal::CarOutput::Reader value); + inline ::cereal::CarOutput::Builder initCarOutput(); + inline void adoptCarOutput(::capnp::Orphan< ::cereal::CarOutput>&& value); + inline ::capnp::Orphan< ::cereal::CarOutput> disownCarOutput(); + private: ::capnp::_::StructBuilder _builder; template @@ -21195,6 +21219,40 @@ inline void InitData::Builder::setWallTimeNanos( ::uint64_t value) { ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); } +inline bool InitData::Reader::hasGitCommitDate() const { + return !_reader.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS).isNull(); +} +inline bool InitData::Builder::hasGitCommitDate() { + return !_builder.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS).isNull(); +} +inline ::capnp::Text::Reader InitData::Reader::getGitCommitDate() const { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS)); +} +inline ::capnp::Text::Builder InitData::Builder::getGitCommitDate() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS)); +} +inline void InitData::Builder::setGitCommitDate( ::capnp::Text::Reader value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS), value); +} +inline ::capnp::Text::Builder InitData::Builder::initGitCommitDate(unsigned int size) { + return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS), size); +} +inline void InitData::Builder::adoptGitCommitDate( + ::capnp::Orphan< ::capnp::Text>&& value) { + ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::capnp::Text> InitData::Builder::disownGitCommitDate() { + return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( + ::capnp::bounded<17>() * ::capnp::POINTERS)); +} + inline bool InitData::PandaInfo::Reader::getHasPanda() const { return _reader.getDataField( ::capnp::bounded<0>() * ::capnp::ELEMENTS); @@ -23994,16 +24052,16 @@ inline void GpsLocationData::Builder::setBearingDeg(float value) { ::capnp::bounded<8>() * ::capnp::ELEMENTS, value); } -inline float GpsLocationData::Reader::getAccuracy() const { +inline float GpsLocationData::Reader::getHorizontalAccuracy() const { return _reader.getDataField( ::capnp::bounded<9>() * ::capnp::ELEMENTS); } -inline float GpsLocationData::Builder::getAccuracy() { +inline float GpsLocationData::Builder::getHorizontalAccuracy() { return _builder.getDataField( ::capnp::bounded<9>() * ::capnp::ELEMENTS); } -inline void GpsLocationData::Builder::setAccuracy(float value) { +inline void GpsLocationData::Builder::setHorizontalAccuracy(float value) { _builder.setDataField( ::capnp::bounded<9>() * ::capnp::ELEMENTS, value); } @@ -24680,16 +24738,16 @@ inline void DeviceState::Builder::setBatteryTempCDEPRECATED(float value) { ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); } -inline float DeviceState::Reader::getAmbientTempC() const { +inline float DeviceState::Reader::getAmbientTempCDEPRECATED() const { return _reader.getDataField( ::capnp::bounded<17>() * ::capnp::ELEMENTS); } -inline float DeviceState::Builder::getAmbientTempC() { +inline float DeviceState::Builder::getAmbientTempCDEPRECATED() { return _builder.getDataField( ::capnp::bounded<17>() * ::capnp::ELEMENTS); } -inline void DeviceState::Builder::setAmbientTempC(float value) { +inline void DeviceState::Builder::setAmbientTempCDEPRECATED(float value) { _builder.setDataField( ::capnp::bounded<17>() * ::capnp::ELEMENTS, value); } @@ -41644,44 +41702,44 @@ inline void QcomGnss::DrSvPolyReport::Builder::setGpsTow(double value) { ::capnp::bounded<7>() * ::capnp::ELEMENTS, value); } -inline ::uint64_t Clocks::Reader::getBootTimeNanos() const { +inline ::uint64_t Clocks::Reader::getBootTimeNanosDEPRECATED() const { return _reader.getDataField< ::uint64_t>( ::capnp::bounded<0>() * ::capnp::ELEMENTS); } -inline ::uint64_t Clocks::Builder::getBootTimeNanos() { +inline ::uint64_t Clocks::Builder::getBootTimeNanosDEPRECATED() { return _builder.getDataField< ::uint64_t>( ::capnp::bounded<0>() * ::capnp::ELEMENTS); } -inline void Clocks::Builder::setBootTimeNanos( ::uint64_t value) { +inline void Clocks::Builder::setBootTimeNanosDEPRECATED( ::uint64_t value) { _builder.setDataField< ::uint64_t>( ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); } -inline ::uint64_t Clocks::Reader::getMonotonicNanos() const { +inline ::uint64_t Clocks::Reader::getMonotonicNanosDEPRECATED() const { return _reader.getDataField< ::uint64_t>( ::capnp::bounded<1>() * ::capnp::ELEMENTS); } -inline ::uint64_t Clocks::Builder::getMonotonicNanos() { +inline ::uint64_t Clocks::Builder::getMonotonicNanosDEPRECATED() { return _builder.getDataField< ::uint64_t>( ::capnp::bounded<1>() * ::capnp::ELEMENTS); } -inline void Clocks::Builder::setMonotonicNanos( ::uint64_t value) { +inline void Clocks::Builder::setMonotonicNanosDEPRECATED( ::uint64_t value) { _builder.setDataField< ::uint64_t>( ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); } -inline ::uint64_t Clocks::Reader::getMonotonicRawNanos() const { +inline ::uint64_t Clocks::Reader::getMonotonicRawNanosDEPRECATD() const { return _reader.getDataField< ::uint64_t>( ::capnp::bounded<2>() * ::capnp::ELEMENTS); } -inline ::uint64_t Clocks::Builder::getMonotonicRawNanos() { +inline ::uint64_t Clocks::Builder::getMonotonicRawNanosDEPRECATD() { return _builder.getDataField< ::uint64_t>( ::capnp::bounded<2>() * ::capnp::ELEMENTS); } -inline void Clocks::Builder::setMonotonicRawNanos( ::uint64_t value) { +inline void Clocks::Builder::setMonotonicRawNanosDEPRECATD( ::uint64_t value) { _builder.setDataField< ::uint64_t>( ::capnp::bounded<2>() * ::capnp::ELEMENTS, value); } @@ -41700,16 +41758,16 @@ inline void Clocks::Builder::setWallTimeNanos( ::uint64_t value) { ::capnp::bounded<3>() * ::capnp::ELEMENTS, value); } -inline ::uint64_t Clocks::Reader::getModemUptimeMillis() const { +inline ::uint64_t Clocks::Reader::getModemUptimeMillisDEPRECATED() const { return _reader.getDataField< ::uint64_t>( ::capnp::bounded<4>() * ::capnp::ELEMENTS); } -inline ::uint64_t Clocks::Builder::getModemUptimeMillis() { +inline ::uint64_t Clocks::Builder::getModemUptimeMillisDEPRECATED() { return _builder.getDataField< ::uint64_t>( ::capnp::bounded<4>() * ::capnp::ELEMENTS); } -inline void Clocks::Builder::setModemUptimeMillis( ::uint64_t value) { +inline void Clocks::Builder::setModemUptimeMillisDEPRECATED( ::uint64_t value) { _builder.setDataField< ::uint64_t>( ::capnp::bounded<4>() * ::capnp::ELEMENTS, value); } @@ -53107,6 +53165,60 @@ inline ::capnp::Orphan< ::capnp::Data> Event::Builder::disownCustomReservedRawDa ::capnp::bounded<0>() * ::capnp::POINTERS)); } +inline bool Event::Reader::isCarOutput() const { + return which() == Event::CAR_OUTPUT; +} +inline bool Event::Builder::isCarOutput() { + return which() == Event::CAR_OUTPUT; +} +inline bool Event::Reader::hasCarOutput() const { + if (which() != Event::CAR_OUTPUT) return false; + return !_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline bool Event::Builder::hasCarOutput() { + if (which() != Event::CAR_OUTPUT) return false; + return !_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); +} +inline ::cereal::CarOutput::Reader Event::Reader::getCarOutput() const { + KJ_IREQUIRE((which() == Event::CAR_OUTPUT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarOutput>::get(_reader.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline ::cereal::CarOutput::Builder Event::Builder::getCarOutput() { + KJ_IREQUIRE((which() == Event::CAR_OUTPUT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarOutput>::get(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::setCarOutput( ::cereal::CarOutput::Reader value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_OUTPUT); + ::capnp::_::PointerHelpers< ::cereal::CarOutput>::set(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), value); +} +inline ::cereal::CarOutput::Builder Event::Builder::initCarOutput() { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_OUTPUT); + return ::capnp::_::PointerHelpers< ::cereal::CarOutput>::init(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} +inline void Event::Builder::adoptCarOutput( + ::capnp::Orphan< ::cereal::CarOutput>&& value) { + _builder.setDataField( + ::capnp::bounded<4>() * ::capnp::ELEMENTS, Event::CAR_OUTPUT); + ::capnp::_::PointerHelpers< ::cereal::CarOutput>::adopt(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); +} +inline ::capnp::Orphan< ::cereal::CarOutput> Event::Builder::disownCarOutput() { + KJ_IREQUIRE((which() == Event::CAR_OUTPUT), + "Must check which() before get()ing a union member."); + return ::capnp::_::PointerHelpers< ::cereal::CarOutput>::disown(_builder.getPointerField( + ::capnp::bounded<0>() * ::capnp::POINTERS)); +} + } // namespace CAPNP_END_HEADER diff --git a/cereal/libcereal_shared.so b/cereal/libcereal_shared.so index 5f3c32d26..24b80297b 100755 Binary files a/cereal/libcereal_shared.so and b/cereal/libcereal_shared.so differ diff --git a/cereal/log.capnp b/cereal/log.capnp index 89e68bdd7..453ba1c3f 100644 --- a/cereal/log.capnp +++ b/cereal/log.capnp @@ -33,6 +33,7 @@ struct InitData { deviceType @3 :DeviceType; version @4 :Text; gitCommit @10 :Text; + gitCommitDate @21 :Text; gitBranch @11 :Text; gitRemote @13 :Text; @@ -56,6 +57,7 @@ struct InitData { tici @4; pc @5; tizi @6; + mici @7; } struct PandaInfo { @@ -267,8 +269,8 @@ struct GpsLocationData { # Represents heading in degrees. bearingDeg @5 :Float32; - # Represents expected accuracy in meters. (presumably 1 sigma?) - accuracy @6 :Float32; + # Represents expected horizontal accuracy in meters. + horizontalAccuracy @6 :Float32; unixTimestampMillis @7 :Int64; @@ -356,7 +358,6 @@ struct DeviceState @0xa4d8b5af2aa492eb { cpuTempC @26 :List(Float32); gpuTempC @27 :List(Float32); memoryTempC @28 :Float32; - ambientTempC @30 :Float32; nvmeTempC @35 :List(Float32); modemTempC @36 :List(Float32); pmicTempC @39 :List(Float32); @@ -429,6 +430,7 @@ struct DeviceState @0xa4d8b5af2aa492eb { chargingErrorDEPRECATED @17 :Bool; chargingDisabledDEPRECATED @18 :Bool; usbOnlineDEPRECATED @12 :Bool; + ambientTempCDEPRECATED @30 :Float32; } struct PandaState @0xa7649e2575e4591e { @@ -1877,11 +1879,12 @@ struct QcomGnss @0xde94674b07ae51c1 { } struct Clocks { - bootTimeNanos @0 :UInt64; - monotonicNanos @1 :UInt64; - monotonicRawNanos @2 :UInt64; - wallTimeNanos @3 :UInt64; - modemUptimeMillis @4 :UInt64; + wallTimeNanos @3 :UInt64; # unix epoch time + + bootTimeNanosDEPRECATED @0 :UInt64; + monotonicNanosDEPRECATED @1 :UInt64; + monotonicRawNanosDEPRECATD @2 :UInt64; + modemUptimeMillisDEPRECATED @4 :UInt64; } struct LiveMpcData { @@ -2248,6 +2251,7 @@ struct Event { liveCalibration @19 :LiveCalibrationData; carState @22 :Car.CarState; carControl @23 :Car.CarControl; + carOutput @127 :Car.CarOutput; longitudinalPlan @24 :LongitudinalPlan; uiPlan @106 :UiPlan; ubloxGnss @34 :UbloxGnss; diff --git a/cereal/messaging/__init__.py b/cereal/messaging/__init__.py index 6a4740366..ddc086684 100644 --- a/cereal/messaging/__init__.py +++ b/cereal/messaging/__init__.py @@ -22,7 +22,6 @@ assert delete_fake_prefix assert wait_for_one_event NO_TRAVERSAL_LIMIT = 2**64-1 -AVG_FREQ_HISTORY = 100 context = Context() @@ -117,14 +116,14 @@ def recv_sock(sock: SubSocket, wait: bool = False) -> Optional[capnp.lib.capnp._ while 1: if wait and dat is None: - rcv = sock.receive() + recv = sock.receive() else: - rcv = sock.receive(non_blocking=True) + recv = sock.receive(non_blocking=True) - if rcv is None: # Timeout hit + if recv is None: # Timeout hit break - dat = rcv + dat = recv if dat is not None: dat = log_from_bytes(dat) @@ -155,55 +154,76 @@ def recv_one_retry(sock: SubSocket) -> capnp.lib.capnp._DynamicStructReader: class SubMaster: - def __init__(self, services: List[str], poll: Optional[List[str]] = None, + def __init__(self, services: List[str], poll: Optional[str] = None, ignore_alive: Optional[List[str]] = None, ignore_avg_freq: Optional[List[str]] = None, - ignore_valid: Optional[List[str]] = None, addr: str = "127.0.0.1"): + ignore_valid: Optional[List[str]] = None, addr: str = "127.0.0.1", frequency: Optional[float] = None): self.frame = -1 + self.seen = {s: False for s in services} self.updated = {s: False for s in services} - self.rcv_time = {s: 0. for s in services} - self.rcv_frame = {s: 0 for s in services} + self.recv_time = {s: 0. for s in services} + self.recv_frame = {s: 0 for s in services} self.alive = {s: False for s in services} self.freq_ok = {s: False for s in services} - self.recv_dts: Dict[str, Deque[float]] = {s: deque(maxlen=AVG_FREQ_HISTORY) for s in services} + self.recv_dts: Dict[str, Deque[float]] = {} self.sock = {} - self.freq = {} self.data = {} self.valid = {} self.logMonoTime = {} + self.max_freq = {} + self.min_freq = {} + self.poller = Poller() - self.non_polled_services = [s for s in services if poll is not None and - len(poll) and s not in poll] + polled_services = set([poll, ] if poll is not None else services) + self.non_polled_services = set(services) - polled_services self.ignore_average_freq = [] if ignore_avg_freq is None else ignore_avg_freq self.ignore_alive = [] if ignore_alive is None else ignore_alive self.ignore_valid = [] if ignore_valid is None else ignore_valid - self.simulation = bool(int(os.getenv("SIMULATION", "0"))) + if bool(int(os.getenv("SIMULATION", "0"))): + self.ignore_alive = services + self.ignore_average_freq = services + + # if freq and poll aren't specified, assume the max to be conservative + assert frequency is None or poll is None, "Do not specify 'frequency' - frequency of the polled service will be used." + self.update_freq = frequency or max([SERVICE_LIST[s].frequency for s in polled_services]) for s in services: - if addr is not None: - p = self.poller if s not in self.non_polled_services else None - self.sock[s] = sub_sock(s, poller=p, addr=addr, conflate=True) - self.freq[s] = SERVICE_LIST[s].frequency + p = self.poller if s not in self.non_polled_services else None + self.sock[s] = sub_sock(s, poller=p, addr=addr, conflate=True) try: data = new_message(s) - except capnp.lib.capnp.KjException: # pylint: disable=c-extension-no-member + except capnp.lib.capnp.KjException: data = new_message(s, 0) # lists self.data[s] = getattr(data.as_reader(), s) self.logMonoTime[s] = 0 - # TODO: this should default to False - self.valid[s] = True + self.valid[s] = True # FIXME: this should default to False + + freq = max(min([SERVICE_LIST[s].frequency, self.update_freq]), 1.) + if s == poll: + max_freq = freq + min_freq = freq + else: + max_freq = min(freq, self.update_freq) + if SERVICE_LIST[s].frequency >= 2*self.update_freq: + min_freq = self.update_freq + elif self.update_freq >= 2*SERVICE_LIST[s].frequency: + min_freq = freq + else: + min_freq = min(freq, freq / 2.) + self.max_freq[s] = max_freq*1.2 + self.min_freq[s] = min_freq*0.8 + self.recv_dts[s] = deque(maxlen=int(10*freq)) def __getitem__(self, s: str) -> capnp.lib.capnp._DynamicStructReader: return self.data[s] - def _check_avg_freq(self, s): - return self.rcv_time[s] > 1e-5 and self.freq[s] > 1e-5 and (s not in self.non_polled_services) \ - and (s not in self.ignore_average_freq) + def _check_avg_freq(self, s: str) -> bool: + return SERVICE_LIST[s].frequency > 0.99 and (s not in self.ignore_average_freq) and (s not in self.ignore_alive) - def update(self, timeout: int = 1000) -> None: + def update(self, timeout: int = 100) -> None: msgs = [] for sock in self.poller.poll(timeout): msgs.append(recv_one_or_none(sock)) @@ -221,64 +241,57 @@ class SubMaster: continue s = msg.which() + self.seen[s] = True self.updated[s] = True - if self._check_avg_freq(s): - self.recv_dts[s].append(cur_time - self.rcv_time[s]) - - self.rcv_time[s] = cur_time - self.rcv_frame[s] = self.frame + if self.recv_time[s] > 1e-5: + self.recv_dts[s].append(cur_time - self.recv_time[s]) + self.recv_time[s] = cur_time + self.recv_frame[s] = self.frame self.data[s] = getattr(msg, s) self.logMonoTime[s] = msg.logMonoTime self.valid[s] = msg.valid - if self.simulation: + for s in self.data: + if SERVICE_LIST[s].frequency > 1e-5: + # alive if delay is within 10x the expected frequency + self.alive[s] = (cur_time - self.recv_time[s]) < (10. / SERVICE_LIST[s].frequency) + + # check average frequency; slow to fall, quick to recover + dts = self.recv_dts[s] + assert dts.maxlen is not None + recent_dts = list(dts)[-int(dts.maxlen / 10):] + try: + avg_freq = 1 / (sum(dts) / len(dts)) + avg_freq_recent = 1 / (sum(recent_dts) / len(recent_dts)) + except ZeroDivisionError: + avg_freq = 0 + avg_freq_recent = 0 + + avg_freq_ok = self.min_freq[s] <= avg_freq <= self.max_freq[s] + recent_freq_ok = self.min_freq[s] <= avg_freq_recent <= self.max_freq[s] + self.freq_ok[s] = avg_freq_ok or recent_freq_ok + else: self.freq_ok[s] = True self.alive[s] = True - if not self.simulation: - for s in self.data: - # arbitrary small number to avoid float comparison. If freq is 0, we can skip the check - if self.freq[s] > 1e-5: - # alive if delay is within 10x the expected frequency - self.alive[s] = (cur_time - self.rcv_time[s]) < (10. / self.freq[s]) - - # TODO: check if update frequency is high enough to not drop messages - # freq_ok if average frequency is higher than 90% of expected frequency - if self._check_avg_freq(s): - if len(self.recv_dts[s]) > 0: - avg_dt = sum(self.recv_dts[s]) / len(self.recv_dts[s]) - expected_dt = 1 / (self.freq[s] * 0.90) - self.freq_ok[s] = (avg_dt < expected_dt) - else: - self.freq_ok[s] = False - else: - self.freq_ok[s] = True - else: - self.freq_ok[s] = True - self.alive[s] = True - - def all_alive(self, service_list=None) -> bool: - if service_list is None: # check all - service_list = self.alive.keys() + def all_alive(self, service_list: Optional[List[str]] = None) -> bool: + if service_list is None: + service_list = list(self.sock.keys()) return all(self.alive[s] for s in service_list if s not in self.ignore_alive) - def all_freq_ok(self, service_list=None) -> bool: - if service_list is None: # check all - service_list = self.alive.keys() - return all(self.freq_ok[s] for s in service_list if s not in self.ignore_alive) + def all_freq_ok(self, service_list: Optional[List[str]] = None) -> bool: + if service_list is None: + service_list = list(self.sock.keys()) + return all(self.freq_ok[s] for s in service_list if self._check_avg_freq(s)) - def all_valid(self, service_list=None) -> bool: - if service_list is None: # check all - service_list = self.valid.keys() + def all_valid(self, service_list: Optional[List[str]] = None) -> bool: + if service_list is None: + service_list = list(self.sock.keys()) return all(self.valid[s] for s in service_list if s not in self.ignore_valid) - def all_checks(self, service_list=None) -> bool: - if service_list is None: # check all - service_list = self.alive.keys() - return self.all_alive(service_list=service_list) \ - and self.all_freq_ok(service_list=service_list) \ - and self.all_valid(service_list=service_list) + def all_checks(self, service_list: Optional[List[str]] = None) -> bool: + return self.all_alive(service_list) and self.all_freq_ok(service_list) and self.all_valid(service_list) class PubMaster: diff --git a/cereal/messaging/bridge b/cereal/messaging/bridge index 899362e1b..8553751bd 100755 Binary files a/cereal/messaging/bridge and b/cereal/messaging/bridge differ diff --git a/cereal/messaging/messaging_pyx.so b/cereal/messaging/messaging_pyx.so index 27dc66c9c..44004d00a 100755 Binary files a/cereal/messaging/messaging_pyx.so and b/cereal/messaging/messaging_pyx.so differ diff --git a/cereal/services.h b/cereal/services.h index d18f03f99..9c105d847 100644 --- a/cereal/services.h +++ b/cereal/services.h @@ -30,60 +30,61 @@ static std::map services = { { "androidLog", {"androidLog", 8024, true, 0, -1}}, { "carState", {"carState", 8025, true, 100, 10}}, { "carControl", {"carControl", 8026, true, 100, 10}}, - { "longitudinalPlan", {"longitudinalPlan", 8027, true, 20, 5}}, - { "procLog", {"procLog", 8028, true, 0, 15}}, - { "gpsLocationExternal", {"gpsLocationExternal", 8029, true, 10, 10}}, - { "gpsLocation", {"gpsLocation", 8030, true, 1, 1}}, - { "ubloxGnss", {"ubloxGnss", 8031, true, 10, -1}}, - { "qcomGnss", {"qcomGnss", 8032, true, 2, -1}}, - { "gnssMeasurements", {"gnssMeasurements", 8033, true, 10, 10}}, - { "clocks", {"clocks", 8034, true, 1, 1}}, - { "ubloxRaw", {"ubloxRaw", 8035, true, 20, -1}}, - { "liveLocationKalman", {"liveLocationKalman", 8036, true, 20, 5}}, - { "liveParameters", {"liveParameters", 8037, true, 20, 5}}, - { "cameraOdometry", {"cameraOdometry", 8038, true, 20, 5}}, - { "thumbnail", {"thumbnail", 8039, true, 0, 1}}, - { "onroadEvents", {"onroadEvents", 8040, true, 1, 1}}, - { "carParams", {"carParams", 8041, true, 0, 1}}, - { "roadCameraState", {"roadCameraState", 8042, true, 20, 20}}, - { "driverCameraState", {"driverCameraState", 8043, true, 20, 20}}, - { "driverEncodeIdx", {"driverEncodeIdx", 8044, false, 20, 1}}, - { "driverStateV2", {"driverStateV2", 8045, true, 20, 10}}, - { "driverMonitoringState", {"driverMonitoringState", 8046, true, 20, 10}}, - { "wideRoadEncodeIdx", {"wideRoadEncodeIdx", 8047, false, 20, 1}}, - { "wideRoadCameraState", {"wideRoadCameraState", 8048, true, 20, 20}}, - { "modelV2", {"modelV2", 8049, true, 20, 40}}, - { "managerState", {"managerState", 8050, true, 2, 1}}, - { "uploaderState", {"uploaderState", 8051, true, 0, 1}}, - { "navInstruction", {"navInstruction", 8052, true, 1, 10}}, - { "navRoute", {"navRoute", 8053, true, 0, -1}}, - { "navThumbnail", {"navThumbnail", 8054, true, 0, -1}}, - { "navModel", {"navModel", 8055, true, 2, 4}}, - { "mapRenderState", {"mapRenderState", 8056, true, 2, 1}}, - { "uiPlan", {"uiPlan", 8057, true, 20, 40}}, - { "qRoadEncodeIdx", {"qRoadEncodeIdx", 8058, false, 20, -1}}, - { "userFlag", {"userFlag", 8059, true, 0, 1}}, - { "microphone", {"microphone", 8060, true, 10, 10}}, - { "uiDebug", {"uiDebug", 8061, true, 0, 1}}, - { "testJoystick", {"testJoystick", 8062, true, 0, -1}}, - { "roadEncodeData", {"roadEncodeData", 8063, false, 20, -1}}, - { "driverEncodeData", {"driverEncodeData", 8064, false, 20, -1}}, - { "wideRoadEncodeData", {"wideRoadEncodeData", 8065, false, 20, -1}}, - { "qRoadEncodeData", {"qRoadEncodeData", 8066, false, 20, -1}}, - { "livestreamWideRoadEncodeIdx", {"livestreamWideRoadEncodeIdx", 8067, false, 20, -1}}, - { "livestreamRoadEncodeIdx", {"livestreamRoadEncodeIdx", 8068, false, 20, -1}}, - { "livestreamDriverEncodeIdx", {"livestreamDriverEncodeIdx", 8069, false, 20, -1}}, - { "livestreamWideRoadEncodeData", {"livestreamWideRoadEncodeData", 8070, false, 20, -1}}, - { "livestreamRoadEncodeData", {"livestreamRoadEncodeData", 8071, false, 20, -1}}, - { "livestreamDriverEncodeData", {"livestreamDriverEncodeData", 8072, false, 20, -1}}, - { "customReservedRawData0", {"customReservedRawData0", 8073, true, 0, -1}}, - { "customReservedRawData1", {"customReservedRawData1", 8074, true, 0, -1}}, - { "customReservedRawData2", {"customReservedRawData2", 8075, true, 0, -1}}, - { "liveMapData", {"liveMapData", 8076, false, 0, -1}}, - { "longitudinalPlanExt", {"longitudinalPlanExt", 8077, false, 20, 5}}, - { "lateralPlanExt", {"lateralPlanExt", 8078, false, 20, 5}}, - { "controlsStateExt", {"controlsStateExt", 8079, false, 100, 10}}, - { "navInstructionExt", {"navInstructionExt", 8080, false, 0, -1}}, + { "carOutput", {"carOutput", 8027, true, 100, 10}}, + { "longitudinalPlan", {"longitudinalPlan", 8028, true, 20, 5}}, + { "procLog", {"procLog", 8029, true, 0, 15}}, + { "gpsLocationExternal", {"gpsLocationExternal", 8030, true, 10, 10}}, + { "gpsLocation", {"gpsLocation", 8031, true, 1, 1}}, + { "ubloxGnss", {"ubloxGnss", 8032, true, 10, -1}}, + { "qcomGnss", {"qcomGnss", 8033, true, 2, -1}}, + { "gnssMeasurements", {"gnssMeasurements", 8034, true, 10, 10}}, + { "clocks", {"clocks", 8035, true, 0, 1}}, + { "ubloxRaw", {"ubloxRaw", 8036, true, 20, -1}}, + { "liveLocationKalman", {"liveLocationKalman", 8037, true, 20, 5}}, + { "liveParameters", {"liveParameters", 8038, true, 20, 5}}, + { "cameraOdometry", {"cameraOdometry", 8039, true, 20, 5}}, + { "thumbnail", {"thumbnail", 8040, true, 0, 1}}, + { "onroadEvents", {"onroadEvents", 8041, true, 1, 1}}, + { "carParams", {"carParams", 8042, true, 0, 1}}, + { "roadCameraState", {"roadCameraState", 8043, true, 20, 20}}, + { "driverCameraState", {"driverCameraState", 8044, true, 20, 20}}, + { "driverEncodeIdx", {"driverEncodeIdx", 8045, false, 20, 1}}, + { "driverStateV2", {"driverStateV2", 8046, true, 20, 10}}, + { "driverMonitoringState", {"driverMonitoringState", 8047, true, 20, 10}}, + { "wideRoadEncodeIdx", {"wideRoadEncodeIdx", 8048, false, 20, 1}}, + { "wideRoadCameraState", {"wideRoadCameraState", 8049, true, 20, 20}}, + { "modelV2", {"modelV2", 8050, true, 20, 40}}, + { "managerState", {"managerState", 8051, true, 2, 1}}, + { "uploaderState", {"uploaderState", 8052, true, 0, 1}}, + { "navInstruction", {"navInstruction", 8053, true, 1, 10}}, + { "navRoute", {"navRoute", 8054, true, 0, -1}}, + { "navThumbnail", {"navThumbnail", 8055, true, 0, -1}}, + { "navModel", {"navModel", 8056, true, 2, 4}}, + { "mapRenderState", {"mapRenderState", 8057, true, 2, 1}}, + { "uiPlan", {"uiPlan", 8058, true, 20, 40}}, + { "qRoadEncodeIdx", {"qRoadEncodeIdx", 8059, false, 20, -1}}, + { "userFlag", {"userFlag", 8060, true, 0, 1}}, + { "microphone", {"microphone", 8061, true, 10, 10}}, + { "uiDebug", {"uiDebug", 8062, true, 0, 1}}, + { "testJoystick", {"testJoystick", 8063, true, 0, -1}}, + { "roadEncodeData", {"roadEncodeData", 8064, false, 20, -1}}, + { "driverEncodeData", {"driverEncodeData", 8065, false, 20, -1}}, + { "wideRoadEncodeData", {"wideRoadEncodeData", 8066, false, 20, -1}}, + { "qRoadEncodeData", {"qRoadEncodeData", 8067, false, 20, -1}}, + { "livestreamWideRoadEncodeIdx", {"livestreamWideRoadEncodeIdx", 8068, false, 20, -1}}, + { "livestreamRoadEncodeIdx", {"livestreamRoadEncodeIdx", 8069, false, 20, -1}}, + { "livestreamDriverEncodeIdx", {"livestreamDriverEncodeIdx", 8070, false, 20, -1}}, + { "livestreamWideRoadEncodeData", {"livestreamWideRoadEncodeData", 8071, false, 20, -1}}, + { "livestreamRoadEncodeData", {"livestreamRoadEncodeData", 8072, false, 20, -1}}, + { "livestreamDriverEncodeData", {"livestreamDriverEncodeData", 8073, false, 20, -1}}, + { "customReservedRawData0", {"customReservedRawData0", 8074, true, 0, -1}}, + { "customReservedRawData1", {"customReservedRawData1", 8075, true, 0, -1}}, + { "customReservedRawData2", {"customReservedRawData2", 8076, true, 0, -1}}, + { "liveMapData", {"liveMapData", 8077, false, 0, -1}}, + { "longitudinalPlanExt", {"longitudinalPlanExt", 8078, false, 20, 5}}, + { "lateralPlanExt", {"lateralPlanExt", 8079, false, 20, 5}}, + { "controlsStateExt", {"controlsStateExt", 8080, false, 100, 10}}, + { "navInstructionExt", {"navInstructionExt", 8081, false, 0, -1}}, }; #endif diff --git a/cereal/services.py b/cereal/services.py index bfb445f2d..7daa80b0d 100755 --- a/cereal/services.py +++ b/cereal/services.py @@ -46,6 +46,7 @@ services: dict[str, tuple] = { "androidLog": (True, 0.), "carState": (True, 100., 10), "carControl": (True, 100., 10), + "carOutput": (True, 100., 10), "longitudinalPlan": (True, 20., 5), "procLog": (True, 0.5, 15), "gpsLocationExternal": (True, 10., 10), @@ -53,7 +54,7 @@ services: dict[str, tuple] = { "ubloxGnss": (True, 10.), "qcomGnss": (True, 2.), "gnssMeasurements": (True, 10., 10), - "clocks": (True, 1., 1), + "clocks": (True, 0.1, 1), "ubloxRaw": (True, 20.), "liveLocationKalman": (True, 20., 5), "liveParameters": (True, 20., 5), diff --git a/cereal/visionipc/visionipc_pyx.so b/cereal/visionipc/visionipc_pyx.so index c225dca06..f7d18ad51 100755 Binary files a/cereal/visionipc/visionipc_pyx.so and b/cereal/visionipc/visionipc_pyx.so differ diff --git a/common/file_helpers.py b/common/file_helpers.py index dea298a52..29ad219c0 100644 --- a/common/file_helpers.py +++ b/common/file_helpers.py @@ -1,7 +1,6 @@ import os import tempfile import contextlib -from typing import Optional class CallbackReader: @@ -24,7 +23,7 @@ class CallbackReader: @contextlib.contextmanager -def atomic_write_in_dir(path: str, mode: str = 'w', buffering: int = -1, encoding: Optional[str] = None, newline: Optional[str] = None, +def atomic_write_in_dir(path: str, mode: str = 'w', buffering: int = -1, encoding: str = None, newline: str = None, overwrite: bool = False): """Write to a file atomically using a temporary file in the same directory as the destination file.""" dir_name = os.path.dirname(path) diff --git a/common/gpio.py b/common/gpio.py index 88a9479a6..68932cb87 100644 --- a/common/gpio.py +++ b/common/gpio.py @@ -1,6 +1,5 @@ import os from functools import lru_cache -from typing import Optional, List def gpio_init(pin: int, output: bool) -> None: try: @@ -16,7 +15,7 @@ def gpio_set(pin: int, high: bool) -> None: except Exception as e: print(f"Failed to set gpio {pin} value: {e}") -def gpio_read(pin: int) -> Optional[bool]: +def gpio_read(pin: int) -> bool | None: val = None try: with open(f"/sys/class/gpio/gpio{pin}/value", 'rb') as f: @@ -37,7 +36,7 @@ def gpio_export(pin: int) -> None: print(f"Failed to export gpio {pin}") @lru_cache(maxsize=None) -def get_irq_action(irq: int) -> List[str]: +def get_irq_action(irq: int) -> list[str]: try: with open(f"/sys/kernel/irq/{irq}/actions") as f: actions = f.read().strip().split(',') @@ -45,7 +44,7 @@ def get_irq_action(irq: int) -> List[str]: except FileNotFoundError: return [] -def get_irqs_for_action(action: str) -> List[str]: +def get_irqs_for_action(action: str) -> list[str]: ret = [] with open("/proc/interrupts") as f: for l in f.readlines(): diff --git a/common/mock/__init__.py b/common/mock/__init__.py new file mode 100644 index 000000000..8c86bbd39 --- /dev/null +++ b/common/mock/__init__.py @@ -0,0 +1,50 @@ +""" +Utilities for generating mock messages for testing. +example in common/tests/test_mock.py +""" + + +import functools +import threading +from cereal.messaging import PubMaster +from cereal.services import SERVICE_LIST +from openpilot.common.mock.generators import generate_liveLocationKalman +from openpilot.common.realtime import Ratekeeper + + +MOCK_GENERATOR = { + "liveLocationKalman": generate_liveLocationKalman +} + + +def generate_messages_loop(services: list[str], done: threading.Event): + pm = PubMaster(services) + rk = Ratekeeper(100) + i = 0 + while not done.is_set(): + for s in services: + should_send = i % (100/SERVICE_LIST[s].frequency) == 0 + if should_send: + message = MOCK_GENERATOR[s]() + pm.send(s, message) + i += 1 + rk.keep_time() + + +def mock_messages(services: list[str] | str): + if isinstance(services, str): + services = [services] + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + done = threading.Event() + t = threading.Thread(target=generate_messages_loop, args=(services, done)) + t.start() + try: + return func(*args, **kwargs) + finally: + done.set() + t.join() + return wrapper + return decorator diff --git a/common/mock/generators.py b/common/mock/generators.py new file mode 100644 index 000000000..40951faf8 --- /dev/null +++ b/common/mock/generators.py @@ -0,0 +1,20 @@ +from cereal import messaging + + +LOCATION1 = (32.7174, -117.16277) +LOCATION2 = (32.7558, -117.2037) + +LLK_DECIMATION = 10 +RENDER_FRAMES = 15 +DEFAULT_ITERATIONS = RENDER_FRAMES * LLK_DECIMATION + + +def generate_liveLocationKalman(location=LOCATION1): + msg = messaging.new_message('liveLocationKalman') + msg.liveLocationKalman.positionGeodetic = {'value': [*location, 0], 'std': [0., 0., 0.], 'valid': True} + msg.liveLocationKalman.positionECEF = {'value': [0., 0., 0.], 'std': [0., 0., 0.], 'valid': True} + msg.liveLocationKalman.calibratedOrientationNED = {'value': [0., 0., 0.], 'std': [0., 0., 0.], 'valid': True} + msg.liveLocationKalman.velocityCalibrated = {'value': [0., 0., 0.], 'std': [0., 0., 0.], 'valid': True} + msg.liveLocationKalman.status = 'valid' + msg.liveLocationKalman.gpsOK = True + return msg diff --git a/common/params_pyx.cpp b/common/params_pyx.cpp index 1db3ee493..3be5357f5 100644 --- a/common/params_pyx.cpp +++ b/common/params_pyx.cpp @@ -9,7 +9,7 @@ "language": "c++", "name": "common.params_pyx", "sources": [ - "/data/openpilot/common/params_pyx.pyx" + "/data/dp-private/common/params_pyx.pyx" ] }, "module_name": "common.params_pyx" @@ -6883,7 +6883,7 @@ static PyObject *__pyx_unpickle___Pyx_EnumMeta__set_state(struct __pyx_obj___Pyx * * * def ensure_bytes(v): # <<<<<<<<<<<<<< - * return v.encode() if isinstance(v, str) else v; + * return v.encode() if isinstance(v, str) else v * */ @@ -7000,7 +7000,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_ensure_bytes(CYTHON_UNUSED PyObje /* "common/params_pyx.pyx":32 * * def ensure_bytes(v): - * return v.encode() if isinstance(v, str) else v; # <<<<<<<<<<<<<< + * return v.encode() if isinstance(v, str) else v # <<<<<<<<<<<<<< * * class UnknownKeyName(Exception): */ @@ -7045,7 +7045,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_ensure_bytes(CYTHON_UNUSED PyObje * * * def ensure_bytes(v): # <<<<<<<<<<<<<< - * return v.encode() if isinstance(v, str) else v; + * return v.encode() if isinstance(v, str) else v * */ @@ -10657,7 +10657,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * * def ensure_bytes(v): # <<<<<<<<<<<<<< - * return v.encode() if isinstance(v, str) else v; + * return v.encode() if isinstance(v, str) else v * */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_v); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 31, __pyx_L1_error) @@ -12161,7 +12161,7 @@ if (!__Pyx_RefNanny) { * * * def ensure_bytes(v): # <<<<<<<<<<<<<< - * return v.encode() if isinstance(v, str) else v; + * return v.encode() if isinstance(v, str) else v * */ __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_6common_10params_pyx_1ensure_bytes, 0, __pyx_n_s_ensure_bytes, NULL, __pyx_kp_s_common_params_pyx, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 31, __pyx_L1_error) @@ -12170,7 +12170,7 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "common/params_pyx.pyx":34 - * return v.encode() if isinstance(v, str) else v; + * return v.encode() if isinstance(v, str) else v * * class UnknownKeyName(Exception): # <<<<<<<<<<<<<< * pass diff --git a/common/params_pyx.pyx b/common/params_pyx.pyx index 47d2075df..535514e52 100644 --- a/common/params_pyx.pyx +++ b/common/params_pyx.pyx @@ -29,7 +29,7 @@ cdef extern from "common/params.h": def ensure_bytes(v): - return v.encode() if isinstance(v, str) else v; + return v.encode() if isinstance(v, str) else v class UnknownKeyName(Exception): pass diff --git a/common/params_pyx.so b/common/params_pyx.so index 0b1877c1d..984c0926d 100755 Binary files a/common/params_pyx.so and b/common/params_pyx.so differ diff --git a/common/prefix.py b/common/prefix.py index d027e3e5a..4059ac09e 100644 --- a/common/prefix.py +++ b/common/prefix.py @@ -2,14 +2,13 @@ import os import shutil import uuid -from typing import Optional from openpilot.common.params import Params from openpilot.system.hardware.hw import Paths from openpilot.system.hardware.hw import DEFAULT_DOWNLOAD_CACHE_ROOT class OpenpilotPrefix: - def __init__(self, prefix: Optional[str] = None, clean_dirs_on_exit: bool = True, shared_download_cache: bool = False): + def __init__(self, prefix: str = None, clean_dirs_on_exit: bool = True, shared_download_cache: bool = False): self.prefix = prefix if prefix else str(uuid.uuid4().hex[0:15]) self.msgq_path = os.path.join('/dev/shm', self.prefix) self.clean_dirs_on_exit = clean_dirs_on_exit diff --git a/common/realtime.py b/common/realtime.py index a39814616..6b8587ff0 100644 --- a/common/realtime.py +++ b/common/realtime.py @@ -3,7 +3,6 @@ import gc import os import time from collections import deque -from typing import Optional, List, Union from setproctitle import getproctitle @@ -33,12 +32,12 @@ def set_realtime_priority(level: int) -> None: os.sched_setscheduler(0, os.SCHED_FIFO, os.sched_param(level)) -def set_core_affinity(cores: List[int]) -> None: +def set_core_affinity(cores: list[int]) -> None: if not PC: os.sched_setaffinity(0, cores) -def config_realtime_process(cores: Union[int, List[int]], priority: int) -> None: +def config_realtime_process(cores: int | list[int], priority: int) -> None: gc.disable() set_realtime_priority(priority) c = cores if isinstance(cores, list) else [cores, ] @@ -46,7 +45,7 @@ def config_realtime_process(cores: Union[int, List[int]], priority: int) -> None class Ratekeeper: - def __init__(self, rate: float, print_delay_threshold: Optional[float] = 0.0) -> None: + def __init__(self, rate: float, print_delay_threshold: float | None = 0.0) -> None: """Rate in Hz for ratekeeping. print_delay_threshold must be nonnegative.""" self._interval = 1. / rate self._next_frame_time = time.monotonic() + self._interval diff --git a/common/transformations/orientation.py b/common/transformations/orientation.py index ce4378738..86e6a6c34 100644 --- a/common/transformations/orientation.py +++ b/common/transformations/orientation.py @@ -1,5 +1,5 @@ import numpy as np -from typing import Callable +from collections.abc import Callable from openpilot.common.transformations.transformations import (ecef_euler_from_ned_single, euler2quat_single, diff --git a/common/transformations/transformations.cpp b/common/transformations/transformations.cpp index 3c93244df..a600acc7a 100644 --- a/common/transformations/transformations.cpp +++ b/common/transformations/transformations.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.5 */ +/* Generated by Cython 3.0.8 */ /* BEGIN: Cython Metadata { @@ -20,7 +20,7 @@ "language": "c++", "name": "common.transformations.transformations", "sources": [ - "/data/openpilot/common/transformations/transformations.pyx" + "/data/dp-private/common/transformations/transformations.pyx" ] }, "module_name": "common.transformations.transformations" @@ -51,10 +51,10 @@ END: Cython Metadata */ #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif -#define CYTHON_ABI "3_0_5" __PYX_EXTRA_ABI_MODULE_NAME +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030005F0 +#define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -268,7 +268,7 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif -#elif defined(PY_NOGIL) +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 @@ -612,18 +612,19 @@ class __Pyx_FakeReference { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; // borrowed - #endif + PyObject *version_info; PyObject *py_minor_version = NULL; + #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; // we don't yet need to distinguish between versions > 11 + minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; @@ -644,7 +645,6 @@ class __Pyx_FakeReference { Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); - Py_XDECREF(py_minor_version); if (type) { PyErr_Restore(type, value, traceback); } @@ -677,7 +677,7 @@ class __Pyx_FakeReference { PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 @@ -972,7 +972,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ @@ -1383,7 +1383,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 + #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) @@ -1503,7 +1503,7 @@ static const char *__pyx_filename; #if !defined(CYTHON_CCOMPLEX) #if defined(__cplusplus) #define CYTHON_CCOMPLEX 1 - #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__)) + #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER)) #define CYTHON_CCOMPLEX 1 #else #define CYTHON_CCOMPLEX 0 @@ -1808,7 +1808,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; */ typedef npy_cdouble __pyx_t_5numpy_complex_t; -/* "common/transformations/transformations.pyx":115 +/* "common/transformations/transformations.pyx":114 * * * cdef class LocalCoord: # <<<<<<<<<<<<<< @@ -2195,8 +2195,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op - #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL @@ -2208,12 +2208,13 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 - static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs - #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS @@ -2303,22 +2304,22 @@ static int __Pyx_setup_reduce(PyObject* type_obj); #endif /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_5 -#define __PYX_HAVE_RT_ImportType_proto_3_0_5 +#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 +#define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_5(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_5(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_5 { - __Pyx_ImportType_CheckSize_Error_3_0_5 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_5 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_5 = 2 +enum __Pyx_ImportType_CheckSize_3_0_8 { + __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, + __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; -static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_5 check_size); +static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* Import.proto */ @@ -2420,7 +2421,7 @@ typedef struct { #endif void *defaults; int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults + size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2691,8 +2692,6 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p /* Module declarations from "openpilot.common.transformations.transformations" */ -/* Module declarations from "cython" */ - /* Module declarations from "libc.string" */ /* Module declarations from "libc.stdio" */ @@ -2883,8 +2882,6 @@ typedef struct { #endif #if CYTHON_USE_MODULE_STATE #endif - #if CYTHON_USE_MODULE_STATE - #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; #if CYTHON_USE_MODULE_STATE #endif @@ -3434,8 +3431,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #endif #if CYTHON_USE_MODULE_STATE #endif -#if CYTHON_USE_MODULE_STATE -#endif #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type #if CYTHON_USE_MODULE_STATE #endif @@ -4165,7 +4160,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4179,7 +4174,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":969 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -4188,16 +4183,16 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":969 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< * * cdef inline object get_array_base(ndarray arr): */ - __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 969, __pyx_L1_error) + __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 970, __pyx_L1_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -4212,7 +4207,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_L0:; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4227,7 +4222,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -4236,7 +4231,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -4246,7 +4241,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -4257,7 +4252,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -4266,7 +4261,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -4278,7 +4273,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -4293,7 +4288,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4317,7 +4312,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4333,16 +4328,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 981, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 982, __pyx_L3_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4356,7 +4351,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -4366,27 +4361,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 982, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 983, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 983, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 984, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 983, __pyx_L5_except_error) + __PYX_ERR(2, 984, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -4402,7 +4397,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -4425,7 +4420,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -4449,7 +4444,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4465,16 +4460,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 987, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 988, __pyx_L3_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4488,7 +4483,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4498,27 +4493,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 989, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 990, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 989, __pyx_L5_except_error) + __PYX_ERR(2, 990, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -4534,7 +4529,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -4557,7 +4552,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -4581,7 +4576,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4597,16 +4592,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 994, __pyx_L3_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4620,7 +4615,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -4630,27 +4625,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 995, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":996 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 996, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 995, __pyx_L5_except_error) + __PYX_ERR(2, 996, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -4666,7 +4661,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -4689,7 +4684,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -4700,7 +4695,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1010 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1011 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -4710,7 +4705,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -4723,7 +4718,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -4734,7 +4729,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1025 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1026 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -4744,7 +4739,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -4757,7 +4752,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4768,7 +4763,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1036 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -4778,7 +4773,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4791,7 +4786,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4802,7 +4797,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1042 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1043 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -4812,7 +4807,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -4825,7 +4820,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -4836,7 +4831,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1049 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1050 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -4844,7 +4839,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -4857,7 +4852,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec return __pyx_r; } -/* "common/transformations/transformations.pyx":24 +/* "common/transformations/transformations.pyx":23 * cimport numpy as np * * cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m): # <<<<<<<<<<<<<< @@ -4882,7 +4877,7 @@ static PyArrayObject *__pyx_f_6common_15transformations_15transformations_matrix int __pyx_clineno = 0; __Pyx_RefNannySetupContext("matrix2numpy", 1); - /* "common/transformations/transformations.pyx":25 + /* "common/transformations/transformations.pyx":24 * * cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m): * return np.array([ # <<<<<<<<<<<<<< @@ -4890,102 +4885,102 @@ static PyArrayObject *__pyx_f_6common_15transformations_15transformations_matrix * [m(1, 0), m(1, 1), m(1, 2)], */ __Pyx_XDECREF((PyObject *)__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":26 + /* "common/transformations/transformations.pyx":25 * cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m): * return np.array([ * [m(0, 0), m(0, 1), m(0, 2)], # <<<<<<<<<<<<<< * [m(1, 0), m(1, 1), m(1, 2)], * [m(2, 0), m(2, 1), m(2, 2)], */ - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_m(0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_m(0, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_m(0, 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_m(0, 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_m(0, 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_m(0, 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 26, __pyx_L1_error) + __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(0, 25, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "common/transformations/transformations.pyx":27 + /* "common/transformations/transformations.pyx":26 * return np.array([ * [m(0, 0), m(0, 1), m(0, 2)], * [m(1, 0), m(1, 1), m(1, 2)], # <<<<<<<<<<<<<< * [m(2, 0), m(2, 1), m(2, 2)], * ]) */ - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_m(1, 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_m(1, 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_m(1, 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_m(1, 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_m(1, 2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_m(1, 2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":28 + /* "common/transformations/transformations.pyx":27 * [m(0, 0), m(0, 1), m(0, 2)], * [m(1, 0), m(1, 1), m(1, 2)], * [m(2, 0), m(2, 1), m(2, 2)], # <<<<<<<<<<<<<< * ]) * */ - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_m(2, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_m(2, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_m(2, 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_m(2, 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_m(2, 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_m(2, 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_5)) __PYX_ERR(0, 28, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "common/transformations/transformations.pyx":25 + /* "common/transformations/transformations.pyx":24 * * cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m): * return np.array([ # <<<<<<<<<<<<<< * [m(0, 0), m(0, 1), m(0, 2)], * [m(1, 0), m(1, 1), m(1, 2)], */ - __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 25, __pyx_L1_error) + __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(0, 25, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(0, 24, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_7)) __PYX_ERR(0, 25, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_7)) __PYX_ERR(0, 24, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_8)) __PYX_ERR(0, 25, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_8)) __PYX_ERR(0, 24, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; @@ -5008,16 +5003,16 @@ static PyArrayObject *__pyx_f_6common_15transformations_15transformations_matrix __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 25, __pyx_L1_error) + if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 24, __pyx_L1_error) __pyx_r = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":24 + /* "common/transformations/transformations.pyx":23 * cimport numpy as np * * cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m): # <<<<<<<<<<<<<< @@ -5043,7 +5038,7 @@ static PyArrayObject *__pyx_f_6common_15transformations_15transformations_matrix return __pyx_r; } -/* "common/transformations/transformations.pyx":31 +/* "common/transformations/transformations.pyx":30 * ]) * * cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m): # <<<<<<<<<<<<<< @@ -5067,11 +5062,11 @@ static Eigen::Matrix3d __pyx_f_6common_15transformations_15transformations_numpy __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m; { __Pyx_BufFmt_StackElem __pyx_stack[1]; - if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 31, __pyx_L1_error) + if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_F_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 30, __pyx_L1_error) } __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1]; - /* "common/transformations/transformations.pyx":32 + /* "common/transformations/transformations.pyx":31 * * cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m): * assert m.shape[0] == 3 # <<<<<<<<<<<<<< @@ -5080,8 +5075,28 @@ static Eigen::Matrix3d __pyx_f_6common_15transformations_15transformations_numpy */ #ifndef CYTHON_WITHOUT_ASSERTIONS if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_m)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_m)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1[0]) == 3); + if (unlikely(!__pyx_t_2)) { + __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); + __PYX_ERR(0, 31, __pyx_L1_error) + } + } + #else + if ((1)); else __PYX_ERR(0, 31, __pyx_L1_error) + #endif + + /* "common/transformations/transformations.pyx":32 + * cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m): + * assert m.shape[0] == 3 + * assert m.shape[1] == 3 # <<<<<<<<<<<<<< + * return Matrix3(m.data) + * + */ + #ifndef CYTHON_WITHOUT_ASSERTIONS + if (unlikely(__pyx_assertions_enabled())) { + __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_m)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_2 = ((__pyx_t_1[1]) == 3); if (unlikely(!__pyx_t_2)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); __PYX_ERR(0, 32, __pyx_L1_error) @@ -5092,37 +5107,17 @@ static Eigen::Matrix3d __pyx_f_6common_15transformations_15transformations_numpy #endif /* "common/transformations/transformations.pyx":33 - * cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m): - * assert m.shape[0] == 3 - * assert m.shape[1] == 3 # <<<<<<<<<<<<<< - * return Matrix3(m.data) - * - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_assertions_enabled())) { - __pyx_t_1 = __pyx_f_5numpy_7ndarray_5shape_shape(((PyArrayObject *)__pyx_v_m)); if (unlikely(__pyx_t_1 == ((npy_intp *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L1_error) - __pyx_t_2 = ((__pyx_t_1[1]) == 3); - if (unlikely(!__pyx_t_2)) { - __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 33, __pyx_L1_error) - } - } - #else - if ((1)); else __PYX_ERR(0, 33, __pyx_L1_error) - #endif - - /* "common/transformations/transformations.pyx":34 * assert m.shape[0] == 3 * assert m.shape[1] == 3 * return Matrix3(m.data) # <<<<<<<<<<<<<< * * cdef ECEF list2ecef(ecef): */ - __pyx_t_3 = __pyx_f_5numpy_7ndarray_4data_data(((PyArrayObject *)__pyx_v_m)); if (unlikely(__pyx_t_3 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L1_error) + __pyx_t_3 = __pyx_f_5numpy_7ndarray_4data_data(((PyArrayObject *)__pyx_v_m)); if (unlikely(__pyx_t_3 == ((char *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 33, __pyx_L1_error) __pyx_r = Eigen::Matrix3d(((double *)__pyx_t_3)); goto __pyx_L0; - /* "common/transformations/transformations.pyx":31 + /* "common/transformations/transformations.pyx":30 * ]) * * cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m): # <<<<<<<<<<<<<< @@ -5147,11 +5142,11 @@ static Eigen::Matrix3d __pyx_f_6common_15transformations_15transformations_numpy return __pyx_r; } -/* "common/transformations/transformations.pyx":36 +/* "common/transformations/transformations.pyx":35 * return Matrix3(m.data) * * cdef ECEF list2ecef(ecef): # <<<<<<<<<<<<<< - * cdef ECEF e; + * cdef ECEF e * e.x = ecef[0] */ @@ -5166,46 +5161,46 @@ static struct ECEF __pyx_f_6common_15transformations_15transformations_list2ecef int __pyx_clineno = 0; __Pyx_RefNannySetupContext("list2ecef", 1); - /* "common/transformations/transformations.pyx":38 + /* "common/transformations/transformations.pyx":37 * cdef ECEF list2ecef(ecef): - * cdef ECEF e; + * cdef ECEF e * e.x = ecef[0] # <<<<<<<<<<<<<< * e.y = ecef[1] * e.z = ecef[2] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ecef, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ecef, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_e.x = __pyx_t_2; - /* "common/transformations/transformations.pyx":39 - * cdef ECEF e; + /* "common/transformations/transformations.pyx":38 + * cdef ECEF e * e.x = ecef[0] * e.y = ecef[1] # <<<<<<<<<<<<<< * e.z = ecef[2] * return e */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ecef, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ecef, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_e.y = __pyx_t_2; - /* "common/transformations/transformations.pyx":40 + /* "common/transformations/transformations.pyx":39 * e.x = ecef[0] * e.y = ecef[1] * e.z = ecef[2] # <<<<<<<<<<<<<< * return e * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ecef, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ecef, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 40, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_e.z = __pyx_t_2; - /* "common/transformations/transformations.pyx":41 + /* "common/transformations/transformations.pyx":40 * e.y = ecef[1] * e.z = ecef[2] * return e # <<<<<<<<<<<<<< @@ -5215,11 +5210,11 @@ static struct ECEF __pyx_f_6common_15transformations_15transformations_list2ecef __pyx_r = __pyx_v_e; goto __pyx_L0; - /* "common/transformations/transformations.pyx":36 + /* "common/transformations/transformations.pyx":35 * return Matrix3(m.data) * * cdef ECEF list2ecef(ecef): # <<<<<<<<<<<<<< - * cdef ECEF e; + * cdef ECEF e * e.x = ecef[0] */ @@ -5233,11 +5228,11 @@ static struct ECEF __pyx_f_6common_15transformations_15transformations_list2ecef return __pyx_r; } -/* "common/transformations/transformations.pyx":43 +/* "common/transformations/transformations.pyx":42 * return e * * cdef NED list2ned(ned): # <<<<<<<<<<<<<< - * cdef NED n; + * cdef NED n * n.n = ned[0] */ @@ -5252,46 +5247,46 @@ static struct NED __pyx_f_6common_15transformations_15transformations_list2ned(P int __pyx_clineno = 0; __Pyx_RefNannySetupContext("list2ned", 1); - /* "common/transformations/transformations.pyx":45 + /* "common/transformations/transformations.pyx":44 * cdef NED list2ned(ned): - * cdef NED n; + * cdef NED n * n.n = ned[0] # <<<<<<<<<<<<<< * n.e = ned[1] * n.d = ned[2] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ned, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ned, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n.n = __pyx_t_2; - /* "common/transformations/transformations.pyx":46 - * cdef NED n; + /* "common/transformations/transformations.pyx":45 + * cdef NED n * n.n = ned[0] * n.e = ned[1] # <<<<<<<<<<<<<< * n.d = ned[2] * return n */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ned, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ned, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n.e = __pyx_t_2; - /* "common/transformations/transformations.pyx":47 + /* "common/transformations/transformations.pyx":46 * n.n = ned[0] * n.e = ned[1] * n.d = ned[2] # <<<<<<<<<<<<<< * return n * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ned, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ned, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_n.d = __pyx_t_2; - /* "common/transformations/transformations.pyx":48 + /* "common/transformations/transformations.pyx":47 * n.e = ned[1] * n.d = ned[2] * return n # <<<<<<<<<<<<<< @@ -5301,11 +5296,11 @@ static struct NED __pyx_f_6common_15transformations_15transformations_list2ned(P __pyx_r = __pyx_v_n; goto __pyx_L0; - /* "common/transformations/transformations.pyx":43 + /* "common/transformations/transformations.pyx":42 * return e * * cdef NED list2ned(ned): # <<<<<<<<<<<<<< - * cdef NED n; + * cdef NED n * n.n = ned[0] */ @@ -5319,7 +5314,7 @@ static struct NED __pyx_f_6common_15transformations_15transformations_list2ned(P return __pyx_r; } -/* "common/transformations/transformations.pyx":50 +/* "common/transformations/transformations.pyx":49 * return n * * cdef Geodetic list2geodetic(geodetic): # <<<<<<<<<<<<<< @@ -5338,46 +5333,46 @@ static struct Geodetic __pyx_f_6common_15transformations_15transformations_list2 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("list2geodetic", 1); - /* "common/transformations/transformations.pyx":52 + /* "common/transformations/transformations.pyx":51 * cdef Geodetic list2geodetic(geodetic): * cdef Geodetic g * g.lat = geodetic[0] # <<<<<<<<<<<<<< * g.lon = geodetic[1] * g.alt = geodetic[2] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_geodetic, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_geodetic, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_g.lat = __pyx_t_2; - /* "common/transformations/transformations.pyx":53 + /* "common/transformations/transformations.pyx":52 * cdef Geodetic g * g.lat = geodetic[0] * g.lon = geodetic[1] # <<<<<<<<<<<<<< * g.alt = geodetic[2] * return g */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_geodetic, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_geodetic, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_g.lon = __pyx_t_2; - /* "common/transformations/transformations.pyx":54 + /* "common/transformations/transformations.pyx":53 * g.lat = geodetic[0] * g.lon = geodetic[1] * g.alt = geodetic[2] # <<<<<<<<<<<<<< * return g * */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_geodetic, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_geodetic, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_g.alt = __pyx_t_2; - /* "common/transformations/transformations.pyx":55 + /* "common/transformations/transformations.pyx":54 * g.lon = geodetic[1] * g.alt = geodetic[2] * return g # <<<<<<<<<<<<<< @@ -5387,7 +5382,7 @@ static struct Geodetic __pyx_f_6common_15transformations_15transformations_list2 __pyx_r = __pyx_v_g; goto __pyx_L0; - /* "common/transformations/transformations.pyx":50 + /* "common/transformations/transformations.pyx":49 * return n * * cdef Geodetic list2geodetic(geodetic): # <<<<<<<<<<<<<< @@ -5405,7 +5400,7 @@ static struct Geodetic __pyx_f_6common_15transformations_15transformations_list2 return __pyx_r; } -/* "common/transformations/transformations.pyx":57 +/* "common/transformations/transformations.pyx":56 * return g * * def euler2quat_single(euler): # <<<<<<<<<<<<<< @@ -5466,12 +5461,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "euler2quat_single") < 0)) __PYX_ERR(0, 57, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "euler2quat_single") < 0)) __PYX_ERR(0, 56, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -5482,7 +5477,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("euler2quat_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 57, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("euler2quat_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 56, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5527,28 +5522,28 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_euler2quat int __pyx_clineno = 0; __Pyx_RefNannySetupContext("euler2quat_single", 1); - /* "common/transformations/transformations.pyx":58 + /* "common/transformations/transformations.pyx":57 * * def euler2quat_single(euler): * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) # <<<<<<<<<<<<<< * cdef Quaternion q = euler2quat_c(e) * return [q.w(), q.x(), q.y(), q.z()] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_e = Eigen::Vector3d(__pyx_t_2, __pyx_t_3, __pyx_t_4); - /* "common/transformations/transformations.pyx":59 + /* "common/transformations/transformations.pyx":58 * def euler2quat_single(euler): * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) * cdef Quaternion q = euler2quat_c(e) # <<<<<<<<<<<<<< @@ -5557,7 +5552,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_euler2quat */ __pyx_v_q = euler2quat(__pyx_v_e); - /* "common/transformations/transformations.pyx":60 + /* "common/transformations/transformations.pyx":59 * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) * cdef Quaternion q = euler2quat_c(e) * return [q.w(), q.x(), q.y(), q.z()] # <<<<<<<<<<<<<< @@ -5565,24 +5560,24 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_euler2quat * def quat2euler_single(quat): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_q.w()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_q.w()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q.x()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q.x()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_q.y()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_q.y()); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_q.z()); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_q.z()); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyList_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 60, __pyx_L1_error) + __pyx_t_8 = PyList_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_5)) __PYX_ERR(0, 60, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_5)) __PYX_ERR(0, 59, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_6)) __PYX_ERR(0, 60, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_6)) __PYX_ERR(0, 59, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 3, __pyx_t_7)) __PYX_ERR(0, 60, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 3, __pyx_t_7)) __PYX_ERR(0, 59, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; @@ -5591,7 +5586,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_euler2quat __pyx_t_8 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":57 + /* "common/transformations/transformations.pyx":56 * return g * * def euler2quat_single(euler): # <<<<<<<<<<<<<< @@ -5614,12 +5609,12 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_euler2quat return __pyx_r; } -/* "common/transformations/transformations.pyx":62 +/* "common/transformations/transformations.pyx":61 * return [q.w(), q.x(), q.y(), q.z()] * * def quat2euler_single(quat): # <<<<<<<<<<<<<< * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) - * cdef Vector3 e = quat2euler_c(q); + * cdef Vector3 e = quat2euler_c(q) */ /* Python wrapper */ @@ -5675,12 +5670,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "quat2euler_single") < 0)) __PYX_ERR(0, 62, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "quat2euler_single") < 0)) __PYX_ERR(0, 61, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -5691,7 +5686,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("quat2euler_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 62, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("quat2euler_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 61, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5736,62 +5731,62 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_2quat2eule int __pyx_clineno = 0; __Pyx_RefNannySetupContext("quat2euler_single", 1); - /* "common/transformations/transformations.pyx":63 + /* "common/transformations/transformations.pyx":62 * * def quat2euler_single(quat): * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) # <<<<<<<<<<<<<< - * cdef Vector3 e = quat2euler_c(q); + * cdef Vector3 e = quat2euler_c(q) * return [e(0), e(1), e(2)] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 62, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_q = Eigen::Quaterniond(__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5); - /* "common/transformations/transformations.pyx":64 + /* "common/transformations/transformations.pyx":63 * def quat2euler_single(quat): * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) - * cdef Vector3 e = quat2euler_c(q); # <<<<<<<<<<<<<< + * cdef Vector3 e = quat2euler_c(q) # <<<<<<<<<<<<<< * return [e(0), e(1), e(2)] * */ __pyx_v_e = quat2euler(__pyx_v_q); - /* "common/transformations/transformations.pyx":65 + /* "common/transformations/transformations.pyx":64 * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) - * cdef Vector3 e = quat2euler_c(q); + * cdef Vector3 e = quat2euler_c(q) * return [e(0), e(1), e(2)] # <<<<<<<<<<<<<< * * def quat2rot_single(quat): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_e(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_e(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e(1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e(1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_e(2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_e(2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 65, __pyx_L1_error) + __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 64, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(0, 65, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(0, 64, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(0, 65, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(0, 64, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; @@ -5799,12 +5794,12 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_2quat2eule __pyx_t_8 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":62 + /* "common/transformations/transformations.pyx":61 * return [q.w(), q.x(), q.y(), q.z()] * * def quat2euler_single(quat): # <<<<<<<<<<<<<< * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) - * cdef Vector3 e = quat2euler_c(q); + * cdef Vector3 e = quat2euler_c(q) */ /* function exit code */ @@ -5821,7 +5816,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_2quat2eule return __pyx_r; } -/* "common/transformations/transformations.pyx":67 +/* "common/transformations/transformations.pyx":66 * return [e(0), e(1), e(2)] * * def quat2rot_single(quat): # <<<<<<<<<<<<<< @@ -5882,12 +5877,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 66, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "quat2rot_single") < 0)) __PYX_ERR(0, 67, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "quat2rot_single") < 0)) __PYX_ERR(0, 66, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -5898,7 +5893,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("quat2rot_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 67, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("quat2rot_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 66, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -5940,32 +5935,32 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_4quat2rot_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("quat2rot_single", 1); - /* "common/transformations/transformations.pyx":68 + /* "common/transformations/transformations.pyx":67 * * def quat2rot_single(quat): * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) # <<<<<<<<<<<<<< * cdef Matrix3 r = quat2rot_c(q) * return matrix2numpy(r) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_quat, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_q = Eigen::Quaterniond(__pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5); - /* "common/transformations/transformations.pyx":69 + /* "common/transformations/transformations.pyx":68 * def quat2rot_single(quat): * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) * cdef Matrix3 r = quat2rot_c(q) # <<<<<<<<<<<<<< @@ -5974,7 +5969,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_4quat2rot_ */ __pyx_v_r = quat2rot(__pyx_v_q); - /* "common/transformations/transformations.pyx":70 + /* "common/transformations/transformations.pyx":69 * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) * cdef Matrix3 r = quat2rot_c(q) * return matrix2numpy(r) # <<<<<<<<<<<<<< @@ -5982,13 +5977,13 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_4quat2rot_ * def rot2quat_single(rot): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(__pyx_v_r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(__pyx_v_r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":67 + /* "common/transformations/transformations.pyx":66 * return [e(0), e(1), e(2)] * * def quat2rot_single(quat): # <<<<<<<<<<<<<< @@ -6007,7 +6002,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_4quat2rot_ return __pyx_r; } -/* "common/transformations/transformations.pyx":72 +/* "common/transformations/transformations.pyx":71 * return matrix2numpy(r) * * def rot2quat_single(rot): # <<<<<<<<<<<<<< @@ -6068,12 +6063,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rot2quat_single") < 0)) __PYX_ERR(0, 72, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rot2quat_single") < 0)) __PYX_ERR(0, 71, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -6084,7 +6079,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rot2quat_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 72, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rot2quat_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 71, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6127,43 +6122,43 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_6rot2quat_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rot2quat_single", 1); - /* "common/transformations/transformations.pyx":73 + /* "common/transformations/transformations.pyx":72 * * def rot2quat_single(rot): * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) # <<<<<<<<<<<<<< * cdef Quaternion q = rot2quat_c(r) * return [q.w(), q.x(), q.y(), q.z()] */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_rot); __Pyx_GIVEREF(__pyx_v_rot); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_rot)) __PYX_ERR(0, 73, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_rot)) __PYX_ERR(0, 72, __pyx_L1_error); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 73, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 73, __pyx_L1_error) - __pyx_t_6 = __pyx_f_6common_15transformations_15transformations_numpy2matrix(((PyArrayObject *)__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 73, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6common_15transformations_15transformations_numpy2matrix(((PyArrayObject *)__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_r = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6); - /* "common/transformations/transformations.pyx":74 + /* "common/transformations/transformations.pyx":73 * def rot2quat_single(rot): * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) * cdef Quaternion q = rot2quat_c(r) # <<<<<<<<<<<<<< @@ -6172,7 +6167,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_6rot2quat_ */ __pyx_v_q = rot2quat(__pyx_v_r); - /* "common/transformations/transformations.pyx":75 + /* "common/transformations/transformations.pyx":74 * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) * cdef Quaternion q = rot2quat_c(r) * return [q.w(), q.x(), q.y(), q.z()] # <<<<<<<<<<<<<< @@ -6180,24 +6175,24 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_6rot2quat_ * def euler2rot_single(euler): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q.w()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_q.w()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q.x()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_q.x()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_q.y()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_q.y()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_q.z()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_q.z()); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyList_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error) + __pyx_t_4 = PyList_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 3, __pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 3, __pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; @@ -6206,7 +6201,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_6rot2quat_ __pyx_t_4 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":72 + /* "common/transformations/transformations.pyx":71 * return matrix2numpy(r) * * def rot2quat_single(rot): # <<<<<<<<<<<<<< @@ -6229,7 +6224,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_6rot2quat_ return __pyx_r; } -/* "common/transformations/transformations.pyx":77 +/* "common/transformations/transformations.pyx":76 * return [q.w(), q.x(), q.y(), q.z()] * * def euler2rot_single(euler): # <<<<<<<<<<<<<< @@ -6290,12 +6285,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 76, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "euler2rot_single") < 0)) __PYX_ERR(0, 77, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "euler2rot_single") < 0)) __PYX_ERR(0, 76, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -6306,7 +6301,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("euler2rot_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 77, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("euler2rot_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 76, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6347,28 +6342,28 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_8euler2rot int __pyx_clineno = 0; __Pyx_RefNannySetupContext("euler2rot_single", 1); - /* "common/transformations/transformations.pyx":78 + /* "common/transformations/transformations.pyx":77 * * def euler2rot_single(euler): * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) # <<<<<<<<<<<<<< * cdef Matrix3 r = euler2rot_c(e) * return matrix2numpy(r) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_euler, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 77, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_e = Eigen::Vector3d(__pyx_t_2, __pyx_t_3, __pyx_t_4); - /* "common/transformations/transformations.pyx":79 + /* "common/transformations/transformations.pyx":78 * def euler2rot_single(euler): * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) * cdef Matrix3 r = euler2rot_c(e) # <<<<<<<<<<<<<< @@ -6377,7 +6372,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_8euler2rot */ __pyx_v_r = euler2rot(__pyx_v_e); - /* "common/transformations/transformations.pyx":80 + /* "common/transformations/transformations.pyx":79 * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) * cdef Matrix3 r = euler2rot_c(e) * return matrix2numpy(r) # <<<<<<<<<<<<<< @@ -6385,13 +6380,13 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_8euler2rot * def rot2euler_single(rot): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(__pyx_v_r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(__pyx_v_r)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":77 + /* "common/transformations/transformations.pyx":76 * return [q.w(), q.x(), q.y(), q.z()] * * def euler2rot_single(euler): # <<<<<<<<<<<<<< @@ -6410,7 +6405,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_8euler2rot return __pyx_r; } -/* "common/transformations/transformations.pyx":82 +/* "common/transformations/transformations.pyx":81 * return matrix2numpy(r) * * def rot2euler_single(rot): # <<<<<<<<<<<<<< @@ -6471,12 +6466,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rot2euler_single") < 0)) __PYX_ERR(0, 82, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rot2euler_single") < 0)) __PYX_ERR(0, 81, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -6487,7 +6482,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rot2euler_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 82, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rot2euler_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 81, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6530,43 +6525,43 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10rot2eule int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rot2euler_single", 1); - /* "common/transformations/transformations.pyx":83 + /* "common/transformations/transformations.pyx":82 * * def rot2euler_single(rot): * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) # <<<<<<<<<<<<<< * cdef Vector3 e = rot2euler_c(r) * return [e(0), e(1), e(2)] */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asfortranarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_rot); __Pyx_GIVEREF(__pyx_v_rot); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_rot)) __PYX_ERR(0, 83, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_rot)) __PYX_ERR(0, 82, __pyx_L1_error); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 83, __pyx_L1_error) - __pyx_t_6 = __pyx_f_6common_15transformations_15transformations_numpy2matrix(((PyArrayObject *)__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error) + if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_6 = __pyx_f_6common_15transformations_15transformations_numpy2matrix(((PyArrayObject *)__pyx_t_5)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_r = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6); - /* "common/transformations/transformations.pyx":84 + /* "common/transformations/transformations.pyx":83 * def rot2euler_single(rot): * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) * cdef Vector3 e = rot2euler_c(r) # <<<<<<<<<<<<<< @@ -6575,7 +6570,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10rot2eule */ __pyx_v_e = rot2euler(__pyx_v_r); - /* "common/transformations/transformations.pyx":85 + /* "common/transformations/transformations.pyx":84 * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) * cdef Vector3 e = rot2euler_c(r) * return [e(0), e(1), e(2)] # <<<<<<<<<<<<<< @@ -6583,20 +6578,20 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10rot2eule * def rot_matrix(roll, pitch, yaw): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_e(0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_e(0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_e(1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_e(1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_e(2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_e(2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) + __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; @@ -6604,7 +6599,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10rot2eule __pyx_t_2 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":82 + /* "common/transformations/transformations.pyx":81 * return matrix2numpy(r) * * def rot2euler_single(rot): # <<<<<<<<<<<<<< @@ -6627,7 +6622,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10rot2eule return __pyx_r; } -/* "common/transformations/transformations.pyx":87 +/* "common/transformations/transformations.pyx":86 * return [e(0), e(1), e(2)] * * def rot_matrix(roll, pitch, yaw): # <<<<<<<<<<<<<< @@ -6694,7 +6689,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -6702,9 +6697,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("rot_matrix", 1, 3, 3, 1); __PYX_ERR(0, 87, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rot_matrix", 1, 3, 3, 1); __PYX_ERR(0, 86, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -6712,14 +6707,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("rot_matrix", 1, 3, 3, 2); __PYX_ERR(0, 87, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rot_matrix", 1, 3, 3, 2); __PYX_ERR(0, 86, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rot_matrix") < 0)) __PYX_ERR(0, 87, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rot_matrix") < 0)) __PYX_ERR(0, 86, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -6734,7 +6729,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rot_matrix", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 87, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rot_matrix", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 86, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6773,7 +6768,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_12rot_matr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rot_matrix", 1); - /* "common/transformations/transformations.pyx":88 + /* "common/transformations/transformations.pyx":87 * * def rot_matrix(roll, pitch, yaw): * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) # <<<<<<<<<<<<<< @@ -6781,16 +6776,16 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_12rot_matr * def ecef_euler_from_ned_single(ecef_init, ned_pose): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_roll); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_pitch); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_yaw); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error) - __pyx_t_4 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(rot_matrix(__pyx_t_1, __pyx_t_2, __pyx_t_3))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error) + __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_roll); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_pitch); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_yaw); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_4 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(rot_matrix(__pyx_t_1, __pyx_t_2, __pyx_t_3))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":87 + /* "common/transformations/transformations.pyx":86 * return [e(0), e(1), e(2)] * * def rot_matrix(roll, pitch, yaw): # <<<<<<<<<<<<<< @@ -6809,7 +6804,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_12rot_matr return __pyx_r; } -/* "common/transformations/transformations.pyx":90 +/* "common/transformations/transformations.pyx":89 * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) * * def ecef_euler_from_ned_single(ecef_init, ned_pose): # <<<<<<<<<<<<<< @@ -6873,7 +6868,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -6881,14 +6876,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("ecef_euler_from_ned_single", 1, 2, 2, 1); __PYX_ERR(0, 90, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("ecef_euler_from_ned_single", 1, 2, 2, 1); __PYX_ERR(0, 89, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ecef_euler_from_ned_single") < 0)) __PYX_ERR(0, 90, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ecef_euler_from_ned_single") < 0)) __PYX_ERR(0, 89, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -6901,7 +6896,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ecef_euler_from_ned_single", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 90, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("ecef_euler_from_ned_single", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 89, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -6947,38 +6942,38 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_14ecef_eul int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ecef_euler_from_ned_single", 1); - /* "common/transformations/transformations.pyx":91 + /* "common/transformations/transformations.pyx":90 * * def ecef_euler_from_ned_single(ecef_init, ned_pose): * cdef ECEF init = list2ecef(ecef_init) # <<<<<<<<<<<<<< * cdef Vector3 pose = Vector3(ned_pose[0], ned_pose[1], ned_pose[2]) * */ - __pyx_t_1 = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef_init); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef_init); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L1_error) __pyx_v_init = __pyx_t_1; - /* "common/transformations/transformations.pyx":92 + /* "common/transformations/transformations.pyx":91 * def ecef_euler_from_ned_single(ecef_init, ned_pose): * cdef ECEF init = list2ecef(ecef_init) * cdef Vector3 pose = Vector3(ned_pose[0], ned_pose[1], ned_pose[2]) # <<<<<<<<<<<<<< * * cdef Vector3 e = ecef_euler_from_ned_c(init, pose) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ned_pose, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ned_pose, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ned_pose, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ned_pose, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ned_pose, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ned_pose, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_pose = Eigen::Vector3d(__pyx_t_3, __pyx_t_4, __pyx_t_5); - /* "common/transformations/transformations.pyx":94 + /* "common/transformations/transformations.pyx":93 * cdef Vector3 pose = Vector3(ned_pose[0], ned_pose[1], ned_pose[2]) * * cdef Vector3 e = ecef_euler_from_ned_c(init, pose) # <<<<<<<<<<<<<< @@ -6987,7 +6982,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_14ecef_eul */ __pyx_v_e = ecef_euler_from_ned(__pyx_v_init, __pyx_v_pose); - /* "common/transformations/transformations.pyx":95 + /* "common/transformations/transformations.pyx":94 * * cdef Vector3 e = ecef_euler_from_ned_c(init, pose) * return [e(0), e(1), e(2)] # <<<<<<<<<<<<<< @@ -6995,20 +6990,20 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_14ecef_eul * def ned_euler_from_ecef_single(ecef_init, ecef_pose): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e(0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e(0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e(1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e(1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_e(2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_e(2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 95, __pyx_L1_error) + __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 94, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(0, 95, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(0, 94, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; @@ -7016,7 +7011,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_14ecef_eul __pyx_t_8 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":90 + /* "common/transformations/transformations.pyx":89 * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) * * def ecef_euler_from_ned_single(ecef_init, ned_pose): # <<<<<<<<<<<<<< @@ -7038,7 +7033,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_14ecef_eul return __pyx_r; } -/* "common/transformations/transformations.pyx":97 +/* "common/transformations/transformations.pyx":96 * return [e(0), e(1), e(2)] * * def ned_euler_from_ecef_single(ecef_init, ecef_pose): # <<<<<<<<<<<<<< @@ -7102,7 +7097,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -7110,14 +7105,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("ned_euler_from_ecef_single", 1, 2, 2, 1); __PYX_ERR(0, 97, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("ned_euler_from_ecef_single", 1, 2, 2, 1); __PYX_ERR(0, 96, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ned_euler_from_ecef_single") < 0)) __PYX_ERR(0, 97, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ned_euler_from_ecef_single") < 0)) __PYX_ERR(0, 96, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -7130,7 +7125,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ned_euler_from_ecef_single", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 97, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("ned_euler_from_ecef_single", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 96, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7176,38 +7171,38 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_16ned_eule int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ned_euler_from_ecef_single", 1); - /* "common/transformations/transformations.pyx":98 + /* "common/transformations/transformations.pyx":97 * * def ned_euler_from_ecef_single(ecef_init, ecef_pose): * cdef ECEF init = list2ecef(ecef_init) # <<<<<<<<<<<<<< * cdef Vector3 pose = Vector3(ecef_pose[0], ecef_pose[1], ecef_pose[2]) * */ - __pyx_t_1 = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef_init); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef_init); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error) __pyx_v_init = __pyx_t_1; - /* "common/transformations/transformations.pyx":99 + /* "common/transformations/transformations.pyx":98 * def ned_euler_from_ecef_single(ecef_init, ecef_pose): * cdef ECEF init = list2ecef(ecef_init) * cdef Vector3 pose = Vector3(ecef_pose[0], ecef_pose[1], ecef_pose[2]) # <<<<<<<<<<<<<< * * cdef Vector3 e = ned_euler_from_ecef_c(init, pose) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ecef_pose, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ecef_pose, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ecef_pose, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ecef_pose, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ecef_pose, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ecef_pose, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_pose = Eigen::Vector3d(__pyx_t_3, __pyx_t_4, __pyx_t_5); - /* "common/transformations/transformations.pyx":101 + /* "common/transformations/transformations.pyx":100 * cdef Vector3 pose = Vector3(ecef_pose[0], ecef_pose[1], ecef_pose[2]) * * cdef Vector3 e = ned_euler_from_ecef_c(init, pose) # <<<<<<<<<<<<<< @@ -7216,7 +7211,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_16ned_eule */ __pyx_v_e = ned_euler_from_ecef(__pyx_v_init, __pyx_v_pose); - /* "common/transformations/transformations.pyx":102 + /* "common/transformations/transformations.pyx":101 * * cdef Vector3 e = ned_euler_from_ecef_c(init, pose) * return [e(0), e(1), e(2)] # <<<<<<<<<<<<<< @@ -7224,20 +7219,20 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_16ned_eule * def geodetic2ecef_single(geodetic): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e(0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e(0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e(1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_6 = PyFloat_FromDouble(__pyx_v_e(1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyFloat_FromDouble(__pyx_v_e(2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_7 = PyFloat_FromDouble(__pyx_v_e(2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(0, 102, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(0, 101, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(0, 102, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(0, 101, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; @@ -7245,7 +7240,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_16ned_eule __pyx_t_8 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":97 + /* "common/transformations/transformations.pyx":96 * return [e(0), e(1), e(2)] * * def ned_euler_from_ecef_single(ecef_init, ecef_pose): # <<<<<<<<<<<<<< @@ -7267,7 +7262,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_16ned_eule return __pyx_r; } -/* "common/transformations/transformations.pyx":104 +/* "common/transformations/transformations.pyx":103 * return [e(0), e(1), e(2)] * * def geodetic2ecef_single(geodetic): # <<<<<<<<<<<<<< @@ -7328,12 +7323,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "geodetic2ecef_single") < 0)) __PYX_ERR(0, 104, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "geodetic2ecef_single") < 0)) __PYX_ERR(0, 103, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -7344,7 +7339,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("geodetic2ecef_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("geodetic2ecef_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 103, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7386,17 +7381,17 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_18geodetic int __pyx_clineno = 0; __Pyx_RefNannySetupContext("geodetic2ecef_single", 1); - /* "common/transformations/transformations.pyx":105 + /* "common/transformations/transformations.pyx":104 * * def geodetic2ecef_single(geodetic): * cdef Geodetic g = list2geodetic(geodetic) # <<<<<<<<<<<<<< * cdef ECEF e = geodetic2ecef_c(g) * return [e.x, e.y, e.z] */ - __pyx_t_1 = __pyx_f_6common_15transformations_15transformations_list2geodetic(__pyx_v_geodetic); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6common_15transformations_15transformations_list2geodetic(__pyx_v_geodetic); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) __pyx_v_g = __pyx_t_1; - /* "common/transformations/transformations.pyx":106 + /* "common/transformations/transformations.pyx":105 * def geodetic2ecef_single(geodetic): * cdef Geodetic g = list2geodetic(geodetic) * cdef ECEF e = geodetic2ecef_c(g) # <<<<<<<<<<<<<< @@ -7405,7 +7400,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_18geodetic */ __pyx_v_e = geodetic2ecef(__pyx_v_g); - /* "common/transformations/transformations.pyx":107 + /* "common/transformations/transformations.pyx":106 * cdef Geodetic g = list2geodetic(geodetic) * cdef ECEF e = geodetic2ecef_c(g) * return [e.x, e.y, e.z] # <<<<<<<<<<<<<< @@ -7413,20 +7408,20 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_18geodetic * def ecef2geodetic_single(ecef): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_e.x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_e.y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_e.y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_e.z); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_e.z); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error) + __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; @@ -7434,7 +7429,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_18geodetic __pyx_t_5 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":104 + /* "common/transformations/transformations.pyx":103 * return [e(0), e(1), e(2)] * * def geodetic2ecef_single(geodetic): # <<<<<<<<<<<<<< @@ -7456,7 +7451,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_18geodetic return __pyx_r; } -/* "common/transformations/transformations.pyx":109 +/* "common/transformations/transformations.pyx":108 * return [e.x, e.y, e.z] * * def ecef2geodetic_single(ecef): # <<<<<<<<<<<<<< @@ -7517,12 +7512,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ecef2geodetic_single") < 0)) __PYX_ERR(0, 109, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ecef2geodetic_single") < 0)) __PYX_ERR(0, 108, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -7533,7 +7528,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ecef2geodetic_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 109, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("ecef2geodetic_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 108, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7575,17 +7570,17 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_20ecef2geo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ecef2geodetic_single", 1); - /* "common/transformations/transformations.pyx":110 + /* "common/transformations/transformations.pyx":109 * * def ecef2geodetic_single(ecef): * cdef ECEF e = list2ecef(ecef) # <<<<<<<<<<<<<< * cdef Geodetic g = ecef2geodetic_c(e) * return [g.lat, g.lon, g.alt] */ - __pyx_t_1 = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_1 = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L1_error) __pyx_v_e = __pyx_t_1; - /* "common/transformations/transformations.pyx":111 + /* "common/transformations/transformations.pyx":110 * def ecef2geodetic_single(ecef): * cdef ECEF e = list2ecef(ecef) * cdef Geodetic g = ecef2geodetic_c(e) # <<<<<<<<<<<<<< @@ -7594,7 +7589,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_20ecef2geo */ __pyx_v_g = ecef2geodetic(__pyx_v_e); - /* "common/transformations/transformations.pyx":112 + /* "common/transformations/transformations.pyx":111 * cdef ECEF e = list2ecef(ecef) * cdef Geodetic g = ecef2geodetic_c(e) * return [g.lat, g.lon, g.alt] # <<<<<<<<<<<<<< @@ -7602,20 +7597,20 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_20ecef2geo * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_g.lat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_g.lat); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_g.lon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_g.lon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_g.alt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_g.alt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; @@ -7623,7 +7618,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_20ecef2geo __pyx_t_5 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":109 + /* "common/transformations/transformations.pyx":108 * return [e.x, e.y, e.z] * * def ecef2geodetic_single(ecef): # <<<<<<<<<<<<<< @@ -7645,7 +7640,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_20ecef2geo return __pyx_r; } -/* "common/transformations/transformations.pyx":118 +/* "common/transformations/transformations.pyx":117 * cdef LocalCoord_c * lc * * def __init__(self, geodetic=None, ecef=None): # <<<<<<<<<<<<<< @@ -7693,19 +7688,19 @@ static int __pyx_pw_6common_15transformations_15transformations_10LocalCoord_1__ if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_geodetic); if (value) { values[0] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ecef); if (value) { values[1] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 118, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 117, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -7722,7 +7717,7 @@ static int __pyx_pw_6common_15transformations_15transformations_10LocalCoord_1__ } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 118, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 117, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7759,7 +7754,7 @@ static int __pyx_pf_6common_15transformations_15transformations_10LocalCoord___i const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "common/transformations/transformations.pyx":119 + /* "common/transformations/transformations.pyx":118 * * def __init__(self, geodetic=None, ecef=None): * assert (geodetic is not None) or (ecef is not None) # <<<<<<<<<<<<<< @@ -7779,14 +7774,14 @@ static int __pyx_pf_6common_15transformations_15transformations_10LocalCoord___i __pyx_L3_bool_binop_done:; if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 119, __pyx_L1_error) + __PYX_ERR(0, 118, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 119, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 118, __pyx_L1_error) #endif - /* "common/transformations/transformations.pyx":120 + /* "common/transformations/transformations.pyx":119 * def __init__(self, geodetic=None, ecef=None): * assert (geodetic is not None) or (ecef is not None) * if geodetic is not None: # <<<<<<<<<<<<<< @@ -7796,17 +7791,17 @@ static int __pyx_pf_6common_15transformations_15transformations_10LocalCoord___i __pyx_t_1 = (__pyx_v_geodetic != Py_None); if (__pyx_t_1) { - /* "common/transformations/transformations.pyx":121 + /* "common/transformations/transformations.pyx":120 * assert (geodetic is not None) or (ecef is not None) * if geodetic is not None: * self.lc = new LocalCoord_c(list2geodetic(geodetic)) # <<<<<<<<<<<<<< * elif ecef is not None: * self.lc = new LocalCoord_c(list2ecef(ecef)) */ - __pyx_t_3 = __pyx_f_6common_15transformations_15transformations_list2geodetic(__pyx_v_geodetic); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error) + __pyx_t_3 = __pyx_f_6common_15transformations_15transformations_list2geodetic(__pyx_v_geodetic); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error) __pyx_v_self->lc = new LocalCoord(__pyx_t_3); - /* "common/transformations/transformations.pyx":120 + /* "common/transformations/transformations.pyx":119 * def __init__(self, geodetic=None, ecef=None): * assert (geodetic is not None) or (ecef is not None) * if geodetic is not None: # <<<<<<<<<<<<<< @@ -7816,7 +7811,7 @@ static int __pyx_pf_6common_15transformations_15transformations_10LocalCoord___i goto __pyx_L5; } - /* "common/transformations/transformations.pyx":122 + /* "common/transformations/transformations.pyx":121 * if geodetic is not None: * self.lc = new LocalCoord_c(list2geodetic(geodetic)) * elif ecef is not None: # <<<<<<<<<<<<<< @@ -7826,17 +7821,17 @@ static int __pyx_pf_6common_15transformations_15transformations_10LocalCoord___i __pyx_t_1 = (__pyx_v_ecef != Py_None); if (__pyx_t_1) { - /* "common/transformations/transformations.pyx":123 + /* "common/transformations/transformations.pyx":122 * self.lc = new LocalCoord_c(list2geodetic(geodetic)) * elif ecef is not None: * self.lc = new LocalCoord_c(list2ecef(ecef)) # <<<<<<<<<<<<<< * * @property */ - __pyx_t_4 = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_4 = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L1_error) __pyx_v_self->lc = new LocalCoord(__pyx_t_4); - /* "common/transformations/transformations.pyx":122 + /* "common/transformations/transformations.pyx":121 * if geodetic is not None: * self.lc = new LocalCoord_c(list2geodetic(geodetic)) * elif ecef is not None: # <<<<<<<<<<<<<< @@ -7846,7 +7841,7 @@ static int __pyx_pf_6common_15transformations_15transformations_10LocalCoord___i } __pyx_L5:; - /* "common/transformations/transformations.pyx":118 + /* "common/transformations/transformations.pyx":117 * cdef LocalCoord_c * lc * * def __init__(self, geodetic=None, ecef=None): # <<<<<<<<<<<<<< @@ -7864,7 +7859,7 @@ static int __pyx_pf_6common_15transformations_15transformations_10LocalCoord___i return __pyx_r; } -/* "common/transformations/transformations.pyx":125 +/* "common/transformations/transformations.pyx":124 * self.lc = new LocalCoord_c(list2ecef(ecef)) * * @property # <<<<<<<<<<<<<< @@ -7896,7 +7891,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); - /* "common/transformations/transformations.pyx":127 + /* "common/transformations/transformations.pyx":126 * @property * def ned2ecef_matrix(self): * return matrix2numpy(self.lc.ned2ecef_matrix) # <<<<<<<<<<<<<< @@ -7904,13 +7899,13 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(__pyx_v_self->lc->ned2ecef_matrix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(__pyx_v_self->lc->ned2ecef_matrix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":125 + /* "common/transformations/transformations.pyx":124 * self.lc = new LocalCoord_c(list2ecef(ecef)) * * @property # <<<<<<<<<<<<<< @@ -7929,7 +7924,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo return __pyx_r; } -/* "common/transformations/transformations.pyx":129 +/* "common/transformations/transformations.pyx":128 * return matrix2numpy(self.lc.ned2ecef_matrix) * * @property # <<<<<<<<<<<<<< @@ -7961,7 +7956,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); - /* "common/transformations/transformations.pyx":131 + /* "common/transformations/transformations.pyx":130 * @property * def ecef2ned_matrix(self): * return matrix2numpy(self.lc.ecef2ned_matrix) # <<<<<<<<<<<<<< @@ -7969,13 +7964,13 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(__pyx_v_self->lc->ecef2ned_matrix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) + __pyx_t_1 = ((PyObject *)__pyx_f_6common_15transformations_15transformations_matrix2numpy(__pyx_v_self->lc->ecef2ned_matrix)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":129 + /* "common/transformations/transformations.pyx":128 * return matrix2numpy(self.lc.ned2ecef_matrix) * * @property # <<<<<<<<<<<<<< @@ -7994,7 +7989,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo return __pyx_r; } -/* "common/transformations/transformations.pyx":133 +/* "common/transformations/transformations.pyx":132 * return matrix2numpy(self.lc.ecef2ned_matrix) * * @property # <<<<<<<<<<<<<< @@ -8026,7 +8021,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); - /* "common/transformations/transformations.pyx":135 + /* "common/transformations/transformations.pyx":134 * @property * def ned_from_ecef_matrix(self): * return self.ecef2ned_matrix # <<<<<<<<<<<<<< @@ -8034,13 +8029,13 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ecef2ned_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ecef2ned_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":133 + /* "common/transformations/transformations.pyx":132 * return matrix2numpy(self.lc.ecef2ned_matrix) * * @property # <<<<<<<<<<<<<< @@ -8059,7 +8054,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo return __pyx_r; } -/* "common/transformations/transformations.pyx":137 +/* "common/transformations/transformations.pyx":136 * return self.ecef2ned_matrix * * @property # <<<<<<<<<<<<<< @@ -8091,7 +8086,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 1); - /* "common/transformations/transformations.pyx":139 + /* "common/transformations/transformations.pyx":138 * @property * def ecef_from_ned_matrix(self): * return self.ned2ecef_matrix # <<<<<<<<<<<<<< @@ -8099,13 +8094,13 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo * @classmethod */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ned2ecef_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ned2ecef_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":137 + /* "common/transformations/transformations.pyx":136 * return self.ecef2ned_matrix * * @property # <<<<<<<<<<<<<< @@ -8124,7 +8119,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo return __pyx_r; } -/* "common/transformations/transformations.pyx":141 +/* "common/transformations/transformations.pyx":140 * return self.ned2ecef_matrix * * @classmethod # <<<<<<<<<<<<<< @@ -8185,12 +8180,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_geodetic") < 0)) __PYX_ERR(0, 141, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_geodetic") < 0)) __PYX_ERR(0, 140, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -8201,7 +8196,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("from_geodetic", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 141, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("from_geodetic", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 140, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8238,7 +8233,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_geodetic", 1); - /* "common/transformations/transformations.pyx":143 + /* "common/transformations/transformations.pyx":142 * @classmethod * def from_geodetic(cls, geodetic): * return cls(geodetic=geodetic) # <<<<<<<<<<<<<< @@ -8246,17 +8241,17 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo * @classmethod */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_geodetic, __pyx_v_geodetic) < 0) __PYX_ERR(0, 143, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_geodetic, __pyx_v_geodetic) < 0) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":141 + /* "common/transformations/transformations.pyx":140 * return self.ned2ecef_matrix * * @classmethod # <<<<<<<<<<<<<< @@ -8276,7 +8271,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo return __pyx_r; } -/* "common/transformations/transformations.pyx":145 +/* "common/transformations/transformations.pyx":144 * return cls(geodetic=geodetic) * * @classmethod # <<<<<<<<<<<<<< @@ -8337,12 +8332,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_ecef") < 0)) __PYX_ERR(0, 145, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "from_ecef") < 0)) __PYX_ERR(0, 144, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -8353,7 +8348,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("from_ecef", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 145, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("from_ecef", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 144, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8390,7 +8385,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("from_ecef", 1); - /* "common/transformations/transformations.pyx":147 + /* "common/transformations/transformations.pyx":146 * @classmethod * def from_ecef(cls, ecef): * return cls(ecef=ecef) # <<<<<<<<<<<<<< @@ -8398,17 +8393,17 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo * def ecef2ned_single(self, ecef): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ecef, __pyx_v_ecef) < 0) __PYX_ERR(0, 147, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ecef, __pyx_v_ecef) < 0) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_cls), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":145 + /* "common/transformations/transformations.pyx":144 * return cls(geodetic=geodetic) * * @classmethod # <<<<<<<<<<<<<< @@ -8428,7 +8423,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo return __pyx_r; } -/* "common/transformations/transformations.pyx":149 +/* "common/transformations/transformations.pyx":148 * return cls(ecef=ecef) * * def ecef2ned_single(self, ecef): # <<<<<<<<<<<<<< @@ -8489,12 +8484,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ecef2ned_single") < 0)) __PYX_ERR(0, 149, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ecef2ned_single") < 0)) __PYX_ERR(0, 148, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -8505,7 +8500,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ecef2ned_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 149, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("ecef2ned_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 148, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8548,7 +8543,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ecef2ned_single", 1); - /* "common/transformations/transformations.pyx":150 + /* "common/transformations/transformations.pyx":149 * * def ecef2ned_single(self, ecef): * assert self.lc # <<<<<<<<<<<<<< @@ -8560,24 +8555,24 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo __pyx_t_1 = (__pyx_v_self->lc != 0); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 150, __pyx_L1_error) + __PYX_ERR(0, 149, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 150, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 149, __pyx_L1_error) #endif - /* "common/transformations/transformations.pyx":151 + /* "common/transformations/transformations.pyx":150 * def ecef2ned_single(self, ecef): * assert self.lc * cdef ECEF e = list2ecef(ecef) # <<<<<<<<<<<<<< * cdef NED n = self.lc.ecef2ned(e) * return [n.n, n.e, n.d] */ - __pyx_t_2 = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_2 = __pyx_f_6common_15transformations_15transformations_list2ecef(__pyx_v_ecef); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L1_error) __pyx_v_e = __pyx_t_2; - /* "common/transformations/transformations.pyx":152 + /* "common/transformations/transformations.pyx":151 * assert self.lc * cdef ECEF e = list2ecef(ecef) * cdef NED n = self.lc.ecef2ned(e) # <<<<<<<<<<<<<< @@ -8586,7 +8581,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo */ __pyx_v_n = __pyx_v_self->lc->ecef2ned(__pyx_v_e); - /* "common/transformations/transformations.pyx":153 + /* "common/transformations/transformations.pyx":152 * cdef ECEF e = list2ecef(ecef) * cdef NED n = self.lc.ecef2ned(e) * return [n.n, n.e, n.d] # <<<<<<<<<<<<<< @@ -8594,20 +8589,20 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo * def ned2ecef_single(self, ned): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_n.n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_n.n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_n.e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_n.e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_n.d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_n.d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; @@ -8615,7 +8610,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo __pyx_t_6 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":149 + /* "common/transformations/transformations.pyx":148 * return cls(ecef=ecef) * * def ecef2ned_single(self, ecef): # <<<<<<<<<<<<<< @@ -8637,7 +8632,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo return __pyx_r; } -/* "common/transformations/transformations.pyx":155 +/* "common/transformations/transformations.pyx":154 * return [n.n, n.e, n.d] * * def ned2ecef_single(self, ned): # <<<<<<<<<<<<<< @@ -8698,12 +8693,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ned2ecef_single") < 0)) __PYX_ERR(0, 155, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ned2ecef_single") < 0)) __PYX_ERR(0, 154, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -8714,7 +8709,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ned2ecef_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 155, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("ned2ecef_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 154, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8757,7 +8752,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ned2ecef_single", 1); - /* "common/transformations/transformations.pyx":156 + /* "common/transformations/transformations.pyx":155 * * def ned2ecef_single(self, ned): * assert self.lc # <<<<<<<<<<<<<< @@ -8769,24 +8764,24 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo __pyx_t_1 = (__pyx_v_self->lc != 0); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 156, __pyx_L1_error) + __PYX_ERR(0, 155, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 156, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 155, __pyx_L1_error) #endif - /* "common/transformations/transformations.pyx":157 + /* "common/transformations/transformations.pyx":156 * def ned2ecef_single(self, ned): * assert self.lc * cdef NED n = list2ned(ned) # <<<<<<<<<<<<<< * cdef ECEF e = self.lc.ned2ecef(n) * return [e.x, e.y, e.z] */ - __pyx_t_2 = __pyx_f_6common_15transformations_15transformations_list2ned(__pyx_v_ned); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error) + __pyx_t_2 = __pyx_f_6common_15transformations_15transformations_list2ned(__pyx_v_ned); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L1_error) __pyx_v_n = __pyx_t_2; - /* "common/transformations/transformations.pyx":158 + /* "common/transformations/transformations.pyx":157 * assert self.lc * cdef NED n = list2ned(ned) * cdef ECEF e = self.lc.ned2ecef(n) # <<<<<<<<<<<<<< @@ -8795,7 +8790,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo */ __pyx_v_e = __pyx_v_self->lc->ned2ecef(__pyx_v_n); - /* "common/transformations/transformations.pyx":159 + /* "common/transformations/transformations.pyx":158 * cdef NED n = list2ned(ned) * cdef ECEF e = self.lc.ned2ecef(n) * return [e.x, e.y, e.z] # <<<<<<<<<<<<<< @@ -8803,20 +8798,20 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo * def geodetic2ned_single(self, geodetic): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_e.x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_e.x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_e.y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_e.y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_e.z); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_e.z); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; @@ -8824,7 +8819,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo __pyx_t_6 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":155 + /* "common/transformations/transformations.pyx":154 * return [n.n, n.e, n.d] * * def ned2ecef_single(self, ned): # <<<<<<<<<<<<<< @@ -8846,7 +8841,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo return __pyx_r; } -/* "common/transformations/transformations.pyx":161 +/* "common/transformations/transformations.pyx":160 * return [e.x, e.y, e.z] * * def geodetic2ned_single(self, geodetic): # <<<<<<<<<<<<<< @@ -8907,12 +8902,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "geodetic2ned_single") < 0)) __PYX_ERR(0, 161, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "geodetic2ned_single") < 0)) __PYX_ERR(0, 160, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -8923,7 +8918,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("geodetic2ned_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 161, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("geodetic2ned_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 160, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8966,7 +8961,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("geodetic2ned_single", 1); - /* "common/transformations/transformations.pyx":162 + /* "common/transformations/transformations.pyx":161 * * def geodetic2ned_single(self, geodetic): * assert self.lc # <<<<<<<<<<<<<< @@ -8978,24 +8973,24 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo __pyx_t_1 = (__pyx_v_self->lc != 0); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 162, __pyx_L1_error) + __PYX_ERR(0, 161, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 162, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 161, __pyx_L1_error) #endif - /* "common/transformations/transformations.pyx":163 + /* "common/transformations/transformations.pyx":162 * def geodetic2ned_single(self, geodetic): * assert self.lc * cdef Geodetic g = list2geodetic(geodetic) # <<<<<<<<<<<<<< * cdef NED n = self.lc.geodetic2ned(g) * return [n.n, n.e, n.d] */ - __pyx_t_2 = __pyx_f_6common_15transformations_15transformations_list2geodetic(__pyx_v_geodetic); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_2 = __pyx_f_6common_15transformations_15transformations_list2geodetic(__pyx_v_geodetic); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error) __pyx_v_g = __pyx_t_2; - /* "common/transformations/transformations.pyx":164 + /* "common/transformations/transformations.pyx":163 * assert self.lc * cdef Geodetic g = list2geodetic(geodetic) * cdef NED n = self.lc.geodetic2ned(g) # <<<<<<<<<<<<<< @@ -9004,7 +8999,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo */ __pyx_v_n = __pyx_v_self->lc->geodetic2ned(__pyx_v_g); - /* "common/transformations/transformations.pyx":165 + /* "common/transformations/transformations.pyx":164 * cdef Geodetic g = list2geodetic(geodetic) * cdef NED n = self.lc.geodetic2ned(g) * return [n.n, n.e, n.d] # <<<<<<<<<<<<<< @@ -9012,20 +9007,20 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo * def ned2geodetic_single(self, ned): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_n.n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_n.n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_n.e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_n.e); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_n.d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_n.d); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error) + __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; @@ -9033,7 +9028,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo __pyx_t_6 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":161 + /* "common/transformations/transformations.pyx":160 * return [e.x, e.y, e.z] * * def geodetic2ned_single(self, geodetic): # <<<<<<<<<<<<<< @@ -9055,7 +9050,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo return __pyx_r; } -/* "common/transformations/transformations.pyx":167 +/* "common/transformations/transformations.pyx":166 * return [n.n, n.e, n.d] * * def ned2geodetic_single(self, ned): # <<<<<<<<<<<<<< @@ -9116,12 +9111,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 167, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ned2geodetic_single") < 0)) __PYX_ERR(0, 167, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "ned2geodetic_single") < 0)) __PYX_ERR(0, 166, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -9132,7 +9127,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("ned2geodetic_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 167, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("ned2geodetic_single", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 166, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9175,7 +9170,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ned2geodetic_single", 1); - /* "common/transformations/transformations.pyx":168 + /* "common/transformations/transformations.pyx":167 * * def ned2geodetic_single(self, ned): * assert self.lc # <<<<<<<<<<<<<< @@ -9187,24 +9182,24 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo __pyx_t_1 = (__pyx_v_self->lc != 0); if (unlikely(!__pyx_t_1)) { __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0); - __PYX_ERR(0, 168, __pyx_L1_error) + __PYX_ERR(0, 167, __pyx_L1_error) } } #else - if ((1)); else __PYX_ERR(0, 168, __pyx_L1_error) + if ((1)); else __PYX_ERR(0, 167, __pyx_L1_error) #endif - /* "common/transformations/transformations.pyx":169 + /* "common/transformations/transformations.pyx":168 * def ned2geodetic_single(self, ned): * assert self.lc * cdef NED n = list2ned(ned) # <<<<<<<<<<<<<< * cdef Geodetic g = self.lc.ned2geodetic(n) * return [g.lat, g.lon, g.alt] */ - __pyx_t_2 = __pyx_f_6common_15transformations_15transformations_list2ned(__pyx_v_ned); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_2 = __pyx_f_6common_15transformations_15transformations_list2ned(__pyx_v_ned); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L1_error) __pyx_v_n = __pyx_t_2; - /* "common/transformations/transformations.pyx":170 + /* "common/transformations/transformations.pyx":169 * assert self.lc * cdef NED n = list2ned(ned) * cdef Geodetic g = self.lc.ned2geodetic(n) # <<<<<<<<<<<<<< @@ -9213,7 +9208,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo */ __pyx_v_g = __pyx_v_self->lc->ned2geodetic(__pyx_v_n); - /* "common/transformations/transformations.pyx":171 + /* "common/transformations/transformations.pyx":170 * cdef NED n = list2ned(ned) * cdef Geodetic g = self.lc.ned2geodetic(n) * return [g.lat, g.lon, g.alt] # <<<<<<<<<<<<<< @@ -9221,20 +9216,20 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo * def __dealloc__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyFloat_FromDouble(__pyx_v_g.lat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(__pyx_v_g.lat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_g.lon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_g.lon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyFloat_FromDouble(__pyx_v_g.alt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_v_g.alt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; @@ -9242,7 +9237,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo __pyx_t_6 = 0; goto __pyx_L0; - /* "common/transformations/transformations.pyx":167 + /* "common/transformations/transformations.pyx":166 * return [n.n, n.e, n.d] * * def ned2geodetic_single(self, ned): # <<<<<<<<<<<<<< @@ -9264,7 +9259,7 @@ static PyObject *__pyx_pf_6common_15transformations_15transformations_10LocalCoo return __pyx_r; } -/* "common/transformations/transformations.pyx":173 +/* "common/transformations/transformations.pyx":172 * return [g.lat, g.lon, g.alt] * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -9286,14 +9281,14 @@ static void __pyx_pw_6common_15transformations_15transformations_10LocalCoord_15 static void __pyx_pf_6common_15transformations_15transformations_10LocalCoord_14__dealloc__(struct __pyx_obj_6common_15transformations_15transformations_LocalCoord *__pyx_v_self) { - /* "common/transformations/transformations.pyx":174 + /* "common/transformations/transformations.pyx":173 * * def __dealloc__(self): * del self.lc # <<<<<<<<<<<<<< */ delete __pyx_v_self->lc; - /* "common/transformations/transformations.pyx":173 + /* "common/transformations/transformations.pyx":172 * return [g.lat, g.lon, g.alt] * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -9804,9 +9799,9 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { } /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 31, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 984, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -9817,231 +9812,231 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple_)) __PYX_ERR(2, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(2, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "common/transformations/transformations.pyx":57 + /* "common/transformations/transformations.pyx":56 * return g * * def euler2quat_single(euler): # <<<<<<<<<<<<<< * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) * cdef Quaternion q = euler2quat_c(e) */ - __pyx_tuple__4 = PyTuple_Pack(3, __pyx_n_s_euler, __pyx_n_s_e, __pyx_n_s_q); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_tuple__4 = PyTuple_Pack(3, __pyx_n_s_euler, __pyx_n_s_e, __pyx_n_s_q); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_euler2quat_single, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_euler2quat_single, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 56, __pyx_L1_error) - /* "common/transformations/transformations.pyx":62 + /* "common/transformations/transformations.pyx":61 * return [q.w(), q.x(), q.y(), q.z()] * * def quat2euler_single(quat): # <<<<<<<<<<<<<< * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) - * cdef Vector3 e = quat2euler_c(q); + * cdef Vector3 e = quat2euler_c(q) */ - __pyx_tuple__6 = PyTuple_Pack(3, __pyx_n_s_quat, __pyx_n_s_q, __pyx_n_s_e); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_tuple__6 = PyTuple_Pack(3, __pyx_n_s_quat, __pyx_n_s_q, __pyx_n_s_e); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_quat2euler_single, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_quat2euler_single, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 61, __pyx_L1_error) - /* "common/transformations/transformations.pyx":67 + /* "common/transformations/transformations.pyx":66 * return [e(0), e(1), e(2)] * * def quat2rot_single(quat): # <<<<<<<<<<<<<< * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) * cdef Matrix3 r = quat2rot_c(q) */ - __pyx_tuple__8 = PyTuple_Pack(3, __pyx_n_s_quat, __pyx_n_s_q, __pyx_n_s_r); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_tuple__8 = PyTuple_Pack(3, __pyx_n_s_quat, __pyx_n_s_q, __pyx_n_s_r); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_quat2rot_single, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_quat2rot_single, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 66, __pyx_L1_error) - /* "common/transformations/transformations.pyx":72 + /* "common/transformations/transformations.pyx":71 * return matrix2numpy(r) * * def rot2quat_single(rot): # <<<<<<<<<<<<<< * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) * cdef Quaternion q = rot2quat_c(r) */ - __pyx_tuple__10 = PyTuple_Pack(3, __pyx_n_s_rot, __pyx_n_s_r, __pyx_n_s_q); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(3, __pyx_n_s_rot, __pyx_n_s_r, __pyx_n_s_q); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_rot2quat_single, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_rot2quat_single, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 71, __pyx_L1_error) - /* "common/transformations/transformations.pyx":77 + /* "common/transformations/transformations.pyx":76 * return [q.w(), q.x(), q.y(), q.z()] * * def euler2rot_single(euler): # <<<<<<<<<<<<<< * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) * cdef Matrix3 r = euler2rot_c(e) */ - __pyx_tuple__12 = PyTuple_Pack(3, __pyx_n_s_euler, __pyx_n_s_e, __pyx_n_s_r); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(3, __pyx_n_s_euler, __pyx_n_s_e, __pyx_n_s_r); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_euler2rot_single, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_euler2rot_single, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 76, __pyx_L1_error) - /* "common/transformations/transformations.pyx":82 + /* "common/transformations/transformations.pyx":81 * return matrix2numpy(r) * * def rot2euler_single(rot): # <<<<<<<<<<<<<< * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) * cdef Vector3 e = rot2euler_c(r) */ - __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_rot, __pyx_n_s_r, __pyx_n_s_e); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_rot, __pyx_n_s_r, __pyx_n_s_e); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_rot2euler_single, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_rot2euler_single, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 81, __pyx_L1_error) - /* "common/transformations/transformations.pyx":87 + /* "common/transformations/transformations.pyx":86 * return [e(0), e(1), e(2)] * * def rot_matrix(roll, pitch, yaw): # <<<<<<<<<<<<<< * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) * */ - __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_roll, __pyx_n_s_pitch, __pyx_n_s_yaw); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_roll, __pyx_n_s_pitch, __pyx_n_s_yaw); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_rot_matrix, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_rot_matrix, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 86, __pyx_L1_error) - /* "common/transformations/transformations.pyx":90 + /* "common/transformations/transformations.pyx":89 * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) * * def ecef_euler_from_ned_single(ecef_init, ned_pose): # <<<<<<<<<<<<<< * cdef ECEF init = list2ecef(ecef_init) * cdef Vector3 pose = Vector3(ned_pose[0], ned_pose[1], ned_pose[2]) */ - __pyx_tuple__18 = PyTuple_Pack(5, __pyx_n_s_ecef_init, __pyx_n_s_ned_pose, __pyx_n_s_init, __pyx_n_s_pose, __pyx_n_s_e); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_tuple__18 = PyTuple_Pack(5, __pyx_n_s_ecef_init, __pyx_n_s_ned_pose, __pyx_n_s_init, __pyx_n_s_pose, __pyx_n_s_e); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ecef_euler_from_ned_single, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ecef_euler_from_ned_single, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 89, __pyx_L1_error) - /* "common/transformations/transformations.pyx":97 + /* "common/transformations/transformations.pyx":96 * return [e(0), e(1), e(2)] * * def ned_euler_from_ecef_single(ecef_init, ecef_pose): # <<<<<<<<<<<<<< * cdef ECEF init = list2ecef(ecef_init) * cdef Vector3 pose = Vector3(ecef_pose[0], ecef_pose[1], ecef_pose[2]) */ - __pyx_tuple__20 = PyTuple_Pack(5, __pyx_n_s_ecef_init, __pyx_n_s_ecef_pose, __pyx_n_s_init, __pyx_n_s_pose, __pyx_n_s_e); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_tuple__20 = PyTuple_Pack(5, __pyx_n_s_ecef_init, __pyx_n_s_ecef_pose, __pyx_n_s_init, __pyx_n_s_pose, __pyx_n_s_e); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ned_euler_from_ecef_single, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ned_euler_from_ecef_single, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 96, __pyx_L1_error) - /* "common/transformations/transformations.pyx":104 + /* "common/transformations/transformations.pyx":103 * return [e(0), e(1), e(2)] * * def geodetic2ecef_single(geodetic): # <<<<<<<<<<<<<< * cdef Geodetic g = list2geodetic(geodetic) * cdef ECEF e = geodetic2ecef_c(g) */ - __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_geodetic, __pyx_n_s_g, __pyx_n_s_e); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_tuple__22 = PyTuple_Pack(3, __pyx_n_s_geodetic, __pyx_n_s_g, __pyx_n_s_e); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_geodetic2ecef_single, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_geodetic2ecef_single, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 103, __pyx_L1_error) - /* "common/transformations/transformations.pyx":109 + /* "common/transformations/transformations.pyx":108 * return [e.x, e.y, e.z] * * def ecef2geodetic_single(ecef): # <<<<<<<<<<<<<< * cdef ECEF e = list2ecef(ecef) * cdef Geodetic g = ecef2geodetic_c(e) */ - __pyx_tuple__24 = PyTuple_Pack(3, __pyx_n_s_ecef, __pyx_n_s_e, __pyx_n_s_g); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(3, __pyx_n_s_ecef, __pyx_n_s_e, __pyx_n_s_g); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); - __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ecef2geodetic_single, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ecef2geodetic_single, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 108, __pyx_L1_error) - /* "common/transformations/transformations.pyx":141 + /* "common/transformations/transformations.pyx":140 * return self.ned2ecef_matrix * * @classmethod # <<<<<<<<<<<<<< * def from_geodetic(cls, geodetic): * return cls(geodetic=geodetic) */ - __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_geodetic); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_geodetic); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_from_geodetic, 141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_from_geodetic, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 140, __pyx_L1_error) - /* "common/transformations/transformations.pyx":145 + /* "common/transformations/transformations.pyx":144 * return cls(geodetic=geodetic) * * @classmethod # <<<<<<<<<<<<<< * def from_ecef(cls, ecef): * return cls(ecef=ecef) */ - __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_ecef); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_ecef); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); - __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_from_ecef, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_from_ecef, 144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 144, __pyx_L1_error) - /* "common/transformations/transformations.pyx":149 + /* "common/transformations/transformations.pyx":148 * return cls(ecef=ecef) * * def ecef2ned_single(self, ecef): # <<<<<<<<<<<<<< * assert self.lc * cdef ECEF e = list2ecef(ecef) */ - __pyx_tuple__30 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ecef, __pyx_n_s_e, __pyx_n_s_n); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_tuple__30 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ecef, __pyx_n_s_e, __pyx_n_s_n); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); - __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ecef2ned_single, 149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ecef2ned_single, 148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 148, __pyx_L1_error) - /* "common/transformations/transformations.pyx":155 + /* "common/transformations/transformations.pyx":154 * return [n.n, n.e, n.d] * * def ned2ecef_single(self, ned): # <<<<<<<<<<<<<< * assert self.lc * cdef NED n = list2ned(ned) */ - __pyx_tuple__32 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ned, __pyx_n_s_n, __pyx_n_s_e); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_tuple__32 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ned, __pyx_n_s_n, __pyx_n_s_e); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); - __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ned2ecef_single, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ned2ecef_single, 154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 154, __pyx_L1_error) - /* "common/transformations/transformations.pyx":161 + /* "common/transformations/transformations.pyx":160 * return [e.x, e.y, e.z] * * def geodetic2ned_single(self, geodetic): # <<<<<<<<<<<<<< * assert self.lc * cdef Geodetic g = list2geodetic(geodetic) */ - __pyx_tuple__34 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_geodetic, __pyx_n_s_g, __pyx_n_s_n); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_geodetic, __pyx_n_s_g, __pyx_n_s_n); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_geodetic2ned_single, 161, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_geodetic2ned_single, 160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 160, __pyx_L1_error) - /* "common/transformations/transformations.pyx":167 + /* "common/transformations/transformations.pyx":166 * return [n.n, n.e, n.d] * * def ned2geodetic_single(self, ned): # <<<<<<<<<<<<<< * assert self.lc * cdef NED n = list2ned(ned) */ - __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ned, __pyx_n_s_n, __pyx_n_s_g); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ned, __pyx_n_s_n, __pyx_n_s_g); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); - __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ned2geodetic_single, 167, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_transformations_transform, __pyx_n_s_ned2geodetic_single, 166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 166, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< @@ -10150,15 +10145,15 @@ static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_6common_15transformations_15transformations_LocalCoord = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6common_15transformations_15transformations_LocalCoord_spec, NULL); if (unlikely(!__pyx_ptype_6common_15transformations_15transformations_LocalCoord)) __PYX_ERR(0, 115, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6common_15transformations_15transformations_LocalCoord_spec, __pyx_ptype_6common_15transformations_15transformations_LocalCoord) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + __pyx_ptype_6common_15transformations_15transformations_LocalCoord = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6common_15transformations_15transformations_LocalCoord_spec, NULL); if (unlikely(!__pyx_ptype_6common_15transformations_15transformations_LocalCoord)) __PYX_ERR(0, 114, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6common_15transformations_15transformations_LocalCoord_spec, __pyx_ptype_6common_15transformations_15transformations_LocalCoord) < 0) __PYX_ERR(0, 114, __pyx_L1_error) #else __pyx_ptype_6common_15transformations_15transformations_LocalCoord = &__pyx_type_6common_15transformations_15transformations_LocalCoord; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_6common_15transformations_15transformations_LocalCoord) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_6common_15transformations_15transformations_LocalCoord) < 0) __PYX_ERR(0, 114, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_6common_15transformations_15transformations_LocalCoord->tp_print = 0; @@ -10168,9 +10163,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_ptype_6common_15transformations_15transformations_LocalCoord->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LocalCoord, (PyObject *) __pyx_ptype_6common_15transformations_15transformations_LocalCoord) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LocalCoord, (PyObject *) __pyx_ptype_6common_15transformations_15transformations_LocalCoord) < 0) __PYX_ERR(0, 114, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API - if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_6common_15transformations_15transformations_LocalCoord) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_6common_15transformations_15transformations_LocalCoord) < 0) __PYX_ERR(0, 114, __pyx_L1_error) #endif __Pyx_RefNannyFinishContext(); return 0; @@ -10189,33 +10184,33 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_5(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_8(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyTypeObject), #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 809, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 811, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 813, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 815, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 817, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 819, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 821, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 823, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 825, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 827, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 865, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 202, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 225, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 229, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 809, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 811, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 815, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 817, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 819, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 821, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 823, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 825, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 866, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -10430,7 +10425,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_transformations(PyObject *__pyx_py __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to transformations pseudovariable */ + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "transformations" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } @@ -10520,241 +10515,241 @@ if (!__Pyx_RefNanny) { if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - /* "common/transformations/transformations.pyx":21 + /* "common/transformations/transformations.pyx":20 + * * - * import cython * import numpy as np # <<<<<<<<<<<<<< * cimport numpy as np * */ - __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) + __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":57 + /* "common/transformations/transformations.pyx":56 * return g * * def euler2quat_single(euler): # <<<<<<<<<<<<<< * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) * cdef Quaternion q = euler2quat_c(e) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_1euler2quat_single, 0, __pyx_n_s_euler2quat_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_1euler2quat_single, 0, __pyx_n_s_euler2quat_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_euler2quat_single, __pyx_t_2) < 0) __PYX_ERR(0, 57, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_euler2quat_single, __pyx_t_2) < 0) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":62 + /* "common/transformations/transformations.pyx":61 * return [q.w(), q.x(), q.y(), q.z()] * * def quat2euler_single(quat): # <<<<<<<<<<<<<< * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) - * cdef Vector3 e = quat2euler_c(q); + * cdef Vector3 e = quat2euler_c(q) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_3quat2euler_single, 0, __pyx_n_s_quat2euler_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_3quat2euler_single, 0, __pyx_n_s_quat2euler_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_quat2euler_single, __pyx_t_2) < 0) __PYX_ERR(0, 62, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_quat2euler_single, __pyx_t_2) < 0) __PYX_ERR(0, 61, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":67 + /* "common/transformations/transformations.pyx":66 * return [e(0), e(1), e(2)] * * def quat2rot_single(quat): # <<<<<<<<<<<<<< * cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) * cdef Matrix3 r = quat2rot_c(q) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_5quat2rot_single, 0, __pyx_n_s_quat2rot_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_5quat2rot_single, 0, __pyx_n_s_quat2rot_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_quat2rot_single, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_quat2rot_single, __pyx_t_2) < 0) __PYX_ERR(0, 66, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":72 + /* "common/transformations/transformations.pyx":71 * return matrix2numpy(r) * * def rot2quat_single(rot): # <<<<<<<<<<<<<< * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) * cdef Quaternion q = rot2quat_c(r) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_7rot2quat_single, 0, __pyx_n_s_rot2quat_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_7rot2quat_single, 0, __pyx_n_s_rot2quat_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_rot2quat_single, __pyx_t_2) < 0) __PYX_ERR(0, 72, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rot2quat_single, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":77 + /* "common/transformations/transformations.pyx":76 * return [q.w(), q.x(), q.y(), q.z()] * * def euler2rot_single(euler): # <<<<<<<<<<<<<< * cdef Vector3 e = Vector3(euler[0], euler[1], euler[2]) * cdef Matrix3 r = euler2rot_c(e) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_9euler2rot_single, 0, __pyx_n_s_euler2rot_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_9euler2rot_single, 0, __pyx_n_s_euler2rot_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_euler2rot_single, __pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_euler2rot_single, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":82 + /* "common/transformations/transformations.pyx":81 * return matrix2numpy(r) * * def rot2euler_single(rot): # <<<<<<<<<<<<<< * cdef Matrix3 r = numpy2matrix(np.asfortranarray(rot, dtype=np.double)) * cdef Vector3 e = rot2euler_c(r) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_11rot2euler_single, 0, __pyx_n_s_rot2euler_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_11rot2euler_single, 0, __pyx_n_s_rot2euler_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_rot2euler_single, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rot2euler_single, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":87 + /* "common/transformations/transformations.pyx":86 * return [e(0), e(1), e(2)] * * def rot_matrix(roll, pitch, yaw): # <<<<<<<<<<<<<< * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) * */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_13rot_matrix, 0, __pyx_n_s_rot_matrix, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_13rot_matrix, 0, __pyx_n_s_rot_matrix, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_rot_matrix, __pyx_t_2) < 0) __PYX_ERR(0, 87, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_rot_matrix, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":90 + /* "common/transformations/transformations.pyx":89 * return matrix2numpy(rot_matrix_c(roll, pitch, yaw)) * * def ecef_euler_from_ned_single(ecef_init, ned_pose): # <<<<<<<<<<<<<< * cdef ECEF init = list2ecef(ecef_init) * cdef Vector3 pose = Vector3(ned_pose[0], ned_pose[1], ned_pose[2]) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_15ecef_euler_from_ned_single, 0, __pyx_n_s_ecef_euler_from_ned_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_15ecef_euler_from_ned_single, 0, __pyx_n_s_ecef_euler_from_ned_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ecef_euler_from_ned_single, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ecef_euler_from_ned_single, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":97 + /* "common/transformations/transformations.pyx":96 * return [e(0), e(1), e(2)] * * def ned_euler_from_ecef_single(ecef_init, ecef_pose): # <<<<<<<<<<<<<< * cdef ECEF init = list2ecef(ecef_init) * cdef Vector3 pose = Vector3(ecef_pose[0], ecef_pose[1], ecef_pose[2]) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_17ned_euler_from_ecef_single, 0, __pyx_n_s_ned_euler_from_ecef_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_17ned_euler_from_ecef_single, 0, __pyx_n_s_ned_euler_from_ecef_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ned_euler_from_ecef_single, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ned_euler_from_ecef_single, __pyx_t_2) < 0) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":104 + /* "common/transformations/transformations.pyx":103 * return [e(0), e(1), e(2)] * * def geodetic2ecef_single(geodetic): # <<<<<<<<<<<<<< * cdef Geodetic g = list2geodetic(geodetic) * cdef ECEF e = geodetic2ecef_c(g) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_19geodetic2ecef_single, 0, __pyx_n_s_geodetic2ecef_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_19geodetic2ecef_single, 0, __pyx_n_s_geodetic2ecef_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_geodetic2ecef_single, __pyx_t_2) < 0) __PYX_ERR(0, 104, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_geodetic2ecef_single, __pyx_t_2) < 0) __PYX_ERR(0, 103, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":109 + /* "common/transformations/transformations.pyx":108 * return [e.x, e.y, e.z] * * def ecef2geodetic_single(ecef): # <<<<<<<<<<<<<< * cdef ECEF e = list2ecef(ecef) * cdef Geodetic g = ecef2geodetic_c(e) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_21ecef2geodetic_single, 0, __pyx_n_s_ecef2geodetic_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_21ecef2geodetic_single, 0, __pyx_n_s_ecef2geodetic_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ecef2geodetic_single, __pyx_t_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ecef2geodetic_single, __pyx_t_2) < 0) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "common/transformations/transformations.pyx":141 + /* "common/transformations/transformations.pyx":140 * return self.ned2ecef_matrix * * @classmethod # <<<<<<<<<<<<<< * def from_geodetic(cls, geodetic): * return cls(geodetic=geodetic) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_10LocalCoord_3from_geodetic, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LocalCoord_from_geodetic, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_10LocalCoord_3from_geodetic, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LocalCoord_from_geodetic, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_geodetic, __pyx_t_2) < 0) __PYX_ERR(0, 141, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_geodetic, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6common_15transformations_15transformations_LocalCoord); - __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_geodetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_geodetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_geodetic, __pyx_t_3) < 0) __PYX_ERR(0, 141, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_geodetic, __pyx_t_3) < 0) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_6common_15transformations_15transformations_LocalCoord); - /* "common/transformations/transformations.pyx":145 + /* "common/transformations/transformations.pyx":144 * return cls(geodetic=geodetic) * * @classmethod # <<<<<<<<<<<<<< * def from_ecef(cls, ecef): * return cls(ecef=ecef) */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_10LocalCoord_5from_ecef, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LocalCoord_from_ecef, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_10LocalCoord_5from_ecef, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LocalCoord_from_ecef, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_ecef, __pyx_t_3) < 0) __PYX_ERR(0, 145, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_ecef, __pyx_t_3) < 0) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_6common_15transformations_15transformations_LocalCoord); - __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_ecef); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) + __Pyx_GetNameInClass(__pyx_t_3, (PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_ecef); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_ecef, __pyx_t_2) < 0) __PYX_ERR(0, 145, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_from_ecef, __pyx_t_2) < 0) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6common_15transformations_15transformations_LocalCoord); - /* "common/transformations/transformations.pyx":149 + /* "common/transformations/transformations.pyx":148 * return cls(ecef=ecef) * * def ecef2ned_single(self, ecef): # <<<<<<<<<<<<<< * assert self.lc * cdef ECEF e = list2ecef(ecef) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_10LocalCoord_7ecef2ned_single, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LocalCoord_ecef2ned_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_10LocalCoord_7ecef2ned_single, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LocalCoord_ecef2ned_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_ecef2ned_single, __pyx_t_2) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_ecef2ned_single, __pyx_t_2) < 0) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6common_15transformations_15transformations_LocalCoord); - /* "common/transformations/transformations.pyx":155 + /* "common/transformations/transformations.pyx":154 * return [n.n, n.e, n.d] * * def ned2ecef_single(self, ned): # <<<<<<<<<<<<<< * assert self.lc * cdef NED n = list2ned(ned) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_10LocalCoord_9ned2ecef_single, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LocalCoord_ned2ecef_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_10LocalCoord_9ned2ecef_single, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LocalCoord_ned2ecef_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_ned2ecef_single, __pyx_t_2) < 0) __PYX_ERR(0, 155, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_ned2ecef_single, __pyx_t_2) < 0) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6common_15transformations_15transformations_LocalCoord); - /* "common/transformations/transformations.pyx":161 + /* "common/transformations/transformations.pyx":160 * return [e.x, e.y, e.z] * * def geodetic2ned_single(self, geodetic): # <<<<<<<<<<<<<< * assert self.lc * cdef Geodetic g = list2geodetic(geodetic) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_10LocalCoord_11geodetic2ned_single, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LocalCoord_geodetic2ned_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_10LocalCoord_11geodetic2ned_single, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LocalCoord_geodetic2ned_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_geodetic2ned_single, __pyx_t_2) < 0) __PYX_ERR(0, 161, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_geodetic2ned_single, __pyx_t_2) < 0) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6common_15transformations_15transformations_LocalCoord); - /* "common/transformations/transformations.pyx":167 + /* "common/transformations/transformations.pyx":166 * return [n.n, n.e, n.d] * * def ned2geodetic_single(self, ned): # <<<<<<<<<<<<<< * assert self.lc * cdef NED n = list2ned(ned) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_10LocalCoord_13ned2geodetic_single, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LocalCoord_ned2geodetic_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6common_15transformations_15transformations_10LocalCoord_13ned2geodetic_single, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_LocalCoord_ned2geodetic_single, NULL, __pyx_n_s_common_transformations_transform_2, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_ned2geodetic_single, __pyx_t_2) < 0) __PYX_ERR(0, 167, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_6common_15transformations_15transformations_LocalCoord, __pyx_n_s_ned2geodetic_single, __pyx_t_2) < 0) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; PyType_Modified(__pyx_ptype_6common_15transformations_15transformations_LocalCoord); @@ -12351,7 +12346,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } } #else - if (is_list || PySequence_Check(o)) { + if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif @@ -12557,14 +12552,14 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error + if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } - return NULL; // not found (no exception set) + return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 -static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); @@ -12648,7 +12643,7 @@ bad: if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); // transfer ownership of value to values + Py_INCREF(value); Py_DECREF(key); #endif key = NULL; @@ -12667,7 +12662,7 @@ bad: && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -12699,7 +12694,7 @@ bad: if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -13100,38 +13095,38 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif return -1; } -#if !CYTHON_USE_TYPE_SLOTS - if (dictoffset == 0) { - PyErr_Format(PyExc_TypeError, - "extension type '%s.200s': " - "unable to validate whether bases have a __dict__ " - "when CYTHON_USE_TYPE_SLOTS is off " - "(likely because you are building in the limited API). " - "Therefore, all extension types with multiple bases " - "must add 'cdef dict __dict__' in this compilation mode", - type_name); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } -#else - if (dictoffset == 0 && b->tp_dictoffset) + if (dictoffset == 0) { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); - PyErr_Format(PyExc_TypeError, - "extension type '%.200s' has no __dict__ slot, " - "but base type '" __Pyx_FMT_TYPENAME "' has: " - "either add 'cdef dict __dict__' to the extension type " - "or add '__slots__ = [...]' to the base type", - type_name, b_name); - __Pyx_DECREF_TypeName(b_name); + Py_ssize_t b_dictoffset = 0; +#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + b_dictoffset = b->tp_dictoffset; +#else + PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); + if (!py_b_dictoffset) goto dictoffset_return; + b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); + Py_DECREF(py_b_dictoffset); + if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; +#endif + if (b_dictoffset) { + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + } +#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) + dictoffset_return: +#endif #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); + Py_DECREF(b0); #endif - return -1; + return -1; + } } -#endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif @@ -13386,10 +13381,10 @@ __PYX_GOOD: #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType_3_0_5 -#define __PYX_HAVE_RT_ImportType_3_0_5 -static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_5 check_size) + #ifndef __PYX_HAVE_RT_ImportType_3_0_8 +#define __PYX_HAVE_RT_ImportType_3_0_8 +static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; @@ -13443,7 +13438,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject *module, const char *module module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_5 && + if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " @@ -13451,7 +13446,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject *module, const char *module module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_5 && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -15160,7 +15155,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); diff --git a/common/transformations/transformations.pxd b/common/transformations/transformations.pxd index 7af009870..964adf06e 100644 --- a/common/transformations/transformations.pxd +++ b/common/transformations/transformations.pxd @@ -1,4 +1,4 @@ -#cython: language_level=3 +# cython: language_level=3 from libcpp cimport bool cdef extern from "orientation.cc": diff --git a/common/transformations/transformations.pyx b/common/transformations/transformations.pyx index c5cb9e005..ae045c369 100644 --- a/common/transformations/transformations.pyx +++ b/common/transformations/transformations.pyx @@ -17,7 +17,6 @@ from openpilot.common.transformations.transformations cimport ecef2geodetic as e from openpilot.common.transformations.transformations cimport LocalCoord_c -import cython import numpy as np cimport numpy as np @@ -34,14 +33,14 @@ cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m): return Matrix3(m.data) cdef ECEF list2ecef(ecef): - cdef ECEF e; + cdef ECEF e e.x = ecef[0] e.y = ecef[1] e.z = ecef[2] return e cdef NED list2ned(ned): - cdef NED n; + cdef NED n n.n = ned[0] n.e = ned[1] n.d = ned[2] @@ -61,7 +60,7 @@ def euler2quat_single(euler): def quat2euler_single(quat): cdef Quaternion q = Quaternion(quat[0], quat[1], quat[2], quat[3]) - cdef Vector3 e = quat2euler_c(q); + cdef Vector3 e = quat2euler_c(q) return [e(0), e(1), e(2)] def quat2rot_single(quat): diff --git a/common/transformations/transformations.so b/common/transformations/transformations.so index 7cfda48b7..a8b4e39f7 100755 Binary files a/common/transformations/transformations.so and b/common/transformations/transformations.so differ diff --git a/common/utils.py b/common/utils.py new file mode 100644 index 000000000..b9de020ee --- /dev/null +++ b/common/utils.py @@ -0,0 +1,11 @@ +class Freezable: + _frozen: bool = False + + def freeze(self): + if not self._frozen: + self._frozen = True + + def __setattr__(self, *args, **kwargs): + if self._frozen: + raise Exception("cannot modify frozen object") + super().__setattr__(*args, **kwargs) diff --git a/common/version.h b/common/version.h index 49fb7eeab..fe31df527 100644 --- a/common/version.h +++ b/common/version.h @@ -1 +1 @@ -#define COMMA_VERSION "2024.02.13" +#define COMMA_VERSION "2024.03.12" diff --git a/d3 b/d3 new file mode 100644 index 000000000..e69de29bb diff --git a/docs/CARS.md b/docs/CARS.md index 736aaaec1..f601da2be 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -4,7 +4,7 @@ A supported vehicle is one that just works when you install a comma device. All supported cars provide a better experience than any stock system. Supported vehicles reference the US market unless otherwise specified. -# 277 Supported Cars +# 288 Supported Cars |Make|Model|Supported Package|ACC|No ACC accel below|No ALC below|Steering Torque|Resume from stop|Hardware Needed
 |Video| |---|---|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:| @@ -23,6 +23,7 @@ A supported vehicle is one that just works when you install a comma device. All |Cadillac|Escalade ESV 2019[4](#footnotes)|Adaptive Cruise Control (ACC) & LKAS|openpilot|0 mph|7 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 OBD-II connector
- 1 comma 3X
- 2 long OBD-C cable
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Chevrolet|Bolt EUV 2022-23|Premier or Premier Redline Trim without Super Cruise Package|openpilot available[1](#footnotes)|3 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 GM connector
- 1 comma 3X
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Chevrolet|Bolt EV 2022-23|2LT Trim with Adaptive Cruise Control Package|openpilot available[1](#footnotes)|3 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 GM connector
- 1 comma 3X
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Chevrolet|Equinox 2019-22|Adaptive Cruise Control (ACC)|openpilot available[1](#footnotes)|3 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 GM connector
- 1 comma 3X
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Chevrolet|Silverado 1500 2020-21|Safety Package II|openpilot available[1](#footnotes)|0 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 GM connector
- 1 comma 3X
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Chevrolet|Trailblazer 2021-22|Adaptive Cruise Control (ACC)|openpilot available[1](#footnotes)|3 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 GM connector
- 1 comma 3X
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Chevrolet|Volt 2017-18[4](#footnotes)|Adaptive Cruise Control (ACC)|openpilot|0 mph|7 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 OBD-II connector
- 1 comma 3X
- 2 long OBD-C cable
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| @@ -33,13 +34,22 @@ A supported vehicle is one that just works when you install a comma device. All |Chrysler|Pacifica Hybrid 2018|Adaptive Cruise Control (ACC)|Stock|0 mph|9 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 FCA connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Chrysler|Pacifica Hybrid 2019-23|Adaptive Cruise Control (ACC)|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 FCA connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |comma|body|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|None|| +|Dodge|Durango 2020-21|Adaptive Cruise Control (ACC)|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 FCA connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Ford|Bronco Sport 2021-22|Co-Pilot360 Assist+|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 angled mount (8 degrees)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Ford|Escape 2020-22|Co-Pilot360 Assist+|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Ford|Escape Hybrid 2020-22|Co-Pilot360 Assist+|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Ford|Escape Plug-in Hybrid 2020-22|Co-Pilot360 Assist+|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Ford|Explorer 2020-23|Co-Pilot360 Assist+|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Ford|Explorer Hybrid 2020-23|Co-Pilot360 Assist+|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Ford|Focus 2018[3](#footnotes)|Adaptive Cruise Control with Lane Centering|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Ford|Focus Hybrid 2018[3](#footnotes)|Adaptive Cruise Control with Lane Centering|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Ford|Kuga 2020-22|Adaptive Cruise Control with Lane Centering|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Ford|Kuga Hybrid 2020-22|Adaptive Cruise Control with Lane Centering|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Ford|Kuga Plug-in Hybrid 2020-22|Adaptive Cruise Control with Lane Centering|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Ford|Maverick 2022|LARIAT Luxury|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 angled mount (8 degrees)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Ford|Maverick 2023|Co-Pilot360 Assist|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 angled mount (8 degrees)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Ford|Maverick Hybrid 2022|LARIAT Luxury|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 angled mount (8 degrees)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Ford|Maverick Hybrid 2023|Co-Pilot360 Assist|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 angled mount (8 degrees)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Genesis|G70 2018-19|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Hyundai F connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Genesis|G70 2020|All|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Hyundai F connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Genesis|G80 2017|All|Stock|19 mph|37 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Hyundai J connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| @@ -175,7 +185,8 @@ A supported vehicle is one that just works when you install a comma device. All |Lexus|RX Hybrid 2017-19|All|openpilot available[2](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Lexus|RX Hybrid 2020-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Lexus|UX Hybrid 2019-23|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| -|Lincoln|Aviator 2020-21|Co-Pilot360 Plus|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Lincoln|Aviator 2020-23|Co-Pilot360 Plus|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Lincoln|Aviator Plug-in Hybrid 2020-23|Co-Pilot360 Plus|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Ford Q3 connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |MAN|eTGE 2020-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[1,13](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 J533 connector
- 1 USB-C coupler
- 1 angled mount (8 degrees)
- 1 comma 3X
- 1 harness box
- 1 long OBD-C cable
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |MAN|TGE 2017-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[1,13](#footnotes)|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 J533 connector
- 1 USB-C coupler
- 1 angled mount (8 degrees)
- 1 comma 3X
- 1 harness box
- 1 long OBD-C cable
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Mazda|CX-5 2022-24|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 Mazda connector
- 1 RJ45 cable (7 ft)
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| @@ -214,9 +225,9 @@ A supported vehicle is one that just works when you install a comma device. All |Toyota|Avalon Hybrid 2019-21|All|openpilot available[2](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Toyota|Avalon Hybrid 2022|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Toyota|C-HR 2017-20|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| -|Toyota|C-HR 2021|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Toyota|C-HR 2021|All|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Toyota|C-HR Hybrid 2017-20|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| -|Toyota|C-HR Hybrid 2021-22|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Toyota|C-HR Hybrid 2021-22|All|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Toyota|Camry 2018-20|All|Stock|0 mph[9](#footnotes)|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Toyota|Camry 2021-24|All|openpilot|0 mph[9](#footnotes)|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Toyota|Camry Hybrid 2018-20|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| @@ -242,13 +253,13 @@ A supported vehicle is one that just works when you install a comma device. All |Toyota|RAV4 2016|Toyota Safety Sense P|openpilot available[2](#footnotes)|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Toyota|RAV4 2017-18|All|openpilot available[2](#footnotes)|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Toyota|RAV4 2019-21|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| -|Toyota|RAV4 2022|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| -|Toyota|RAV4 2023-24|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Toyota|RAV4 2022|All|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Toyota|RAV4 2023-24|All|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Toyota|RAV4 Hybrid 2016|Toyota Safety Sense P|openpilot available[2](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Toyota|RAV4 Hybrid 2017-18|All|openpilot available[2](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Toyota|RAV4 Hybrid 2019-21|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| -|Toyota|RAV4 Hybrid 2022|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| -|Toyota|RAV4 Hybrid 2023-24|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Toyota|RAV4 Hybrid 2022|All|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| +|Toyota|RAV4 Hybrid 2023-24|All|openpilot available[1](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Toyota|Sienna 2018-20|All|openpilot available[2](#footnotes)|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 RJ45 cable (7 ft)
- 1 Toyota A connector
- 1 comma 3X
- 1 comma power v2
- 1 harness box
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Volkswagen|Arteon 2018-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[1,13](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 J533 connector
- 1 USB-C coupler
- 1 comma 3X
- 1 harness box
- 1 long OBD-C cable
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| |Volkswagen|Arteon eHybrid 2020-23|Adaptive Cruise Control (ACC) & Lane Assist|openpilot available[1,13](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|
Parts- 1 J533 connector
- 1 USB-C coupler
- 1 comma 3X
- 1 harness box
- 1 long OBD-C cable
- 1 mount
- 1 right angle OBD-C cable (1.5 ft)
Buy Here
|| @@ -341,6 +352,7 @@ openpilot does not yet support these Toyota models due to a new message authenti * Toyota Venza 2021+ * Toyota Sequoia 2023+ * Toyota Tundra 2022+ +* Toyota Highlander 2024+ * Toyota Corolla Cross 2022+ (only US model) * Lexus NX 2022+ * Toyota bZ4x 2023+ diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 30f4e0dfd..755ca8222 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -62,4 +62,4 @@ A good pull request has all of the following: * Consider opting into driver camera uploads to improve the driver monitoring model. * Connect your device to Wi-Fi regularly, so that we can pull data for training better driving models. * Run the `nightly` branch and report issues. This branch is like `master` but it's built just like a release. -* Annotate images in the [comma10k dateset](https://github.com/commaai/comma10k). +* Annotate images in the [comma10k dataset](https://github.com/commaai/comma10k). diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index a5b64a430..32060a9b2 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -21,6 +21,11 @@ function agnos_init { # set success flag for current boot slot sudo abctl --set_success + # TODO: do this without udev in AGNOS + # udev does this, but sometimes we startup faster + sudo chgrp gpu /dev/adsprpc-smd /dev/ion /dev/kgsl-3d0 + sudo chmod 660 /dev/adsprpc-smd /dev/ion /dev/kgsl-3d0 + # Check if AGNOS update is required if [ $(< /VERSION) != "$AGNOS_VERSION" ]; then AGNOS_PY="$DIR/system/hardware/tici/agnos.py" diff --git a/launch_env.sh b/launch_env.sh index fa8ddf0ba..3c499dd52 100755 --- a/launch_env.sh +++ b/launch_env.sh @@ -7,7 +7,7 @@ export OPENBLAS_NUM_THREADS=1 export VECLIB_MAXIMUM_THREADS=1 if [ -z "$AGNOS_VERSION" ]; then - export AGNOS_VERSION="9.6" + export AGNOS_VERSION="9.7" fi export STAGING_ROOT="/data/safe_staging" diff --git a/opendbc/can/libdbc.so b/opendbc/can/libdbc.so index 818d64f79..059b7a25d 100755 Binary files a/opendbc/can/libdbc.so and b/opendbc/can/libdbc.so differ diff --git a/opendbc/can/packer_pyx.cpp b/opendbc/can/packer_pyx.cpp index cb8623228..d4f257534 100644 --- a/opendbc/can/packer_pyx.cpp +++ b/opendbc/can/packer_pyx.cpp @@ -13,7 +13,7 @@ "language": "c++", "name": "opendbc.can.packer_pyx", "sources": [ - "/data/openpilot/opendbc/can/packer_pyx.pyx" + "/data/dp-private/opendbc/can/packer_pyx.pyx" ] }, "module_name": "opendbc.can.packer_pyx" diff --git a/opendbc/can/parser_pyx.cpp b/opendbc/can/parser_pyx.cpp index c29ee7f95..8c2c61eeb 100644 --- a/opendbc/can/parser_pyx.cpp +++ b/opendbc/can/parser_pyx.cpp @@ -13,7 +13,7 @@ "language": "c++", "name": "opendbc.can.parser_pyx", "sources": [ - "/data/openpilot/opendbc/can/parser_pyx.pyx" + "/data/dp-private/opendbc/can/parser_pyx.pyx" ] }, "module_name": "opendbc.can.parser_pyx" diff --git a/opendbc/can/parser_pyx.so b/opendbc/can/parser_pyx.so index f656e097b..f843797bd 100755 Binary files a/opendbc/can/parser_pyx.so and b/opendbc/can/parser_pyx.so differ diff --git a/opendbc/ford_lincoln_base_pt.dbc b/opendbc/ford_lincoln_base_pt.dbc index ebe7a4321..acd45e796 100644 --- a/opendbc/ford_lincoln_base_pt.dbc +++ b/opendbc/ford_lincoln_base_pt.dbc @@ -3608,6 +3608,9 @@ BO_ 922 DCACA_Data1_FD1: 8 GWM SG_ DcacClntFlw_D_Rq : 5|2@0+ (1,0) [0|3] "SED" SOBDMC_HPCM_FD1 SG_ CoolFanDcac_D_Rq : 7|2@0+ (1,0) [0|3] "SED" SOBDMC_HPCM_FD1 +BO_ 1082 INSTRUMENT_PANEL: 8 GWM + SG_ METRIC_UNITS : 54|1@0+ (1,0) [0|1] "SED" IPMA,PCM,PCM_HEV + BO_TX_BU_ 2612224016 : ECM_Diesel,PCM,PCM_HEV; BO_TX_BU_ 878 : PCM,PCM_HEV; BO_TX_BU_ 1085 : ECM_Diesel,PCM; diff --git a/opendbc/gm_global_a_powertrain_generated.dbc b/opendbc/gm_global_a_powertrain_generated.dbc index 37ad918cb..5d03286d1 100644 --- a/opendbc/gm_global_a_powertrain_generated.dbc +++ b/opendbc/gm_global_a_powertrain_generated.dbc @@ -188,6 +188,9 @@ BO_ 497 BCMGeneralPlatformStatus: 8 K9_BCM SG_ SystemBackUpPowerMode : 5|2@0+ (1,0) [0|3] "" XXX SG_ ParkBrakeSwActive : 36|1@0+ (1,0) [0|3] "" XXX +BO_ 500 SportMode: 6 XXX + SG_ SportMode : 15|1@0+ (1,0) [0|1] "" XXX + BO_ 501 ECMPRDNL2: 8 K20_ECM SG_ TransmissionState : 48|4@1+ (1,0) [0|7] "" NEO SG_ PRNDL2 : 27|4@0+ (1,0) [0|255] "" NEO diff --git a/opendbc/hyundai_canfd.dbc b/opendbc/hyundai_canfd.dbc index 8d2759452..1ef67c044 100644 --- a/opendbc/hyundai_canfd.dbc +++ b/opendbc/hyundai_canfd.dbc @@ -263,7 +263,7 @@ BO_ 416 SCC_CONTROL: 32 ADRV SG_ aReqValue : 128|11@1+ (0.01,-10.23) [-10.23|10.24] "m/s^2" XXX SG_ ZEROS_7 : 63|8@0+ (1,0) [0|255] "" XXX SG_ ACCMode : 68|3@1+ (1,0) [0|7] "" XXX - SG_ NEW_SIGNAL_12 : 35|9@1+ (0.1,0) [0|255] "" XXX + SG_ ACC_ObjRelSpd : 35|9@1+ (0.1,-16.4) [-16.4|34.7] "m/s" XXX SG_ JerkLowerLimit : 166|7@0+ (0.1,0) [0|12.7] "m/s^3" XXX SG_ StopReq : 184|1@0+ (1,0) [0|1] "" XXX SG_ NEW_SIGNAL_15 : 192|11@1+ (0.1,0) [0|204.7] "m" XXX diff --git a/opendbc/tesla_can.dbc b/opendbc/tesla_can.dbc index db8d67e0b..56624c3e5 100644 --- a/opendbc/tesla_can.dbc +++ b/opendbc/tesla_can.dbc @@ -131,6 +131,19 @@ BO_ 880 EPAS_sysStatus: 8 EPAS SG_ EPAS_sysStatusCounter : 51|4@0+ (1,0) [0|15] "" NEO SG_ EPAS_torsionBarTorque : 19|12@0+ (0.01,-20.5) [0|0] "Nm" NEO +BO_ 305 EPAS3P_sysStatus: 8 NEO + SG_ EPAS_currentTuneMode : 7|4@0+ (1,0) [0|0] "" NEO + SG_ EPAS_eacErrorCode : 23|4@0+ (1,0) [0|15] "" NEO + SG_ EPAS_eacStatus : 55|3@0+ (1,0) [0|7] "" NEO + SG_ EPAS_handsOnLevel : 39|2@0+ (1,0) [0|3] "" NEO + SG_ EPAS_internalSAS : 37|14@0+ (0.1,-819.2) [-819.2|819] "deg" NEO + SG_ EPAS_steeringFault : 2|1@0+ (1,0) [0|1] "" NEO + SG_ EPAS_steeringRackForce : 1|10@0+ (50,-25575) [-25575|25575] "N" NEO + SG_ EPAS_steeringReduced : 3|1@0+ (1,0) [0|1] "" NEO + SG_ EPAS_sysStatusChecksum : 63|8@0+ (1,0) [0|255] "" NEO + SG_ EPAS_sysStatusCounter : 51|4@0+ (1,0) [0|15] "" NEO + SG_ EPAS_torsionBarTorque : 19|12@0+ (0.01,-20.5) [-20.5|20.45] "Nm" NEO + BO_ 3 STW_ANGL_STAT: 8 STW SG_ StW_Angl : 5|14@0+ (0.5,-2048) [0|0] "deg" NEO SG_ StW_AnglSpd : 21|14@0+ (0.5,-2048) [0|0] "/s" NEO @@ -708,6 +721,10 @@ BO_ 1001 DAS_bodyControls: 8 XXX SG_ DAS_bodyControlsCounter : 52|4@1+ (1,0) [0|15] "" XXX SG_ DAS_bodyControlsChecksum : 56|8@1+ (1,0) [0|255] "" XXX +BO_ 780 DriverSeat: 8 XXX + SG_ occupancyStatus : 16|3@1+ (1,0) [0|7] "" XXX + SG_ buckleStatus : 19|2@1+ (1,0) [0|3] "" XXX + VAL_ 3 StW_Angl 16383 "SNA" ; VAL_ 3 StW_AnglSens_Id 2 "MUST" 0 "PSBL" 1 "SELF" ; VAL_ 3 StW_AnglSens_Stat 2 "ERR" 3 "ERR_INI" 1 "INI" 0 "OK" ; @@ -802,6 +819,8 @@ 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_ 780 occupancyStatus 1 "OCCUPIED" 0 "UNOCCUPIED" ; +VAL_ 780 buckleStatus 1 "LATCHED" 0 "UNLATCHED" ; 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" ; diff --git a/opendbc/toyota_new_mc_pt_generated.dbc b/opendbc/toyota_new_mc_pt_generated.dbc index e5c0fbbbb..b6810fb4b 100644 --- a/opendbc/toyota_new_mc_pt_generated.dbc +++ b/opendbc/toyota_new_mc_pt_generated.dbc @@ -38,12 +38,6 @@ CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor th BO_ 767 SDSU: 8 XXX SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX -BO_ 1880 DEBUG: 8 XXX - SG_ BLINDSPOTSIDE : 7|8@0+ (1,0) [0|255] "" XXX - SG_ BLINDSPOT : 38|1@0+ (1,0) [0|15] "" XXX - SG_ BLINDSPOTD1 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ BLINDSPOTD2 : 55|8@0+ (1,0) [0|255] "" 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"; @@ -208,15 +202,13 @@ BO_ 835 ACC_CONTROL: 8 DSU SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU SG_ ACC_CUT_IN : 25|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_VEHICLE_STOPPED : 29|1@0+ (1,0) [0|0] "" DSU SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU SG_ ITS_CONNECT_LEAD : 39|8@0+ (1,0) [0|1] "" Vector__XXX SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX -BO_ 836 PRE_COLLISION_2: 8 DSU - SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX - BO_ 865 CLUTCH: 8 XXX SG_ ACC_FAULTED : 32|1@0+ (1,0) [0|1] "" XXX SG_ GAS_PEDAL_ALT : 23|8@0+ (0.005,0) [0|1] "" XXX @@ -457,6 +449,7 @@ CM_ SG_ 835 ACC_MALFUNCTION "display ACC fault on dash if set to 1"; CM_ SG_ 835 ACC_CUT_IN "Display blinking yellow lead if set to 1"; CM_ SG_ 835 DISTANCE "Cycle through ACC following distance from long, mid, short when set to 1"; CM_ SG_ 835 ITS_CONNECT_LEAD "Displayed when lead car is capable of ITS Connect"; +CM_ SG_ 835 LEAD_VEHICLE_STOPPED "Set to 1 when lead is stopped, likely only used in older TSS-P vehicles"; CM_ SG_ 835 ALLOW_LONG_PRESS "Enable Toyota's factory set speed increment behaviour, available on both metrics cars and imperial unit cars"; CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG."; 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."; @@ -564,6 +557,36 @@ VAL_ 1553 UNITS 1 "km" 2 "miles"; VAL_ 1556 TURN_SIGNALS 3 "none" 2 "right" 1 "left"; VAL_ 1592 LOCK_STATUS 0 "locked" 1 "unlocked"; + +CM_ "Imported file _dp_debug_toyota.dbc starts here"; +BO_ 1880 DEBUG: 8 XXX + SG_ BLINDSPOTSIDE : 7|8@0+ (1,0) [0|255] "" XXX + SG_ BLINDSPOT : 38|1@0+ (1,0) [0|15] "" XXX + SG_ BLINDSPOTD1 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ BLINDSPOTD2 : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 836 PRE_COLLISION_2: 8 DSU + SG_ DSS1GDRV : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX + SG_ DS1STAT2 : 13|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ DS1STBK2 : 10|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSWAR : 18|1@0+ (1,0) [0|0] "" FCM + SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM + SG_ PCSOPR : 16|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSABK : 31|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PPTRGR : 28|1@0+ (1,0) [0|0] "" FCM + SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM + SG_ CLEXTRGR : 26|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ IRLT_REQ : 25|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ BRKHLD : 37|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS + SG_ VGRSTRGR : 35|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBRTRGR : 32|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSDIS : 43|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBPREPMP : 40|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX + CM_ "toyota_new_mc_pt.dbc starts here"; BO_ 548 BRAKE_MODULE: 8 XXX diff --git a/opendbc/toyota_nodsu_pt_generated.dbc b/opendbc/toyota_nodsu_pt_generated.dbc index 5f2d0c66d..cb73a654c 100644 --- a/opendbc/toyota_nodsu_pt_generated.dbc +++ b/opendbc/toyota_nodsu_pt_generated.dbc @@ -38,12 +38,6 @@ CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor th BO_ 767 SDSU: 8 XXX SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX -BO_ 1880 DEBUG: 8 XXX - SG_ BLINDSPOTSIDE : 7|8@0+ (1,0) [0|255] "" XXX - SG_ BLINDSPOT : 38|1@0+ (1,0) [0|15] "" XXX - SG_ BLINDSPOTD1 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ BLINDSPOTD2 : 55|8@0+ (1,0) [0|255] "" 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"; @@ -208,15 +202,13 @@ BO_ 835 ACC_CONTROL: 8 DSU SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU SG_ ACC_CUT_IN : 25|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_VEHICLE_STOPPED : 29|1@0+ (1,0) [0|0] "" DSU SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU SG_ ITS_CONNECT_LEAD : 39|8@0+ (1,0) [0|1] "" Vector__XXX SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX -BO_ 836 PRE_COLLISION_2: 8 DSU - SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX - BO_ 865 CLUTCH: 8 XXX SG_ ACC_FAULTED : 32|1@0+ (1,0) [0|1] "" XXX SG_ GAS_PEDAL_ALT : 23|8@0+ (0.005,0) [0|1] "" XXX @@ -457,6 +449,7 @@ CM_ SG_ 835 ACC_MALFUNCTION "display ACC fault on dash if set to 1"; CM_ SG_ 835 ACC_CUT_IN "Display blinking yellow lead if set to 1"; CM_ SG_ 835 DISTANCE "Cycle through ACC following distance from long, mid, short when set to 1"; CM_ SG_ 835 ITS_CONNECT_LEAD "Displayed when lead car is capable of ITS Connect"; +CM_ SG_ 835 LEAD_VEHICLE_STOPPED "Set to 1 when lead is stopped, likely only used in older TSS-P vehicles"; CM_ SG_ 835 ALLOW_LONG_PRESS "Enable Toyota's factory set speed increment behaviour, available on both metrics cars and imperial unit cars"; CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG."; 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."; @@ -564,6 +557,36 @@ VAL_ 1553 UNITS 1 "km" 2 "miles"; VAL_ 1556 TURN_SIGNALS 3 "none" 2 "right" 1 "left"; VAL_ 1592 LOCK_STATUS 0 "locked" 1 "unlocked"; + +CM_ "Imported file _dp_debug_toyota.dbc starts here"; +BO_ 1880 DEBUG: 8 XXX + SG_ BLINDSPOTSIDE : 7|8@0+ (1,0) [0|255] "" XXX + SG_ BLINDSPOT : 38|1@0+ (1,0) [0|15] "" XXX + SG_ BLINDSPOTD1 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ BLINDSPOTD2 : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 836 PRE_COLLISION_2: 8 DSU + SG_ DSS1GDRV : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX + SG_ DS1STAT2 : 13|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ DS1STBK2 : 10|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSWAR : 18|1@0+ (1,0) [0|0] "" FCM + SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM + SG_ PCSOPR : 16|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSABK : 31|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PPTRGR : 28|1@0+ (1,0) [0|0] "" FCM + SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM + SG_ CLEXTRGR : 26|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ IRLT_REQ : 25|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ BRKHLD : 37|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS + SG_ VGRSTRGR : 35|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBRTRGR : 32|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSDIS : 43|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBPREPMP : 40|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX + CM_ "toyota_nodsu_pt.dbc starts here"; BO_ 401 STEERING_LTA: 8 XXX diff --git a/opendbc/toyota_tnga_k_pt_generated.dbc b/opendbc/toyota_tnga_k_pt_generated.dbc index 4db6983af..72cf11068 100644 --- a/opendbc/toyota_tnga_k_pt_generated.dbc +++ b/opendbc/toyota_tnga_k_pt_generated.dbc @@ -38,12 +38,6 @@ CM_ "BO_ SECONDARY_STEER_ANGLE: ZSS is a high-precision steering angle sensor th BO_ 767 SDSU: 8 XXX SG_ FD_BUTTON : 7|1@0+ (1,0) [0|1] "" XXX -BO_ 1880 DEBUG: 8 XXX - SG_ BLINDSPOTSIDE : 7|8@0+ (1,0) [0|255] "" XXX - SG_ BLINDSPOT : 38|1@0+ (1,0) [0|15] "" XXX - SG_ BLINDSPOTD1 : 47|8@0+ (1,0) [0|255] "" XXX - SG_ BLINDSPOTD2 : 55|8@0+ (1,0) [0|255] "" 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"; @@ -208,15 +202,13 @@ BO_ 835 ACC_CONTROL: 8 DSU SG_ ACC_TYPE : 23|2@0+ (1,0) [0|3] "" HCU SG_ CANCEL_REQ : 24|1@0+ (1,0) [0|1] "" HCU SG_ ACC_CUT_IN : 25|1@0+ (1,0) [0|1] "" XXX + SG_ LEAD_VEHICLE_STOPPED : 29|1@0+ (1,0) [0|0] "" DSU SG_ PERMIT_BRAKING : 30|1@0+ (1,0) [0|1] "" HCU SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU SG_ ITS_CONNECT_LEAD : 39|8@0+ (1,0) [0|1] "" Vector__XXX SG_ ACCEL_CMD_ALT : 47|8@0- (0.05,0) [0|0] "m/s^2" XXX SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX -BO_ 836 PRE_COLLISION_2: 8 DSU - SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX - BO_ 865 CLUTCH: 8 XXX SG_ ACC_FAULTED : 32|1@0+ (1,0) [0|1] "" XXX SG_ GAS_PEDAL_ALT : 23|8@0+ (0.005,0) [0|1] "" XXX @@ -457,6 +449,7 @@ CM_ SG_ 835 ACC_MALFUNCTION "display ACC fault on dash if set to 1"; CM_ SG_ 835 ACC_CUT_IN "Display blinking yellow lead if set to 1"; CM_ SG_ 835 DISTANCE "Cycle through ACC following distance from long, mid, short when set to 1"; CM_ SG_ 835 ITS_CONNECT_LEAD "Displayed when lead car is capable of ITS Connect"; +CM_ SG_ 835 LEAD_VEHICLE_STOPPED "Set to 1 when lead is stopped, likely only used in older TSS-P vehicles"; CM_ SG_ 835 ALLOW_LONG_PRESS "Enable Toyota's factory set speed increment behaviour, available on both metrics cars and imperial unit cars"; CM_ SG_ 835 PERMIT_BRAKING "Original ACC has this going high when a car in front is detected. In openpilot and before the PERMIT_BRAKING name, this was 'SET_ME_1' and is hardcoded to be high. Unsure if only informational or has an effect though existing usage in openpilot is to always set it to 1. Originally 'PMTBRKG' in the leaked toyota_2017_ref_pt.dbc file and name expansion speculated to be PerMiT BRaKinG."; 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."; @@ -564,6 +557,36 @@ VAL_ 1553 UNITS 1 "km" 2 "miles"; VAL_ 1556 TURN_SIGNALS 3 "none" 2 "right" 1 "left"; VAL_ 1592 LOCK_STATUS 0 "locked" 1 "unlocked"; + +CM_ "Imported file _dp_debug_toyota.dbc starts here"; +BO_ 1880 DEBUG: 8 XXX + SG_ BLINDSPOTSIDE : 7|8@0+ (1,0) [0|255] "" XXX + SG_ BLINDSPOT : 38|1@0+ (1,0) [0|15] "" XXX + SG_ BLINDSPOTD1 : 47|8@0+ (1,0) [0|255] "" XXX + SG_ BLINDSPOTD2 : 55|8@0+ (1,0) [0|255] "" XXX + +BO_ 836 PRE_COLLISION_2: 8 DSU + SG_ DSS1GDRV : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX + SG_ DS1STAT2 : 13|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ DS1STBK2 : 10|3@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSWAR : 18|1@0+ (1,0) [0|0] "" FCM + SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM + SG_ PCSOPR : 16|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSABK : 31|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PPTRGR : 28|1@0+ (1,0) [0|0] "" FCM + SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM + SG_ CLEXTRGR : 26|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ IRLT_REQ : 25|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ BRKHLD : 37|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS + SG_ VGRSTRGR : 35|2@0+ (1,0) [0|0] "" Vector__XXX + SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBRTRGR : 32|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PCSDIS : 43|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ PBPREPMP : 40|1@0+ (1,0) [0|0] "" Vector__XXX + SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX + CM_ "toyota_tnga_k_pt.dbc starts here"; BO_ 550 BRAKE_MODULE: 8 XXX diff --git a/opendbc/vw_golf_mk4.dbc b/opendbc/vw_golf_mk4.dbc index 131a4b763..6f1478913 100644 --- a/opendbc/vw_golf_mk4.dbc +++ b/opendbc/vw_golf_mk4.dbc @@ -1518,8 +1518,15 @@ CM_ SG_ 912 BSK_HD_Hauptraste "Status of trunk lid main detent"; CM_ SG_ 1088 Zaehler_Getriebe_1 "Counter Getriebe_1"; CM_ SG_ 1088 Waehlhebelposition__Getriebe_1_ "Gear Selector Position"; CM_ SG_ 1088 inneres_Soll_Motormoment "Desired Inner Torque"; +CM_ SG_ 1088 Gang_eingelegt "Gear Engaged"; CM_ SG_ 1088 Schaltabsicht "Shift Intent"; +CM_ SG_ 1088 Kuehlleistung "Cooling Power"; CM_ SG_ 1088 Wandlerverlustmoment "Converter Torque Loss"; +CM_ SG_ 1088 Getriebe_Notlauf "Transmission_Notlauf"; +CM_ SG_ 1088 Zielgang_oder_eingelegter_Gang "target_gear_or_gear_in_engagement"; +CM_ SG_ 1088 Uebertragungsfunktion "transfer function"; +CM_ SG_ 1088 EGS_Anforderung "EGS Requirement"; +CM_ SG_ 1088 Schaltung_aktiv__Getriebe_1_ "Shift Activity"; CM_ SG_ 1056 Fehlerstatus_Aussentemp__4_1 "ambient temp error"; CM_ SG_ 1056 Fehlerstatus_Oeltemperatur_4_1 "oil temp error"; diff --git a/openpilot/__init__.py b/openpilot/__init__.py index b28b04f64..e69de29bb 100644 --- a/openpilot/__init__.py +++ b/openpilot/__init__.py @@ -1,3 +0,0 @@ - - - diff --git a/panda/board/jungle/__init__.py b/panda/board/jungle/__init__.py index 77a6e3c7c..a95ddfa92 100644 --- a/panda/board/jungle/__init__.py +++ b/panda/board/jungle/__init__.py @@ -2,7 +2,6 @@ import os import struct from functools import wraps -from typing import Optional from panda import Panda, PandaDFU from panda.python.constants import McuType @@ -57,7 +56,7 @@ class PandaJungle(Panda): fn = os.path.join(FW_PATH, self._mcu_type.config.app_fn.replace("panda", "panda_jungle")) super().flash(fn=fn, code=code, reconnect=reconnect) - def recover(self, timeout: Optional[int] = 60, reset: bool = True) -> bool: + def recover(self, timeout: int | None = 60, reset: bool = True) -> bool: dfu_serial = self.get_dfu_serial() if reset: diff --git a/panda/board/jungle/obj/bootstub.panda_jungle.bin b/panda/board/jungle/obj/bootstub.panda_jungle.bin index 11017f692..53db704cc 100755 Binary files a/panda/board/jungle/obj/bootstub.panda_jungle.bin and b/panda/board/jungle/obj/bootstub.panda_jungle.bin differ diff --git a/panda/board/jungle/obj/bootstub.panda_jungle.elf b/panda/board/jungle/obj/bootstub.panda_jungle.elf index 87602bf72..1fe749325 100755 Binary files a/panda/board/jungle/obj/bootstub.panda_jungle.elf and b/panda/board/jungle/obj/bootstub.panda_jungle.elf differ diff --git a/panda/board/jungle/obj/bootstub.panda_jungle_h7.bin b/panda/board/jungle/obj/bootstub.panda_jungle_h7.bin index f132b6440..4b5567e11 100755 Binary files a/panda/board/jungle/obj/bootstub.panda_jungle_h7.bin and b/panda/board/jungle/obj/bootstub.panda_jungle_h7.bin differ diff --git a/panda/board/jungle/obj/bootstub.panda_jungle_h7.elf b/panda/board/jungle/obj/bootstub.panda_jungle_h7.elf index cd2d47878..e97d129b7 100755 Binary files a/panda/board/jungle/obj/bootstub.panda_jungle_h7.elf and b/panda/board/jungle/obj/bootstub.panda_jungle_h7.elf differ diff --git a/panda/board/jungle/obj/panda_jungle.bin b/panda/board/jungle/obj/panda_jungle.bin index e461eed5e..47febe3e8 100755 Binary files a/panda/board/jungle/obj/panda_jungle.bin and b/panda/board/jungle/obj/panda_jungle.bin differ diff --git a/panda/board/jungle/obj/panda_jungle.bin.signed b/panda/board/jungle/obj/panda_jungle.bin.signed index 7ae1a8513..053dc973d 100644 Binary files a/panda/board/jungle/obj/panda_jungle.bin.signed and b/panda/board/jungle/obj/panda_jungle.bin.signed differ diff --git a/panda/board/jungle/obj/panda_jungle.elf b/panda/board/jungle/obj/panda_jungle.elf index 5a93464e5..fb9e798f3 100755 Binary files a/panda/board/jungle/obj/panda_jungle.elf and b/panda/board/jungle/obj/panda_jungle.elf differ diff --git a/panda/board/jungle/obj/panda_jungle_h7.bin b/panda/board/jungle/obj/panda_jungle_h7.bin index b5879e024..1d9dd3e73 100755 Binary files a/panda/board/jungle/obj/panda_jungle_h7.bin and b/panda/board/jungle/obj/panda_jungle_h7.bin differ diff --git a/panda/board/jungle/obj/panda_jungle_h7.bin.signed b/panda/board/jungle/obj/panda_jungle_h7.bin.signed index 4aec2318a..3e0c41ad1 100644 Binary files a/panda/board/jungle/obj/panda_jungle_h7.bin.signed and b/panda/board/jungle/obj/panda_jungle_h7.bin.signed differ diff --git a/panda/board/jungle/obj/panda_jungle_h7.elf b/panda/board/jungle/obj/panda_jungle_h7.elf index ebb052026..9ff1acb9f 100755 Binary files a/panda/board/jungle/obj/panda_jungle_h7.elf and b/panda/board/jungle/obj/panda_jungle_h7.elf differ diff --git a/panda/board/jungle/scripts/get_version.py b/panda/board/jungle/scripts/get_version.py index ad4a1c426..4fc9d30be 100755 --- a/panda/board/jungle/scripts/get_version.py +++ b/panda/board/jungle/scripts/get_version.py @@ -4,6 +4,6 @@ from panda import PandaJungle if __name__ == "__main__": for p in PandaJungle.list(): pp = PandaJungle(p) - print("%s: %s" % (pp.get_serial()[0], pp.get_version())) + print(f"{pp.get_serial()[0]}: {pp.get_version()}") diff --git a/panda/board/obj/bootstub.panda.bin b/panda/board/obj/bootstub.panda.bin index f57bb9c3e..34b78453c 100755 Binary files a/panda/board/obj/bootstub.panda.bin and b/panda/board/obj/bootstub.panda.bin differ diff --git a/panda/board/obj/bootstub.panda.elf b/panda/board/obj/bootstub.panda.elf index 8a55b06b9..3dc160aa5 100755 Binary files a/panda/board/obj/bootstub.panda.elf and b/panda/board/obj/bootstub.panda.elf differ diff --git a/panda/board/obj/bootstub.panda_h7.bin b/panda/board/obj/bootstub.panda_h7.bin index 8cb10d775..6c29edbec 100755 Binary files a/panda/board/obj/bootstub.panda_h7.bin and b/panda/board/obj/bootstub.panda_h7.bin differ diff --git a/panda/board/obj/bootstub.panda_h7.elf b/panda/board/obj/bootstub.panda_h7.elf index a04f316de..a64ee8c35 100755 Binary files a/panda/board/obj/bootstub.panda_h7.elf and b/panda/board/obj/bootstub.panda_h7.elf differ diff --git a/panda/board/obj/gitversion.h b/panda/board/obj/gitversion.h index 11353dc97..c26a06359 100644 --- a/panda/board/obj/gitversion.h +++ b/panda/board/obj/gitversion.h @@ -1 +1 @@ -const uint8_t gitversion[] = "DEV-2ade7461-DEBUG"; +const uint8_t gitversion[] = "DEV-abf3d716-DEBUG"; diff --git a/panda/board/obj/panda.bin b/panda/board/obj/panda.bin index c12f79ae2..2f53f6efc 100755 Binary files a/panda/board/obj/panda.bin and b/panda/board/obj/panda.bin differ diff --git a/panda/board/obj/panda.bin.signed b/panda/board/obj/panda.bin.signed index 516932f2d..ad11517e7 100644 Binary files a/panda/board/obj/panda.bin.signed and b/panda/board/obj/panda.bin.signed differ diff --git a/panda/board/obj/panda.elf b/panda/board/obj/panda.elf index 527938baf..e4857996e 100755 Binary files a/panda/board/obj/panda.elf and b/panda/board/obj/panda.elf differ diff --git a/panda/board/obj/panda_h7.bin b/panda/board/obj/panda_h7.bin index ce92ea096..9611aa67d 100755 Binary files a/panda/board/obj/panda_h7.bin and b/panda/board/obj/panda_h7.bin differ diff --git a/panda/board/obj/panda_h7.bin.signed b/panda/board/obj/panda_h7.bin.signed index cd2752c3f..987d0605a 100644 Binary files a/panda/board/obj/panda_h7.bin.signed and b/panda/board/obj/panda_h7.bin.signed differ diff --git a/panda/board/obj/panda_h7.elf b/panda/board/obj/panda_h7.elf index 081b63167..baab3b0df 100755 Binary files a/panda/board/obj/panda_h7.elf and b/panda/board/obj/panda_h7.elf differ diff --git a/panda/board/obj/version b/panda/board/obj/version index eef05d215..e7493da6b 100644 --- a/panda/board/obj/version +++ b/panda/board/obj/version @@ -1 +1 @@ -DEV-2ade7461-DEBUG \ No newline at end of file +DEV-abf3d716-DEBUG \ No newline at end of file diff --git a/panda/board/pedal/.gitignore b/panda/board/pedal/.gitignore deleted file mode 100644 index 94053f292..000000000 --- a/panda/board/pedal/.gitignore +++ /dev/null @@ -1 +0,0 @@ -obj/* diff --git a/panda/board/pedal/README.md b/panda/board/pedal/README.md deleted file mode 100644 index 9e004d6bd..000000000 --- a/panda/board/pedal/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# pedal - -This is the firmware for the comma pedal. - -The comma pedal is a gas pedal interceptor for Honda/Acura and Toyota/Lexus. It allows you to "virtually" press the pedal and borrows a lot from panda. - -== Test Plan == - -* Startup -** Confirm STATE_FAULT_STARTUP -* Timeout -** Send value -** Confirm value is output -** Stop sending messages -** Confirm value is passthru after 100ms -** Confirm STATE_FAULT_TIMEOUT -* Random values -** Send random 6 byte messages -** Confirm random values cause passthru -** Confirm STATE_FAULT_BAD_CHECKSUM -* Same message lockout -** Send same message repeated -** Confirm timeout behavior -* Don't set enable -** Confirm no output -* Set enable and values -** Confirm output - diff --git a/panda/board/pedal/flash_can.sh b/panda/board/pedal/flash_can.sh deleted file mode 100755 index b9edf25f1..000000000 --- a/panda/board/pedal/flash_can.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env sh -set -e - -cd .. -scons -u -j$(nproc) -cd pedal - -../../tests/pedal/enter_canloader.py obj/pedal.bin.signed diff --git a/panda/board/pedal/main.c b/panda/board/pedal/main.c deleted file mode 100644 index 704ee5436..000000000 --- a/panda/board/pedal/main.c +++ /dev/null @@ -1,316 +0,0 @@ -// ********************* Includes ********************* -//#define PEDAL_USB -#include "../config.h" - -#include "early_init.h" -#include "crc.h" - -#define CAN CAN1 - -#ifdef PEDAL_USB - #include "drivers/usb.h" -#else - // no serial either - void print(const char *a) { - UNUSED(a); - } - void puth(unsigned int i) { - UNUSED(i); - } - void puth2(unsigned int i) { - UNUSED(i); - } -#endif - -#define ENTER_BOOTLOADER_MAGIC 0xdeadbeefU -uint32_t enter_bootloader_mode; - -// cppcheck-suppress unusedFunction ; used in headers not included in cppcheck -void __initialize_hardware_early(void) { - early_initialization(); -} - -// ********************* serial debugging ********************* - -#ifdef PEDAL_USB - -void debug_ring_callback(uart_ring *ring) { - char rcv; - while (get_char(ring, &rcv) != 0) { - (void)put_char(ring, rcv); - } -} - -int comms_can_read(uint8_t *data, uint32_t max_len) { - UNUSED(data); - UNUSED(max_len); - return 0; -} -void comms_can_write(const uint8_t *data, uint32_t len) { - UNUSED(data); - UNUSED(len); -} -void comms_endpoint2_write(const uint8_t *data, uint32_t len) { - UNUSED(data); - UNUSED(len); -} -void refresh_can_tx_slots_available(void) {} - -int comms_control_handler(ControlPacket_t *req, uint8_t *resp) { - unsigned int resp_len = 0; - uart_ring *ur = NULL; - switch (req->request) { - // **** 0xc1: get hardware type - case 0xc1: - resp[0] = hw_type; - resp_len = 1; - break; - // **** 0xe0: uart read - case 0xe0: - ur = get_ring_by_number(req->param1); - if (!ur) { - break; - } - // read - while ((resp_len < MIN(req->length, USBPACKET_MAX_SIZE)) && - get_char(ur, (char*)&resp[resp_len])) { - ++resp_len; - } - break; - default: - print("NO HANDLER "); - puth(req->request); - print("\n"); - break; - } - return resp_len; -} - -#endif - -// ***************************** can port ***************************** - -// addresses to be used on CAN -#define CAN_GAS_INPUT 0x200 -#define CAN_GAS_OUTPUT 0x201UL -#define CAN_GAS_SIZE 6 -#define COUNTER_CYCLE 0xFU - -void CAN1_TX_IRQ_Handler(void) { - // clear interrupt - CAN->TSR |= CAN_TSR_RQCP0; -} - -// two independent values -uint16_t gas_set_0 = 0; -uint16_t gas_set_1 = 0; - -#define MAX_TIMEOUT 10U -uint32_t timeout = 0; -uint32_t current_index = 0; - -#define NO_FAULT 0U -#define FAULT_BAD_CHECKSUM 1U -#define FAULT_SEND 2U -#define FAULT_SCE 3U -#define FAULT_STARTUP 4U -#define FAULT_TIMEOUT 5U -#define FAULT_INVALID 6U -uint8_t state = FAULT_STARTUP; -const uint8_t crc_poly = 0xD5U; // standard crc8 - -void CAN1_RX0_IRQ_Handler(void) { - while ((CAN->RF0R & CAN_RF0R_FMP0) != 0) { - #ifdef DEBUG - print("CAN RX\n"); - #endif - int address = CAN->sFIFOMailBox[0].RIR >> 21; - if (address == CAN_GAS_INPUT) { - // softloader entry - if (GET_MAILBOX_BYTES_04(&CAN->sFIFOMailBox[0]) == 0xdeadfaceU) { - if (GET_MAILBOX_BYTES_48(&CAN->sFIFOMailBox[0]) == 0x0ab00b1e) { - enter_bootloader_mode = ENTER_SOFTLOADER_MAGIC; - NVIC_SystemReset(); - } else if (GET_MAILBOX_BYTES_48(&CAN->sFIFOMailBox[0]) == 0x02b00b1e) { - enter_bootloader_mode = ENTER_BOOTLOADER_MAGIC; - NVIC_SystemReset(); - } else { - print("Failed entering Softloader or Bootloader\n"); - } - } - - // normal packet - uint8_t dat[8]; - for (int i=0; i<8; i++) { - dat[i] = GET_MAILBOX_BYTE(&CAN->sFIFOMailBox[0], i); - } - uint16_t value_0 = (dat[0] << 8) | dat[1]; - uint16_t value_1 = (dat[2] << 8) | dat[3]; - bool enable = ((dat[4] >> 7) & 1U) != 0U; - uint8_t index = dat[4] & COUNTER_CYCLE; - if (crc_checksum(dat, CAN_GAS_SIZE - 1, crc_poly) == dat[5]) { - if (((current_index + 1U) & COUNTER_CYCLE) == index) { - #ifdef DEBUG - print("setting gas "); - puth(value_0); - print("\n"); - #endif - if (enable) { - gas_set_0 = value_0; - gas_set_1 = value_1; - } else { - // clear the fault state if values are 0 - if ((value_0 == 0U) && (value_1 == 0U)) { - state = NO_FAULT; - } else { - state = FAULT_INVALID; - } - gas_set_0 = 0; - gas_set_1 = 0; - } - // clear the timeout - timeout = 0; - } - current_index = index; - } else { - // wrong checksum = fault - state = FAULT_BAD_CHECKSUM; - } - } - // next - CAN->RF0R |= CAN_RF0R_RFOM0; - } -} - -void CAN1_SCE_IRQ_Handler(void) { - state = FAULT_SCE; - llcan_clear_send(CAN); -} - -uint32_t pdl0 = 0; -uint32_t pdl1 = 0; -unsigned int pkt_idx = 0; - -int led_value = 0; - -void TIM3_IRQ_Handler(void) { - #ifdef DEBUG - puth(TIM3->CNT); - print(" "); - puth(pdl0); - print(" "); - puth(pdl1); - print("\n"); - #endif - - // check timer for sending the user pedal and clearing the CAN - if ((CAN->TSR & CAN_TSR_TME0) == CAN_TSR_TME0) { - uint8_t dat[8]; - dat[0] = (pdl0 >> 8) & 0xFFU; - dat[1] = (pdl0 >> 0) & 0xFFU; - dat[2] = (pdl1 >> 8) & 0xFFU; - dat[3] = (pdl1 >> 0) & 0xFFU; - dat[4] = ((state & 0xFU) << 4) | pkt_idx; - dat[5] = crc_checksum(dat, CAN_GAS_SIZE - 1, crc_poly); - CAN->sTxMailBox[0].TDLR = dat[0] | (dat[1] << 8) | (dat[2] << 16) | (dat[3] << 24); - CAN->sTxMailBox[0].TDHR = dat[4] | (dat[5] << 8); - CAN->sTxMailBox[0].TDTR = 6; // len of packet is 5 - CAN->sTxMailBox[0].TIR = (CAN_GAS_OUTPUT << 21) | 1U; - ++pkt_idx; - pkt_idx &= COUNTER_CYCLE; - } else { - // old can packet hasn't sent! - state = FAULT_SEND; - #ifdef DEBUG - print("CAN MISS\n"); - #endif - } - - // blink the LED - current_board->set_led(LED_GREEN, led_value); - led_value = !led_value; - - TIM3->SR = 0; - - // up timeout for gas set - if (timeout == MAX_TIMEOUT) { - state = FAULT_TIMEOUT; - } else { - timeout += 1U; - } -} - -// ***************************** main code ***************************** - -void pedal(void) { - // read/write - pdl0 = adc_get_raw(ADCCHAN_ACCEL0); - pdl1 = adc_get_raw(ADCCHAN_ACCEL1); - - // write the pedal to the DAC - if (state == NO_FAULT) { - dac_set(0, MAX(gas_set_0, pdl0)); - dac_set(1, MAX(gas_set_1, pdl1)); - } else { - dac_set(0, pdl0); - dac_set(1, pdl1); - } - - watchdog_feed(); -} - -int main(void) { - // Init interrupt table - init_interrupts(true); - - REGISTER_INTERRUPT(CAN1_TX_IRQn, CAN1_TX_IRQ_Handler, CAN_INTERRUPT_RATE, FAULT_INTERRUPT_RATE_CAN_1) - REGISTER_INTERRUPT(CAN1_RX0_IRQn, CAN1_RX0_IRQ_Handler, CAN_INTERRUPT_RATE, FAULT_INTERRUPT_RATE_CAN_1) - REGISTER_INTERRUPT(CAN1_SCE_IRQn, CAN1_SCE_IRQ_Handler, CAN_INTERRUPT_RATE, FAULT_INTERRUPT_RATE_CAN_1) - - // Should run at around 732Hz (see init below) - REGISTER_INTERRUPT(TIM3_IRQn, TIM3_IRQ_Handler, 1000U, FAULT_INTERRUPT_RATE_TIM3) - - disable_interrupts(); - - // init devices - clock_init(); - peripherals_init(); - detect_board_type(); - - // init board - current_board->init(); - -#ifdef PEDAL_USB - // enable USB - usb_init(); -#endif - - // pedal stuff - dac_init(); - adc_init(); - - // init can - bool llcan_speed_set = llcan_set_speed(CAN, 5000, false, false); - if (!llcan_speed_set) { - print("Failed to set llcan speed"); - } - - bool ret = llcan_init(CAN); - UNUSED(ret); - - // 48mhz / 65536 ~= 732 - timer_init(TIM3, 15); - NVIC_EnableIRQ(TIM3_IRQn); - - watchdog_init(WATCHDOG_50_MS); - - print("**** INTERRUPTS ON ****\n"); - enable_interrupts(); - - // main pedal loop - while (1) { - pedal(); - } - - return 0; -} diff --git a/panda/board/pedal/main_declarations.h b/panda/board/pedal/main_declarations.h deleted file mode 100644 index 33e422735..000000000 --- a/panda/board/pedal/main_declarations.h +++ /dev/null @@ -1,11 +0,0 @@ -// ******************** Prototypes ******************** -void print(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; - -// ********************* Globals ********************** -uint8_t hw_type = 0; -const board *current_board; diff --git a/panda/board/pedal/obj/bootstub.pedal.bin b/panda/board/pedal/obj/bootstub.pedal.bin deleted file mode 100755 index 943272845..000000000 Binary files a/panda/board/pedal/obj/bootstub.pedal.bin and /dev/null differ diff --git a/panda/board/pedal/obj/bootstub.pedal.elf b/panda/board/pedal/obj/bootstub.pedal.elf deleted file mode 100755 index 1d743e6d5..000000000 Binary files a/panda/board/pedal/obj/bootstub.pedal.elf and /dev/null differ diff --git a/panda/board/pedal/obj/bootstub.pedal_usb.bin b/panda/board/pedal/obj/bootstub.pedal_usb.bin deleted file mode 100755 index 943272845..000000000 Binary files a/panda/board/pedal/obj/bootstub.pedal_usb.bin and /dev/null differ diff --git a/panda/board/pedal/obj/bootstub.pedal_usb.elf b/panda/board/pedal/obj/bootstub.pedal_usb.elf deleted file mode 100755 index 1e9c9be11..000000000 Binary files a/panda/board/pedal/obj/bootstub.pedal_usb.elf and /dev/null differ diff --git a/panda/board/pedal/obj/pedal.bin b/panda/board/pedal/obj/pedal.bin deleted file mode 100755 index 1e8de9356..000000000 Binary files a/panda/board/pedal/obj/pedal.bin and /dev/null differ diff --git a/panda/board/pedal/obj/pedal.bin.signed b/panda/board/pedal/obj/pedal.bin.signed deleted file mode 100644 index 0a8316670..000000000 Binary files a/panda/board/pedal/obj/pedal.bin.signed and /dev/null differ diff --git a/panda/board/pedal/obj/pedal.elf b/panda/board/pedal/obj/pedal.elf deleted file mode 100755 index d33937115..000000000 Binary files a/panda/board/pedal/obj/pedal.elf and /dev/null differ diff --git a/panda/board/pedal/obj/pedal_usb.bin b/panda/board/pedal/obj/pedal_usb.bin deleted file mode 100755 index 2d6e30bf4..000000000 Binary files a/panda/board/pedal/obj/pedal_usb.bin and /dev/null differ diff --git a/panda/board/pedal/obj/pedal_usb.bin.signed b/panda/board/pedal/obj/pedal_usb.bin.signed deleted file mode 100644 index a50f985ed..000000000 Binary files a/panda/board/pedal/obj/pedal_usb.bin.signed and /dev/null differ diff --git a/panda/board/pedal/obj/pedal_usb.elf b/panda/board/pedal/obj/pedal_usb.elf deleted file mode 100755 index dfea95624..000000000 Binary files a/panda/board/pedal/obj/pedal_usb.elf and /dev/null differ diff --git a/panda/board/pedal/recover.sh b/panda/board/pedal/recover.sh deleted file mode 100755 index d7fe0aff5..000000000 --- a/panda/board/pedal/recover.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env sh -set -e - -DFU_UTIL="dfu-util" - -cd .. -scons -u -j$(nproc) -cd pedal - -$DFU_UTIL -d 0483:df11 -a 0 -s 0x08004000 -D obj/pedal.bin.signed -$DFU_UTIL -d 0483:df11 -a 0 -s 0x08000000:leave -D obj/bootstub.pedal.bin diff --git a/panda/python/__init__.py b/panda/python/__init__.py index 518db79f9..3b142f7f0 100644 --- a/panda/python/__init__.py +++ b/panda/python/__init__.py @@ -9,7 +9,6 @@ import binascii import datetime import logging from functools import wraps, partial -from typing import Optional from itertools import accumulate from .base import BaseHandle @@ -176,7 +175,6 @@ class Panda: HEALTH_STRUCT = struct.Struct(" bool: + def recover(self, timeout: int | None = 60, reset: bool = True) -> bool: dfu_serial = self.get_dfu_serial() if reset: @@ -551,7 +549,7 @@ class Panda: return True @staticmethod - def wait_for_dfu(dfu_serial: Optional[str], timeout: Optional[int] = None) -> bool: + def wait_for_dfu(dfu_serial: str | None, timeout: int | None = None) -> bool: t_start = time.monotonic() dfu_list = PandaDFU.list() while (dfu_serial is None and len(dfu_list) == 0) or (dfu_serial is not None and dfu_serial not in dfu_list): @@ -563,7 +561,7 @@ class Panda: return True @staticmethod - def wait_for_panda(serial: Optional[str], timeout: int) -> bool: + def wait_for_panda(serial: str | None, timeout: int) -> bool: t_start = time.monotonic() serials = Panda.list() while (serial is None and len(serials) == 0) or (serial is not None and serial not in serials): @@ -699,9 +697,7 @@ class Panda: def get_mcu_type(self) -> McuType: hw_type = self.get_type() - if hw_type in Panda.F2_DEVICES: - return McuType.F2 - elif hw_type in Panda.F4_DEVICES: + if hw_type in Panda.F4_DEVICES: return McuType.F4 elif hw_type in Panda.H7_DEVICES: return McuType.H7 diff --git a/panda/python/constants.py b/panda/python/constants.py index 8078da3e6..8b0959308 100644 --- a/panda/python/constants.py +++ b/panda/python/constants.py @@ -1,6 +1,6 @@ import os import enum -from typing import List, NamedTuple +from typing import NamedTuple BASEDIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../") FW_PATH = os.path.join(BASEDIR, "board/obj/") @@ -10,7 +10,7 @@ USBPACKET_MAX_SIZE = 0x40 class McuConfig(NamedTuple): mcu: str mcu_idcode: int - sector_sizes: List[int] + sector_sizes: list[int] sector_count: int # total sector count, used for MCU identification in DFU mode uid_address: int block_size: int @@ -24,7 +24,11 @@ class McuConfig(NamedTuple): # assume bootstub is in sector 0 return self.bootstub_address + sum(self.sector_sizes[:i]) -Fx = ( +F4Config = McuConfig( + "STM32F4", + 0x463, + [0x4000 for _ in range(4)] + [0x10000] + [0x20000 for _ in range(11)], + 16, 0x1FFF7A10, 0x800, 0x1FFF79C0, @@ -33,8 +37,6 @@ Fx = ( 0x8000000, "bootstub.panda.bin", ) -F2Config = McuConfig("STM32F2", 0x411, [0x4000 for _ in range(4)] + [0x10000] + [0x20000 for _ in range(7)], 12, *Fx) -F4Config = McuConfig("STM32F4", 0x463, [0x4000 for _ in range(4)] + [0x10000] + [0x20000 for _ in range(11)], 16, *Fx) H7Config = McuConfig( "STM32H7", @@ -53,7 +55,6 @@ H7Config = McuConfig( @enum.unique class McuType(enum.Enum): - F2 = F2Config F4 = F4Config H7 = H7Config diff --git a/panda/python/dfu.py b/panda/python/dfu.py index 01ff037f8..9beba45e5 100644 --- a/panda/python/dfu.py +++ b/panda/python/dfu.py @@ -2,7 +2,6 @@ import os import usb1 import struct import binascii -from typing import List, Optional from .base import BaseSTBootloaderHandle from .spi import STBootloaderSPIHandle, PandaSpiException @@ -11,9 +10,9 @@ from .constants import FW_PATH, McuType class PandaDFU: - def __init__(self, dfu_serial: Optional[str]): + def __init__(self, dfu_serial: str | None): # try USB, then SPI - handle: Optional[BaseSTBootloaderHandle] + handle: BaseSTBootloaderHandle | None self._context, handle = PandaDFU.usb_connect(dfu_serial) if handle is None: self._context, handle = PandaDFU.spi_connect(dfu_serial) @@ -38,7 +37,7 @@ class PandaDFU: self._context.close() @staticmethod - def usb_connect(dfu_serial: Optional[str]): + def usb_connect(dfu_serial: str | None): handle = None context = usb1.USBContext() context.open() @@ -56,7 +55,7 @@ class PandaDFU: return context, handle @staticmethod - def spi_connect(dfu_serial: Optional[str]): + def spi_connect(dfu_serial: str | None): handle = None this_dfu_serial = None @@ -72,13 +71,7 @@ class PandaDFU: return None, handle @staticmethod - def list() -> List[str]: - ret = PandaDFU.usb_list() - ret += PandaDFU.spi_list() - return list(set(ret)) - - @staticmethod - def usb_list() -> List[str]: + def usb_list() -> list[str]: dfu_serials = [] try: with usb1.USBContext() as context: @@ -93,7 +86,7 @@ class PandaDFU: return dfu_serials @staticmethod - def spi_list() -> List[str]: + def spi_list() -> list[str]: try: _, h = PandaDFU.spi_connect(None) if h is not None: @@ -134,3 +127,9 @@ class PandaDFU: code = f.read() self.program_bootstub(code) self.reset() + + @staticmethod + def list() -> list[str]: + ret = PandaDFU.usb_list() + ret += PandaDFU.spi_list() + return list(set(ret)) diff --git a/panda/python/isotp.py b/panda/python/isotp.py index 3334deb8e..d0bef7d94 100644 --- a/panda/python/isotp.py +++ b/panda/python/isotp.py @@ -79,10 +79,10 @@ def isotp_send(panda, x, addr, bus=0, recvaddr=None, subaddr=None, rate=None): sends = [] while len(x) > 0: if subaddr: - sends.append(((bytes([subaddr, 0x20 + (idx & 0xF)]) + x[0:6]).ljust(8, b"\x00"))) + sends.append((bytes([subaddr, 0x20 + (idx & 0xF)]) + x[0:6]).ljust(8, b"\x00")) x = x[6:] else: - sends.append(((bytes([0x20 + (idx & 0xF)]) + x[0:7]).ljust(8, b"\x00"))) + sends.append((bytes([0x20 + (idx & 0xF)]) + x[0:7]).ljust(8, b"\x00")) x = x[7:] idx += 1 diff --git a/panda/python/serial.py b/panda/python/serial.py index 9ac58862b..c2e965b76 100644 --- a/panda/python/serial.py +++ b/panda/python/serial.py @@ -1,5 +1,5 @@ # mimic a python serial port -class PandaSerial(object): +class PandaSerial: def __init__(self, panda, port, baud): self.panda = panda self.port = port diff --git a/panda/python/spi.py b/panda/python/spi.py index 699431bf0..d34a61d56 100644 --- a/panda/python/spi.py +++ b/panda/python/spi.py @@ -9,11 +9,10 @@ import logging import threading from contextlib import contextmanager from functools import reduce -from typing import Callable, List, Optional +from collections.abc import Callable from .base import BaseHandle, BaseSTBootloaderHandle, TIMEOUT from .constants import McuType, MCU_TYPE_BY_IDCODE, USBPACKET_MAX_SIZE -from .utils import crc8_pedal try: import spidev @@ -35,6 +34,20 @@ XFER_SIZE = 0x40*31 DEV_PATH = "/dev/spidev0.0" +def crc8(data): + crc = 0xFF # standard init value + poly = 0xD5 # standard crc8: x8+x7+x6+x4+x2+1 + size = len(data) + for i in range(size - 1, -1, -1): + crc ^= data[i] + for _ in range(8): + if ((crc & 0x80) != 0): + crc = ((crc << 1) ^ poly) & 0xFF + else: + crc <<= 1 + return crc + + class PandaSpiException(Exception): pass @@ -248,7 +261,7 @@ class PandaSpiHandle(BaseHandle): # get response dat = spi.readbytes(rlen + 1) resp = dat[:-1] - calculated_crc = crc8_pedal(bytes(version_bytes + resp)) + calculated_crc = crc8(bytes(version_bytes + resp)) if calculated_crc != dat[-1]: raise PandaSpiBadChecksum return bytes(resp) @@ -328,7 +341,7 @@ class STBootloaderSPIHandle(BaseSTBootloaderHandle): elif data != self.ACK: raise PandaSpiMissingAck - def _cmd_no_retry(self, cmd: int, data: Optional[List[bytes]] = None, read_bytes: int = 0, predata=None) -> bytes: + def _cmd_no_retry(self, cmd: int, data: list[bytes] | None = None, read_bytes: int = 0, predata=None) -> bytes: ret = b"" with self.dev.acquire() as spi: # sync + command @@ -358,7 +371,7 @@ class STBootloaderSPIHandle(BaseSTBootloaderHandle): return bytes(ret) - def _cmd(self, cmd: int, data: Optional[List[bytes]] = None, read_bytes: int = 0, predata=None) -> bytes: + def _cmd(self, cmd: int, data: list[bytes] | None = None, read_bytes: int = 0, predata=None) -> bytes: exc = PandaSpiException() for n in range(MAX_XFER_RETRY_COUNT): try: diff --git a/panda/python/uds.py b/panda/python/uds.py index aaa0697f9..12b4fcdc2 100644 --- a/panda/python/uds.py +++ b/panda/python/uds.py @@ -1,7 +1,8 @@ import time import struct from collections import deque -from typing import Callable, NamedTuple, Tuple, List, Deque, Generator, Optional, cast +from typing import NamedTuple, Deque, cast +from collections.abc import Callable, Generator from enum import IntEnum from functools import partial @@ -300,8 +301,8 @@ def get_dtc_status_names(status): return result class CanClient(): - def __init__(self, can_send: Callable[[int, bytes, int], None], can_recv: Callable[[], List[Tuple[int, int, bytes, int]]], - tx_addr: int, rx_addr: int, bus: int, sub_addr: Optional[int] = None, debug: bool = False): + def __init__(self, can_send: Callable[[int, bytes, int], None], can_recv: Callable[[], list[tuple[int, int, bytes, int]]], + tx_addr: int, rx_addr: int, bus: int, sub_addr: int | None = None, debug: bool = False): self.tx = can_send self.rx = can_recv self.tx_addr = tx_addr @@ -335,7 +336,7 @@ class CanClient(): msgs = self.rx() if drain: if self.debug: - print("CAN-RX: drain - {}".format(len(msgs))) + print(f"CAN-RX: drain - {len(msgs)}") self.rx_buff.clear() else: for rx_addr, _, rx_data, rx_bus in msgs or []: @@ -366,7 +367,7 @@ class CanClient(): except IndexError: pass # empty - def send(self, msgs: List[bytes], delay: float = 0) -> None: + def send(self, msgs: list[bytes], delay: float = 0) -> None: for i, msg in enumerate(msgs): if delay and i != 0: if self.debug: @@ -443,7 +444,7 @@ class IsoTpMessage(): if not setup_only: self._can_client.send([msg]) - def recv(self, timeout=None) -> Tuple[Optional[bytes], bool]: + def recv(self, timeout=None) -> tuple[bytes | None, bool]: if timeout is None: timeout = self.timeout @@ -566,11 +567,11 @@ def get_rx_addr_for_tx_addr(tx_addr, rx_offset=0x8): # standard 29 bit response addr (flip last two bytes) return (tx_addr & 0xFFFF0000) + (tx_addr << 8 & 0xFF00) + (tx_addr >> 8 & 0xFF) - raise ValueError("invalid tx_addr: {}".format(tx_addr)) + raise ValueError(f"invalid tx_addr: {tx_addr}") class UdsClient(): - def __init__(self, panda, tx_addr: int, rx_addr: Optional[int] = None, bus: int = 0, sub_addr: Optional[int] = None, timeout: float = 1, + def __init__(self, panda, tx_addr: int, rx_addr: int | None = None, bus: int = 0, sub_addr: int | None = None, timeout: float = 1, debug: bool = False, tx_timeout: float = 1, response_pending_timeout: float = 10): self.bus = bus self.tx_addr = tx_addr @@ -583,7 +584,7 @@ class UdsClient(): self.response_pending_timeout = response_pending_timeout # generic uds request - def _uds_request(self, service_type: SERVICE_TYPE, subfunction: Optional[int] = None, data: Optional[bytes] = None) -> bytes: + def _uds_request(self, service_type: SERVICE_TYPE, subfunction: int | None = None, data: bytes | None = None) -> bytes: req = bytes([service_type]) if subfunction is not None: req += bytes([subfunction]) @@ -623,12 +624,12 @@ class UdsClient(): if self.debug: print("UDS-RX: response pending") continue - raise NegativeResponseError('{} - {}'.format(service_desc, error_desc), service_id, error_code) + raise NegativeResponseError(f'{service_desc} - {error_desc}', service_id, error_code) # positive response if service_type + 0x40 != resp_sid: resp_sid_hex = hex(resp_sid) if resp_sid is not None else None - raise InvalidServiceIdError('invalid response service id: {}'.format(resp_sid_hex)) + raise InvalidServiceIdError(f'invalid response service id: {resp_sid_hex}') if subfunction is not None: resp_sfn = resp[1] if len(resp) > 1 else None @@ -671,7 +672,7 @@ class UdsClient(): def tester_present(self, ): self._uds_request(SERVICE_TYPE.TESTER_PRESENT, subfunction=0x00) - def access_timing_parameter(self, timing_parameter_type: TIMING_PARAMETER_TYPE, parameter_values: Optional[bytes] = None): + def access_timing_parameter(self, timing_parameter_type: TIMING_PARAMETER_TYPE, parameter_values: bytes | None = None): write_custom_values = timing_parameter_type == TIMING_PARAMETER_TYPE.SET_TO_GIVEN_VALUES read_values = (timing_parameter_type == TIMING_PARAMETER_TYPE.READ_CURRENTLY_ACTIVE or timing_parameter_type == TIMING_PARAMETER_TYPE.READ_EXTENDED_SET) @@ -714,8 +715,8 @@ class UdsClient(): "data": resp[2:], # TODO: parse the reset of response } - def link_control(self, link_control_type: LINK_CONTROL_TYPE, baud_rate_type: Optional[BAUD_RATE_TYPE] = None): - data: Optional[bytes] + def link_control(self, link_control_type: LINK_CONTROL_TYPE, baud_rate_type: BAUD_RATE_TYPE | None = None): + data: bytes | None if link_control_type == LINK_CONTROL_TYPE.VERIFY_BAUDRATE_TRANSITION_WITH_FIXED_BAUDRATE: # baud_rate_type = BAUD_RATE_TYPE @@ -733,21 +734,21 @@ 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: {} expected: {}'.format(hex(resp_id), hex(data_identifier_type))) + raise ValueError(f'invalid response data identifier: {hex(resp_id)} expected: {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): if memory_address_bytes < 1 or memory_address_bytes > 4: - raise ValueError('invalid memory_address_bytes: {}'.format(memory_address_bytes)) + raise ValueError(f'invalid memory_address_bytes: {memory_address_bytes}') if memory_size_bytes < 1 or memory_size_bytes > 4: - raise ValueError('invalid memory_size_bytes: {}'.format(memory_size_bytes)) + raise ValueError(f'invalid memory_size_bytes: {memory_size_bytes}') data = bytes([memory_size_bytes << 4 | memory_address_bytes]) if memory_address >= 1 << (memory_address_bytes * 8): - raise ValueError('invalid memory_address: {}'.format(memory_address)) + raise ValueError(f'invalid memory_address: {memory_address}') data += struct.pack('!I', memory_address)[4 - memory_address_bytes:] if memory_size >= 1 << (memory_size_bytes * 8): - raise ValueError('invalid memory_size: {}'.format(memory_size)) + raise ValueError(f'invalid memory_size: {memory_size}') data += struct.pack('!I', memory_size)[4 - memory_size_bytes:] resp = self._uds_request(SERVICE_TYPE.READ_MEMORY_BY_ADDRESS, subfunction=None, data=data) @@ -758,7 +759,7 @@ class UdsClient(): resp = self._uds_request(SERVICE_TYPE.READ_SCALING_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(f'invalid response data identifier: {hex(resp_id)}') return resp[2:] # TODO: parse the response def read_data_by_periodic_identifier(self, transmission_mode_type: TRANSMISSION_MODE_TYPE, periodic_data_identifier: int): @@ -767,11 +768,11 @@ class UdsClient(): self._uds_request(SERVICE_TYPE.READ_DATA_BY_PERIODIC_IDENTIFIER, subfunction=None, data=data) def dynamically_define_data_identifier(self, dynamic_definition_type: DYNAMIC_DEFINITION_TYPE, dynamic_data_identifier: int, - source_definitions: List[DynamicSourceDefinition], memory_address_bytes: int = 4, memory_size_bytes: int = 1): + source_definitions: list[DynamicSourceDefinition], memory_address_bytes: int = 4, memory_size_bytes: int = 1): if memory_address_bytes < 1 or memory_address_bytes > 4: - raise ValueError('invalid memory_address_bytes: {}'.format(memory_address_bytes)) + raise ValueError(f'invalid memory_address_bytes: {memory_address_bytes}') if memory_size_bytes < 1 or memory_size_bytes > 4: - raise ValueError('invalid memory_size_bytes: {}'.format(memory_size_bytes)) + raise ValueError(f'invalid memory_size_bytes: {memory_size_bytes}') data = struct.pack('!H', dynamic_data_identifier) if dynamic_definition_type == DYNAMIC_DEFINITION_TYPE.DEFINE_BY_IDENTIFIER: @@ -781,15 +782,15 @@ class UdsClient(): data += bytes([memory_size_bytes << 4 | memory_address_bytes]) for s in source_definitions: if s.memory_address >= 1 << (memory_address_bytes * 8): - raise ValueError('invalid memory_address: {}'.format(s.memory_address)) + raise ValueError(f'invalid memory_address: {s.memory_address}') data += struct.pack('!I', s.memory_address)[4 - memory_address_bytes:] if s.memory_size >= 1 << (memory_size_bytes * 8): - raise ValueError('invalid memory_size: {}'.format(s.memory_size)) + raise ValueError(f'invalid memory_size: {s.memory_size}') data += struct.pack('!I', s.memory_size)[4 - memory_size_bytes:] elif dynamic_definition_type == DYNAMIC_DEFINITION_TYPE.CLEAR_DYNAMICALLY_DEFINED_DATA_IDENTIFIER: pass else: - raise ValueError('invalid dynamic identifier type: {}'.format(hex(dynamic_definition_type))) + raise ValueError(f'invalid dynamic identifier type: {hex(dynamic_definition_type)}') self._uds_request(SERVICE_TYPE.DYNAMICALLY_DEFINE_DATA_IDENTIFIER, subfunction=dynamic_definition_type, data=data) def write_data_by_identifier(self, data_identifier_type: DATA_IDENTIFIER_TYPE, data_record: bytes): @@ -797,20 +798,20 @@ class UdsClient(): resp = self._uds_request(SERVICE_TYPE.WRITE_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(f'invalid response data identifier: {hex(resp_id)}') def write_memory_by_address(self, memory_address: int, memory_size: int, data_record: bytes, memory_address_bytes: int = 4, memory_size_bytes: int = 1): if memory_address_bytes < 1 or memory_address_bytes > 4: - raise ValueError('invalid memory_address_bytes: {}'.format(memory_address_bytes)) + raise ValueError(f'invalid memory_address_bytes: {memory_address_bytes}') if memory_size_bytes < 1 or memory_size_bytes > 4: - raise ValueError('invalid memory_size_bytes: {}'.format(memory_size_bytes)) + raise ValueError(f'invalid memory_size_bytes: {memory_size_bytes}') data = bytes([memory_size_bytes << 4 | memory_address_bytes]) if memory_address >= 1 << (memory_address_bytes * 8): - raise ValueError('invalid memory_address: {}'.format(memory_address)) + raise ValueError(f'invalid memory_address: {memory_address}') data += struct.pack('!I', memory_address)[4 - memory_address_bytes:] if memory_size >= 1 << (memory_size_bytes * 8): - raise ValueError('invalid memory_size: {}'.format(memory_size)) + raise ValueError(f'invalid memory_size: {memory_size}') data += struct.pack('!I', memory_size)[4 - memory_size_bytes:] data += data_record @@ -864,7 +865,7 @@ class UdsClient(): resp = self._uds_request(SERVICE_TYPE.INPUT_OUTPUT_CONTROL_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(f'invalid response data identifier: {hex(resp_id)}') return resp[2:] def routine_control(self, routine_control_type: ROUTINE_CONTROL_TYPE, routine_identifier_type: ROUTINE_IDENTIFIER_TYPE, routine_option_record: bytes = b''): @@ -872,23 +873,23 @@ class UdsClient(): resp = self._uds_request(SERVICE_TYPE.ROUTINE_CONTROL, subfunction=routine_control_type, data=data) resp_id = struct.unpack('!H', resp[0:2])[0] if len(resp) >= 2 else None if resp_id != routine_identifier_type: - raise ValueError('invalid response routine identifier: {}'.format(hex(resp_id))) + raise ValueError(f'invalid response routine identifier: {hex(resp_id)}') return resp[2:] def request_download(self, memory_address: int, memory_size: int, memory_address_bytes: int = 4, memory_size_bytes: int = 4, data_format: int = 0x00): data = bytes([data_format]) if memory_address_bytes < 1 or memory_address_bytes > 4: - raise ValueError('invalid memory_address_bytes: {}'.format(memory_address_bytes)) + raise ValueError(f'invalid memory_address_bytes: {memory_address_bytes}') if memory_size_bytes < 1 or memory_size_bytes > 4: - raise ValueError('invalid memory_size_bytes: {}'.format(memory_size_bytes)) + raise ValueError(f'invalid memory_size_bytes: {memory_size_bytes}') data += bytes([memory_size_bytes << 4 | memory_address_bytes]) if memory_address >= 1 << (memory_address_bytes * 8): - raise ValueError('invalid memory_address: {}'.format(memory_address)) + raise ValueError(f'invalid memory_address: {memory_address}') data += struct.pack('!I', memory_address)[4 - memory_address_bytes:] if memory_size >= 1 << (memory_size_bytes * 8): - raise ValueError('invalid memory_size: {}'.format(memory_size)) + raise ValueError(f'invalid memory_size: {memory_size}') data += struct.pack('!I', memory_size)[4 - memory_size_bytes:] resp = self._uds_request(SERVICE_TYPE.REQUEST_DOWNLOAD, subfunction=None, data=data) @@ -896,7 +897,7 @@ class UdsClient(): if max_num_bytes_len >= 1 and max_num_bytes_len <= 4: max_num_bytes = struct.unpack('!I', (b"\x00" * (4 - max_num_bytes_len)) + resp[1:max_num_bytes_len + 1])[0] else: - raise ValueError('invalid max_num_bytes_len: {}'.format(max_num_bytes_len)) + raise ValueError(f'invalid max_num_bytes_len: {max_num_bytes_len}') return max_num_bytes # max number of bytes per transfer data request @@ -904,16 +905,16 @@ class UdsClient(): data = bytes([data_format]) if memory_address_bytes < 1 or memory_address_bytes > 4: - raise ValueError('invalid memory_address_bytes: {}'.format(memory_address_bytes)) + raise ValueError(f'invalid memory_address_bytes: {memory_address_bytes}') if memory_size_bytes < 1 or memory_size_bytes > 4: - raise ValueError('invalid memory_size_bytes: {}'.format(memory_size_bytes)) + raise ValueError(f'invalid memory_size_bytes: {memory_size_bytes}') data += bytes([memory_size_bytes << 4 | memory_address_bytes]) if memory_address >= 1 << (memory_address_bytes * 8): - raise ValueError('invalid memory_address: {}'.format(memory_address)) + raise ValueError(f'invalid memory_address: {memory_address}') data += struct.pack('!I', memory_address)[4 - memory_address_bytes:] if memory_size >= 1 << (memory_size_bytes * 8): - raise ValueError('invalid memory_size: {}'.format(memory_size)) + raise ValueError(f'invalid memory_size: {memory_size}') data += struct.pack('!I', memory_size)[4 - memory_size_bytes:] resp = self._uds_request(SERVICE_TYPE.REQUEST_UPLOAD, subfunction=None, data=data) @@ -921,7 +922,7 @@ class UdsClient(): if max_num_bytes_len >= 1 and max_num_bytes_len <= 4: max_num_bytes = struct.unpack('!I', (b"\x00" * (4 - max_num_bytes_len)) + resp[1:max_num_bytes_len + 1])[0] else: - raise ValueError('invalid max_num_bytes_len: {}'.format(max_num_bytes_len)) + raise ValueError(f'invalid max_num_bytes_len: {max_num_bytes_len}') return max_num_bytes # max number of bytes per transfer data request @@ -930,7 +931,7 @@ class UdsClient(): resp = self._uds_request(SERVICE_TYPE.TRANSFER_DATA, subfunction=None, data=data) resp_id = resp[0] if len(resp) > 0 else None if resp_id != block_sequence_count: - raise ValueError('invalid block_sequence_count: {}'.format(resp_id)) + raise ValueError(f'invalid block_sequence_count: {resp_id}') return resp[1:] def request_transfer_exit(self): diff --git a/panda/python/utils.py b/panda/python/utils.py deleted file mode 100644 index f91da6413..000000000 --- a/panda/python/utils.py +++ /dev/null @@ -1,12 +0,0 @@ -def crc8_pedal(data): - crc = 0xFF # standard init value - poly = 0xD5 # standard crc8: x8+x7+x6+x4+x2+1 - size = len(data) - for i in range(size - 1, -1, -1): - crc ^= data[i] - for _ in range(8): - if ((crc & 0x80) != 0): - crc = ((crc << 1) ^ poly) & 0xFF - else: - crc <<= 1 - return crc diff --git a/panda/python/xcp.py b/panda/python/xcp.py new file mode 100644 index 000000000..bb294046e --- /dev/null +++ b/panda/python/xcp.py @@ -0,0 +1,258 @@ +import sys +import time +import struct +from enum import IntEnum + +class COMMAND_CODE(IntEnum): + CONNECT = 0xFF + DISCONNECT = 0xFE + GET_STATUS = 0xFD + SYNCH = 0xFC + GET_COMM_MODE_INFO = 0xFB + GET_ID = 0xFA + SET_REQUEST = 0xF9 + GET_SEED = 0xF8 + UNLOCK = 0xF7 + SET_MTA = 0xF6 + UPLOAD = 0xF5 + SHORT_UPLOAD = 0xF4 + BUILD_CHECKSUM = 0xF3 + TRANSPORT_LAYER_CMD = 0xF2 + USER_CMD = 0xF1 + DOWNLOAD = 0xF0 + DOWNLOAD_NEXT = 0xEF + DOWNLOAD_MAX = 0xEE + SHORT_DOWNLOAD = 0xED + MODIFY_BITS = 0xEC + SET_CAL_PAGE = 0xEB + GET_CAL_PAGE = 0xEA + GET_PAG_PROCESSOR_INFO = 0xE9 + GET_SEGMENT_INFO = 0xE8 + GET_PAGE_INFO = 0xE7 + SET_SEGMENT_MODE = 0xE6 + GET_SEGMENT_MODE = 0xE5 + COPY_CAL_PAGE = 0xE4 + CLEAR_DAQ_LIST = 0xE3 + SET_DAQ_PTR = 0xE2 + WRITE_DAQ = 0xE1 + SET_DAQ_LIST_MODE = 0xE0 + GET_DAQ_LIST_MODE = 0xDF + START_STOP_DAQ_LIST = 0xDE + START_STOP_SYNCH = 0xDD + GET_DAQ_CLOCK = 0xDC + READ_DAQ = 0xDB + GET_DAQ_PROCESSOR_INFO = 0xDA + GET_DAQ_RESOLUTION_INFO = 0xD9 + GET_DAQ_LIST_INFO = 0xD8 + GET_DAQ_EVENT_INFO = 0xD7 + FREE_DAQ = 0xD6 + ALLOC_DAQ = 0xD5 + ALLOC_ODT = 0xD4 + ALLOC_ODT_ENTRY = 0xD3 + PROGRAM_START = 0xD2 + PROGRAM_CLEAR = 0xD1 + PROGRAM = 0xD0 + PROGRAM_RESET = 0xCF + GET_PGM_PROCESSOR_INFO = 0xCE + GET_SECTOR_INFO = 0xCD + PROGRAM_PREPARE = 0xCC + PROGRAM_FORMAT = 0xCB + PROGRAM_NEXT = 0xCA + PROGRAM_MAX = 0xC9 + PROGRAM_VERIFY = 0xC8 + +ERROR_CODES = { + 0x00: "Command processor synchronization", + 0x10: "Command was not executed", + 0x11: "Command rejected because DAQ is running", + 0x12: "Command rejected because PGM is running", + 0x20: "Unknown command or not implemented optional command", + 0x21: "Command syntax invalid", + 0x22: "Command syntax valid but command parameter(s) out of range", + 0x23: "The memory location is write protected", + 0x24: "The memory location is not accessible", + 0x25: "Access denied, Seed & Key is required", + 0x26: "Selected page not available", + 0x27: "Selected page mode not available", + 0x28: "Selected segment not valid", + 0x29: "Sequence error", + 0x2A: "DAQ configuration not valid", + 0x30: "Memory overflow error", + 0x31: "Generic error", + 0x32: "The slave internal program verify routine detects an error", +} + +class CONNECT_MODE(IntEnum): + NORMAL = 0x00, + USER_DEFINED = 0x01, + +class GET_ID_REQUEST_TYPE(IntEnum): + ASCII = 0x00, + ASAM_MC2_FILE = 0x01, + ASAM_MC2_PATH = 0x02, + ASAM_MC2_URL = 0x03, + ASAM_MC2_UPLOAD = 0x04, + # 128-255 user defined + +class CommandTimeoutError(Exception): + pass + +class CommandCounterError(Exception): + pass + +class CommandResponseError(Exception): + def __init__(self, message, return_code): + super().__init__() + self.message = message + self.return_code = return_code + + def __str__(self): + return self.message + +class XcpClient(): + def __init__(self, panda, tx_addr: int, rx_addr: int, bus: int=0, timeout: float=0.1, debug=False, pad=True): + self.tx_addr = tx_addr + self.rx_addr = rx_addr + self.can_bus = bus + self.timeout = timeout + self.debug = debug + self._panda = panda + self._byte_order = ">" + self._max_cto = 8 + self._max_dto = 8 + self.pad = pad + + def _send_cto(self, cmd: int, dat: bytes = b"") -> None: + tx_data = (bytes([cmd]) + dat) + + # Some ECUs don't respond if the packets are not padded to 8 bytes + if self.pad: + tx_data = tx_data.ljust(8, b"\x00") + + if self.debug: + print("CAN-CLEAR: TX") + self._panda.can_clear(self.can_bus) + if self.debug: + print("CAN-CLEAR: RX") + self._panda.can_clear(0xFFFF) + if self.debug: + print(f"CAN-TX: {hex(self.tx_addr)} - 0x{bytes.hex(tx_data)}") + self._panda.can_send(self.tx_addr, tx_data, self.can_bus) + + def _recv_dto(self, timeout: float) -> bytes: + start_time = time.time() + while time.time() - start_time < timeout: + msgs = self._panda.can_recv() or [] + if len(msgs) >= 256: + print("CAN RX buffer overflow!!!", file=sys.stderr) + for rx_addr, _, rx_data, rx_bus in msgs: + if rx_bus == self.can_bus and rx_addr == self.rx_addr: + rx_data = bytes(rx_data) # convert bytearray to bytes + if self.debug: + print(f"CAN-RX: {hex(rx_addr)} - 0x{bytes.hex(rx_data)}") + + pid = rx_data[0] + if pid == 0xFE: + err = rx_data[1] + err_desc = ERROR_CODES.get(err, "unknown error") + dat = rx_data[2:] + raise CommandResponseError(f"{hex(err)} - {err_desc} {dat}", err) + + return bytes(rx_data[1:]) + time.sleep(0.001) + + raise CommandTimeoutError("timeout waiting for response") + + # commands + def connect(self, connect_mode: CONNECT_MODE=CONNECT_MODE.NORMAL) -> dict: + self._send_cto(COMMAND_CODE.CONNECT, bytes([connect_mode])) + resp = self._recv_dto(self.timeout) + assert len(resp) == 7, f"incorrect data length: {len(resp)}" + self._byte_order = ">" if resp[1] & 0x01 else "<" + self._slave_block_mode = resp[1] & 0x40 != 0 + self._max_cto = resp[2] + self._max_dto = struct.unpack(f"{self._byte_order}H", resp[3:5])[0] + return { + "cal_support": resp[0] & 0x01 != 0, + "daq_support": resp[0] & 0x04 != 0, + "stim_support": resp[0] & 0x08 != 0, + "pgm_support": resp[0] & 0x10 != 0, + "byte_order": self._byte_order, + "address_granularity": 2**((resp[1] & 0x06) >> 1), + "slave_block_mode": self._slave_block_mode, + "optional": resp[1] & 0x80 != 0, + "max_cto": self._max_cto, + "max_dto": self._max_dto, + "protocol_version": resp[5], + "transport_version": resp[6], + } + + def disconnect(self) -> None: + self._send_cto(COMMAND_CODE.DISCONNECT) + resp = self._recv_dto(self.timeout) + assert len(resp) == 0, f"incorrect data length: {len(resp)}" + + def get_id(self, req_id_type: GET_ID_REQUEST_TYPE = GET_ID_REQUEST_TYPE.ASCII) -> dict: + if req_id_type > 255: + raise ValueError("request id type must be less than 255") + self._send_cto(COMMAND_CODE.GET_ID, bytes([req_id_type])) + resp = self._recv_dto(self.timeout) + return { + # mode = 0 means MTA was set + # mode = 1 means data is at end (only CAN-FD has space for this) + "mode": resp[0], + "length": struct.unpack(f"{self._byte_order}I", resp[3:7])[0], + "identifier": resp[7:] if self._max_cto > 8 else None + } + + def get_seed(self, mode: int = 0) -> bytes: + if mode > 255: + raise ValueError("mode must be less than 255") + self._send_cto(COMMAND_CODE.GET_SEED, bytes([0, mode])) + + # TODO: add support for longer seeds spread over multiple blocks + ret = self._recv_dto(self.timeout) + length = ret[0] + return ret[1:length+1] + + def unlock(self, key: bytes) -> bytes: + # TODO: add support for longer keys spread over multiple blocks + self._send_cto(COMMAND_CODE.UNLOCK, bytes([len(key)]) + key) + return self._recv_dto(self.timeout) + + def set_mta(self, addr: int, addr_ext: int = 0) -> bytes: + if addr_ext > 255: + raise ValueError("address extension must be less than 256") + # TODO: this looks broken (missing addr extension) + self._send_cto(COMMAND_CODE.SET_MTA, bytes([0x00, 0x00, addr_ext]) + struct.pack(f"{self._byte_order}I", addr)) + return self._recv_dto(self.timeout) + + def upload(self, size: int) -> bytes: + if size > 255: + raise ValueError("size must be less than 256") + if not self._slave_block_mode and size > self._max_dto - 1: + raise ValueError("block mode not supported") + + self._send_cto(COMMAND_CODE.UPLOAD, bytes([size])) + resp = b"" + while len(resp) < size: + resp += self._recv_dto(self.timeout)[:size - len(resp) + 1] + return resp[:size] # trim off bytes with undefined values + + def short_upload(self, size: int, addr_ext: int, addr: int) -> bytes: + if size > 6: + raise ValueError("size must be less than 7") + if addr_ext > 255: + raise ValueError("address extension must be less than 256") + self._send_cto(COMMAND_CODE.SHORT_UPLOAD, bytes([size, 0x00, addr_ext]) + struct.pack(f"{self._byte_order}I", addr)) + return self._recv_dto(self.timeout)[:size] # trim off bytes with undefined values + + def download(self, data: bytes) -> bytes: + size = len(data) + if size > 255: + raise ValueError("size must be less than 256") + if not self._slave_block_mode and size > self._max_dto - 2: + raise ValueError("block mode not supported") + + self._send_cto(COMMAND_CODE.DOWNLOAD, bytes([size]) + data) + return self._recv_dto(self.timeout)[:size] diff --git a/pyproject.toml b/pyproject.toml index 51396ca39..99a860246 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,6 +63,9 @@ warn_unused_ignores=true # restrict dynamic typing warn_return_any=true +# allow implicit optionals for default args +implicit_optional = true + [tool.poetry] name = "openpilot" @@ -187,6 +190,7 @@ lint.flake8-implicit-str-concat.allow-multiline=false "system".msg = "Use openpilot.system" "third_party".msg = "Use openpilot.third_party" "tools".msg = "Use openpilot.tools" +"pytest.main".msg = "pytest.main requires special handling that is easy to mess up!" [tool.coverage.run] concurrency = ["multiprocessing", "thread"] diff --git a/rednose/helpers/ekf_sym.py b/rednose/helpers/ekf_sym.py index 8f0425cb0..e8bd6420f 100644 --- a/rednose/helpers/ekf_sym.py +++ b/rednose/helpers/ekf_sym.py @@ -464,7 +464,7 @@ class EKF_sym(): # rewind if self.filter_time is not None and t < self.filter_time: if len(self.rewind_t) == 0 or t < self.rewind_t[0] or t < self.rewind_t[-1] - self.max_rewind_age: - self.logger.error("observation too old at %.3f with filter at %.3f, ignoring" % (t, self.filter_time)) + self.logger.error(f"observation too old at {t:.3f} with filter at {self.filter_time:.3f}, ignoring") return None rewound = self.rewind(t) else: diff --git a/rednose/helpers/ekf_sym_pyx.cpp b/rednose/helpers/ekf_sym_pyx.cpp index 2ba8693a8..cfea0d8e0 100644 --- a/rednose/helpers/ekf_sym_pyx.cpp +++ b/rednose/helpers/ekf_sym_pyx.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.5 */ +/* Generated by Cython 3.0.8 */ /* BEGIN: Cython Metadata { @@ -10,7 +10,7 @@ "language": "c++", "name": "rednose.helpers.ekf_sym_pyx", "sources": [ - "/data/openpilot/rednose/helpers/ekf_sym_pyx.pyx" + "/data/dp-private/rednose/helpers/ekf_sym_pyx.pyx" ] }, "module_name": "rednose.helpers.ekf_sym_pyx" @@ -41,10 +41,10 @@ END: Cython Metadata */ #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif -#define CYTHON_ABI "3_0_5" __PYX_EXTRA_ABI_MODULE_NAME +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030005F0 +#define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -258,7 +258,7 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif -#elif defined(PY_NOGIL) +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 @@ -602,18 +602,19 @@ class __Pyx_FakeReference { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; // borrowed - #endif + PyObject *version_info; PyObject *py_minor_version = NULL; + #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; // we don't yet need to distinguish between versions > 11 + minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; @@ -634,7 +635,6 @@ class __Pyx_FakeReference { Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); - Py_XDECREF(py_minor_version); if (type) { PyErr_Restore(type, value, traceback); } @@ -667,7 +667,7 @@ class __Pyx_FakeReference { PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 @@ -962,7 +962,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ @@ -1380,7 +1380,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 + #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) @@ -1500,7 +1500,7 @@ static const char *__pyx_filename; #if !defined(CYTHON_CCOMPLEX) #if defined(__cplusplus) #define CYTHON_CCOMPLEX 1 - #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__)) + #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER)) #define CYTHON_CCOMPLEX 1 #else #define CYTHON_CCOMPLEX 0 @@ -2220,8 +2220,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op - #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL @@ -2233,12 +2233,13 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 - static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs - #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS @@ -3007,22 +3008,22 @@ static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_5 -#define __PYX_HAVE_RT_ImportType_proto_3_0_5 +#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 +#define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_5(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_5(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_5 { - __Pyx_ImportType_CheckSize_Error_3_0_5 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_5 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_5 = 2 +enum __Pyx_ImportType_CheckSize_3_0_8 { + __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, + __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; -static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_5 check_size); +static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* FetchSharedCythonModule.proto */ @@ -3115,7 +3116,7 @@ typedef struct { #endif void *defaults; int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults + size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -20126,7 +20127,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -20140,7 +20141,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":969 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -20149,16 +20150,16 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":969 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< * * cdef inline object get_array_base(ndarray arr): */ - __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 969, __pyx_L1_error) + __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 970, __pyx_L1_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -20173,7 +20174,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_L0:; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -20188,7 +20189,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -20197,7 +20198,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -20207,7 +20208,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -20218,7 +20219,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -20227,7 +20228,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -20239,7 +20240,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -20254,7 +20255,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -20278,7 +20279,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -20294,16 +20295,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 981, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 982, __pyx_L3_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -20317,7 +20318,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -20327,27 +20328,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 982, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 983, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 983, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 984, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 983, __pyx_L5_except_error) + __PYX_ERR(2, 984, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -20363,7 +20364,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -20386,7 +20387,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -20410,7 +20411,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -20426,16 +20427,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 987, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 988, __pyx_L3_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -20449,7 +20450,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -20459,27 +20460,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 989, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 990, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 989, __pyx_L5_except_error) + __PYX_ERR(2, 990, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -20495,7 +20496,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -20518,7 +20519,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -20542,7 +20543,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -20558,16 +20559,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 994, __pyx_L3_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -20581,7 +20582,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -20591,27 +20592,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 995, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":996 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 996, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 995, __pyx_L5_except_error) + __PYX_ERR(2, 996, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -20627,7 +20628,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -20650,7 +20651,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -20661,7 +20662,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1010 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1011 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -20671,7 +20672,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -20684,7 +20685,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -20695,7 +20696,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1025 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1026 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -20705,7 +20706,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -20718,7 +20719,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -20729,7 +20730,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1036 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -20739,7 +20740,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -20752,7 +20753,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -20763,7 +20764,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1042 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1043 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -20773,7 +20774,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -20786,7 +20787,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -20797,7 +20798,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1049 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1050 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -20805,7 +20806,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -26294,7 +26295,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 408, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 618, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 914, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 984, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -26341,25 +26342,25 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); @@ -26907,33 +26908,33 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_5(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_8(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyTypeObject), #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 809, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 811, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 813, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 815, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 817, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 819, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 821, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 823, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 825, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 827, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 865, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 202, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 225, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 229, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 809, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 811, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 815, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 817, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 819, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 821, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 823, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 825, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 866, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -27154,7 +27155,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_ekf_sym_pyx(PyObject *__pyx_pyinit __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to ekf_sym_pyx pseudovariable */ + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "ekf_sym_pyx" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } @@ -28475,14 +28476,14 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error + if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } - return NULL; // not found (no exception set) + return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 -static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); @@ -28592,7 +28593,7 @@ static int __Pyx_ParseOptionalKeywords( if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); // transfer ownership of value to values + Py_INCREF(value); Py_DECREF(key); #endif key = NULL; @@ -28611,7 +28612,7 @@ static int __Pyx_ParseOptionalKeywords( && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -28643,7 +28644,7 @@ static int __Pyx_ParseOptionalKeywords( if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -29565,7 +29566,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } } #else - if (is_list || PySequence_Check(o)) { + if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif @@ -30449,11 +30450,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje } } #else -#if CYTHON_COMPILING_IN_PYPY - if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) -#else - if (is_list || PySequence_Check(o)) -#endif + if (is_list || !PyMapping_Check(o)) { return PySequence_SetItem(o, i, v); } @@ -31657,38 +31654,38 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif return -1; } -#if !CYTHON_USE_TYPE_SLOTS - if (dictoffset == 0) { - PyErr_Format(PyExc_TypeError, - "extension type '%s.200s': " - "unable to validate whether bases have a __dict__ " - "when CYTHON_USE_TYPE_SLOTS is off " - "(likely because you are building in the limited API). " - "Therefore, all extension types with multiple bases " - "must add 'cdef dict __dict__' in this compilation mode", - type_name); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } -#else - if (dictoffset == 0 && b->tp_dictoffset) + if (dictoffset == 0) { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); - PyErr_Format(PyExc_TypeError, - "extension type '%.200s' has no __dict__ slot, " - "but base type '" __Pyx_FMT_TYPENAME "' has: " - "either add 'cdef dict __dict__' to the extension type " - "or add '__slots__ = [...]' to the base type", - type_name, b_name); - __Pyx_DECREF_TypeName(b_name); + Py_ssize_t b_dictoffset = 0; +#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + b_dictoffset = b->tp_dictoffset; +#else + PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); + if (!py_b_dictoffset) goto dictoffset_return; + b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); + Py_DECREF(py_b_dictoffset); + if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; +#endif + if (b_dictoffset) { + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + } +#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) + dictoffset_return: +#endif #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); + Py_DECREF(b0); #endif - return -1; + return -1; + } } -#endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif @@ -31982,10 +31979,10 @@ bad: #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType_3_0_5 -#define __PYX_HAVE_RT_ImportType_3_0_5 -static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_5 check_size) + #ifndef __PYX_HAVE_RT_ImportType_3_0_8 +#define __PYX_HAVE_RT_ImportType_3_0_8 +static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; @@ -32039,7 +32036,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject *module, const char *module module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_5 && + if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " @@ -32047,7 +32044,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject *module, const char *module module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_5 && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -33506,7 +33503,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); diff --git a/rednose/helpers/ekf_sym_pyx.so b/rednose/helpers/ekf_sym_pyx.so index 87f285da2..cd94da6f3 100755 Binary files a/rednose/helpers/ekf_sym_pyx.so and b/rednose/helpers/ekf_sym_pyx.so differ diff --git a/rednose/helpers/kalmanfilter.py b/rednose/helpers/kalmanfilter.py index d541faa34..fc9fd2bf3 100644 --- a/rednose/helpers/kalmanfilter.py +++ b/rednose/helpers/kalmanfilter.py @@ -1,4 +1,4 @@ -from typing import Any, Dict +from typing import Any import numpy as np @@ -8,10 +8,10 @@ class KalmanFilter: initial_x = np.zeros((0, 0)) initial_P_diag = np.zeros((0, 0)) Q = np.zeros((0, 0)) - obs_noise: Dict[int, Any] = {} + obs_noise: dict[int, Any] = {} # Should be initialized when initializating a KalmanFilter implementation - filter = None # noqa: A003 + filter = None @property def x(self): diff --git a/scripts/stop_updater.sh b/scripts/stop_updater.sh index 4243d30e9..7f8219182 100755 --- a/scripts/stop_updater.sh +++ b/scripts/stop_updater.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh # Stop updater -pkill -2 -f selfdrive.updated +pkill -2 -f selfdrive.updated.updated # Remove pending update rm -f /data/safe_staging/finalized/.overlay_consistent diff --git a/selfdrive/athena/athenad.py b/selfdrive/athena/athenad.py index 833bf841f..9f901498b 100755 --- a/selfdrive/athena/athenad.py +++ b/selfdrive/athena/athenad.py @@ -19,7 +19,8 @@ from dataclasses import asdict, dataclass, replace from datetime import datetime from functools import partial from queue import Queue -from typing import Callable, Dict, List, Optional, Set, Union, cast +from typing import cast +from collections.abc import Callable import requests from jsonrpc import JSONRPCResponseManager, dispatcher @@ -55,17 +56,17 @@ WS_FRAME_SIZE = 4096 NetworkType = log.DeviceState.NetworkType -UploadFileDict = Dict[str, Union[str, int, float, bool]] -UploadItemDict = Dict[str, Union[str, bool, int, float, Dict[str, str]]] +UploadFileDict = dict[str, str | int | float | bool] +UploadItemDict = dict[str, str | bool | int | float | dict[str, str]] -UploadFilesToUrlResponse = Dict[str, Union[int, List[UploadItemDict], List[str]]] +UploadFilesToUrlResponse = dict[str, int | list[UploadItemDict] | list[str]] @dataclass class UploadFile: fn: str url: str - headers: Dict[str, str] + headers: dict[str, str] allow_cellular: bool @classmethod @@ -77,9 +78,9 @@ class UploadFile: class UploadItem: path: str url: str - headers: Dict[str, str] + headers: dict[str, str] created_at: int - id: Optional[str] + id: str | None retry_count: int = 0 current: bool = False progress: float = 0 @@ -97,9 +98,9 @@ send_queue: Queue[str] = queue.Queue() upload_queue: Queue[UploadItem] = queue.Queue() low_priority_send_queue: Queue[str] = queue.Queue() log_recv_queue: Queue[str] = queue.Queue() -cancelled_uploads: Set[str] = set() +cancelled_uploads: set[str] = set() -cur_upload_items: Dict[int, Optional[UploadItem]] = {} +cur_upload_items: dict[int, UploadItem | None] = {} def strip_bz2_extension(fn: str) -> str: @@ -127,14 +128,14 @@ class UploadQueueCache: @staticmethod def cache(upload_queue: Queue[UploadItem]) -> None: try: - queue: List[Optional[UploadItem]] = list(upload_queue.queue) + queue: list[UploadItem | None] = list(upload_queue.queue) items = [asdict(i) for i in queue if i is not None and (i.id not in cancelled_uploads)] Params().put("AthenadUploadQueue", json.dumps(items)) except Exception: cloudlog.exception("athena.UploadQueueCache.cache.exception") -def handle_long_poll(ws: WebSocket, exit_event: Optional[threading.Event]) -> None: +def handle_long_poll(ws: WebSocket, exit_event: threading.Event | None) -> None: end_event = threading.Event() threads = [ @@ -206,13 +207,17 @@ def retry_upload(tid: int, end_event: threading.Event, increase_count: bool = Tr break -def cb(sm, item, tid, sz: int, cur: int) -> None: +def cb(sm, item, tid, end_event: threading.Event, sz: int, cur: int) -> None: # Abort transfer if connection changed to metered after starting upload + # or if athenad is shutting down to re-connect the websocket sm.update(0) metered = sm['deviceState'].networkMetered if metered and (not item.allow_cellular): raise AbortTransferException + if end_event.is_set(): + raise AbortTransferException + cur_upload_items[tid] = replace(item, progress=cur / sz if sz else 1) @@ -252,7 +257,7 @@ def upload_handler(end_event: threading.Event) -> None: sz = -1 cloudlog.event("athena.upload_handler.upload_start", fn=fn, sz=sz, network_type=network_type, metered=metered, retry_count=item.retry_count) - response = _do_upload(item, partial(cb, sm, item, tid)) + response = _do_upload(item, partial(cb, sm, item, tid, end_event)) if response.status_code not in (200, 201, 401, 403, 412): cloudlog.event("athena.upload_handler.retry", status_code=response.status_code, fn=fn, sz=sz, network_type=network_type, metered=metered) @@ -274,7 +279,7 @@ def upload_handler(end_event: threading.Event) -> None: cloudlog.exception("athena.upload_handler.exception") -def _do_upload(upload_item: UploadItem, callback: Optional[Callable] = None) -> requests.Response: +def _do_upload(upload_item: UploadItem, callback: Callable = None) -> requests.Response: path = upload_item.path compress = False @@ -313,7 +318,7 @@ def getMessage(service: str, timeout: int = 1000) -> dict: @dispatcher.add_method -def getVersion() -> Dict[str, str]: +def getVersion() -> dict[str, str]: return { "version": get_version(), "remote": get_normalized_origin(), @@ -323,7 +328,7 @@ def getVersion() -> Dict[str, str]: @dispatcher.add_method -def setNavDestination(latitude: int = 0, longitude: int = 0, place_name: Optional[str] = None, place_details: Optional[str] = None) -> Dict[str, int]: +def setNavDestination(latitude: int = 0, longitude: int = 0, place_name: str = None, place_details: str = None) -> dict[str, int]: destination = { "latitude": latitude, "longitude": longitude, @@ -335,7 +340,7 @@ def setNavDestination(latitude: int = 0, longitude: int = 0, place_name: Optiona return {"success": 1} -def scan_dir(path: str, prefix: str) -> List[str]: +def scan_dir(path: str, prefix: str) -> list[str]: files = [] # only walk directories that match the prefix # (glob and friends traverse entire dir tree) @@ -355,12 +360,12 @@ def scan_dir(path: str, prefix: str) -> List[str]: return files @dispatcher.add_method -def listDataDirectory(prefix='') -> List[str]: +def listDataDirectory(prefix='') -> list[str]: return scan_dir(Paths.log_root(), prefix) @dispatcher.add_method -def uploadFileToUrl(fn: str, url: str, headers: Dict[str, str]) -> UploadFilesToUrlResponse: +def uploadFileToUrl(fn: str, url: str, headers: dict[str, str]) -> UploadFilesToUrlResponse: # this is because mypy doesn't understand that the decorator doesn't change the return type response: UploadFilesToUrlResponse = uploadFilesToUrls([{ "fn": fn, @@ -371,11 +376,11 @@ def uploadFileToUrl(fn: str, url: str, headers: Dict[str, str]) -> UploadFilesTo @dispatcher.add_method -def uploadFilesToUrls(files_data: List[UploadFileDict]) -> UploadFilesToUrlResponse: +def uploadFilesToUrls(files_data: list[UploadFileDict]) -> UploadFilesToUrlResponse: files = map(UploadFile.from_dict, files_data) - items: List[UploadItemDict] = [] - failed: List[str] = [] + items: list[UploadItemDict] = [] + failed: list[str] = [] for file in files: if len(file.fn) == 0 or file.fn[0] == '/' or '..' in file.fn or len(file.url) == 0: failed.append(file.fn) @@ -414,13 +419,13 @@ def uploadFilesToUrls(files_data: List[UploadFileDict]) -> UploadFilesToUrlRespo @dispatcher.add_method -def listUploadQueue() -> List[UploadItemDict]: +def listUploadQueue() -> list[UploadItemDict]: items = list(upload_queue.queue) + list(cur_upload_items.values()) return [asdict(i) for i in items if (i is not None) and (i.id not in cancelled_uploads)] @dispatcher.add_method -def cancelUpload(upload_id: Union[str, List[str]]) -> Dict[str, Union[int, str]]: +def cancelUpload(upload_id: str | list[str]) -> dict[str, int | str]: if not isinstance(upload_id, list): upload_id = [upload_id] @@ -433,7 +438,7 @@ def cancelUpload(upload_id: Union[str, List[str]]) -> Dict[str, Union[int, str]] return {"success": 1} @dispatcher.add_method -def setRouteViewed(route: str) -> Dict[str, Union[int, str]]: +def setRouteViewed(route: str) -> dict[str, int | str]: # maintain a list of the last 10 routes viewed in connect params = Params() @@ -448,7 +453,7 @@ def setRouteViewed(route: str) -> Dict[str, Union[int, str]]: return {"success": 1} -def startLocalProxy(global_end_event: threading.Event, remote_ws_uri: str, local_port: int) -> Dict[str, int]: +def startLocalProxy(global_end_event: threading.Event, remote_ws_uri: str, local_port: int) -> dict[str, int]: try: if local_port not in LOCAL_PORT_WHITELIST: raise Exception("Requested local port not whitelisted") @@ -482,7 +487,7 @@ def startLocalProxy(global_end_event: threading.Event, remote_ws_uri: str, local @dispatcher.add_method -def getPublicKey() -> Optional[str]: +def getPublicKey() -> str | None: if not os.path.isfile(Paths.persist_root() + '/comma/id_rsa.pub'): return None @@ -522,7 +527,7 @@ def getNetworks(): @dispatcher.add_method -def takeSnapshot() -> Optional[Union[str, Dict[str, str]]]: +def takeSnapshot() -> str | dict[str, str] | None: from openpilot.system.camerad.snapshot.snapshot import jpeg_write, snapshot ret = snapshot() if ret is not None: @@ -539,7 +544,7 @@ def takeSnapshot() -> Optional[Union[str, Dict[str, str]]]: raise Exception("not available while camerad is started") -def get_logs_to_send_sorted() -> List[str]: +def get_logs_to_send_sorted() -> list[str]: # TODO: scan once then use inotify to detect file creation/deletion curr_time = int(time.time()) logs = [] @@ -746,6 +751,9 @@ def ws_manage(ws: WebSocket, end_event: threading.Event) -> None: onroad_prev = onroad if sock is not None: + # While not sending data, onroad, we can expect to time out in 7 + (7 * 2) = 21s + # offroad, we can expect to time out in 30 + (10 * 3) = 60s + # FIXME: TCP_USER_TIMEOUT is effectively 2x for some reason (32s), so it's mostly unused sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_USER_TIMEOUT, 16000 if onroad else 0) sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 7 if onroad else 30) sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 7 if onroad else 10) @@ -759,7 +767,7 @@ def backoff(retries: int) -> int: return random.randrange(0, min(128, int(2 ** retries))) -def main(exit_event: Optional[threading.Event] = None): +def main(exit_event: threading.Event = None): try: set_core_affinity([0, 1, 2, 3]) except Exception: diff --git a/selfdrive/athena/registration.py b/selfdrive/athena/registration.py index 96d4fc029..736462ac9 100755 --- a/selfdrive/athena/registration.py +++ b/selfdrive/athena/registration.py @@ -3,14 +3,13 @@ import time import json import jwt from pathlib import Path -from typing import Optional from datetime import datetime, timedelta from openpilot.common.api import api_get from openpilot.common.params import Params from openpilot.common.spinner import Spinner -from openpilot.selfdrive.controls.lib.alertmanager import set_offroad_alert -from openpilot.system.hardware import HARDWARE, PC +#from openpilot.selfdrive.controls.lib.alertmanager import set_offroad_alert +from openpilot.system.hardware import HARDWARE #, PC from openpilot.system.hardware.hw import Paths from openpilot.common.swaglog import cloudlog @@ -23,12 +22,12 @@ def is_registered_device() -> bool: return dongle not in (None, UNREGISTERED_DONGLE_ID) -def register(show_spinner=False) -> Optional[str]: +def register(show_spinner=False) -> str | None: params = Params() IMEI = params.get("IMEI", encoding='utf8') HardwareSerial = params.get("HardwareSerial", encoding='utf8') - dongle_id: Optional[str] = params.get("DongleId", encoding='utf8') + dongle_id: str | None = params.get("DongleId", encoding='utf8') needs_registration = None in (IMEI, HardwareSerial, dongle_id) pubkey = Path(Paths.persist_root()+"/comma/id_rsa.pub") @@ -48,8 +47,8 @@ def register(show_spinner=False) -> Optional[str]: # Block until we get the imei serial = HARDWARE.get_serial() start_time = time.monotonic() - imei1: Optional[str] = None - imei2: Optional[str] = None + imei1: str | None = None + imei2: str | None = None while imei1 is None and imei2 is None: try: imei1, imei2 = HARDWARE.get_imei(0), HARDWARE.get_imei(1) diff --git a/selfdrive/boardd/boardd b/selfdrive/boardd/boardd index b9d6e28a3..af09f6ab6 100755 Binary files a/selfdrive/boardd/boardd and b/selfdrive/boardd/boardd differ diff --git a/selfdrive/boardd/boardd_api_impl.cpp b/selfdrive/boardd/boardd_api_impl.cpp index daac71af2..9022a9d32 100644 --- a/selfdrive/boardd/boardd_api_impl.cpp +++ b/selfdrive/boardd/boardd_api_impl.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.5 */ +/* Generated by Cython 3.0.8 */ /* BEGIN: Cython Metadata { @@ -13,7 +13,7 @@ "language": "c++", "name": "selfdrive.boardd.boardd_api_impl", "sources": [ - "/data/openpilot/selfdrive/boardd/boardd_api_impl.pyx" + "/data/dp-private/selfdrive/boardd/boardd_api_impl.pyx" ] }, "module_name": "selfdrive.boardd.boardd_api_impl" @@ -44,10 +44,10 @@ END: Cython Metadata */ #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif -#define CYTHON_ABI "3_0_5" __PYX_EXTRA_ABI_MODULE_NAME +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030005F0 +#define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -261,7 +261,7 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif -#elif defined(PY_NOGIL) +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 @@ -605,18 +605,19 @@ class __Pyx_FakeReference { PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; // borrowed - #endif + PyObject *version_info; PyObject *py_minor_version = NULL; + #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; // we don't yet need to distinguish between versions > 11 + minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; @@ -637,7 +638,6 @@ class __Pyx_FakeReference { Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); - Py_XDECREF(py_minor_version); if (type) { PyErr_Restore(type, value, traceback); } @@ -670,7 +670,7 @@ class __Pyx_FakeReference { PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 @@ -965,7 +965,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ @@ -1371,7 +1371,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 + #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) @@ -1613,8 +1613,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op - #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL @@ -1626,12 +1626,13 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 - static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs - #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS @@ -1797,7 +1798,7 @@ typedef struct { #endif void *defaults; int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults + size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -3328,7 +3329,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_boardd_api_impl(PyObject *__pyx_py __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to boardd_api_impl pseudovariable */ + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "boardd_api_impl" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error) pystate_addmodule_run = 1; } @@ -3708,14 +3709,14 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error + if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } - return NULL; // not found (no exception set) + return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 -static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); @@ -3799,7 +3800,7 @@ static int __Pyx_ParseOptionalKeywords( if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); // transfer ownership of value to values + Py_INCREF(value); Py_DECREF(key); #endif key = NULL; @@ -3818,7 +3819,7 @@ static int __Pyx_ParseOptionalKeywords( && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -3850,7 +3851,7 @@ static int __Pyx_ParseOptionalKeywords( if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -4018,7 +4019,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } } #else - if (is_list || PySequence_Check(o)) { + if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif @@ -5714,7 +5715,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); diff --git a/selfdrive/boardd/boardd_api_impl.so b/selfdrive/boardd/boardd_api_impl.so index 477a3f869..e96534b91 100755 Binary files a/selfdrive/boardd/boardd_api_impl.so and b/selfdrive/boardd/boardd_api_impl.so differ diff --git a/selfdrive/boardd/pandad.py b/selfdrive/boardd/pandad.py index 672678778..988d1a240 100755 --- a/selfdrive/boardd/pandad.py +++ b/selfdrive/boardd/pandad.py @@ -4,7 +4,7 @@ import os import usb1 import time import subprocess -from typing import List, NoReturn +from typing import NoReturn from functools import cmp_to_key from panda import Panda, PandaDFU, PandaProtocolMismatch, FW_PATH @@ -93,6 +93,11 @@ def main() -> NoReturn: cloudlog.event("pandad.flash_and_connect", count=count) params.remove("PandaSignatures") + # TODO: remove this in the next AGNOS + # wait until USB is up before counting + if time.monotonic() < 25.: + no_internal_panda_count = 0 + # Handle missing internal panda if no_internal_panda_count > 0: if no_internal_panda_count == 3: @@ -119,7 +124,7 @@ def main() -> NoReturn: cloudlog.info(f"{len(panda_serials)} panda(s) found, connecting - {panda_serials}") # Flash pandas - pandas: List[Panda] = [] + pandas: list[Panda] = [] for serial in panda_serials: pandas.append(flash_panda(serial)) diff --git a/selfdrive/boardd/tests/test_boardd_loopback.py b/selfdrive/boardd/tests/test_boardd_loopback.py index dfce0e371..148ce9a25 100755 --- a/selfdrive/boardd/tests/test_boardd_loopback.py +++ b/selfdrive/boardd/tests/test_boardd_loopback.py @@ -32,7 +32,7 @@ class TestBoardd(unittest.TestCase): with Timeout(90, "boardd didn't start"): sm = messaging.SubMaster(['pandaStates']) - while sm.rcv_frame['pandaStates'] < 1 or len(sm['pandaStates']) == 0 or \ + while sm.recv_frame['pandaStates'] < 1 or len(sm['pandaStates']) == 0 or \ any(ps.pandaType == log.PandaState.PandaType.unknown for ps in sm['pandaStates']): sm.update(1000) diff --git a/selfdrive/car/__init__.py b/selfdrive/car/__init__.py index c90ae50ab..c7af2da68 100644 --- a/selfdrive/car/__init__.py +++ b/selfdrive/car/__init__.py @@ -1,11 +1,15 @@ # functions common among cars -from collections import namedtuple -from typing import Dict, List, Optional +from collections import defaultdict, namedtuple +from dataclasses import dataclass +from enum import IntFlag, ReprEnum +from dataclasses import replace import capnp from cereal import car from openpilot.common.numpy_fast import clip, interp +from openpilot.common.utils import Freezable +from openpilot.selfdrive.car.docs_definitions import CarInfo # kg of standard extra cargo to count for drive, gas, etc... @@ -24,9 +28,9 @@ def apply_hysteresis(val: float, val_steady: float, hyst_gap: float) -> float: return val_steady -def create_button_events(cur_btn: int, prev_btn: int, buttons_dict: Dict[int, capnp.lib.capnp._EnumModule], - unpressed_btn: int = 0) -> List[capnp.lib.capnp._DynamicStructBuilder]: - events: List[capnp.lib.capnp._DynamicStructBuilder] = [] +def create_button_events(cur_btn: int, prev_btn: int, buttons_dict: dict[int, capnp.lib.capnp._EnumModule], + unpressed_btn: int = 0) -> list[capnp.lib.capnp._DynamicStructBuilder]: + events: list[capnp.lib.capnp._DynamicStructBuilder] = [] if cur_btn == prev_btn: return events @@ -73,7 +77,10 @@ def scale_tire_stiffness(mass, wheelbase, center_to_front, tire_stiffness_factor return tire_stiffness_front, tire_stiffness_rear -def dbc_dict(pt_dbc, radar_dbc, chassis_dbc=None, body_dbc=None) -> Dict[str, str]: +DbcDict = dict[str, str] + + +def dbc_dict(pt_dbc, radar_dbc, chassis_dbc=None, body_dbc=None) -> DbcDict: return {'pt': pt_dbc, 'radar': radar_dbc, 'chassis': chassis_dbc, 'body': body_dbc} @@ -208,7 +215,7 @@ def get_safety_config(safety_model, safety_param = None): class CanBusBase: offset: int - def __init__(self, CP, fingerprint: Optional[Dict[int, Dict[int, int]]]) -> None: + def __init__(self, CP, fingerprint: dict[int, dict[int, int]] | None) -> None: if CP is None: assert fingerprint is not None num = max([k for k, v in fingerprint.items() if len(v)], default=0) // 4 + 1 @@ -236,3 +243,78 @@ class CanSignalRateCalculator: self.previous_value = current_value return self.rate + + +CarInfos = CarInfo | list[CarInfo] | None + + +@dataclass(frozen=True, kw_only=True) +class CarSpecs: + mass: float # kg, curb weight + wheelbase: float # meters + steerRatio: float + centerToFrontRatio: float = 0.5 + minSteerSpeed: float = 0.0 # m/s + minEnableSpeed: float = -1.0 # m/s + tireStiffnessFactor: float = 1.0 + + def override(self, **kwargs): + return replace(self, **kwargs) + + +@dataclass(order=True) +class PlatformConfig(Freezable): + platform_str: str + car_info: CarInfos + specs: CarSpecs + + dbc_dict: DbcDict + + flags: int = 0 + + def __hash__(self) -> int: + return hash(self.platform_str) + + def override(self, **kwargs): + return replace(self, **kwargs) + + def init(self): + pass + + def __post_init__(self): + self.init() + self.freeze() + + +class Platforms(str, ReprEnum): + config: PlatformConfig + + def __new__(cls, platform_config: PlatformConfig): + member = str.__new__(cls, platform_config.platform_str) + member.config = platform_config + member._value_ = platform_config.platform_str + return member + + @classmethod + def create_dbc_map(cls) -> dict[str, DbcDict]: + return {p: p.config.dbc_dict for p in cls} + + @classmethod + def create_carinfo_map(cls) -> dict[str, CarInfos]: + return {p: p.config.car_info for p in cls} + + @classmethod + def with_flags(cls, flags: IntFlag) -> set['Platforms']: + return {p for p in cls if p.config.flags & flags} + + @classmethod + def print_debug(cls, flags): + platforms_with_flag = defaultdict(list) + for flag in flags: + for platform in cls: + if platform.config.flags & flag: + assert flag.name is not None + platforms_with_flag[flag.name].append(platform) + + for flag, platforms in platforms_with_flag.items(): + print(f"{flag:32s}: {', '.join(p.name for p in platforms)}") diff --git a/selfdrive/car/body/carcontroller.py b/selfdrive/car/body/carcontroller.py index 1dad8e796..db34320ca 100644 --- a/selfdrive/car/body/carcontroller.py +++ b/selfdrive/car/body/carcontroller.py @@ -1,10 +1,10 @@ import numpy as np -from openpilot.common.params import Params from openpilot.common.realtime import DT_CTRL from opendbc.can.packer import CANPacker from openpilot.selfdrive.car.body import bodycan from openpilot.selfdrive.car.body.values import SPEED_FROM_RPM +from openpilot.selfdrive.car.interfaces import CarControllerBase from openpilot.selfdrive.controls.lib.pid import PIDController @@ -15,23 +15,18 @@ MAX_POS_INTEGRATOR = 0.2 # meters MAX_TURN_INTEGRATOR = 0.1 # meters -class CarController: +class CarController(CarControllerBase): def __init__(self, dbc_name, CP, VM): self.frame = 0 self.packer = CANPacker(dbc_name) - # Speed, balance and turn PIDs - self.speed_pid = PIDController(0.115, k_i=0.23, rate=1/DT_CTRL) - self.balance_pid = PIDController(1300, k_i=0, k_d=280, rate=1/DT_CTRL) + # PIDs self.turn_pid = PIDController(110, k_i=11.5, rate=1/DT_CTRL) self.wheeled_speed_pid = PIDController(110, k_i=11.5, rate=1/DT_CTRL) self.torque_r_filtered = 0. self.torque_l_filtered = 0. - params = Params() - self.wheeled_body = params.get("WheeledBody") - @staticmethod def deadband_filter(torque, deadband): if torque > 0: @@ -55,17 +50,7 @@ class CarController: speed_measured = SPEED_FROM_RPM * (CS.out.wheelSpeeds.fl + CS.out.wheelSpeeds.fr) / 2. speed_error = speed_desired - speed_measured - if self.wheeled_body is None: - freeze_integrator = ((speed_error < 0 and self.speed_pid.error_integral <= -MAX_POS_INTEGRATOR) or - (speed_error > 0 and self.speed_pid.error_integral >= MAX_POS_INTEGRATOR)) - angle_setpoint = self.speed_pid.update(speed_error, freeze_integrator=freeze_integrator) - - # Clip angle error, this is enough to get up from stands - angle_error = np.clip((-CC.orientationNED[1]) - angle_setpoint, -MAX_ANGLE_ERROR, MAX_ANGLE_ERROR) - angle_error_rate = np.clip(-CC.angularVelocity[1], -1., 1.) - torque = self.balance_pid.update(angle_error, error_rate=angle_error_rate) - else: - torque = self.wheeled_speed_pid.update(speed_error, freeze_integrator=False) + torque = self.wheeled_speed_pid.update(speed_error, freeze_integrator=False) speed_diff_measured = SPEED_FROM_RPM * (CS.out.wheelSpeeds.fl - CS.out.wheelSpeeds.fr) turn_error = speed_diff_measured - speed_diff_desired diff --git a/selfdrive/car/body/interface.py b/selfdrive/car/body/interface.py index 12a2d5f30..4d72d2f60 100644 --- a/selfdrive/car/body/interface.py +++ b/selfdrive/car/body/interface.py @@ -14,14 +14,10 @@ class CarInterface(CarInterfaceBase): ret.minSteerSpeed = -math.inf ret.maxLateralAccel = math.inf # TODO: set to a reasonable value - ret.steerRatio = 0.5 ret.steerLimitTimer = 1.0 ret.steerActuatorDelay = 0. - ret.mass = 9 - ret.wheelbase = 0.406 ret.wheelSpeedFactor = SPEED_FROM_RPM - ret.centerToFront = ret.wheelbase * 0.44 ret.radarUnavailable = True ret.openpilotLongitudinalControl = True diff --git a/selfdrive/car/body/values.py b/selfdrive/car/body/values.py index 33119bf0f..82b00ee47 100644 --- a/selfdrive/car/body/values.py +++ b/selfdrive/car/body/values.py @@ -1,8 +1,5 @@ -from enum import StrEnum -from typing import Dict - from cereal import car -from openpilot.selfdrive.car import dbc_dict +from openpilot.selfdrive.car import CarSpecs, PlatformConfig, Platforms, dbc_dict from openpilot.selfdrive.car.docs_definitions import CarInfo from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries @@ -22,13 +19,13 @@ class CarControllerParams: pass -class CAR(StrEnum): - BODY = "COMMA BODY" - - -CAR_INFO: Dict[str, CarInfo] = { - CAR.BODY: CarInfo("comma body", package="All"), -} +class CAR(Platforms): + BODY = PlatformConfig( + "COMMA BODY", + CarInfo("comma body", package="All"), + CarSpecs(mass=9, wheelbase=0.406, steerRatio=0.5, centerToFrontRatio=0.44), + dbc_dict('comma_body', None), + ) FW_QUERY_CONFIG = FwQueryConfig( @@ -41,7 +38,5 @@ FW_QUERY_CONFIG = FwQueryConfig( ], ) - -DBC = { - CAR.BODY: dbc_dict('comma_body', None), -} +CAR_INFO = CAR.create_carinfo_map() +DBC = CAR.create_dbc_map() diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 25db2a47a..ba397b95d 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -1,21 +1,22 @@ import os import time -from typing import Callable, Dict, List, Optional, Tuple +from collections.abc import Callable from cereal import car from openpilot.common.params import Params from openpilot.common.basedir import BASEDIR -from openpilot.system.version import is_comma_remote, is_tested_branch +from openpilot.selfdrive.car.values import PLATFORMS +#from openpilot.system.version import is_comma_remote, is_tested_branch from openpilot.selfdrive.car.interfaces import get_interface_attr from openpilot.selfdrive.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars from openpilot.selfdrive.car.vin import get_vin, is_valid_vin, VIN_UNKNOWN from openpilot.selfdrive.car.fw_versions import get_fw_versions_ordered, get_present_ecus, match_fw_to_car, set_obd_multiplexing +from openpilot.selfdrive.car.mock.values import CAR as MOCK from openpilot.common.swaglog import cloudlog import cereal.messaging as messaging from openpilot.selfdrive.car import gen_empty_fingerprint import threading import requests -import time import openpilot.selfdrive.sentry as sentry FRAME_FINGERPRINT = 100 # 1s @@ -66,7 +67,7 @@ def load_interfaces(brand_names): return ret -def _get_interface_names() -> Dict[str, List[str]]: +def _get_interface_names() -> dict[str, list[str]]: # returns a dict of brand name and its respective models brand_names = {} for brand_name, brand_models in get_interface_attr("CAR").items(): @@ -80,7 +81,7 @@ interface_names = _get_interface_names() interfaces = load_interfaces(interface_names) -def can_fingerprint(next_can: Callable) -> Tuple[Optional[str], Dict[int, dict]]: +def can_fingerprint(next_can: Callable) -> tuple[str | None, dict[int, dict]]: finger = gen_empty_fingerprint() candidate_cars = {i: all_legacy_fingerprint_cars() for i in [0, 1]} # attempt fingerprint on both bus 0 and 1 frame = 0 @@ -146,9 +147,10 @@ def fingerprint(logcan, sendcan, num_pandas): cached = True else: cloudlog.warning("Getting VIN & FW versions") - # enable OBD multiplexing for Vin query, also allows time for sendcan subscriber to connect + # enable OBD multiplexing for VIN query + # NOTE: this takes ~0.1s and is relied on to allow sendcan subscriber to connect in time set_obd_multiplexing(params, True) - # Vin query only reliably works through OBDII + # VIN query only reliably works through OBDII vin_rx_addr, vin_rx_bus, vin = get_vin(logcan, sendcan, (0, 1)) ecu_rx_addrs = get_present_ecus(logcan, sendcan, num_pandas=num_pandas) car_fw = get_fw_versions_ordered(logcan, sendcan, ecu_rx_addrs, num_pandas=num_pandas) @@ -166,7 +168,7 @@ def fingerprint(logcan, sendcan, num_pandas): cloudlog.warning("VIN %s", vin) params.put("CarVin", vin) - # disable OBD multiplexing for potential ECU knockouts + # disable OBD multiplexing for CAN fingerprinting and potential ECU knockouts set_obd_multiplexing(params, False) params.put_bool("FirmwareQueryDone", True) @@ -193,7 +195,10 @@ def fingerprint(logcan, sendcan, num_pandas): cloudlog.event("fingerprinted", car_fingerprint=car_fingerprint, source=source, fuzzy=not exact_match, cached=cached, fw_count=len(car_fw), ecu_responses=list(ecu_rx_addrs), vin_rx_addr=vin_rx_addr, vin_rx_bus=vin_rx_bus, fingerprints=repr(finger), fw_query_time=fw_query_time, error=True) - return car_fingerprint, finger, vin, car_fw, source, exact_match + + car_platform = PLATFORMS.get(car_fingerprint, MOCK.MOCK) + + return car_platform, finger, vin, car_fw, source, exact_match #dp def is_connected_to_internet(timeout=5): @@ -248,14 +253,14 @@ def get_car(logcan, sendcan, experimental_long_allowed, num_pandas=1): except KeyError: return None, None -def write_car_param(fingerprint="mock"): +def write_car_param(platform=MOCK.MOCK): params = Params() - CarInterface, _, _ = interfaces[fingerprint] - CP = CarInterface.get_non_essential_params(fingerprint) + CarInterface, _, _ = interfaces[platform] + CP = CarInterface.get_non_essential_params(platform) params.put("CarParams", CP.to_bytes()) def get_demo_car_params(): - fingerprint="mock" - CarInterface, _, _ = interfaces[fingerprint] - CP = CarInterface.get_non_essential_params(fingerprint) + platform = MOCK.MOCK + CarInterface, _, _ = interfaces[platform] + CP = CarInterface.get_non_essential_params(platform) return CP diff --git a/selfdrive/car/card.py b/selfdrive/car/card.py new file mode 100755 index 000000000..4eae9a0a7 --- /dev/null +++ b/selfdrive/car/card.py @@ -0,0 +1,145 @@ +#!/usr/bin/env python3 +import os +import time + +import cereal.messaging as messaging + +from cereal import car + +from panda import ALTERNATIVE_EXPERIENCE + +from openpilot.common.params import Params +from openpilot.common.realtime import DT_CTRL + +from openpilot.selfdrive.boardd.boardd import can_list_to_can_capnp +from openpilot.selfdrive.car.car_helpers import get_car, get_one_can +from openpilot.selfdrive.car.interfaces import CarInterfaceBase + + +REPLAY = "REPLAY" in os.environ + + +class CarD: + CI: CarInterfaceBase + CS: car.CarState + + def __init__(self, CI=None): + self.can_sock = messaging.sub_sock('can', timeout=20) + self.sm = messaging.SubMaster(['pandaStates']) + self.pm = messaging.PubMaster(['sendcan', 'carState', 'carParams', 'carOutput']) + + self.can_rcv_timeout_counter = 0 # conseuctive timeout count + self.can_rcv_cum_timeout_counter = 0 # cumulative timeout count + + self.CC_prev = car.CarState.new_message() + + self.last_actuators = None + + self.params = Params() + + if CI is None: + # wait for one pandaState and one CAN packet + print("Waiting for CAN messages...") + get_one_can(self.can_sock) + + num_pandas = len(messaging.recv_one_retry(self.sm.sock['pandaStates']).pandaStates) + experimental_long_allowed = self.params.get_bool("ExperimentalLongitudinalEnabled") + self.CI, self.CP = get_car(self.can_sock, self.pm.sock['sendcan'], experimental_long_allowed, num_pandas) + else: + self.CI, self.CP = CI, CI.CP + + # set alternative experiences from parameters + disengage_on_accelerator = self.params.get_bool("DisengageOnAccelerator") + _dp_alka = self.params.get_bool("dp_alka") + self.CP.alternativeExperience = 0 + if not disengage_on_accelerator: + self.CP.alternativeExperience |= ALTERNATIVE_EXPERIENCE.DISABLE_DISENGAGE_ON_GAS + + if _dp_alka: + self.CP.alternativeExperience |= ALTERNATIVE_EXPERIENCE.ALKA + + car_recognized = self.CP.carName != 'mock' + openpilot_enabled_toggle = self.params.get_bool("OpenpilotEnabledToggle") + + controller_available = self.CI.CC is not None and openpilot_enabled_toggle and not self.CP.dashcamOnly + + self.CP.passive = not car_recognized or not controller_available or self.CP.dashcamOnly + if self.CP.passive: + safety_config = car.CarParams.SafetyConfig.new_message() + safety_config.safetyModel = car.CarParams.SafetyModel.noOutput + self.CP.safetyConfigs = [safety_config] + + # Write previous route's CarParams + prev_cp = self.params.get("CarParamsPersistent") + if prev_cp is not None: + self.params.put("CarParamsPrevRoute", prev_cp) + + # Write CarParams for radard + cp_bytes = self.CP.to_bytes() + self.params.put("CarParams", cp_bytes) + self.params.put_nonblocking("CarParamsCache", cp_bytes) + self.params.put_nonblocking("CarParamsPersistent", cp_bytes) + + def initialize(self): + """Initialize CarInterface, once controls are ready""" + self.CI.init(self.CP, self.can_sock, self.pm.sock['sendcan']) + + def state_update(self): + """carState update loop, driven by can""" + + # Update carState from CAN + can_strs = messaging.drain_sock_raw(self.can_sock, wait_for_one=True) + self.CS = self.CI.update(self.CC_prev, can_strs) + + self.sm.update(0) + + can_rcv_valid = len(can_strs) > 0 + + # Check for CAN timeout + if not can_rcv_valid: + self.can_rcv_timeout_counter += 1 + self.can_rcv_cum_timeout_counter += 1 + else: + self.can_rcv_timeout_counter = 0 + + self.can_rcv_timeout = self.can_rcv_timeout_counter >= 5 + + if can_rcv_valid and REPLAY: + self.can_log_mono_time = messaging.log_from_bytes(can_strs[0]).logMonoTime + + self.state_publish() + + return self.CS + + def state_publish(self): + """carState and carParams publish loop""" + + # carState + cs_send = messaging.new_message('carState') + cs_send.valid = self.CS.canValid + cs_send.carState = self.CS + self.pm.send('carState', cs_send) + + # carParams - logged every 50 seconds (> 1 per segment) + if (self.sm.frame % int(50. / DT_CTRL) == 0): + cp_send = messaging.new_message('carParams') + cp_send.valid = True + cp_send.carParams = self.CP + self.pm.send('carParams', cp_send) + + # publish new carOutput + co_send = messaging.new_message('carOutput') + co_send.valid = True + if self.last_actuators is not None: + co_send.carOutput.actuatorsOutput = self.last_actuators + self.pm.send('carOutput', co_send) + + def controls_update(self, CC: car.CarControl): + """control update loop, driven by carControl""" + + # send car controls over can + now_nanos = self.can_log_mono_time if REPLAY else int(time.monotonic() * 1e9) + self.last_actuators, can_sends = self.CI.apply(CC, now_nanos) + self.pm.send('sendcan', can_list_to_can_capnp(can_sends, msgtype='sendcan', valid=self.CS.canValid)) + + self.CC_prev = CC diff --git a/selfdrive/car/chrysler/carcontroller.py b/selfdrive/car/chrysler/carcontroller.py index 050eb41b1..39248f3f7 100644 --- a/selfdrive/car/chrysler/carcontroller.py +++ b/selfdrive/car/chrysler/carcontroller.py @@ -3,9 +3,10 @@ from openpilot.common.realtime import DT_CTRL from openpilot.selfdrive.car import apply_meas_steer_torque_limits from openpilot.selfdrive.car.chrysler import chryslercan from openpilot.selfdrive.car.chrysler.values import RAM_CARS, CarControllerParams, ChryslerFlags +from openpilot.selfdrive.car.interfaces import CarControllerBase -class CarController: +class CarController(CarControllerBase): def __init__(self, dbc_name, CP, VM): self.CP = CP self.apply_steer_last = 0 diff --git a/selfdrive/car/chrysler/fingerprints.py b/selfdrive/car/chrysler/fingerprints.py index c0b038e8f..3444b4cc5 100644 --- a/selfdrive/car/chrysler/fingerprints.py +++ b/selfdrive/car/chrysler/fingerprints.py @@ -38,6 +38,7 @@ FW_VERSIONS = { b'68227902AF', b'68227902AG', b'68227902AH', + b'68227905AG', b'68360252AC', ], (Ecu.srs, 0x744, None): [ @@ -67,9 +68,11 @@ FW_VERSIONS = { (Ecu.engine, 0x7e0, None): [ b'68267018AO ', b'68267020AJ ', + b'68303534AJ ', b'68340762AD ', b'68340764AD ', b'68352652AE ', + b'68352654AE ', b'68366851AH ', b'68366853AE ', b'68372861AF ', @@ -299,9 +302,11 @@ FW_VERSIONS = { CAR.JEEP_GRAND_CHEROKEE_2019: { (Ecu.combinationMeter, 0x742, None): [ b'68402703AB', + b'68402704AB', b'68402708AB', b'68402971AD', b'68454144AD', + b'68454145AB', b'68454152AB', b'68454156AB', b'68516650AB', @@ -326,6 +331,7 @@ FW_VERSIONS = { (Ecu.eps, 0x75a, None): [ b'68417279AA', b'68417280AA', + b'68417281AA', b'68453431AA', b'68453433AA', b'68453435AA', @@ -336,6 +342,7 @@ FW_VERSIONS = { (Ecu.engine, 0x7e0, None): [ b'05035674AB ', b'68412635AG ', + b'68412660AD ', b'68422860AB', b'68449435AE ', b'68496223AA ', @@ -346,6 +353,7 @@ FW_VERSIONS = { (Ecu.transmission, 0x7e1, None): [ b'05035707AA', b'68419672AC', + b'68419678AB', b'68423905AB', b'68449258AC', b'68495807AA', @@ -396,6 +404,7 @@ FW_VERSIONS = { b'68527383AD', b'68527387AE', b'68527403AC', + b'68546047AF', b'68631938AA', b'68631942AA', ], @@ -607,4 +616,34 @@ FW_VERSIONS = { b'M2421132MB', ], }, + CAR.DODGE_DURANGO: { + (Ecu.combinationMeter, 0x742, None): [ + b'68454261AD', + b'68471535AE', + ], + (Ecu.srs, 0x744, None): [ + b'68355362AB', + b'68492238AD', + ], + (Ecu.abs, 0x747, None): [ + b'68408639AD', + b'68499978AB', + ], + (Ecu.fwdRadar, 0x753, None): [ + b'68440581AE', + b'68456722AC', + ], + (Ecu.eps, 0x75a, None): [ + b'68453435AA', + b'68498477AA', + ], + (Ecu.engine, 0x7e0, None): [ + b'05035786AE ', + b'68449476AE ', + ], + (Ecu.transmission, 0x7e1, None): [ + b'05035826AC', + b'68449265AC', + ], + }, } diff --git a/selfdrive/car/chrysler/interface.py b/selfdrive/car/chrysler/interface.py index 10cdd0fd1..eb40bc6f6 100755 --- a/selfdrive/car/chrysler/interface.py +++ b/selfdrive/car/chrysler/interface.py @@ -24,21 +24,16 @@ class CarInterface(CarInterfaceBase): elif candidate in RAM_DT: ret.safetyConfigs[0].safetyParam |= Panda.FLAG_CHRYSLER_RAM_DT - ret.minSteerSpeed = 3.8 # m/s CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) if candidate not in RAM_CARS: # Newer FW versions standard on the following platforms, or flashed by a dealer onto older platforms have a higher minimum steering speed. - new_eps_platform = candidate in (CAR.PACIFICA_2019_HYBRID, CAR.PACIFICA_2020, CAR.JEEP_GRAND_CHEROKEE_2019) + new_eps_platform = candidate in (CAR.PACIFICA_2019_HYBRID, CAR.PACIFICA_2020, CAR.JEEP_GRAND_CHEROKEE_2019, CAR.DODGE_DURANGO) new_eps_firmware = any(fw.ecu == 'eps' and fw.fwVersion[:4] >= b"6841" for fw in car_fw) if new_eps_platform or new_eps_firmware: ret.flags |= ChryslerFlags.HIGHER_MIN_STEERING_SPEED.value # Chrysler - if candidate in (CAR.PACIFICA_2017_HYBRID, CAR.PACIFICA_2018, CAR.PACIFICA_2018_HYBRID, CAR.PACIFICA_2019_HYBRID, CAR.PACIFICA_2020): - ret.mass = 2242. - ret.wheelbase = 3.089 - ret.steerRatio = 16.2 # Pacifica Hybrid 2017 - + if candidate in (CAR.PACIFICA_2017_HYBRID, CAR.PACIFICA_2018, CAR.PACIFICA_2018_HYBRID, CAR.PACIFICA_2019_HYBRID, CAR.PACIFICA_2020, CAR.DODGE_DURANGO): ret.lateralTuning.init('pid') ret.lateralTuning.pid.kpBP, ret.lateralTuning.pid.kiBP = [[9., 20.], [9., 20.]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.15, 0.30], [0.03, 0.05]] @@ -46,9 +41,6 @@ class CarInterface(CarInterfaceBase): # Jeep elif candidate in (CAR.JEEP_GRAND_CHEROKEE, CAR.JEEP_GRAND_CHEROKEE_2019): - ret.mass = 1778 - ret.wheelbase = 2.71 - ret.steerRatio = 16.7 ret.steerActuatorDelay = 0.2 ret.lateralTuning.init('pid') @@ -60,19 +52,12 @@ class CarInterface(CarInterfaceBase): elif candidate == CAR.RAM_1500: ret.steerActuatorDelay = 0.2 ret.wheelbase = 3.88 - ret.steerRatio = 16.3 - ret.mass = 2493. - ret.minSteerSpeed = 14.5 # Older EPS FW allow steer to zero if any(fw.ecu == 'eps' and b"68" < fw.fwVersion[:4] <= b"6831" for fw in car_fw): ret.minSteerSpeed = 0. elif candidate == CAR.RAM_HD: ret.steerActuatorDelay = 0.2 - ret.wheelbase = 3.785 - ret.steerRatio = 15.61 - ret.mass = 3405. - ret.minSteerSpeed = 16 CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning, 1.0, False) else: @@ -80,6 +65,7 @@ class CarInterface(CarInterfaceBase): if ret.flags & ChryslerFlags.HIGHER_MIN_STEERING_SPEED: # TODO: allow these cars to steer down to 13 m/s if already engaged. + # TODO: Durango 2020 may be able to steer to zero once above 38 kph ret.minSteerSpeed = 17.5 # m/s 17 on the way up, 13 on the way down once engaged. ret.centerToFront = ret.wheelbase * 0.44 diff --git a/selfdrive/car/chrysler/values.py b/selfdrive/car/chrysler/values.py index 34e602562..78b22bea4 100644 --- a/selfdrive/car/chrysler/values.py +++ b/selfdrive/car/chrysler/values.py @@ -1,10 +1,9 @@ -from enum import IntFlag, StrEnum +from enum import IntFlag from dataclasses import dataclass, field -from typing import Dict, List, Optional, Union from cereal import car from panda.python import uds -from openpilot.selfdrive.car import dbc_dict +from openpilot.selfdrive.car import CarSpecs, DbcDict, PlatformConfig, Platforms, dbc_dict from openpilot.selfdrive.car.docs_definitions import CarHarness, CarInfo, CarParts from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, p16 @@ -12,24 +11,92 @@ Ecu = car.CarParams.Ecu class ChryslerFlags(IntFlag): + # Detected flags HIGHER_MIN_STEERING_SPEED = 1 +@dataclass +class ChryslerCarInfo(CarInfo): + package: str = "Adaptive Cruise Control (ACC)" + car_parts: CarParts = field(default_factory=CarParts.common([CarHarness.fca])) -class CAR(StrEnum): + +@dataclass +class ChryslerPlatformConfig(PlatformConfig): + dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('chrysler_pacifica_2017_hybrid_generated', 'chrysler_pacifica_2017_hybrid_private_fusion')) + + +@dataclass(frozen=True) +class ChryslerCarSpecs(CarSpecs): + minSteerSpeed: float = 3.8 # m/s + + +class CAR(Platforms): # Chrysler - PACIFICA_2017_HYBRID = "CHRYSLER PACIFICA HYBRID 2017" - PACIFICA_2018_HYBRID = "CHRYSLER PACIFICA HYBRID 2018" - PACIFICA_2019_HYBRID = "CHRYSLER PACIFICA HYBRID 2019" - PACIFICA_2018 = "CHRYSLER PACIFICA 2018" - PACIFICA_2020 = "CHRYSLER PACIFICA 2020" + PACIFICA_2017_HYBRID = ChryslerPlatformConfig( + "CHRYSLER PACIFICA HYBRID 2017", + ChryslerCarInfo("Chrysler Pacifica Hybrid 2017"), + ChryslerCarSpecs(mass=2242., wheelbase=3.089, steerRatio=16.2), + ) + PACIFICA_2018_HYBRID = ChryslerPlatformConfig( + "CHRYSLER PACIFICA HYBRID 2018", + ChryslerCarInfo("Chrysler Pacifica Hybrid 2018"), + PACIFICA_2017_HYBRID.specs, + ) + PACIFICA_2019_HYBRID = ChryslerPlatformConfig( + "CHRYSLER PACIFICA HYBRID 2019", + ChryslerCarInfo("Chrysler Pacifica Hybrid 2019-23"), + PACIFICA_2017_HYBRID.specs, + ) + PACIFICA_2018 = ChryslerPlatformConfig( + "CHRYSLER PACIFICA 2018", + ChryslerCarInfo("Chrysler Pacifica 2017-18"), + PACIFICA_2017_HYBRID.specs, + ) + PACIFICA_2020 = ChryslerPlatformConfig( + "CHRYSLER PACIFICA 2020", + [ + ChryslerCarInfo("Chrysler Pacifica 2019-20"), + ChryslerCarInfo("Chrysler Pacifica 2021-23", package="All"), + ], + PACIFICA_2017_HYBRID.specs, + ) + + # Dodge + DODGE_DURANGO = ChryslerPlatformConfig( + "DODGE DURANGO 2021", + ChryslerCarInfo("Dodge Durango 2020-21"), + PACIFICA_2017_HYBRID.specs, + ) # Jeep - JEEP_GRAND_CHEROKEE = "JEEP GRAND CHEROKEE V6 2018" # includes 2017 Trailhawk - JEEP_GRAND_CHEROKEE_2019 = "JEEP GRAND CHEROKEE 2019" # includes 2020 Trailhawk + JEEP_GRAND_CHEROKEE = ChryslerPlatformConfig( # includes 2017 Trailhawk + "JEEP GRAND CHEROKEE V6 2018", + ChryslerCarInfo("Jeep Grand Cherokee 2016-18", video_link="https://www.youtube.com/watch?v=eLR9o2JkuRk"), + ChryslerCarSpecs(mass=1778., wheelbase=2.71, steerRatio=16.7), + ) + + JEEP_GRAND_CHEROKEE_2019 = ChryslerPlatformConfig( # includes 2020 Trailhawk + "JEEP GRAND CHEROKEE 2019", + ChryslerCarInfo("Jeep Grand Cherokee 2019-21", video_link="https://www.youtube.com/watch?v=jBe4lWnRSu4"), + JEEP_GRAND_CHEROKEE.specs, + ) # Ram - RAM_1500 = "RAM 1500 5TH GEN" - RAM_HD = "RAM HD 5TH GEN" + RAM_1500 = ChryslerPlatformConfig( + "RAM 1500 5TH GEN", + ChryslerCarInfo("Ram 1500 2019-24", car_parts=CarParts.common([CarHarness.ram])), + ChryslerCarSpecs(mass=2493., wheelbase=3.88, steerRatio=16.3, minSteerSpeed=14.5), + dbc_dict('chrysler_ram_dt_generated', None), + ) + RAM_HD = ChryslerPlatformConfig( + "RAM HD 5TH GEN", + [ + ChryslerCarInfo("Ram 2500 2020-24", car_parts=CarParts.common([CarHarness.ram])), + ChryslerCarInfo("Ram 3500 2019-22", car_parts=CarParts.common([CarHarness.ram])), + ], + ChryslerCarSpecs(mass=3405., wheelbase=3.785, steerRatio=15.61, minSteerSpeed=16.), + dbc_dict('chrysler_ram_hd_generated', None), + ) class CarControllerParams: @@ -57,31 +124,6 @@ RAM_HD = {CAR.RAM_HD, } RAM_CARS = RAM_DT | RAM_HD -@dataclass -class ChryslerCarInfo(CarInfo): - package: str = "Adaptive Cruise Control (ACC)" - car_parts: CarParts = field(default_factory=CarParts.common([CarHarness.fca])) - - -CAR_INFO: Dict[str, Optional[Union[ChryslerCarInfo, List[ChryslerCarInfo]]]] = { - CAR.PACIFICA_2017_HYBRID: ChryslerCarInfo("Chrysler Pacifica Hybrid 2017"), - CAR.PACIFICA_2018_HYBRID: ChryslerCarInfo("Chrysler Pacifica Hybrid 2018"), - CAR.PACIFICA_2019_HYBRID: ChryslerCarInfo("Chrysler Pacifica Hybrid 2019-23"), - CAR.PACIFICA_2018: ChryslerCarInfo("Chrysler Pacifica 2017-18"), - CAR.PACIFICA_2020: [ - ChryslerCarInfo("Chrysler Pacifica 2019-20"), - ChryslerCarInfo("Chrysler Pacifica 2021-23", package="All"), - ], - CAR.JEEP_GRAND_CHEROKEE: ChryslerCarInfo("Jeep Grand Cherokee 2016-18", video_link="https://www.youtube.com/watch?v=eLR9o2JkuRk"), - CAR.JEEP_GRAND_CHEROKEE_2019: ChryslerCarInfo("Jeep Grand Cherokee 2019-21", video_link="https://www.youtube.com/watch?v=jBe4lWnRSu4"), - CAR.RAM_1500: ChryslerCarInfo("Ram 1500 2019-24", car_parts=CarParts.common([CarHarness.ram])), - CAR.RAM_HD: [ - ChryslerCarInfo("Ram 2500 2020-24", car_parts=CarParts.common([CarHarness.ram])), - ChryslerCarInfo("Ram 3500 2019-22", car_parts=CarParts.common([CarHarness.ram])), - ], -} - - CHRYSLER_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ p16(0xf132) CHRYSLER_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ @@ -121,15 +163,5 @@ FW_QUERY_CONFIG = FwQueryConfig( ], ) - -DBC = { - CAR.PACIFICA_2017_HYBRID: dbc_dict('chrysler_pacifica_2017_hybrid_generated', 'chrysler_pacifica_2017_hybrid_private_fusion'), - CAR.PACIFICA_2018: dbc_dict('chrysler_pacifica_2017_hybrid_generated', 'chrysler_pacifica_2017_hybrid_private_fusion'), - CAR.PACIFICA_2020: dbc_dict('chrysler_pacifica_2017_hybrid_generated', 'chrysler_pacifica_2017_hybrid_private_fusion'), - CAR.PACIFICA_2018_HYBRID: dbc_dict('chrysler_pacifica_2017_hybrid_generated', 'chrysler_pacifica_2017_hybrid_private_fusion'), - CAR.PACIFICA_2019_HYBRID: dbc_dict('chrysler_pacifica_2017_hybrid_generated', 'chrysler_pacifica_2017_hybrid_private_fusion'), - CAR.JEEP_GRAND_CHEROKEE: dbc_dict('chrysler_pacifica_2017_hybrid_generated', 'chrysler_pacifica_2017_hybrid_private_fusion'), - CAR.JEEP_GRAND_CHEROKEE_2019: dbc_dict('chrysler_pacifica_2017_hybrid_generated', 'chrysler_pacifica_2017_hybrid_private_fusion'), - CAR.RAM_1500: dbc_dict('chrysler_ram_dt_generated', None), - CAR.RAM_HD: dbc_dict('chrysler_ram_hd_generated', None), -} +CAR_INFO = CAR.create_carinfo_map() +DBC = CAR.create_dbc_map() diff --git a/selfdrive/car/docs_definitions.py b/selfdrive/car/docs_definitions.py index f2ce74360..1adf78b1c 100644 --- a/selfdrive/car/docs_definitions.py +++ b/selfdrive/car/docs_definitions.py @@ -3,7 +3,6 @@ from collections import namedtuple import copy from dataclasses import dataclass, field from enum import Enum -from typing import Dict, List, Optional, Tuple, Union from cereal import car from openpilot.common.conversions import Conversions as CV @@ -35,7 +34,7 @@ class Star(Enum): @dataclass class BasePart: name: str - parts: List[Enum] = field(default_factory=list) + parts: list[Enum] = field(default_factory=list) def all_parts(self): # Recursively get all parts @@ -76,7 +75,7 @@ class Accessory(EnumBase): @dataclass class BaseCarHarness(BasePart): - parts: List[Enum] = field(default_factory=lambda: [Accessory.harness_box, Accessory.comma_power_v2, Cable.rj45_cable_7ft]) + parts: list[Enum] = field(default_factory=lambda: [Accessory.harness_box, Accessory.comma_power_v2, Cable.rj45_cable_7ft]) has_connector: bool = True # without are hidden on the harness connector page @@ -119,7 +118,8 @@ class CarHarness(EnumBase): nissan_b = BaseCarHarness("Nissan B connector", parts=[Accessory.harness_box, Cable.rj45_cable_7ft, Cable.long_obdc_cable, Cable.usbc_coupler]) mazda = BaseCarHarness("Mazda connector") ford_q3 = BaseCarHarness("Ford Q3 connector") - ford_q4 = BaseCarHarness("Ford Q4 connector") + ford_q4 = BaseCarHarness("Ford Q4 connector", parts=[Accessory.harness_box, Accessory.comma_power_v2, Cable.rj45_cable_7ft, Cable.long_obdc_cable, + Cable.usbc_coupler]) class Device(EnumBase): @@ -149,18 +149,18 @@ class PartType(Enum): tool = Tool -DEFAULT_CAR_PARTS: List[EnumBase] = [Device.threex] +DEFAULT_CAR_PARTS: list[EnumBase] = [Device.threex] @dataclass class CarParts: - parts: List[EnumBase] = field(default_factory=list) + parts: list[EnumBase] = field(default_factory=list) def __call__(self): return copy.deepcopy(self) @classmethod - def common(cls, add: Optional[List[EnumBase]] = None, remove: Optional[List[EnumBase]] = None): + def common(cls, add: list[EnumBase] = None, remove: list[EnumBase] = None): p = [part for part in (add or []) + DEFAULT_CAR_PARTS if part not in (remove or [])] return cls(p) @@ -186,7 +186,7 @@ class CommonFootnote(Enum): Column.LONGITUDINAL) -def get_footnotes(footnotes: List[Enum], column: Column) -> List[Enum]: +def get_footnotes(footnotes: list[Enum], column: Column) -> list[Enum]: # Returns applicable footnotes given current column return [fn for fn in footnotes if fn.value.column == column] @@ -209,7 +209,7 @@ def get_year_list(years): return years_list -def split_name(name: str) -> Tuple[str, str, str]: +def split_name(name: str) -> tuple[str, str, str]: make, model = name.split(" ", 1) years = "" match = re.search(MODEL_YEARS_RE, model) @@ -233,13 +233,13 @@ class CarInfo: # the minimum compatibility requirements for this model, regardless # of market. can be a package, trim, or list of features - requirements: Optional[str] = None + requirements: str | None = None - video_link: Optional[str] = None - footnotes: List[Enum] = field(default_factory=list) - min_steer_speed: Optional[float] = None - min_enable_speed: Optional[float] = None - auto_resume: Optional[bool] = None + video_link: str | None = None + footnotes: list[Enum] = field(default_factory=list) + min_steer_speed: float | None = None + min_enable_speed: float | None = None + auto_resume: bool | None = None # all the parts needed for the supported car car_parts: CarParts = field(default_factory=CarParts) @@ -248,7 +248,7 @@ class CarInfo: self.make, self.model, self.years = split_name(self.name) self.year_list = get_year_list(self.years) - def init(self, CP: car.CarParams, all_footnotes: Dict[Enum, int]): + def init(self, CP: car.CarParams, all_footnotes: dict[Enum, int]): self.car_name = CP.carName self.car_fingerprint = CP.carFingerprint @@ -293,7 +293,7 @@ class CarInfo: if len(tools_docs): hardware_col += f'
Tools{display_func(tools_docs)}
' - self.row: Dict[Enum, Union[str, Star]] = { + self.row: dict[Enum, str | Star] = { Column.MAKE: self.make, Column.MODEL: self.model, Column.PACKAGE: self.package, @@ -352,7 +352,7 @@ class CarInfo: raise Exception(f"This notCar does not have a detail sentence: {CP.carFingerprint}") def get_column(self, column: Column, star_icon: str, video_icon: str, footnote_tag: str) -> str: - item: Union[str, Star] = self.row[column] + item: str | Star = self.row[column] if isinstance(item, Star): item = star_icon.format(item.value) elif column == Column.MODEL and len(self.years): diff --git a/selfdrive/car/ecu_addrs.py b/selfdrive/car/ecu_addrs.py index 13f7926de..da5e7b461 100755 --- a/selfdrive/car/ecu_addrs.py +++ b/selfdrive/car/ecu_addrs.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 import capnp import time -from typing import Optional, Set import cereal.messaging as messaging from panda.python.uds import SERVICE_TYPE @@ -20,7 +19,7 @@ def make_tester_present_msg(addr, bus, subaddr=None): return make_can_msg(addr, bytes(dat), bus) -def is_tester_present_response(msg: capnp.lib.capnp._DynamicStructReader, subaddr: Optional[int] = None) -> bool: +def is_tester_present_response(msg: capnp.lib.capnp._DynamicStructReader, subaddr: int = None) -> bool: # ISO-TP messages are always padded to 8 bytes # tester present response is always a single frame dat_offset = 1 if subaddr is not None else 0 @@ -34,16 +33,16 @@ def is_tester_present_response(msg: capnp.lib.capnp._DynamicStructReader, subadd return False -def get_all_ecu_addrs(logcan: messaging.SubSocket, sendcan: messaging.PubSocket, bus: int, timeout: float = 1, debug: bool = True) -> Set[EcuAddrBusType]: +def get_all_ecu_addrs(logcan: messaging.SubSocket, sendcan: messaging.PubSocket, bus: int, timeout: float = 1, debug: bool = True) -> set[EcuAddrBusType]: addr_list = [0x700 + i for i in range(256)] + [0x18da00f1 + (i << 8) for i in range(256)] - queries: Set[EcuAddrBusType] = {(addr, None, bus) for addr in addr_list} + queries: set[EcuAddrBusType] = {(addr, None, bus) for addr in addr_list} responses = queries return get_ecu_addrs(logcan, sendcan, queries, responses, timeout=timeout, debug=debug) -def get_ecu_addrs(logcan: messaging.SubSocket, sendcan: messaging.PubSocket, queries: Set[EcuAddrBusType], - responses: Set[EcuAddrBusType], timeout: float = 1, debug: bool = False) -> Set[EcuAddrBusType]: - ecu_responses: Set[EcuAddrBusType] = set() # set((addr, subaddr, bus),) +def get_ecu_addrs(logcan: messaging.SubSocket, sendcan: messaging.PubSocket, queries: set[EcuAddrBusType], + responses: set[EcuAddrBusType], timeout: float = 1, debug: bool = False) -> set[EcuAddrBusType]: + ecu_responses: set[EcuAddrBusType] = set() # set((addr, subaddr, bus),) try: msgs = [make_tester_present_msg(addr, bus, subaddr) for addr, subaddr, bus in queries] diff --git a/selfdrive/car/ford/carcontroller.py b/selfdrive/car/ford/carcontroller.py index 45516d603..390325a8e 100644 --- a/selfdrive/car/ford/carcontroller.py +++ b/selfdrive/car/ford/carcontroller.py @@ -1,9 +1,10 @@ from cereal import car -from openpilot.common.numpy_fast import clip from opendbc.can.packer import CANPacker +from openpilot.common.numpy_fast import clip from openpilot.selfdrive.car import apply_std_steer_angle_limits from openpilot.selfdrive.car.ford import fordcan -from openpilot.selfdrive.car.ford.values import CANFD_CAR, CarControllerParams +from openpilot.selfdrive.car.ford.values import CarControllerParams, FordFlags +from openpilot.selfdrive.car.interfaces import CarControllerBase from openpilot.selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX LongCtrlState = car.CarControl.Actuators.LongControlState @@ -22,7 +23,7 @@ def apply_ford_curvature_limits(apply_curvature, apply_curvature_last, current_c return clip(apply_curvature, -CarControllerParams.CURVATURE_MAX, CarControllerParams.CURVATURE_MAX) -class CarController: +class CarController(CarControllerBase): def __init__(self, dbc_name, CP, VM): self.CP = CP self.VM = VM @@ -69,7 +70,7 @@ class CarController: self.apply_curvature_last = apply_curvature - if self.CP.carFingerprint in CANFD_CAR: + if self.CP.flags & FordFlags.CANFD: # TODO: extended mode mode = 1 if CC.latActive else 0 counter = (self.frame // CarControllerParams.STEER_STEP) % 0xF diff --git a/selfdrive/car/ford/carstate.py b/selfdrive/car/ford/carstate.py index 9230d16ef..039e24575 100644 --- a/selfdrive/car/ford/carstate.py +++ b/selfdrive/car/ford/carstate.py @@ -1,10 +1,10 @@ from cereal import car -from openpilot.common.conversions import Conversions as CV from opendbc.can.can_define import CANDefine from opendbc.can.parser import CANParser -from openpilot.selfdrive.car.interfaces import CarStateBase +from openpilot.common.conversions import Conversions as CV from openpilot.selfdrive.car.ford.fordcan import CanBus -from openpilot.selfdrive.car.ford.values import CANFD_CAR, CarControllerParams, DBC +from openpilot.selfdrive.car.ford.values import DBC, CarControllerParams, FordFlags +from openpilot.selfdrive.car.interfaces import CarStateBase GearShifter = car.CarState.GearShifter TransmissionType = car.CarParams.TransmissionType @@ -18,17 +18,10 @@ class CarState(CarStateBase): self.shifter_values = can_define.dv["Gear_Shift_by_Wire_FD1"]["TrnRng_D_RqGsm"] self.vehicle_sensors_valid = False - self.unsupported_platform = False def update(self, cp, cp_cam): ret = car.CarState.new_message() - # Ford Q3 hybrid variants experience a bug where a message from the PCM sends invalid checksums, - # this must be root-caused before enabling support. Ford Q4 hybrids do not have this problem. - # TrnAin_Tq_Actl and its quality flag are only set on ICE platform variants - self.unsupported_platform = (cp.vl["VehicleOperatingModes"]["TrnAinTq_D_Qf"] == 0 and - self.CP.carFingerprint not in CANFD_CAR) - # Occasionally on startup, the ABS module recalibrates the steering pinion offset, so we need to block engagement # The vehicle usually recovers out of this state within a minute of normal driving self.vehicle_sensors_valid = cp.vl["SteeringPinion_Data"]["StePinCompAnEst_D_Qf"] == 3 @@ -54,9 +47,9 @@ class CarState(CarStateBase): ret.steeringPressed = self.update_steering_pressed(abs(ret.steeringTorque) > CarControllerParams.STEER_DRIVER_ALLOWANCE, 5) ret.steerFaultTemporary = cp.vl["EPAS_INFO"]["EPAS_Failure"] == 1 ret.steerFaultPermanent = cp.vl["EPAS_INFO"]["EPAS_Failure"] in (2, 3) - # ret.espDisabled = False # TODO: find traction control signal + ret.espDisabled = cp.vl["Cluster_Info1_FD1"]["DrvSlipCtlMde_D_Rq"] != 0 # 0 is default mode - if self.CP.carFingerprint in CANFD_CAR: + if self.CP.flags & FordFlags.CANFD: # this signal is always 0 on non-CAN FD cars ret.steerFaultTemporary |= cp.vl["Lane_Assist_Data3_FD1"]["LatCtlSte_D_Stat"] not in (1, 2, 3) @@ -98,7 +91,7 @@ class CarState(CarStateBase): # blindspot sensors if self.CP.enableBsm: - cp_bsm = cp_cam if self.CP.carFingerprint in CANFD_CAR else cp + cp_bsm = cp_cam if self.CP.flags & FordFlags.CANFD else cp ret.leftBlindspot = cp_bsm.vl["Side_Detect_L_Stat"]["SodDetctLeft_D_Stat"] != 0 ret.rightBlindspot = cp_bsm.vl["Side_Detect_R_Stat"]["SodDetctRight_D_Stat"] != 0 @@ -129,7 +122,7 @@ class CarState(CarStateBase): ("RCMStatusMessage2_FD1", 10), ] - if CP.carFingerprint in CANFD_CAR: + if CP.flags & FordFlags.CANFD: messages += [ ("Lane_Assist_Data3_FD1", 33), ] @@ -144,7 +137,7 @@ class CarState(CarStateBase): ("BCM_Lamp_Stat_FD1", 1), ] - if CP.enableBsm and CP.carFingerprint not in CANFD_CAR: + if CP.enableBsm and not (CP.flags & FordFlags.CANFD): messages += [ ("Side_Detect_L_Stat", 5), ("Side_Detect_R_Stat", 5), @@ -162,7 +155,7 @@ class CarState(CarStateBase): ("IPMA_Data", 1), ] - if CP.enableBsm and CP.carFingerprint in CANFD_CAR: + if CP.enableBsm and CP.flags & FordFlags.CANFD: messages += [ ("Side_Detect_L_Stat", 5), ("Side_Detect_R_Stat", 5), diff --git a/selfdrive/car/ford/interface.py b/selfdrive/car/ford/interface.py index cc013fb54..a79b4af2e 100644 --- a/selfdrive/car/ford/interface.py +++ b/selfdrive/car/ford/interface.py @@ -3,7 +3,7 @@ from panda import Panda from openpilot.common.conversions import Conversions as CV from openpilot.selfdrive.car import get_safety_config from openpilot.selfdrive.car.ford.fordcan import CanBus -from openpilot.selfdrive.car.ford.values import CANFD_CAR, CAR, Ecu +from openpilot.selfdrive.car.ford.values import Ecu, FordFlags from openpilot.selfdrive.car.interfaces import CarInterfaceBase TransmissionType = car.CarParams.TransmissionType @@ -14,7 +14,7 @@ class CarInterface(CarInterfaceBase): @staticmethod def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): ret.carName = "ford" - ret.dashcamOnly = candidate in CANFD_CAR + ret.dashcamOnly = bool(ret.flags & FordFlags.CANFD) ret.radarUnavailable = True ret.steerControlType = car.CarParams.SteerControlType.angle @@ -36,54 +36,9 @@ class CarInterface(CarInterfaceBase): ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_FORD_LONG_CONTROL ret.openpilotLongitudinalControl = True - if candidate in CANFD_CAR: + if ret.flags & FordFlags.CANFD: ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_FORD_CANFD - if candidate == CAR.BRONCO_SPORT_MK1: - ret.wheelbase = 2.67 - ret.steerRatio = 17.7 - ret.mass = 1625 - - elif candidate == CAR.ESCAPE_MK4: - ret.wheelbase = 2.71 - ret.steerRatio = 16.7 - ret.mass = 1750 - - elif candidate == CAR.EXPLORER_MK6: - ret.wheelbase = 3.025 - ret.steerRatio = 16.8 - ret.mass = 2050 - - elif candidate == CAR.F_150_MK14: - # required trim only on SuperCrew - ret.wheelbase = 3.69 - ret.steerRatio = 17.0 - ret.mass = 2000 - - elif candidate == CAR.F_150_LIGHTNING_MK1: - # required trim only on SuperCrew - ret.wheelbase = 3.70 - ret.steerRatio = 16.9 - ret.mass = 2948 - - elif candidate == CAR.MUSTANG_MACH_E_MK1: - ret.wheelbase = 2.984 - ret.steerRatio = 17.0 # guess - ret.mass = 2200 - - elif candidate == CAR.FOCUS_MK4: - ret.wheelbase = 2.7 - ret.steerRatio = 15.0 - ret.mass = 1350 - - elif candidate == CAR.MAVERICK_MK1: - ret.wheelbase = 3.076 - ret.steerRatio = 17.0 - ret.mass = 1650 - - else: - raise ValueError(f"Unsupported car: {candidate}") - # Auto Transmission: 0x732 ECU or Gear_Shift_by_Wire_FD1 found_ecus = [fw.ecu for fw in car_fw] if Ecu.shiftByWire in found_ecus or 0x5A in fingerprint[CAN.main] or docs: @@ -109,8 +64,6 @@ class CarInterface(CarInterfaceBase): events = self.create_common_events(ret, extra_gears=[GearShifter.manumatic]) if not self.CS.vehicle_sensors_valid: events.add(car.CarEvent.EventName.vehicleSensorsInvalid) - if self.CS.unsupported_platform: - events.add(car.CarEvent.EventName.startupNoControl) ret.events = events.to_msg() diff --git a/selfdrive/car/ford/values.py b/selfdrive/car/ford/values.py index c080e0229..fe776fea7 100644 --- a/selfdrive/car/ford/values.py +++ b/selfdrive/car/ford/values.py @@ -1,13 +1,12 @@ -from collections import defaultdict -from dataclasses import dataclass -from enum import Enum, StrEnum -from typing import Dict, List, Union +from dataclasses import dataclass, field +from enum import Enum, IntFlag +import panda.python.uds as uds from cereal import car -from openpilot.selfdrive.car import AngleRateLimit, dbc_dict +from openpilot.selfdrive.car import AngleRateLimit, CarSpecs, dbc_dict, DbcDict, PlatformConfig, Platforms from openpilot.selfdrive.car.docs_definitions import CarFootnote, CarHarness, CarInfo, CarParts, Column, \ Device -from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries +from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries, p16 Ecu = car.CarParams.Ecu @@ -40,18 +39,9 @@ class CarControllerParams: pass -class CAR(StrEnum): - BRONCO_SPORT_MK1 = "FORD BRONCO SPORT 1ST GEN" - ESCAPE_MK4 = "FORD ESCAPE 4TH GEN" - EXPLORER_MK6 = "FORD EXPLORER 6TH GEN" - F_150_MK14 = "FORD F-150 14TH GEN" - FOCUS_MK4 = "FORD FOCUS 4TH GEN" - MAVERICK_MK1 = "FORD MAVERICK 1ST GEN" - F_150_LIGHTNING_MK1 = "FORD F-150 LIGHTNING 1ST GEN" - MUSTANG_MACH_E_MK1 = "FORD MUSTANG MACH-E 1ST GEN" - - -CANFD_CAR = {CAR.F_150_MK14, CAR.F_150_LIGHTNING_MK1, CAR.MUSTANG_MACH_E_MK1} +class FordFlags(IntFlag): + # Static flags + CANFD = 1 class RADAR: @@ -59,14 +49,6 @@ class RADAR: DELPHI_MRR = 'FORD_CADS' -DBC: Dict[str, Dict[str, str]] = defaultdict(lambda: dbc_dict("ford_lincoln_base_pt", RADAR.DELPHI_MRR)) - -# F-150 radar is not yet supported -DBC[CAR.F_150_MK14] = dbc_dict("ford_lincoln_base_pt", None) -DBC[CAR.F_150_LIGHTNING_MK1] = dbc_dict("ford_lincoln_base_pt", None) -DBC[CAR.MUSTANG_MACH_E_MK1] = dbc_dict("ford_lincoln_base_pt", None) - - class Footnote(Enum): FOCUS = CarFootnote( "Refers only to the Focus Mk4 (C519) available in Europe/China/Taiwan/Australasia, not the Focus Mk3 (C346) in " + @@ -80,32 +62,119 @@ class FordCarInfo(CarInfo): package: str = "Co-Pilot360 Assist+" def init_make(self, CP: car.CarParams): - harness = CarHarness.ford_q4 if CP.carFingerprint in CANFD_CAR else CarHarness.ford_q3 - if CP.carFingerprint in (CAR.BRONCO_SPORT_MK1, CAR.MAVERICK_MK1, CAR.F_150_MK14): + harness = CarHarness.ford_q4 if CP.flags & FordFlags.CANFD else CarHarness.ford_q3 + if CP.carFingerprint in (CAR.BRONCO_SPORT_MK1, CAR.MAVERICK_MK1, CAR.F_150_MK14, CAR.F_150_LIGHTNING_MK1): self.car_parts = CarParts([Device.threex_angled_mount, harness]) else: self.car_parts = CarParts([Device.threex, harness]) -CAR_INFO: Dict[str, Union[CarInfo, List[CarInfo]]] = { - CAR.BRONCO_SPORT_MK1: FordCarInfo("Ford Bronco Sport 2021-22"), - CAR.ESCAPE_MK4: [ - FordCarInfo("Ford Escape 2020-22"), - FordCarInfo("Ford Kuga 2020-22", "Adaptive Cruise Control with Lane Centering"), - ], - CAR.EXPLORER_MK6: [ - FordCarInfo("Ford Explorer 2020-23"), - FordCarInfo("Lincoln Aviator 2020-21", "Co-Pilot360 Plus"), - ], - CAR.F_150_MK14: FordCarInfo("Ford F-150 2023", "Co-Pilot360 Active 2.0"), - CAR.F_150_LIGHTNING_MK1: FordCarInfo("Ford F-150 Lightning 2021-23", "Co-Pilot360 Active 2.0"), - CAR.MUSTANG_MACH_E_MK1: FordCarInfo("Ford Mustang Mach-E 2021-23", "Co-Pilot360 Active 2.0"), - CAR.FOCUS_MK4: FordCarInfo("Ford Focus 2018", "Adaptive Cruise Control with Lane Centering", footnotes=[Footnote.FOCUS]), - CAR.MAVERICK_MK1: [ - FordCarInfo("Ford Maverick 2022", "LARIAT Luxury"), - FordCarInfo("Ford Maverick 2023", "Co-Pilot360 Assist"), - ], -} +@dataclass +class FordPlatformConfig(PlatformConfig): + dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('ford_lincoln_base_pt', RADAR.DELPHI_MRR)) + + +@dataclass +class FordCANFDPlatformConfig(FordPlatformConfig): + dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('ford_lincoln_base_pt', None)) + + def init(self): + super().init() + self.flags |= FordFlags.CANFD + + +class CAR(Platforms): + BRONCO_SPORT_MK1 = FordPlatformConfig( + "FORD BRONCO SPORT 1ST GEN", + FordCarInfo("Ford Bronco Sport 2021-22"), + CarSpecs(mass=1625, wheelbase=2.67, steerRatio=17.7), + ) + ESCAPE_MK4 = FordPlatformConfig( + "FORD ESCAPE 4TH GEN", + [ + FordCarInfo("Ford Escape 2020-22"), + FordCarInfo("Ford Escape Hybrid 2020-22"), + FordCarInfo("Ford Escape Plug-in Hybrid 2020-22"), + FordCarInfo("Ford Kuga 2020-22", "Adaptive Cruise Control with Lane Centering"), + FordCarInfo("Ford Kuga Hybrid 2020-22", "Adaptive Cruise Control with Lane Centering"), + FordCarInfo("Ford Kuga Plug-in Hybrid 2020-22", "Adaptive Cruise Control with Lane Centering"), + ], + CarSpecs(mass=1750, wheelbase=2.71, steerRatio=16.7), + ) + EXPLORER_MK6 = FordPlatformConfig( + "FORD EXPLORER 6TH GEN", + [ + FordCarInfo("Ford Explorer 2020-23"), + FordCarInfo("Ford Explorer Hybrid 2020-23"), # Limited and Platinum only + FordCarInfo("Lincoln Aviator 2020-23", "Co-Pilot360 Plus"), + FordCarInfo("Lincoln Aviator Plug-in Hybrid 2020-23", "Co-Pilot360 Plus"), # Grand Touring only + ], + CarSpecs(mass=2050, wheelbase=3.025, steerRatio=16.8), + ) + F_150_MK14 = FordCANFDPlatformConfig( + "FORD F-150 14TH GEN", + [ + FordCarInfo("Ford F-150 2023", "Co-Pilot360 Active 2.0"), + FordCarInfo("Ford F-150 Hybrid 2023", "Co-Pilot360 Active 2.0"), + ], + CarSpecs(mass=2000, wheelbase=3.69, steerRatio=17.0), + ) + F_150_LIGHTNING_MK1 = FordCANFDPlatformConfig( + "FORD F-150 LIGHTNING 1ST GEN", + FordCarInfo("Ford F-150 Lightning 2021-23", "Co-Pilot360 Active 2.0"), + CarSpecs(mass=2948, wheelbase=3.70, steerRatio=16.9), + ) + FOCUS_MK4 = FordPlatformConfig( + "FORD FOCUS 4TH GEN", + [ + FordCarInfo("Ford Focus 2018", "Adaptive Cruise Control with Lane Centering", footnotes=[Footnote.FOCUS]), + FordCarInfo("Ford Focus Hybrid 2018", "Adaptive Cruise Control with Lane Centering", footnotes=[Footnote.FOCUS]), # mHEV only + ], + CarSpecs(mass=1350, wheelbase=2.7, steerRatio=15.0), + ) + MAVERICK_MK1 = FordPlatformConfig( + "FORD MAVERICK 1ST GEN", + [ + FordCarInfo("Ford Maverick 2022", "LARIAT Luxury"), + FordCarInfo("Ford Maverick Hybrid 2022", "LARIAT Luxury"), + FordCarInfo("Ford Maverick 2023", "Co-Pilot360 Assist"), + FordCarInfo("Ford Maverick Hybrid 2023", "Co-Pilot360 Assist"), + ], + CarSpecs(mass=1650, wheelbase=3.076, steerRatio=17.0), + ) + MUSTANG_MACH_E_MK1 = FordCANFDPlatformConfig( + "FORD MUSTANG MACH-E 1ST GEN", + FordCarInfo("Ford Mustang Mach-E 2021-23", "Co-Pilot360 Active 2.0"), + CarSpecs(mass=2200, wheelbase=2.984, steerRatio=17.0), # TODO: check steer ratio + ) + + +DATA_IDENTIFIER_FORD_ASBUILT = 0xDE00 + +ASBUILT_BLOCKS: list[tuple[int, list]] = [ + (1, [Ecu.debug, Ecu.fwdCamera, Ecu.eps]), + (2, [Ecu.abs, Ecu.debug, Ecu.eps]), + (3, [Ecu.abs, Ecu.debug, Ecu.eps]), + (4, [Ecu.debug, Ecu.fwdCamera]), + (5, [Ecu.debug]), + (6, [Ecu.debug]), + (7, [Ecu.debug]), + (8, [Ecu.debug]), + (9, [Ecu.debug]), + (16, [Ecu.debug, Ecu.fwdCamera]), + (18, [Ecu.fwdCamera]), + (20, [Ecu.fwdCamera]), + (21, [Ecu.fwdCamera]), +] + + +def ford_asbuilt_block_request(block_id: int): + return bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + p16(DATA_IDENTIFIER_FORD_ASBUILT + block_id - 1) + + +def ford_asbuilt_block_response(block_id: int): + return bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + p16(DATA_IDENTIFIER_FORD_ASBUILT + block_id - 1) + FW_QUERY_CONFIG = FwQueryConfig( requests=[ @@ -114,13 +183,31 @@ FW_QUERY_CONFIG = FwQueryConfig( Request( [StdQueries.TESTER_PRESENT_REQUEST, StdQueries.MANUFACTURER_SOFTWARE_VERSION_REQUEST], [StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.MANUFACTURER_SOFTWARE_VERSION_RESPONSE], + whitelist_ecus=[Ecu.abs, Ecu.debug, Ecu.engine, Ecu.eps, Ecu.fwdCamera, Ecu.fwdRadar, Ecu.shiftByWire], + logging=True, + ), + Request( + [StdQueries.TESTER_PRESENT_REQUEST, StdQueries.MANUFACTURER_SOFTWARE_VERSION_REQUEST], + [StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.MANUFACTURER_SOFTWARE_VERSION_RESPONSE], + whitelist_ecus=[Ecu.abs, Ecu.debug, Ecu.engine, Ecu.eps, Ecu.fwdCamera, Ecu.fwdRadar, Ecu.shiftByWire], bus=0, auxiliary=True, ), + *[Request( + [StdQueries.TESTER_PRESENT_REQUEST, ford_asbuilt_block_request(block_id)], + [StdQueries.TESTER_PRESENT_RESPONSE, ford_asbuilt_block_response(block_id)], + whitelist_ecus=ecus, + bus=0, + logging=True, + ) for block_id, ecus in ASBUILT_BLOCKS], ], extra_ecus=[ - # We are unlikely to get a response from the PCM from behind the gateway - (Ecu.engine, 0x7e0, None), - (Ecu.shiftByWire, 0x732, None), + (Ecu.engine, 0x7e0, None), # Powertrain Control Module + # Note: We are unlikely to get a response from behind the gateway + (Ecu.shiftByWire, 0x732, None), # Gear Shift Module + (Ecu.debug, 0x7d0, None), # Accessory Protocol Interface Module ], ) + +CAR_INFO = CAR.create_carinfo_map() +DBC = CAR.create_dbc_map() diff --git a/selfdrive/car/fw_query_definitions.py b/selfdrive/car/fw_query_definitions.py index ed886a69d..80492b417 100755 --- a/selfdrive/car/fw_query_definitions.py +++ b/selfdrive/car/fw_query_definitions.py @@ -3,21 +3,21 @@ import capnp import copy from dataclasses import dataclass, field import struct -from typing import Callable, Dict, List, Optional, Set, Tuple +from collections.abc import Callable import panda.python.uds as uds -AddrType = Tuple[int, Optional[int]] -EcuAddrBusType = Tuple[int, Optional[int], int] -EcuAddrSubAddr = Tuple[int, int, Optional[int]] +AddrType = tuple[int, int | None] +EcuAddrBusType = tuple[int, int | None, int] +EcuAddrSubAddr = tuple[int, int, int | None] -LiveFwVersions = Dict[AddrType, Set[bytes]] -OfflineFwVersions = Dict[str, Dict[EcuAddrSubAddr, List[bytes]]] +LiveFwVersions = dict[AddrType, set[bytes]] +OfflineFwVersions = dict[str, dict[EcuAddrSubAddr, list[bytes]]] # A global list of addresses we will only ever consider for VIN responses # engine, hybrid controller, Ford abs, Hyundai CAN FD cluster, 29-bit engine, PGM-FI # TODO: move these to each brand's FW query config -STANDARD_VIN_ADDRS = [0x7e0, 0x7e2, 0x760, 0x7c4, 0x18da10f1, 0x18da0ef1] +STANDARD_VIN_ADDRS = [0x7e0, 0x7e2, 0x760, 0x7c6, 0x18da10f1, 0x18da0ef1] def p16(val): @@ -65,12 +65,15 @@ class StdQueries: GM_VIN_REQUEST = b'\x1a\x90' GM_VIN_RESPONSE = b'\x5a\x90' + KWP_VIN_REQUEST = b'\x21\x81' + KWP_VIN_RESPONSE = b'\x61\x81' + @dataclass class Request: - request: List[bytes] - response: List[bytes] - whitelist_ecus: List[int] = field(default_factory=list) + request: list[bytes] + response: list[bytes] + whitelist_ecus: list[int] = field(default_factory=list) rx_offset: int = 0x8 bus: int = 1 # Whether this query should be run on the first auxiliary panda (CAN FD cars for example) @@ -83,15 +86,15 @@ class Request: @dataclass class FwQueryConfig: - requests: List[Request] + requests: list[Request] # TODO: make this automatic and remove hardcoded lists, or do fingerprinting with ecus # Overrides and removes from essential ecus for specific models and ecus (exact matching) - non_essential_ecus: Dict[capnp.lib.capnp._EnumModule, List[str]] = field(default_factory=dict) + non_essential_ecus: dict[capnp.lib.capnp._EnumModule, list[str]] = field(default_factory=dict) # Ecus added for data collection, not to be fingerprinted on - extra_ecus: List[Tuple[capnp.lib.capnp._EnumModule, int, Optional[int]]] = field(default_factory=list) + extra_ecus: list[tuple[capnp.lib.capnp._EnumModule, int, int | None]] = field(default_factory=list) # Function a brand can implement to provide better fuzzy matching. Takes in FW versions, # returns set of candidates. Only will match if one candidate is returned - match_fw_to_car_fuzzy: Optional[Callable[[LiveFwVersions, OfflineFwVersions], Set[str]]] = None + match_fw_to_car_fuzzy: Callable[[LiveFwVersions, OfflineFwVersions], set[str]] | None = None def __post_init__(self): for i in range(len(self.requests)): diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py index 5e8db6301..7ead7c0b6 100755 --- a/selfdrive/car/fw_versions.py +++ b/selfdrive/car/fw_versions.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 from collections import defaultdict -from typing import Any, DefaultDict, Dict, Iterator, List, Optional, Set, TypeVar +from typing import Any, TypeVar +from collections.abc import Iterator from tqdm import tqdm import capnp @@ -27,19 +28,19 @@ REQUESTS = [(brand, config, r) for brand, config in FW_QUERY_CONFIGS.items() for T = TypeVar('T') -def chunks(l: List[T], n: int = 128) -> Iterator[List[T]]: +def chunks(l: list[T], n: int = 128) -> Iterator[list[T]]: for i in range(0, len(l), n): yield l[i:i + n] -def is_brand(brand: str, filter_brand: Optional[str]) -> bool: +def is_brand(brand: str, filter_brand: str | None) -> bool: """Returns if brand matches filter_brand or no brand filter is specified""" return filter_brand is None or brand == filter_brand -def build_fw_dict(fw_versions: List[capnp.lib.capnp._DynamicStructBuilder], - filter_brand: Optional[str] = None) -> Dict[AddrType, Set[bytes]]: - fw_versions_dict: DefaultDict[AddrType, Set[bytes]] = defaultdict(set) +def build_fw_dict(fw_versions: list[capnp.lib.capnp._DynamicStructBuilder], + filter_brand: str = None) -> dict[AddrType, set[bytes]]: + fw_versions_dict: defaultdict[AddrType, set[bytes]] = defaultdict(set) for fw in fw_versions: if is_brand(fw.brand, filter_brand) and not fw.logging: sub_addr = fw.subAddress if fw.subAddress != 0 else None @@ -97,7 +98,7 @@ def match_fw_to_car_fuzzy(live_fw_versions, match_brand=None, log=True, exclude= return set() -def match_fw_to_car_exact(live_fw_versions, match_brand=None, log=True, extra_fw_versions=None) -> Set[str]: +def match_fw_to_car_exact(live_fw_versions, match_brand=None, log=True, extra_fw_versions=None) -> set[str]: """Do an exact FW match. Returns all cars that match the given FW versions for a list of "essential" ECUs. If an ECU is not considered essential the FW version can be missing to get a fingerprint, but if it's present it @@ -164,11 +165,11 @@ def match_fw_to_car(fw_versions, allow_exact=True, allow_fuzzy=True, log=True): return True, set() -def get_present_ecus(logcan, sendcan, num_pandas=1) -> Set[EcuAddrBusType]: +def get_present_ecus(logcan, sendcan, num_pandas=1) -> set[EcuAddrBusType]: params = Params() # queries are split by OBD multiplexing mode - queries: Dict[bool, List[List[EcuAddrBusType]]] = {True: [], False: []} - parallel_queries: Dict[bool, List[EcuAddrBusType]] = {True: [], False: []} + queries: dict[bool, list[list[EcuAddrBusType]]] = {True: [], False: []} + parallel_queries: dict[bool, list[EcuAddrBusType]] = {True: [], False: []} responses = set() for brand, config, r in REQUESTS: @@ -203,7 +204,7 @@ def get_present_ecus(logcan, sendcan, num_pandas=1) -> Set[EcuAddrBusType]: return ecu_responses -def get_brand_ecu_matches(ecu_rx_addrs: Set[EcuAddrBusType]) -> dict[str, set[AddrType]]: +def get_brand_ecu_matches(ecu_rx_addrs: set[EcuAddrBusType]) -> dict[str, set[AddrType]]: """Returns dictionary of brands and matches with ECUs in their FW versions""" brand_addrs = {brand: {(addr, subaddr) for _, addr, subaddr in config.get_all_ecus(VERSIONS[brand])} for @@ -231,7 +232,7 @@ def set_obd_multiplexing(params: Params, obd_multiplexing: bool): def get_fw_versions_ordered(logcan, sendcan, ecu_rx_addrs, timeout=0.1, num_pandas=1, debug=False, progress=False) -> \ - List[capnp.lib.capnp._DynamicStructBuilder]: + list[capnp.lib.capnp._DynamicStructBuilder]: """Queries for FW versions ordering brands by likelihood, breaks when exact match is found""" all_car_fw = [] @@ -254,7 +255,7 @@ def get_fw_versions_ordered(logcan, sendcan, ecu_rx_addrs, timeout=0.1, num_pand def get_fw_versions(logcan, sendcan, query_brand=None, extra=None, timeout=0.1, num_pandas=1, debug=False, progress=False) -> \ - List[capnp.lib.capnp._DynamicStructBuilder]: + list[capnp.lib.capnp._DynamicStructBuilder]: versions = VERSIONS.copy() params = Params() diff --git a/selfdrive/car/gm/carcontroller.py b/selfdrive/car/gm/carcontroller.py index 6c7e8007f..e010c5653 100644 --- a/selfdrive/car/gm/carcontroller.py +++ b/selfdrive/car/gm/carcontroller.py @@ -6,6 +6,7 @@ from opendbc.can.packer import CANPacker from openpilot.selfdrive.car import apply_driver_steer_torque_limits from openpilot.selfdrive.car.gm import gmcan from openpilot.selfdrive.car.gm.values import DBC, CanBus, CarControllerParams, CruiseButtons +from openpilot.selfdrive.car.interfaces import CarControllerBase VisualAlert = car.CarControl.HUDControl.VisualAlert NetworkLocation = car.CarParams.NetworkLocation @@ -17,7 +18,7 @@ CAMERA_CANCEL_DELAY_FRAMES = 10 MIN_STEER_MSG_INTERVAL_MS = 15 -class CarController: +class CarController(CarControllerBase): def __init__(self, dbc_name, CP, VM): self.CP = CP self.start_time = 0. diff --git a/selfdrive/car/gm/fingerprints.py b/selfdrive/car/gm/fingerprints.py index c349ee285..73a205a25 100644 --- a/selfdrive/car/gm/fingerprints.py +++ b/selfdrive/car/gm/fingerprints.py @@ -2,6 +2,7 @@ from openpilot.selfdrive.car.gm.values import CAR # Trailblazer also matches as a SILVERADO, TODO: split with fw versions +# FIXME: There are Equinox users with different message lengths, specifically 304 and 320 FINGERPRINTS = { @@ -52,6 +53,9 @@ FINGERPRINTS = { }], CAR.EQUINOX: [{ 190: 6, 193: 8, 197: 8, 201: 8, 209: 7, 211: 2, 241: 6, 249: 8, 257: 8, 288: 5, 289: 8, 298: 8, 304: 1, 309: 8, 311: 8, 313: 8, 320: 3, 328: 1, 352: 5, 381: 8, 384: 4, 386: 8, 388: 8, 413: 8, 451: 8, 452: 8, 453: 6, 455: 7, 463: 3, 479: 3, 481: 7, 485: 8, 489: 8, 497: 8, 500: 6, 501: 8, 510: 8, 528: 5, 532: 6, 560: 8, 562: 8, 563: 5, 565: 5, 587: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 707: 8, 715: 8, 717: 5, 753: 5, 761: 7, 789: 5, 800: 6, 810: 8, 840: 5, 842: 5, 844: 8, 869: 4, 880: 6, 977: 8, 1001: 8, 1011: 6, 1017: 8, 1020: 8, 1033: 7, 1034: 7, 1217: 8, 1221: 5, 1233: 8, 1249: 8, 1259: 8, 1261: 7, 1263: 4, 1265: 8, 1267: 1, 1271: 8, 1280: 4, 1296: 4, 1300: 8, 1611: 8, 1930: 7 + }, + { + 190: 6, 201: 8, 211: 2, 717: 5, 241: 6, 451: 8, 298: 8, 452: 8, 453: 6, 479: 3, 485: 8, 249: 8, 500: 6, 587: 8, 1611: 8, 289: 8, 481: 7, 193: 8, 197: 8, 209: 7, 455: 7, 489: 8, 309: 8, 413: 8, 501: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 311: 8, 510: 8, 528: 5, 532: 6, 715: 8, 560: 8, 562: 8, 707: 8, 789: 5, 869: 4, 880: 6, 761: 7, 840: 5, 842: 5, 844: 8, 313: 8, 381: 8, 386: 8, 810: 8, 322: 7, 384: 4, 800: 6, 1033: 7, 1034: 7, 1296: 4, 753: 5, 388: 8, 288: 5, 497: 8, 463: 3, 304: 3, 977: 8, 1001: 8, 1280: 4, 320: 4, 352: 5, 563: 5, 565: 5, 1221: 5, 1011: 6, 1017: 8, 1020: 8, 1249: 8, 1300: 8, 328: 1, 1217: 8, 1233: 8, 1259: 8, 1261: 7, 1263: 4, 1265: 8, 1267: 1, 1930: 7, 1271: 8 }], } diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 0c78b0061..e0dde4d0e 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -137,7 +137,7 @@ class CarInterface(CarInterfaceBase): # These cars have been put into dashcam only due to both a lack of users and test coverage. # These cars likely still work fine. Once a user confirms each car works and a test route is # added to selfdrive/car/tests/routes.py, we can remove it from this list. - ret.dashcamOnly = candidate in {CAR.CADILLAC_ATS, CAR.HOLDEN_ASTRA, CAR.MALIBU, CAR.BUICK_REGAL, CAR.EQUINOX} or \ + ret.dashcamOnly = candidate in {CAR.CADILLAC_ATS, CAR.HOLDEN_ASTRA, CAR.MALIBU, CAR.BUICK_REGAL} or \ (ret.networkLocation == NetworkLocation.gateway and ret.radarUnavailable) # Start with a baseline tuning for all GM vehicles. Override tuning as needed in each model section below. @@ -152,11 +152,7 @@ class CarInterface(CarInterfaceBase): ret.longitudinalActuatorDelayUpperBound = 0.5 # large delay to initially start braking if candidate == CAR.VOLT: - ret.mass = 1607. - ret.wheelbase = 2.69 - ret.steerRatio = 17.7 # Stock 15.7, LiveParameters ret.tireStiffnessFactor = 0.469 # Stock Michelin Energy Saver A/S, LiveParameters - ret.centerToFront = ret.wheelbase * 0.45 # Volt Gen 1, TODO corner weigh ret.lateralTuning.pid.kpBP = [0., 40.] ret.lateralTuning.pid.kpV = [0., 0.17] @@ -165,61 +161,20 @@ class CarInterface(CarInterfaceBase): ret.lateralTuning.pid.kf = 1. # get_steer_feedforward_volt() ret.steerActuatorDelay = 0.2 - elif candidate == CAR.MALIBU: - ret.mass = 1496. - ret.wheelbase = 2.83 - ret.steerRatio = 15.8 - ret.centerToFront = ret.wheelbase * 0.4 # wild guess - - elif candidate == CAR.HOLDEN_ASTRA: - ret.mass = 1363. - ret.wheelbase = 2.662 - # Remaining parameters copied from Volt for now - ret.centerToFront = ret.wheelbase * 0.4 - ret.steerRatio = 15.7 - elif candidate == CAR.ACADIA: ret.minEnableSpeed = -1. # engage speed is decided by pcm - ret.mass = 4353. * CV.LB_TO_KG - ret.wheelbase = 2.86 - ret.steerRatio = 14.4 # end to end is 13.46 - ret.centerToFront = ret.wheelbase * 0.4 ret.steerActuatorDelay = 0.2 CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) elif candidate == CAR.BUICK_LACROSSE: - ret.mass = 1712. - ret.wheelbase = 2.91 - ret.steerRatio = 15.8 - ret.centerToFront = ret.wheelbase * 0.4 # wild guess CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) - elif candidate == CAR.BUICK_REGAL: - ret.mass = 3779. * CV.LB_TO_KG # (3849+3708)/2 - ret.wheelbase = 2.83 # 111.4 inches in meters - ret.steerRatio = 14.4 # guess for tourx - ret.centerToFront = ret.wheelbase * 0.4 # guess for tourx - - elif candidate == CAR.CADILLAC_ATS: - ret.mass = 1601. - ret.wheelbase = 2.78 - ret.steerRatio = 15.3 - ret.centerToFront = ret.wheelbase * 0.5 - elif candidate == CAR.ESCALADE: ret.minEnableSpeed = -1. # engage speed is decided by pcm - ret.mass = 5653. * CV.LB_TO_KG # (5552+5815)/2 - ret.wheelbase = 2.95 # 116 inches in meters - ret.steerRatio = 17.3 - ret.centerToFront = ret.wheelbase * 0.5 CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) elif candidate in (CAR.ESCALADE_ESV, CAR.ESCALADE_ESV_2019): ret.minEnableSpeed = -1. # engage speed is decided by pcm - ret.mass = 2739. - ret.wheelbase = 3.302 - ret.steerRatio = 17.3 - ret.centerToFront = ret.wheelbase * 0.5 ret.tireStiffnessFactor = 1.0 if candidate == CAR.ESCALADE_ESV: @@ -231,19 +186,11 @@ class CarInterface(CarInterfaceBase): CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) elif candidate == CAR.BOLT_EUV: - ret.mass = 1669. - ret.wheelbase = 2.63779 - ret.steerRatio = 16.8 - ret.centerToFront = ret.wheelbase * 0.4 ret.tireStiffnessFactor = 1.0 ret.steerActuatorDelay = 0.2 CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) elif candidate == CAR.SILVERADO: - ret.mass = 2450. - ret.wheelbase = 3.75 - ret.steerRatio = 16.3 - ret.centerToFront = ret.wheelbase * 0.5 ret.tireStiffnessFactor = 1.0 # On the Bolt, the ECM and camera independently check that you are either above 5 kph or at a stop # with foot on brake to allow engagement, but this platform only has that check in the camera. @@ -253,17 +200,9 @@ class CarInterface(CarInterfaceBase): CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) elif candidate == CAR.EQUINOX: - ret.mass = 3500. * CV.LB_TO_KG - ret.wheelbase = 2.72 - ret.steerRatio = 14.4 - ret.centerToFront = ret.wheelbase * 0.4 CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) elif candidate == CAR.TRAILBLAZER: - ret.mass = 1345. - ret.wheelbase = 2.64 - ret.steerRatio = 16.8 - ret.centerToFront = ret.wheelbase * 0.4 ret.tireStiffnessFactor = 1.0 ret.steerActuatorDelay = 0.2 CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) diff --git a/selfdrive/car/gm/values.py b/selfdrive/car/gm/values.py index 8188ad4e6..e3414df2b 100644 --- a/selfdrive/car/gm/values.py +++ b/selfdrive/car/gm/values.py @@ -1,10 +1,8 @@ -from collections import defaultdict -from dataclasses import dataclass -from enum import Enum, StrEnum -from typing import Dict, List, Union +from dataclasses import dataclass, field +from enum import Enum from cereal import car -from openpilot.selfdrive.car import dbc_dict +from openpilot.selfdrive.car import dbc_dict, PlatformConfig, DbcDict, Platforms, CarSpecs from openpilot.selfdrive.car.docs_definitions import CarFootnote, CarHarness, CarInfo, CarParts, Column from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries @@ -62,23 +60,6 @@ class CarControllerParams: self.BRAKE_LOOKUP_V = [self.MAX_BRAKE, 0.] -class CAR(StrEnum): - HOLDEN_ASTRA = "HOLDEN ASTRA RS-V BK 2017" - VOLT = "CHEVROLET VOLT PREMIER 2017" - CADILLAC_ATS = "CADILLAC ATS Premium Performance 2018" - MALIBU = "CHEVROLET MALIBU PREMIER 2017" - ACADIA = "GMC ACADIA DENALI 2018" - BUICK_LACROSSE = "BUICK LACROSSE 2017" - BUICK_REGAL = "BUICK REGAL ESSENCE 2018" - ESCALADE = "CADILLAC ESCALADE 2017" - ESCALADE_ESV = "CADILLAC ESCALADE ESV 2016" - ESCALADE_ESV_2019 = "CADILLAC ESCALADE ESV 2019" - BOLT_EUV = "CHEVROLET BOLT EUV 2022" - SILVERADO = "CHEVROLET SILVERADO 1500 2020" - EQUINOX = "CHEVROLET EQUINOX 2019" - TRAILBLAZER = "CHEVROLET TRAILBLAZER 2021" - - class Footnote(Enum): OBD_II = CarFootnote( 'Requires a community built ASCM harness. ' + @@ -98,28 +79,88 @@ class GMCarInfo(CarInfo): self.footnotes.append(Footnote.OBD_II) -CAR_INFO: Dict[str, Union[GMCarInfo, List[GMCarInfo]]] = { - CAR.HOLDEN_ASTRA: GMCarInfo("Holden Astra 2017"), - CAR.VOLT: GMCarInfo("Chevrolet Volt 2017-18", min_enable_speed=0, video_link="https://youtu.be/QeMCN_4TFfQ"), - CAR.CADILLAC_ATS: GMCarInfo("Cadillac ATS Premium Performance 2018"), - CAR.MALIBU: GMCarInfo("Chevrolet Malibu Premier 2017"), - CAR.ACADIA: GMCarInfo("GMC Acadia 2018", video_link="https://www.youtube.com/watch?v=0ZN6DdsBUZo"), - CAR.BUICK_LACROSSE: GMCarInfo("Buick LaCrosse 2017-19", "Driver Confidence Package 2"), - CAR.BUICK_REGAL: GMCarInfo("Buick Regal Essence 2018"), - CAR.ESCALADE: GMCarInfo("Cadillac Escalade 2017", "Driver Assist Package"), - CAR.ESCALADE_ESV: GMCarInfo("Cadillac Escalade ESV 2016", "Adaptive Cruise Control (ACC) & LKAS"), - CAR.ESCALADE_ESV_2019: GMCarInfo("Cadillac Escalade ESV 2019", "Adaptive Cruise Control (ACC) & LKAS"), - CAR.BOLT_EUV: [ - GMCarInfo("Chevrolet Bolt EUV 2022-23", "Premier or Premier Redline Trim without Super Cruise Package", video_link="https://youtu.be/xvwzGMUA210"), - GMCarInfo("Chevrolet Bolt EV 2022-23", "2LT Trim with Adaptive Cruise Control Package"), - ], - CAR.SILVERADO: [ - GMCarInfo("Chevrolet Silverado 1500 2020-21", "Safety Package II"), - GMCarInfo("GMC Sierra 1500 2020-21", "Driver Alert Package II", video_link="https://youtu.be/5HbNoBLzRwE"), - ], - CAR.EQUINOX: GMCarInfo("Chevrolet Equinox 2019-22"), - CAR.TRAILBLAZER: GMCarInfo("Chevrolet Trailblazer 2021-22"), -} +@dataclass +class GMPlatformConfig(PlatformConfig): + dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('gm_global_a_powertrain_generated', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis')) + + +class CAR(Platforms): + HOLDEN_ASTRA = GMPlatformConfig( + "HOLDEN ASTRA RS-V BK 2017", + GMCarInfo("Holden Astra 2017"), + CarSpecs(mass=1363, wheelbase=2.662, steerRatio=15.7, centerToFrontRatio=0.4), + ) + VOLT = GMPlatformConfig( + "CHEVROLET VOLT PREMIER 2017", + GMCarInfo("Chevrolet Volt 2017-18", min_enable_speed=0, video_link="https://youtu.be/QeMCN_4TFfQ"), + CarSpecs(mass=1607, wheelbase=2.69, steerRatio=17.7, centerToFrontRatio=0.45), + ) + CADILLAC_ATS = GMPlatformConfig( + "CADILLAC ATS Premium Performance 2018", + GMCarInfo("Cadillac ATS Premium Performance 2018"), + CarSpecs(mass=1601, wheelbase=2.78, steerRatio=15.3), + ) + MALIBU = GMPlatformConfig( + "CHEVROLET MALIBU PREMIER 2017", + GMCarInfo("Chevrolet Malibu Premier 2017"), + CarSpecs(mass=1496, wheelbase=2.83, steerRatio=15.8, centerToFrontRatio=0.4), + ) + ACADIA = GMPlatformConfig( + "GMC ACADIA DENALI 2018", + GMCarInfo("GMC Acadia 2018", video_link="https://www.youtube.com/watch?v=0ZN6DdsBUZo"), + CarSpecs(mass=1975, wheelbase=2.86, steerRatio=14.4, centerToFrontRatio=0.4), + ) + BUICK_LACROSSE = GMPlatformConfig( + "BUICK LACROSSE 2017", + GMCarInfo("Buick LaCrosse 2017-19", "Driver Confidence Package 2"), + CarSpecs(mass=1712, wheelbase=2.91, steerRatio=15.8, centerToFrontRatio=0.4), + ) + BUICK_REGAL = GMPlatformConfig( + "BUICK REGAL ESSENCE 2018", + GMCarInfo("Buick Regal Essence 2018"), + CarSpecs(mass=1714, wheelbase=2.83, steerRatio=14.4, centerToFrontRatio=0.4), + ) + ESCALADE = GMPlatformConfig( + "CADILLAC ESCALADE 2017", + GMCarInfo("Cadillac Escalade 2017", "Driver Assist Package"), + CarSpecs(mass=2564, wheelbase=2.95, steerRatio=17.3), + ) + ESCALADE_ESV = GMPlatformConfig( + "CADILLAC ESCALADE ESV 2016", + GMCarInfo("Cadillac Escalade ESV 2016", "Adaptive Cruise Control (ACC) & LKAS"), + CarSpecs(mass=2739, wheelbase=3.302, steerRatio=17.3), + ) + ESCALADE_ESV_2019 = GMPlatformConfig( + "CADILLAC ESCALADE ESV 2019", + GMCarInfo("Cadillac Escalade ESV 2019", "Adaptive Cruise Control (ACC) & LKAS"), + ESCALADE_ESV.specs, + ) + BOLT_EUV = GMPlatformConfig( + "CHEVROLET BOLT EUV 2022", + [ + GMCarInfo("Chevrolet Bolt EUV 2022-23", "Premier or Premier Redline Trim without Super Cruise Package", video_link="https://youtu.be/xvwzGMUA210"), + GMCarInfo("Chevrolet Bolt EV 2022-23", "2LT Trim with Adaptive Cruise Control Package"), + ], + CarSpecs(mass=1669, wheelbase=2.63779, steerRatio=16.8, centerToFrontRatio=0.4), + ) + SILVERADO = GMPlatformConfig( + "CHEVROLET SILVERADO 1500 2020", + [ + GMCarInfo("Chevrolet Silverado 1500 2020-21", "Safety Package II"), + GMCarInfo("GMC Sierra 1500 2020-21", "Driver Alert Package II", video_link="https://youtu.be/5HbNoBLzRwE"), + ], + CarSpecs(mass=2450, wheelbase=3.75, steerRatio=16.3), + ) + EQUINOX = GMPlatformConfig( + "CHEVROLET EQUINOX 2019", + GMCarInfo("Chevrolet Equinox 2019-22"), + CarSpecs(mass=1588, wheelbase=2.72, steerRatio=14.4, centerToFrontRatio=0.4), + ) + TRAILBLAZER = GMPlatformConfig( + "CHEVROLET TRAILBLAZER 2021", + GMCarInfo("Chevrolet Trailblazer 2021-22"), + CarSpecs(mass=1345, wheelbase=2.64, steerRatio=16.8, centerToFrontRatio=0.4), + ) class CruiseButtons: @@ -148,22 +189,35 @@ class CanBus: # In a Data Module, an identifier is a string used to recognize an object, # either by itself or together with the identifiers of parent objects. # Each returns a 4 byte hex representation of the decimal part number. `b"\x02\x8c\xf0'"` -> 42790951 +GM_BOOT_SOFTWARE_PART_NUMER_REQUEST = b'\x1a\xc0' # likely does not contain anything useful GM_SOFTWARE_MODULE_1_REQUEST = b'\x1a\xc1' GM_SOFTWARE_MODULE_2_REQUEST = b'\x1a\xc2' GM_SOFTWARE_MODULE_3_REQUEST = b'\x1a\xc3' + +# Part number of XML data file that is used to configure ECU +GM_XML_DATA_FILE_PART_NUMBER = b'\x1a\x9c' +GM_XML_CONFIG_COMPAT_ID = b'\x1a\x9b' # used to know if XML file is compatible with the ECU software/hardware + # This DID is for identifying the part number that reflects the mix of hardware, # software, and calibrations in the ECU when it first arrives at the vehicle assembly plant. # If there's an Alpha Code, it's associated with this part number and stored in the DID $DB. GM_END_MODEL_PART_NUMBER_REQUEST = b'\x1a\xcb' +GM_END_MODEL_PART_NUMBER_ALPHA_CODE_REQUEST = b'\x1a\xdb' GM_BASE_MODEL_PART_NUMBER_REQUEST = b'\x1a\xcc' +GM_BASE_MODEL_PART_NUMBER_ALPHA_CODE_REQUEST = b'\x1a\xdc' GM_FW_RESPONSE = b'\x5a' GM_FW_REQUESTS = [ + GM_BOOT_SOFTWARE_PART_NUMER_REQUEST, GM_SOFTWARE_MODULE_1_REQUEST, GM_SOFTWARE_MODULE_2_REQUEST, GM_SOFTWARE_MODULE_3_REQUEST, + GM_XML_DATA_FILE_PART_NUMBER, + GM_XML_CONFIG_COMPAT_ID, GM_END_MODEL_PART_NUMBER_REQUEST, + GM_END_MODEL_PART_NUMBER_ALPHA_CODE_REQUEST, GM_BASE_MODEL_PART_NUMBER_REQUEST, + GM_BASE_MODEL_PART_NUMBER_ALPHA_CODE_REQUEST, ] GM_RX_OFFSET = 0x400 @@ -181,11 +235,12 @@ FW_QUERY_CONFIG = FwQueryConfig( extra_ecus=[(Ecu.fwdCamera, 0x24b, None)], ) -DBC: Dict[str, Dict[str, str]] = defaultdict(lambda: dbc_dict('gm_global_a_powertrain_generated', 'gm_global_a_object', chassis_dbc='gm_global_a_chassis')) - EV_CAR = {CAR.VOLT, CAR.BOLT_EUV} # We're integrated at the camera with VOACC on these cars (instead of ASCM w/ OBD-II harness) CAMERA_ACC_CAR = {CAR.BOLT_EUV, CAR.SILVERADO, CAR.EQUINOX, CAR.TRAILBLAZER} STEER_THRESHOLD = 1.0 + +CAR_INFO = CAR.create_carinfo_map() +DBC = CAR.create_dbc_map() diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index 056b47c4b..547abcd9b 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -7,6 +7,7 @@ from opendbc.can.packer import CANPacker from openpilot.selfdrive.car import create_gas_interceptor_command from openpilot.selfdrive.car.honda import hondacan from openpilot.selfdrive.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, HONDA_NIDEC_ALT_PCM_ACCEL, CarControllerParams +from openpilot.selfdrive.car.interfaces import CarControllerBase from openpilot.selfdrive.controls.lib.drive_helpers import rate_limit VisualAlert = car.CarControl.HUDControl.VisualAlert @@ -104,11 +105,12 @@ def rate_limit_steer(new_steer, last_steer): return clip(new_steer, last_steer - MAX_DELTA, last_steer + MAX_DELTA) -class CarController: +class CarController(CarControllerBase): def __init__(self, dbc_name, CP, VM): self.CP = CP self.packer = CANPacker(dbc_name) self.params = CarControllerParams(CP) + self.CAN = hondacan.CanBus(CP) self.frame = 0 self.braking = False @@ -167,7 +169,7 @@ class CarController: can_sends.append((0x18DAB0F1, 0, b"\x02\x3E\x80\x00\x00\x00\x00\x00", 1)) # Send steering command. - can_sends.append(hondacan.create_steering_control(self.packer, apply_steer, CC.latActive, self.CP.carFingerprint, + can_sends.append(hondacan.create_steering_control(self.packer, self.CAN, apply_steer, CC.latActive, self.CP.carFingerprint, CS.CP.openpilotLongitudinalControl)) # wind brake from air resistance decel at high speed @@ -201,12 +203,12 @@ class CarController: if not self.CP.openpilotLongitudinalControl: if self.frame % 2 == 0 and self.CP.carFingerprint not in HONDA_BOSCH_RADARLESS: # radarless cars don't have supplemental message - can_sends.append(hondacan.create_bosch_supplemental_1(self.packer, self.CP.carFingerprint)) + can_sends.append(hondacan.create_bosch_supplemental_1(self.packer, self.CAN, self.CP.carFingerprint)) # If using stock ACC, spam cancel command to kill gas when OP disengages. if pcm_cancel_cmd: - can_sends.append(hondacan.spam_buttons_command(self.packer, CruiseButtons.CANCEL, self.CP.carFingerprint)) + can_sends.append(hondacan.spam_buttons_command(self.packer, self.CAN, CruiseButtons.CANCEL, self.CP.carFingerprint)) elif CC.cruiseControl.resume: - can_sends.append(hondacan.spam_buttons_command(self.packer, CruiseButtons.RES_ACCEL, self.CP.carFingerprint)) + can_sends.append(hondacan.spam_buttons_command(self.packer, self.CAN, CruiseButtons.RES_ACCEL, self.CP.carFingerprint)) else: # Send gas and brake commands. @@ -219,7 +221,7 @@ class CarController: stopping = actuators.longControlState == LongCtrlState.stopping self.stopping_counter = self.stopping_counter + 1 if stopping else 0 - can_sends.extend(hondacan.create_acc_commands(self.packer, CC.enabled, CC.longActive, self.accel, self.gas, + can_sends.extend(hondacan.create_acc_commands(self.packer, self.CAN, CC.enabled, CC.longActive, self.accel, self.gas, self.stopping_counter, self.CP.carFingerprint)) else: apply_brake = clip(self.brake_last - wind_brake, 0.0, 1.0) @@ -227,7 +229,7 @@ class CarController: pump_on, self.last_pump_ts = brake_pump_hysteresis(apply_brake, self.apply_brake_last, self.last_pump_ts, ts) pcm_override = True - can_sends.append(hondacan.create_brake_command(self.packer, apply_brake, pump_on, + can_sends.append(hondacan.create_brake_command(self.packer, self.CAN, apply_brake, pump_on, pcm_override, pcm_cancel_cmd, fcw_display, self.CP.carFingerprint, CS.stock_brake)) self.apply_brake_last = apply_brake @@ -250,7 +252,7 @@ class CarController: if self.frame % 10 == 0: hud = HUDData(int(pcm_accel), int(round(hud_v_cruise)), hud_control.leadVisible, hud_control.lanesVisible, fcw_display, acc_alert, steer_required) - can_sends.extend(hondacan.create_ui_commands(self.packer, self.CP, CC.enabled, pcm_speed, hud, CS.is_metric, CS.acc_hud, CS.lkas_hud)) + can_sends.extend(hondacan.create_ui_commands(self.packer, self.CAN, self.CP, CC.enabled, pcm_speed, hud, CS.is_metric, CS.acc_hud, CS.lkas_hud)) if self.CP.openpilotLongitudinalControl and self.CP.carFingerprint not in HONDA_BOSCH: self.speed = pcm_speed diff --git a/selfdrive/car/honda/carstate.py b/selfdrive/car/honda/carstate.py index 75ca6938d..364b215fd 100644 --- a/selfdrive/car/honda/carstate.py +++ b/selfdrive/car/honda/carstate.py @@ -5,10 +5,10 @@ from openpilot.common.conversions import Conversions as CV from openpilot.common.numpy_fast import interp from opendbc.can.can_define import CANDefine from opendbc.can.parser import CANParser -from openpilot.selfdrive.car.honda.hondacan import get_cruise_speed_conversion, get_pt_bus +from openpilot.selfdrive.car.honda.hondacan import CanBus, get_cruise_speed_conversion from openpilot.selfdrive.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, \ - HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_ALT_BRAKE_SIGNAL, \ - HONDA_BOSCH_RADARLESS + HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_RADARLESS, \ + HondaFlags from openpilot.selfdrive.car.interfaces import CarStateBase TransmissionType = car.CarParams.TransmissionType @@ -44,7 +44,7 @@ def get_can_messages(CP, gearbox_msg): else: messages.append((gearbox_msg, 100)) - if CP.carFingerprint in HONDA_BOSCH_ALT_BRAKE_SIGNAL: + if CP.flags & HondaFlags.BOSCH_ALT_BRAKE: messages.append(("BRAKE_MODULE", 50)) if CP.carFingerprint in (HONDA_BOSCH | {CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN}): @@ -64,7 +64,7 @@ def get_can_messages(CP, gearbox_msg): messages.append(("CRUISE_PARAMS", 50)) # TODO: clean this up - if CP.carFingerprint in (CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, + if CP.carFingerprint in (CAR.ACCORD, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.CIVIC_2022, CAR.HRV_3G): pass elif CP.carFingerprint in (CAR.ODYSSEY_CHN, CAR.FREED, CAR.HRV): @@ -129,7 +129,7 @@ class CarState(CarStateBase): # panda checks if the signal is non-zero ret.standstill = cp.vl["ENGINE_DATA"]["XMISSION_SPEED"] < 1e-5 # TODO: find a common signal across all cars - if self.CP.carFingerprint in (CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, + if self.CP.carFingerprint in (CAR.ACCORD, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.CIVIC_2022, CAR.HRV_3G): ret.doorOpen = bool(cp.vl["SCM_FEEDBACK"]["DRIVERS_DOOR_OPEN"]) elif self.CP.carFingerprint in (CAR.ODYSSEY_CHN, CAR.FREED, CAR.HRV): @@ -218,7 +218,7 @@ class CarState(CarStateBase): else: ret.cruiseState.speed = cp.vl["CRUISE"]["CRUISE_SPEED_PCM"] * CV.KPH_TO_MS - if self.CP.carFingerprint in HONDA_BOSCH_ALT_BRAKE_SIGNAL: + if self.CP.flags & HondaFlags.BOSCH_ALT_BRAKE: ret.brakePressed = cp.vl["BRAKE_MODULE"]["BRAKE_PRESSED"] != 0 else: # brake switch has shown some single time step noise, so only considered when @@ -243,11 +243,11 @@ class CarState(CarStateBase): ret.brakePressed = True #DP: brake light for ui. - if self.CP.carFingerprint in (CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN, CAR.CRV_5G, CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, + if self.CP.carFingerprint in (CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN, CAR.CRV_5G, CAR.ACCORD, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E): ret.brakeLightsDEPRECATED = bool(cp.vl["ACC_CONTROL"]['BRAKE_LIGHTS'] != 0 or ret.brake > 0.4) if not self.CP.openpilotLongitudinalControl else \ bool(ret.brake > 0.4) - elif self.CP.carFingerprint in HONDA_BOSCH and self.CP.carFingerprint not in (CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN, CAR.CRV_5G, CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, + elif self.CP.carFingerprint in HONDA_BOSCH and self.CP.carFingerprint not in (CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN, CAR.CRV_5G, CAR.ACCORD, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E) and self.CP.carFingerprint not in HONDA_BOSCH_RADARLESS: ret.brakeLightsDEPRECATED = bool(cp.vl["ACC_CONTROL"]['BRAKE_LIGHTS'] != 0 or ret.brake > 0.4) if not self.CP.openpilotLongitudinalControl else \ bool(ret.brake > 0.4) @@ -278,7 +278,7 @@ class CarState(CarStateBase): def get_can_parser(self, CP): messages = get_can_messages(CP, self.gearbox_msg) - return CANParser(DBC[CP.carFingerprint]["pt"], messages, get_pt_bus(CP.carFingerprint)) + return CANParser(DBC[CP.carFingerprint]["pt"], messages, CanBus(CP).pt) @staticmethod def get_cam_can_parser(CP): @@ -298,7 +298,7 @@ class CarState(CarStateBase): ("BRAKE_COMMAND", 50), ] - return CANParser(DBC[CP.carFingerprint]["pt"], messages, 2) + return CANParser(DBC[CP.carFingerprint]["pt"], messages, CanBus(CP).camera) @staticmethod def get_body_can_parser(CP): @@ -307,6 +307,6 @@ class CarState(CarStateBase): ("BSM_STATUS_LEFT", 3), ("BSM_STATUS_RIGHT", 3), ] - bus_body = 0 # B-CAN is forwarded to ACC-CAN radar side (CAN 0 on fake ethernet port) + bus_body = CanBus(CP).radar # B-CAN is forwarded to ACC-CAN radar side (CAN 0 on fake ethernet port) return CANParser(DBC[CP.carFingerprint]["body"], messages, bus_body) return None diff --git a/selfdrive/car/honda/fingerprints.py b/selfdrive/car/honda/fingerprints.py index a61265491..a842baac8 100644 --- a/selfdrive/car/honda/fingerprints.py +++ b/selfdrive/car/honda/fingerprints.py @@ -48,6 +48,7 @@ FW_VERSIONS = { ], (Ecu.shiftByWire, 0x18da0bf1, None): [ b'54008-TVC-A910\x00\x00', + b'54008-TWA-A910\x00\x00', ], (Ecu.transmission, 0x18da1ef1, None): [ b'28101-6A7-A220\x00\x00', @@ -89,6 +90,12 @@ FW_VERSIONS = { b'57114-TVA-C530\x00\x00', b'57114-TVA-E520\x00\x00', b'57114-TVE-H250\x00\x00', + b'57114-TWA-A040\x00\x00', + b'57114-TWA-A050\x00\x00', + b'57114-TWA-A530\x00\x00', + b'57114-TWA-B520\x00\x00', + b'57114-TWA-C510\x00\x00', + b'57114-TWB-H030\x00\x00', ], (Ecu.eps, 0x18da30f1, None): [ b'39990-TBX-H120\x00\x00', @@ -100,10 +107,7 @@ FW_VERSIONS = { b'39990-TVA-X030\x00\x00', b'39990-TVA-X040\x00\x00', b'39990-TVE-H130\x00\x00', - ], - (Ecu.unknown, 0x18da3af1, None): [ - b'39390-TVA-A020\x00\x00', - b'39390-TVA-A120\x00\x00', + b'39990-TWB-H120\x00\x00', ], (Ecu.srs, 0x18da53f1, None): [ b'77959-TBX-H230\x00\x00', @@ -112,6 +116,9 @@ FW_VERSIONS = { b'77959-TVA-H230\x00\x00', b'77959-TVA-L420\x00\x00', b'77959-TVA-X330\x00\x00', + b'77959-TWA-A440\x00\x00', + b'77959-TWA-L420\x00\x00', + b'77959-TWB-H220\x00\x00', ], (Ecu.combinationMeter, 0x18da60f1, None): [ b'78109-TBX-H310\x00\x00', @@ -145,7 +152,19 @@ FW_VERSIONS = { b'78109-TVC-M510\x00\x00', b'78109-TVC-YF10\x00\x00', b'78109-TVE-H610\x00\x00', + b'78109-TWA-A010\x00\x00', + b'78109-TWA-A020\x00\x00', + b'78109-TWA-A030\x00\x00', + b'78109-TWA-A110\x00\x00', + b'78109-TWA-A120\x00\x00', + b'78109-TWA-A130\x00\x00', b'78109-TWA-A210\x00\x00', + b'78109-TWA-A220\x00\x00', + b'78109-TWA-A230\x00\x00', + b'78109-TWA-A610\x00\x00', + b'78109-TWA-H210\x00\x00', + b'78109-TWA-L010\x00\x00', + b'78109-TWA-L210\x00\x00', ], (Ecu.hud, 0x18da61f1, None): [ b'78209-TVA-A010\x00\x00', @@ -162,6 +181,9 @@ FW_VERSIONS = { b'36802-TVE-H070\x00\x00', b'36802-TWA-A070\x00\x00', b'36802-TWA-A080\x00\x00', + b'36802-TWA-A210\x00\x00', + b'36802-TWA-A330\x00\x00', + b'36802-TWB-H060\x00\x00', ], (Ecu.fwdCamera, 0x18dab5f1, None): [ b'36161-TBX-H130\x00\x00', @@ -170,72 +192,17 @@ FW_VERSIONS = { b'36161-TVC-A330\x00\x00', b'36161-TVE-H050\x00\x00', b'36161-TWA-A070\x00\x00', + b'36161-TWA-A330\x00\x00', + b'36161-TWB-H040\x00\x00', ], (Ecu.gateway, 0x18daeff1, None): [ b'38897-TVA-A010\x00\x00', b'38897-TVA-A020\x00\x00', b'38897-TVA-A230\x00\x00', b'38897-TVA-A240\x00\x00', - ], - }, - CAR.ACCORDH: { - (Ecu.gateway, 0x18daeff1, None): [ b'38897-TWA-A120\x00\x00', b'38897-TWD-J020\x00\x00', ], - (Ecu.vsa, 0x18da28f1, None): [ - b'57114-TWA-A040\x00\x00', - b'57114-TWA-A050\x00\x00', - b'57114-TWA-A530\x00\x00', - b'57114-TWA-B520\x00\x00', - b'57114-TWA-C510\x00\x00', - b'57114-TWB-H030\x00\x00', - ], - (Ecu.srs, 0x18da53f1, None): [ - b'77959-TWA-A440\x00\x00', - b'77959-TWA-L420\x00\x00', - b'77959-TWB-H220\x00\x00', - ], - (Ecu.combinationMeter, 0x18da60f1, None): [ - b'78109-TWA-A010\x00\x00', - b'78109-TWA-A020\x00\x00', - b'78109-TWA-A030\x00\x00', - b'78109-TWA-A110\x00\x00', - b'78109-TWA-A120\x00\x00', - b'78109-TWA-A130\x00\x00', - b'78109-TWA-A210\x00\x00', - b'78109-TWA-A220\x00\x00', - b'78109-TWA-A230\x00\x00', - b'78109-TWA-A610\x00\x00', - b'78109-TWA-H210\x00\x00', - b'78109-TWA-L010\x00\x00', - b'78109-TWA-L210\x00\x00', - ], - (Ecu.shiftByWire, 0x18da0bf1, None): [ - b'54008-TWA-A910\x00\x00', - ], - (Ecu.hud, 0x18da61f1, None): [ - b'78209-TVA-A010\x00\x00', - b'78209-TVA-A110\x00\x00', - ], - (Ecu.fwdCamera, 0x18dab5f1, None): [ - b'36161-TWA-A070\x00\x00', - b'36161-TWA-A330\x00\x00', - b'36161-TWB-H040\x00\x00', - ], - (Ecu.fwdRadar, 0x18dab0f1, None): [ - b'36802-TWA-A070\x00\x00', - b'36802-TWA-A080\x00\x00', - b'36802-TWA-A210\x00\x00', - b'36802-TWA-A330\x00\x00', - b'36802-TWB-H060\x00\x00', - ], - (Ecu.eps, 0x18da30f1, None): [ - b'39990-TVA-A150\x00\x00', - b'39990-TVA-A160\x00\x00', - b'39990-TVA-A340\x00\x00', - b'39990-TWB-H120\x00\x00', - ], }, CAR.CIVIC: { (Ecu.programmedFuelInjection, 0x18da10f1, None): [ @@ -299,6 +266,7 @@ FW_VERSIONS = { (Ecu.srs, 0x18da53f1, None): [ b'77959-TBA-A030\x00\x00', b'77959-TBA-A040\x00\x00', + b'77959-TBG-A020\x00\x00', b'77959-TBG-A030\x00\x00', b'77959-TEA-Q820\x00\x00', ], @@ -680,6 +648,7 @@ FW_VERSIONS = { b'36802-TLA-A040\x00\x00', b'36802-TLA-A050\x00\x00', b'36802-TLA-A060\x00\x00', + b'36802-TLA-A070\x00\x00', b'36802-TMC-Q040\x00\x00', b'36802-TMC-Q070\x00\x00', b'36802-TNY-A030\x00\x00', @@ -836,6 +805,7 @@ FW_VERSIONS = { b'37805-5MR-3250\x00\x00', b'37805-5MR-4070\x00\x00', b'37805-5MR-4080\x00\x00', + b'37805-5MR-4170\x00\x00', b'37805-5MR-4180\x00\x00', b'37805-5MR-A240\x00\x00', b'37805-5MR-A250\x00\x00', @@ -880,6 +850,7 @@ FW_VERSIONS = { b'28102-5MX-A900\x00\x00', b'28102-5MX-A910\x00\x00', b'28102-5MX-C001\x00\x00', + b'28102-5MX-C910\x00\x00', b'28102-5MX-D001\x00\x00', b'28102-5MX-D710\x00\x00', b'28102-5MX-K610\x00\x00', @@ -917,6 +888,7 @@ FW_VERSIONS = { b'78109-THR-C320\x00\x00', b'78109-THR-C330\x00\x00', b'78109-THR-CE20\x00\x00', + b'78109-THR-CL10\x00\x00', b'78109-THR-DA20\x00\x00', b'78109-THR-DA30\x00\x00', b'78109-THR-DA40\x00\x00', diff --git a/selfdrive/car/honda/hondacan.py b/selfdrive/car/honda/hondacan.py index a8cbad78c..d10d5576d 100644 --- a/selfdrive/car/honda/hondacan.py +++ b/selfdrive/car/honda/hondacan.py @@ -1,4 +1,5 @@ from openpilot.common.conversions import Conversions as CV +from openpilot.selfdrive.car import CanBusBase from openpilot.selfdrive.car.honda.values import HondaFlags, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, CAR, CarControllerParams # CAN bus layout with relay @@ -8,15 +9,34 @@ from openpilot.selfdrive.car.honda.values import HondaFlags, HONDA_BOSCH, HONDA_ # 3 = F-CAN A - OBDII port -def get_pt_bus(car_fingerprint): - return 1 if car_fingerprint in (HONDA_BOSCH - HONDA_BOSCH_RADARLESS) else 0 +class CanBus(CanBusBase): + def __init__(self, CP=None, fingerprint=None) -> None: + # use fingerprint if specified + super().__init__(CP if fingerprint is None else None, fingerprint) + + if CP.carFingerprint in (HONDA_BOSCH - HONDA_BOSCH_RADARLESS): + self._pt, self._radar = self.offset + 1, self.offset + else: + self._pt, self._radar = self.offset, self.offset + 1 + + @property + def pt(self) -> int: + return self._pt + + @property + def radar(self) -> int: + return self._radar + + @property + def camera(self) -> int: + return self.offset + 2 -def get_lkas_cmd_bus(car_fingerprint, radar_disabled=False): +def get_lkas_cmd_bus(CAN, car_fingerprint, radar_disabled=False): no_radar = car_fingerprint in HONDA_BOSCH_RADARLESS if radar_disabled or no_radar: # when radar is disabled, steering commands are sent directly to powertrain bus - return get_pt_bus(car_fingerprint) + return CAN.pt # normally steering commands are sent to radar, which forwards them to powertrain bus return 0 @@ -26,7 +46,7 @@ def get_cruise_speed_conversion(car_fingerprint: str, is_metric: bool) -> float: return CV.MPH_TO_MS if car_fingerprint in HONDA_BOSCH_RADARLESS and not is_metric else CV.KPH_TO_MS -def create_brake_command(packer, apply_brake, pump_on, pcm_override, pcm_cancel_cmd, fcw, car_fingerprint, stock_brake): +def create_brake_command(packer, CAN, apply_brake, pump_on, pcm_override, pcm_cancel_cmd, fcw, car_fingerprint, stock_brake): # TODO: do we loose pressure if we keep pump off for long? brakelights = apply_brake > 0 brake_rq = apply_brake > 0 @@ -47,13 +67,11 @@ def create_brake_command(packer, apply_brake, pump_on, pcm_override, pcm_cancel_ "AEB_REQ_2": 0, "AEB_STATUS": 0, } - bus = get_pt_bus(car_fingerprint) - return packer.make_can_msg("BRAKE_COMMAND", bus, values) + return packer.make_can_msg("BRAKE_COMMAND", CAN.pt, values) -def create_acc_commands(packer, enabled, active, accel, gas, stopping_counter, car_fingerprint): +def create_acc_commands(packer, CAN, enabled, active, accel, gas, stopping_counter, car_fingerprint): commands = [] - bus = get_pt_bus(car_fingerprint) min_gas_accel = CarControllerParams.BOSCH_GAS_LOOKUP_BP[0] control_on = 5 if enabled else 0 @@ -90,37 +108,36 @@ def create_acc_commands(packer, enabled, active, accel, gas, stopping_counter, c "SET_TO_75": 0x75, "SET_TO_30": 0x30, } - commands.append(packer.make_can_msg("ACC_CONTROL_ON", bus, acc_control_on_values)) + commands.append(packer.make_can_msg("ACC_CONTROL_ON", CAN.pt, acc_control_on_values)) - commands.append(packer.make_can_msg("ACC_CONTROL", bus, acc_control_values)) + commands.append(packer.make_can_msg("ACC_CONTROL", CAN.pt, acc_control_values)) return commands -def create_steering_control(packer, apply_steer, lkas_active, car_fingerprint, radar_disabled): +def create_steering_control(packer, CAN, apply_steer, lkas_active, car_fingerprint, radar_disabled): values = { "STEER_TORQUE": apply_steer if lkas_active else 0, "STEER_TORQUE_REQUEST": lkas_active, } - bus = get_lkas_cmd_bus(car_fingerprint, radar_disabled) + bus = get_lkas_cmd_bus(CAN, car_fingerprint, radar_disabled) return packer.make_can_msg("STEERING_CONTROL", bus, values) -def create_bosch_supplemental_1(packer, car_fingerprint): +def create_bosch_supplemental_1(packer, CAN, car_fingerprint): # non-active params values = { "SET_ME_X04": 0x04, "SET_ME_X80": 0x80, "SET_ME_X10": 0x10, } - bus = get_lkas_cmd_bus(car_fingerprint) + bus = get_lkas_cmd_bus(CAN, car_fingerprint) return packer.make_can_msg("BOSCH_SUPPLEMENTAL_1", bus, values) -def create_ui_commands(packer, CP, enabled, pcm_speed, hud, is_metric, acc_hud, lkas_hud): +def create_ui_commands(packer, CAN, CP, enabled, pcm_speed, hud, is_metric, acc_hud, lkas_hud): commands = [] - bus_pt = get_pt_bus(CP.carFingerprint) radar_disabled = CP.carFingerprint in (HONDA_BOSCH - HONDA_BOSCH_RADARLESS) and CP.openpilotLongitudinalControl - bus_lkas = get_lkas_cmd_bus(CP.carFingerprint, radar_disabled) + bus_lkas = get_lkas_cmd_bus(CAN, CP.carFingerprint, radar_disabled) if CP.openpilotLongitudinalControl: acc_hud_values = { @@ -144,7 +161,7 @@ def create_ui_commands(packer, CP, enabled, pcm_speed, hud, is_metric, acc_hud, acc_hud_values['FCM_OFF_2'] = acc_hud['FCM_OFF_2'] acc_hud_values['FCM_PROBLEM'] = acc_hud['FCM_PROBLEM'] acc_hud_values['ICONS'] = acc_hud['ICONS'] - commands.append(packer.make_can_msg("ACC_HUD", bus_pt, acc_hud_values)) + commands.append(packer.make_can_msg("ACC_HUD", CAN.pt, acc_hud_values)) lkas_hud_values = { 'SET_ME_X41': 0x41, @@ -173,19 +190,19 @@ def create_ui_commands(packer, CP, enabled, pcm_speed, hud, is_metric, acc_hud, 'CMBS_OFF': 0x01, 'SET_TO_1': 0x01, } - commands.append(packer.make_can_msg('RADAR_HUD', bus_pt, radar_hud_values)) + commands.append(packer.make_can_msg('RADAR_HUD', CAN.pt, radar_hud_values)) if CP.carFingerprint == CAR.CIVIC_BOSCH: - commands.append(packer.make_can_msg("LEGACY_BRAKE_COMMAND", bus_pt, {})) + commands.append(packer.make_can_msg("LEGACY_BRAKE_COMMAND", CAN.pt, {})) return commands -def spam_buttons_command(packer, button_val, car_fingerprint): +def spam_buttons_command(packer, CAN, button_val, car_fingerprint): values = { 'CRUISE_BUTTONS': button_val, 'CRUISE_SETTING': 0, } # send buttons to camera on radarless cars - bus = 2 if car_fingerprint in HONDA_BOSCH_RADARLESS else get_pt_bus(car_fingerprint) + bus = CAN.camera if car_fingerprint in HONDA_BOSCH_RADARLESS else CAN.pt return packer.make_can_msg("SCM_BUTTONS", bus, values) diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index 9f228cd8f..9c39c4694 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -3,8 +3,9 @@ from cereal import car from panda import Panda from openpilot.common.conversions import Conversions as CV from openpilot.common.numpy_fast import interp +from openpilot.selfdrive.car.honda.hondacan import CanBus from openpilot.selfdrive.car.honda.values import CarControllerParams, CruiseButtons, HondaFlags, CAR, HONDA_BOSCH, HONDA_NIDEC_ALT_SCM_MESSAGES, \ - HONDA_BOSCH_ALT_BRAKE_SIGNAL, HONDA_BOSCH_RADARLESS + HONDA_BOSCH_RADARLESS from openpilot.selfdrive.car import create_button_events, get_safety_config from openpilot.selfdrive.car.interfaces import CarInterfaceBase from openpilot.selfdrive.car.disable_ecu import disable_ecu @@ -35,6 +36,8 @@ class CarInterface(CarInterfaceBase): def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): ret.carName = "honda" + CAN = CanBus(ret, fingerprint) + if candidate in HONDA_BOSCH: ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.hondaBosch)] ret.radarUnavailable = True @@ -46,20 +49,20 @@ class CarInterface(CarInterfaceBase): ret.pcmCruise = not ret.openpilotLongitudinalControl else: ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.hondaNidec)] - ret.enableGasInterceptor = 0x201 in fingerprint[0] + ret.enableGasInterceptor = 0x201 in fingerprint[CAN.pt] ret.openpilotLongitudinalControl = True ret.pcmCruise = not ret.enableGasInterceptor if candidate == CAR.CRV_5G: - ret.enableBsm = 0x12f8bfa7 in fingerprint[0] + ret.enableBsm = 0x12f8bfa7 in fingerprint[CAN.radar] # Detect Bosch cars with new HUD msgs if any(0x33DA in f for f in fingerprint.values()): ret.flags |= HondaFlags.BOSCH_EXT_HUD.value - # Accord 1.5T CVT has different gearbox message - if candidate == CAR.ACCORD and 0x191 in fingerprint[1]: + # Accord ICE 1.5T CVT has different gearbox message + if candidate == CAR.ACCORD and 0x191 in fingerprint[CAN.pt]: ret.transmissionType = TransmissionType.cvt # Certain Hondas have an extra steering sensor at the bottom of the steering rack, @@ -89,10 +92,6 @@ class CarInterface(CarInterfaceBase): eps_modified = True if candidate == CAR.CIVIC: - ret.mass = 1326. - ret.wheelbase = 2.70 - ret.centerToFront = ret.wheelbase * 0.4 - ret.steerRatio = 15.38 # 10.93 is end-to-end spec if eps_modified: # stock request input values: 0x0000, 0x00DE, 0x014D, 0x01EF, 0x0290, 0x0377, 0x0454, 0x0610, 0x06EE # stock request output values: 0x0000, 0x0917, 0x0DC5, 0x1017, 0x119F, 0x140B, 0x1680, 0x1680, 0x1680 @@ -107,18 +106,10 @@ class CarInterface(CarInterfaceBase): ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[1.1], [0.33]] elif candidate in (CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CIVIC_2022): - ret.mass = 1326. - ret.wheelbase = 2.70 - ret.centerToFront = ret.wheelbase * 0.4 - ret.steerRatio = 15.38 # 10.93 is end-to-end spec ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] - elif candidate in (CAR.ACCORD, CAR.ACCORDH): - ret.mass = 3279. * CV.LB_TO_KG - ret.wheelbase = 2.83 - ret.centerToFront = ret.wheelbase * 0.39 - ret.steerRatio = 16.33 # 11.82 is spec end-to-end + elif candidate == CAR.ACCORD: ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end ret.tireStiffnessFactor = 0.8467 @@ -128,29 +119,17 @@ class CarInterface(CarInterfaceBase): ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] elif candidate == CAR.ACURA_ILX: - ret.mass = 3095. * CV.LB_TO_KG - ret.wheelbase = 2.67 - ret.centerToFront = ret.wheelbase * 0.37 - ret.steerRatio = 18.61 # 15.3 is spec end-to-end ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 3840], [0, 3840]] # TODO: determine if there is a dead zone at the top end ret.tireStiffnessFactor = 0.72 ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] elif candidate in (CAR.CRV, CAR.CRV_EU): - ret.mass = 3572. * CV.LB_TO_KG - ret.wheelbase = 2.62 - ret.centerToFront = ret.wheelbase * 0.41 - ret.steerRatio = 16.89 # as spec ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 1000], [0, 1000]] # TODO: determine if there is a dead zone at the top end ret.tireStiffnessFactor = 0.444 ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] ret.wheelSpeedFactor = 1.025 elif candidate == CAR.CRV_5G: - ret.mass = 3410. * CV.LB_TO_KG - ret.wheelbase = 2.66 - ret.centerToFront = ret.wheelbase * 0.41 - ret.steerRatio = 16.0 # 12.3 is spec end-to-end if eps_modified: # stock request input values: 0x0000, 0x00DB, 0x01BB, 0x0296, 0x0377, 0x0454, 0x0532, 0x0610, 0x067F # stock request output values: 0x0000, 0x0500, 0x0A15, 0x0E6D, 0x1100, 0x1200, 0x129A, 0x134D, 0x1400 @@ -164,39 +143,22 @@ class CarInterface(CarInterfaceBase): ret.wheelSpeedFactor = 1.025 elif candidate == CAR.CRV_HYBRID: - ret.mass = 1667. # mean of 4 models in kg - ret.wheelbase = 2.66 - ret.centerToFront = ret.wheelbase * 0.41 - ret.steerRatio = 16.0 # 12.3 is spec end-to-end ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end ret.tireStiffnessFactor = 0.677 ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] ret.wheelSpeedFactor = 1.025 elif candidate == CAR.FIT: - ret.mass = 2644. * CV.LB_TO_KG - ret.wheelbase = 2.53 - ret.centerToFront = ret.wheelbase * 0.39 - ret.steerRatio = 13.06 ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end ret.tireStiffnessFactor = 0.75 ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.05]] elif candidate == CAR.FREED: - ret.mass = 3086. * CV.LB_TO_KG - ret.wheelbase = 2.74 - # the remaining parameters were copied from FIT - ret.centerToFront = ret.wheelbase * 0.39 - ret.steerRatio = 13.06 ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] ret.tireStiffnessFactor = 0.75 ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.05]] elif candidate in (CAR.HRV, CAR.HRV_3G): - ret.mass = 3125 * CV.LB_TO_KG - ret.wheelbase = 2.61 - ret.centerToFront = ret.wheelbase * 0.41 - ret.steerRatio = 15.2 ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] ret.tireStiffnessFactor = 0.5 if candidate == CAR.HRV: @@ -206,28 +168,16 @@ class CarInterface(CarInterfaceBase): ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] # TODO: can probably use some tuning elif candidate == CAR.ACURA_RDX: - ret.mass = 3935. * CV.LB_TO_KG - ret.wheelbase = 2.68 - ret.centerToFront = ret.wheelbase * 0.38 - ret.steerRatio = 15.0 # as spec ret.tireStiffnessFactor = 0.444 ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 1000], [0, 1000]] # TODO: determine if there is a dead zone at the top end ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.8], [0.24]] elif candidate == CAR.ACURA_RDX_3G: - ret.mass = 4068. * CV.LB_TO_KG - ret.wheelbase = 2.75 - ret.centerToFront = ret.wheelbase * 0.41 - ret.steerRatio = 11.95 # as spec ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 3840], [0, 3840]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.06]] ret.tireStiffnessFactor = 0.677 elif candidate in (CAR.ODYSSEY, CAR.ODYSSEY_CHN): - ret.mass = 1900. - ret.wheelbase = 3.00 - ret.centerToFront = ret.wheelbase * 0.41 - ret.steerRatio = 14.35 # as spec ret.tireStiffnessFactor = 0.82 ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.28], [0.08]] if candidate == CAR.ODYSSEY_CHN: @@ -236,37 +186,21 @@ class CarInterface(CarInterfaceBase): ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end elif candidate == CAR.PILOT: - ret.mass = 4278. * CV.LB_TO_KG # average weight - ret.wheelbase = 2.86 - ret.centerToFront = ret.wheelbase * 0.428 - ret.steerRatio = 16.0 # as spec ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end ret.tireStiffnessFactor = 0.444 ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]] elif candidate == CAR.RIDGELINE: - ret.mass = 4515. * CV.LB_TO_KG - ret.wheelbase = 3.18 - ret.centerToFront = ret.wheelbase * 0.41 - ret.steerRatio = 15.59 # as spec ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end ret.tireStiffnessFactor = 0.444 ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]] elif candidate == CAR.INSIGHT: - ret.mass = 2987. * CV.LB_TO_KG - ret.wheelbase = 2.7 - ret.centerToFront = ret.wheelbase * 0.39 - ret.steerRatio = 15.0 # 12.58 is spec end-to-end ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end ret.tireStiffnessFactor = 0.82 ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] elif candidate == CAR.HONDA_E: - ret.mass = 3338.8 * CV.LB_TO_KG - ret.wheelbase = 2.5 - ret.centerToFront = ret.wheelbase * 0.5 - ret.steerRatio = 16.71 ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end ret.tireStiffnessFactor = 0.82 ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.6], [0.18]] # TODO: can probably use some tuning @@ -275,7 +209,11 @@ class CarInterface(CarInterfaceBase): raise ValueError(f"unsupported car {candidate}") # These cars use alternate user brake msg (0x1BE) - if candidate in HONDA_BOSCH_ALT_BRAKE_SIGNAL: + # TODO: Only detect feature for Accord/Accord Hybrid, not all Bosch DBCs have BRAKE_MODULE + if 0x1BE in fingerprint[CAN.pt] and candidate == CAR.ACCORD: + ret.flags |= HondaFlags.BOSCH_ALT_BRAKE.value + + if ret.flags & HondaFlags.BOSCH_ALT_BRAKE: ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HONDA_ALT_BRAKE # These cars use alternate SCM messages (SCM_FEEDBACK AND SCM_BUTTON) diff --git a/selfdrive/car/honda/values.py b/selfdrive/car/honda/values.py index 2878076de..a6b7d2656 100644 --- a/selfdrive/car/honda/values.py +++ b/selfdrive/car/honda/values.py @@ -1,11 +1,10 @@ from dataclasses import dataclass -from enum import Enum, IntFlag, StrEnum -from typing import Dict, List, Optional, Union +from enum import Enum, IntFlag from cereal import car from openpilot.common.conversions import Conversions as CV from panda.python import uds -from openpilot.selfdrive.car import dbc_dict +from openpilot.selfdrive.car import CarSpecs, PlatformConfig, Platforms, dbc_dict from openpilot.selfdrive.car.docs_definitions import CarFootnote, CarHarness, CarInfo, CarParts, Column from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries, p16 @@ -47,8 +46,18 @@ class CarControllerParams: class HondaFlags(IntFlag): + # Detected flags # Bosch models with alternate set of LKAS_HUD messages BOSCH_EXT_HUD = 1 + BOSCH_ALT_BRAKE = 2 + + # Static flags + BOSCH = 4 + BOSCH_RADARLESS = 8 + + NIDEC = 16 + NIDEC_ALT_PCM_ACCEL = 32 + NIDEC_ALT_SCM_MESSAGES = 64 # Car button codes @@ -72,30 +81,15 @@ VISUAL_HUD = { } -class CAR(StrEnum): - ACCORD = "HONDA ACCORD 2018" - ACCORDH = "HONDA ACCORD HYBRID 2018" - CIVIC = "HONDA CIVIC 2016" - CIVIC_BOSCH = "HONDA CIVIC (BOSCH) 2019" - CIVIC_BOSCH_DIESEL = "HONDA CIVIC SEDAN 1.6 DIESEL 2019" - CIVIC_2022 = "HONDA CIVIC 2022" - ACURA_ILX = "ACURA ILX 2016" - CRV = "HONDA CR-V 2016" - CRV_5G = "HONDA CR-V 2017" - CRV_EU = "HONDA CR-V EU 2016" - CRV_HYBRID = "HONDA CR-V HYBRID 2019" - FIT = "HONDA FIT 2018" - FREED = "HONDA FREED 2020" - HRV = "HONDA HRV 2019" - HRV_3G = "HONDA HR-V 2023" - ODYSSEY = "HONDA ODYSSEY 2018" - ODYSSEY_CHN = "HONDA ODYSSEY CHN 2019" - ACURA_RDX = "ACURA RDX 2018" - ACURA_RDX_3G = "ACURA RDX 2020" - PILOT = "HONDA PILOT 2017" - RIDGELINE = "HONDA RIDGELINE 2017" - INSIGHT = "HONDA INSIGHT 2019" - HONDA_E = "HONDA E 2020" +@dataclass +class HondaCarInfo(CarInfo): + package: str = "Honda Sensing" + + def init_make(self, CP: car.CarParams): + if CP.flags & HondaFlags.BOSCH: + self.car_parts = CarParts.common([CarHarness.bosch_b]) if CP.flags & HondaFlags.BOSCH_RADARLESS else CarParts.common([CarHarness.bosch_a]) + else: + self.car_parts = CarParts.common([CarHarness.nidec]) class Footnote(Enum): @@ -104,55 +98,182 @@ class Footnote(Enum): Column.FSR_STEERING) -@dataclass -class HondaCarInfo(CarInfo): - package: str = "Honda Sensing" - - def init_make(self, CP: car.CarParams): - if CP.carFingerprint in HONDA_BOSCH: - self.car_parts = CarParts.common([CarHarness.bosch_b]) if CP.carFingerprint in HONDA_BOSCH_RADARLESS else CarParts.common([CarHarness.bosch_a]) - else: - self.car_parts = CarParts.common([CarHarness.nidec]) +class HondaBoschPlatformConfig(PlatformConfig): + def init(self): + self.flags |= HondaFlags.BOSCH -CAR_INFO: Dict[str, Optional[Union[HondaCarInfo, List[HondaCarInfo]]]] = { - CAR.ACCORD: [ - HondaCarInfo("Honda Accord 2018-22", "All", video_link="https://www.youtube.com/watch?v=mrUwlj3Mi58", min_steer_speed=3. * CV.MPH_TO_MS), - HondaCarInfo("Honda Inspire 2018", "All", min_steer_speed=3. * CV.MPH_TO_MS), - ], - CAR.ACCORDH: HondaCarInfo("Honda Accord Hybrid 2018-22", "All", min_steer_speed=3. * CV.MPH_TO_MS), - CAR.CIVIC: HondaCarInfo("Honda Civic 2016-18", min_steer_speed=12. * CV.MPH_TO_MS, video_link="https://youtu.be/-IkImTe1NYE"), - CAR.CIVIC_BOSCH: [ - HondaCarInfo("Honda Civic 2019-21", "All", video_link="https://www.youtube.com/watch?v=4Iz1Mz5LGF8", - footnotes=[Footnote.CIVIC_DIESEL], min_steer_speed=2. * CV.MPH_TO_MS), - HondaCarInfo("Honda Civic Hatchback 2017-21", min_steer_speed=12. * CV.MPH_TO_MS), - ], - CAR.CIVIC_BOSCH_DIESEL: None, # same platform - CAR.CIVIC_2022: [ - HondaCarInfo("Honda Civic 2022-23", "All", video_link="https://youtu.be/ytiOT5lcp6Q"), - HondaCarInfo("Honda Civic Hatchback 2022-23", "All", video_link="https://youtu.be/ytiOT5lcp6Q"), - ], - CAR.ACURA_ILX: HondaCarInfo("Acura ILX 2016-19", "AcuraWatch Plus", min_steer_speed=25. * CV.MPH_TO_MS), - CAR.CRV: HondaCarInfo("Honda CR-V 2015-16", "Touring Trim", min_steer_speed=12. * CV.MPH_TO_MS), - CAR.CRV_5G: HondaCarInfo("Honda CR-V 2017-22", min_steer_speed=12. * CV.MPH_TO_MS), - CAR.CRV_EU: None, # HondaCarInfo("Honda CR-V EU", "Touring"), # Euro version of CRV Touring - CAR.CRV_HYBRID: HondaCarInfo("Honda CR-V Hybrid 2017-20", min_steer_speed=12. * CV.MPH_TO_MS), - CAR.FIT: HondaCarInfo("Honda Fit 2018-20", min_steer_speed=12. * CV.MPH_TO_MS), - CAR.FREED: HondaCarInfo("Honda Freed 2020", min_steer_speed=12. * CV.MPH_TO_MS), - CAR.HRV: HondaCarInfo("Honda HR-V 2019-22", min_steer_speed=12. * CV.MPH_TO_MS), - CAR.HRV_3G: HondaCarInfo("Honda HR-V 2023", "All"), - CAR.ODYSSEY: HondaCarInfo("Honda Odyssey 2018-20"), - CAR.ODYSSEY_CHN: None, # Chinese version of Odyssey - CAR.ACURA_RDX: HondaCarInfo("Acura RDX 2016-18", "AcuraWatch Plus", min_steer_speed=12. * CV.MPH_TO_MS), - CAR.ACURA_RDX_3G: HondaCarInfo("Acura RDX 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS), - CAR.PILOT: [ - HondaCarInfo("Honda Pilot 2016-22", min_steer_speed=12. * CV.MPH_TO_MS), - HondaCarInfo("Honda Passport 2019-23", "All", min_steer_speed=12. * CV.MPH_TO_MS), - ], - CAR.RIDGELINE: HondaCarInfo("Honda Ridgeline 2017-24", min_steer_speed=12. * CV.MPH_TO_MS), - CAR.INSIGHT: HondaCarInfo("Honda Insight 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS), - CAR.HONDA_E: HondaCarInfo("Honda e 2020", "All", min_steer_speed=3. * CV.MPH_TO_MS), -} +class HondaNidecPlatformConfig(PlatformConfig): + def init(self): + self.flags |= HondaFlags.NIDEC + + +class CAR(Platforms): + # Bosch Cars + ACCORD = HondaBoschPlatformConfig( + "HONDA ACCORD 2018", + [ + HondaCarInfo("Honda Accord 2018-22", "All", video_link="https://www.youtube.com/watch?v=mrUwlj3Mi58", min_steer_speed=3. * CV.MPH_TO_MS), + HondaCarInfo("Honda Inspire 2018", "All", min_steer_speed=3. * CV.MPH_TO_MS), + HondaCarInfo("Honda Accord Hybrid 2018-22", "All", min_steer_speed=3. * CV.MPH_TO_MS), + ], + CarSpecs(mass=3279 * CV.LB_TO_KG, wheelbase=2.83, steerRatio=16.33, centerToFrontRatio=0.39), # steerRatio: 11.82 is spec end-to-end + dbc_dict('honda_accord_2018_can_generated', None), + ) + CIVIC_BOSCH = HondaBoschPlatformConfig( + "HONDA CIVIC (BOSCH) 2019", + [ + HondaCarInfo("Honda Civic 2019-21", "All", video_link="https://www.youtube.com/watch?v=4Iz1Mz5LGF8", + footnotes=[Footnote.CIVIC_DIESEL], min_steer_speed=2. * CV.MPH_TO_MS), + HondaCarInfo("Honda Civic Hatchback 2017-21", min_steer_speed=12. * CV.MPH_TO_MS), + ], + CarSpecs(mass=1326, wheelbase=2.7, steerRatio=15.38, centerToFrontRatio=0.4), # steerRatio: 10.93 is end-to-end spec + dbc_dict('honda_civic_hatchback_ex_2017_can_generated', None), + ) + CIVIC_BOSCH_DIESEL = HondaBoschPlatformConfig( + "HONDA CIVIC SEDAN 1.6 DIESEL 2019", + None, # don't show in docs + CIVIC_BOSCH.specs, + dbc_dict('honda_accord_2018_can_generated', None), + ) + CIVIC_2022 = HondaBoschPlatformConfig( + "HONDA CIVIC 2022", + [ + HondaCarInfo("Honda Civic 2022-23", "All", video_link="https://youtu.be/ytiOT5lcp6Q"), + HondaCarInfo("Honda Civic Hatchback 2022-23", "All", video_link="https://youtu.be/ytiOT5lcp6Q"), + ], + CIVIC_BOSCH.specs, + dbc_dict('honda_civic_ex_2022_can_generated', None), + flags=HondaFlags.BOSCH_RADARLESS, + ) + CRV_5G = HondaBoschPlatformConfig( + "HONDA CR-V 2017", + HondaCarInfo("Honda CR-V 2017-22", min_steer_speed=12. * CV.MPH_TO_MS), + CarSpecs(mass=3410 * CV.LB_TO_KG, wheelbase=2.66, steerRatio=16.0, centerToFrontRatio=0.41), # steerRatio: 12.3 is spec end-to-end + dbc_dict('honda_crv_ex_2017_can_generated', None, body_dbc='honda_crv_ex_2017_body_generated'), + flags=HondaFlags.BOSCH_ALT_BRAKE, + ) + CRV_HYBRID = HondaBoschPlatformConfig( + "HONDA CR-V HYBRID 2019", + HondaCarInfo("Honda CR-V Hybrid 2017-20", min_steer_speed=12. * CV.MPH_TO_MS), + CarSpecs(mass=1667, wheelbase=2.66, steerRatio=16, centerToFrontRatio=0.41), # mass: mean of 4 models in kg, steerRatio: 12.3 is spec end-to-end + dbc_dict('honda_accord_2018_can_generated', None), + ) + HRV_3G = HondaBoschPlatformConfig( + "HONDA HR-V 2023", + HondaCarInfo("Honda HR-V 2023", "All"), + CarSpecs(mass=3125 * CV.LB_TO_KG, wheelbase=2.61, steerRatio=15.2, centerToFrontRatio=0.41), + dbc_dict('honda_civic_ex_2022_can_generated', None), + flags=HondaFlags.BOSCH_RADARLESS | HondaFlags.BOSCH_ALT_BRAKE, + ) + ACURA_RDX_3G = HondaBoschPlatformConfig( + "ACURA RDX 2020", + HondaCarInfo("Acura RDX 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS), + CarSpecs(mass=4068 * CV.LB_TO_KG, wheelbase=2.75, steerRatio=11.95, centerToFrontRatio=0.41), # as spec + dbc_dict('acura_rdx_2020_can_generated', None), + flags=HondaFlags.BOSCH_ALT_BRAKE, + ) + INSIGHT = HondaBoschPlatformConfig( + "HONDA INSIGHT 2019", + HondaCarInfo("Honda Insight 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS), + CarSpecs(mass=2987 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.0, centerToFrontRatio=0.39), # as spec + dbc_dict('honda_insight_ex_2019_can_generated', None), + ) + HONDA_E = HondaBoschPlatformConfig( + "HONDA E 2020", + HondaCarInfo("Honda e 2020", "All", min_steer_speed=3. * CV.MPH_TO_MS), + CarSpecs(mass=3338.8 * CV.LB_TO_KG, wheelbase=2.5, centerToFrontRatio=0.5, steerRatio=16.71), + dbc_dict('acura_rdx_2020_can_generated', None), + ) + + # Nidec Cars + ACURA_ILX = HondaNidecPlatformConfig( + "ACURA ILX 2016", + HondaCarInfo("Acura ILX 2016-19", "AcuraWatch Plus", min_steer_speed=25. * CV.MPH_TO_MS), + CarSpecs(mass=3095 * CV.LB_TO_KG, wheelbase=2.67, steerRatio=18.61, centerToFrontRatio=0.37), # 15.3 is spec end-to-end + dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'), + flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES, + ) + CRV = HondaNidecPlatformConfig( + "HONDA CR-V 2016", + HondaCarInfo("Honda CR-V 2015-16", "Touring Trim", min_steer_speed=12. * CV.MPH_TO_MS), + CarSpecs(mass=3572 * CV.LB_TO_KG, wheelbase=2.62, steerRatio=16.89, centerToFrontRatio=0.41), # as spec + dbc_dict('honda_crv_touring_2016_can_generated', 'acura_ilx_2016_nidec'), + flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES, + ) + CRV_EU = HondaNidecPlatformConfig( + "HONDA CR-V EU 2016", + None, # Euro version of CRV Touring, don't show in docs + CRV.specs, + dbc_dict('honda_crv_executive_2016_can_generated', 'acura_ilx_2016_nidec'), + flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES, + ) + FIT = HondaNidecPlatformConfig( + "HONDA FIT 2018", + HondaCarInfo("Honda Fit 2018-20", min_steer_speed=12. * CV.MPH_TO_MS), + CarSpecs(mass=2644 * CV.LB_TO_KG, wheelbase=2.53, steerRatio=13.06, centerToFrontRatio=0.39), + dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'), + flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES, + ) + FREED = HondaNidecPlatformConfig( + "HONDA FREED 2020", + HondaCarInfo("Honda Freed 2020", min_steer_speed=12. * CV.MPH_TO_MS), + CarSpecs(mass=3086. * CV.LB_TO_KG, wheelbase=2.74, steerRatio=13.06, centerToFrontRatio=0.39), # mostly copied from FIT + dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'), + flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES, + ) + HRV = HondaNidecPlatformConfig( + "HONDA HRV 2019", + HondaCarInfo("Honda HR-V 2019-22", min_steer_speed=12. * CV.MPH_TO_MS), + HRV_3G.specs, + dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'), + flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES, + ) + ODYSSEY = HondaNidecPlatformConfig( + "HONDA ODYSSEY 2018", + HondaCarInfo("Honda Odyssey 2018-20"), + CarSpecs(mass=1900, wheelbase=3.0, steerRatio=14.35, centerToFrontRatio=0.41), + dbc_dict('honda_odyssey_exl_2018_generated', 'acura_ilx_2016_nidec'), + flags=HondaFlags.NIDEC_ALT_PCM_ACCEL, + ) + ODYSSEY_CHN = HondaNidecPlatformConfig( + "HONDA ODYSSEY CHN 2019", + None, # Chinese version of Odyssey, don't show in docs + ODYSSEY.specs, + dbc_dict('honda_odyssey_extreme_edition_2018_china_can_generated', 'acura_ilx_2016_nidec'), + flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES, + ) + ACURA_RDX = HondaNidecPlatformConfig( + "ACURA RDX 2018", + HondaCarInfo("Acura RDX 2016-18", "AcuraWatch Plus", min_steer_speed=12. * CV.MPH_TO_MS), + CarSpecs(mass=3925 * CV.LB_TO_KG, wheelbase=2.68, steerRatio=15.0, centerToFrontRatio=0.38), # as spec + dbc_dict('acura_rdx_2018_can_generated', 'acura_ilx_2016_nidec'), + flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES, + ) + PILOT = HondaNidecPlatformConfig( + "HONDA PILOT 2017", + [ + HondaCarInfo("Honda Pilot 2016-22", min_steer_speed=12. * CV.MPH_TO_MS), + HondaCarInfo("Honda Passport 2019-23", "All", min_steer_speed=12. * CV.MPH_TO_MS), + ], + CarSpecs(mass=4278 * CV.LB_TO_KG, wheelbase=2.86, centerToFrontRatio=0.428, steerRatio=16.0), # as spec + dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'), + flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES, + ) + RIDGELINE = HondaNidecPlatformConfig( + "HONDA RIDGELINE 2017", + HondaCarInfo("Honda Ridgeline 2017-24", min_steer_speed=12. * CV.MPH_TO_MS), + CarSpecs(mass=4515 * CV.LB_TO_KG, wheelbase=3.18, centerToFrontRatio=0.41, steerRatio=15.59), # as spec + dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'), + flags=HondaFlags.NIDEC_ALT_SCM_MESSAGES, + ) + CIVIC = HondaNidecPlatformConfig( + "HONDA CIVIC 2016", + HondaCarInfo("Honda Civic 2016-18", min_steer_speed=12. * CV.MPH_TO_MS, video_link="https://youtu.be/-IkImTe1NYE"), + CarSpecs(mass=1326, wheelbase=2.70, centerToFrontRatio=0.4, steerRatio=15.38), # 10.93 is end-to-end spec + dbc_dict('honda_civic_touring_2016_can_generated', 'acura_ilx_2016_nidec'), + ) + HONDA_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ p16(0xF112) @@ -188,60 +309,45 @@ FW_QUERY_CONFIG = FwQueryConfig( [StdQueries.UDS_VERSION_REQUEST], [StdQueries.UDS_VERSION_RESPONSE], bus=0, - logging=True, ), # Bosch PT bus Request( [StdQueries.UDS_VERSION_REQUEST], [StdQueries.UDS_VERSION_RESPONSE], bus=1, - logging=True, obd_multiplexing=False, ), ], + # We lose these ECUs without the comma power on these cars. + # Note that we still attempt to match with them when they are present + non_essential_ecus={ + Ecu.programmedFuelInjection: [CAR.ACCORD, CAR.CIVIC, CAR.CIVIC_BOSCH, CAR.CRV_5G], + Ecu.transmission: [CAR.ACCORD, CAR.CIVIC, CAR.CIVIC_BOSCH, CAR.CRV_5G], + Ecu.srs: [CAR.ACCORD], + Ecu.eps: [CAR.ACCORD], + Ecu.vsa: [CAR.ACCORD, CAR.CIVIC, CAR.CIVIC_BOSCH, CAR.CRV_5G], + Ecu.combinationMeter: [CAR.ACCORD, CAR.CIVIC, CAR.CIVIC_BOSCH, CAR.CRV_5G], + Ecu.gateway: [CAR.ACCORD, CAR.CIVIC, CAR.CIVIC_BOSCH, CAR.CRV_5G], + Ecu.electricBrakeBooster: [CAR.ACCORD, CAR.CIVIC_BOSCH, CAR.CRV_5G], + Ecu.shiftByWire: [CAR.ACCORD], # existence correlates with transmission type for ICE + Ecu.hud: [CAR.ACCORD], # existence correlates with trim level + }, extra_ecus=[ # The only other ECU on PT bus accessible by camera on radarless Civic (Ecu.unknown, 0x18DAB3F1, None), ], ) - -DBC = { - CAR.ACCORD: dbc_dict('honda_accord_2018_can_generated', None), - CAR.ACCORDH: dbc_dict('honda_accord_2018_can_generated', None), - CAR.ACURA_ILX: dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'), - CAR.ACURA_RDX: dbc_dict('acura_rdx_2018_can_generated', 'acura_ilx_2016_nidec'), - CAR.ACURA_RDX_3G: dbc_dict('acura_rdx_2020_can_generated', None), - CAR.CIVIC: dbc_dict('honda_civic_touring_2016_can_generated', 'acura_ilx_2016_nidec'), - CAR.CIVIC_BOSCH: dbc_dict('honda_civic_hatchback_ex_2017_can_generated', None), - CAR.CIVIC_BOSCH_DIESEL: dbc_dict('honda_accord_2018_can_generated', None), - CAR.CRV: dbc_dict('honda_crv_touring_2016_can_generated', 'acura_ilx_2016_nidec'), - CAR.CRV_5G: dbc_dict('honda_crv_ex_2017_can_generated', None, body_dbc='honda_crv_ex_2017_body_generated'), - CAR.CRV_EU: dbc_dict('honda_crv_executive_2016_can_generated', 'acura_ilx_2016_nidec'), - CAR.CRV_HYBRID: dbc_dict('honda_accord_2018_can_generated', None), - CAR.FIT: dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'), - CAR.FREED: dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'), - CAR.HRV: dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'), - CAR.HRV_3G: dbc_dict('honda_civic_ex_2022_can_generated', None), - CAR.ODYSSEY: dbc_dict('honda_odyssey_exl_2018_generated', 'acura_ilx_2016_nidec'), - CAR.ODYSSEY_CHN: dbc_dict('honda_odyssey_extreme_edition_2018_china_can_generated', 'acura_ilx_2016_nidec'), - CAR.PILOT: dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'), - CAR.RIDGELINE: dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'), - CAR.INSIGHT: dbc_dict('honda_insight_ex_2019_can_generated', None), - CAR.HONDA_E: dbc_dict('acura_rdx_2020_can_generated', None), - CAR.CIVIC_2022: dbc_dict('honda_civic_ex_2022_can_generated', None), -} - STEER_THRESHOLD = { # default is 1200, overrides go here CAR.ACURA_RDX: 400, CAR.CRV_EU: 400, } -HONDA_NIDEC_ALT_PCM_ACCEL = {CAR.ODYSSEY} -HONDA_NIDEC_ALT_SCM_MESSAGES = {CAR.ACURA_ILX, CAR.ACURA_RDX, CAR.CRV, CAR.CRV_EU, CAR.FIT, CAR.FREED, CAR.HRV, CAR.ODYSSEY_CHN, - CAR.PILOT, CAR.RIDGELINE} -HONDA_BOSCH = {CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_5G, - CAR.CRV_HYBRID, CAR.INSIGHT, CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.CIVIC_2022, CAR.HRV_3G} -HONDA_BOSCH_ALT_BRAKE_SIGNAL = {CAR.ACCORD, CAR.CRV_5G, CAR.ACURA_RDX_3G, CAR.HRV_3G} -HONDA_BOSCH_RADARLESS = {CAR.CIVIC_2022, CAR.HRV_3G} +HONDA_NIDEC_ALT_PCM_ACCEL = CAR.with_flags(HondaFlags.NIDEC_ALT_PCM_ACCEL) +HONDA_NIDEC_ALT_SCM_MESSAGES = CAR.with_flags(HondaFlags.NIDEC_ALT_SCM_MESSAGES) +HONDA_BOSCH = CAR.with_flags(HondaFlags.BOSCH) +HONDA_BOSCH_RADARLESS = CAR.with_flags(HondaFlags.BOSCH_RADARLESS) + +CAR_INFO = CAR.create_carinfo_map() +DBC = CAR.create_dbc_map() diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index adeb8c5d0..03e15c797 100644 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -7,6 +7,7 @@ from openpilot.selfdrive.car import apply_driver_steer_torque_limits, common_fau from openpilot.selfdrive.car.hyundai import hyundaicanfd, hyundaican from openpilot.selfdrive.car.hyundai.hyundaicanfd import CanBus from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, Buttons, CarControllerParams, CANFD_CAR, CAR +from openpilot.selfdrive.car.interfaces import CarControllerBase VisualAlert = car.CarControl.HUDControl.VisualAlert LongCtrlState = car.CarControl.Actuators.LongControlState @@ -42,7 +43,7 @@ def process_hud_alert(enabled, fingerprint, hud_control): return sys_warning, sys_state, left_lane_warning, right_lane_warning -class CarController: +class CarController(CarControllerBase): def __init__(self, dbc_name, CP, VM): self.CP = CP self.CAN = CanBus(CP) @@ -62,7 +63,7 @@ class CarController: # steering torque # rick - from taco - self.params = CarControllerParams(self.CP, CS.out.vEgoRaw) + self.params.update(CS.out.vEgoRaw) new_steer = int(round(actuators.steer * self.params.STEER_MAX)) apply_steer = apply_driver_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, self.params) # rick - from taco @@ -138,7 +139,7 @@ class CarController: # button presses can_sends.extend(self.create_button_messages(CC, CS, use_clu11=False)) else: - can_sends.append(hyundaican.create_lkas11(self.packer, self.frame, self.car_fingerprint, apply_steer, apply_steer_req, + can_sends.append(hyundaican.create_lkas11(self.packer, self.frame, self.CP, apply_steer, apply_steer_req, torque_fault, CS.lkas11, sys_warning, sys_state, CC.enabled, hud_control.leftLaneVisible, hud_control.rightLaneVisible, left_lane_warning, right_lane_warning)) @@ -178,12 +179,12 @@ class CarController: can_sends = [] if use_clu11: if CC.cruiseControl.cancel: - can_sends.append(hyundaican.create_clu11(self.packer, self.frame, CS.clu11, Buttons.CANCEL, self.CP.carFingerprint)) + can_sends.append(hyundaican.create_clu11(self.packer, self.frame, CS.clu11, Buttons.CANCEL, self.CP)) elif CC.cruiseControl.resume: # send resume at a max freq of 10Hz if (self.frame - self.last_button_frame) * DT_CTRL > 0.1: # send 25 messages at a time to increases the likelihood of resume being accepted - can_sends.extend([hyundaican.create_clu11(self.packer, self.frame, CS.clu11, Buttons.RES_ACCEL, self.CP.carFingerprint)] * 25) + can_sends.extend([hyundaican.create_clu11(self.packer, self.frame, CS.clu11, Buttons.RES_ACCEL, self.CP)] * 25) if (self.frame - self.last_button_frame) * DT_CTRL >= 0.15: self.last_button_frame = self.frame else: diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index 2b887544f..645d48688 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -75,6 +75,8 @@ class CarState(CarStateBase): ret.vEgoRaw = (ret.wheelSpeeds.fl + ret.wheelSpeeds.fr + ret.wheelSpeeds.rl + ret.wheelSpeeds.rr) / 4. ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) ret.standstill = ret.wheelSpeeds.fl <= STANDSTILL_THRESHOLD and ret.wheelSpeeds.rr <= STANDSTILL_THRESHOLD + # rick - for taco tune + self.params.update(ret.vEgoRaw) self.cluster_speed_counter += 1 if self.cluster_speed_counter > CLUSTER_SAMPLE_RATE: diff --git a/selfdrive/car/hyundai/fingerprints.py b/selfdrive/car/hyundai/fingerprints.py index b82895042..d1fc1faab 100644 --- a/selfdrive/car/hyundai/fingerprints.py +++ b/selfdrive/car/hyundai/fingerprints.py @@ -1549,6 +1549,7 @@ FW_VERSIONS = { b'\xf1\x00NE1 MFC AT EUR LHD 1.00 1.06 99211-GI000 210813', b'\xf1\x00NE1 MFC AT EUR RHD 1.00 1.01 99211-GI010 211007', b'\xf1\x00NE1 MFC AT EUR RHD 1.00 1.02 99211-GI010 211206', + b'\xf1\x00NE1 MFC AT KOR LHD 1.00 1.00 99211-GI020 230719', b'\xf1\x00NE1 MFC AT KOR LHD 1.00 1.05 99211-GI010 220614', b'\xf1\x00NE1 MFC AT USA LHD 1.00 1.00 99211-GI020 230719', b'\xf1\x00NE1 MFC AT USA LHD 1.00 1.01 99211-GI010 211007', diff --git a/selfdrive/car/hyundai/hyundaican.py b/selfdrive/car/hyundai/hyundaican.py index bc29aeb98..0bf29664e 100644 --- a/selfdrive/car/hyundai/hyundaican.py +++ b/selfdrive/car/hyundai/hyundaican.py @@ -1,9 +1,9 @@ import crcmod -from openpilot.selfdrive.car.hyundai.values import CAR, CHECKSUM, CAMERA_SCC_CAR +from openpilot.selfdrive.car.hyundai.values import CAR, HyundaiFlags hyundai_checksum = crcmod.mkCrcFun(0x11D, initCrc=0xFD, rev=False, xorOut=0xdf) -def create_lkas11(packer, frame, car_fingerprint, apply_steer, steer_req, +def create_lkas11(packer, frame, CP, apply_steer, steer_req, torque_fault, lkas11, sys_warning, sys_state, enabled, left_lane, right_lane, left_lane_depart, right_lane_depart): @@ -33,12 +33,12 @@ def create_lkas11(packer, frame, car_fingerprint, apply_steer, steer_req, values["CF_Lkas_ToiFlt"] = torque_fault # seems to allow actuation on CR_Lkas_StrToqReq values["CF_Lkas_MsgCount"] = frame % 0x10 - if car_fingerprint in (CAR.SONATA, CAR.PALISADE, CAR.KIA_NIRO_EV, CAR.KIA_NIRO_HEV_2021, CAR.SANTA_FE, - CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV, CAR.KIA_SELTOS, CAR.ELANTRA_2021, CAR.GENESIS_G70_2020, - CAR.ELANTRA_HEV_2021, CAR.SONATA_HYBRID, CAR.KONA_EV, CAR.KONA_HEV, CAR.KONA_EV_2022, - CAR.SANTA_FE_2022, CAR.KIA_K5_2021, CAR.IONIQ_HEV_2022, CAR.SANTA_FE_HEV_2022, - CAR.SANTA_FE_PHEV_2022, CAR.KIA_STINGER_2022, CAR.KIA_K5_HEV_2020, CAR.KIA_CEED, - CAR.AZERA_6TH_GEN, CAR.AZERA_HEV_6TH_GEN, CAR.CUSTIN_1ST_GEN): + if CP.carFingerprint in (CAR.SONATA, CAR.PALISADE, CAR.KIA_NIRO_EV, CAR.KIA_NIRO_HEV_2021, CAR.SANTA_FE, + CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV, CAR.KIA_SELTOS, CAR.ELANTRA_2021, CAR.GENESIS_G70_2020, + CAR.ELANTRA_HEV_2021, CAR.SONATA_HYBRID, CAR.KONA_EV, CAR.KONA_HEV, CAR.KONA_EV_2022, + CAR.SANTA_FE_2022, CAR.KIA_K5_2021, CAR.IONIQ_HEV_2022, CAR.SANTA_FE_HEV_2022, + CAR.SANTA_FE_PHEV_2022, CAR.KIA_STINGER_2022, CAR.KIA_K5_HEV_2020, CAR.KIA_CEED, + CAR.AZERA_6TH_GEN, CAR.AZERA_HEV_6TH_GEN, CAR.CUSTIN_1ST_GEN): values["CF_Lkas_LdwsActivemode"] = int(left_lane) + (int(right_lane) << 1) values["CF_Lkas_LdwsOpt_USM"] = 2 @@ -57,7 +57,7 @@ def create_lkas11(packer, frame, car_fingerprint, apply_steer, steer_req, values["CF_Lkas_SysWarning"] = 4 if sys_warning else 0 # Likely cars lacking the ability to show individual lane lines in the dash - elif car_fingerprint in (CAR.KIA_OPTIMA_G4, CAR.KIA_OPTIMA_G4_FL): + elif CP.carFingerprint in (CAR.KIA_OPTIMA_G4, CAR.KIA_OPTIMA_G4_FL): # SysWarning 4 = keep hands on wheel + beep values["CF_Lkas_SysWarning"] = 4 if sys_warning else 0 @@ -72,18 +72,18 @@ def create_lkas11(packer, frame, car_fingerprint, apply_steer, steer_req, values["CF_Lkas_LdwsActivemode"] = 0 values["CF_Lkas_FcwOpt_USM"] = 0 - elif car_fingerprint == CAR.HYUNDAI_GENESIS: + elif CP.carFingerprint == CAR.HYUNDAI_GENESIS: # This field is actually LdwsActivemode # Genesis and Optima fault when forwarding while engaged values["CF_Lkas_LdwsActivemode"] = 2 dat = packer.make_can_msg("LKAS11", 0, values)[2] - if car_fingerprint in CHECKSUM["crc8"]: + if CP.flags & HyundaiFlags.CHECKSUM_CRC8: # CRC Checksum as seen on 2019 Hyundai Santa Fe dat = dat[:6] + dat[7:8] checksum = hyundai_checksum(dat) - elif car_fingerprint in CHECKSUM["6B"]: + elif CP.flags & HyundaiFlags.CHECKSUM_6B: # Checksum of first 6 Bytes, as seen on 2018 Kia Sorento checksum = sum(dat[:6]) % 256 else: @@ -95,7 +95,7 @@ def create_lkas11(packer, frame, car_fingerprint, apply_steer, steer_req, return packer.make_can_msg("LKAS11", 0, values) -def create_clu11(packer, frame, clu11, button, car_fingerprint): +def create_clu11(packer, frame, clu11, button, CP): values = {s: clu11[s] for s in [ "CF_Clu_CruiseSwState", "CF_Clu_CruiseSwMain", @@ -113,7 +113,7 @@ def create_clu11(packer, frame, clu11, button, car_fingerprint): values["CF_Clu_CruiseSwState"] = button values["CF_Clu_AliveCnt1"] = frame % 0x10 # send buttons to camera on camera-scc based cars - bus = 2 if car_fingerprint in CAMERA_SCC_CAR else 0 + bus = 2 if CP.flags & HyundaiFlags.CAMERA_SCC else 0 return packer.make_can_msg("CLU11", bus, values) diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index a3210f807..69b513280 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -1,6 +1,5 @@ from cereal import car from panda import Panda -from openpilot.common.conversions import Conversions as CV from openpilot.selfdrive.car.hyundai.hyundaicanfd import CanBus from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, CAR, DBC, CANFD_CAR, CAMERA_SCC_CAR, CANFD_RADAR_SCC_CAR, \ CANFD_UNSUPPORTED_LONGITUDINAL_CAR, EV_CAR, HYBRID_CAR, LEGACY_SAFETY_MODE_CAR, \ @@ -11,7 +10,6 @@ from openpilot.selfdrive.car.interfaces import CarInterfaceBase from openpilot.selfdrive.car.disable_ecu import disable_ecu Ecu = car.CarParams.Ecu -SafetyModel = car.CarParams.SafetyModel ButtonType = car.CarState.ButtonEvent.Type EventName = car.CarEvent.EventName ENABLE_BUTTONS = (Buttons.RES_ACCEL, Buttons.SET_DECEL, Buttons.CANCEL) @@ -19,17 +17,6 @@ BUTTONS_DICT = {Buttons.RES_ACCEL: ButtonType.accelCruise, Buttons.SET_DECEL: Bu Buttons.GAP_DIST: ButtonType.gapAdjustCruise, Buttons.CANCEL: ButtonType.cancel} -def set_safety_config_hyundai(candidate, CAN, can_fd=False): - platform = SafetyModel.hyundaiCanfd if can_fd else \ - SafetyModel.hyundaiLegacy if candidate in LEGACY_SAFETY_MODE_CAR else \ - SafetyModel.hyundai - cfgs = [get_safety_config(platform), ] - if CAN.ECAN >= 4: - cfgs.insert(0, get_safety_config(SafetyModel.noOutput)) - - return cfgs - - class CarInterface(CarInterfaceBase): @staticmethod def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): @@ -54,6 +41,7 @@ class CarInterface(CarInterfaceBase): # detect HDA2 with ADAS Driving ECU if hda2: + ret.flags |= HyundaiFlags.CANFD_HDA2.value if 0x110 in fingerprint[CAN.CAM]: ret.flags |= HyundaiFlags.CANFD_HDA2_ALT_STEERING.value else: @@ -87,196 +75,6 @@ class CarInterface(CarInterfaceBase): ret.steerLimitTimer = 0.4 CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) - if candidate in (CAR.AZERA_6TH_GEN, CAR.AZERA_HEV_6TH_GEN): - ret.mass = 1600. if candidate == CAR.AZERA_6TH_GEN else 1675. # ICE is ~average of 2.5L and 3.5L - ret.wheelbase = 2.885 - ret.steerRatio = 14.5 - elif candidate in (CAR.SANTA_FE, CAR.SANTA_FE_2022, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022): - ret.mass = 3982. * CV.LB_TO_KG - ret.wheelbase = 2.766 - # Values from optimizer - ret.steerRatio = 16.55 # 13.8 is spec end-to-end - ret.tireStiffnessFactor = 0.82 - elif candidate in (CAR.SONATA, CAR.SONATA_HYBRID): - ret.mass = 1513. - ret.wheelbase = 2.84 - ret.steerRatio = 13.27 * 1.15 # 15% higher at the center seems reasonable - ret.tireStiffnessFactor = 0.65 - elif candidate == CAR.SONATA_LF: - ret.mass = 1536. - ret.wheelbase = 2.804 - ret.steerRatio = 13.27 * 1.15 # 15% higher at the center seems reasonable - elif candidate == CAR.PALISADE: - ret.mass = 1999. - ret.wheelbase = 2.90 - ret.steerRatio = 15.6 * 1.15 - ret.tireStiffnessFactor = 0.63 - elif candidate in (CAR.ELANTRA, CAR.ELANTRA_GT_I30): - ret.mass = 1275. - ret.wheelbase = 2.7 - ret.steerRatio = 15.4 # 14 is Stock | Settled Params Learner values are steerRatio: 15.401566348670535 - ret.tireStiffnessFactor = 0.385 # stiffnessFactor settled on 1.0081302973865127 - ret.minSteerSpeed = 32 * CV.MPH_TO_MS - elif candidate == CAR.ELANTRA_2021: - ret.mass = 2800. * CV.LB_TO_KG - ret.wheelbase = 2.72 - ret.steerRatio = 12.9 - ret.tireStiffnessFactor = 0.65 - elif candidate == CAR.ELANTRA_HEV_2021: - ret.mass = 3017. * CV.LB_TO_KG - ret.wheelbase = 2.72 - ret.steerRatio = 12.9 - ret.tireStiffnessFactor = 0.65 - elif candidate == CAR.HYUNDAI_GENESIS: - ret.mass = 2060. - ret.wheelbase = 3.01 - ret.steerRatio = 16.5 - ret.minSteerSpeed = 60 * CV.KPH_TO_MS - elif candidate in (CAR.KONA, CAR.KONA_EV, CAR.KONA_HEV, CAR.KONA_EV_2022, CAR.KONA_EV_2ND_GEN): - ret.mass = {CAR.KONA_EV: 1685., CAR.KONA_HEV: 1425., CAR.KONA_EV_2022: 1743., CAR.KONA_EV_2ND_GEN: 1740.}.get(candidate, 1275.) - ret.wheelbase = {CAR.KONA_EV_2ND_GEN: 2.66, }.get(candidate, 2.6) - ret.steerRatio = {CAR.KONA_EV_2ND_GEN: 13.6, }.get(candidate, 13.42) # Spec - ret.tireStiffnessFactor = 0.385 - elif candidate in (CAR.IONIQ, CAR.IONIQ_EV_LTD, CAR.IONIQ_PHEV_2019, CAR.IONIQ_HEV_2022, CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV): - ret.mass = 1490. # weight per hyundai site https://www.hyundaiusa.com/ioniq-electric/specifications.aspx - ret.wheelbase = 2.7 - ret.steerRatio = 13.73 # Spec - ret.tireStiffnessFactor = 0.385 - if candidate in (CAR.IONIQ, CAR.IONIQ_EV_LTD, CAR.IONIQ_PHEV_2019): - ret.minSteerSpeed = 32 * CV.MPH_TO_MS - elif candidate in (CAR.IONIQ_5, CAR.IONIQ_6): - ret.mass = 1948 - ret.wheelbase = 2.97 - ret.steerRatio = 14.26 - ret.tireStiffnessFactor = 0.65 - elif candidate == CAR.VELOSTER: - ret.mass = 2917. * CV.LB_TO_KG - ret.wheelbase = 2.80 - ret.steerRatio = 13.75 * 1.15 - ret.tireStiffnessFactor = 0.5 - elif candidate == CAR.TUCSON: - ret.mass = 3520. * CV.LB_TO_KG - ret.wheelbase = 2.67 - ret.steerRatio = 14.00 * 1.15 - ret.tireStiffnessFactor = 0.385 - elif candidate == CAR.TUCSON_4TH_GEN: - ret.mass = 1630. # average - ret.wheelbase = 2.756 - ret.steerRatio = 16. - ret.tireStiffnessFactor = 0.385 - elif candidate == CAR.SANTA_CRUZ_1ST_GEN: - ret.mass = 1870. # weight from Limited trim - the only supported trim - ret.wheelbase = 3.000 - # steering ratio according to Hyundai News https://www.hyundainews.com/assets/documents/original/48035-2022SantaCruzProductGuideSpecsv2081521.pdf - ret.steerRatio = 14.2 - elif candidate == CAR.CUSTIN_1ST_GEN: - ret.mass = 1690. # from https://www.hyundai-motor.com.tw/clicktobuy/custin#spec_0 - ret.wheelbase = 3.055 - ret.steerRatio = 17.0 # from learner - elif candidate == CAR.STARIA_4TH_GEN: - ret.mass = 2205. - ret.wheelbase = 3.273 - ret.steerRatio = 11.94 # https://www.hyundai.com/content/dam/hyundai/au/en/models/staria-load/premium-pip-update-2023/spec-sheet/STARIA_Load_Spec-Table_March_2023_v3.1.pdf - - # Kia - elif candidate == CAR.KIA_SORENTO: - ret.mass = 1985. - ret.wheelbase = 2.78 - ret.steerRatio = 14.4 * 1.1 # 10% higher at the center seems reasonable - elif candidate in (CAR.KIA_NIRO_EV, CAR.KIA_NIRO_EV_2ND_GEN, CAR.KIA_NIRO_PHEV, CAR.KIA_NIRO_HEV_2021, CAR.KIA_NIRO_HEV_2ND_GEN, CAR.KIA_NIRO_PHEV_2022): - ret.mass = 3543. * CV.LB_TO_KG # average of all the cars - ret.wheelbase = 2.7 - ret.steerRatio = 13.6 # average of all the cars - ret.tireStiffnessFactor = 0.385 - if candidate == CAR.KIA_NIRO_PHEV: - ret.minSteerSpeed = 32 * CV.MPH_TO_MS - elif candidate == CAR.KIA_SELTOS: - ret.mass = 1337. - ret.wheelbase = 2.63 - ret.steerRatio = 14.56 - elif candidate == CAR.KIA_SPORTAGE_5TH_GEN: - ret.mass = 1725. # weight from SX and above trims, average of FWD and AWD versions - ret.wheelbase = 2.756 - ret.steerRatio = 13.6 # steering ratio according to Kia News https://www.kiamedia.com/us/en/models/sportage/2023/specifications - elif candidate in (CAR.KIA_OPTIMA_G4, CAR.KIA_OPTIMA_G4_FL, CAR.KIA_OPTIMA_H, CAR.KIA_OPTIMA_H_G4_FL): - ret.mass = 3558. * CV.LB_TO_KG - ret.wheelbase = 2.80 - ret.steerRatio = 13.75 - ret.tireStiffnessFactor = 0.5 - if candidate == CAR.KIA_OPTIMA_G4: - ret.minSteerSpeed = 32 * CV.MPH_TO_MS - elif candidate in (CAR.KIA_STINGER, CAR.KIA_STINGER_2022): - ret.mass = 1825. - ret.wheelbase = 2.78 - ret.steerRatio = 14.4 * 1.15 # 15% higher at the center seems reasonable - elif candidate == CAR.KIA_FORTE: - ret.mass = 2878. * CV.LB_TO_KG - ret.wheelbase = 2.80 - ret.steerRatio = 13.75 - ret.tireStiffnessFactor = 0.5 - elif candidate == CAR.KIA_CEED: - ret.mass = 1450. - ret.wheelbase = 2.65 - ret.steerRatio = 13.75 - ret.tireStiffnessFactor = 0.5 - elif candidate in (CAR.KIA_K5_2021, CAR.KIA_K5_HEV_2020): - ret.mass = 3381. * CV.LB_TO_KG - ret.wheelbase = 2.85 - ret.steerRatio = 13.27 # 2021 Kia K5 Steering Ratio (all trims) - ret.tireStiffnessFactor = 0.5 - elif candidate == CAR.KIA_EV6: - ret.mass = 2055 - ret.wheelbase = 2.9 - ret.steerRatio = 16. - ret.tireStiffnessFactor = 0.65 - elif candidate in (CAR.KIA_SORENTO_4TH_GEN, CAR.KIA_SORENTO_HEV_4TH_GEN): - ret.wheelbase = 2.81 - ret.steerRatio = 13.5 # average of the platforms - if candidate == CAR.KIA_SORENTO_4TH_GEN: - ret.mass = 3957 * CV.LB_TO_KG - else: - ret.mass = 4396 * CV.LB_TO_KG - elif candidate == CAR.KIA_CARNIVAL_4TH_GEN: - ret.mass = 2087. - ret.wheelbase = 3.09 - ret.steerRatio = 14.23 - elif candidate == CAR.KIA_K8_HEV_1ST_GEN: - ret.mass = 1630. # https://carprices.ae/brands/kia/2023/k8/1.6-turbo-hybrid - ret.wheelbase = 2.895 - ret.steerRatio = 13.27 # guesstimate from K5 platform - - # Genesis - elif candidate == CAR.GENESIS_GV60_EV_1ST_GEN: - ret.mass = 2205 - ret.wheelbase = 2.9 - # https://www.motor1.com/reviews/586376/2023-genesis-gv60-first-drive/#:~:text=Relative%20to%20the%20related%20Ioniq,5%2FEV6%27s%2014.3%3A1. - ret.steerRatio = 12.6 - elif candidate == CAR.GENESIS_G70: - ret.steerActuatorDelay = 0.1 - ret.mass = 1640.0 - ret.wheelbase = 2.84 - ret.steerRatio = 13.56 - elif candidate == CAR.GENESIS_G70_2020: - ret.mass = 3673.0 * CV.LB_TO_KG - ret.wheelbase = 2.83 - ret.steerRatio = 12.9 - elif candidate == CAR.GENESIS_GV70_1ST_GEN: - ret.mass = 1950. - ret.wheelbase = 2.87 - ret.steerRatio = 14.6 - elif candidate == CAR.GENESIS_G80: - ret.mass = 2060. - ret.wheelbase = 3.01 - ret.steerRatio = 16.5 - elif candidate == CAR.GENESIS_G90: - ret.mass = 2200. - ret.wheelbase = 3.15 - ret.steerRatio = 12.069 - elif candidate == CAR.GENESIS_GV80: - ret.mass = 2258. - ret.wheelbase = 2.95 - ret.steerRatio = 14.14 - # *** longitudinal control *** if candidate in CANFD_CAR: ret.longitudinalTuning.kpV = [0.1] @@ -303,20 +101,30 @@ class CarInterface(CarInterfaceBase): ret.enableBsm = 0x58b in fingerprint[0] # *** panda safety config *** - ret.safetyConfigs = set_safety_config_hyundai(candidate, CAN, can_fd=(candidate in CANFD_CAR)) - - if hda2: - ret.flags |= HyundaiFlags.CANFD_HDA2.value - ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CANFD_HDA2 - if candidate in CANFD_CAR: - if hda2 and ret.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING: - ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CANFD_HDA2_ALT_STEERING + cfgs = [get_safety_config(car.CarParams.SafetyModel.hyundaiCanfd), ] + if CAN.ECAN >= 4: + cfgs.insert(0, get_safety_config(car.CarParams.SafetyModel.noOutput)) + ret.safetyConfigs = cfgs + + if ret.flags & HyundaiFlags.CANFD_HDA2: + ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CANFD_HDA2 + if ret.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING: + ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CANFD_HDA2_ALT_STEERING if ret.flags & HyundaiFlags.CANFD_ALT_BUTTONS: ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CANFD_ALT_BUTTONS + if ret.flags & HyundaiFlags.CANFD_CAMERA_SCC: + ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CAMERA_SCC + else: + if candidate in LEGACY_SAFETY_MODE_CAR: + # these cars require a special panda safety mode due to missing counters and checksums in the messages + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.hyundaiLegacy)] + else: + ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.hyundai, 0)] + + if candidate in CAMERA_SCC_CAR: + ret.safetyConfigs[0].safetyParam |= Panda.FLAG_HYUNDAI_CAMERA_SCC - if ret.flags & HyundaiFlags.CANFD_CAMERA_SCC or candidate in CAMERA_SCC_CAR: - ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_CAMERA_SCC if ret.openpilotLongitudinalControl: ret.safetyConfigs[-1].safetyParam |= Panda.FLAG_HYUNDAI_LONG if ret.flags & HyundaiFlags.HYBRID: diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index d56304e9f..33dcb638f 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -1,14 +1,14 @@ import re -from dataclasses import dataclass -from enum import Enum, IntFlag, StrEnum -from typing import Dict, List, Optional, Set, Tuple, Union +from dataclasses import dataclass, field +from enum import Enum, IntFlag from cereal import car from panda.python import uds from openpilot.common.conversions import Conversions as CV -from openpilot.selfdrive.car import dbc_dict +from openpilot.selfdrive.car import CarSpecs, DbcDict, PlatformConfig, Platforms, dbc_dict from openpilot.selfdrive.car.docs_definitions import CarFootnote, CarHarness, CarInfo, CarParts, Column from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, p16 +from common.params import Params Ecu = car.CarParams.Ecu @@ -17,7 +17,7 @@ class CarControllerParams: ACCEL_MIN = -3.5 # m/s ACCEL_MAX = 2.0 # m/s - def __init__(self, CP, vEgoRaw=100.): + def __init__(self, CP): self.STEER_DELTA_UP = 3 self.STEER_DELTA_DOWN = 7 self.STEER_DRIVER_ALLOWANCE = 50 @@ -25,21 +25,15 @@ class CarControllerParams: self.STEER_DRIVER_FACTOR = 1 self.STEER_THRESHOLD = 150 self.STEER_STEP = 1 # 100 Hz + self.dp_long_taco = Params().get_bool("dp_long_taco") and CP.carFingerprint in CANFD_CAR if CP.carFingerprint in CANFD_CAR: - # self.STEER_MAX = 270 - # self.STEER_DRIVER_ALLOWANCE = 250 - # self.STEER_DRIVER_MULTIPLIER = 2 - # self.STEER_THRESHOLD = 250 - # self.STEER_DELTA_UP = 2 - # self.STEER_DELTA_DOWN = 3 - # rick - taco tune - self.STEER_MAX = 384 if vEgoRaw < 11. else 330 - self.STEER_DRIVER_ALLOWANCE = 350 + self.STEER_MAX = 270 + self.STEER_DRIVER_ALLOWANCE = 250 self.STEER_DRIVER_MULTIPLIER = 2 - self.STEER_THRESHOLD = 350 - self.STEER_DELTA_UP = 10 if vEgoRaw < 11. else 2 - self.STEER_DELTA_DOWN = 10 if vEgoRaw < 11. else 3 + self.STEER_THRESHOLD = 250 + self.STEER_DELTA_UP = 2 + self.STEER_DELTA_DOWN = 3 # To determine the limit for your car, find the maximum value that the stock LKAS will request. # If the max stock LKAS request is <384, add your car to this list. @@ -58,94 +52,69 @@ class CarControllerParams: else: self.STEER_MAX = 384 + # rick - re-implement taco mode, thanks to stupefacient + def update(self, v_ego_raw: float = 100.): + if self.dp_long_taco: + if v_ego_raw < 11: + self.STEER_MAX = 384 + self.STEER_DRIVER_ALLOWANCE = 350 + self.STEER_DRIVER_MULTIPLIER = 2 + self.STEER_THRESHOLD = 350 + self.STEER_DELTA_UP = 10 + self.STEER_DELTA_DOWN = 10 + else: + # stock values + self.STEER_MAX = 270 + self.STEER_DRIVER_ALLOWANCE = 250 + self.STEER_DRIVER_MULTIPLIER = 2 + self.STEER_THRESHOLD = 250 + self.STEER_DELTA_UP = 2 + self.STEER_DELTA_DOWN = 3 + class HyundaiFlags(IntFlag): + # Dynamic Flags CANFD_HDA2 = 1 CANFD_ALT_BUTTONS = 2 - CANFD_ALT_GEARS = 4 - CANFD_CAMERA_SCC = 8 + CANFD_ALT_GEARS = 2 ** 2 + CANFD_CAMERA_SCC = 2 ** 3 - ALT_LIMITS = 16 - ENABLE_BLINKERS = 32 - CANFD_ALT_GEARS_2 = 64 - SEND_LFA = 128 - USE_FCA = 256 - CANFD_HDA2_ALT_STEERING = 512 - HYBRID = 1024 - EV = 2048 + ALT_LIMITS = 2 ** 4 + ENABLE_BLINKERS = 2 ** 5 + CANFD_ALT_GEARS_2 = 2 ** 6 + SEND_LFA = 2 ** 7 + USE_FCA = 2 ** 8 + CANFD_HDA2_ALT_STEERING = 2 ** 9 + # these cars use a different gas signal + HYBRID = 2 ** 10 + EV = 2 ** 11 -class CAR(StrEnum): - # Hyundai - AZERA_6TH_GEN = "HYUNDAI AZERA 6TH GEN" - AZERA_HEV_6TH_GEN = "HYUNDAI AZERA HYBRID 6TH GEN" - ELANTRA = "HYUNDAI ELANTRA 2017" - ELANTRA_GT_I30 = "HYUNDAI I30 N LINE 2019 & GT 2018 DCT" - ELANTRA_2021 = "HYUNDAI ELANTRA 2021" - ELANTRA_HEV_2021 = "HYUNDAI ELANTRA HYBRID 2021" - HYUNDAI_GENESIS = "HYUNDAI GENESIS 2015-2016" - IONIQ = "HYUNDAI IONIQ HYBRID 2017-2019" - IONIQ_HEV_2022 = "HYUNDAI IONIQ HYBRID 2020-2022" - IONIQ_EV_LTD = "HYUNDAI IONIQ ELECTRIC LIMITED 2019" - IONIQ_EV_2020 = "HYUNDAI IONIQ ELECTRIC 2020" - IONIQ_PHEV_2019 = "HYUNDAI IONIQ PLUG-IN HYBRID 2019" - IONIQ_PHEV = "HYUNDAI IONIQ PHEV 2020" - KONA = "HYUNDAI KONA 2020" - KONA_EV = "HYUNDAI KONA ELECTRIC 2019" - KONA_EV_2022 = "HYUNDAI KONA ELECTRIC 2022" - KONA_EV_2ND_GEN = "HYUNDAI KONA ELECTRIC 2ND GEN" - KONA_HEV = "HYUNDAI KONA HYBRID 2020" - SANTA_FE = "HYUNDAI SANTA FE 2019" - SANTA_FE_2022 = "HYUNDAI SANTA FE 2022" - SANTA_FE_HEV_2022 = "HYUNDAI SANTA FE HYBRID 2022" - SANTA_FE_PHEV_2022 = "HYUNDAI SANTA FE PlUG-IN HYBRID 2022" - SONATA = "HYUNDAI SONATA 2020" - SONATA_LF = "HYUNDAI SONATA 2019" - STARIA_4TH_GEN = "HYUNDAI STARIA 4TH GEN" - TUCSON = "HYUNDAI TUCSON 2019" - PALISADE = "HYUNDAI PALISADE 2020" - VELOSTER = "HYUNDAI VELOSTER 2019" - SONATA_HYBRID = "HYUNDAI SONATA HYBRID 2021" - IONIQ_5 = "HYUNDAI IONIQ 5 2022" - IONIQ_6 = "HYUNDAI IONIQ 6 2023" - TUCSON_4TH_GEN = "HYUNDAI TUCSON 4TH GEN" - SANTA_CRUZ_1ST_GEN = "HYUNDAI SANTA CRUZ 1ST GEN" - CUSTIN_1ST_GEN = "HYUNDAI CUSTIN 1ST GEN" + # Static flags - # Kia - KIA_FORTE = "KIA FORTE E 2018 & GT 2021" - KIA_K5_2021 = "KIA K5 2021" - KIA_K5_HEV_2020 = "KIA K5 HYBRID 2020" - KIA_K8_HEV_1ST_GEN = "KIA K8 HYBRID 1ST GEN" - KIA_NIRO_EV = "KIA NIRO EV 2020" - KIA_NIRO_EV_2ND_GEN = "KIA NIRO EV 2ND GEN" - KIA_NIRO_PHEV = "KIA NIRO HYBRID 2019" - KIA_NIRO_PHEV_2022 = "KIA NIRO PLUG-IN HYBRID 2022" - KIA_NIRO_HEV_2021 = "KIA NIRO HYBRID 2021" - KIA_NIRO_HEV_2ND_GEN = "KIA NIRO HYBRID 2ND GEN" - KIA_OPTIMA_G4 = "KIA OPTIMA 4TH GEN" - KIA_OPTIMA_G4_FL = "KIA OPTIMA 4TH GEN FACELIFT" - KIA_OPTIMA_H = "KIA OPTIMA HYBRID 2017 & SPORTS 2019" - KIA_OPTIMA_H_G4_FL = "KIA OPTIMA HYBRID 4TH GEN FACELIFT" - KIA_SELTOS = "KIA SELTOS 2021" - KIA_SPORTAGE_5TH_GEN = "KIA SPORTAGE 5TH GEN" - KIA_SORENTO = "KIA SORENTO GT LINE 2018" - KIA_SORENTO_4TH_GEN = "KIA SORENTO 4TH GEN" - KIA_SORENTO_HEV_4TH_GEN = "KIA SORENTO HYBRID 4TH GEN" - KIA_STINGER = "KIA STINGER GT2 2018" - KIA_STINGER_2022 = "KIA STINGER 2022" - KIA_CEED = "KIA CEED INTRO ED 2019" - KIA_EV6 = "KIA EV6 2022" - KIA_CARNIVAL_4TH_GEN = "KIA CARNIVAL 4TH GEN" + # If 0x500 is present on bus 1 it probably has a Mando radar outputting radar points. + # If no points are outputted by default it might be possible to turn it on using selfdrive/debug/hyundai_enable_radar_points.py + MANDO_RADAR = 2 ** 12 + CANFD = 2 ** 13 - # Genesis - GENESIS_GV60_EV_1ST_GEN = "GENESIS GV60 ELECTRIC 1ST GEN" - GENESIS_G70 = "GENESIS G70 2018" - GENESIS_G70_2020 = "GENESIS G70 2020" - GENESIS_GV70_1ST_GEN = "GENESIS GV70 1ST GEN" - GENESIS_G80 = "GENESIS G80 2017" - GENESIS_G90 = "GENESIS G90 2017" - GENESIS_GV80 = "GENESIS GV80 2023" + # The radar does SCC on these cars when HDA I, rather than the camera + RADAR_SCC = 2 ** 14 + CAMERA_SCC = 2 ** 15 + CHECKSUM_CRC8 = 2 ** 16 + CHECKSUM_6B = 2 ** 17 + + # these cars require a special panda safety mode due to missing counters and checksums in the messages + LEGACY = 2 ** 18 + + # these cars have not been verified to work with longitudinal yet - radar disable, sending correct messages, etc. + UNSUPPORTED_LONGITUDINAL = 2 ** 19 + + CANFD_NO_RADAR_DISABLE = 2 ** 20 + + CLUSTER_GEARS = 2 ** 21 + TCU_GEARS = 2 ** 22 + + MIN_STEER_32_MPH = 2 ** 23 class Footnote(Enum): @@ -160,160 +129,497 @@ class HyundaiCarInfo(CarInfo): package: str = "Smart Cruise Control (SCC)" def init_make(self, CP: car.CarParams): - if CP.carFingerprint in CANFD_CAR: + if CP.flags & HyundaiFlags.CANFD: self.footnotes.insert(0, Footnote.CANFD) -CAR_INFO: Dict[str, Optional[Union[HyundaiCarInfo, List[HyundaiCarInfo]]]] = { - CAR.AZERA_6TH_GEN: HyundaiCarInfo("Hyundai Azera 2022", "All", car_parts=CarParts.common([CarHarness.hyundai_k])), - CAR.AZERA_HEV_6TH_GEN: [ - HyundaiCarInfo("Hyundai Azera Hybrid 2019", "All", car_parts=CarParts.common([CarHarness.hyundai_c])), - HyundaiCarInfo("Hyundai Azera Hybrid 2020", "All", car_parts=CarParts.common([CarHarness.hyundai_k])), - ], - CAR.ELANTRA: [ - # TODO: 2017-18 could be Hyundai G - HyundaiCarInfo("Hyundai Elantra 2017-18", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_b])), - HyundaiCarInfo("Hyundai Elantra 2019", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_g])), - ], - CAR.ELANTRA_GT_I30: [ - HyundaiCarInfo("Hyundai Elantra GT 2017-19", car_parts=CarParts.common([CarHarness.hyundai_e])), - HyundaiCarInfo("Hyundai i30 2017-19", car_parts=CarParts.common([CarHarness.hyundai_e])), - ], - CAR.ELANTRA_2021: HyundaiCarInfo("Hyundai Elantra 2021-23", video_link="https://youtu.be/_EdYQtV52-c", car_parts=CarParts.common([CarHarness.hyundai_k])), - CAR.ELANTRA_HEV_2021: HyundaiCarInfo("Hyundai Elantra Hybrid 2021-23", video_link="https://youtu.be/_EdYQtV52-c", - car_parts=CarParts.common([CarHarness.hyundai_k])), - CAR.HYUNDAI_GENESIS: [ - # TODO: check 2015 packages - HyundaiCarInfo("Hyundai Genesis 2015-16", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_j])), - HyundaiCarInfo("Genesis G80 2017", "All", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_j])), - ], - CAR.IONIQ: HyundaiCarInfo("Hyundai Ioniq Hybrid 2017-19", car_parts=CarParts.common([CarHarness.hyundai_c])), - CAR.IONIQ_HEV_2022: HyundaiCarInfo("Hyundai Ioniq Hybrid 2020-22", car_parts=CarParts.common([CarHarness.hyundai_h])), # TODO: confirm 2020-21 harness - CAR.IONIQ_EV_LTD: HyundaiCarInfo("Hyundai Ioniq Electric 2019", car_parts=CarParts.common([CarHarness.hyundai_c])), - CAR.IONIQ_EV_2020: HyundaiCarInfo("Hyundai Ioniq Electric 2020", "All", car_parts=CarParts.common([CarHarness.hyundai_h])), - CAR.IONIQ_PHEV_2019: HyundaiCarInfo("Hyundai Ioniq Plug-in Hybrid 2019", car_parts=CarParts.common([CarHarness.hyundai_c])), - CAR.IONIQ_PHEV: HyundaiCarInfo("Hyundai Ioniq Plug-in Hybrid 2020-22", "All", car_parts=CarParts.common([CarHarness.hyundai_h])), - CAR.KONA: HyundaiCarInfo("Hyundai Kona 2020", car_parts=CarParts.common([CarHarness.hyundai_b])), - CAR.KONA_EV: HyundaiCarInfo("Hyundai Kona Electric 2018-21", car_parts=CarParts.common([CarHarness.hyundai_g])), - CAR.KONA_EV_2022: HyundaiCarInfo("Hyundai Kona Electric 2022-23", car_parts=CarParts.common([CarHarness.hyundai_o])), - CAR.KONA_HEV: HyundaiCarInfo("Hyundai Kona Hybrid 2020", car_parts=CarParts.common([CarHarness.hyundai_i])), # TODO: check packages - # TODO: this is the 2024 US MY, not yet released - CAR.KONA_EV_2ND_GEN: HyundaiCarInfo("Hyundai Kona Electric (with HDA II, Korea only) 2023", video_link="https://www.youtube.com/watch?v=U2fOCmcQ8hw", - car_parts=CarParts.common([CarHarness.hyundai_r])), - CAR.SANTA_FE: HyundaiCarInfo("Hyundai Santa Fe 2019-20", "All", video_link="https://youtu.be/bjDR0YjM__s", - car_parts=CarParts.common([CarHarness.hyundai_d])), - CAR.SANTA_FE_2022: HyundaiCarInfo("Hyundai Santa Fe 2021-23", "All", video_link="https://youtu.be/VnHzSTygTS4", - car_parts=CarParts.common([CarHarness.hyundai_l])), - CAR.SANTA_FE_HEV_2022: HyundaiCarInfo("Hyundai Santa Fe Hybrid 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_l])), - CAR.SANTA_FE_PHEV_2022: HyundaiCarInfo("Hyundai Santa Fe Plug-in Hybrid 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_l])), - CAR.SONATA: HyundaiCarInfo("Hyundai Sonata 2020-23", "All", video_link="https://www.youtube.com/watch?v=ix63r9kE3Fw", - car_parts=CarParts.common([CarHarness.hyundai_a])), - CAR.STARIA_4TH_GEN: HyundaiCarInfo("Hyundai Staria 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_k])), - CAR.SONATA_LF: HyundaiCarInfo("Hyundai Sonata 2018-19", car_parts=CarParts.common([CarHarness.hyundai_e])), - CAR.TUCSON: [ - HyundaiCarInfo("Hyundai Tucson 2021", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_l])), - HyundaiCarInfo("Hyundai Tucson Diesel 2019", car_parts=CarParts.common([CarHarness.hyundai_l])), - ], - CAR.PALISADE: [ - HyundaiCarInfo("Hyundai Palisade 2020-22", "All", video_link="https://youtu.be/TAnDqjF4fDY?t=456", car_parts=CarParts.common([CarHarness.hyundai_h])), - HyundaiCarInfo("Kia Telluride 2020-22", "All", car_parts=CarParts.common([CarHarness.hyundai_h])), - ], - CAR.VELOSTER: HyundaiCarInfo("Hyundai Veloster 2019-20", min_enable_speed=5. * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_e])), - CAR.SONATA_HYBRID: HyundaiCarInfo("Hyundai Sonata Hybrid 2020-23", "All", car_parts=CarParts.common([CarHarness.hyundai_a])), - CAR.IONIQ_5: [ - HyundaiCarInfo("Hyundai Ioniq 5 (Southeast Asia only) 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_q])), - HyundaiCarInfo("Hyundai Ioniq 5 (without HDA II) 2022-23", "Highway Driving Assist", car_parts=CarParts.common([CarHarness.hyundai_k])), - HyundaiCarInfo("Hyundai Ioniq 5 (with HDA II) 2022-23", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_q])), - ], - CAR.IONIQ_6: [ +@dataclass +class HyundaiPlatformConfig(PlatformConfig): + dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict("hyundai_kia_generic", None)) + + def init(self): + if self.flags & HyundaiFlags.MANDO_RADAR: + self.dbc_dict = dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated') + + if self.flags & HyundaiFlags.MIN_STEER_32_MPH: + self.specs = self.specs.override(minSteerSpeed=32 * CV.MPH_TO_MS) + + +@dataclass +class HyundaiCanFDPlatformConfig(PlatformConfig): + dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict("hyundai_canfd", None)) + + def init(self): + self.flags |= HyundaiFlags.CANFD + + +class CAR(Platforms): + # Hyundai + AZERA_6TH_GEN = HyundaiPlatformConfig( + "HYUNDAI AZERA 6TH GEN", + HyundaiCarInfo("Hyundai Azera 2022", "All", car_parts=CarParts.common([CarHarness.hyundai_k])), + CarSpecs(mass=1600, wheelbase=2.885, steerRatio=14.5), + ) + AZERA_HEV_6TH_GEN = HyundaiPlatformConfig( + "HYUNDAI AZERA HYBRID 6TH GEN", + [ + HyundaiCarInfo("Hyundai Azera Hybrid 2019", "All", car_parts=CarParts.common([CarHarness.hyundai_c])), + HyundaiCarInfo("Hyundai Azera Hybrid 2020", "All", car_parts=CarParts.common([CarHarness.hyundai_k])), + ], + CarSpecs(mass=1675, wheelbase=2.885, steerRatio=14.5), + flags=HyundaiFlags.HYBRID, + ) + ELANTRA = HyundaiPlatformConfig( + "HYUNDAI ELANTRA 2017", + [ + # TODO: 2017-18 could be Hyundai G + HyundaiCarInfo("Hyundai Elantra 2017-18", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_b])), + HyundaiCarInfo("Hyundai Elantra 2019", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_g])), + ], + # steerRatio: 14 is Stock | Settled Params Learner values are steerRatio: 15.401566348670535, stiffnessFactor settled on 1.0081302973865127 + CarSpecs(mass=1275, wheelbase=2.7, steerRatio=15.4, tireStiffnessFactor=0.385), + flags=HyundaiFlags.LEGACY | HyundaiFlags.CLUSTER_GEARS | HyundaiFlags.MIN_STEER_32_MPH, + ) + ELANTRA_GT_I30 = HyundaiPlatformConfig( + "HYUNDAI I30 N LINE 2019 & GT 2018 DCT", + [ + HyundaiCarInfo("Hyundai Elantra GT 2017-19", car_parts=CarParts.common([CarHarness.hyundai_e])), + HyundaiCarInfo("Hyundai i30 2017-19", car_parts=CarParts.common([CarHarness.hyundai_e])), + ], + ELANTRA.specs, + flags=HyundaiFlags.LEGACY | HyundaiFlags.CLUSTER_GEARS | HyundaiFlags.MIN_STEER_32_MPH, + ) + ELANTRA_2021 = HyundaiPlatformConfig( + "HYUNDAI ELANTRA 2021", + HyundaiCarInfo("Hyundai Elantra 2021-23", video_link="https://youtu.be/_EdYQtV52-c", car_parts=CarParts.common([CarHarness.hyundai_k])), + CarSpecs(mass=2800 * CV.LB_TO_KG, wheelbase=2.72, steerRatio=12.9, tireStiffnessFactor=0.65), + flags=HyundaiFlags.CHECKSUM_CRC8, + ) + ELANTRA_HEV_2021 = HyundaiPlatformConfig( + "HYUNDAI ELANTRA HYBRID 2021", + HyundaiCarInfo("Hyundai Elantra Hybrid 2021-23", video_link="https://youtu.be/_EdYQtV52-c", + car_parts=CarParts.common([CarHarness.hyundai_k])), + CarSpecs(mass=3017 * CV.LB_TO_KG, wheelbase=2.72, steerRatio=12.9, tireStiffnessFactor=0.65), + flags=HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID, + ) + HYUNDAI_GENESIS = HyundaiPlatformConfig( + "HYUNDAI GENESIS 2015-2016", + [ + # TODO: check 2015 packages + HyundaiCarInfo("Hyundai Genesis 2015-16", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_j])), + HyundaiCarInfo("Genesis G80 2017", "All", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_j])), + ], + CarSpecs(mass=2060, wheelbase=3.01, steerRatio=16.5, minSteerSpeed=60 * CV.KPH_TO_MS), + flags=HyundaiFlags.CHECKSUM_6B | HyundaiFlags.LEGACY, + ) + IONIQ = HyundaiPlatformConfig( + "HYUNDAI IONIQ HYBRID 2017-2019", + HyundaiCarInfo("Hyundai Ioniq Hybrid 2017-19", car_parts=CarParts.common([CarHarness.hyundai_c])), + CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385), + flags=HyundaiFlags.HYBRID | HyundaiFlags.MIN_STEER_32_MPH, + ) + IONIQ_HEV_2022 = HyundaiPlatformConfig( + "HYUNDAI IONIQ HYBRID 2020-2022", + HyundaiCarInfo("Hyundai Ioniq Hybrid 2020-22", car_parts=CarParts.common([CarHarness.hyundai_h])), # TODO: confirm 2020-21 harness, + CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385), + flags=HyundaiFlags.HYBRID | HyundaiFlags.LEGACY, + ) + IONIQ_EV_LTD = HyundaiPlatformConfig( + "HYUNDAI IONIQ ELECTRIC LIMITED 2019", + HyundaiCarInfo("Hyundai Ioniq Electric 2019", car_parts=CarParts.common([CarHarness.hyundai_c])), + CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385), + flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.EV | HyundaiFlags.LEGACY | HyundaiFlags.MIN_STEER_32_MPH, + ) + IONIQ_EV_2020 = HyundaiPlatformConfig( + "HYUNDAI IONIQ ELECTRIC 2020", + HyundaiCarInfo("Hyundai Ioniq Electric 2020", "All", car_parts=CarParts.common([CarHarness.hyundai_h])), + CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385), + flags=HyundaiFlags.EV, + ) + IONIQ_PHEV_2019 = HyundaiPlatformConfig( + "HYUNDAI IONIQ PLUG-IN HYBRID 2019", + HyundaiCarInfo("Hyundai Ioniq Plug-in Hybrid 2019", car_parts=CarParts.common([CarHarness.hyundai_c])), + CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385), + flags=HyundaiFlags.HYBRID | HyundaiFlags.MIN_STEER_32_MPH, + ) + IONIQ_PHEV = HyundaiPlatformConfig( + "HYUNDAI IONIQ PHEV 2020", + HyundaiCarInfo("Hyundai Ioniq Plug-in Hybrid 2020-22", "All", car_parts=CarParts.common([CarHarness.hyundai_h])), + CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385), + flags=HyundaiFlags.HYBRID, + ) + KONA = HyundaiPlatformConfig( + "HYUNDAI KONA 2020", + HyundaiCarInfo("Hyundai Kona 2020", car_parts=CarParts.common([CarHarness.hyundai_b])), + CarSpecs(mass=1275, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385), + flags=HyundaiFlags.CLUSTER_GEARS, + ) + KONA_EV = HyundaiPlatformConfig( + "HYUNDAI KONA ELECTRIC 2019", + HyundaiCarInfo("Hyundai Kona Electric 2018-21", car_parts=CarParts.common([CarHarness.hyundai_g])), + CarSpecs(mass=1685, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385), + flags=HyundaiFlags.EV, + ) + KONA_EV_2022 = HyundaiPlatformConfig( + "HYUNDAI KONA ELECTRIC 2022", + HyundaiCarInfo("Hyundai Kona Electric 2022-23", car_parts=CarParts.common([CarHarness.hyundai_o])), + CarSpecs(mass=1743, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385), + flags=HyundaiFlags.CAMERA_SCC | HyundaiFlags.EV, + ) + KONA_EV_2ND_GEN = HyundaiCanFDPlatformConfig( + "HYUNDAI KONA ELECTRIC 2ND GEN", + HyundaiCarInfo("Hyundai Kona Electric (with HDA II, Korea only) 2023", video_link="https://www.youtube.com/watch?v=U2fOCmcQ8hw", + car_parts=CarParts.common([CarHarness.hyundai_r])), + CarSpecs(mass=1740, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385), + flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE, + ) + KONA_HEV = HyundaiPlatformConfig( + "HYUNDAI KONA HYBRID 2020", + HyundaiCarInfo("Hyundai Kona Hybrid 2020", car_parts=CarParts.common([CarHarness.hyundai_i])), # TODO: check packages, + CarSpecs(mass=1425, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385), + flags=HyundaiFlags.HYBRID, + ) + SANTA_FE = HyundaiPlatformConfig( + "HYUNDAI SANTA FE 2019", + HyundaiCarInfo("Hyundai Santa Fe 2019-20", "All", video_link="https://youtu.be/bjDR0YjM__s", + car_parts=CarParts.common([CarHarness.hyundai_d])), + CarSpecs(mass=3982 * CV.LB_TO_KG, wheelbase=2.766, steerRatio=16.55, tireStiffnessFactor=0.82), + flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8, + ) + SANTA_FE_2022 = HyundaiPlatformConfig( + "HYUNDAI SANTA FE 2022", + HyundaiCarInfo("Hyundai Santa Fe 2021-23", "All", video_link="https://youtu.be/VnHzSTygTS4", + car_parts=CarParts.common([CarHarness.hyundai_l])), + SANTA_FE.specs, + flags=HyundaiFlags.CHECKSUM_CRC8, + ) + SANTA_FE_HEV_2022 = HyundaiPlatformConfig( + "HYUNDAI SANTA FE HYBRID 2022", + HyundaiCarInfo("Hyundai Santa Fe Hybrid 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_l])), + SANTA_FE.specs, + flags=HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID, + ) + SANTA_FE_PHEV_2022 = HyundaiPlatformConfig( + "HYUNDAI SANTA FE PlUG-IN HYBRID 2022", + HyundaiCarInfo("Hyundai Santa Fe Plug-in Hybrid 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_l])), + SANTA_FE.specs, + flags=HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID, + ) + SONATA = HyundaiPlatformConfig( + "HYUNDAI SONATA 2020", + HyundaiCarInfo("Hyundai Sonata 2020-23", "All", video_link="https://www.youtube.com/watch?v=ix63r9kE3Fw", + car_parts=CarParts.common([CarHarness.hyundai_a])), + CarSpecs(mass=1513, wheelbase=2.84, steerRatio=13.27 * 1.15, tireStiffnessFactor=0.65), # 15% higher at the center seems reasonable + flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8, + ) + SONATA_LF = HyundaiPlatformConfig( + "HYUNDAI SONATA 2019", + HyundaiCarInfo("Hyundai Sonata 2018-19", car_parts=CarParts.common([CarHarness.hyundai_e])), + CarSpecs(mass=1536, wheelbase=2.804, steerRatio=13.27 * 1.15), # 15% higher at the center seems reasonable + + flags=HyundaiFlags.UNSUPPORTED_LONGITUDINAL | HyundaiFlags.TCU_GEARS, + ) + STARIA_4TH_GEN = HyundaiCanFDPlatformConfig( + "HYUNDAI STARIA 4TH GEN", + HyundaiCarInfo("Hyundai Staria 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_k])), + CarSpecs(mass=2205, wheelbase=3.273, steerRatio=11.94), # https://www.hyundai.com/content/dam/hyundai/au/en/models/staria-load/premium-pip-update-2023/spec-sheet/STARIA_Load_Spec-Table_March_2023_v3.1.pdf + ) + TUCSON = HyundaiPlatformConfig( + "HYUNDAI TUCSON 2019", + [ + HyundaiCarInfo("Hyundai Tucson 2021", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_l])), + HyundaiCarInfo("Hyundai Tucson Diesel 2019", car_parts=CarParts.common([CarHarness.hyundai_l])), + ], + CarSpecs(mass=3520 * CV.LB_TO_KG, wheelbase=2.67, steerRatio=16.1, tireStiffnessFactor=0.385), + flags=HyundaiFlags.TCU_GEARS, + ) + PALISADE = HyundaiPlatformConfig( + "HYUNDAI PALISADE 2020", + [ + HyundaiCarInfo("Hyundai Palisade 2020-22", "All", video_link="https://youtu.be/TAnDqjF4fDY?t=456", car_parts=CarParts.common([CarHarness.hyundai_h])), + HyundaiCarInfo("Kia Telluride 2020-22", "All", car_parts=CarParts.common([CarHarness.hyundai_h])), + ], + CarSpecs(mass=1999, wheelbase=2.9, steerRatio=15.6 * 1.15, tireStiffnessFactor=0.63), + flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8, + ) + VELOSTER = HyundaiPlatformConfig( + "HYUNDAI VELOSTER 2019", + HyundaiCarInfo("Hyundai Veloster 2019-20", min_enable_speed=5. * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_e])), + CarSpecs(mass=2917 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75 * 1.15, tireStiffnessFactor=0.5), + flags=HyundaiFlags.LEGACY | HyundaiFlags.TCU_GEARS, + ) + SONATA_HYBRID = HyundaiPlatformConfig( + "HYUNDAI SONATA HYBRID 2021", + HyundaiCarInfo("Hyundai Sonata Hybrid 2020-23", "All", car_parts=CarParts.common([CarHarness.hyundai_a])), + SONATA.specs, + flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID, + ) + IONIQ_5 = HyundaiCanFDPlatformConfig( + "HYUNDAI IONIQ 5 2022", + [ + HyundaiCarInfo("Hyundai Ioniq 5 (Southeast Asia only) 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_q])), + HyundaiCarInfo("Hyundai Ioniq 5 (without HDA II) 2022-23", "Highway Driving Assist", car_parts=CarParts.common([CarHarness.hyundai_k])), + HyundaiCarInfo("Hyundai Ioniq 5 (with HDA II) 2022-23", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_q])), + ], + CarSpecs(mass=1948, wheelbase=2.97, steerRatio=14.26, tireStiffnessFactor=0.65), + flags=HyundaiFlags.EV, + ) + IONIQ_6 = HyundaiCanFDPlatformConfig( + "HYUNDAI IONIQ 6 2023", HyundaiCarInfo("Hyundai Ioniq 6 (with HDA II) 2023", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_p])), - ], - CAR.TUCSON_4TH_GEN: [ - HyundaiCarInfo("Hyundai Tucson 2022", car_parts=CarParts.common([CarHarness.hyundai_n])), - HyundaiCarInfo("Hyundai Tucson 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_n])), - HyundaiCarInfo("Hyundai Tucson Hybrid 2022-24", "All", car_parts=CarParts.common([CarHarness.hyundai_n])), - ], - CAR.SANTA_CRUZ_1ST_GEN: HyundaiCarInfo("Hyundai Santa Cruz 2022-23", car_parts=CarParts.common([CarHarness.hyundai_n])), - CAR.CUSTIN_1ST_GEN: HyundaiCarInfo("Hyundai Custin 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_k])), + IONIQ_5.specs, + flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE, + ) + TUCSON_4TH_GEN = HyundaiCanFDPlatformConfig( + "HYUNDAI TUCSON 4TH GEN", + [ + HyundaiCarInfo("Hyundai Tucson 2022", car_parts=CarParts.common([CarHarness.hyundai_n])), + HyundaiCarInfo("Hyundai Tucson 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_n])), + HyundaiCarInfo("Hyundai Tucson Hybrid 2022-24", "All", car_parts=CarParts.common([CarHarness.hyundai_n])), + ], + CarSpecs(mass=1630, wheelbase=2.756, steerRatio=16, tireStiffnessFactor=0.385), + ) + SANTA_CRUZ_1ST_GEN = HyundaiCanFDPlatformConfig( + "HYUNDAI SANTA CRUZ 1ST GEN", + HyundaiCarInfo("Hyundai Santa Cruz 2022-23", car_parts=CarParts.common([CarHarness.hyundai_n])), + # weight from Limited trim - the only supported trim, steering ratio according to Hyundai News https://www.hyundainews.com/assets/documents/original/48035-2022SantaCruzProductGuideSpecsv2081521.pdf + CarSpecs(mass=1870, wheelbase=3, steerRatio=14.2), + ) + CUSTIN_1ST_GEN = HyundaiPlatformConfig( + "HYUNDAI CUSTIN 1ST GEN", + HyundaiCarInfo("Hyundai Custin 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_k])), + CarSpecs(mass=1690, wheelbase=3.055, steerRatio=17), # mass: from https://www.hyundai-motor.com.tw/clicktobuy/custin#spec_0, steerRatio: from learner + flags=HyundaiFlags.CHECKSUM_CRC8, + ) # Kia - CAR.KIA_FORTE: [ - HyundaiCarInfo("Kia Forte 2019-21", car_parts=CarParts.common([CarHarness.hyundai_g])), - HyundaiCarInfo("Kia Forte 2023", car_parts=CarParts.common([CarHarness.hyundai_e])), - ], - CAR.KIA_K5_2021: HyundaiCarInfo("Kia K5 2021-24", car_parts=CarParts.common([CarHarness.hyundai_a])), - CAR.KIA_K5_HEV_2020: HyundaiCarInfo("Kia K5 Hybrid 2020-22", car_parts=CarParts.common([CarHarness.hyundai_a])), - CAR.KIA_K8_HEV_1ST_GEN: HyundaiCarInfo("Kia K8 Hybrid (with HDA II) 2023", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_q])), - CAR.KIA_NIRO_EV: [ - HyundaiCarInfo("Kia Niro EV 2019", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", car_parts=CarParts.common([CarHarness.hyundai_h])), - HyundaiCarInfo("Kia Niro EV 2020", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", car_parts=CarParts.common([CarHarness.hyundai_f])), - HyundaiCarInfo("Kia Niro EV 2021", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", car_parts=CarParts.common([CarHarness.hyundai_c])), - HyundaiCarInfo("Kia Niro EV 2022", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", car_parts=CarParts.common([CarHarness.hyundai_h])), - ], - CAR.KIA_NIRO_EV_2ND_GEN: HyundaiCarInfo("Kia Niro EV 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_a])), - CAR.KIA_NIRO_PHEV: [ - HyundaiCarInfo("Kia Niro Plug-in Hybrid 2018-19", "All", min_enable_speed=10. * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_c])), - HyundaiCarInfo("Kia Niro Plug-in Hybrid 2020", "All", car_parts=CarParts.common([CarHarness.hyundai_d])), - ], - CAR.KIA_NIRO_PHEV_2022: [ - HyundaiCarInfo("Kia Niro Plug-in Hybrid 2021", "All", car_parts=CarParts.common([CarHarness.hyundai_d])), - HyundaiCarInfo("Kia Niro Plug-in Hybrid 2022", "All", car_parts=CarParts.common([CarHarness.hyundai_f])), - ], - CAR.KIA_NIRO_HEV_2021: [ - HyundaiCarInfo("Kia Niro Hybrid 2021", car_parts=CarParts.common([CarHarness.hyundai_d])), - HyundaiCarInfo("Kia Niro Hybrid 2022", car_parts=CarParts.common([CarHarness.hyundai_f])), - ], - CAR.KIA_NIRO_HEV_2ND_GEN: HyundaiCarInfo("Kia Niro Hybrid 2023", car_parts=CarParts.common([CarHarness.hyundai_a])), - CAR.KIA_OPTIMA_G4: HyundaiCarInfo("Kia Optima 2017", "Advanced Smart Cruise Control", - car_parts=CarParts.common([CarHarness.hyundai_b])), # TODO: may support 2016, 2018 - CAR.KIA_OPTIMA_G4_FL: HyundaiCarInfo("Kia Optima 2019-20", car_parts=CarParts.common([CarHarness.hyundai_g])), + KIA_FORTE = HyundaiPlatformConfig( + "KIA FORTE E 2018 & GT 2021", + [ + HyundaiCarInfo("Kia Forte 2019-21", car_parts=CarParts.common([CarHarness.hyundai_g])), + HyundaiCarInfo("Kia Forte 2023", car_parts=CarParts.common([CarHarness.hyundai_e])), + ], + CarSpecs(mass=2878 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5) + ) + KIA_K5_2021 = HyundaiPlatformConfig( + "KIA K5 2021", + HyundaiCarInfo("Kia K5 2021-24", car_parts=CarParts.common([CarHarness.hyundai_a])), + CarSpecs(mass=3381 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27, tireStiffnessFactor=0.5), # 2021 Kia K5 Steering Ratio (all trims) + flags=HyundaiFlags.CHECKSUM_CRC8, + ) + KIA_K5_HEV_2020 = HyundaiPlatformConfig( + "KIA K5 HYBRID 2020", + HyundaiCarInfo("Kia K5 Hybrid 2020-22", car_parts=CarParts.common([CarHarness.hyundai_a])), + KIA_K5_2021.specs, + flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID, + ) + KIA_K8_HEV_1ST_GEN = HyundaiCanFDPlatformConfig( + "KIA K8 HYBRID 1ST GEN", + HyundaiCarInfo("Kia K8 Hybrid (with HDA II) 2023", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_q])), + # mass: https://carprices.ae/brands/kia/2023/k8/1.6-turbo-hybrid, steerRatio: guesstimate from K5 platform + CarSpecs(mass=1630, wheelbase=2.895, steerRatio=13.27) + ) + KIA_NIRO_EV = HyundaiPlatformConfig( + "KIA NIRO EV 2020", + [ + HyundaiCarInfo("Kia Niro EV 2019", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", car_parts=CarParts.common([CarHarness.hyundai_h])), + HyundaiCarInfo("Kia Niro EV 2020", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", car_parts=CarParts.common([CarHarness.hyundai_f])), + HyundaiCarInfo("Kia Niro EV 2021", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", car_parts=CarParts.common([CarHarness.hyundai_c])), + HyundaiCarInfo("Kia Niro EV 2022", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", car_parts=CarParts.common([CarHarness.hyundai_h])), + ], + CarSpecs(mass=3543 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=13.6, tireStiffnessFactor=0.385), # average of all the cars + flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.EV, + ) + KIA_NIRO_EV_2ND_GEN = HyundaiCanFDPlatformConfig( + "KIA NIRO EV 2ND GEN", + HyundaiCarInfo("Kia Niro EV 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_a])), + KIA_NIRO_EV.specs, + flags=HyundaiFlags.EV, + ) + KIA_NIRO_PHEV = HyundaiPlatformConfig( + "KIA NIRO HYBRID 2019", + [ + HyundaiCarInfo("Kia Niro Plug-in Hybrid 2018-19", "All", min_enable_speed=10. * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_c])), + HyundaiCarInfo("Kia Niro Plug-in Hybrid 2020", "All", car_parts=CarParts.common([CarHarness.hyundai_d])), + ], + KIA_NIRO_EV.specs, + flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.HYBRID | HyundaiFlags.UNSUPPORTED_LONGITUDINAL | HyundaiFlags.MIN_STEER_32_MPH, + ) + KIA_NIRO_PHEV_2022 = HyundaiPlatformConfig( + "KIA NIRO PLUG-IN HYBRID 2022", + [ + HyundaiCarInfo("Kia Niro Plug-in Hybrid 2021", "All", car_parts=CarParts.common([CarHarness.hyundai_d])), + HyundaiCarInfo("Kia Niro Plug-in Hybrid 2022", "All", car_parts=CarParts.common([CarHarness.hyundai_f])), + ], + KIA_NIRO_EV.specs, + flags=HyundaiFlags.HYBRID | HyundaiFlags.MANDO_RADAR, + ) + KIA_NIRO_HEV_2021 = HyundaiPlatformConfig( + "KIA NIRO HYBRID 2021", + [ + HyundaiCarInfo("Kia Niro Hybrid 2021", car_parts=CarParts.common([CarHarness.hyundai_d])), + HyundaiCarInfo("Kia Niro Hybrid 2022", car_parts=CarParts.common([CarHarness.hyundai_f])), + ], + KIA_NIRO_EV.specs, + flags=HyundaiFlags.HYBRID, + ) + KIA_NIRO_HEV_2ND_GEN = HyundaiCanFDPlatformConfig( + "KIA NIRO HYBRID 2ND GEN", + HyundaiCarInfo("Kia Niro Hybrid 2023", car_parts=CarParts.common([CarHarness.hyundai_a])), + KIA_NIRO_EV.specs, + ) + KIA_OPTIMA_G4 = HyundaiPlatformConfig( + "KIA OPTIMA 4TH GEN", + HyundaiCarInfo("Kia Optima 2017", "Advanced Smart Cruise Control", + car_parts=CarParts.common([CarHarness.hyundai_b])), # TODO: may support 2016, 2018 + CarSpecs(mass=3558 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5), + flags=HyundaiFlags.LEGACY | HyundaiFlags.TCU_GEARS | HyundaiFlags.MIN_STEER_32_MPH, + ) + KIA_OPTIMA_G4_FL = HyundaiPlatformConfig( + "KIA OPTIMA 4TH GEN FACELIFT", + HyundaiCarInfo("Kia Optima 2019-20", car_parts=CarParts.common([CarHarness.hyundai_g])), + CarSpecs(mass=3558 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5), + flags=HyundaiFlags.UNSUPPORTED_LONGITUDINAL | HyundaiFlags.TCU_GEARS, + ) # TODO: may support adjacent years. may have a non-zero minimum steering speed - CAR.KIA_OPTIMA_H: HyundaiCarInfo("Kia Optima Hybrid 2017", "Advanced Smart Cruise Control", car_parts=CarParts.common([CarHarness.hyundai_c])), - CAR.KIA_OPTIMA_H_G4_FL: HyundaiCarInfo("Kia Optima Hybrid 2019", car_parts=CarParts.common([CarHarness.hyundai_h])), - CAR.KIA_SELTOS: HyundaiCarInfo("Kia Seltos 2021", car_parts=CarParts.common([CarHarness.hyundai_a])), - CAR.KIA_SPORTAGE_5TH_GEN: [ - HyundaiCarInfo("Kia Sportage 2023", car_parts=CarParts.common([CarHarness.hyundai_n])), - HyundaiCarInfo("Kia Sportage Hybrid 2023", car_parts=CarParts.common([CarHarness.hyundai_n])), - ], - CAR.KIA_SORENTO: [ - HyundaiCarInfo("Kia Sorento 2018", "Advanced Smart Cruise Control & LKAS", video_link="https://www.youtube.com/watch?v=Fkh3s6WHJz8", - car_parts=CarParts.common([CarHarness.hyundai_e])), - HyundaiCarInfo("Kia Sorento 2019", video_link="https://www.youtube.com/watch?v=Fkh3s6WHJz8", car_parts=CarParts.common([CarHarness.hyundai_e])), - ], - CAR.KIA_SORENTO_4TH_GEN: HyundaiCarInfo("Kia Sorento 2021-23", car_parts=CarParts.common([CarHarness.hyundai_k])), - CAR.KIA_SORENTO_HEV_4TH_GEN: [ - HyundaiCarInfo("Kia Sorento Hybrid 2021-23", "All", car_parts=CarParts.common([CarHarness.hyundai_a])), - HyundaiCarInfo("Kia Sorento Plug-in Hybrid 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_a])), - ], - CAR.KIA_STINGER: HyundaiCarInfo("Kia Stinger 2018-20", video_link="https://www.youtube.com/watch?v=MJ94qoofYw0", - car_parts=CarParts.common([CarHarness.hyundai_c])), - CAR.KIA_STINGER_2022: HyundaiCarInfo("Kia Stinger 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_k])), - CAR.KIA_CEED: HyundaiCarInfo("Kia Ceed 2019", car_parts=CarParts.common([CarHarness.hyundai_e])), - CAR.KIA_EV6: [ - HyundaiCarInfo("Kia EV6 (Southeast Asia only) 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_p])), - HyundaiCarInfo("Kia EV6 (without HDA II) 2022-23", "Highway Driving Assist", car_parts=CarParts.common([CarHarness.hyundai_l])), - HyundaiCarInfo("Kia EV6 (with HDA II) 2022-23", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_p])) - ], - CAR.KIA_CARNIVAL_4TH_GEN: [ - HyundaiCarInfo("Kia Carnival 2022-24", car_parts=CarParts.common([CarHarness.hyundai_a])), - HyundaiCarInfo("Kia Carnival (China only) 2023", car_parts=CarParts.common([CarHarness.hyundai_k])) - ], + KIA_OPTIMA_H = HyundaiPlatformConfig( + "KIA OPTIMA HYBRID 2017 & SPORTS 2019", + HyundaiCarInfo("Kia Optima Hybrid 2017", "Advanced Smart Cruise Control", car_parts=CarParts.common([CarHarness.hyundai_c])), + CarSpecs(mass=3558 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5), + flags=HyundaiFlags.HYBRID | HyundaiFlags.LEGACY, + ) + KIA_OPTIMA_H_G4_FL = HyundaiPlatformConfig( + "KIA OPTIMA HYBRID 4TH GEN FACELIFT", + HyundaiCarInfo("Kia Optima Hybrid 2019", car_parts=CarParts.common([CarHarness.hyundai_h])), + CarSpecs(mass=3558 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5), + flags=HyundaiFlags.HYBRID | HyundaiFlags.UNSUPPORTED_LONGITUDINAL, + ) + KIA_SELTOS = HyundaiPlatformConfig( + "KIA SELTOS 2021", + HyundaiCarInfo("Kia Seltos 2021", car_parts=CarParts.common([CarHarness.hyundai_a])), + CarSpecs(mass=1337, wheelbase=2.63, steerRatio=14.56), + flags=HyundaiFlags.CHECKSUM_CRC8, + ) + KIA_SPORTAGE_5TH_GEN = HyundaiCanFDPlatformConfig( + "KIA SPORTAGE 5TH GEN", + [ + HyundaiCarInfo("Kia Sportage 2023", car_parts=CarParts.common([CarHarness.hyundai_n])), + HyundaiCarInfo("Kia Sportage Hybrid 2023", car_parts=CarParts.common([CarHarness.hyundai_n])), + ], + # weight from SX and above trims, average of FWD and AWD version, steering ratio according to Kia News https://www.kiamedia.com/us/en/models/sportage/2023/specifications + CarSpecs(mass=1725, wheelbase=2.756, steerRatio=13.6), + ) + KIA_SORENTO = HyundaiPlatformConfig( + "KIA SORENTO GT LINE 2018", + [ + HyundaiCarInfo("Kia Sorento 2018", "Advanced Smart Cruise Control & LKAS", video_link="https://www.youtube.com/watch?v=Fkh3s6WHJz8", + car_parts=CarParts.common([CarHarness.hyundai_e])), + HyundaiCarInfo("Kia Sorento 2019", video_link="https://www.youtube.com/watch?v=Fkh3s6WHJz8", car_parts=CarParts.common([CarHarness.hyundai_e])), + ], + CarSpecs(mass=1985, wheelbase=2.78, steerRatio=14.4 * 1.1), # 10% higher at the center seems reasonable + flags=HyundaiFlags.CHECKSUM_6B | HyundaiFlags.UNSUPPORTED_LONGITUDINAL, + ) + KIA_SORENTO_4TH_GEN = HyundaiCanFDPlatformConfig( + "KIA SORENTO 4TH GEN", + HyundaiCarInfo("Kia Sorento 2021-23", car_parts=CarParts.common([CarHarness.hyundai_k])), + CarSpecs(mass=3957 * CV.LB_TO_KG, wheelbase=2.81, steerRatio=13.5), # average of the platforms + flags=HyundaiFlags.RADAR_SCC, + ) + KIA_SORENTO_HEV_4TH_GEN = HyundaiCanFDPlatformConfig( + "KIA SORENTO HYBRID 4TH GEN", + [ + HyundaiCarInfo("Kia Sorento Hybrid 2021-23", "All", car_parts=CarParts.common([CarHarness.hyundai_a])), + HyundaiCarInfo("Kia Sorento Plug-in Hybrid 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_a])), + ], + CarSpecs(mass=4395 * CV.LB_TO_KG, wheelbase=2.81, steerRatio=13.5), # average of the platforms + flags=HyundaiFlags.RADAR_SCC, + ) + KIA_STINGER = HyundaiPlatformConfig( + "KIA STINGER GT2 2018", + HyundaiCarInfo("Kia Stinger 2018-20", video_link="https://www.youtube.com/watch?v=MJ94qoofYw0", + car_parts=CarParts.common([CarHarness.hyundai_c])), + CarSpecs(mass=1825, wheelbase=2.78, steerRatio=14.4 * 1.15) # 15% higher at the center seems reasonable + ) + KIA_STINGER_2022 = HyundaiPlatformConfig( + "KIA STINGER 2022", + HyundaiCarInfo("Kia Stinger 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_k])), + KIA_STINGER.specs, + ) + KIA_CEED = HyundaiPlatformConfig( + "KIA CEED INTRO ED 2019", + HyundaiCarInfo("Kia Ceed 2019", car_parts=CarParts.common([CarHarness.hyundai_e])), + CarSpecs(mass=1450, wheelbase=2.65, steerRatio=13.75, tireStiffnessFactor=0.5), + flags=HyundaiFlags.LEGACY, + ) + KIA_EV6 = HyundaiCanFDPlatformConfig( + "KIA EV6 2022", + [ + HyundaiCarInfo("Kia EV6 (Southeast Asia only) 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_p])), + HyundaiCarInfo("Kia EV6 (without HDA II) 2022-23", "Highway Driving Assist", car_parts=CarParts.common([CarHarness.hyundai_l])), + HyundaiCarInfo("Kia EV6 (with HDA II) 2022-23", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_p])) + ], + CarSpecs(mass=2055, wheelbase=2.9, steerRatio=16, tireStiffnessFactor=0.65), + flags=HyundaiFlags.EV, + ) + KIA_CARNIVAL_4TH_GEN = HyundaiCanFDPlatformConfig( + "KIA CARNIVAL 4TH GEN", + [ + HyundaiCarInfo("Kia Carnival 2022-24", car_parts=CarParts.common([CarHarness.hyundai_a])), + HyundaiCarInfo("Kia Carnival (China only) 2023", car_parts=CarParts.common([CarHarness.hyundai_k])) + ], + CarSpecs(mass=2087, wheelbase=3.09, steerRatio=14.23), + flags=HyundaiFlags.RADAR_SCC, + ) # Genesis - CAR.GENESIS_GV60_EV_1ST_GEN: [ - HyundaiCarInfo("Genesis GV60 (Advanced Trim) 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_a])), - HyundaiCarInfo("Genesis GV60 (Performance Trim) 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_k])), - ], - CAR.GENESIS_G70: HyundaiCarInfo("Genesis G70 2018-19", "All", car_parts=CarParts.common([CarHarness.hyundai_f])), - CAR.GENESIS_G70_2020: HyundaiCarInfo("Genesis G70 2020", "All", car_parts=CarParts.common([CarHarness.hyundai_f])), - CAR.GENESIS_GV70_1ST_GEN: [ - HyundaiCarInfo("Genesis GV70 (2.5T Trim) 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_l])), - HyundaiCarInfo("Genesis GV70 (3.5T Trim) 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_m])), - ], - CAR.GENESIS_G80: HyundaiCarInfo("Genesis G80 2018-19", "All", car_parts=CarParts.common([CarHarness.hyundai_h])), - CAR.GENESIS_G90: HyundaiCarInfo("Genesis G90 2017-18", "All", car_parts=CarParts.common([CarHarness.hyundai_c])), - CAR.GENESIS_GV80: HyundaiCarInfo("Genesis GV80 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_m])), -} + GENESIS_GV60_EV_1ST_GEN = HyundaiCanFDPlatformConfig( + "GENESIS GV60 ELECTRIC 1ST GEN", + [ + HyundaiCarInfo("Genesis GV60 (Advanced Trim) 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_a])), + HyundaiCarInfo("Genesis GV60 (Performance Trim) 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_k])), + ], + CarSpecs(mass=2205, wheelbase=2.9, steerRatio=12.6), # steerRatio: https://www.motor1.com/reviews/586376/2023-genesis-gv60-first-drive/#:~:text=Relative%20to%20the%20related%20Ioniq,5%2FEV6%27s%2014.3%3A1. + flags=HyundaiFlags.EV, + ) + GENESIS_G70 = HyundaiPlatformConfig( + "GENESIS G70 2018", + HyundaiCarInfo("Genesis G70 2018-19", "All", car_parts=CarParts.common([CarHarness.hyundai_f])), + CarSpecs(mass=1640, wheelbase=2.84, steerRatio=13.56), + flags=HyundaiFlags.LEGACY, + ) + GENESIS_G70_2020 = HyundaiPlatformConfig( + "GENESIS G70 2020", + HyundaiCarInfo("Genesis G70 2020", "All", car_parts=CarParts.common([CarHarness.hyundai_f])), + CarSpecs(mass=3673 * CV.LB_TO_KG, wheelbase=2.83, steerRatio=12.9), + flags=HyundaiFlags.MANDO_RADAR, + ) + GENESIS_GV70_1ST_GEN = HyundaiCanFDPlatformConfig( + "GENESIS GV70 1ST GEN", + [ + HyundaiCarInfo("Genesis GV70 (2.5T Trim) 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_l])), + HyundaiCarInfo("Genesis GV70 (3.5T Trim) 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_m])), + ], + CarSpecs(mass=1950, wheelbase=2.87, steerRatio=14.6), + flags=HyundaiFlags.RADAR_SCC, + ) + GENESIS_G80 = HyundaiPlatformConfig( + "GENESIS G80 2017", + HyundaiCarInfo("Genesis G80 2018-19", "All", car_parts=CarParts.common([CarHarness.hyundai_h])), + CarSpecs(mass=2060, wheelbase=3.01, steerRatio=16.5), + flags=HyundaiFlags.LEGACY, + ) + GENESIS_G90 = HyundaiPlatformConfig( + "GENESIS G90 2017", + HyundaiCarInfo("Genesis G90 2017-18", "All", car_parts=CarParts.common([CarHarness.hyundai_c])), + CarSpecs(mass=2200, wheelbase=3.15, steerRatio=12.069), + ) + GENESIS_GV80 = HyundaiCanFDPlatformConfig( + "GENESIS GV80 2023", + HyundaiCarInfo("Genesis GV80 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_m])), + CarSpecs(mass=2258, wheelbase=2.95, steerRatio=14.14), + flags=HyundaiFlags.RADAR_SCC, + ) + class Buttons: NONE = 0 @@ -323,7 +629,7 @@ class Buttons: CANCEL = 4 # on newer models, this is a pause/resume button -def get_platform_codes(fw_versions: List[bytes]) -> Set[Tuple[bytes, Optional[bytes]]]: +def get_platform_codes(fw_versions: list[bytes]) -> set[tuple[bytes, bytes | None]]: # Returns unique, platform-specific identification codes for a set of versions codes = set() # (code-Optional[part], date) for fw in fw_versions: @@ -342,12 +648,12 @@ def get_platform_codes(fw_versions: List[bytes]) -> Set[Tuple[bytes, Optional[by return codes -def match_fw_to_car_fuzzy(live_fw_versions, offline_fw_versions) -> Set[str]: +def match_fw_to_car_fuzzy(live_fw_versions, offline_fw_versions) -> set[str]: # Non-electric CAN FD platforms often do not have platform code specifiers needed # to distinguish between hybrid and ICE. All EVs so far are either exclusively # electric or specify electric in the platform code. fuzzy_platform_blacklist = {str(c) for c in (CANFD_CAR - EV_CAR - CANFD_FUZZY_WHITELIST)} - candidates: Set[str] = set() + candidates: set[str] = set() for candidate, fws in offline_fw_versions.items(): # Keep track of ECUs which pass all checks (platform codes, within date range) @@ -526,118 +832,37 @@ FW_QUERY_CONFIG = FwQueryConfig( match_fw_to_car_fuzzy=match_fw_to_car_fuzzy, ) - CHECKSUM = { - "crc8": [CAR.SANTA_FE, CAR.SONATA, CAR.PALISADE, CAR.KIA_SELTOS, CAR.ELANTRA_2021, CAR.ELANTRA_HEV_2021, - CAR.SONATA_HYBRID, CAR.SANTA_FE_2022, CAR.KIA_K5_2021, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022, - CAR.KIA_K5_HEV_2020, CAR.CUSTIN_1ST_GEN], - "6B": [CAR.KIA_SORENTO, CAR.HYUNDAI_GENESIS], + "crc8": CAR.with_flags(HyundaiFlags.CHECKSUM_CRC8), + "6B": CAR.with_flags(HyundaiFlags.CHECKSUM_6B), } CAN_GEARS = { # which message has the gear. hybrid and EV use ELECT_GEAR - "use_cluster_gears": {CAR.ELANTRA, CAR.ELANTRA_GT_I30, CAR.KONA}, - "use_tcu_gears": {CAR.KIA_OPTIMA_G4, CAR.KIA_OPTIMA_G4_FL, CAR.SONATA_LF, CAR.VELOSTER, CAR.TUCSON}, + "use_cluster_gears": CAR.with_flags(HyundaiFlags.CLUSTER_GEARS), + "use_tcu_gears": CAR.with_flags(HyundaiFlags.TCU_GEARS), } -CANFD_CAR = {CAR.KIA_EV6, CAR.IONIQ_5, CAR.IONIQ_6, CAR.TUCSON_4TH_GEN, CAR.SANTA_CRUZ_1ST_GEN, CAR.KIA_SPORTAGE_5TH_GEN, CAR.GENESIS_GV70_1ST_GEN, - CAR.GENESIS_GV60_EV_1ST_GEN, CAR.KIA_SORENTO_4TH_GEN, CAR.KIA_NIRO_HEV_2ND_GEN, CAR.KIA_NIRO_EV_2ND_GEN, - CAR.GENESIS_GV80, CAR.KIA_CARNIVAL_4TH_GEN, CAR.KIA_SORENTO_HEV_4TH_GEN, CAR.KONA_EV_2ND_GEN, CAR.KIA_K8_HEV_1ST_GEN, - CAR.STARIA_4TH_GEN} - -# The radar does SCC on these cars when HDA I, rather than the camera -CANFD_RADAR_SCC_CAR = {CAR.GENESIS_GV70_1ST_GEN, CAR.KIA_SORENTO_4TH_GEN, CAR.GENESIS_GV80, CAR.KIA_CARNIVAL_4TH_GEN, CAR.KIA_SORENTO_HEV_4TH_GEN} +CANFD_CAR = CAR.with_flags(HyundaiFlags.CANFD) +CANFD_RADAR_SCC_CAR = CAR.with_flags(HyundaiFlags.RADAR_SCC) # These CAN FD cars do not accept communication control to disable the ADAS ECU, # responds with 0x7F2822 - 'conditions not correct' -CANFD_UNSUPPORTED_LONGITUDINAL_CAR = {CAR.IONIQ_6, CAR.KONA_EV_2ND_GEN} +CANFD_UNSUPPORTED_LONGITUDINAL_CAR = CAR.with_flags(HyundaiFlags.CANFD_NO_RADAR_DISABLE) # The camera does SCC on these cars, rather than the radar -CAMERA_SCC_CAR = {CAR.KONA_EV_2022, } +CAMERA_SCC_CAR = CAR.with_flags(HyundaiFlags.CAMERA_SCC) -# these cars use a different gas signal -HYBRID_CAR = {CAR.IONIQ_PHEV, CAR.ELANTRA_HEV_2021, CAR.KIA_NIRO_PHEV, CAR.KIA_NIRO_HEV_2021, CAR.SONATA_HYBRID, CAR.KONA_HEV, CAR.IONIQ, - CAR.IONIQ_HEV_2022, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022, CAR.IONIQ_PHEV_2019, CAR.KIA_K5_HEV_2020, - CAR.KIA_OPTIMA_H, CAR.KIA_OPTIMA_H_G4_FL, CAR.AZERA_HEV_6TH_GEN, CAR.KIA_NIRO_PHEV_2022} +HYBRID_CAR = CAR.with_flags(HyundaiFlags.HYBRID) -EV_CAR = {CAR.IONIQ_EV_2020, CAR.IONIQ_EV_LTD, CAR.KONA_EV, CAR.KIA_NIRO_EV, CAR.KIA_NIRO_EV_2ND_GEN, CAR.KONA_EV_2022, - CAR.KIA_EV6, CAR.IONIQ_5, CAR.IONIQ_6, CAR.GENESIS_GV60_EV_1ST_GEN, CAR.KONA_EV_2ND_GEN} +EV_CAR = CAR.with_flags(HyundaiFlags.EV) -# these cars require a special panda safety mode due to missing counters and checksums in the messages -LEGACY_SAFETY_MODE_CAR = {CAR.HYUNDAI_GENESIS, CAR.IONIQ_EV_LTD, CAR.KIA_OPTIMA_G4, - CAR.VELOSTER, CAR.GENESIS_G70, CAR.GENESIS_G80, CAR.KIA_CEED, CAR.ELANTRA, CAR.IONIQ_HEV_2022, - CAR.KIA_OPTIMA_H, CAR.ELANTRA_GT_I30} +LEGACY_SAFETY_MODE_CAR = CAR.with_flags(HyundaiFlags.LEGACY) -# these cars have not been verified to work with longitudinal yet - radar disable, sending correct messages, etc. -UNSUPPORTED_LONGITUDINAL_CAR = LEGACY_SAFETY_MODE_CAR | {CAR.KIA_NIRO_PHEV, CAR.KIA_SORENTO, CAR.SONATA_LF, CAR.KIA_OPTIMA_G4_FL, - CAR.KIA_OPTIMA_H_G4_FL} +UNSUPPORTED_LONGITUDINAL_CAR = CAR.with_flags(HyundaiFlags.LEGACY) | CAR.with_flags(HyundaiFlags.UNSUPPORTED_LONGITUDINAL) -# If 0x500 is present on bus 1 it probably has a Mando radar outputting radar points. -# If no points are outputted by default it might be possible to turn it on using selfdrive/debug/hyundai_enable_radar_points.py -DBC = { - CAR.AZERA_6TH_GEN: dbc_dict('hyundai_kia_generic', None), - CAR.AZERA_HEV_6TH_GEN: dbc_dict('hyundai_kia_generic', None), - CAR.ELANTRA: dbc_dict('hyundai_kia_generic', None), - CAR.ELANTRA_GT_I30: dbc_dict('hyundai_kia_generic', None), - CAR.ELANTRA_2021: dbc_dict('hyundai_kia_generic', None), - CAR.ELANTRA_HEV_2021: dbc_dict('hyundai_kia_generic', None), - CAR.GENESIS_G70: dbc_dict('hyundai_kia_generic', None), - CAR.GENESIS_G70_2020: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'), - CAR.GENESIS_G80: dbc_dict('hyundai_kia_generic', None), - CAR.GENESIS_G90: dbc_dict('hyundai_kia_generic', None), - CAR.HYUNDAI_GENESIS: dbc_dict('hyundai_kia_generic', None), - CAR.IONIQ_PHEV_2019: dbc_dict('hyundai_kia_generic', None), - CAR.IONIQ_PHEV: dbc_dict('hyundai_kia_generic', None), - CAR.IONIQ_EV_2020: dbc_dict('hyundai_kia_generic', None), - CAR.IONIQ_EV_LTD: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'), - CAR.IONIQ: dbc_dict('hyundai_kia_generic', None), - CAR.IONIQ_HEV_2022: dbc_dict('hyundai_kia_generic', None), - CAR.KIA_FORTE: dbc_dict('hyundai_kia_generic', None), - CAR.KIA_K5_2021: dbc_dict('hyundai_kia_generic', None), - CAR.KIA_K5_HEV_2020: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'), - CAR.KIA_NIRO_EV: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'), - CAR.KIA_NIRO_PHEV: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'), - CAR.KIA_NIRO_HEV_2021: dbc_dict('hyundai_kia_generic', None), - CAR.KIA_OPTIMA_G4: dbc_dict('hyundai_kia_generic', None), - CAR.KIA_OPTIMA_G4_FL: dbc_dict('hyundai_kia_generic', None), - CAR.KIA_OPTIMA_H: dbc_dict('hyundai_kia_generic', None), - CAR.KIA_OPTIMA_H_G4_FL: dbc_dict('hyundai_kia_generic', None), - CAR.KIA_SELTOS: dbc_dict('hyundai_kia_generic', None), - CAR.KIA_SORENTO: dbc_dict('hyundai_kia_generic', None), # Has 0x5XX messages, but different format - CAR.KIA_STINGER: dbc_dict('hyundai_kia_generic', None), - CAR.KIA_STINGER_2022: dbc_dict('hyundai_kia_generic', None), - CAR.KONA: dbc_dict('hyundai_kia_generic', None), - CAR.KONA_EV: dbc_dict('hyundai_kia_generic', None), - CAR.KONA_EV_2022: dbc_dict('hyundai_kia_generic', None), - CAR.KONA_HEV: dbc_dict('hyundai_kia_generic', None), - CAR.SANTA_FE: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'), - CAR.SANTA_FE_2022: dbc_dict('hyundai_kia_generic', None), - CAR.SANTA_FE_HEV_2022: dbc_dict('hyundai_kia_generic', None), - CAR.SANTA_FE_PHEV_2022: dbc_dict('hyundai_kia_generic', None), - CAR.SONATA: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'), - CAR.SONATA_LF: dbc_dict('hyundai_kia_generic', None), # Has 0x5XX messages, but different format - CAR.TUCSON: dbc_dict('hyundai_kia_generic', None), - CAR.PALISADE: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'), - CAR.VELOSTER: dbc_dict('hyundai_kia_generic', None), - CAR.KIA_CEED: dbc_dict('hyundai_kia_generic', None), - CAR.KIA_EV6: dbc_dict('hyundai_canfd', None), - CAR.SONATA_HYBRID: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'), - CAR.TUCSON_4TH_GEN: dbc_dict('hyundai_canfd', None), - CAR.IONIQ_5: dbc_dict('hyundai_canfd', None), - CAR.IONIQ_6: dbc_dict('hyundai_canfd', None), - CAR.SANTA_CRUZ_1ST_GEN: dbc_dict('hyundai_canfd', None), - CAR.KIA_SPORTAGE_5TH_GEN: dbc_dict('hyundai_canfd', None), - CAR.GENESIS_GV70_1ST_GEN: dbc_dict('hyundai_canfd', None), - CAR.GENESIS_GV60_EV_1ST_GEN: dbc_dict('hyundai_canfd', None), - CAR.KIA_SORENTO_4TH_GEN: dbc_dict('hyundai_canfd', None), - CAR.KIA_NIRO_HEV_2ND_GEN: dbc_dict('hyundai_canfd', None), - CAR.KIA_NIRO_EV_2ND_GEN: dbc_dict('hyundai_canfd', None), - CAR.GENESIS_GV80: dbc_dict('hyundai_canfd', None), - CAR.KIA_CARNIVAL_4TH_GEN: dbc_dict('hyundai_canfd', None), - CAR.KIA_SORENTO_HEV_4TH_GEN: dbc_dict('hyundai_canfd', None), - CAR.KONA_EV_2ND_GEN: dbc_dict('hyundai_canfd', None), - CAR.KIA_K8_HEV_1ST_GEN: dbc_dict('hyundai_canfd', None), - CAR.CUSTIN_1ST_GEN: dbc_dict('hyundai_kia_generic', None), - CAR.KIA_NIRO_PHEV_2022: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'), - CAR.STARIA_4TH_GEN: dbc_dict('hyundai_canfd', None), -} +CAR_INFO = CAR.create_carinfo_map() +DBC = CAR.create_dbc_map() + +if __name__ == "__main__": + CAR.print_debug(HyundaiFlags) diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index b7357d2c9..9a78eea85 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -1,11 +1,11 @@ import json import os -import time import numpy as np import tomllib from abc import abstractmethod, ABC from enum import StrEnum -from typing import Any, Dict, Optional, Tuple, List, Callable, NamedTuple +from typing import Any, NamedTuple +from collections.abc import Callable from cereal import car from openpilot.common.basedir import BASEDIR @@ -14,6 +14,7 @@ from openpilot.common.simple_kalman import KF1D, get_kalman_gain from openpilot.common.numpy_fast import clip from openpilot.common.realtime import DT_CTRL from openpilot.selfdrive.car import apply_hysteresis, gen_empty_fingerprint, scale_rot_inertia, scale_tire_stiffness, STD_CARGO_KG +from openpilot.selfdrive.car.values import Platform from openpilot.selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX, get_friction from openpilot.selfdrive.controls.lib.events import Events from openpilot.selfdrive.controls.lib.vehicle_model import VehicleModel @@ -101,15 +102,25 @@ class CarInterfaceBase(ABC): return ACCEL_MIN, ACCEL_MAX @classmethod - def get_non_essential_params(cls, candidate: str): + def get_non_essential_params(cls, candidate: Platform): """ Parameters essential to controlling the car may be incomplete or wrong without FW versions or fingerprints. """ return cls.get_params(candidate, gen_empty_fingerprint(), list(), False, False) @classmethod - def get_params(cls, candidate: str, fingerprint: Dict[int, Dict[int, int]], car_fw: List[car.CarParams.CarFw], experimental_long: bool, docs: bool): + def get_params(cls, candidate: Platform, fingerprint: dict[int, dict[int, int]], car_fw: list[car.CarParams.CarFw], experimental_long: bool, docs: bool): ret = CarInterfaceBase.get_std_params(candidate) + + ret.mass = candidate.config.specs.mass + ret.wheelbase = candidate.config.specs.wheelbase + ret.steerRatio = candidate.config.specs.steerRatio + ret.centerToFront = ret.wheelbase * candidate.config.specs.centerToFrontRatio + ret.minEnableSpeed = candidate.config.specs.minEnableSpeed + ret.minSteerSpeed = candidate.config.specs.minSteerSpeed + ret.tireStiffnessFactor = candidate.config.specs.tireStiffnessFactor + ret.flags |= int(candidate.config.flags) + ret = cls._get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs) # Vehicle mass is published curb weight plus assumed payload such as a human driver; notCars have no assumed payload @@ -124,8 +135,8 @@ class CarInterfaceBase(ABC): @staticmethod @abstractmethod - def _get_params(ret: car.CarParams, candidate: str, fingerprint: Dict[int, Dict[int, int]], - car_fw: List[car.CarParams.CarFw], experimental_long: bool, docs: bool): + def _get_params(ret: car.CarParams, candidate, fingerprint: dict[int, dict[int, int]], + car_fw: list[car.CarParams.CarFw], experimental_long: bool, docs: bool): raise NotImplementedError @staticmethod @@ -205,7 +216,7 @@ class CarInterfaceBase(ABC): def _update(self, c: car.CarControl) -> car.CarState: pass - def update(self, c: car.CarControl, can_strings: List[bytes]) -> car.CarState: + def update(self, c: car.CarControl, can_strings: list[bytes]) -> car.CarState: # parse can for cp in self.can_parsers: if cp is not None: @@ -239,7 +250,7 @@ class CarInterfaceBase(ABC): return reader @abstractmethod - def apply(self, c: car.CarControl, now_nanos: int) -> Tuple[car.CarControl.Actuators, List[bytes]]: + def apply(self, c: car.CarControl, now_nanos: int) -> tuple[car.CarControl.Actuators, list[bytes]]: pass def create_common_events(self, cs_out, extra_gears=None, pcm_enable=True, allow_enable=True, @@ -322,13 +333,14 @@ class RadarInterfaceBase(ABC): self.pts = {} self.delay = 0 self.radar_ts = CP.radarTimeStep + self.frame = 0 self.no_radar_sleep = 'NO_RADAR_SLEEP' in os.environ def update(self, can_strings): - ret = car.RadarData.new_message() - if not self.no_radar_sleep: - time.sleep(self.radar_ts) # radard runs on RI updates - return ret + self.frame += 1 + if (self.frame % int(100 * self.radar_ts)) == 0: + return car.RadarData.new_message() + return None class CarStateBase(ABC): @@ -409,11 +421,11 @@ class CarStateBase(ABC): return bool(left_blinker_stalk or self.left_blinker_cnt > 0), bool(right_blinker_stalk or self.right_blinker_cnt > 0) @staticmethod - def parse_gear_shifter(gear: Optional[str]) -> car.CarState.GearShifter: + def parse_gear_shifter(gear: str | None) -> car.CarState.GearShifter: if gear is None: return GearShifter.unknown - d: Dict[str, car.CarState.GearShifter] = { + d: dict[str, car.CarState.GearShifter] = { 'P': GearShifter.park, 'PARK': GearShifter.park, 'R': GearShifter.reverse, 'REVERSE': GearShifter.reverse, 'N': GearShifter.neutral, 'NEUTRAL': GearShifter.neutral, @@ -443,6 +455,15 @@ class CarStateBase(ABC): return None +SendCan = tuple[int, int, bytes, int] + + +class CarControllerBase(ABC): + @abstractmethod + def update(self, CC, CS, now_nanos) -> tuple[car.CarControl.Actuators, list[SendCan]]: + pass + + INTERFACE_ATTR_FILE = { "FINGERPRINTS": "fingerprints", "FW_VERSIONS": "fingerprints", @@ -450,7 +471,7 @@ INTERFACE_ATTR_FILE = { # interface-specific helpers -def get_interface_attr(attr: str, combine_brands: bool = False, ignore_none: bool = False) -> Dict[str | StrEnum, Any]: +def get_interface_attr(attr: str, combine_brands: bool = False, ignore_none: bool = False) -> dict[str | StrEnum, Any]: # read all the folders in selfdrive/car and return a dict where: # - keys are all the car models or brand names # - values are attr values from all car folders @@ -483,7 +504,7 @@ class NanoFFModel: self.load_weights(platform) def load_weights(self, platform: str): - with open(self.weights_loc, 'r') as fob: + with open(self.weights_loc) as fob: self.weights = {k: np.array(v) for k, v in json.load(fob)[platform].items()} def relu(self, x: np.ndarray): @@ -498,7 +519,7 @@ class NanoFFModel: x = np.dot(x, self.weights['w_4']) + self.weights['b_4'] return x - def predict(self, x: List[float], do_sample: bool = False): + def predict(self, x: list[float], do_sample: bool = False): x = self.forward(np.array(x)) if do_sample: pred = np.random.laplace(x[0], np.exp(x[1]) / self.weights['temperature']) diff --git a/selfdrive/car/isotp_parallel_query.py b/selfdrive/car/isotp_parallel_query.py index 678fe9ea4..8fdc747e9 100644 --- a/selfdrive/car/isotp_parallel_query.py +++ b/selfdrive/car/isotp_parallel_query.py @@ -12,7 +12,7 @@ from panda.python.uds import CanClient, IsoTpMessage, FUNCTIONAL_ADDRS, get_rx_a class IsoTpParallelQuery: def __init__(self, sendcan: messaging.PubSocket, logcan: messaging.SubSocket, bus: int, addrs: list[int] | list[AddrType], request: list[bytes], response: list[bytes], response_offset: int = 0x8, - functional_addrs: list[int] | None = None, debug: bool = False, response_pending_timeout: float = 10) -> None: + functional_addrs: list[int] = None, debug: bool = False, response_pending_timeout: float = 10) -> None: self.sendcan = sendcan self.logcan = logcan self.bus = bus diff --git a/selfdrive/car/mazda/carcontroller.py b/selfdrive/car/mazda/carcontroller.py index 320ad19bb..8d3a59b4e 100644 --- a/selfdrive/car/mazda/carcontroller.py +++ b/selfdrive/car/mazda/carcontroller.py @@ -1,13 +1,14 @@ from cereal import car from opendbc.can.packer import CANPacker from openpilot.selfdrive.car import apply_driver_steer_torque_limits +from openpilot.selfdrive.car.interfaces import CarControllerBase from openpilot.selfdrive.car.mazda import mazdacan from openpilot.selfdrive.car.mazda.values import CarControllerParams, Buttons VisualAlert = car.CarControl.HUDControl.VisualAlert -class CarController: +class CarController(CarControllerBase): def __init__(self, dbc_name, CP, VM): self.CP = CP self.apply_steer_last = 0 @@ -35,13 +36,13 @@ class CarController: if self.frame % 10 == 0 and not (CS.out.brakePressed and self.brake_counter < 7): # Cancel Stock ACC if it's enabled while OP is disengaged # Send at a rate of 10hz until we sync with stock ACC state - can_sends.append(mazdacan.create_button_cmd(self.packer, self.CP.carFingerprint, CS.crz_btns_counter, Buttons.CANCEL)) + can_sends.append(mazdacan.create_button_cmd(self.packer, self.CP, CS.crz_btns_counter, Buttons.CANCEL)) else: self.brake_counter = 0 if CC.cruiseControl.resume and self.frame % 5 == 0: # Mazda Stop and Go requires a RES button (or gas) press if the car stops more than 3 seconds # Send Resume button when planner wants car to move - can_sends.append(mazdacan.create_button_cmd(self.packer, self.CP.carFingerprint, CS.crz_btns_counter, Buttons.RESUME)) + can_sends.append(mazdacan.create_button_cmd(self.packer, self.CP, CS.crz_btns_counter, Buttons.RESUME)) self.apply_steer_last = apply_steer @@ -54,7 +55,7 @@ class CarController: can_sends.append(mazdacan.create_alert_command(self.packer, CS.cam_laneinfo, ldw, steer_required)) # send steering command - can_sends.append(mazdacan.create_steering_control(self.packer, self.CP.carFingerprint, + can_sends.append(mazdacan.create_steering_control(self.packer, self.CP, self.frame, apply_steer, CS.cam_lkas)) new_actuators = CC.actuators.copy() diff --git a/selfdrive/car/mazda/carstate.py b/selfdrive/car/mazda/carstate.py index 1f7846ca0..37a67ecd9 100644 --- a/selfdrive/car/mazda/carstate.py +++ b/selfdrive/car/mazda/carstate.py @@ -3,7 +3,7 @@ from openpilot.common.conversions import Conversions as CV from opendbc.can.can_define import CANDefine from opendbc.can.parser import CANParser from openpilot.selfdrive.car.interfaces import CarStateBase -from openpilot.selfdrive.car.mazda.values import DBC, LKAS_LIMITS, GEN1 +from openpilot.selfdrive.car.mazda.values import DBC, LKAS_LIMITS, MazdaFlags class CarState(CarStateBase): def __init__(self, CP): @@ -32,7 +32,7 @@ class CarState(CarStateBase): # Match panda speed reading speed_kph = cp.vl["ENGINE_DATA"]["SPEED"] - ret.standstill = speed_kph < .1 + ret.standstill = speed_kph <= .1 can_gear = int(cp.vl["GEAR"]["GEAR"]) ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(can_gear, None)) @@ -116,7 +116,7 @@ class CarState(CarStateBase): ("WHEEL_SPEEDS", 100), ] - if CP.carFingerprint in GEN1: + if CP.flags & MazdaFlags.GEN1: messages += [ ("ENGINE_DATA", 100), ("CRZ_CTRL", 50), @@ -136,7 +136,7 @@ class CarState(CarStateBase): def get_cam_can_parser(CP): messages = [] - if CP.carFingerprint in GEN1: + if CP.flags & MazdaFlags.GEN1: messages += [ # sig_address, frequency ("CAM_LANEINFO", 2), diff --git a/selfdrive/car/mazda/interface.py b/selfdrive/car/mazda/interface.py index 7ac93d9de..a138318b1 100755 --- a/selfdrive/car/mazda/interface.py +++ b/selfdrive/car/mazda/interface.py @@ -24,23 +24,6 @@ class CarInterface(CarInterfaceBase): CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) - if candidate in (CAR.CX5, CAR.CX5_2022): - ret.mass = 3655 * CV.LB_TO_KG - ret.wheelbase = 2.7 - ret.steerRatio = 15.5 - elif candidate in (CAR.CX9, CAR.CX9_2021): - ret.mass = 4217 * CV.LB_TO_KG - ret.wheelbase = 3.1 - ret.steerRatio = 17.6 - elif candidate == CAR.MAZDA3: - ret.mass = 2875 * CV.LB_TO_KG - ret.wheelbase = 2.7 - ret.steerRatio = 14.0 - elif candidate == CAR.MAZDA6: - ret.mass = 3443 * CV.LB_TO_KG - ret.wheelbase = 2.83 - ret.steerRatio = 15.5 - if candidate not in (CAR.CX5_2022, ): ret.minSteerSpeed = LKAS_LIMITS.DISABLE_SPEED * CV.KPH_TO_MS diff --git a/selfdrive/car/mazda/mazdacan.py b/selfdrive/car/mazda/mazdacan.py index e350c5587..74f6af04c 100644 --- a/selfdrive/car/mazda/mazdacan.py +++ b/selfdrive/car/mazda/mazdacan.py @@ -1,7 +1,7 @@ -from openpilot.selfdrive.car.mazda.values import GEN1, Buttons +from openpilot.selfdrive.car.mazda.values import Buttons, MazdaFlags -def create_steering_control(packer, car_fingerprint, frame, apply_steer, lkas): +def create_steering_control(packer, CP, frame, apply_steer, lkas): tmp = apply_steer + 2048 @@ -45,7 +45,7 @@ def create_steering_control(packer, car_fingerprint, frame, apply_steer, lkas): csum = csum % 256 values = {} - if car_fingerprint in GEN1: + if CP.flags & MazdaFlags.GEN1: values = { "LKAS_REQUEST": apply_steer, "CTR": ctr, @@ -88,12 +88,12 @@ def create_alert_command(packer, cam_msg: dict, ldw: bool, steer_required: bool) return packer.make_can_msg("CAM_LANEINFO", 0, values) -def create_button_cmd(packer, car_fingerprint, counter, button): +def create_button_cmd(packer, CP, counter, button): can = int(button == Buttons.CANCEL) res = int(button == Buttons.RESUME) - if car_fingerprint in GEN1: + if CP.flags & MazdaFlags.GEN1: values = { "CAN_OFF": can, "CAN_OFF_INV": (can + 1) % 2, diff --git a/selfdrive/car/mazda/values.py b/selfdrive/car/mazda/values.py index b43ab3df6..f45e80c11 100644 --- a/selfdrive/car/mazda/values.py +++ b/selfdrive/car/mazda/values.py @@ -1,9 +1,9 @@ from dataclasses import dataclass, field -from enum import StrEnum -from typing import Dict, List, Union +from enum import IntFlag from cereal import car -from openpilot.selfdrive.car import dbc_dict +from openpilot.common.conversions import Conversions as CV +from openpilot.selfdrive.car import CarSpecs, DbcDict, PlatformConfig, Platforms, dbc_dict from openpilot.selfdrive.car.docs_definitions import CarHarness, CarInfo, CarParts from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries @@ -26,29 +26,55 @@ class CarControllerParams: pass -class CAR(StrEnum): - CX5 = "MAZDA CX-5" - CX9 = "MAZDA CX-9" - MAZDA3 = "MAZDA 3" - MAZDA6 = "MAZDA 6" - CX9_2021 = "MAZDA CX-9 2021" - CX5_2022 = "MAZDA CX-5 2022" - - @dataclass class MazdaCarInfo(CarInfo): package: str = "All" car_parts: CarParts = field(default_factory=CarParts.common([CarHarness.mazda])) -CAR_INFO: Dict[str, Union[MazdaCarInfo, List[MazdaCarInfo]]] = { - CAR.CX5: MazdaCarInfo("Mazda CX-5 2017-21"), - CAR.CX9: MazdaCarInfo("Mazda CX-9 2016-20"), - CAR.MAZDA3: MazdaCarInfo("Mazda 3 2017-18"), - CAR.MAZDA6: MazdaCarInfo("Mazda 6 2017-20"), - CAR.CX9_2021: MazdaCarInfo("Mazda CX-9 2021-23", video_link="https://youtu.be/dA3duO4a0O4"), - CAR.CX5_2022: MazdaCarInfo("Mazda CX-5 2022-24"), -} +class MazdaFlags(IntFlag): + # Static flags + # Gen 1 hardware: same CAN messages and same camera + GEN1 = 1 + + +@dataclass +class MazdaPlatformConfig(PlatformConfig): + dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('mazda_2017', None)) + flags: int = MazdaFlags.GEN1 + + +class CAR(Platforms): + CX5 = MazdaPlatformConfig( + "MAZDA CX-5", + MazdaCarInfo("Mazda CX-5 2017-21"), + CarSpecs(mass=3655 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.5) + ) + CX9 = MazdaPlatformConfig( + "MAZDA CX-9", + MazdaCarInfo("Mazda CX-9 2016-20"), + CarSpecs(mass=4217 * CV.LB_TO_KG, wheelbase=3.1, steerRatio=17.6) + ) + MAZDA3 = MazdaPlatformConfig( + "MAZDA 3", + MazdaCarInfo("Mazda 3 2017-18"), + CarSpecs(mass=2875 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=14.0) + ) + MAZDA6 = MazdaPlatformConfig( + "MAZDA 6", + MazdaCarInfo("Mazda 6 2017-20"), + CarSpecs(mass=3443 * CV.LB_TO_KG, wheelbase=2.83, steerRatio=15.5) + ) + CX9_2021 = MazdaPlatformConfig( + "MAZDA CX-9 2021", + MazdaCarInfo("Mazda CX-9 2021-23", video_link="https://youtu.be/dA3duO4a0O4"), + CX9.specs + ) + CX5_2022 = MazdaPlatformConfig( + "MAZDA CX-5 2022", + MazdaCarInfo("Mazda CX-5 2022-24"), + CX5.specs, + ) class LKAS_LIMITS: @@ -77,14 +103,5 @@ FW_QUERY_CONFIG = FwQueryConfig( ) -DBC = { - CAR.CX5: dbc_dict('mazda_2017', None), - CAR.CX9: dbc_dict('mazda_2017', None), - CAR.MAZDA3: dbc_dict('mazda_2017', None), - CAR.MAZDA6: dbc_dict('mazda_2017', None), - CAR.CX9_2021: dbc_dict('mazda_2017', None), - CAR.CX5_2022: dbc_dict('mazda_2017', None), -} - -# Gen 1 hardware: same CAN messages and same camera -GEN1 = {CAR.CX5, CAR.CX9, CAR.CX9_2021, CAR.MAZDA3, CAR.MAZDA6, CAR.CX5_2022} +CAR_INFO = CAR.create_carinfo_map() +DBC = CAR.create_dbc_map() diff --git a/selfdrive/car/mock/interface.py b/selfdrive/car/mock/interface.py index c7821bdb9..2e4ac4303 100755 --- a/selfdrive/car/mock/interface.py +++ b/selfdrive/car/mock/interface.py @@ -22,7 +22,7 @@ class CarInterface(CarInterfaceBase): def _update(self, c): self.sm.update(0) - gps_sock = 'gpsLocationExternal' if self.sm.rcv_frame['gpsLocationExternal'] > 1 else 'gpsLocation' + gps_sock = 'gpsLocationExternal' if self.sm.recv_frame['gpsLocationExternal'] > 1 else 'gpsLocation' ret = car.CarState.new_message() ret.vEgo = self.sm[gps_sock].speed diff --git a/selfdrive/car/mock/values.py b/selfdrive/car/mock/values.py index c6c96579b..74e8bb5fc 100644 --- a/selfdrive/car/mock/values.py +++ b/selfdrive/car/mock/values.py @@ -1,13 +1,14 @@ -from enum import StrEnum -from typing import Dict, List, Optional, Union - -from openpilot.selfdrive.car.docs_definitions import CarInfo +from openpilot.selfdrive.car import CarSpecs, PlatformConfig, Platforms -class CAR(StrEnum): - MOCK = 'mock' + +class CAR(Platforms): + MOCK = PlatformConfig( + 'mock', + None, + CarSpecs(mass=1700, wheelbase=2.7, steerRatio=13), + {} + ) -CAR_INFO: Dict[str, Optional[Union[CarInfo, List[CarInfo]]]] = { - CAR.MOCK: None, -} +CAR_INFO = CAR.create_carinfo_map() diff --git a/selfdrive/car/nissan/carcontroller.py b/selfdrive/car/nissan/carcontroller.py index 2da518bbf..6aa4bb943 100644 --- a/selfdrive/car/nissan/carcontroller.py +++ b/selfdrive/car/nissan/carcontroller.py @@ -1,13 +1,14 @@ from cereal import car from opendbc.can.packer import CANPacker from openpilot.selfdrive.car import apply_std_steer_angle_limits +from openpilot.selfdrive.car.interfaces import CarControllerBase from openpilot.selfdrive.car.nissan import nissancan from openpilot.selfdrive.car.nissan.values import CAR, CarControllerParams VisualAlert = car.CarControl.HUDControl.VisualAlert -class CarController: +class CarController(CarControllerBase): def __init__(self, dbc_name, CP, VM): self.CP = CP self.car_fingerprint = CP.carFingerprint diff --git a/selfdrive/car/nissan/fingerprints.py b/selfdrive/car/nissan/fingerprints.py index 69e88be89..19267ded4 100644 --- a/selfdrive/car/nissan/fingerprints.py +++ b/selfdrive/car/nissan/fingerprints.py @@ -45,15 +45,30 @@ FW_VERSIONS = { }, CAR.LEAF: { (Ecu.abs, 0x740, None): [ + b'476605SA1C', + b'476605SA7D', + b'476605SC2D', + b'476606WK7B', b'476606WK9B', ], (Ecu.eps, 0x742, None): [ + b'5SA2A\x99A\x05\x02N123F\x15b\x00\x00\x00\x00\x00\x00\x00\x80', + b'5SA2A\xb7A\x05\x02N123F\x15\xa2\x00\x00\x00\x00\x00\x00\x00\x80', + b'5SN2A\xb7A\x05\x02N123F\x15\xa2\x00\x00\x00\x00\x00\x00\x00\x80', b'5SN2A\xb7A\x05\x02N126F\x15\xb2\x00\x00\x00\x00\x00\x00\x00\x80', ], (Ecu.fwdCamera, 0x707, None): [ + b'5SA0ADB\x04\x18\x00\x00\x00\x00\x00_*6\x04\x94a\x00\x00\x00\x80', + b'5SA2ADB\x04\x18\x00\x00\x00\x00\x00_*6\x04\x94a\x00\x00\x00\x80', + b'6WK2ADB\x04\x18\x00\x00\x00\x00\x00R;1\x18\x99\x10\x00\x00\x00\x80', + b'6WK2BDB\x04\x18\x00\x00\x00\x00\x00R;1\x18\x99\x10\x00\x00\x00\x80', b'6WK2CDB\x04\x18\x00\x00\x00\x00\x00R=1\x18\x99\x10\x00\x00\x00\x80', ], (Ecu.gateway, 0x18dad0f1, None): [ + b'284U25SA3C', + b'284U25SP0C', + b'284U25SP1C', + b'284U26WK0A', b'284U26WK0C', ], }, diff --git a/selfdrive/car/nissan/interface.py b/selfdrive/car/nissan/interface.py index aedcaa188..a94b97de2 100644 --- a/selfdrive/car/nissan/interface.py +++ b/selfdrive/car/nissan/interface.py @@ -16,25 +16,13 @@ class CarInterface(CarInterfaceBase): ret.steerLimitTimer = 1.0 ret.steerActuatorDelay = 0.1 - ret.steerRatio = 17 ret.steerControlType = car.CarParams.SteerControlType.angle ret.radarUnavailable = True - if candidate in (CAR.ROGUE, CAR.XTRAIL): - ret.mass = 1610 - ret.wheelbase = 2.705 - ret.centerToFront = ret.wheelbase * 0.44 - elif candidate in (CAR.LEAF, CAR.LEAF_IC): - ret.mass = 1610 - ret.wheelbase = 2.705 - ret.centerToFront = ret.wheelbase * 0.44 - elif candidate == CAR.ALTIMA: + if candidate == CAR.ALTIMA: # Altima has EPS on C-CAN unlike the others that have it on V-CAN ret.safetyConfigs[0].safetyParam |= Panda.FLAG_NISSAN_ALT_EPS_BUS - ret.mass = 1492 - ret.wheelbase = 2.824 - ret.centerToFront = ret.wheelbase * 0.44 return ret diff --git a/selfdrive/car/nissan/values.py b/selfdrive/car/nissan/values.py index d064ce894..cb7289389 100644 --- a/selfdrive/car/nissan/values.py +++ b/selfdrive/car/nissan/values.py @@ -1,10 +1,8 @@ from dataclasses import dataclass, field -from enum import StrEnum -from typing import Dict, List, Optional, Union from cereal import car from panda.python import uds -from openpilot.selfdrive.car import AngleRateLimit, dbc_dict +from openpilot.selfdrive.car import AngleRateLimit, CarSpecs, DbcDict, PlatformConfig, Platforms, dbc_dict from openpilot.selfdrive.car.docs_definitions import CarInfo, CarHarness, CarParts from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries @@ -21,29 +19,52 @@ class CarControllerParams: pass -class CAR(StrEnum): - XTRAIL = "NISSAN X-TRAIL 2017" - LEAF = "NISSAN LEAF 2018" - # Leaf with ADAS ECU found behind instrument cluster instead of glovebox - # Currently the only known difference between them is the inverted seatbelt signal. - LEAF_IC = "NISSAN LEAF 2018 Instrument Cluster" - ROGUE = "NISSAN ROGUE 2019" - ALTIMA = "NISSAN ALTIMA 2020" - - @dataclass class NissanCarInfo(CarInfo): package: str = "ProPILOT Assist" car_parts: CarParts = field(default_factory=CarParts.common([CarHarness.nissan_a])) -CAR_INFO: Dict[str, Optional[Union[NissanCarInfo, List[NissanCarInfo]]]] = { - CAR.XTRAIL: NissanCarInfo("Nissan X-Trail 2017"), - CAR.LEAF: NissanCarInfo("Nissan Leaf 2018-23", video_link="https://youtu.be/vaMbtAh_0cY"), - CAR.LEAF_IC: None, # same platforms - CAR.ROGUE: NissanCarInfo("Nissan Rogue 2018-20"), - CAR.ALTIMA: NissanCarInfo("Nissan Altima 2019-20", car_parts=CarParts.common([CarHarness.nissan_b])), -} +@dataclass(frozen=True) +class NissanCarSpecs(CarSpecs): + centerToFrontRatio: float = 0.44 + steerRatio: float = 17. + + +@dataclass +class NissanPlaformConfig(PlatformConfig): + dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('nissan_x_trail_2017_generated', None)) + + +class CAR(Platforms): + XTRAIL = NissanPlaformConfig( + "NISSAN X-TRAIL 2017", + NissanCarInfo("Nissan X-Trail 2017"), + NissanCarSpecs(mass=1610, wheelbase=2.705) + ) + LEAF = NissanPlaformConfig( + "NISSAN LEAF 2018", + NissanCarInfo("Nissan Leaf 2018-23", video_link="https://youtu.be/vaMbtAh_0cY"), + NissanCarSpecs(mass=1610, wheelbase=2.705), + dbc_dict('nissan_leaf_2018_generated', None), + ) + # Leaf with ADAS ECU found behind instrument cluster instead of glovebox + # Currently the only known difference between them is the inverted seatbelt signal. + LEAF_IC = LEAF.override(platform_str="NISSAN LEAF 2018 Instrument Cluster", car_info=None) + ROGUE = NissanPlaformConfig( + "NISSAN ROGUE 2019", + NissanCarInfo("Nissan Rogue 2018-20"), + NissanCarSpecs(mass=1610, wheelbase=2.705) + ) + ALTIMA = NissanPlaformConfig( + "NISSAN ALTIMA 2020", + NissanCarInfo("Nissan Altima 2019-20", car_parts=CarParts.common([CarHarness.nissan_b])), + NissanCarSpecs(mass=1492, wheelbase=2.824) + ) + + +CAR_INFO = CAR.create_carinfo_map() +DBC = CAR.create_dbc_map() # Default diagnostic session NISSAN_DIAGNOSTIC_REQUEST_KWP = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL, 0x81]) @@ -89,11 +110,3 @@ FW_QUERY_CONFIG = FwQueryConfig( ), ]], ) - -DBC = { - CAR.XTRAIL: dbc_dict('nissan_x_trail_2017_generated', None), - CAR.LEAF: dbc_dict('nissan_leaf_2018_generated', None), - CAR.LEAF_IC: dbc_dict('nissan_leaf_2018_generated', None), - CAR.ROGUE: dbc_dict('nissan_x_trail_2017_generated', None), - CAR.ALTIMA: dbc_dict('nissan_x_trail_2017_generated', None), -} diff --git a/selfdrive/car/subaru/carcontroller.py b/selfdrive/car/subaru/carcontroller.py index cc8ce4f72..22a1475b5 100644 --- a/selfdrive/car/subaru/carcontroller.py +++ b/selfdrive/car/subaru/carcontroller.py @@ -1,9 +1,9 @@ from openpilot.common.numpy_fast import clip, interp from opendbc.can.packer import CANPacker from openpilot.selfdrive.car import apply_driver_steer_torque_limits, common_fault_avoidance +from openpilot.selfdrive.car.interfaces import CarControllerBase from openpilot.selfdrive.car.subaru import subarucan -from openpilot.selfdrive.car.subaru.values import DBC, GLOBAL_ES_ADDR, GLOBAL_GEN2, PREGLOBAL_CARS, HYBRID_CARS, STEER_RATE_LIMITED, \ - CanBus, CarControllerParams, SubaruFlags +from openpilot.selfdrive.car.subaru.values import DBC, GLOBAL_ES_ADDR, CanBus, CarControllerParams, SubaruFlags # FIXME: These limits aren't exact. The real limit is more than likely over a larger time period and # involves the total steering angle change rather than rate, but these limits work well for now @@ -11,7 +11,7 @@ MAX_STEER_RATE = 25 # deg/s MAX_STEER_RATE_FRAMES = 7 # tx control frames needed before torque can be cut -class CarController: +class CarController(CarControllerBase): def __init__(self, dbc_name, CP, VM): self.CP = CP self.apply_steer_last = 0 @@ -42,12 +42,12 @@ class CarController: if not CC.latActive: apply_steer = 0 - if self.CP.carFingerprint in PREGLOBAL_CARS: + if self.CP.flags & SubaruFlags.PREGLOBAL: can_sends.append(subarucan.create_preglobal_steering_control(self.packer, self.frame // self.p.STEER_STEP, apply_steer, CC.latActive)) else: apply_steer_req = CC.latActive - if self.CP.carFingerprint in STEER_RATE_LIMITED: + if self.CP.flags & SubaruFlags.STEER_RATE_LIMITED: # Steering rate fault prevention self.steer_rate_counter, apply_steer_req = \ common_fault_avoidance(abs(CS.out.steeringRateDeg) > MAX_STEER_RATE, apply_steer_req, @@ -74,7 +74,7 @@ class CarController: cruise_brake = CarControllerParams.BRAKE_MIN # *** alerts and pcm cancel *** - if self.CP.carFingerprint in PREGLOBAL_CARS: + if self.CP.flags & SubaruFlags.PREGLOBAL: if self.frame % 5 == 0: # 1 = main, 2 = set shallow, 3 = set deep, 4 = resume shallow, 5 = resume deep # disengage ACC when OP is disengaged @@ -117,8 +117,8 @@ class CarController: self.CP.openpilotLongitudinalControl, cruise_brake > 0, cruise_throttle)) else: if pcm_cancel_cmd: - if self.CP.carFingerprint not in HYBRID_CARS: - bus = CanBus.alt if self.CP.carFingerprint in GLOBAL_GEN2 else CanBus.main + if not (self.CP.flags & SubaruFlags.HYBRID): + bus = CanBus.alt if self.CP.flags & SubaruFlags.GLOBAL_GEN2 else CanBus.main can_sends.append(subarucan.create_es_distance(self.packer, CS.es_distance_msg["COUNTER"] + 1, CS.es_distance_msg, bus, pcm_cancel_cmd)) if self.CP.flags & SubaruFlags.DISABLE_EYESIGHT: diff --git a/selfdrive/car/subaru/carstate.py b/selfdrive/car/subaru/carstate.py index c8a6dfe1e..ebf0ca906 100644 --- a/selfdrive/car/subaru/carstate.py +++ b/selfdrive/car/subaru/carstate.py @@ -4,7 +4,7 @@ from opendbc.can.can_define import CANDefine from openpilot.common.conversions import Conversions as CV from openpilot.selfdrive.car.interfaces import CarStateBase from opendbc.can.parser import CANParser -from openpilot.selfdrive.car.subaru.values import DBC, GLOBAL_GEN2, PREGLOBAL_CARS, HYBRID_CARS, CanBus, SubaruFlags +from openpilot.selfdrive.car.subaru.values import DBC, CanBus, SubaruFlags from openpilot.selfdrive.car import CanSignalRateCalculator @@ -19,17 +19,17 @@ class CarState(CarStateBase): def update(self, cp, cp_cam, cp_body): ret = car.CarState.new_message() - throttle_msg = cp.vl["Throttle"] if self.car_fingerprint not in HYBRID_CARS else cp_body.vl["Throttle_Hybrid"] + throttle_msg = cp.vl["Throttle"] if not (self.CP.flags & SubaruFlags.HYBRID) else cp_body.vl["Throttle_Hybrid"] ret.gas = throttle_msg["Throttle_Pedal"] / 255. ret.gasPressed = ret.gas > 1e-5 - if self.car_fingerprint in PREGLOBAL_CARS: + if self.CP.flags & SubaruFlags.PREGLOBAL: ret.brakePressed = cp.vl["Brake_Pedal"]["Brake_Pedal"] > 0 else: - cp_brakes = cp_body if self.car_fingerprint in GLOBAL_GEN2 else cp + cp_brakes = cp_body if self.CP.flags & SubaruFlags.GLOBAL_GEN2 else cp ret.brakePressed = cp_brakes.vl["Brake_Status"]["Brake"] == 1 - cp_wheels = cp_body if self.car_fingerprint in GLOBAL_GEN2 else cp + cp_wheels = cp_body if self.CP.flags & SubaruFlags.GLOBAL_GEN2 else cp ret.wheelSpeeds = self.get_wheel_speeds( cp_wheels.vl["Wheel_Speeds"]["FL"], cp_wheels.vl["Wheel_Speeds"]["FR"], @@ -48,24 +48,24 @@ class CarState(CarStateBase): ret.leftBlindspot = (cp.vl["BSD_RCTA"]["L_ADJACENT"] == 1) or (cp.vl["BSD_RCTA"]["L_APPROACHING"] == 1) ret.rightBlindspot = (cp.vl["BSD_RCTA"]["R_ADJACENT"] == 1) or (cp.vl["BSD_RCTA"]["R_APPROACHING"] == 1) - cp_transmission = cp_body if self.car_fingerprint in HYBRID_CARS else cp + cp_transmission = cp_body if self.CP.flags & SubaruFlags.HYBRID else cp can_gear = int(cp_transmission.vl["Transmission"]["Gear"]) ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(can_gear, None)) ret.steeringAngleDeg = cp.vl["Steering_Torque"]["Steering_Angle"] - if self.car_fingerprint not in PREGLOBAL_CARS: + if not (self.CP.flags & SubaruFlags.PREGLOBAL): # ideally we get this from the car, but unclear if it exists. diagnostic software doesn't even have it ret.steeringRateDeg = self.angle_rate_calulator.update(ret.steeringAngleDeg, cp.vl["Steering_Torque"]["COUNTER"]) ret.steeringTorque = cp.vl["Steering_Torque"]["Steer_Torque_Sensor"] ret.steeringTorqueEps = cp.vl["Steering_Torque"]["Steer_Torque_Output"] - steer_threshold = 75 if self.CP.carFingerprint in PREGLOBAL_CARS else 80 + steer_threshold = 75 if self.CP.flags & SubaruFlags.PREGLOBAL else 80 ret.steeringPressed = abs(ret.steeringTorque) > steer_threshold - cp_cruise = cp_body if self.car_fingerprint in GLOBAL_GEN2 else cp - if self.car_fingerprint in HYBRID_CARS: + cp_cruise = cp_body if self.CP.flags & SubaruFlags.GLOBAL_GEN2 else cp + if self.CP.flags & SubaruFlags.HYBRID: ret.cruiseState.enabled = cp_cam.vl["ES_DashStatus"]['Cruise_Activated'] != 0 ret.cruiseState.available = cp_cam.vl["ES_DashStatus"]['Cruise_On'] != 0 else: @@ -73,8 +73,8 @@ class CarState(CarStateBase): ret.cruiseState.available = cp_cruise.vl["CruiseControl"]["Cruise_On"] != 0 ret.cruiseState.speed = cp_cam.vl["ES_DashStatus"]["Cruise_Set_Speed"] * CV.KPH_TO_MS - if (self.car_fingerprint in PREGLOBAL_CARS and cp.vl["Dash_State2"]["UNITS"] == 1) or \ - (self.car_fingerprint not in PREGLOBAL_CARS and cp.vl["Dashlights"]["UNITS"] == 1): + if (self.CP.flags & SubaruFlags.PREGLOBAL and cp.vl["Dash_State2"]["UNITS"] == 1) or \ + (not (self.CP.flags & SubaruFlags.PREGLOBAL) and cp.vl["Dashlights"]["UNITS"] == 1): ret.cruiseState.speed *= CV.MPH_TO_KPH ret.seatbeltUnlatched = cp.vl["Dashlights"]["SEATBELT_FL"] == 1 @@ -84,8 +84,8 @@ class CarState(CarStateBase): cp.vl["BodyInfo"]["DOOR_OPEN_FL"]]) ret.steerFaultPermanent = cp.vl["Steering_Torque"]["Steer_Error_1"] == 1 - cp_es_distance = cp_body if self.car_fingerprint in (GLOBAL_GEN2 | HYBRID_CARS) else cp_cam - if self.car_fingerprint in PREGLOBAL_CARS: + cp_es_distance = cp_body if self.CP.flags & (SubaruFlags.GLOBAL_GEN2 | SubaruFlags.HYBRID) else cp_cam + if self.CP.flags & SubaruFlags.PREGLOBAL: self.cruise_button = cp_cam.vl["ES_Distance"]["Cruise_Button"] self.ready = not cp_cam.vl["ES_DashStatus"]["Not_Ready_Startup"] else: @@ -96,12 +96,12 @@ class CarState(CarStateBase): (cp_cam.vl["ES_LKAS_State"]["LKAS_Alert"] == 2) self.es_lkas_state_msg = copy.copy(cp_cam.vl["ES_LKAS_State"]) - cp_es_brake = cp_body if self.car_fingerprint in GLOBAL_GEN2 else cp_cam + cp_es_brake = cp_body if self.CP.flags & SubaruFlags.GLOBAL_GEN2 else cp_cam self.es_brake_msg = copy.copy(cp_es_brake.vl["ES_Brake"]) - cp_es_status = cp_body if self.car_fingerprint in GLOBAL_GEN2 else cp_cam + cp_es_status = cp_body if self.CP.flags & SubaruFlags.GLOBAL_GEN2 else cp_cam # TODO: Hybrid cars don't have ES_Distance, need a replacement - if self.car_fingerprint not in HYBRID_CARS: + if not (self.CP.flags & SubaruFlags.HYBRID): # 8 is known AEB, there are a few other values related to AEB we ignore ret.stockAeb = (cp_es_distance.vl["ES_Brake"]["AEB_Status"] == 8) and \ (cp_es_distance.vl["ES_Brake"]["Brake_Pressure"] != 0) @@ -109,7 +109,7 @@ class CarState(CarStateBase): self.es_status_msg = copy.copy(cp_es_status.vl["ES_Status"]) self.cruise_control_msg = copy.copy(cp_cruise.vl["CruiseControl"]) - if self.car_fingerprint not in HYBRID_CARS: + if not (self.CP.flags & SubaruFlags.HYBRID): self.es_distance_msg = copy.copy(cp_es_distance.vl["ES_Distance"]) self.es_dashstatus_msg = copy.copy(cp_cam.vl["ES_DashStatus"]) @@ -125,7 +125,7 @@ class CarState(CarStateBase): ("Brake_Status", 50), ] - if CP.carFingerprint not in HYBRID_CARS: + if not (CP.flags & SubaruFlags.HYBRID): messages.append(("CruiseControl", 20)) return messages @@ -136,7 +136,7 @@ class CarState(CarStateBase): ("ES_Brake", 20), ] - if CP.carFingerprint not in HYBRID_CARS: + if not (CP.flags & SubaruFlags.HYBRID): messages += [ ("ES_Distance", 20), ("ES_Status", 20) @@ -164,7 +164,7 @@ class CarState(CarStateBase): ("Brake_Pedal", 50), ] - if CP.carFingerprint not in HYBRID_CARS: + if not (CP.flags & SubaruFlags.HYBRID): messages += [ ("Throttle", 100), ("Transmission", 100) @@ -173,8 +173,8 @@ class CarState(CarStateBase): if CP.enableBsm: messages.append(("BSD_RCTA", 17)) - if CP.carFingerprint not in PREGLOBAL_CARS: - if CP.carFingerprint not in GLOBAL_GEN2: + if not (CP.flags & SubaruFlags.PREGLOBAL): + if not (CP.flags & SubaruFlags.GLOBAL_GEN2): messages += CarState.get_common_global_body_messages(CP) else: messages += CarState.get_common_preglobal_body_messages() @@ -183,7 +183,7 @@ class CarState(CarStateBase): @staticmethod def get_cam_can_parser(CP): - if CP.carFingerprint in PREGLOBAL_CARS: + if CP.flags & SubaruFlags.PREGLOBAL: messages = [ ("ES_DashStatus", 20), ("ES_Distance", 20), @@ -194,7 +194,7 @@ class CarState(CarStateBase): ("ES_LKAS_State", 10), ] - if CP.carFingerprint not in GLOBAL_GEN2: + if not (CP.flags & SubaruFlags.GLOBAL_GEN2): messages += CarState.get_common_global_es_messages(CP) if CP.flags & SubaruFlags.SEND_INFOTAINMENT: @@ -206,11 +206,11 @@ class CarState(CarStateBase): def get_body_can_parser(CP): messages = [] - if CP.carFingerprint in GLOBAL_GEN2: + if CP.flags & SubaruFlags.GLOBAL_GEN2: messages += CarState.get_common_global_body_messages(CP) messages += CarState.get_common_global_es_messages(CP) - if CP.carFingerprint in HYBRID_CARS: + if CP.flags & SubaruFlags.HYBRID: messages += [ ("Throttle_Hybrid", 40), ("Transmission", 100) diff --git a/selfdrive/car/subaru/fingerprints.py b/selfdrive/car/subaru/fingerprints.py index ad8ebe87c..90fa6093d 100644 --- a/selfdrive/car/subaru/fingerprints.py +++ b/selfdrive/car/subaru/fingerprints.py @@ -509,17 +509,20 @@ FW_VERSIONS = { (Ecu.fwdCamera, 0x787, None): [ b'\x04!\x01\x1eD\x07!\x00\x04,', b'\x04!\x08\x01.\x07!\x08\x022', + b'\r!\x08\x017\n!\x08\x003', ], (Ecu.engine, 0x7e0, None): [ b'\xd5"`0\x07', b'\xd5"a0\x07', b'\xf1"`q\x07', b'\xf1"aq\x07', + b'\xfa"ap\x07', ], (Ecu.transmission, 0x7e1, None): [ b'\x1d\x86B0\x00', b'\x1d\xf6B0\x00', b'\x1e\x86B0\x00', + b'\x1e\x86F0\x00', b'\x1e\xf6D0\x00', ], }, diff --git a/selfdrive/car/subaru/interface.py b/selfdrive/car/subaru/interface.py index 1296aead5..30e186bd0 100644 --- a/selfdrive/car/subaru/interface.py +++ b/selfdrive/car/subaru/interface.py @@ -3,125 +3,91 @@ from panda import Panda from openpilot.selfdrive.car import get_safety_config from openpilot.selfdrive.car.disable_ecu import disable_ecu from openpilot.selfdrive.car.interfaces import CarInterfaceBase -from openpilot.selfdrive.car.subaru.values import CAR, GLOBAL_ES_ADDR, LKAS_ANGLE, GLOBAL_GEN2, PREGLOBAL_CARS, HYBRID_CARS, SubaruFlags +from openpilot.selfdrive.car.subaru.values import CAR, GLOBAL_ES_ADDR, SubaruFlags class CarInterface(CarInterfaceBase): @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate: CAR, fingerprint, car_fw, experimental_long, docs): ret.carName = "subaru" ret.radarUnavailable = True # for HYBRID CARS to be upstreamed, we need: # - replacement for ES_Distance so we can cancel the cruise control # - to find the Cruise_Activated bit from the car # - proper panda safety setup (use the correct cruise_activated bit, throttle from Throttle_Hybrid, etc) - ret.dashcamOnly = candidate in (PREGLOBAL_CARS | LKAS_ANGLE | HYBRID_CARS) + ret.dashcamOnly = bool(ret.flags & (SubaruFlags.PREGLOBAL | SubaruFlags.LKAS_ANGLE | SubaruFlags.HYBRID)) ret.autoResumeSng = False # Detect infotainment message sent from the camera - if candidate not in PREGLOBAL_CARS and 0x323 in fingerprint[2]: + if not (ret.flags & SubaruFlags.PREGLOBAL) and 0x323 in fingerprint[2]: ret.flags |= SubaruFlags.SEND_INFOTAINMENT.value - if candidate in PREGLOBAL_CARS: + if ret.flags & SubaruFlags.PREGLOBAL: ret.enableBsm = 0x25c in fingerprint[0] ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.subaruPreglobal)] else: ret.enableBsm = 0x228 in fingerprint[0] ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.subaru)] - if candidate in GLOBAL_GEN2: + if ret.flags & SubaruFlags.GLOBAL_GEN2: ret.safetyConfigs[0].safetyParam |= Panda.FLAG_SUBARU_GEN2 ret.steerLimitTimer = 0.4 ret.steerActuatorDelay = 0.1 - if candidate in LKAS_ANGLE: + if ret.flags & SubaruFlags.LKAS_ANGLE: ret.steerControlType = car.CarParams.SteerControlType.angle else: CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) if candidate in (CAR.ASCENT, CAR.ASCENT_2023): - ret.mass = 2031. - ret.wheelbase = 2.89 - ret.centerToFront = ret.wheelbase * 0.5 - ret.steerRatio = 13.5 - ret.steerActuatorDelay = 0.3 # end-to-end angle controller + ret.steerActuatorDelay = 0.3 # end-to-end angle controller ret.lateralTuning.init('pid') ret.lateralTuning.pid.kf = 0.00003 ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0., 20.], [0., 20.]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.0025, 0.1], [0.00025, 0.01]] elif candidate == CAR.IMPREZA: - ret.mass = 1568. - ret.wheelbase = 2.67 - ret.centerToFront = ret.wheelbase * 0.5 - ret.steerRatio = 15 - ret.steerActuatorDelay = 0.4 # end-to-end angle controller + ret.steerActuatorDelay = 0.4 # end-to-end angle controller ret.lateralTuning.init('pid') ret.lateralTuning.pid.kf = 0.00005 ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0., 20.], [0., 20.]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2, 0.3], [0.02, 0.03]] elif candidate == CAR.IMPREZA_2020: - ret.mass = 1480. - ret.wheelbase = 2.67 - ret.centerToFront = ret.wheelbase * 0.5 - ret.steerRatio = 17 # learned, 14 stock ret.lateralTuning.init('pid') ret.lateralTuning.pid.kf = 0.00005 ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0., 14., 23.], [0., 14., 23.]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.045, 0.042, 0.20], [0.04, 0.035, 0.045]] elif candidate == CAR.CROSSTREK_HYBRID: - ret.mass = 1668. - ret.wheelbase = 2.67 - ret.centerToFront = ret.wheelbase * 0.5 - ret.steerRatio = 17 ret.steerActuatorDelay = 0.1 elif candidate in (CAR.FORESTER, CAR.FORESTER_2022, CAR.FORESTER_HYBRID): - ret.mass = 1568. - ret.wheelbase = 2.67 - ret.centerToFront = ret.wheelbase * 0.5 - ret.steerRatio = 17 # learned, 14 stock ret.lateralTuning.init('pid') ret.lateralTuning.pid.kf = 0.000038 ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0., 14., 23.], [0., 14., 23.]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.01, 0.065, 0.2], [0.001, 0.015, 0.025]] elif candidate in (CAR.OUTBACK, CAR.LEGACY, CAR.OUTBACK_2023): - ret.mass = 1568. - ret.wheelbase = 2.67 - ret.centerToFront = ret.wheelbase * 0.5 - ret.steerRatio = 17 ret.steerActuatorDelay = 0.1 elif candidate in (CAR.FORESTER_PREGLOBAL, CAR.OUTBACK_PREGLOBAL_2018): ret.safetyConfigs[0].safetyParam = Panda.FLAG_SUBARU_PREGLOBAL_REVERSED_DRIVER_TORQUE # Outback 2018-2019 and Forester have reversed driver torque signal - ret.mass = 1568 - ret.wheelbase = 2.67 - ret.centerToFront = ret.wheelbase * 0.5 - ret.steerRatio = 20 # learned, 14 stock elif candidate == CAR.LEGACY_PREGLOBAL: - ret.mass = 1568 - ret.wheelbase = 2.67 - ret.centerToFront = ret.wheelbase * 0.5 - ret.steerRatio = 12.5 # 14.5 stock ret.steerActuatorDelay = 0.15 elif candidate == CAR.OUTBACK_PREGLOBAL: - ret.mass = 1568 - ret.wheelbase = 2.67 - ret.centerToFront = ret.wheelbase * 0.5 - ret.steerRatio = 20 # learned, 14 stock + pass else: raise ValueError(f"unknown car: {candidate}") - ret.experimentalLongitudinalAvailable = candidate not in (GLOBAL_GEN2 | PREGLOBAL_CARS | LKAS_ANGLE | HYBRID_CARS) + ret.experimentalLongitudinalAvailable = not (ret.flags & (SubaruFlags.GLOBAL_GEN2 | SubaruFlags.PREGLOBAL | + SubaruFlags.LKAS_ANGLE | SubaruFlags.HYBRID)) ret.openpilotLongitudinalControl = experimental_long and ret.experimentalLongitudinalAvailable - if candidate in GLOBAL_GEN2 and ret.openpilotLongitudinalControl: + if ret.flags & SubaruFlags.GLOBAL_GEN2 and ret.openpilotLongitudinalControl: ret.flags |= SubaruFlags.DISABLE_EYESIGHT.value if ret.openpilotLongitudinalControl: diff --git a/selfdrive/car/subaru/subarucan.py b/selfdrive/car/subaru/subarucan.py index 290737c3e..86d39ff88 100644 --- a/selfdrive/car/subaru/subarucan.py +++ b/selfdrive/car/subaru/subarucan.py @@ -13,6 +13,15 @@ def create_steering_control(packer, apply_steer, steer_req): return packer.make_can_msg("ES_LKAS", 0, values) +def create_steering_control_angle(packer, apply_steer, steer_req): + values = { + "LKAS_Output": apply_steer, + "LKAS_Request": steer_req, + "SET_3": 3 + } + return packer.make_can_msg("ES_LKAS_ANGLE", 0, values) + + def create_steering_status(packer): return packer.make_can_msg("ES_LKAS_State", 0, {}) diff --git a/selfdrive/car/subaru/values.py b/selfdrive/car/subaru/values.py index d9d2f78ce..566867822 100644 --- a/selfdrive/car/subaru/values.py +++ b/selfdrive/car/subaru/values.py @@ -1,10 +1,9 @@ from dataclasses import dataclass, field -from enum import Enum, IntFlag, StrEnum -from typing import Dict, List, Union +from enum import Enum, IntFlag from cereal import car from panda.python import uds -from openpilot.selfdrive.car import dbc_dict +from openpilot.selfdrive.car import CarSpecs, DbcDict, PlatformConfig, Platforms, dbc_dict from openpilot.selfdrive.car.docs_definitions import CarFootnote, CarHarness, CarInfo, CarParts, Tool, Column from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries, p16 @@ -20,7 +19,7 @@ class CarControllerParams: self.STEER_DRIVER_MULTIPLIER = 50 # weight driver torque heavily self.STEER_DRIVER_FACTOR = 1 # from dbc - if CP.carFingerprint in GLOBAL_GEN2: + if CP.flags & SubaruFlags.GLOBAL_GEN2: self.STEER_MAX = 1000 self.STEER_DELTA_UP = 40 self.STEER_DELTA_DOWN = 40 @@ -54,9 +53,20 @@ class CarControllerParams: class SubaruFlags(IntFlag): + # Detected flags SEND_INFOTAINMENT = 1 DISABLE_EYESIGHT = 2 + # Static flags + GLOBAL_GEN2 = 4 + + # Cars that temporarily fault when steering angle rate is greater than some threshold. + # Appears to be all torque-based cars produced around 2019 - present + STEER_RATE_LIMITED = 8 + PREGLOBAL = 16 + HYBRID = 32 + LKAS_ANGLE = 64 + GLOBAL_ES_ADDR = 0x787 GEN2_ES_BUTTONS_DID = b'\x11\x30' @@ -68,27 +78,6 @@ class CanBus: camera = 2 -class CAR(StrEnum): - # Global platform - ASCENT = "SUBARU ASCENT LIMITED 2019" - ASCENT_2023 = "SUBARU ASCENT 2023" - IMPREZA = "SUBARU IMPREZA LIMITED 2019" - IMPREZA_2020 = "SUBARU IMPREZA SPORT 2020" - FORESTER = "SUBARU FORESTER 2019" - OUTBACK = "SUBARU OUTBACK 6TH GEN" - CROSSTREK_HYBRID = "SUBARU CROSSTREK HYBRID 2020" - FORESTER_HYBRID = "SUBARU FORESTER HYBRID 2020" - LEGACY = "SUBARU LEGACY 7TH GEN" - FORESTER_2022 = "SUBARU FORESTER 2022" - OUTBACK_2023 = "SUBARU OUTBACK 7TH GEN" - - # Pre-global - FORESTER_PREGLOBAL = "SUBARU FORESTER 2017 - 2018" - LEGACY_PREGLOBAL = "SUBARU LEGACY 2015 - 2018" - OUTBACK_PREGLOBAL = "SUBARU OUTBACK 2015 - 2017" - OUTBACK_PREGLOBAL_2018 = "SUBARU OUTBACK 2018 - 2019" - - class Footnote(Enum): GLOBAL = CarFootnote( "In the non-US market, openpilot requires the car to come equipped with EyeSight with Lane Keep Assistance.", @@ -102,7 +91,7 @@ class Footnote(Enum): class SubaruCarInfo(CarInfo): package: str = "EyeSight Driver Assistance" car_parts: CarParts = field(default_factory=CarParts.common([CarHarness.subaru_a])) - footnotes: List[Enum] = field(default_factory=lambda: [Footnote.GLOBAL]) + footnotes: list[Enum] = field(default_factory=lambda: [Footnote.GLOBAL]) def init_make(self, CP: car.CarParams): self.car_parts.parts.extend([Tool.socket_8mm_deep, Tool.pry_tool]) @@ -110,41 +99,129 @@ class SubaruCarInfo(CarInfo): if CP.experimentalLongitudinalAvailable: self.footnotes.append(Footnote.EXP_LONG) -CAR_INFO: Dict[str, Union[SubaruCarInfo, List[SubaruCarInfo]]] = { - CAR.ASCENT: SubaruCarInfo("Subaru Ascent 2019-21", "All"), - CAR.OUTBACK: SubaruCarInfo("Subaru Outback 2020-22", "All", car_parts=CarParts.common([CarHarness.subaru_b])), - CAR.LEGACY: SubaruCarInfo("Subaru Legacy 2020-22", "All", car_parts=CarParts.common([CarHarness.subaru_b])), - CAR.IMPREZA: [ - SubaruCarInfo("Subaru Impreza 2017-19"), - SubaruCarInfo("Subaru Crosstrek 2018-19", video_link="https://youtu.be/Agww7oE1k-s?t=26"), - SubaruCarInfo("Subaru XV 2018-19", video_link="https://youtu.be/Agww7oE1k-s?t=26"), - ], - CAR.IMPREZA_2020: [ - SubaruCarInfo("Subaru Impreza 2020-22"), - SubaruCarInfo("Subaru Crosstrek 2020-23"), - SubaruCarInfo("Subaru XV 2020-21"), - ], + +@dataclass +class SubaruPlatformConfig(PlatformConfig): + dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('subaru_global_2017_generated', None)) + + def init(self): + if self.flags & SubaruFlags.HYBRID: + self.dbc_dict = dbc_dict('subaru_global_2020_hybrid_generated', None) + + +@dataclass +class SubaruGen2PlatformConfig(SubaruPlatformConfig): + def init(self): + super().init() + self.flags |= SubaruFlags.GLOBAL_GEN2 + if not (self.flags & SubaruFlags.LKAS_ANGLE): + self.flags |= SubaruFlags.STEER_RATE_LIMITED + + +class CAR(Platforms): + # Global platform + ASCENT = SubaruPlatformConfig( + "SUBARU ASCENT LIMITED 2019", + SubaruCarInfo("Subaru Ascent 2019-21", "All"), + CarSpecs(mass=2031, wheelbase=2.89, steerRatio=13.5), + ) + OUTBACK = SubaruGen2PlatformConfig( + "SUBARU OUTBACK 6TH GEN", + SubaruCarInfo("Subaru Outback 2020-22", "All", car_parts=CarParts.common([CarHarness.subaru_b])), + CarSpecs(mass=1568, wheelbase=2.67, steerRatio=17), + ) + LEGACY = SubaruGen2PlatformConfig( + "SUBARU LEGACY 7TH GEN", + SubaruCarInfo("Subaru Legacy 2020-22", "All", car_parts=CarParts.common([CarHarness.subaru_b])), + OUTBACK.specs, + ) + IMPREZA = SubaruPlatformConfig( + "SUBARU IMPREZA LIMITED 2019", + [ + SubaruCarInfo("Subaru Impreza 2017-19"), + SubaruCarInfo("Subaru Crosstrek 2018-19", video_link="https://youtu.be/Agww7oE1k-s?t=26"), + SubaruCarInfo("Subaru XV 2018-19", video_link="https://youtu.be/Agww7oE1k-s?t=26"), + ], + CarSpecs(mass=1568, wheelbase=2.67, steerRatio=15), + ) + IMPREZA_2020 = SubaruPlatformConfig( + "SUBARU IMPREZA SPORT 2020", + [ + SubaruCarInfo("Subaru Impreza 2020-22"), + SubaruCarInfo("Subaru Crosstrek 2020-23"), + SubaruCarInfo("Subaru XV 2020-21"), + ], + CarSpecs(mass=1480, wheelbase=2.67, steerRatio=17), + flags=SubaruFlags.STEER_RATE_LIMITED, + ) # TODO: is there an XV and Impreza too? - CAR.CROSSTREK_HYBRID: SubaruCarInfo("Subaru Crosstrek Hybrid 2020", car_parts=CarParts.common([CarHarness.subaru_b])), - CAR.FORESTER_HYBRID: SubaruCarInfo("Subaru Forester Hybrid 2020"), - CAR.FORESTER: SubaruCarInfo("Subaru Forester 2019-21", "All"), - CAR.FORESTER_PREGLOBAL: SubaruCarInfo("Subaru Forester 2017-18"), - CAR.LEGACY_PREGLOBAL: SubaruCarInfo("Subaru Legacy 2015-18"), - CAR.OUTBACK_PREGLOBAL: SubaruCarInfo("Subaru Outback 2015-17"), - CAR.OUTBACK_PREGLOBAL_2018: SubaruCarInfo("Subaru Outback 2018-19"), - CAR.FORESTER_2022: SubaruCarInfo("Subaru Forester 2022-23", "All", car_parts=CarParts.common([CarHarness.subaru_c])), - CAR.OUTBACK_2023: SubaruCarInfo("Subaru Outback 2023", "All", car_parts=CarParts.common([CarHarness.subaru_d])), - CAR.ASCENT_2023: SubaruCarInfo("Subaru Ascent 2023", "All", car_parts=CarParts.common([CarHarness.subaru_d])), -} + CROSSTREK_HYBRID = SubaruPlatformConfig( + "SUBARU CROSSTREK HYBRID 2020", + SubaruCarInfo("Subaru Crosstrek Hybrid 2020", car_parts=CarParts.common([CarHarness.subaru_b])), + CarSpecs(mass=1668, wheelbase=2.67, steerRatio=17), + flags=SubaruFlags.HYBRID, + ) + FORESTER = SubaruPlatformConfig( + "SUBARU FORESTER 2019", + SubaruCarInfo("Subaru Forester 2019-21", "All"), + CarSpecs(mass=1568, wheelbase=2.67, steerRatio=17), + flags=SubaruFlags.STEER_RATE_LIMITED, + ) + FORESTER_HYBRID = SubaruPlatformConfig( + "SUBARU FORESTER HYBRID 2020", + SubaruCarInfo("Subaru Forester Hybrid 2020"), + FORESTER.specs, + flags=SubaruFlags.HYBRID, + ) + # Pre-global + FORESTER_PREGLOBAL = SubaruPlatformConfig( + "SUBARU FORESTER 2017 - 2018", + SubaruCarInfo("Subaru Forester 2017-18"), + CarSpecs(mass=1568, wheelbase=2.67, steerRatio=20), + dbc_dict('subaru_forester_2017_generated', None), + flags=SubaruFlags.PREGLOBAL, + ) + LEGACY_PREGLOBAL = SubaruPlatformConfig( + "SUBARU LEGACY 2015 - 2018", + SubaruCarInfo("Subaru Legacy 2015-18"), + CarSpecs(mass=1568, wheelbase=2.67, steerRatio=12.5), + dbc_dict('subaru_outback_2015_generated', None), + flags=SubaruFlags.PREGLOBAL, + ) + OUTBACK_PREGLOBAL = SubaruPlatformConfig( + "SUBARU OUTBACK 2015 - 2017", + SubaruCarInfo("Subaru Outback 2015-17"), + FORESTER_PREGLOBAL.specs, + dbc_dict('subaru_outback_2015_generated', None), + flags=SubaruFlags.PREGLOBAL, + ) + OUTBACK_PREGLOBAL_2018 = SubaruPlatformConfig( + "SUBARU OUTBACK 2018 - 2019", + SubaruCarInfo("Subaru Outback 2018-19"), + FORESTER_PREGLOBAL.specs, + dbc_dict('subaru_outback_2019_generated', None), + flags=SubaruFlags.PREGLOBAL, + ) + # Angle LKAS + FORESTER_2022 = SubaruPlatformConfig( + "SUBARU FORESTER 2022", + SubaruCarInfo("Subaru Forester 2022-24", "All", car_parts=CarParts.common([CarHarness.subaru_c])), + FORESTER.specs, + flags=SubaruFlags.LKAS_ANGLE, + ) + OUTBACK_2023 = SubaruGen2PlatformConfig( + "SUBARU OUTBACK 7TH GEN", + SubaruCarInfo("Subaru Outback 2023", "All", car_parts=CarParts.common([CarHarness.subaru_d])), + OUTBACK.specs, + flags=SubaruFlags.LKAS_ANGLE, + ) + ASCENT_2023 = SubaruGen2PlatformConfig( + "SUBARU ASCENT 2023", + SubaruCarInfo("Subaru Ascent 2023", "All", car_parts=CarParts.common([CarHarness.subaru_d])), + ASCENT.specs, + flags=SubaruFlags.LKAS_ANGLE, + ) -LKAS_ANGLE = {CAR.FORESTER_2022, CAR.OUTBACK_2023, CAR.ASCENT_2023} -GLOBAL_GEN2 = {CAR.OUTBACK, CAR.LEGACY, CAR.OUTBACK_2023, CAR.ASCENT_2023} -PREGLOBAL_CARS = {CAR.FORESTER_PREGLOBAL, CAR.LEGACY_PREGLOBAL, CAR.OUTBACK_PREGLOBAL, CAR.OUTBACK_PREGLOBAL_2018} -HYBRID_CARS = {CAR.CROSSTREK_HYBRID, CAR.FORESTER_HYBRID} - -# Cars that temporarily fault when steering angle rate is greater than some threshold. -# Appears to be all torque-based cars produced around 2019 - present -STEER_RATE_LIMITED = GLOBAL_GEN2 | {CAR.IMPREZA_2020, CAR.FORESTER} SUBARU_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_DATA_IDENTIFICATION) @@ -182,24 +259,13 @@ FW_QUERY_CONFIG = FwQueryConfig( ], # We don't get the EPS from non-OBD queries on GEN2 cars. Note that we still attempt to match when it exists non_essential_ecus={ - Ecu.eps: list(GLOBAL_GEN2), + Ecu.eps: list(CAR.with_flags(SubaruFlags.GLOBAL_GEN2)), } ) -DBC = { - CAR.ASCENT: dbc_dict('subaru_global_2017_generated', None), - CAR.ASCENT_2023: dbc_dict('subaru_global_2017_generated', None), - CAR.IMPREZA: dbc_dict('subaru_global_2017_generated', None), - CAR.IMPREZA_2020: dbc_dict('subaru_global_2017_generated', None), - CAR.FORESTER: dbc_dict('subaru_global_2017_generated', None), - CAR.FORESTER_2022: dbc_dict('subaru_global_2017_generated', None), - CAR.OUTBACK: dbc_dict('subaru_global_2017_generated', None), - CAR.FORESTER_HYBRID: dbc_dict('subaru_global_2020_hybrid_generated', None), - CAR.CROSSTREK_HYBRID: dbc_dict('subaru_global_2020_hybrid_generated', None), - CAR.OUTBACK_2023: dbc_dict('subaru_global_2017_generated', None), - CAR.LEGACY: dbc_dict('subaru_global_2017_generated', None), - CAR.FORESTER_PREGLOBAL: dbc_dict('subaru_forester_2017_generated', None), - CAR.LEGACY_PREGLOBAL: dbc_dict('subaru_outback_2015_generated', None), - CAR.OUTBACK_PREGLOBAL: dbc_dict('subaru_outback_2015_generated', None), - CAR.OUTBACK_PREGLOBAL_2018: dbc_dict('subaru_outback_2019_generated', None), -} +CAR_INFO = CAR.create_carinfo_map() +DBC = CAR.create_dbc_map() + + +if __name__ == "__main__": + CAR.print_debug(SubaruFlags) diff --git a/selfdrive/car/tesla/carcontroller.py b/selfdrive/car/tesla/carcontroller.py index 95a248a61..f217c4692 100644 --- a/selfdrive/car/tesla/carcontroller.py +++ b/selfdrive/car/tesla/carcontroller.py @@ -1,11 +1,12 @@ from openpilot.common.numpy_fast import clip from opendbc.can.packer import CANPacker from openpilot.selfdrive.car import apply_std_steer_angle_limits +from openpilot.selfdrive.car.interfaces import CarControllerBase from openpilot.selfdrive.car.tesla.teslacan import TeslaCAN from openpilot.selfdrive.car.tesla.values import DBC, CANBUS, CarControllerParams -class CarController: +class CarController(CarControllerBase): def __init__(self, dbc_name, CP, VM): self.CP = CP self.frame = 0 diff --git a/selfdrive/car/tesla/interface.py b/selfdrive/car/tesla/interface.py index e06139729..537433a35 100755 --- a/selfdrive/car/tesla/interface.py +++ b/selfdrive/car/tesla/interface.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 from cereal import car from panda import Panda -from openpilot.selfdrive.car.tesla.values import CANBUS, CAR +from openpilot.selfdrive.car.tesla.values import CANBUS from openpilot.selfdrive.car import get_safety_config from openpilot.selfdrive.car.interfaces import CarInterfaceBase @@ -41,14 +41,6 @@ class CarInterface(CarInterfaceBase): ret.steerLimitTimer = 1.0 ret.steerActuatorDelay = 0.25 - if candidate in (CAR.AP2_MODELS, CAR.AP1_MODELS): - ret.mass = 2100. - ret.wheelbase = 2.959 - ret.centerToFront = ret.wheelbase * 0.5 - ret.steerRatio = 15.0 - else: - raise ValueError(f"Unsupported car: {candidate}") - return ret def _update(self, c): diff --git a/selfdrive/car/tesla/values.py b/selfdrive/car/tesla/values.py index 12877f134..3104506e5 100644 --- a/selfdrive/car/tesla/values.py +++ b/selfdrive/car/tesla/values.py @@ -1,9 +1,8 @@ from collections import namedtuple -from enum import StrEnum -from typing import Dict, List, Union +from dataclasses import dataclass, field from cereal import car -from openpilot.selfdrive.car import AngleRateLimit, dbc_dict +from openpilot.selfdrive.car import AngleRateLimit, CarSpecs, DbcDict, PlatformConfig, Platforms, dbc_dict from openpilot.selfdrive.car.docs_definitions import CarInfo from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries @@ -12,22 +11,24 @@ Ecu = car.CarParams.Ecu Button = namedtuple('Button', ['event_type', 'can_addr', 'can_msg', 'values']) -class CAR(StrEnum): - AP1_MODELS = 'TESLA AP1 MODEL S' - AP2_MODELS = 'TESLA AP2 MODEL S' +@dataclass +class TeslaPlatformConfig(PlatformConfig): + dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('tesla_powertrain', 'tesla_radar', chassis_dbc='tesla_can')) -CAR_INFO: Dict[str, Union[CarInfo, List[CarInfo]]] = { - CAR.AP1_MODELS: CarInfo("Tesla AP1 Model S", "All"), - CAR.AP2_MODELS: CarInfo("Tesla AP2 Model S", "All"), -} +class CAR(Platforms): + AP1_MODELS = TeslaPlatformConfig( + 'TESLA AP1 MODEL S', + CarInfo("Tesla AP1 Model S", "All"), + CarSpecs(mass=2100., wheelbase=2.959, steerRatio=15.0) + ) + AP2_MODELS = TeslaPlatformConfig( + 'TESLA AP2 MODEL S', + CarInfo("Tesla AP2 Model S", "All"), + AP1_MODELS.specs + ) -DBC = { - CAR.AP2_MODELS: dbc_dict('tesla_powertrain', 'tesla_radar', chassis_dbc='tesla_can'), - CAR.AP1_MODELS: dbc_dict('tesla_powertrain', 'tesla_radar', chassis_dbc='tesla_can'), -} - FW_QUERY_CONFIG = FwQueryConfig( requests=[ Request( @@ -89,3 +90,7 @@ class CarControllerParams: def __init__(self, CP): pass + + +CAR_INFO = CAR.create_carinfo_map() +DBC = CAR.create_dbc_map() diff --git a/selfdrive/car/tests/test_car_interfaces.py b/selfdrive/car/tests/test_car_interfaces.py index 2306cbf45..02a8d60e3 100755 --- a/selfdrive/car/tests/test_car_interfaces.py +++ b/selfdrive/car/tests/test_car_interfaces.py @@ -22,7 +22,7 @@ from openpilot.selfdrive.test.fuzzy_generation import DrawType, FuzzyGenerator ALL_ECUS = list({ecu for ecus in FW_VERSIONS.values() for ecu in ecus.keys()}) -MAX_EXAMPLES = int(os.environ.get('MAX_EXAMPLES', '20')) +MAX_EXAMPLES = int(os.environ.get('MAX_EXAMPLES', '40')) def get_fuzzy_car_interface_args(draw: DrawType) -> dict: @@ -46,11 +46,6 @@ def get_fuzzy_car_interface_args(draw: DrawType) -> dict: class TestCarInterfaces(unittest.TestCase): - - @classmethod - def setUpClass(cls): - os.environ['NO_RADAR_SLEEP'] = '1' - # FIXME: Due to the lists used in carParams, Phase.target is very slow and will cause # many generated examples to overrun when max_examples > ~20, don't use it @parameterized.expand([(car,) for car in sorted(all_known_cars())]) @@ -79,6 +74,10 @@ class TestCarInterfaces(unittest.TestCase): self.assertEqual(len(car_params.longitudinalTuning.kiV), len(car_params.longitudinalTuning.kiBP)) self.assertEqual(len(car_params.longitudinalTuning.deadzoneV), len(car_params.longitudinalTuning.deadzoneBP)) + # If we're using the interceptor for gasPressed, we should be commanding gas with it + if car_params.enableGasInterceptor: + self.assertTrue(car_params.openpilotLongitudinalControl) + # Lateral sanity checks if car_params.steerControlType != car.CarParams.SteerControlType.angle: tune = car_params.lateralTuning diff --git a/selfdrive/car/torque_data/override.toml b/selfdrive/car/torque_data/override.toml index 86723efb7..3cf17f317 100644 --- a/selfdrive/car/torque_data/override.toml +++ b/selfdrive/car/torque_data/override.toml @@ -42,7 +42,8 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "CHEVROLET BOLT EUV 2022" = [2.0, 2.0, 0.05] "CHEVROLET SILVERADO 1500 2020" = [1.9, 1.9, 0.112] "CHEVROLET TRAILBLAZER 2021" = [1.33, 1.9, 0.16] -"CHEVROLET EQUINOX 2019" = [2.0, 2.0, 0.05] +"CHEVROLET EQUINOX 2019" = [2.5, 2.5, 0.05] +"VOLKSWAGEN CADDY 3RD GEN" = [1.2, 1.2, 0.1] "VOLKSWAGEN PASSAT NMS" = [2.5, 2.5, 0.1] "VOLKSWAGEN SHARAN 2ND GEN" = [2.5, 2.5, 0.1] "HYUNDAI SANTA CRUZ 1ST GEN" = [2.7, 2.7, 0.1] diff --git a/selfdrive/car/torque_data/params.toml b/selfdrive/car/torque_data/params.toml index 568646c84..142332b22 100644 --- a/selfdrive/car/torque_data/params.toml +++ b/selfdrive/car/torque_data/params.toml @@ -11,8 +11,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "CHRYSLER PACIFICA HYBRID 2018" = [2.08887, 1.2943025830995154, 0.114818] "CHRYSLER PACIFICA HYBRID 2019" = [1.90120, 1.1958788168371808, 0.131520] "GENESIS G70 2018" = [3.8520195946707947, 2.354697063349854, 0.06830285485626221] -"HONDA ACCORD 2018" = [1.7135052593468778, 0.3461280068322071, 0.21579936052863807] -"HONDA ACCORD HYBRID 2018" = [1.6651615004829625, 0.30322180951193245, 0.2083000440586149] +"HONDA ACCORD 2018" = [1.6893333799149202, 0.3246749081720698, 0.2120497022936265] "HONDA CIVIC (BOSCH) 2019" = [1.691708637466905, 0.40132900729454185, 0.25460295304024094] "HONDA CIVIC 2016" = [1.6528895627785531, 0.4018518740819229, 0.25458812851328544] "HONDA CR-V 2016" = [0.7667141440182675, 0.5927571534745969, 0.40909087636157127] diff --git a/selfdrive/car/torque_data/substitute.toml b/selfdrive/car/torque_data/substitute.toml index d79475fc3..6822ef437 100644 --- a/selfdrive/car/torque_data/substitute.toml +++ b/selfdrive/car/torque_data/substitute.toml @@ -5,6 +5,8 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "MAZDA CX-5 2022" = "MAZDA CX-9 2021" "MAZDA CX-9" = "MAZDA CX-9 2021" +"DODGE DURANGO 2021" = "CHRYSLER PACIFICA 2020" + "TOYOTA ALPHARD 2020" = "TOYOTA SIENNA 2018" "TOYOTA PRIUS v 2017" = "TOYOTA PRIUS 2017" "LEXUS IS 2018" = "LEXUS NX 2018" diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index dee8bce3a..4d8fb218b 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -2,6 +2,7 @@ from cereal import car from openpilot.common.numpy_fast import clip, interp from openpilot.selfdrive.car import apply_meas_steer_torque_limits, apply_std_steer_angle_limits, common_fault_avoidance, \ create_gas_interceptor_command, make_can_msg +from openpilot.selfdrive.car.interfaces import CarControllerBase from openpilot.selfdrive.car.toyota import toyotacan from openpilot.selfdrive.car.toyota.values import CAR, STATIC_DSU_MSGS, NO_STOP_TIMER_CAR, TSS2_CAR, \ MIN_ACC_SPEED, PEDAL_TRANSITION, CarControllerParams, ToyotaFlags, \ @@ -48,7 +49,7 @@ def poll_blindspot_status(lr): m = lr + b'\x02\x21\x69\x00\x00\x00\x00' return make_can_msg(0x750, m, 0) -class CarController: +class CarController(CarControllerBase): def __init__(self, dbc_name, CP, VM): self.CP = CP self.params = CarControllerParams(self.CP) @@ -152,10 +153,10 @@ class CarController: apply_steer = apply_meas_steer_torque_limits(new_steer, self.last_steer, CS.out.steeringTorqueEps, self.params) # >100 degree/sec steering fault prevention - self.steer_rate_counter, apply_steer_req = common_fault_avoidance(abs(CS.out.steeringRateDeg) >= MAX_STEER_RATE, CC.latActive, + self.steer_rate_counter, apply_steer_req = common_fault_avoidance(abs(CS.out.steeringRateDeg) >= MAX_STEER_RATE, lat_active, self.steer_rate_counter, MAX_STEER_RATE_FRAMES) - if not CC.latActive: + if not lat_active: apply_steer = 0 # *** steer angle *** diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index a6689ec1b..1882c44ad 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -151,7 +151,9 @@ class CarState(CarStateBase): ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(can_gear, None)) ret.leftBlinker = cp.vl["BLINKERS_STATE"]["TURN_SIGNALS"] == 1 ret.rightBlinker = cp.vl["BLINKERS_STATE"]["TURN_SIGNALS"] == 2 - ret.engineRpm = cp.vl["ENGINE_RPM"]['RPM'] + + if self.CP.carFingerprint != CAR.MIRAI: + ret.engineRpm = cp.vl["ENGINE_RPM"]["RPM"] ret.steeringTorque = cp.vl["STEER_TORQUE_SENSOR"]["STEER_TORQUE_DRIVER"] ret.steeringTorqueEps = cp.vl["STEER_TORQUE_SENSOR"]["STEER_TORQUE_EPS"] * self.eps_torque_scale @@ -281,9 +283,11 @@ class CarState(CarStateBase): ("PCM_CRUISE", 33), ("PCM_CRUISE_SM", 1), ("STEER_TORQUE_SENSOR", 50), - ("ENGINE_RPM", 100), ] + if CP.carFingerprint != CAR.MIRAI: + messages.append(("ENGINE_RPM", 42)) + if CP.carFingerprint in UNSUPPORTED_DSU_CAR: messages.append(("DSU_CRUISE", 5)) messages.append(("PCM_CRUISE_ALT", 1)) diff --git a/selfdrive/car/toyota/fingerprints.py b/selfdrive/car/toyota/fingerprints.py index 19cdc53eb..b59e1abea 100644 --- a/selfdrive/car/toyota/fingerprints.py +++ b/selfdrive/car/toyota/fingerprints.py @@ -38,6 +38,7 @@ FW_VERSIONS = { b'F152607180\x00\x00\x00\x00\x00\x00', b'F152641040\x00\x00\x00\x00\x00\x00', b'F152641050\x00\x00\x00\x00\x00\x00', + b'F152641060\x00\x00\x00\x00\x00\x00', b'F152641061\x00\x00\x00\x00\x00\x00', ], (Ecu.dsu, 0x791, None): [ @@ -55,10 +56,12 @@ FW_VERSIONS = { b'\x01896630725100\x00\x00\x00\x00', b'\x01896630725200\x00\x00\x00\x00', b'\x01896630725300\x00\x00\x00\x00', + b'\x01896630725400\x00\x00\x00\x00', b'\x01896630735100\x00\x00\x00\x00', b'\x01896630738000\x00\x00\x00\x00', b'\x02896630724000\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', b'\x02896630728000\x00\x00\x00\x00897CF3302002\x00\x00\x00\x00', + b'\x02896630734000\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00', b'\x02896630737000\x00\x00\x00\x00897CF3305001\x00\x00\x00\x00', ], (Ecu.fwdRadar, 0x750, 0xf): [ @@ -570,6 +573,7 @@ FW_VERSIONS = { b'\x018821F6201400\x00\x00\x00\x00', ], (Ecu.fwdCamera, 0x750, 0x6d): [ + b'\x028646F12010C0\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', b'\x028646F12010D0\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', b'\x028646F1201100\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', b'\x028646F1201200\x00\x00\x00\x008646G26011A0\x00\x00\x00\x00', @@ -840,6 +844,7 @@ FW_VERSIONS = { b'8965B47023\x00\x00\x00\x00\x00\x00', b'8965B47050\x00\x00\x00\x00\x00\x00', b'8965B47060\x00\x00\x00\x00\x00\x00', + b'8965B47070\x00\x00\x00\x00\x00\x00', ], (Ecu.abs, 0x7b0, None): [ b'F152647290\x00\x00\x00\x00\x00\x00', @@ -1021,6 +1026,7 @@ FW_VERSIONS = { b'\x02896634A13000\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', b'\x02896634A13001\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', b'\x02896634A13101\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', + b'\x02896634A13201\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', b'\x02896634A14001\x00\x00\x00\x00897CF1203001\x00\x00\x00\x00', b'\x02896634A14001\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', b'\x02896634A14101\x00\x00\x00\x00897CF4801001\x00\x00\x00\x00', @@ -1260,6 +1266,7 @@ FW_VERSIONS = { }, CAR.LEXUS_ES: { (Ecu.engine, 0x7e0, None): [ + b'\x02333M4100\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', b'\x02333M4200\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', b'\x02333R0000\x00\x00\x00\x00\x00\x00\x00\x00A0C01000\x00\x00\x00\x00\x00\x00\x00\x00', ], @@ -1361,16 +1368,19 @@ FW_VERSIONS = { b'\x018966378G3000\x00\x00\x00\x00', ], (Ecu.engine, 0x7e0, None): [ + b'\x0237881000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', b'\x0237887000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', b'\x02378A0000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', b'\x02378F4000\x00\x00\x00\x00\x00\x00\x00\x00A4701000\x00\x00\x00\x00\x00\x00\x00\x00', ], (Ecu.abs, 0x7b0, None): [ b'\x01F152678221\x00\x00\x00\x00\x00\x00', + b'F152678200\x00\x00\x00\x00\x00\x00', b'F152678210\x00\x00\x00\x00\x00\x00', b'F152678211\x00\x00\x00\x00\x00\x00', ], (Ecu.eps, 0x7a1, None): [ + b'8965B78110\x00\x00\x00\x00\x00\x00', b'8965B78120\x00\x00\x00\x00\x00\x00', ], (Ecu.fwdRadar, 0x750, 0xf): [ diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index bd3f186b3..ec94e855c 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -1,5 +1,4 @@ from cereal import car -from openpilot.common.conversions import Conversions as CV from panda import Panda from panda.python import uds from openpilot.selfdrive.car.toyota.values import Ecu, CAR, DBC, ToyotaFlags, CarControllerParams, TSS2_CAR, RADAR_ACC_CAR, NO_DSU_CAR, \ @@ -47,10 +46,6 @@ class CarInterface(CarInterfaceBase): if candidate == CAR.PRIUS: stop_and_go = True - ret.wheelbase = 2.70 - ret.steerRatio = 15.74 # unknown end-to-end spec - ret.tireStiffnessFactor = 0.6371 # hand-tune - ret.mass = 3045. * CV.LB_TO_KG # Only give steer angle deadzone to for bad angle sensor prius for fw in car_fw: if fw.ecu == "eps" and not fw.fwVersion == b'8965B47060\x00\x00\x00\x00\x00\x00': @@ -59,68 +54,30 @@ class CarInterface(CarInterfaceBase): elif candidate == CAR.PRIUS_V: stop_and_go = True - ret.wheelbase = 2.78 - ret.steerRatio = 17.4 - ret.tireStiffnessFactor = 0.5533 - ret.mass = 3340. * CV.LB_TO_KG elif candidate in (CAR.RAV4, CAR.RAV4H): stop_and_go = True if (candidate in CAR.RAV4H) else False - ret.wheelbase = 2.65 - ret.steerRatio = 16.88 # 14.5 is spec end-to-end - ret.tireStiffnessFactor = 0.5533 - ret.mass = 3650. * CV.LB_TO_KG # mean between normal and hybrid - - elif candidate == CAR.COROLLA: - ret.wheelbase = 2.70 - ret.steerRatio = 18.27 - ret.tireStiffnessFactor = 0.444 # not optimized yet - ret.mass = 2860. * CV.LB_TO_KG # mean between normal and hybrid elif candidate in (CAR.LEXUS_RX, CAR.LEXUS_RX_TSS2): stop_and_go = True - ret.wheelbase = 2.79 - ret.steerRatio = 16. # 14.8 is spec end-to-end ret.wheelSpeedFactor = 1.035 - ret.tireStiffnessFactor = 0.5533 - ret.mass = 4481. * CV.LB_TO_KG # mean between min and max elif candidate in (CAR.CHR, CAR.CHR_TSS2): stop_and_go = True - ret.wheelbase = 2.63906 - ret.steerRatio = 13.6 - ret.tireStiffnessFactor = 0.7933 - ret.mass = 3300. * CV.LB_TO_KG elif candidate in (CAR.CAMRY, CAR.CAMRY_TSS2): stop_and_go = True - ret.wheelbase = 2.82448 - ret.steerRatio = 13.7 - ret.tireStiffnessFactor = 0.7933 - ret.mass = 3400. * CV.LB_TO_KG # mean between normal and hybrid elif candidate in (CAR.HIGHLANDER, CAR.HIGHLANDER_TSS2): # TODO: TSS-P models can do stop and go, but unclear if it requires sDSU or unplugging DSU stop_and_go = True - ret.wheelbase = 2.8194 # average of 109.8 and 112.2 in - ret.steerRatio = 16.0 - ret.tireStiffnessFactor = 0.8 - ret.mass = 4516. * CV.LB_TO_KG # mean between normal and hybrid elif candidate in (CAR.AVALON, CAR.AVALON_2019, CAR.AVALON_TSS2): # starting from 2019, all Avalon variants have stop and go # https://engage.toyota.com/static/images/toyota_safety_sense/TSS_Applicability_Chart.pdf stop_and_go = candidate != CAR.AVALON - ret.wheelbase = 2.82 - ret.steerRatio = 14.8 # Found at https://pressroom.toyota.com/releases/2016+avalon+product+specs.download - ret.tireStiffnessFactor = 0.7983 - ret.mass = 3505. * CV.LB_TO_KG # mean between normal and hybrid elif candidate in (CAR.RAV4_TSS2, CAR.RAV4_TSS2_2022, CAR.RAV4_TSS2_2023): - ret.wheelbase = 2.68986 - ret.steerRatio = 14.3 - ret.tireStiffnessFactor = 0.7933 - ret.mass = 3585. * CV.LB_TO_KG # Average between ICE and Hybrid ret.lateralTuning.init('pid') ret.lateralTuning.pid.kiBP = [0.0] ret.lateralTuning.pid.kpBP = [0.0] @@ -137,75 +94,17 @@ class CarInterface(CarInterfaceBase): ret.lateralTuning.pid.kf = 0.00004 break - elif candidate == CAR.COROLLA_TSS2: - ret.wheelbase = 2.67 # Average between 2.70 for sedan and 2.64 for hatchback - ret.steerRatio = 13.9 - ret.tireStiffnessFactor = 0.444 # not optimized yet - ret.mass = 3060. * CV.LB_TO_KG - - elif candidate in (CAR.LEXUS_ES, CAR.LEXUS_ES_TSS2): - ret.wheelbase = 2.8702 - ret.steerRatio = 16.0 # not optimized - ret.tireStiffnessFactor = 0.444 # not optimized yet - ret.mass = 3677. * CV.LB_TO_KG # mean between min and max - elif candidate == CAR.SIENNA: stop_and_go = True - ret.wheelbase = 3.03 - ret.steerRatio = 15.5 - ret.tireStiffnessFactor = 0.444 - ret.mass = 4590. * CV.LB_TO_KG - - elif candidate in (CAR.LEXUS_IS, CAR.LEXUS_IS_TSS2, CAR.LEXUS_RC): - ret.wheelbase = 2.79908 - ret.steerRatio = 13.3 - ret.tireStiffnessFactor = 0.444 - ret.mass = 3736.8 * CV.LB_TO_KG - - elif candidate == CAR.LEXUS_GS_F: - ret.wheelbase = 2.84988 - ret.steerRatio = 13.3 - ret.tireStiffnessFactor = 0.444 - ret.mass = 4034. * CV.LB_TO_KG elif candidate == CAR.LEXUS_CTH: stop_and_go = True - ret.wheelbase = 2.60 - ret.steerRatio = 18.6 - ret.tireStiffnessFactor = 0.517 - ret.mass = 3108 * CV.LB_TO_KG # mean between min and max elif candidate in (CAR.LEXUS_NX, CAR.LEXUS_NX_TSS2): stop_and_go = True - ret.wheelbase = 2.66 - ret.steerRatio = 14.7 - ret.tireStiffnessFactor = 0.444 # not optimized yet - ret.mass = 4070 * CV.LB_TO_KG - - elif candidate == CAR.LEXUS_LC_TSS2: - ret.wheelbase = 2.87 - ret.steerRatio = 13.0 - ret.tireStiffnessFactor = 0.444 # not optimized yet - ret.mass = 4500 * CV.LB_TO_KG - - elif candidate == CAR.PRIUS_TSS2: - ret.wheelbase = 2.70002 # from toyota online sepc. - ret.steerRatio = 13.4 # True steerRatio from older prius - ret.tireStiffnessFactor = 0.6371 # hand-tune - ret.mass = 3115. * CV.LB_TO_KG elif candidate == CAR.MIRAI: stop_and_go = True - ret.wheelbase = 2.91 - ret.steerRatio = 14.8 - ret.tireStiffnessFactor = 0.8 - ret.mass = 4300. * CV.LB_TO_KG - - elif candidate == CAR.ALPHARD_TSS2: - ret.wheelbase = 3.00 - ret.steerRatio = 14.2 - ret.tireStiffnessFactor = 0.444 - ret.mass = 4305. * CV.LB_TO_KG ret.centerToFront = ret.wheelbase * 0.44 @@ -226,20 +125,16 @@ class CarInterface(CarInterfaceBase): found_ecus = [fw.ecu for fw in car_fw] ret.enableDsu = len(found_ecus) > 0 and Ecu.dsu not in found_ecus and candidate not in (NO_DSU_CAR | UNSUPPORTED_DSU_CAR) \ and not (ret.flags & ToyotaFlags.SMART_DSU) - ret.enableGasInterceptor = 0x201 in fingerprint[0] - - if ret.enableGasInterceptor: - ret.safetyConfigs[0].safetyParam |= Panda.FLAG_TOYOTA_GAS_INTERCEPTOR # if the smartDSU is detected, openpilot can send ACC_CONTROL and the smartDSU will block it from the DSU or radar. # since we don't yet parse radar on TSS2/TSS-P radar-based ACC cars, gate longitudinal behind experimental toggle use_sdsu = bool(ret.flags & ToyotaFlags.SMART_DSU) if candidate in (RADAR_ACC_CAR | NO_DSU_CAR): - ret.experimentalLongitudinalAvailable = use_sdsu + ret.experimentalLongitudinalAvailable = use_sdsu or candidate in RADAR_ACC_CAR if not use_sdsu: # Disabling radar is only supported on TSS2 radar-ACC cars - if experimental_long and candidate in RADAR_ACC_CAR and False: # TODO: disabling radar isn't supported yet + if experimental_long and candidate in RADAR_ACC_CAR: ret.flags |= ToyotaFlags.DISABLE_RADAR.value else: use_sdsu = use_sdsu and experimental_long @@ -254,6 +149,7 @@ class CarInterface(CarInterfaceBase): # - TSS-P DSU-less cars w/ CAN filter installed (no radar parser yet) ret.openpilotLongitudinalControl = use_sdsu or ret.enableDsu or candidate in (TSS2_CAR - RADAR_ACC_CAR) or bool(ret.flags & ToyotaFlags.DISABLE_RADAR.value) ret.autoResumeSng = ret.openpilotLongitudinalControl and candidate in NO_STOP_TIMER_CAR + ret.enableGasInterceptor = 0x201 in fingerprint[0] and ret.openpilotLongitudinalControl if Params().get_bool("dp_long_stock_mode"): ret.openpilotLongitudinalControl = False @@ -261,6 +157,9 @@ class CarInterface(CarInterfaceBase): if not ret.openpilotLongitudinalControl: ret.safetyConfigs[0].safetyParam |= Panda.FLAG_TOYOTA_STOCK_LONGITUDINAL + if ret.enableGasInterceptor: + ret.safetyConfigs[0].safetyParam |= Panda.FLAG_TOYOTA_GAS_INTERCEPTOR + # min speed to enable ACC. if car can do stop and go, then set enabling speed # to a negative value, so it won't matter. ret.minEnableSpeed = -1. if (stop_and_go or ret.enableGasInterceptor) else MIN_ACC_SPEED @@ -274,13 +173,13 @@ class CarInterface(CarInterfaceBase): if candidate in TSS2_CAR or ret.enableGasInterceptor: tune.kpBP = [0., 5., 20.] tune.kpV = [1.3, 1.0, 0.7] - tune.kiBP = [ 0., 12., 20., 27., 40.] if dp_toyota_enhanced_long_tune else [0., 5., 12., 20., 27.] - tune.kiV = [.35, .215, .195, .10, .01] if dp_toyota_enhanced_long_tune else [.35, .23, .20, .17, .1] + tune.kiBP = [ 0., 2., 6., 20., 27., 40.] if dp_toyota_enhanced_long_tune else [0., 5., 12., 20., 27.] + tune.kiV = [.35, .31, .235, .195, .10, .01] if dp_toyota_enhanced_long_tune else [.35, .23, .20, .17, .1] if candidate in TSS2_CAR: ret.vEgoStopping = 0.1 if dp_toyota_enhanced_long_tune else 0.25 # car is near 0.1 to 0.2 when car starts requesting stopping accel ret.vEgoStarting = 0.1 if dp_toyota_enhanced_long_tune else 0.25 # needs to be > or == vEgoStopping ret.stopAccel = -0.40 if dp_toyota_enhanced_long_tune else -2.0 # Toyota requests -0.4 when stopped - ret.stoppingDecelRate = 0.5 if dp_toyota_enhanced_long_tune else 0.3 # reach stopping target smoothly - seems to take 0.5 seconds to go from 0 to -0.4 + ret.stoppingDecelRate = 0.4 if dp_toyota_enhanced_long_tune else 0.3 # reach stopping target smoothly - seems to take 0.5 seconds to go from 0 to -0.4 #ret.longitudinalActuatorDelayLowerBound = 1.5 if dp_toyota_enhanced_long_tune else 1.5 #ret.longitudinalActuatorDelayUpperBound = 1.5 if dp_toyota_enhanced_long_tune else 1.5 else: diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index ed2b022f4..9989b9225 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -1,11 +1,11 @@ import re from collections import defaultdict from dataclasses import dataclass, field -from enum import Enum, IntFlag, StrEnum -from typing import Dict, List, Set, Union +from enum import Enum, IntFlag from cereal import car from openpilot.common.conversions import Conversions as CV +from openpilot.selfdrive.car import CarSpecs, PlatformConfig, Platforms from openpilot.selfdrive.car import AngleRateLimit, dbc_dict from openpilot.selfdrive.car.docs_definitions import CarFootnote, CarInfo, Column, CarParts, CarHarness from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries @@ -42,50 +42,19 @@ class CarControllerParams: class ToyotaFlags(IntFlag): + # Detected flags HYBRID = 1 SMART_DSU = 2 DISABLE_RADAR = 4 - -class CAR(StrEnum): - # Toyota - ALPHARD_TSS2 = "TOYOTA ALPHARD 2020" - AVALON = "TOYOTA AVALON 2016" - AVALON_2019 = "TOYOTA AVALON 2019" - AVALON_TSS2 = "TOYOTA AVALON 2022" # TSS 2.5 - CAMRY = "TOYOTA CAMRY 2018" - CAMRY_TSS2 = "TOYOTA CAMRY 2021" # TSS 2.5 - CHR = "TOYOTA C-HR 2018" - CHR_TSS2 = "TOYOTA C-HR 2021" - COROLLA = "TOYOTA COROLLA 2017" - # LSS2 Lexus UX Hybrid is same as a TSS2 Corolla Hybrid - COROLLA_TSS2 = "TOYOTA COROLLA TSS2 2019" - HIGHLANDER = "TOYOTA HIGHLANDER 2017" - HIGHLANDER_TSS2 = "TOYOTA HIGHLANDER 2020" - PRIUS = "TOYOTA PRIUS 2017" - PRIUS_V = "TOYOTA PRIUS v 2017" - PRIUS_TSS2 = "TOYOTA PRIUS TSS2 2021" - RAV4 = "TOYOTA RAV4 2017" - RAV4H = "TOYOTA RAV4 HYBRID 2017" - RAV4_TSS2 = "TOYOTA RAV4 2019" - RAV4_TSS2_2022 = "TOYOTA RAV4 2022" - RAV4_TSS2_2023 = "TOYOTA RAV4 2023" - MIRAI = "TOYOTA MIRAI 2021" # TSS 2.5 - SIENNA = "TOYOTA SIENNA 2018" - - # Lexus - LEXUS_CTH = "LEXUS CT HYBRID 2018" - LEXUS_ES = "LEXUS ES 2018" - LEXUS_ES_TSS2 = "LEXUS ES 2019" - LEXUS_IS = "LEXUS IS 2018" - LEXUS_IS_TSS2 = "LEXUS IS 2023" - LEXUS_NX = "LEXUS NX 2018" - LEXUS_NX_TSS2 = "LEXUS NX 2020" - LEXUS_LC_TSS2 = "LEXUS LC 2024" - LEXUS_RC = "LEXUS RC 2020" - LEXUS_RX = "LEXUS RX 2016" - LEXUS_RX_TSS2 = "LEXUS RX 2020" - LEXUS_GS_F = "LEXUS GS F 2016" + # Static flags + TSS2 = 8 + NO_DSU = 16 + UNSUPPORTED_DSU = 32 + RADAR_ACC = 64 + # these cars use the Lane Tracing Assist (LTA) message for lateral control + ANGLE_CONTROL = 128 + NO_STOP_TIMER = 256 class Footnote(Enum): @@ -100,127 +69,305 @@ class ToyotaCarInfo(CarInfo): car_parts: CarParts = field(default_factory=CarParts.common([CarHarness.toyota_a])) -CAR_INFO: Dict[str, Union[ToyotaCarInfo, List[ToyotaCarInfo]]] = { +@dataclass +class ToyotaTSS2PlatformConfig(PlatformConfig): + dbc_dict: dict = field(default_factory=lambda: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas')) + + def init(self): + self.flags |= ToyotaFlags.TSS2 | ToyotaFlags.NO_STOP_TIMER | ToyotaFlags.NO_DSU + + if self.flags & ToyotaFlags.RADAR_ACC: + self.dbc_dict = dbc_dict('toyota_nodsu_pt_generated', None) + + +class CAR(Platforms): # Toyota - CAR.ALPHARD_TSS2: [ - ToyotaCarInfo("Toyota Alphard 2019-20"), - ToyotaCarInfo("Toyota Alphard Hybrid 2021"), - ], - CAR.AVALON: [ - ToyotaCarInfo("Toyota Avalon 2016", "Toyota Safety Sense P"), - ToyotaCarInfo("Toyota Avalon 2017-18"), - ], - CAR.AVALON_2019: [ - ToyotaCarInfo("Toyota Avalon 2019-21"), - ToyotaCarInfo("Toyota Avalon Hybrid 2019-21"), - ], - CAR.AVALON_TSS2: [ - ToyotaCarInfo("Toyota Avalon 2022"), - ToyotaCarInfo("Toyota Avalon Hybrid 2022"), - ], - CAR.CAMRY: [ - ToyotaCarInfo("Toyota Camry 2018-20", video_link="https://www.youtube.com/watch?v=fkcjviZY9CM", footnotes=[Footnote.CAMRY]), - ToyotaCarInfo("Toyota Camry Hybrid 2018-20", video_link="https://www.youtube.com/watch?v=Q2DYY0AWKgk"), - ], - CAR.CAMRY_TSS2: [ - ToyotaCarInfo("Toyota Camry 2021-24", footnotes=[Footnote.CAMRY]), - ToyotaCarInfo("Toyota Camry Hybrid 2021-24"), - ], - CAR.CHR: [ - ToyotaCarInfo("Toyota C-HR 2017-20"), - ToyotaCarInfo("Toyota C-HR Hybrid 2017-20"), - ], - CAR.CHR_TSS2: [ - ToyotaCarInfo("Toyota C-HR 2021"), - ToyotaCarInfo("Toyota C-HR Hybrid 2021-22"), - ], - CAR.COROLLA: ToyotaCarInfo("Toyota Corolla 2017-19"), - CAR.COROLLA_TSS2: [ - ToyotaCarInfo("Toyota Corolla 2020-22", video_link="https://www.youtube.com/watch?v=_66pXk0CBYA"), - ToyotaCarInfo("Toyota Corolla Cross (Non-US only) 2020-23", min_enable_speed=7.5), - ToyotaCarInfo("Toyota Corolla Hatchback 2019-22", video_link="https://www.youtube.com/watch?v=_66pXk0CBYA"), - # Hybrid platforms - ToyotaCarInfo("Toyota Corolla Hybrid 2020-22"), - ToyotaCarInfo("Toyota Corolla Hybrid (Non-US only) 2020-23", min_enable_speed=7.5), - ToyotaCarInfo("Toyota Corolla Cross Hybrid (Non-US only) 2020-22", min_enable_speed=7.5), - ToyotaCarInfo("Lexus UX Hybrid 2019-23"), - ], - CAR.HIGHLANDER: [ - ToyotaCarInfo("Toyota Highlander 2017-19", video_link="https://www.youtube.com/watch?v=0wS0wXSLzoo"), - ToyotaCarInfo("Toyota Highlander Hybrid 2017-19"), - ], - CAR.HIGHLANDER_TSS2: [ - ToyotaCarInfo("Toyota Highlander 2020-23"), - ToyotaCarInfo("Toyota Highlander Hybrid 2020-23"), - ], - CAR.PRIUS: [ - ToyotaCarInfo("Toyota Prius 2016", "Toyota Safety Sense P", video_link="https://www.youtube.com/watch?v=8zopPJI8XQ0"), - ToyotaCarInfo("Toyota Prius 2017-20", video_link="https://www.youtube.com/watch?v=8zopPJI8XQ0"), - ToyotaCarInfo("Toyota Prius Prime 2017-20", video_link="https://www.youtube.com/watch?v=8zopPJI8XQ0"), - ], - CAR.PRIUS_V: ToyotaCarInfo("Toyota Prius v 2017", "Toyota Safety Sense P", min_enable_speed=MIN_ACC_SPEED), - CAR.PRIUS_TSS2: [ - ToyotaCarInfo("Toyota Prius 2021-22", video_link="https://www.youtube.com/watch?v=J58TvCpUd4U"), - ToyotaCarInfo("Toyota Prius Prime 2021-22", video_link="https://www.youtube.com/watch?v=J58TvCpUd4U"), - ], - CAR.RAV4: [ - ToyotaCarInfo("Toyota RAV4 2016", "Toyota Safety Sense P"), - ToyotaCarInfo("Toyota RAV4 2017-18") - ], - CAR.RAV4H: [ - ToyotaCarInfo("Toyota RAV4 Hybrid 2016", "Toyota Safety Sense P", video_link="https://youtu.be/LhT5VzJVfNI?t=26"), - ToyotaCarInfo("Toyota RAV4 Hybrid 2017-18", video_link="https://youtu.be/LhT5VzJVfNI?t=26") - ], - CAR.RAV4_TSS2: [ - ToyotaCarInfo("Toyota RAV4 2019-21", video_link="https://www.youtube.com/watch?v=wJxjDd42gGA"), - ToyotaCarInfo("Toyota RAV4 Hybrid 2019-21"), - ], - CAR.RAV4_TSS2_2022: [ - ToyotaCarInfo("Toyota RAV4 2022"), - ToyotaCarInfo("Toyota RAV4 Hybrid 2022", video_link="https://youtu.be/U0nH9cnrFB0"), - ], - CAR.RAV4_TSS2_2023: [ - ToyotaCarInfo("Toyota RAV4 2023-24"), - ToyotaCarInfo("Toyota RAV4 Hybrid 2023-24"), - ], - CAR.MIRAI: ToyotaCarInfo("Toyota Mirai 2021"), - CAR.SIENNA: ToyotaCarInfo("Toyota Sienna 2018-20", video_link="https://www.youtube.com/watch?v=q1UPOo4Sh68", min_enable_speed=MIN_ACC_SPEED), + ALPHARD_TSS2 = ToyotaTSS2PlatformConfig( + "TOYOTA ALPHARD 2020", + [ + ToyotaCarInfo("Toyota Alphard 2019-20"), + ToyotaCarInfo("Toyota Alphard Hybrid 2021"), + ], + CarSpecs(mass=4305. * CV.LB_TO_KG, wheelbase=3.0, steerRatio=14.2, tireStiffnessFactor=0.444), + ) + AVALON = PlatformConfig( + "TOYOTA AVALON 2016", + [ + ToyotaCarInfo("Toyota Avalon 2016", "Toyota Safety Sense P"), + ToyotaCarInfo("Toyota Avalon 2017-18"), + ], + CarSpecs(mass=3505. * CV.LB_TO_KG, wheelbase=2.82, steerRatio=14.8, tireStiffnessFactor=0.7983), + dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + ) + AVALON_2019 = PlatformConfig( + "TOYOTA AVALON 2019", + [ + ToyotaCarInfo("Toyota Avalon 2019-21"), + ToyotaCarInfo("Toyota Avalon Hybrid 2019-21"), + ], + AVALON.specs, + dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), + ) + AVALON_TSS2 = ToyotaTSS2PlatformConfig( + "TOYOTA AVALON 2022", # TSS 2.5 + [ + ToyotaCarInfo("Toyota Avalon 2022"), + ToyotaCarInfo("Toyota Avalon Hybrid 2022"), + ], + AVALON.specs, + ) + CAMRY = PlatformConfig( + "TOYOTA CAMRY 2018", + [ + ToyotaCarInfo("Toyota Camry 2018-20", video_link="https://www.youtube.com/watch?v=fkcjviZY9CM", footnotes=[Footnote.CAMRY]), + ToyotaCarInfo("Toyota Camry Hybrid 2018-20", video_link="https://www.youtube.com/watch?v=Q2DYY0AWKgk"), + ], + CarSpecs(mass=3400. * CV.LB_TO_KG, wheelbase=2.82448, steerRatio=13.7, tireStiffnessFactor=0.7933), + dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), + flags=ToyotaFlags.NO_DSU, + ) + CAMRY_TSS2 = ToyotaTSS2PlatformConfig( + "TOYOTA CAMRY 2021", # TSS 2.5 + [ + ToyotaCarInfo("Toyota Camry 2021-24", footnotes=[Footnote.CAMRY]), + ToyotaCarInfo("Toyota Camry Hybrid 2021-24"), + ], + CAMRY.specs, + ) + CHR = PlatformConfig( + "TOYOTA C-HR 2018", + [ + ToyotaCarInfo("Toyota C-HR 2017-20"), + ToyotaCarInfo("Toyota C-HR Hybrid 2017-20"), + ], + CarSpecs(mass=3300. * CV.LB_TO_KG, wheelbase=2.63906, steerRatio=13.6, tireStiffnessFactor=0.7933), + dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), + flags=ToyotaFlags.NO_DSU, + ) + CHR_TSS2 = ToyotaTSS2PlatformConfig( + "TOYOTA C-HR 2021", + [ + ToyotaCarInfo("Toyota C-HR 2021"), + ToyotaCarInfo("Toyota C-HR Hybrid 2021-22"), + ], + CHR.specs, + flags=ToyotaFlags.RADAR_ACC, + ) + COROLLA = PlatformConfig( + "TOYOTA COROLLA 2017", + ToyotaCarInfo("Toyota Corolla 2017-19"), + CarSpecs(mass=2860. * CV.LB_TO_KG, wheelbase=2.7, steerRatio=18.27, tireStiffnessFactor=0.444), + dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), + ) + # LSS2 Lexus UX Hybrid is same as a TSS2 Corolla Hybrid + COROLLA_TSS2 = ToyotaTSS2PlatformConfig( + "TOYOTA COROLLA TSS2 2019", + [ + ToyotaCarInfo("Toyota Corolla 2020-22", video_link="https://www.youtube.com/watch?v=_66pXk0CBYA"), + ToyotaCarInfo("Toyota Corolla Cross (Non-US only) 2020-23", min_enable_speed=7.5), + ToyotaCarInfo("Toyota Corolla Hatchback 2019-22", video_link="https://www.youtube.com/watch?v=_66pXk0CBYA"), + # Hybrid platforms + ToyotaCarInfo("Toyota Corolla Hybrid 2020-22"), + ToyotaCarInfo("Toyota Corolla Hybrid (Non-US only) 2020-23", min_enable_speed=7.5), + ToyotaCarInfo("Toyota Corolla Cross Hybrid (Non-US only) 2020-22", min_enable_speed=7.5), + ToyotaCarInfo("Lexus UX Hybrid 2019-23"), + ], + CarSpecs(mass=3060. * CV.LB_TO_KG, wheelbase=2.67, steerRatio=13.9, tireStiffnessFactor=0.444), + ) + HIGHLANDER = PlatformConfig( + "TOYOTA HIGHLANDER 2017", + [ + ToyotaCarInfo("Toyota Highlander 2017-19", video_link="https://www.youtube.com/watch?v=0wS0wXSLzoo"), + ToyotaCarInfo("Toyota Highlander Hybrid 2017-19"), + ], + CarSpecs(mass=4516. * CV.LB_TO_KG, wheelbase=2.8194, steerRatio=16.0, tireStiffnessFactor=0.8), + dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + flags=ToyotaFlags.NO_STOP_TIMER, + ) + HIGHLANDER_TSS2 = ToyotaTSS2PlatformConfig( + "TOYOTA HIGHLANDER 2020", + [ + ToyotaCarInfo("Toyota Highlander 2020-23"), + ToyotaCarInfo("Toyota Highlander Hybrid 2020-23"), + ], + HIGHLANDER.specs, + ) + PRIUS = PlatformConfig( + "TOYOTA PRIUS 2017", + [ + ToyotaCarInfo("Toyota Prius 2016", "Toyota Safety Sense P", video_link="https://www.youtube.com/watch?v=8zopPJI8XQ0"), + ToyotaCarInfo("Toyota Prius 2017-20", video_link="https://www.youtube.com/watch?v=8zopPJI8XQ0"), + ToyotaCarInfo("Toyota Prius Prime 2017-20", video_link="https://www.youtube.com/watch?v=8zopPJI8XQ0"), + ], + CarSpecs(mass=3045. * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.74, tireStiffnessFactor=0.6371), + dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), + ) + PRIUS_V = PlatformConfig( + "TOYOTA PRIUS v 2017", + ToyotaCarInfo("Toyota Prius v 2017", "Toyota Safety Sense P", min_enable_speed=MIN_ACC_SPEED), + CarSpecs(mass=3340. * CV.LB_TO_KG, wheelbase=2.78, steerRatio=17.4, tireStiffnessFactor=0.5533), + dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), + flags=ToyotaFlags.NO_STOP_TIMER, + ) + PRIUS_TSS2 = ToyotaTSS2PlatformConfig( + "TOYOTA PRIUS TSS2 2021", + [ + ToyotaCarInfo("Toyota Prius 2021-22", video_link="https://www.youtube.com/watch?v=J58TvCpUd4U"), + ToyotaCarInfo("Toyota Prius Prime 2021-22", video_link="https://www.youtube.com/watch?v=J58TvCpUd4U"), + ], + CarSpecs(mass=3115. * CV.LB_TO_KG, wheelbase=2.70002, steerRatio=13.4, tireStiffnessFactor=0.6371), + ) + RAV4 = PlatformConfig( + "TOYOTA RAV4 2017", + [ + ToyotaCarInfo("Toyota RAV4 2016", "Toyota Safety Sense P"), + ToyotaCarInfo("Toyota RAV4 2017-18") + ], + CarSpecs(mass=3650. * CV.LB_TO_KG, wheelbase=2.65, steerRatio=16.88, tireStiffnessFactor=0.5533), + dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), + ) + RAV4H = PlatformConfig( + "TOYOTA RAV4 HYBRID 2017", + [ + ToyotaCarInfo("Toyota RAV4 Hybrid 2016", "Toyota Safety Sense P", video_link="https://youtu.be/LhT5VzJVfNI?t=26"), + ToyotaCarInfo("Toyota RAV4 Hybrid 2017-18", video_link="https://youtu.be/LhT5VzJVfNI?t=26") + ], + RAV4.specs, + dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + flags=ToyotaFlags.NO_STOP_TIMER, + ) + RAV4_TSS2 = ToyotaTSS2PlatformConfig( + "TOYOTA RAV4 2019", + [ + ToyotaCarInfo("Toyota RAV4 2019-21", video_link="https://www.youtube.com/watch?v=wJxjDd42gGA"), + ToyotaCarInfo("Toyota RAV4 Hybrid 2019-21"), + ], + CarSpecs(mass=3585. * CV.LB_TO_KG, wheelbase=2.68986, steerRatio=14.3, tireStiffnessFactor=0.7933), + ) + RAV4_TSS2_2022 = ToyotaTSS2PlatformConfig( + "TOYOTA RAV4 2022", + [ + ToyotaCarInfo("Toyota RAV4 2022"), + ToyotaCarInfo("Toyota RAV4 Hybrid 2022", video_link="https://youtu.be/U0nH9cnrFB0"), + ], + RAV4_TSS2.specs, + flags=ToyotaFlags.RADAR_ACC, + ) + RAV4_TSS2_2023 = ToyotaTSS2PlatformConfig( + "TOYOTA RAV4 2023", + [ + ToyotaCarInfo("Toyota RAV4 2023-24"), + ToyotaCarInfo("Toyota RAV4 Hybrid 2023-24"), + ], + RAV4_TSS2.specs, + flags=ToyotaFlags.RADAR_ACC | ToyotaFlags.ANGLE_CONTROL, + ) + MIRAI = ToyotaTSS2PlatformConfig( + "TOYOTA MIRAI 2021", # TSS 2.5 + ToyotaCarInfo("Toyota Mirai 2021"), + CarSpecs(mass=4300. * CV.LB_TO_KG, wheelbase=2.91, steerRatio=14.8, tireStiffnessFactor=0.8), + ) + SIENNA = PlatformConfig( + "TOYOTA SIENNA 2018", + ToyotaCarInfo("Toyota Sienna 2018-20", video_link="https://www.youtube.com/watch?v=q1UPOo4Sh68", min_enable_speed=MIN_ACC_SPEED), + CarSpecs(mass=4590. * CV.LB_TO_KG, wheelbase=3.03, steerRatio=15.5, tireStiffnessFactor=0.444), + dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + flags=ToyotaFlags.NO_STOP_TIMER, + ) # Lexus - CAR.LEXUS_CTH: ToyotaCarInfo("Lexus CT Hybrid 2017-18", "Lexus Safety System+"), - CAR.LEXUS_ES: [ - ToyotaCarInfo("Lexus ES 2017-18"), - ToyotaCarInfo("Lexus ES Hybrid 2017-18"), - ], - CAR.LEXUS_ES_TSS2: [ - ToyotaCarInfo("Lexus ES 2019-24"), - ToyotaCarInfo("Lexus ES Hybrid 2019-24", video_link="https://youtu.be/BZ29osRVJeg?t=12"), - ], - CAR.LEXUS_IS: ToyotaCarInfo("Lexus IS 2017-19"), - CAR.LEXUS_IS_TSS2: ToyotaCarInfo("Lexus IS 2022-23"), - CAR.LEXUS_GS_F: ToyotaCarInfo("Lexus GS F 2016"), - CAR.LEXUS_NX: [ - ToyotaCarInfo("Lexus NX 2018-19"), - ToyotaCarInfo("Lexus NX Hybrid 2018-19"), - ], - CAR.LEXUS_NX_TSS2: [ - ToyotaCarInfo("Lexus NX 2020-21"), - ToyotaCarInfo("Lexus NX Hybrid 2020-21"), - ], - CAR.LEXUS_LC_TSS2: ToyotaCarInfo("Lexus LC 2024"), - CAR.LEXUS_RC: ToyotaCarInfo("Lexus RC 2018-20"), - CAR.LEXUS_RX: [ - ToyotaCarInfo("Lexus RX 2016", "Lexus Safety System+"), - ToyotaCarInfo("Lexus RX 2017-19"), - # Hybrid platforms - ToyotaCarInfo("Lexus RX Hybrid 2016", "Lexus Safety System+"), - ToyotaCarInfo("Lexus RX Hybrid 2017-19"), - ], - CAR.LEXUS_RX_TSS2: [ - ToyotaCarInfo("Lexus RX 2020-22"), - ToyotaCarInfo("Lexus RX Hybrid 2020-22"), - ], -} + LEXUS_CTH = PlatformConfig( + "LEXUS CT HYBRID 2018", + ToyotaCarInfo("Lexus CT Hybrid 2017-18", "Lexus Safety System+"), + CarSpecs(mass=3108. * CV.LB_TO_KG, wheelbase=2.6, steerRatio=18.6, tireStiffnessFactor=0.517), + dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), + ) + LEXUS_ES = PlatformConfig( + "LEXUS ES 2018", + [ + ToyotaCarInfo("Lexus ES 2017-18"), + ToyotaCarInfo("Lexus ES Hybrid 2017-18"), + ], + CarSpecs(mass=3677. * CV.LB_TO_KG, wheelbase=2.8702, steerRatio=16.0, tireStiffnessFactor=0.444), + dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), + ) + LEXUS_ES_TSS2 = ToyotaTSS2PlatformConfig( + "LEXUS ES 2019", + [ + ToyotaCarInfo("Lexus ES 2019-24"), + ToyotaCarInfo("Lexus ES Hybrid 2019-24", video_link="https://youtu.be/BZ29osRVJeg?t=12"), + ], + LEXUS_ES.specs, + ) + LEXUS_IS = PlatformConfig( + "LEXUS IS 2018", + ToyotaCarInfo("Lexus IS 2017-19"), + CarSpecs(mass=3736.8 * CV.LB_TO_KG, wheelbase=2.79908, steerRatio=13.3, tireStiffnessFactor=0.444), + dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + flags=ToyotaFlags.UNSUPPORTED_DSU, + ) + LEXUS_IS_TSS2 = ToyotaTSS2PlatformConfig( + "LEXUS IS 2023", + ToyotaCarInfo("Lexus IS 2022-23"), + LEXUS_IS.specs, + ) + LEXUS_NX = PlatformConfig( + "LEXUS NX 2018", + [ + ToyotaCarInfo("Lexus NX 2018-19"), + ToyotaCarInfo("Lexus NX Hybrid 2018-19"), + ], + CarSpecs(mass=4070. * CV.LB_TO_KG, wheelbase=2.66, steerRatio=14.7, tireStiffnessFactor=0.444), + dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + ) + LEXUS_NX_TSS2 = ToyotaTSS2PlatformConfig( + "LEXUS NX 2020", + [ + ToyotaCarInfo("Lexus NX 2020-21"), + ToyotaCarInfo("Lexus NX Hybrid 2020-21"), + ], + LEXUS_NX.specs, + ) + LEXUS_LC_TSS2 = ToyotaTSS2PlatformConfig( + "LEXUS LC 2024", + ToyotaCarInfo("Lexus LC 2024"), + CarSpecs(mass=4500. * CV.LB_TO_KG, wheelbase=2.87, steerRatio=13.0, tireStiffnessFactor=0.444), + ) + LEXUS_RC = PlatformConfig( + "LEXUS RC 2020", + ToyotaCarInfo("Lexus RC 2018-20"), + LEXUS_IS.specs, + dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + flags=ToyotaFlags.UNSUPPORTED_DSU, + ) + LEXUS_RX = PlatformConfig( + "LEXUS RX 2016", + [ + ToyotaCarInfo("Lexus RX 2016", "Lexus Safety System+"), + ToyotaCarInfo("Lexus RX 2017-19"), + # Hybrid platforms + ToyotaCarInfo("Lexus RX Hybrid 2016", "Lexus Safety System+"), + ToyotaCarInfo("Lexus RX Hybrid 2017-19"), + ], + CarSpecs(mass=4481. * CV.LB_TO_KG, wheelbase=2.79, steerRatio=16., tireStiffnessFactor=0.5533), + dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), + ) + LEXUS_RX_TSS2 = ToyotaTSS2PlatformConfig( + "LEXUS RX 2020", + [ + ToyotaCarInfo("Lexus RX 2020-22"), + ToyotaCarInfo("Lexus RX Hybrid 2020-22"), + ], + LEXUS_RX.specs, + ) + LEXUS_GS_F = PlatformConfig( + "LEXUS GS F 2016", + ToyotaCarInfo("Lexus GS F 2016"), + CarSpecs(mass=4034. * CV.LB_TO_KG, wheelbase=2.84988, steerRatio=13.3, tireStiffnessFactor=0.444), + dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), + flags=ToyotaFlags.UNSUPPORTED_DSU, + ) + # (addr, cars, bus, 1/freq*100, vl) STATIC_DSU_MSGS = [ @@ -253,7 +400,7 @@ STATIC_DSU_MSGS = [ ] -def get_platform_codes(fw_versions: List[bytes]) -> Dict[bytes, Set[bytes]]: +def get_platform_codes(fw_versions: list[bytes]) -> dict[bytes, set[bytes]]: # Returns sub versions in a dict so comparisons can be made within part-platform-major_version combos codes = defaultdict(set) # Optional[part]-platform-major_version: set of sub_version for fw in fw_versions: @@ -297,7 +444,7 @@ def get_platform_codes(fw_versions: List[bytes]) -> Dict[bytes, Set[bytes]]: return dict(codes) -def match_fw_to_car_fuzzy(live_fw_versions, offline_fw_versions) -> Set[str]: +def match_fw_to_car_fuzzy(live_fw_versions, offline_fw_versions) -> set[str]: candidates = set() for candidate, fws in offline_fw_versions.items(): @@ -440,62 +587,24 @@ FW_QUERY_CONFIG = FwQueryConfig( STEER_THRESHOLD = 100 -DBC = { - CAR.RAV4H: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), - CAR.RAV4: dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), - CAR.PRIUS: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), - CAR.PRIUS_V: dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), - CAR.COROLLA: dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), - CAR.LEXUS_LC_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), - CAR.LEXUS_RC: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), - CAR.LEXUS_RX: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), - CAR.LEXUS_RX_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), - CAR.CHR: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), - CAR.CHR_TSS2: dbc_dict('toyota_nodsu_pt_generated', None), - CAR.CAMRY: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), - CAR.CAMRY_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), - CAR.HIGHLANDER: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), - CAR.HIGHLANDER_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), - CAR.AVALON: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), - CAR.AVALON_2019: dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'), - CAR.AVALON_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), - CAR.RAV4_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), - CAR.RAV4_TSS2_2022: dbc_dict('toyota_nodsu_pt_generated', None), - CAR.RAV4_TSS2_2023: dbc_dict('toyota_nodsu_pt_generated', None), - CAR.COROLLA_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), - CAR.LEXUS_ES: dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), - CAR.LEXUS_ES_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), - CAR.SIENNA: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), - CAR.LEXUS_IS: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), - CAR.LEXUS_IS_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), - CAR.LEXUS_CTH: dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), - CAR.LEXUS_NX: dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'), - CAR.LEXUS_NX_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), - CAR.PRIUS_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), - CAR.MIRAI: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), - CAR.ALPHARD_TSS2: dbc_dict('toyota_nodsu_pt_generated', 'toyota_tss2_adas'), - CAR.LEXUS_GS_F: dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'), -} - # These cars have non-standard EPS torque scale factors. All others are 73 EPS_SCALE = defaultdict(lambda: 73, {CAR.PRIUS: 66, CAR.COROLLA: 88, CAR.LEXUS_IS: 77, CAR.LEXUS_RC: 77, CAR.LEXUS_CTH: 100, CAR.PRIUS_V: 100}) # Toyota/Lexus Safety Sense 2.0 and 2.5 -TSS2_CAR = {CAR.RAV4_TSS2, CAR.RAV4_TSS2_2022, CAR.RAV4_TSS2_2023, CAR.COROLLA_TSS2, CAR.LEXUS_ES_TSS2, - CAR.LEXUS_RX_TSS2, CAR.HIGHLANDER_TSS2, CAR.PRIUS_TSS2, CAR.CAMRY_TSS2, CAR.LEXUS_IS_TSS2, - CAR.MIRAI, CAR.LEXUS_NX_TSS2, CAR.LEXUS_LC_TSS2, CAR.ALPHARD_TSS2, CAR.AVALON_TSS2, - CAR.CHR_TSS2} +TSS2_CAR = CAR.with_flags(ToyotaFlags.TSS2) -NO_DSU_CAR = TSS2_CAR | {CAR.CHR, CAR.CAMRY} +NO_DSU_CAR = CAR.with_flags(ToyotaFlags.NO_DSU) # the DSU uses the AEB message for longitudinal on these cars -UNSUPPORTED_DSU_CAR = {CAR.LEXUS_IS, CAR.LEXUS_RC, CAR.LEXUS_GS_F} +UNSUPPORTED_DSU_CAR = CAR.with_flags(ToyotaFlags.UNSUPPORTED_DSU) # these cars have a radar which sends ACC messages instead of the camera -RADAR_ACC_CAR = {CAR.RAV4_TSS2_2022, CAR.RAV4_TSS2_2023, CAR.CHR_TSS2} +RADAR_ACC_CAR = CAR.with_flags(ToyotaFlags.RADAR_ACC) -# these cars use the Lane Tracing Assist (LTA) message for lateral control -ANGLE_CONTROL_CAR = {CAR.RAV4_TSS2_2023} +ANGLE_CONTROL_CAR = CAR.with_flags(ToyotaFlags.ANGLE_CONTROL) # no resume button press required -NO_STOP_TIMER_CAR = TSS2_CAR | {CAR.PRIUS_V, CAR.RAV4H, CAR.HIGHLANDER, CAR.SIENNA} +NO_STOP_TIMER_CAR = CAR.with_flags(ToyotaFlags.NO_STOP_TIMER) + +CAR_INFO = CAR.create_carinfo_map() +DBC = CAR.create_dbc_map() diff --git a/selfdrive/car/values.py b/selfdrive/car/values.py new file mode 100644 index 000000000..3e2787091 --- /dev/null +++ b/selfdrive/car/values.py @@ -0,0 +1,18 @@ +from typing import cast +from openpilot.selfdrive.car.body.values import CAR as BODY +from openpilot.selfdrive.car.chrysler.values import CAR as CHRYSLER +from openpilot.selfdrive.car.ford.values import CAR as FORD +from openpilot.selfdrive.car.gm.values import CAR as GM +from openpilot.selfdrive.car.honda.values import CAR as HONDA +from openpilot.selfdrive.car.hyundai.values import CAR as HYUNDAI +from openpilot.selfdrive.car.mazda.values import CAR as MAZDA +from openpilot.selfdrive.car.nissan.values import CAR as NISSAN +from openpilot.selfdrive.car.subaru.values import CAR as SUBARU +from openpilot.selfdrive.car.tesla.values import CAR as TESLA +from openpilot.selfdrive.car.toyota.values import CAR as TOYOTA +from openpilot.selfdrive.car.volkswagen.values import CAR as VOLKSWAGEN + +Platform = BODY | CHRYSLER | FORD | GM | HONDA | HYUNDAI | MAZDA | NISSAN | SUBARU | TESLA | TOYOTA | VOLKSWAGEN +BRANDS = [BODY, CHRYSLER, FORD, GM, HONDA, HYUNDAI, MAZDA, NISSAN, SUBARU, TESLA, TOYOTA, VOLKSWAGEN] + +PLATFORMS: dict[str, Platform] = {str(platform): platform for brand in BRANDS for platform in cast(list[Platform], brand)} diff --git a/selfdrive/car/vin.py b/selfdrive/car/vin.py index 4e554665e..e668c35f7 100755 --- a/selfdrive/car/vin.py +++ b/selfdrive/car/vin.py @@ -15,13 +15,14 @@ def is_valid_vin(vin: str): return re.fullmatch(VIN_RE, vin) is not None -def get_vin(logcan, sendcan, buses, timeout=0.1, retry=3, debug=False): +def get_vin(logcan, sendcan, buses, timeout=0.1, retry=2, debug=False): for i in range(retry): for bus in buses: for request, response, valid_buses, vin_addrs, functional_addrs, rx_offset in ( (StdQueries.UDS_VIN_REQUEST, StdQueries.UDS_VIN_RESPONSE, (0, 1), STANDARD_VIN_ADDRS, FUNCTIONAL_ADDRS, 0x8), (StdQueries.OBD_VIN_REQUEST, StdQueries.OBD_VIN_RESPONSE, (0, 1), STANDARD_VIN_ADDRS, FUNCTIONAL_ADDRS, 0x8), (StdQueries.GM_VIN_REQUEST, StdQueries.GM_VIN_RESPONSE, (0,), [0x24b], None, 0x400), # Bolt fwdCamera + (StdQueries.KWP_VIN_REQUEST, StdQueries.KWP_VIN_RESPONSE, (0,), [0x797], None, 0x3), # Nissan Leaf VCM ): if bus not in valid_buses: continue @@ -40,8 +41,8 @@ def get_vin(logcan, sendcan, buses, timeout=0.1, retry=3, debug=False): for addr in vin_addrs: vin = results.get((addr, None)) if vin is not None: - # Ford pads with null bytes - if len(vin) == 24: + # Ford and Nissan pads with null bytes + if len(vin) in (19, 24): vin = re.sub(b'\x00*$', b'', vin) # Honda Bosch response starts with a length, trim to correct length diff --git a/selfdrive/car/volkswagen/carcontroller.py b/selfdrive/car/volkswagen/carcontroller.py index 0cee2c7fc..1b1858703 100644 --- a/selfdrive/car/volkswagen/carcontroller.py +++ b/selfdrive/car/volkswagen/carcontroller.py @@ -4,18 +4,19 @@ from openpilot.common.numpy_fast import clip from openpilot.common.conversions import Conversions as CV from openpilot.common.realtime import DT_CTRL from openpilot.selfdrive.car import apply_driver_steer_torque_limits +from openpilot.selfdrive.car.interfaces import CarControllerBase from openpilot.selfdrive.car.volkswagen import mqbcan, pqcan -from openpilot.selfdrive.car.volkswagen.values import CANBUS, PQ_CARS, CarControllerParams, VolkswagenFlags +from openpilot.selfdrive.car.volkswagen.values import CANBUS, CarControllerParams, VolkswagenFlags VisualAlert = car.CarControl.HUDControl.VisualAlert LongCtrlState = car.CarControl.Actuators.LongControlState -class CarController: +class CarController(CarControllerBase): def __init__(self, dbc_name, CP, VM): self.CP = CP self.CCP = CarControllerParams(CP) - self.CCS = pqcan if CP.carFingerprint in PQ_CARS else mqbcan + self.CCS = pqcan if CP.flags & VolkswagenFlags.PQ else mqbcan self.packer_pt = CANPacker(dbc_name) self.apply_steer_last = 0 diff --git a/selfdrive/car/volkswagen/carstate.py b/selfdrive/car/volkswagen/carstate.py index 58aa5767e..b06ad419f 100644 --- a/selfdrive/car/volkswagen/carstate.py +++ b/selfdrive/car/volkswagen/carstate.py @@ -3,13 +3,15 @@ from cereal import car from openpilot.common.conversions import Conversions as CV from openpilot.selfdrive.car.interfaces import CarStateBase from opendbc.can.parser import CANParser -from openpilot.selfdrive.car.volkswagen.values import DBC, CANBUS, PQ_CARS, NetworkLocation, TransmissionType, GearShifter, \ +from openpilot.selfdrive.car.volkswagen.values import DBC, CANBUS, NetworkLocation, TransmissionType, GearShifter, \ CarControllerParams, VolkswagenFlags class CarState(CarStateBase): def __init__(self, CP): super().__init__(CP) + self.frame = 0 + self.eps_init_complete = False self.CCP = CarControllerParams(CP) self.button_states = {button.event_type: False for button in self.CCP.BUTTONS} self.esp_hold_confirmation = False @@ -31,7 +33,7 @@ class CarState(CarStateBase): return button_events def update(self, pt_cp, cam_cp, ext_cp, trans_type): - if self.CP.carFingerprint in PQ_CARS: + if self.CP.flags & VolkswagenFlags.PQ: return self.update_pq(pt_cp, cam_cp, ext_cp, trans_type) ret = car.CarState.new_message() @@ -47,18 +49,14 @@ class CarState(CarStateBase): ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) ret.standstill = ret.vEgoRaw == 0 - # Update steering angle, rate, yaw rate, and driver input torque. VW send - # the sign/direction in a separate signal so they must be recombined. + # Update EPS position and state info. For signed values, VW sends the sign in a separate signal. ret.steeringAngleDeg = pt_cp.vl["LWI_01"]["LWI_Lenkradwinkel"] * (1, -1)[int(pt_cp.vl["LWI_01"]["LWI_VZ_Lenkradwinkel"])] ret.steeringRateDeg = pt_cp.vl["LWI_01"]["LWI_Lenkradw_Geschw"] * (1, -1)[int(pt_cp.vl["LWI_01"]["LWI_VZ_Lenkradw_Geschw"])] ret.steeringTorque = pt_cp.vl["LH_EPS_03"]["EPS_Lenkmoment"] * (1, -1)[int(pt_cp.vl["LH_EPS_03"]["EPS_VZ_Lenkmoment"])] ret.steeringPressed = abs(ret.steeringTorque) > self.CCP.STEER_DRIVER_ALLOWANCE ret.yawRate = pt_cp.vl["ESP_02"]["ESP_Gierrate"] * (1, -1)[int(pt_cp.vl["ESP_02"]["ESP_VZ_Gierrate"])] * CV.DEG_TO_RAD - - # Verify EPS readiness to accept steering commands hca_status = self.CCP.hca_status_values.get(pt_cp.vl["LH_EPS_03"]["EPS_HCA_Status"]) - ret.steerFaultPermanent = hca_status in ("DISABLED", "FAULT") - ret.steerFaultTemporary = hca_status in ("INITIALIZING", "REJECTED") + ret.steerFaultTemporary, ret.steerFaultPermanent = self.update_hca_state(hca_status) # VW Emergency Assist status tracking and mitigation self.eps_stock_values = pt_cp.vl["LH_EPS_03"] @@ -152,6 +150,7 @@ class CarState(CarStateBase): # Digital instrument clusters expect the ACC HUD lead car distance to be scaled differently self.upscale_lead_car_signal = bool(pt_cp.vl["Kombi_03"]["KBI_Variante"]) + self.frame += 1 return ret def update_pq(self, pt_cp, cam_cp, ext_cp, trans_type): @@ -169,18 +168,14 @@ class CarState(CarStateBase): ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) ret.standstill = ret.vEgoRaw == 0 - # Update steering angle, rate, yaw rate, and driver input torque. VW send - # the sign/direction in a separate signal so they must be recombined. + # Update EPS position and state info. For signed values, VW sends the sign in a separate signal. ret.steeringAngleDeg = pt_cp.vl["Lenkhilfe_3"]["LH3_BLW"] * (1, -1)[int(pt_cp.vl["Lenkhilfe_3"]["LH3_BLWSign"])] ret.steeringRateDeg = pt_cp.vl["Lenkwinkel_1"]["Lenkradwinkel_Geschwindigkeit"] * (1, -1)[int(pt_cp.vl["Lenkwinkel_1"]["Lenkradwinkel_Geschwindigkeit_S"])] ret.steeringTorque = pt_cp.vl["Lenkhilfe_3"]["LH3_LM"] * (1, -1)[int(pt_cp.vl["Lenkhilfe_3"]["LH3_LMSign"])] ret.steeringPressed = abs(ret.steeringTorque) > self.CCP.STEER_DRIVER_ALLOWANCE ret.yawRate = pt_cp.vl["Bremse_5"]["Giergeschwindigkeit"] * (1, -1)[int(pt_cp.vl["Bremse_5"]["Vorzeichen_der_Giergeschwindigk"])] * CV.DEG_TO_RAD - - # Verify EPS readiness to accept steering commands hca_status = self.CCP.hca_status_values.get(pt_cp.vl["Lenkhilfe_2"]["LH2_Sta_HCA"]) - ret.steerFaultPermanent = hca_status in ("DISABLED", "FAULT") - ret.steerFaultTemporary = hca_status in ("INITIALIZING", "REJECTED") + ret.steerFaultTemporary, ret.steerFaultPermanent = self.update_hca_state(hca_status) # Update gas, brakes, and gearshift. ret.gas = pt_cp.vl["Motor_3"]["Fahrpedal_Rohsignal"] / 100.0 @@ -255,11 +250,20 @@ class CarState(CarStateBase): # Additional safety checks performed in CarInterface. ret.espDisabled = bool(pt_cp.vl["Bremse_1"]["ESP_Passiv_getastet"]) + self.frame += 1 return ret + def update_hca_state(self, hca_status): + # Treat INITIALIZING and FAULT as temporary for worst likely EPS recovery time, for cars without factory Lane Assist + # DISABLED means the EPS hasn't been configured to support Lane Assist + self.eps_init_complete = self.eps_init_complete or (hca_status in ("DISABLED", "READY", "ACTIVE") or self.frame > 600) + perm_fault = hca_status == "DISABLED" or (self.eps_init_complete and hca_status in ("INITIALIZING", "FAULT")) + temp_fault = hca_status == "REJECTED" or not self.eps_init_complete + return temp_fault, perm_fault + @staticmethod def get_can_parser(CP): - if CP.carFingerprint in PQ_CARS: + if CP.flags & VolkswagenFlags.PQ: return CarState.get_can_parser_pq(CP) messages = [ @@ -296,7 +300,7 @@ class CarState(CarStateBase): @staticmethod def get_cam_can_parser(CP): - if CP.carFingerprint in PQ_CARS: + if CP.flags & VolkswagenFlags.PQ: return CarState.get_cam_can_parser_pq(CP) messages = [] diff --git a/selfdrive/car/volkswagen/fingerprints.py b/selfdrive/car/volkswagen/fingerprints.py index 8e5a0667b..d2c85d0fc 100644 --- a/selfdrive/car/volkswagen/fingerprints.py +++ b/selfdrive/car/volkswagen/fingerprints.py @@ -99,6 +99,17 @@ FW_VERSIONS = { b'\xf1\x875Q0907572P \xf1\x890682', ], }, + CAR.CADDY_MK3: { + (Ecu.engine, 0x7e0, None): [ + b'\xf1\x8704E906027T \xf1\x892363', + ], + (Ecu.srs, 0x715, None): [ + b'\xf1\x872K5959655E \xf1\x890018\xf1\x82\x05000P037605', + ], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x877N0907572C \xf1\x890211\xf1\x82\x0155', + ], + }, CAR.CRAFTER_MK2: { (Ecu.engine, 0x7e0, None): [ b'\xf1\x8704L906056BP\xf1\x894729', @@ -1043,6 +1054,7 @@ FW_VERSIONS = { ], (Ecu.srs, 0x715, None): [ b'\xf1\x873Q0959655AC\xf1\x890200\xf1\x82\r11120011100010022212110200', + b'\xf1\x873Q0959655AK\xf1\x890306\xf1\x82\r31210031210021033733310331', b'\xf1\x873Q0959655AP\xf1\x890305\xf1\x82\r11110011110011213331312131', b'\xf1\x873Q0959655AQ\xf1\x890200\xf1\x82\r11120011100010312212113100', b'\xf1\x873Q0959655AS\xf1\x890200\xf1\x82\r11120011100010022212110200', @@ -1062,6 +1074,7 @@ FW_VERSIONS = { (Ecu.fwdRadar, 0x757, None): [ b'\xf1\x875Q0907572D \xf1\x890304\xf1\x82\x0101', b'\xf1\x875Q0907572F \xf1\x890400\xf1\x82\x0101', + b'\xf1\x875Q0907572H \xf1\x890620', b'\xf1\x875Q0907572J \xf1\x890654', b'\xf1\x875Q0907572K \xf1\x890402\xf1\x82\x0101', b'\xf1\x875Q0907572P \xf1\x890682', diff --git a/selfdrive/car/volkswagen/interface.py b/selfdrive/car/volkswagen/interface.py index 710e779d0..43a8bcddd 100644 --- a/selfdrive/car/volkswagen/interface.py +++ b/selfdrive/car/volkswagen/interface.py @@ -1,9 +1,8 @@ from cereal import car from panda import Panda -from openpilot.common.conversions import Conversions as CV from openpilot.selfdrive.car import get_safety_config from openpilot.selfdrive.car.interfaces import CarInterfaceBase -from openpilot.selfdrive.car.volkswagen.values import CAR, PQ_CARS, CANBUS, NetworkLocation, TransmissionType, GearShifter, VolkswagenFlags +from openpilot.selfdrive.car.volkswagen.values import CAR, CANBUS, NetworkLocation, TransmissionType, GearShifter, VolkswagenFlags ButtonType = car.CarState.ButtonEvent.Type EventName = car.CarEvent.EventName @@ -23,11 +22,11 @@ class CarInterface(CarInterfaceBase): self.eps_timer_soft_disable_alert = False @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate: CAR, fingerprint, car_fw, experimental_long, docs): ret.carName = "volkswagen" ret.radarUnavailable = True - if candidate in PQ_CARS: + if ret.flags & VolkswagenFlags.PQ: # Set global PQ35/PQ46/NMS parameters ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.volkswagenPq)] ret.enableBsm = 0x3BA in fingerprint[0] # SWA_1 @@ -72,14 +71,17 @@ class CarInterface(CarInterfaceBase): # Global lateral tuning defaults, can be overridden per-vehicle - ret.steerActuatorDelay = 0.1 ret.steerLimitTimer = 0.4 - ret.steerRatio = 15.6 # Let the params learner figure this out - ret.lateralTuning.pid.kpBP = [0.] - ret.lateralTuning.pid.kiBP = [0.] - ret.lateralTuning.pid.kf = 0.00006 - ret.lateralTuning.pid.kpV = [0.6] - ret.lateralTuning.pid.kiV = [0.2] + if ret.flags & VolkswagenFlags.PQ: + ret.steerActuatorDelay = 0.2 + CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) + else: + ret.steerActuatorDelay = 0.1 + ret.lateralTuning.pid.kpBP = [0.] + ret.lateralTuning.pid.kiBP = [0.] + ret.lateralTuning.pid.kf = 0.00006 + ret.lateralTuning.pid.kpV = [0.6] + ret.lateralTuning.pid.kiV = [0.2] # Global longitudinal tuning defaults, can be overridden per-vehicle @@ -98,130 +100,8 @@ class CarInterface(CarInterfaceBase): ret.vEgoStopping = 0.5 ret.longitudinalTuning.kpV = [0.1] ret.longitudinalTuning.kiV = [0.0] - - # Per-chassis tuning values, override tuning defaults here if desired - - if candidate == CAR.ARTEON_MK1: - ret.mass = 1733 - ret.wheelbase = 2.84 - - elif candidate == CAR.ATLAS_MK1: - ret.mass = 2011 - ret.wheelbase = 2.98 - - elif candidate == CAR.CRAFTER_MK2: - ret.mass = 2100 - ret.wheelbase = 3.64 # SWB, LWB is 4.49, TBD how to detect difference - ret.minSteerSpeed = 50 * CV.KPH_TO_MS - - elif candidate == CAR.GOLF_MK7: - ret.mass = 1397 - ret.wheelbase = 2.62 - - elif candidate == CAR.JETTA_MK7: - ret.mass = 1328 - ret.wheelbase = 2.71 - - elif candidate == CAR.PASSAT_MK8: - ret.mass = 1551 - ret.wheelbase = 2.79 - - elif candidate == CAR.PASSAT_NMS: - ret.mass = 1503 - ret.wheelbase = 2.80 - ret.minEnableSpeed = 20 * CV.KPH_TO_MS # ACC "basic", no FtS - ret.minSteerSpeed = 50 * CV.KPH_TO_MS - ret.steerActuatorDelay = 0.2 - CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) - - elif candidate == CAR.POLO_MK6: - ret.mass = 1230 - ret.wheelbase = 2.55 - - elif candidate == CAR.SHARAN_MK2: - ret.mass = 1639 - ret.wheelbase = 2.92 - ret.minSteerSpeed = 50 * CV.KPH_TO_MS - ret.steerActuatorDelay = 0.2 - - elif candidate == CAR.TAOS_MK1: - ret.mass = 1498 - ret.wheelbase = 2.69 - - elif candidate == CAR.TCROSS_MK1: - ret.mass = 1150 - ret.wheelbase = 2.60 - - elif candidate == CAR.TIGUAN_MK2: - ret.mass = 1715 - ret.wheelbase = 2.74 - - elif candidate == CAR.TOURAN_MK2: - ret.mass = 1516 - ret.wheelbase = 2.79 - - elif candidate == CAR.TRANSPORTER_T61: - ret.mass = 1926 - ret.wheelbase = 3.00 # SWB, LWB is 3.40, TBD how to detect difference - ret.minSteerSpeed = 14.0 - - elif candidate == CAR.TROC_MK1: - ret.mass = 1413 - ret.wheelbase = 2.63 - - elif candidate == CAR.AUDI_A3_MK3: - ret.mass = 1335 - ret.wheelbase = 2.61 - - elif candidate == CAR.AUDI_Q2_MK1: - ret.mass = 1205 - ret.wheelbase = 2.61 - - elif candidate == CAR.AUDI_Q3_MK2: - ret.mass = 1623 - ret.wheelbase = 2.68 - - elif candidate == CAR.SEAT_ATECA_MK1: - ret.mass = 1900 - ret.wheelbase = 2.64 - - elif candidate == CAR.SEAT_LEON_MK3: - ret.mass = 1227 - ret.wheelbase = 2.64 - - elif candidate == CAR.SKODA_FABIA_MK4: - ret.mass = 1266 - ret.wheelbase = 2.56 - - elif candidate == CAR.SKODA_KAMIQ_MK1: - ret.mass = 1265 - ret.wheelbase = 2.66 - - elif candidate == CAR.SKODA_KAROQ_MK1: - ret.mass = 1278 - ret.wheelbase = 2.66 - - elif candidate == CAR.SKODA_KODIAQ_MK1: - ret.mass = 1569 - ret.wheelbase = 2.79 - - elif candidate == CAR.SKODA_OCTAVIA_MK3: - ret.mass = 1388 - ret.wheelbase = 2.68 - - elif candidate == CAR.SKODA_SCALA_MK1: - ret.mass = 1192 - ret.wheelbase = 2.65 - - elif candidate == CAR.SKODA_SUPERB_MK3: - ret.mass = 1505 - ret.wheelbase = 2.84 - - else: - raise ValueError(f"unsupported car {candidate}") - ret.autoResumeSng = ret.minEnableSpeed == -1 - ret.centerToFront = ret.wheelbase * 0.45 + return ret # returns a car.CarState diff --git a/selfdrive/car/volkswagen/values.py b/selfdrive/car/volkswagen/values.py index 35cb3607e..6ff913b20 100644 --- a/selfdrive/car/volkswagen/values.py +++ b/selfdrive/car/volkswagen/values.py @@ -1,12 +1,12 @@ -from collections import defaultdict, namedtuple +from collections import namedtuple from dataclasses import dataclass, field -from enum import Enum, IntFlag, StrEnum -from typing import Dict, List, Union +from enum import Enum, IntFlag from cereal import car from panda.python import uds from opendbc.can.can_define import CANDefine -from openpilot.selfdrive.car import dbc_dict +from openpilot.common.conversions import Conversions as CV +from openpilot.selfdrive.car import dbc_dict, CarSpecs, DbcDict, PlatformConfig, Platforms from openpilot.selfdrive.car.docs_definitions import CarFootnote, CarHarness, CarInfo, CarParts, Column, \ Device from openpilot.selfdrive.car.fw_query_definitions import FwQueryConfig, Request, p16 @@ -40,7 +40,7 @@ class CarControllerParams: def __init__(self, CP): can_define = CANDefine(DBC[CP.carFingerprint]["pt"]) - if CP.carFingerprint in PQ_CARS: + if CP.flags & VolkswagenFlags.PQ: self.LDW_STEP = 5 # LDW_1 message frequency 20Hz self.ACC_HUD_STEP = 4 # ACC_GRA_Anzeige frequency 25Hz self.STEER_DRIVER_ALLOWANCE = 80 # Driver intervention threshold 0.8 Nm @@ -110,50 +110,30 @@ class CANBUS: class VolkswagenFlags(IntFlag): + # Detected flags STOCK_HCA_PRESENT = 1 - -# Check the 7th and 8th characters of the VIN before adding a new CAR. If the -# chassis code is already listed below, don't add a new CAR, just add to the -# FW_VERSIONS for that existing CAR. -# Exception: SEAT Leon and SEAT Ateca share a chassis code - -class CAR(StrEnum): - ARTEON_MK1 = "VOLKSWAGEN ARTEON 1ST GEN" # Chassis AN, Mk1 VW Arteon and variants - ATLAS_MK1 = "VOLKSWAGEN ATLAS 1ST GEN" # Chassis CA, Mk1 VW Atlas and Atlas Cross Sport - CRAFTER_MK2 = "VOLKSWAGEN CRAFTER 2ND GEN" # Chassis SY/SZ, Mk2 VW Crafter, VW Grand California, MAN TGE - GOLF_MK7 = "VOLKSWAGEN GOLF 7TH GEN" # Chassis 5G/AU/BA/BE, Mk7 VW Golf and variants - JETTA_MK7 = "VOLKSWAGEN JETTA 7TH GEN" # Chassis BU, Mk7 VW Jetta - PASSAT_MK8 = "VOLKSWAGEN PASSAT 8TH GEN" # Chassis 3G, Mk8 VW Passat and variants - PASSAT_NMS = "VOLKSWAGEN PASSAT NMS" # Chassis A3, North America/China/Mideast NMS Passat, incl. facelift - POLO_MK6 = "VOLKSWAGEN POLO 6TH GEN" # Chassis AW, Mk6 VW Polo - SHARAN_MK2 = "VOLKSWAGEN SHARAN 2ND GEN" # Chassis 7N, Mk2 Volkswagen Sharan and SEAT Alhambra - TAOS_MK1 = "VOLKSWAGEN TAOS 1ST GEN" # Chassis B2, Mk1 VW Taos and Tharu - TCROSS_MK1 = "VOLKSWAGEN T-CROSS 1ST GEN" # Chassis C1, Mk1 VW T-Cross SWB and LWB variants - TIGUAN_MK2 = "VOLKSWAGEN TIGUAN 2ND GEN" # Chassis AD/BW, Mk2 VW Tiguan and variants - TOURAN_MK2 = "VOLKSWAGEN TOURAN 2ND GEN" # Chassis 1T, Mk2 VW Touran and variants - TRANSPORTER_T61 = "VOLKSWAGEN TRANSPORTER T6.1" # Chassis 7H/7L, T6-facelift Transporter/Multivan/Caravelle/California - TROC_MK1 = "VOLKSWAGEN T-ROC 1ST GEN" # Chassis A1, Mk1 VW T-Roc and variants - AUDI_A3_MK3 = "AUDI A3 3RD GEN" # Chassis 8V/FF, Mk3 Audi A3 and variants - AUDI_Q2_MK1 = "AUDI Q2 1ST GEN" # Chassis GA, Mk1 Audi Q2 (RoW) and Q2L (China only) - AUDI_Q3_MK2 = "AUDI Q3 2ND GEN" # Chassis 8U/F3/FS, Mk2 Audi Q3 and variants - SEAT_ATECA_MK1 = "SEAT ATECA 1ST GEN" # Chassis 5F, Mk1 SEAT Ateca and CUPRA Ateca - SEAT_LEON_MK3 = "SEAT LEON 3RD GEN" # Chassis 5F, Mk3 SEAT Leon and variants - SKODA_FABIA_MK4 = "SKODA FABIA 4TH GEN" # Chassis PJ, Mk4 Skoda Fabia - SKODA_KAMIQ_MK1 = "SKODA KAMIQ 1ST GEN" # Chassis NW, Mk1 Skoda Kamiq - SKODA_KAROQ_MK1 = "SKODA KAROQ 1ST GEN" # Chassis NU, Mk1 Skoda Karoq - SKODA_KODIAQ_MK1 = "SKODA KODIAQ 1ST GEN" # Chassis NS, Mk1 Skoda Kodiaq - SKODA_SCALA_MK1 = "SKODA SCALA 1ST GEN" # Chassis NW, Mk1 Skoda Scala and Skoda Kamiq - SKODA_SUPERB_MK3 = "SKODA SUPERB 3RD GEN" # Chassis 3V/NP, Mk3 Skoda Superb and variants - SKODA_OCTAVIA_MK3 = "SKODA OCTAVIA 3RD GEN" # Chassis NE, Mk3 Skoda Octavia and variants + # Static flags + PQ = 2 -PQ_CARS = {CAR.PASSAT_NMS, CAR.SHARAN_MK2} +@dataclass +class VolkswagenMQBPlatformConfig(PlatformConfig): + dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('vw_mqb_2010', None)) -DBC: Dict[str, Dict[str, str]] = defaultdict(lambda: dbc_dict("vw_mqb_2010", None)) -for car_type in PQ_CARS: - DBC[car_type] = dbc_dict("vw_golf_mk4", None) +@dataclass +class VolkswagenPQPlatformConfig(PlatformConfig): + dbc_dict: DbcDict = field(default_factory=lambda: dbc_dict('vw_golf_mk4', None)) + + def init(self): + self.flags |= VolkswagenFlags.PQ + + +@dataclass(frozen=True, kw_only=True) +class VolkswagenCarSpecs(CarSpecs): + centerToFrontRatio: float = 0.45 + steerRatio: float = 15.6 class Footnote(Enum): @@ -191,88 +171,208 @@ class VWCarInfo(CarInfo): self.car_parts = CarParts([Device.threex_angled_mount, CarHarness.j533]) -CAR_INFO: Dict[str, Union[VWCarInfo, List[VWCarInfo]]] = { - CAR.ARTEON_MK1: [ - VWCarInfo("Volkswagen Arteon 2018-23", video_link="https://youtu.be/FAomFKPFlDA"), - VWCarInfo("Volkswagen Arteon R 2020-23", video_link="https://youtu.be/FAomFKPFlDA"), - VWCarInfo("Volkswagen Arteon eHybrid 2020-23", video_link="https://youtu.be/FAomFKPFlDA"), - VWCarInfo("Volkswagen CC 2018-22", video_link="https://youtu.be/FAomFKPFlDA"), - ], - CAR.ATLAS_MK1: [ - VWCarInfo("Volkswagen Atlas 2018-23"), - VWCarInfo("Volkswagen Atlas Cross Sport 2020-22"), - VWCarInfo("Volkswagen Teramont 2018-22"), - VWCarInfo("Volkswagen Teramont Cross Sport 2021-22"), - VWCarInfo("Volkswagen Teramont X 2021-22"), - ], - CAR.CRAFTER_MK2: [ - VWCarInfo("Volkswagen Crafter 2017-23", video_link="https://youtu.be/4100gLeabmo"), - VWCarInfo("Volkswagen e-Crafter 2018-23", video_link="https://youtu.be/4100gLeabmo"), - VWCarInfo("Volkswagen Grand California 2019-23", video_link="https://youtu.be/4100gLeabmo"), - VWCarInfo("MAN TGE 2017-23", video_link="https://youtu.be/4100gLeabmo"), - VWCarInfo("MAN eTGE 2020-23", video_link="https://youtu.be/4100gLeabmo"), - ], - CAR.GOLF_MK7: [ - VWCarInfo("Volkswagen e-Golf 2014-20"), - VWCarInfo("Volkswagen Golf 2015-20", auto_resume=False), - VWCarInfo("Volkswagen Golf Alltrack 2015-19", auto_resume=False), - VWCarInfo("Volkswagen Golf GTD 2015-20"), - VWCarInfo("Volkswagen Golf GTE 2015-20"), - VWCarInfo("Volkswagen Golf GTI 2015-21", auto_resume=False), - VWCarInfo("Volkswagen Golf R 2015-19"), - VWCarInfo("Volkswagen Golf SportsVan 2015-20"), - ], - CAR.JETTA_MK7: [ - VWCarInfo("Volkswagen Jetta 2018-24"), - VWCarInfo("Volkswagen Jetta GLI 2021-24"), - ], - CAR.PASSAT_MK8: [ - VWCarInfo("Volkswagen Passat 2015-22", footnotes=[Footnote.PASSAT]), - VWCarInfo("Volkswagen Passat Alltrack 2015-22"), - VWCarInfo("Volkswagen Passat GTE 2015-22"), - ], - CAR.PASSAT_NMS: VWCarInfo("Volkswagen Passat NMS 2017-22"), - CAR.POLO_MK6: [ - VWCarInfo("Volkswagen Polo 2018-23", footnotes=[Footnote.VW_MQB_A0]), - VWCarInfo("Volkswagen Polo GTI 2018-23", footnotes=[Footnote.VW_MQB_A0]), - ], - CAR.SHARAN_MK2: [ - VWCarInfo("Volkswagen Sharan 2018-22"), - VWCarInfo("SEAT Alhambra 2018-20"), - ], - CAR.TAOS_MK1: VWCarInfo("Volkswagen Taos 2022-23"), - CAR.TCROSS_MK1: VWCarInfo("Volkswagen T-Cross 2021", footnotes=[Footnote.VW_MQB_A0]), - CAR.TIGUAN_MK2: [ - VWCarInfo("Volkswagen Tiguan 2018-24"), - VWCarInfo("Volkswagen Tiguan eHybrid 2021-23"), - ], - CAR.TOURAN_MK2: VWCarInfo("Volkswagen Touran 2016-23"), - CAR.TRANSPORTER_T61: [ - VWCarInfo("Volkswagen Caravelle 2020"), - VWCarInfo("Volkswagen California 2021-23"), - ], - CAR.TROC_MK1: VWCarInfo("Volkswagen T-Roc 2018-22", footnotes=[Footnote.VW_MQB_A0]), - CAR.AUDI_A3_MK3: [ - VWCarInfo("Audi A3 2014-19"), - VWCarInfo("Audi A3 Sportback e-tron 2017-18"), - VWCarInfo("Audi RS3 2018"), - VWCarInfo("Audi S3 2015-17"), - ], - CAR.AUDI_Q2_MK1: VWCarInfo("Audi Q2 2018"), - CAR.AUDI_Q3_MK2: VWCarInfo("Audi Q3 2019-23"), - CAR.SEAT_ATECA_MK1: VWCarInfo("SEAT Ateca 2018"), - CAR.SEAT_LEON_MK3: VWCarInfo("SEAT Leon 2014-20"), - CAR.SKODA_FABIA_MK4: VWCarInfo("Škoda Fabia 2022-23", footnotes=[Footnote.VW_MQB_A0]), - CAR.SKODA_KAMIQ_MK1: VWCarInfo("Škoda Kamiq 2021-23", footnotes=[Footnote.VW_MQB_A0, Footnote.KAMIQ]), - CAR.SKODA_KAROQ_MK1: VWCarInfo("Škoda Karoq 2019-23"), - CAR.SKODA_KODIAQ_MK1: VWCarInfo("Škoda Kodiaq 2017-23"), - CAR.SKODA_SCALA_MK1: VWCarInfo("Škoda Scala 2020-23", footnotes=[Footnote.VW_MQB_A0]), - CAR.SKODA_SUPERB_MK3: VWCarInfo("Škoda Superb 2015-22"), - CAR.SKODA_OCTAVIA_MK3: [ - VWCarInfo("Škoda Octavia 2015-19"), - VWCarInfo("Škoda Octavia RS 2016"), - ], -} +# Check the 7th and 8th characters of the VIN before adding a new CAR. If the +# chassis code is already listed below, don't add a new CAR, just add to the +# FW_VERSIONS for that existing CAR. +# Exception: SEAT Leon and SEAT Ateca share a chassis code + +class CAR(Platforms): + ARTEON_MK1 = VolkswagenMQBPlatformConfig( + "VOLKSWAGEN ARTEON 1ST GEN", # Chassis AN + [ + VWCarInfo("Volkswagen Arteon 2018-23", video_link="https://youtu.be/FAomFKPFlDA"), + VWCarInfo("Volkswagen Arteon R 2020-23", video_link="https://youtu.be/FAomFKPFlDA"), + VWCarInfo("Volkswagen Arteon eHybrid 2020-23", video_link="https://youtu.be/FAomFKPFlDA"), + VWCarInfo("Volkswagen CC 2018-22", video_link="https://youtu.be/FAomFKPFlDA"), + ], + VolkswagenCarSpecs(mass=1733, wheelbase=2.84), + ) + ATLAS_MK1 = VolkswagenMQBPlatformConfig( + "VOLKSWAGEN ATLAS 1ST GEN", # Chassis CA + [ + VWCarInfo("Volkswagen Atlas 2018-23"), + VWCarInfo("Volkswagen Atlas Cross Sport 2020-22"), + VWCarInfo("Volkswagen Teramont 2018-22"), + VWCarInfo("Volkswagen Teramont Cross Sport 2021-22"), + VWCarInfo("Volkswagen Teramont X 2021-22"), + ], + VolkswagenCarSpecs(mass=2011, wheelbase=2.98), + ) + CADDY_MK3 = VolkswagenPQPlatformConfig( + "VOLKSWAGEN CADDY 3RD GEN", # Chassis 2K + [ + VWCarInfo("Volkswagen Caddy 2019"), + VWCarInfo("Volkswagen Caddy Maxi 2019"), + ], + VolkswagenCarSpecs(mass=1613, wheelbase=2.6, minSteerSpeed=21 * CV.KPH_TO_MS), + ) + CRAFTER_MK2 = VolkswagenMQBPlatformConfig( + "VOLKSWAGEN CRAFTER 2ND GEN", # Chassis SY/SZ + [ + VWCarInfo("Volkswagen Crafter 2017-23", video_link="https://youtu.be/4100gLeabmo"), + VWCarInfo("Volkswagen e-Crafter 2018-23", video_link="https://youtu.be/4100gLeabmo"), + VWCarInfo("Volkswagen Grand California 2019-23", video_link="https://youtu.be/4100gLeabmo"), + VWCarInfo("MAN TGE 2017-23", video_link="https://youtu.be/4100gLeabmo"), + VWCarInfo("MAN eTGE 2020-23", video_link="https://youtu.be/4100gLeabmo"), + ], + VolkswagenCarSpecs(mass=2100, wheelbase=3.64, minSteerSpeed=50 * CV.KPH_TO_MS), + ) + GOLF_MK7 = VolkswagenMQBPlatformConfig( + "VOLKSWAGEN GOLF 7TH GEN", # Chassis 5G/AU/BA/BE + [ + VWCarInfo("Volkswagen e-Golf 2014-20"), + VWCarInfo("Volkswagen Golf 2015-20", auto_resume=False), + VWCarInfo("Volkswagen Golf Alltrack 2015-19", auto_resume=False), + VWCarInfo("Volkswagen Golf GTD 2015-20"), + VWCarInfo("Volkswagen Golf GTE 2015-20"), + VWCarInfo("Volkswagen Golf GTI 2015-21", auto_resume=False), + VWCarInfo("Volkswagen Golf R 2015-19"), + VWCarInfo("Volkswagen Golf SportsVan 2015-20"), + ], + VolkswagenCarSpecs(mass=1397, wheelbase=2.62), + ) + JETTA_MK7 = VolkswagenMQBPlatformConfig( + "VOLKSWAGEN JETTA 7TH GEN", # Chassis BU + [ + VWCarInfo("Volkswagen Jetta 2018-24"), + VWCarInfo("Volkswagen Jetta GLI 2021-24"), + ], + VolkswagenCarSpecs(mass=1328, wheelbase=2.71), + ) + PASSAT_MK8 = VolkswagenMQBPlatformConfig( + "VOLKSWAGEN PASSAT 8TH GEN", # Chassis 3G + [ + VWCarInfo("Volkswagen Passat 2015-22", footnotes=[Footnote.PASSAT]), + VWCarInfo("Volkswagen Passat Alltrack 2015-22"), + VWCarInfo("Volkswagen Passat GTE 2015-22"), + ], + VolkswagenCarSpecs(mass=1551, wheelbase=2.79), + ) + PASSAT_NMS = VolkswagenPQPlatformConfig( + "VOLKSWAGEN PASSAT NMS", # Chassis A3 + VWCarInfo("Volkswagen Passat NMS 2017-22"), + VolkswagenCarSpecs(mass=1503, wheelbase=2.80, minSteerSpeed=50*CV.KPH_TO_MS, minEnableSpeed=20*CV.KPH_TO_MS), + ) + POLO_MK6 = VolkswagenMQBPlatformConfig( + "VOLKSWAGEN POLO 6TH GEN", # Chassis AW + [ + VWCarInfo("Volkswagen Polo 2018-23", footnotes=[Footnote.VW_MQB_A0]), + VWCarInfo("Volkswagen Polo GTI 2018-23", footnotes=[Footnote.VW_MQB_A0]), + ], + VolkswagenCarSpecs(mass=1230, wheelbase=2.55), + ) + SHARAN_MK2 = VolkswagenPQPlatformConfig( + "VOLKSWAGEN SHARAN 2ND GEN", # Chassis 7N + [ + VWCarInfo("Volkswagen Sharan 2018-22"), + VWCarInfo("SEAT Alhambra 2018-20"), + ], + VolkswagenCarSpecs(mass=1639, wheelbase=2.92, minSteerSpeed=50*CV.KPH_TO_MS), + ) + TAOS_MK1 = VolkswagenMQBPlatformConfig( + "VOLKSWAGEN TAOS 1ST GEN", # Chassis B2 + VWCarInfo("Volkswagen Taos 2022-23"), + VolkswagenCarSpecs(mass=1498, wheelbase=2.69), + ) + TCROSS_MK1 = VolkswagenMQBPlatformConfig( + "VOLKSWAGEN T-CROSS 1ST GEN", # Chassis C1 + VWCarInfo("Volkswagen T-Cross 2021", footnotes=[Footnote.VW_MQB_A0]), + VolkswagenCarSpecs(mass=1150, wheelbase=2.60), + ) + TIGUAN_MK2 = VolkswagenMQBPlatformConfig( + "VOLKSWAGEN TIGUAN 2ND GEN", # Chassis AD/BW + [ + VWCarInfo("Volkswagen Tiguan 2018-24"), + VWCarInfo("Volkswagen Tiguan eHybrid 2021-23"), + ], + VolkswagenCarSpecs(mass=1715, wheelbase=2.74), + ) + TOURAN_MK2 = VolkswagenMQBPlatformConfig( + "VOLKSWAGEN TOURAN 2ND GEN", # Chassis 1T + VWCarInfo("Volkswagen Touran 2016-23"), + VolkswagenCarSpecs(mass=1516, wheelbase=2.79), + ) + TRANSPORTER_T61 = VolkswagenMQBPlatformConfig( + "VOLKSWAGEN TRANSPORTER T6.1", # Chassis 7H/7L + [ + VWCarInfo("Volkswagen Caravelle 2020"), + VWCarInfo("Volkswagen California 2021-23"), + ], + VolkswagenCarSpecs(mass=1926, wheelbase=3.00, minSteerSpeed=14.0), + ) + TROC_MK1 = VolkswagenMQBPlatformConfig( + "VOLKSWAGEN T-ROC 1ST GEN", # Chassis A1 + VWCarInfo("Volkswagen T-Roc 2018-22", footnotes=[Footnote.VW_MQB_A0]), + VolkswagenCarSpecs(mass=1413, wheelbase=2.63), + ) + AUDI_A3_MK3 = VolkswagenMQBPlatformConfig( + "AUDI A3 3RD GEN", # Chassis 8V/FF + [ + VWCarInfo("Audi A3 2014-19"), + VWCarInfo("Audi A3 Sportback e-tron 2017-18"), + VWCarInfo("Audi RS3 2018"), + VWCarInfo("Audi S3 2015-17"), + ], + VolkswagenCarSpecs(mass=1335, wheelbase=2.61), + ) + AUDI_Q2_MK1 = VolkswagenMQBPlatformConfig( + "AUDI Q2 1ST GEN", # Chassis GA + VWCarInfo("Audi Q2 2018"), + VolkswagenCarSpecs(mass=1205, wheelbase=2.61), + ) + AUDI_Q3_MK2 = VolkswagenMQBPlatformConfig( + "AUDI Q3 2ND GEN", # Chassis 8U/F3/FS + VWCarInfo("Audi Q3 2019-23"), + VolkswagenCarSpecs(mass=1623, wheelbase=2.68), + ) + SEAT_ATECA_MK1 = VolkswagenMQBPlatformConfig( + "SEAT ATECA 1ST GEN", # Chassis 5F + VWCarInfo("SEAT Ateca 2018"), + VolkswagenCarSpecs(mass=1900, wheelbase=2.64), + ) + SEAT_LEON_MK3 = VolkswagenMQBPlatformConfig( + "SEAT LEON 3RD GEN", # Chassis 5F + VWCarInfo("SEAT Leon 2014-20"), + VolkswagenCarSpecs(mass=1227, wheelbase=2.64), + ) + SKODA_FABIA_MK4 = VolkswagenMQBPlatformConfig( + "SKODA FABIA 4TH GEN", # Chassis PJ + VWCarInfo("Škoda Fabia 2022-23", footnotes=[Footnote.VW_MQB_A0]), + VolkswagenCarSpecs(mass=1266, wheelbase=2.56), + ) + SKODA_KAMIQ_MK1 = VolkswagenMQBPlatformConfig( + "SKODA KAMIQ 1ST GEN", # Chassis NW + VWCarInfo("Škoda Kamiq 2021-23", footnotes=[Footnote.VW_MQB_A0, Footnote.KAMIQ]), + VolkswagenCarSpecs(mass=1265, wheelbase=2.66), + ) + SKODA_KAROQ_MK1 = VolkswagenMQBPlatformConfig( + "SKODA KAROQ 1ST GEN", # Chassis NU + VWCarInfo("Škoda Karoq 2019-23"), + VolkswagenCarSpecs(mass=1278, wheelbase=2.66), + ) + SKODA_KODIAQ_MK1 = VolkswagenMQBPlatformConfig( + "SKODA KODIAQ 1ST GEN", # Chassis NS + VWCarInfo("Škoda Kodiaq 2017-23"), + VolkswagenCarSpecs(mass=1569, wheelbase=2.79), + ) + SKODA_OCTAVIA_MK3 = VolkswagenMQBPlatformConfig( + "SKODA OCTAVIA 3RD GEN", # Chassis NE + [ + VWCarInfo("Škoda Octavia 2015-19"), + VWCarInfo("Škoda Octavia RS 2016"), + ], + VolkswagenCarSpecs(mass=1388, wheelbase=2.68), + ) + SKODA_SCALA_MK1 = VolkswagenMQBPlatformConfig( + "SKODA SCALA 1ST GEN", # Chassis NW + VWCarInfo("Škoda Scala 2020-23", footnotes=[Footnote.VW_MQB_A0]), + VolkswagenCarSpecs(mass=1192, wheelbase=2.65), + ) + SKODA_SUPERB_MK3 = VolkswagenMQBPlatformConfig( + "SKODA SUPERB 3RD GEN", # Chassis 3V/NP + VWCarInfo("Škoda Superb 2015-22"), + VolkswagenCarSpecs(mass=1505, wheelbase=2.84), + ) # All supported cars should return FW from the engine, srs, eps, and fwdRadar. Cars @@ -293,17 +393,28 @@ VOLKSWAGEN_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + VOLKSWAGEN_RX_OFFSET = 0x6a FW_QUERY_CONFIG = FwQueryConfig( - requests=[ + # TODO: add back whitelists after we gather enough data + requests=[request for bus, obd_multiplexing in [(1, True), (1, False), (0, False)] for request in [ Request( [VOLKSWAGEN_VERSION_REQUEST_MULTI], [VOLKSWAGEN_VERSION_RESPONSE], - whitelist_ecus=[Ecu.srs, Ecu.eps, Ecu.fwdRadar], + # whitelist_ecus=[Ecu.srs, Ecu.eps, Ecu.fwdRadar], rx_offset=VOLKSWAGEN_RX_OFFSET, + bus=bus, + logging=(bus != 1 or not obd_multiplexing), + obd_multiplexing=obd_multiplexing, ), Request( [VOLKSWAGEN_VERSION_REQUEST_MULTI], [VOLKSWAGEN_VERSION_RESPONSE], - whitelist_ecus=[Ecu.engine, Ecu.transmission], + # whitelist_ecus=[Ecu.engine, Ecu.transmission], + bus=bus, + logging=(bus != 1 or not obd_multiplexing), + obd_multiplexing=obd_multiplexing, ), - ], + ]], + extra_ecus=[(Ecu.fwdCamera, 0x74f, None)], ) + +CAR_INFO = CAR.create_carinfo_map() +DBC = CAR.create_dbc_map() diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index f0d44dc22..976efa07e 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -5,28 +5,32 @@ import time import threading from typing import SupportsFloat -from cereal import car, log -from openpilot.common.numpy_fast import clip -from openpilot.common.realtime import config_realtime_process, Priority, Ratekeeper, DT_CTRL -from openpilot.common.params import Params import cereal.messaging as messaging + +from cereal import car, log from cereal.visionipc import VisionIpcClient, VisionStreamType + + from openpilot.common.conversions import Conversions as CV -from panda import ALTERNATIVE_EXPERIENCE +from openpilot.common.numpy_fast import clip +from openpilot.common.params import Params +from openpilot.common.realtime import config_realtime_process, Priority, Ratekeeper, DT_CTRL from openpilot.common.swaglog import cloudlog -from openpilot.system.version import get_short_branch -from openpilot.selfdrive.boardd.boardd import can_list_to_can_capnp -from openpilot.selfdrive.car.car_helpers import get_car, get_startup_event, get_one_can + +from openpilot.selfdrive.car.car_helpers import get_startup_event +from openpilot.selfdrive.car.card import CarD +from openpilot.selfdrive.controls.lib.alertmanager import AlertManager, set_offroad_alert from openpilot.selfdrive.controls.lib.drive_helpers import VCruiseHelper, clip_curvature +from openpilot.selfdrive.controls.lib.events import Events, ET from openpilot.selfdrive.controls.lib.latcontrol import LatControl, MIN_LATERAL_CONTROL_SPEED -from openpilot.selfdrive.controls.lib.longcontrol import LongControl from openpilot.selfdrive.controls.lib.latcontrol_pid import LatControlPID from openpilot.selfdrive.controls.lib.latcontrol_angle import LatControlAngle, STEER_ANGLE_SATURATION_THRESHOLD from openpilot.selfdrive.controls.lib.latcontrol_torque import LatControlTorque -from openpilot.selfdrive.controls.lib.events import Events, ET -from openpilot.selfdrive.controls.lib.alertmanager import AlertManager, set_offroad_alert +from openpilot.selfdrive.controls.lib.longcontrol import LongControl from openpilot.selfdrive.controls.lib.vehicle_model import VehicleModel + from openpilot.system.hardware import HARDWARE +from openpilot.system.version import get_short_branch SOFT_DISABLE_TIME = 3 # seconds LDW_MIN_SPEED = 31 * CV.MPH_TO_MS @@ -63,26 +67,34 @@ ENABLED_STATES = (State.preEnabled, *ACTIVE_STATES) class Controls: def __init__(self, CI=None): - config_realtime_process(4, Priority.CTRL_HIGH) + self.card = CarD(CI) + + self.params = Params() + + with car.CarParams.from_bytes(self.params.get("CarParams", block=True)) as msg: + # TODO: this shouldn't need to be a builder + self.CP = msg.as_builder() + + self.CI = self.card.CI + # Ensure the current branch is cached, otherwise the first iteration of controlsd lags self.branch = get_short_branch() # Setup sockets - self.pm = messaging.PubMaster(['sendcan', 'controlsState', 'carState', - 'carControl', 'onroadEvents', 'carParams', 'controlsStateExt']) + self.pm = messaging.PubMaster(['controlsState', 'carControl', 'onroadEvents', 'controlsStateExt']) self.sensor_packets = ["accelerometer", "gyroscope"] self.camera_packets = ["roadCameraState", "driverCameraState", "wideRoadCameraState"] + #DP: self.dp_device_dm_unavailable_once = False if dp_device_dm_unavailable: self.dp_device_dm_unavailable_once = True self.camera_packets.remove("driverCameraState") self.log_sock = messaging.sub_sock('androidLog') - self.can_sock = messaging.sub_sock('can', timeout=20) - self.params = Params() + #DP: self._dp_alka = self.params.get_bool("dp_alka") self._dp_alka_active = True self._dp_alka_trigger_count = 0 @@ -100,61 +112,24 @@ class Controls: if SIMULATION: ignore += ['driverCameraState', 'managerState'] self.sm = messaging.SubMaster(['deviceState', 'pandaStates', 'peripheralState', 'modelV2', 'liveCalibration', - 'driverMonitoringState', 'longitudinalPlan', 'liveLocationKalman', + 'carOutput', 'driverMonitoringState', 'longitudinalPlan', 'liveLocationKalman', 'managerState', 'liveParameters', 'radarState', 'liveTorqueParameters', 'testJoystick', 'longitudinalPlanExt'] + self.camera_packets + self.sensor_packets, - ignore_alive=ignore, ignore_avg_freq=['radarState', 'testJoystick'], ignore_valid=['testJoystick',]) - - if CI is None: - # wait for one pandaState and one CAN packet - print("Waiting for CAN messages...") - get_one_can(self.can_sock) - - num_pandas = len(messaging.recv_one_retry(self.sm.sock['pandaStates']).pandaStates) - experimental_long_allowed = self.params.get_bool("ExperimentalLongitudinalEnabled") - self.CI, self.CP = get_car(self.can_sock, self.pm.sock['sendcan'], experimental_long_allowed, num_pandas) - else: - self.CI, self.CP = CI, CI.CP + ignore_alive=ignore, ignore_avg_freq=ignore+['radarState', 'testJoystick'], ignore_valid=['testJoystick', ], + frequency=int(1/DT_CTRL)) self.joystick_mode = self.params.get_bool("JoystickDebugMode") - # set alternative experiences from parameters - self.disengage_on_accelerator = self.params.get_bool("DisengageOnAccelerator") - self.CP.alternativeExperience = 0 - if not self.disengage_on_accelerator: - self.CP.alternativeExperience |= ALTERNATIVE_EXPERIENCE.DISABLE_DISENGAGE_ON_GAS - - if self._dp_alka: - self.CP.alternativeExperience |= ALTERNATIVE_EXPERIENCE.ALKA - # read params + self.disengage_on_accelerator = self.params.get_bool("DisengageOnAccelerator") self.is_metric = self.params.get_bool("IsMetric") self.is_ldw_enabled = self.params.get_bool("IsLdwEnabled") - openpilot_enabled_toggle = self.params.get_bool("OpenpilotEnabledToggle") # detect sound card presence and ensure successful init sounds_available = HARDWARE.get_sound_card_online() car_recognized = self.CP.carName != 'mock' - controller_available = self.CI.CC is not None and openpilot_enabled_toggle and not self.CP.dashcamOnly - self.CP.passive = not car_recognized or not controller_available or self.CP.dashcamOnly - if self.CP.passive: - safety_config = car.CarParams.SafetyConfig.new_message() - safety_config.safetyModel = car.CarParams.SafetyModel.noOutput - self.CP.safetyConfigs = [safety_config] - - # Write previous route's CarParams - prev_cp = self.params.get("CarParamsPersistent") - if prev_cp is not None: - self.params.put("CarParamsPrevRoute", prev_cp) - - # Write CarParams for radard - cp_bytes = self.CP.to_bytes() - self.params.put("CarParams", cp_bytes) - self.params.put_nonblocking("CarParamsCache", cp_bytes) - self.params.put_nonblocking("CarParamsPersistent", cp_bytes) - # cleanup old params if not self.CP.experimentalLongitudinalAvailable: self.params.remove("ExperimentalLongitudinalEnabled") @@ -184,8 +159,6 @@ class Controls: self.soft_disable_timer = 0 self.mismatch_counter = 0 self.cruise_mismatch_counter = 0 - self.can_rcv_timeout_counter = 0 # conseuctive timeout count - self.can_rcv_cum_timeout_counter = 0 # cumulative timeout count self.last_blinker_frame = 0 self.last_steering_pressed_frame = 0 self.distance_traveled = 0 @@ -203,7 +176,7 @@ class Controls: self.can_log_mono_time = 0 - self.startup_event = get_startup_event(car_recognized, controller_available, len(self.CP.carFw) > 0) + self.startup_event = get_startup_event(car_recognized, not self.CP.passive, len(self.CP.carFw) > 0) if not sounds_available: self.events.add(EventName.soundsUnavailable, static=True) @@ -368,7 +341,8 @@ class Controls: else: safety_mismatch = pandaState.safetyModel not in IGNORED_SAFETY_MODES - if safety_mismatch or pandaState.safetyRxChecksInvalid or self.mismatch_counter >= 200: + # safety mismatch allows some time for boardd to set the safety mode and publish it back from panda + if (safety_mismatch and self.sm.frame*DT_CTRL > 10.) or pandaState.safetyRxChecksInvalid or self.mismatch_counter >= 200: self.events.add(EventName.controlsMismatch) if log.PandaState.FaultType.relayMalfunction in pandaState.faults: @@ -380,7 +354,7 @@ class Controls: num_events = len(self.events) not_running = {p.name for p in self.sm['managerState'].processes if not p.running and p.shouldBeRunning} - if self.sm.rcv_frame['managerState'] and (not_running - IGNORE_PROCESSES): + if self.sm.recv_frame['managerState'] and (not_running - IGNORE_PROCESSES): self.events.add(EventName.processNotRunning) if not_running != self.not_running_prev: cloudlog.event("process_not_running", not_running=not_running, error=True) @@ -406,10 +380,9 @@ class Controls: self.events.add(EventName.canError) # generic catch-all. ideally, a more specific event should be added above instead - can_rcv_timeout = self.can_rcv_timeout_counter >= 5 has_disable_events = self.events.contains(ET.NO_ENTRY) and (self.events.contains(ET.SOFT_DISABLE) or self.events.contains(ET.IMMEDIATE_DISABLE)) no_system_errors = (not has_disable_events) or (len(self.events) == num_events) - if (not self.sm.all_checks() or can_rcv_timeout) and no_system_errors: + if (not self.sm.all_checks() or self.card.can_rcv_timeout) and no_system_errors: if not self.sm.all_alive(): self.events.add(EventName.commIssue) elif not self.sm.all_freq_ok(): @@ -421,7 +394,7 @@ class Controls: 'invalid': [s for s, valid in self.sm.valid.items() if not valid], 'not_alive': [s for s, alive in self.sm.alive.items() if not alive], 'not_freq_ok': [s for s, freq_ok in self.sm.freq_ok.items() if not freq_ok], - 'can_rcv_timeout': can_rcv_timeout, + 'can_rcv_timeout': self.card.can_rcv_timeout, } if logs != self.logged_comm_issue: cloudlog.event("commIssue", error=True, **logs) @@ -440,7 +413,7 @@ class Controls: self.events.add(EventName.paramsdTemporaryError) # conservative HW alert. if the data or frequency are off, locationd will throw an error - if any((self.sm.frame - self.sm.rcv_frame[s])*DT_CTRL > 10. for s in self.sensor_packets): + if any((self.sm.frame - self.sm.recv_frame[s])*DT_CTRL > 10. for s in self.sensor_packets): self.events.add(EventName.sensorDataInvalid) if not REPLAY: @@ -470,9 +443,12 @@ class Controls: # TODO: fix simulator if not SIMULATION or REPLAY: + # Not show in first 1 km to allow for driving out of garage. This event shows after 5 minutes if not self.sm['liveLocationKalman'].gpsOK and self.sm['liveLocationKalman'].inputsOK and (self.distance_traveled > 1000): - # Not show in first 1 km to allow for driving out of garage. This event shows after 5 minutes self.events.add(EventName.noGps) + if self.sm['liveLocationKalman'].gpsOK: + self.distance_traveled = 0 + self.distance_traveled += CS.vEgo * DT_CTRL if self.sm['modelV2'].frameDropPerc > 20: self.events.add(EventName.modeldLagging) @@ -480,17 +456,13 @@ class Controls: def data_sample(self): """Receive data from sockets and update carState""" - # Update carState from CAN - can_strs = messaging.drain_sock_raw(self.can_sock, wait_for_one=True) - CS = self.CI.update(self.CC, can_strs) - if len(can_strs) and REPLAY: - self.can_log_mono_time = messaging.log_from_bytes(can_strs[0]).logMonoTime + CS = self.card.state_update() self.sm.update(0) if not self.initialized: all_valid = CS.canValid and self.sm.all_checks() - timed_out = self.sm.frame * DT_CTRL > (6. if REPLAY else 3.5) + timed_out = self.sm.frame * DT_CTRL > 6. if all_valid or timed_out or (SIMULATION and not REPLAY): available_streams = VisionIpcClient.available_streams("camerad", block=False) if VisionStreamType.VISION_STREAM_ROAD not in available_streams: @@ -499,18 +471,22 @@ class Controls: self.sm.ignore_alive.append('wideRoadCameraState') if not self.CP.passive: - self.CI.init(self.CP, self.can_sock, self.pm.sock['sendcan']) + self.card.initialize() self.initialized = True self.set_initial_state() self.params.put_bool_nonblocking("ControlsReady", True) - # Check for CAN timeout - if not can_strs: - self.can_rcv_timeout_counter += 1 - self.can_rcv_cum_timeout_counter += 1 - else: - self.can_rcv_timeout_counter = 0 + cloudlog.event( + "controlsd.initialized", + dt=self.sm.frame*DT_CTRL, + timeout=timed_out, + canValid=CS.canValid, + invalid=[s for s, valid in self.sm.valid.items() if not valid], + not_alive=[s for s, alive in self.sm.alive.items() if not alive], + not_freq_ok=[s for s, freq_ok in self.sm.freq_ok.items() if not freq_ok], + error=True, + ) # When the panda and controlsd do not agree on controls_allowed # we want to disengage openpilot. However the status from the panda goes through @@ -524,8 +500,6 @@ class Controls: if ps.safetyModel not in IGNORED_SAFETY_MODES): self.mismatch_counter += 1 - self.distance_traveled += CS.vEgo * DT_CTRL - return CS def state_transition(self, CS): @@ -650,7 +624,7 @@ class Controls: if not self.CP.passive and self.initialized and self._dp_alka and self._dp_alka_active and not standstill and CS.cruiseState.available: if self.sm['liveCalibration'].calStatus != log.LiveCalibrationData.Status.calibrated: pass - elif abs(CS.steeringAngleDeg) >= 540: + elif abs(CS.steeringAngleDeg) >= 450: pass elif CS.steerFaultTemporary or CS.steerFaultPermanent: pass @@ -694,7 +668,7 @@ class Controls: if not self.joystick_mode: # accel PID loop pid_accel_limits = self.CI.get_pid_accel_limits(self.CP, CS.vEgo, self.v_cruise_helper.v_cruise_kph * CV.KPH_TO_MS) - t_since_plan = (self.sm.frame - self.sm.rcv_frame['longitudinalPlan']) * DT_CTRL + t_since_plan = (self.sm.frame - self.sm.recv_frame['longitudinalPlan']) * DT_CTRL actuators.accel = self.LoC.update(CC.longActive, CS, long_plan, pid_accel_limits, t_since_plan) # Steering PID loop and lateral MPC @@ -705,9 +679,9 @@ class Controls: self.sm['liveLocationKalman']) else: lac_log = log.ControlsState.LateralDebugState.new_message() - if self.sm.rcv_frame['testJoystick'] > 0: + if self.sm.recv_frame['testJoystick'] > 0: # reset joystick if it hasn't been received in a while - should_reset_joystick = (self.sm.frame - self.sm.rcv_frame['testJoystick'])*DT_CTRL > 0.2 + should_reset_joystick = (self.sm.frame - self.sm.recv_frame['testJoystick'])*DT_CTRL > 0.2 if not should_reset_joystick: joystick_axes = self.sm['testJoystick'].axes else: @@ -771,6 +745,8 @@ class Controls: def publish_logs(self, CS, start_time, CC, lac_log): """Send actuators and hud commands to the car, send controlsstate and MPC logging""" + CO = self.sm['carOutput'] + # Orientation and angle rates can be useful for carcontroller # Only calibrated (car) frame is relevant for the carcontroller orientation_value = list(self.sm['liveLocationKalman'].calibratedOrientationNED.value) @@ -782,7 +758,7 @@ class Controls: CC.cruiseControl.override = self.enabled and not CC.longActive and self.CP.openpilotLongitudinalControl CC.cruiseControl.cancel = CS.cruiseState.enabled and (not self.enabled or not self.CP.pcmCruise) - if self.joystick_mode and self.sm.rcv_frame['testJoystick'] > 0 and self.sm['testJoystick'].buttons[0]: + if self.joystick_mode and self.sm.recv_frame['testJoystick'] > 0 and self.sm['testJoystick'].buttons[0]: CC.cruiseControl.cancel = True speeds = self.sm['longitudinalPlan'].speeds @@ -833,16 +809,12 @@ class Controls: hudControl.visualAlert = current_alert.visual_alert if not self.CP.passive and self.initialized: - # send car controls over can - now_nanos = self.can_log_mono_time if REPLAY else int(time.monotonic() * 1e9) - self.last_actuators, can_sends = self.CI.apply(CC, now_nanos) - self.pm.send('sendcan', can_list_to_can_capnp(can_sends, msgtype='sendcan', valid=CS.canValid)) - CC.actuatorsOutput = self.last_actuators + self.card.controls_update(CC) if self.CP.steerControlType == car.CarParams.SteerControlType.angle: - self.steer_limited = abs(CC.actuators.steeringAngleDeg - CC.actuatorsOutput.steeringAngleDeg) > \ + self.steer_limited = abs(CC.actuators.steeringAngleDeg - CO.actuatorsOutput.steeringAngleDeg) > \ STEER_ANGLE_SATURATION_THRESHOLD else: - self.steer_limited = abs(CC.actuators.steer - CC.actuatorsOutput.steer) > 1e-2 + self.steer_limited = abs(CC.actuators.steer - CO.actuatorsOutput.steer) > 1e-2 force_decel = (self.sm['driverMonitoringState'].awarenessStatus < 0.) or \ (self.state == State.softDisabling) @@ -884,7 +856,7 @@ class Controls: controlsState.cumLagMs = -self.rk.remaining * 1000. controlsState.startMonoTime = int(start_time * 1e9) controlsState.forceDecel = bool(force_decel) - controlsState.canErrorCounter = self.can_rcv_cum_timeout_counter + controlsState.canErrorCounter = self.card.can_rcv_cum_timeout_counter controlsState.experimentalMode = self.experimental_mode lat_tuning = self.CP.lateralTuning.which() @@ -907,29 +879,14 @@ class Controls: controlsStateExt.alkaEnabled = self._dp_alka self.pm.send('controlsStateExt', dat) - # carState - car_events = self.events.to_msg() - cs_send = messaging.new_message('carState') - cs_send.valid = CS.canValid - cs_send.carState = CS - cs_send.carState.events = car_events - self.pm.send('carState', cs_send) - # onroadEvents - logged every second or on change if (self.sm.frame % int(1. / DT_CTRL) == 0) or (self.events.names != self.events_prev): ce_send = messaging.new_message('onroadEvents', len(self.events)) ce_send.valid = True - ce_send.onroadEvents = car_events + ce_send.onroadEvents = self.events.to_msg() self.pm.send('onroadEvents', ce_send) self.events_prev = self.events.names.copy() - # carParams - logged every 50 seconds (> 1 per segment) - if (self.sm.frame % int(50. / DT_CTRL) == 0): - cp_send = messaging.new_message('carParams') - cp_send.valid = True - cp_send.carParams = self.CP - self.pm.send('carParams', cp_send) - # carControl cc_send = messaging.new_message('carControl') cc_send.valid = CS.canValid @@ -988,6 +945,7 @@ class Controls: def main(): + config_realtime_process(4, Priority.CTRL_HIGH) controls = Controls() controls.controlsd_thread() diff --git a/selfdrive/controls/lib/accel_controller.py b/selfdrive/controls/lib/accel_controller.py index 3c4aae2fc..7d5d8cb61 100644 --- a/selfdrive/controls/lib/accel_controller.py +++ b/selfdrive/controls/lib/accel_controller.py @@ -29,15 +29,19 @@ DP_ACCEL_NORMAL = 2 DP_ACCEL_SPORT = 3 # accel profile by @arne182 modified by cgw -_DP_CRUISE_MIN_V = [-0.001, -0.012, -0.30, -0.58, -0.58] -_DP_CRUISE_MIN_V_ECO = [-0.001, -0.010, -0.28, -0.56, -0.56] -_DP_CRUISE_MIN_V_SPORT = [-0.001, -0.014, -0.32, -0.60, -0.60] -_DP_CRUISE_MIN_BP = [0., 8., 16., 28., 42.] +_DP_CRUISE_MIN_V = [-0.02700, -.0001, -.001, -.16, -0.65] +_DP_CRUISE_MIN_V_ECO = [-0.02700, -.0001, -.001, -.14, -0.60] +_DP_CRUISE_MIN_V_SPORT = [-0.02700, -.0001, -.001, -.28, -0.70] +_DP_CRUISE_MIN_BP = [0., .003, 1.0, 2.0, 33.] +#_DP_CRUISE_MIN_V = [-0.0279, -.000002, -.000004, -.0002, -0.07, -0.34, -0.70, -0.75] +#_DP_CRUISE_MIN_V_ECO = [-0.0278, -.000001, -.000003, -.0001, -0.06, -0.32, -0.65, -0.70] +#_DP_CRUISE_MIN_V_SPORT = [-0.0280, -.000003, -.000005, -.0003, -0.08, -0.36, -0.75, -0.80] -_DP_CRUISE_MAX_V = [3.5, 3.5, 3.0, 2.5, 1.221, .863, .66, .42, .33, .12] -_DP_CRUISE_MAX_V_ECO = [3.5, 3.2, 2.3, 2.0, 1.15, .80, .58, .36, .30, .091] -_DP_CRUISE_MAX_V_SPORT = [3.5, 3.5, 3.3, 2.8, 1.5, 1.0, .75, .6, .38, .2] -_DP_CRUISE_MAX_BP = [0., 3, 6., 8., 11., 15., 20., 25., 30., 55.] +#_DP_CRUISE_MIN_BP = [0., .01, .1, 1., 5.5, 8.3, 28., 42.] +_DP_CRUISE_MAX_V = [3.5, 3.5, 3.4, 2.3, 1.9, 1.12, .863, .64, .42, .33, .12] +_DP_CRUISE_MAX_V_ECO = [3.5, 3.5, 3.3, 1.9, 1.5, 0.977, .767, .554, .344, .29, .09] +_DP_CRUISE_MAX_V_SPORT = [3.5, 3.5, 3.5, 3.4, 2.8, 1.25, 1.0, .75, .6, .38, .2] +_DP_CRUISE_MAX_BP = [0., 1., 3, 6., 8., 11., 15., 20., 25., 30., 55.] class AccelController: diff --git a/selfdrive/controls/lib/alertmanager.py b/selfdrive/controls/lib/alertmanager.py index 6abcf4cbb..f67e269fa 100644 --- a/selfdrive/controls/lib/alertmanager.py +++ b/selfdrive/controls/lib/alertmanager.py @@ -3,7 +3,6 @@ import os import json from collections import defaultdict from dataclasses import dataclass -from typing import List, Dict, Optional from openpilot.common.basedir import BASEDIR from openpilot.common.params import Params @@ -14,7 +13,7 @@ with open(os.path.join(BASEDIR, "selfdrive/controls/lib/alerts_offroad.json")) a OFFROAD_ALERTS = json.load(f) -def set_offroad_alert(alert: str, show_alert: bool, extra_text: Optional[str] = None) -> None: +def set_offroad_alert(alert: str, show_alert: bool, extra_text: str = None) -> None: if show_alert: a = copy.copy(OFFROAD_ALERTS[alert]) a['extra'] = extra_text or '' @@ -25,7 +24,7 @@ def set_offroad_alert(alert: str, show_alert: bool, extra_text: Optional[str] = @dataclass class AlertEntry: - alert: Optional[Alert] = None + alert: Alert | None = None start_frame: int = -1 end_frame: int = -1 @@ -34,9 +33,9 @@ class AlertEntry: class AlertManager: def __init__(self): - self.alerts: Dict[str, AlertEntry] = defaultdict(AlertEntry) + self.alerts: dict[str, AlertEntry] = defaultdict(AlertEntry) - def add_many(self, frame: int, alerts: List[Alert]) -> None: + def add_many(self, frame: int, alerts: list[Alert]) -> None: for alert in alerts: entry = self.alerts[alert.alert_type] entry.alert = alert @@ -45,7 +44,7 @@ class AlertManager: min_end_frame = entry.start_frame + alert.duration entry.end_frame = max(frame + 1, min_end_frame) - def process_alerts(self, frame: int, clear_event_types: set) -> Optional[Alert]: + def process_alerts(self, frame: int, clear_event_types: set) -> Alert | None: current_alert = AlertEntry() for v in self.alerts.values(): if not v.alert: diff --git a/selfdrive/controls/lib/dynamic_endtoend_controller.py b/selfdrive/controls/lib/dynamic_endtoend_controller.py index c83281588..22304e53d 100644 --- a/selfdrive/controls/lib/dynamic_endtoend_controller.py +++ b/selfdrive/controls/lib/dynamic_endtoend_controller.py @@ -21,7 +21,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # -# Version = 2024-1-29 +# Version = 2024-02-28 from common.numpy_fast import interp # d-e2e, from modeldata.h @@ -51,6 +51,8 @@ SET_MODE_TIMEOUT = 10 MPC_FCW_WINDOW_SIZE = 5 MPC_FCW_PROB = 0.6 +V_ACC_MIN = 9.72 + class SNG_State: off = 0 stopped = 1 @@ -98,6 +100,7 @@ class DynamicEndtoEndController: self._slowness_gmac = GenericMovingAverageCalculator(window_size=SLOWNESS_WINDOW_SIZE) self._has_slowness = False + self._has_nav_enabled = False self._has_nav_instruction = False self._dangerous_ttc_gmac = GenericMovingAverageCalculator(window_size=DANGEROUS_TTC_WINDOW_SIZE) @@ -129,18 +132,19 @@ class DynamicEndtoEndController: # fcw detection self._mpc_fcw_gmac.add_data(self._mpc_fcw_crash_cnt > 0) - self._has_mpc_fcw = self._mpc_fcw_gmac.get_moving_average() >= MPC_FCW_PROB + self._has_mpc_fcw = self._mpc_fcw_gmac.get_moving_average() > MPC_FCW_PROB # nav enable detection - self._has_nav_instruction = maneuver_distance / max(car_state.vEgo, 1) < 13 + self._has_nav_enabled = md.navEnabled + self._has_nav_instruction = self._has_nav_enabled and maneuver_distance / max(car_state.vEgo, 1) < 13 # lead detection self._lead_gmac.add_data(lead_one.status) - self._has_lead_filtered = self._lead_gmac.get_moving_average() >= LEAD_PROB + self._has_lead_filtered = self._lead_gmac.get_moving_average() > LEAD_PROB # slow down detection self._slow_down_gmac.add_data(len(md.orientation.x) == len(md.position.x) == TRAJECTORY_SIZE and md.position.x[TRAJECTORY_SIZE - 1] < interp(self._v_ego_kph, SLOW_DOWN_BP, SLOW_DOWN_DIST)) - self._has_slow_down = self._slow_down_gmac.get_moving_average() >= SLOW_DOWN_PROB + self._has_slow_down = self._slow_down_gmac.get_moving_average() > SLOW_DOWN_PROB # blinker detection self._has_blinkers = car_state.leftBlinker or car_state.rightBlinker @@ -162,7 +166,7 @@ class DynamicEndtoEndController: # slowness detection if not self._has_standstill: self._slowness_gmac.add_data(self._v_ego_kph <= (self._v_cruise_kph*SLOWNESS_CRUISE_OFFSET)) - self._has_slowness = self._slowness_gmac.get_moving_average() >= SLOWNESS_PROB + self._has_slowness = self._slowness_gmac.get_moving_average() > SLOWNESS_PROB # dangerous TTC detection if not self._has_lead_filtered and self._has_lead_filtered_prev: @@ -180,21 +184,16 @@ class DynamicEndtoEndController: self._has_lead_filtered_prev = self._has_lead_filtered self._frame += 1 - def _blended_priority_mode(self): + def _radarless_mode(self): # when mpc fcw crash prob is high # use blended to slow down quickly if self._has_mpc_fcw: self._set_mode('blended') return - # Nav enabled and distance to upcoming turning is 300 or below - if self._has_nav_instruction: - self._set_mode('blended') - return - - # when blinker is on and speed is driving below highway cruise speed: blended + # when blinker is on and speed is driving below V_ACC_MIN: blended # we dont want it to switch mode at higher speed, blended may trigger hard brake - if self._has_blinkers and self._v_ego_kph < HIGHWAY_CRUISE_KPH: + if self._has_blinkers and self._v_ego_kph < V_ACC_MIN: self._set_mode('blended') return @@ -223,14 +222,19 @@ class DynamicEndtoEndController: self._set_mode('blended') return + # Nav enabled and distance to upcoming turn + if self._has_nav_instruction: + self._set_mode('blended') + return + # car driving at speed lower than set speed: acc if self._has_slowness: self._set_mode('acc') return - self._set_mode('blended') + self._set_mode('acc') - def _acc_priority_mode(self): + def _radar_mode(self): # when mpc fcw crash prob is high # use blended to slow down quickly if self._has_mpc_fcw: @@ -242,9 +246,9 @@ class DynamicEndtoEndController: self._set_mode('acc') return - # when blinker is on and speed is driving below highway cruise speed: blended + # when blinker is on and speed is driving below V_ACC_MIN: blended # we dont want it to switch mode at higher speed, blended may trigger hard brake - if self._has_blinkers and self._v_ego_kph < HIGHWAY_CRUISE_KPH: + if self._has_blinkers and self._v_ego_kph < V_ACC_MIN: self._set_mode('blended') return @@ -260,25 +264,25 @@ class DynamicEndtoEndController: self._set_mode('blended') return + # Nav enabled and distance to upcoming turn + if self._has_nav_instruction: + self._set_mode('blended') + return + # car driving at speed lower than set speed: acc if self._has_slowness: self._set_mode('acc') return - # Nav enabled and distance to upcoming turning is 300 or below - if self._has_nav_instruction: - self._set_mode('blended') - return - self._set_mode('acc') def get_mpc_mode(self, radar_unavailable, car_state, lead_one, md, controls_state, maneuver_distance): if self._is_enabled: self._update(car_state, lead_one, md, controls_state, maneuver_distance) if radar_unavailable: - self._blended_priority_mode() + self._radarless_mode() else: - self._acc_priority_mode() + self._radar_mode() self._mode_prev = self._mode return self._mode diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 769453fe4..bbb48a078 100755 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -7,7 +7,7 @@ _ = events() import math import os from enum import IntEnum -from typing import Dict, Union, Callable, List, Optional +from collections.abc import Callable from cereal import log, car import cereal.messaging as messaging @@ -53,12 +53,12 @@ EVENT_NAME = {v: k for k, v in EventName.schema.enumerants.items()} class Events: def __init__(self): - self.events: List[int] = [] - self.static_events: List[int] = [] + self.events: list[int] = [] + self.static_events: list[int] = [] self.events_prev = dict.fromkeys(EVENTS.keys(), 0) @property - def names(self) -> List[int]: + def names(self) -> list[int]: return self.events def __len__(self) -> int: @@ -76,7 +76,7 @@ class Events: def contains(self, event_type: str) -> bool: return any(event_type in EVENTS.get(e, {}) for e in self.events) - def create_alerts(self, event_types: List[str], callback_args=None): + def create_alerts(self, event_types: list[str], callback_args=None): if callback_args is None: callback_args = [] @@ -137,7 +137,7 @@ class Alert: self.creation_delay = creation_delay self.alert_type = "" - self.event_type: Optional[str] = None + self.event_type: str | None = None def __str__(self) -> str: return f"{self.alert_text_1}/{self.alert_text_2} {self.priority} {self.visual_alert} {self.audible_alert}" @@ -338,7 +338,7 @@ def joystick_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster, -EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = { +EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = { # ********** events with no alerts ********** EventName.stockFcw: {}, @@ -772,12 +772,12 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = { # is thrown. This can mean a service crashed, did not broadcast a message for # ten times the regular interval, or the average interval is more than 10% too high. EventName.commIssue: { - ET.SOFT_DISABLE: soft_disable_alert(_("Communication Issue between Processes")), + ET.SOFT_DISABLE: soft_disable_alert(_("Communication Issue Between Processes")), ET.NO_ENTRY: comm_issue_alert, }, EventName.commIssueAvgFreq: { - ET.SOFT_DISABLE: soft_disable_alert(_("Low Communication Rate between Processes")), - ET.NO_ENTRY: NoEntryAlert(_("Low Communication Rate between Processes")), + ET.SOFT_DISABLE: soft_disable_alert(_("Low Communication Rate Between Processes")), + ET.NO_ENTRY: NoEntryAlert(_("Low Communication Rate Between Processes")), }, EventName.controlsdLagging: { @@ -970,7 +970,7 @@ if __name__ == '__main__': from collections import defaultdict event_names = {v: k for k, v in EventName.schema.enumerants.items()} - alerts_by_type: Dict[str, Dict[Priority, List[str]]] = defaultdict(lambda: defaultdict(list)) + alerts_by_type: dict[str, dict[Priority, list[str]]] = defaultdict(lambda: defaultdict(list)) CP = car.CarParams.new_message() CS = car.CarState.new_message() @@ -982,7 +982,7 @@ if __name__ == '__main__': alert = alert(CP, CS, sm, False, 1) alerts_by_type[et][alert.priority].append(event_names[i]) - all_alerts: Dict[str, List[tuple[Priority, List[str]]]] = {} + all_alerts: dict[str, list[tuple[Priority, list[str]]]] = {} for et, priority_alerts in alerts_by_type.items(): all_alerts[et] = sorted(priority_alerts.items(), key=lambda x: x[0], reverse=True) diff --git a/selfdrive/controls/lib/lateral_mpc_lib/acados_ocp_lat.json b/selfdrive/controls/lib/lateral_mpc_lib/acados_ocp_lat.json index 8716b4b14..4690040e2 100644 --- a/selfdrive/controls/lib/lateral_mpc_lib/acados_ocp_lat.json +++ b/selfdrive/controls/lib/lateral_mpc_lib/acados_ocp_lat.json @@ -1,7 +1,7 @@ { - "acados_include_path": "/data/dp-private/third_party/acados/include", - "acados_lib_path": "/data/dp-private/third_party/acados/lib", - "code_export_directory": "/data/dp-private/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code", + "acados_include_path": "/data/openpilot/third_party/acados/include", + "acados_lib_path": "/data/openpilot/third_party/acados/lib", + "code_export_directory": "/data/openpilot/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code", "constraints": { "C": [], "C_e": [], @@ -261,7 +261,7 @@ "ny_e": 3, "nz": 0 }, - "json_file": "/data/dp-private/selfdrive/controls/lib/lateral_mpc_lib/acados_ocp_lat.json", + "json_file": "/data/openpilot/selfdrive/controls/lib/lateral_mpc_lib/acados_ocp_lat.json", "model": { "con_h_expr": null, "con_h_expr_e": null, diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c index b9cea73f1..fcbe6f5be 100644 --- a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c +++ b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.5 */ +/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -24,10 +24,10 @@ #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif -#define CYTHON_ABI "3_0_5" __PYX_EXTRA_ABI_MODULE_NAME +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030005F0 +#define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -241,7 +241,7 @@ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif -#elif defined(PY_NOGIL) +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 @@ -569,18 +569,19 @@ PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; // borrowed - #endif + PyObject *version_info; PyObject *py_minor_version = NULL; + #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; // we don't yet need to distinguish between versions > 11 + minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; @@ -601,7 +602,6 @@ Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); - Py_XDECREF(py_minor_version); if (type) { PyErr_Restore(type, value, traceback); } @@ -634,7 +634,7 @@ PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 @@ -929,7 +929,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ @@ -1345,7 +1345,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 + #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) @@ -1465,7 +1465,7 @@ static const char *__pyx_filename; #if !defined(CYTHON_CCOMPLEX) #if defined(__cplusplus) #define CYTHON_CCOMPLEX 1 - #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__)) + #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER)) #define CYTHON_CCOMPLEX 1 #else #define CYTHON_CCOMPLEX 0 @@ -2196,8 +2196,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op - #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL @@ -2209,12 +2209,13 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 - static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs - #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS @@ -2825,7 +2826,7 @@ typedef struct { #endif void *defaults; int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults + size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2965,22 +2966,22 @@ static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_5 -#define __PYX_HAVE_RT_ImportType_proto_3_0_5 +#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 +#define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_5(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_5(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_5 { - __Pyx_ImportType_CheckSize_Error_3_0_5 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_5 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_5 = 2 +enum __Pyx_ImportType_CheckSize_3_0_8 { + __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, + __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; -static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_5 check_size); +static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* CLineInTraceback.proto */ @@ -20472,7 +20473,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -20486,7 +20487,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":969 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -20495,16 +20496,16 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":969 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< * * cdef inline object get_array_base(ndarray arr): */ - __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 969, __pyx_L1_error) + __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 970, __pyx_L1_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -20519,7 +20520,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_L0:; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -20534,7 +20535,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -20543,7 +20544,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -20553,7 +20554,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -20564,7 +20565,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -20573,7 +20574,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -20585,7 +20586,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -20600,7 +20601,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -20624,7 +20625,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -20640,16 +20641,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 981, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 982, __pyx_L3_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -20663,7 +20664,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -20673,27 +20674,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 982, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 983, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 983, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 984, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 983, __pyx_L5_except_error) + __PYX_ERR(2, 984, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -20709,7 +20710,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -20732,7 +20733,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -20756,7 +20757,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -20772,16 +20773,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 987, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 988, __pyx_L3_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -20795,7 +20796,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -20805,27 +20806,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 989, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 990, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 989, __pyx_L5_except_error) + __PYX_ERR(2, 990, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -20841,7 +20842,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -20864,7 +20865,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -20888,7 +20889,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -20904,16 +20905,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 994, __pyx_L3_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -20927,7 +20928,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -20937,27 +20938,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 995, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":996 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 996, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 995, __pyx_L5_except_error) + __PYX_ERR(2, 996, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -20973,7 +20974,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -20996,7 +20997,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -21007,7 +21008,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1010 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1011 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -21017,7 +21018,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -21030,7 +21031,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -21041,7 +21042,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1025 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1026 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -21051,7 +21052,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -21064,7 +21065,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -21075,7 +21076,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1036 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -21085,7 +21086,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -21098,7 +21099,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -21109,7 +21110,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1042 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1043 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -21119,7 +21120,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -21132,7 +21133,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -21143,7 +21144,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1049 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1050 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -21151,7 +21152,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -33297,7 +33298,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 408, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 618, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 914, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 984, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -33344,25 +33345,25 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); @@ -34258,33 +34259,33 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_5(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_8(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyTypeObject), #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 809, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 811, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 813, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 815, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 817, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 819, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 821, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 823, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 825, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 827, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 865, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 202, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 225, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 229, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 809, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 811, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 815, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 817, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 819, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 821, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 823, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 825, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 866, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -34504,7 +34505,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_acados_ocp_solver_pyx(PyObject *__ __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to acados_ocp_solver_pyx pseudovariable */ + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "acados_ocp_solver_pyx" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } @@ -35932,14 +35933,14 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error + if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } - return NULL; // not found (no exception set) + return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 -static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); @@ -36049,7 +36050,7 @@ static int __Pyx_ParseOptionalKeywords( if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); // transfer ownership of value to values + Py_INCREF(value); Py_DECREF(key); #endif key = NULL; @@ -36068,7 +36069,7 @@ static int __Pyx_ParseOptionalKeywords( && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -36100,7 +36101,7 @@ static int __Pyx_ParseOptionalKeywords( if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -37022,7 +37023,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } } #else - if (is_list || PySequence_Check(o)) { + if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif @@ -37906,11 +37907,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje } } #else -#if CYTHON_COMPILING_IN_PYPY - if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) -#else - if (is_list || PySequence_Check(o)) -#endif + if (is_list || !PyMapping_Check(o)) { return PySequence_SetItem(o, i, v); } @@ -38912,9 +38909,10 @@ static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) { /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); if (unlikely(!selfless_args)) return NULL; - PyObject *result = PyObject_Call(method, selfless_args, kwargs); + result = PyObject_Call(method, selfless_args, kwargs); Py_DECREF(selfless_args); return result; } @@ -40298,9 +40296,10 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { + PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); + exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; @@ -40865,38 +40864,38 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif return -1; } -#if !CYTHON_USE_TYPE_SLOTS - if (dictoffset == 0) { - PyErr_Format(PyExc_TypeError, - "extension type '%s.200s': " - "unable to validate whether bases have a __dict__ " - "when CYTHON_USE_TYPE_SLOTS is off " - "(likely because you are building in the limited API). " - "Therefore, all extension types with multiple bases " - "must add 'cdef dict __dict__' in this compilation mode", - type_name); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } -#else - if (dictoffset == 0 && b->tp_dictoffset) + if (dictoffset == 0) { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); - PyErr_Format(PyExc_TypeError, - "extension type '%.200s' has no __dict__ slot, " - "but base type '" __Pyx_FMT_TYPENAME "' has: " - "either add 'cdef dict __dict__' to the extension type " - "or add '__slots__ = [...]' to the base type", - type_name, b_name); - __Pyx_DECREF_TypeName(b_name); + Py_ssize_t b_dictoffset = 0; +#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + b_dictoffset = b->tp_dictoffset; +#else + PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); + if (!py_b_dictoffset) goto dictoffset_return; + b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); + Py_DECREF(py_b_dictoffset); + if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; +#endif + if (b_dictoffset) { + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + } +#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) + dictoffset_return: +#endif #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); + Py_DECREF(b0); #endif - return -1; + return -1; + } } -#endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif @@ -41190,10 +41189,10 @@ bad: #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType_3_0_5 -#define __PYX_HAVE_RT_ImportType_3_0_5 -static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_5 check_size) + #ifndef __PYX_HAVE_RT_ImportType_3_0_8 +#define __PYX_HAVE_RT_ImportType_3_0_8 +static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; @@ -41247,7 +41246,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject *module, const char *module module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_5 && + if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " @@ -41255,7 +41254,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject *module, const char *module module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_5 && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -41537,7 +41536,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so index c27fec036..736bbfac4 100755 Binary files a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so and b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so differ diff --git a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/libacados_ocp_solver_lat.so b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/libacados_ocp_solver_lat.so index 7ed2658ac..9e403a154 100755 Binary files a/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/libacados_ocp_solver_lat.so and b/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code/libacados_ocp_solver_lat.so differ diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/acados_ocp_long.json b/selfdrive/controls/lib/longitudinal_mpc_lib/acados_ocp_long.json index 9cce6b28f..7c2cc00d9 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/acados_ocp_long.json +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/acados_ocp_long.json @@ -1,7 +1,7 @@ { - "acados_include_path": "/data/dp-private/third_party/acados/include", - "acados_lib_path": "/data/dp-private/third_party/acados/lib", - "code_export_directory": "/data/dp-private/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code", + "acados_include_path": "/data/openpilot/third_party/acados/include", + "acados_lib_path": "/data/openpilot/third_party/acados/lib", + "code_export_directory": "/data/openpilot/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code", "constraints": { "C": [], "C_e": [], @@ -343,9 +343,9 @@ "ny_e": 5, "nz": 0 }, - "json_file": "/data/dp-private/selfdrive/controls/lib/longitudinal_mpc_lib/acados_ocp_long.json", + "json_file": "/data/openpilot/selfdrive/controls/lib/longitudinal_mpc_lib/acados_ocp_long.json", "model": { - "con_h_expr": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegiaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegpcaaaaaaaaaaaaaafaaaaaaabgpfngjgogegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpfngbgihchcaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaakaaaaaaaihpfpgcgdhehbgdgmgfgegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaacbaaaaaamgfgbgegpfegbgoghgfgchpfggbgdgehpgchegbaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaeglaaaaaaaaaaaaaaachbaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgfaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaamgfgbgegpfehpfggpgmgmgpghhchbaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajggaaaaaaaegbaaaaaaaaaaaaaaachbaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgkaaaaaaa", + "con_h_expr": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegiaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegpcaaaaaaaaaaaaaafaaaaaaabgpfngjgogegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpfngbgihchcaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaakaaaaaaaihpfpgcgdhehbgdgmgfgegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaacbaaaaaamgfgbgegpfegbgoghgfgchpfggbgdgehpgchegbaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaeglaaaaaaaaaaaaaaachbaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgfaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaamgfgbgegpfehpfggpgmgmgpghhchbaaaaaaaaaaaaaaachmaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaachbaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgkaaaaaaa", "con_h_expr_e": null, "con_phi_expr": null, "con_phi_expr_e": null, @@ -368,9 +368,9 @@ "cost_r_in_psi_expr": null, "cost_r_in_psi_expr_0": null, "cost_r_in_psi_expr_e": null, - "cost_y_expr": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegkaaaaaaaaaaaaaaagaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaafaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaakaaaaaaaihpfpgcgdhehbgdgmgfgegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegbaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaeglaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegmcaaaaaaaaaaaaaajgfaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaamgfgbgegpfehpfggpgmgmgpghhcheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajggaaaaaaaegbaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgkaaaaaaachcaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegcaaaaaaaaaaaaaaachbbaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaagaaaaaaaahchfgghpfbgegpcaaaaaaaaaaaaaafaaaaaaakgpffghgpg", - "cost_y_expr_0": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegkaaaaaaaaaaaaaaagaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaafaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaakaaaaaaaihpfpgcgdhehbgdgmgfgegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegbaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaeglaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegmcaaaaaaaaaaaaaajgfaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaamgfgbgegpfehpfggpgmgmgpghhcheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajggaaaaaaaegbaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgkaaaaaaachcaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegcaaaaaaaaaaaaaaachbbaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaagaaaaaaaahchfgghpfbgegpcaaaaaaaaaaaaaafaaaaaaakgpffghgpg", - "cost_y_expr_e": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegjaaaaaaaaaaaaaaafaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaafaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaakaaaaaaaihpfpgcgdhehbgdgmgfgegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegbaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaeglaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegmcaaaaaaaaaaaaaajgfaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaamgfgbgegpfehpfggpgmgmgpghhcheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajggaaaaaaaegbaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgkaaaaaaachcaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegcaaaaaaaaaaaaaaachbbaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaagaaaaaaaahchfgghpfbg", + "cost_y_expr": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegkaaaaaaaaaaaaaaagaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaafaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaakaaaaaaaihpfpgcgdhehbgdgmgfgegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegbaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaeglaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegmcaaaaaaaaaaaaaajgfaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaamgfgbgegpfehpfggpgmgmgpghhcheaaaaaaaaaaaaaaachgaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgkaaaaaaachcaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegcaaaaaaaaaaaaaaachabaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaagaaaaaaaahchfgghpfbgegpcaaaaaaaaaaaaaafaaaaaaakgpffghgpg", + "cost_y_expr_0": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegkaaaaaaaaaaaaaaagaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaafaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaakaaaaaaaihpfpgcgdhehbgdgmgfgegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegbaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaeglaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegmcaaaaaaaaaaaaaajgfaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaamgfgbgegpfehpfggpgmgmgpghhcheaaaaaaaaaaaaaaachgaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgkaaaaaaachcaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegcaaaaaaaaaaaaaaachabaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaagaaaaaaaahchfgghpfbgegpcaaaaaaaaaaaaaafaaaaaaakgpffghgpg", + "cost_y_expr_e": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegjaaaaaaaaaaaaaaafaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaafaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaakaaaaaaaihpfpgcgdhehbgdgmgfgegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegbaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaeglaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegmcaaaaaaaaaaaaaajgfaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaamgfgbgegpfehpfggpgmgmgpghhcheaaaaaaaaaaaaaaachgaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgkaaaaaaachcaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegcaaaaaaaaaaaaaaachabaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaagaaaaaaaahchfgghpfbg", "disc_dyn_expr": null, "dyn_disc_fun": null, "dyn_disc_fun_jac": null, diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c index afe85939f..82838e860 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.5 */ +/* Generated by Cython 3.0.8 */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN @@ -24,10 +24,10 @@ #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif -#define CYTHON_ABI "3_0_5" __PYX_EXTRA_ABI_MODULE_NAME +#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030005F0 +#define CYTHON_HEX_VERSION 0x030008F0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -241,7 +241,7 @@ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif -#elif defined(PY_NOGIL) +#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 @@ -569,18 +569,19 @@ PyObject *exception_table = NULL; PyObject *types_module=NULL, *code_type=NULL, *result=NULL; #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; // borrowed - #endif + PyObject *version_info; PyObject *py_minor_version = NULL; + #endif long minor_version = 0; PyObject *type, *value, *traceback; PyErr_Fetch(&type, &value, &traceback); #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; // we don't yet need to distinguish between versions > 11 + minor_version = 11; #else if (!(version_info = PySys_GetObject("version_info"))) goto end; if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; minor_version = PyLong_AsLong(py_minor_version); + Py_DECREF(py_minor_version); if (minor_version == -1 && PyErr_Occurred()) goto end; #endif if (!(types_module = PyImport_ImportModule("types"))) goto end; @@ -601,7 +602,6 @@ Py_XDECREF(code_type); Py_XDECREF(exception_table); Py_XDECREF(types_module); - Py_XDECREF(py_minor_version); if (type) { PyErr_Restore(type, value, traceback); } @@ -634,7 +634,7 @@ PyObject *fv, PyObject *cell, PyObject* fn, PyObject *name, int fline, PyObject *lnos) { PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here + PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); if (!empty_bytes) return NULL; result = #if PY_VERSION_HEX >= 0x030C0000 @@ -929,7 +929,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #endif #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ - PyTypeObject *type = Py_TYPE(obj);\ + PyTypeObject *type = Py_TYPE((PyObject*)obj);\ assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\ PyObject_GC_Del(obj);\ Py_DECREF(type);\ @@ -1345,7 +1345,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #endif typedef Py_ssize_t __Pyx_compact_pylong; typedef size_t __Pyx_compact_upylong; - #else // Py < 3.12 + #else #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0) #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0) #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0) @@ -1465,7 +1465,7 @@ static const char *__pyx_filename; #if !defined(CYTHON_CCOMPLEX) #if defined(__cplusplus) #define CYTHON_CCOMPLEX 1 - #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__)) + #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER)) #define CYTHON_CCOMPLEX 1 #else #define CYTHON_CCOMPLEX 0 @@ -2196,8 +2196,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op - #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed + #define __Pyx_Arg_NewRef_VARARGS(arg) arg + #define __Pyx_Arg_XDECREF_VARARGS(arg) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL @@ -2209,12 +2209,13 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 - static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); + CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs - #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array + #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs + to have the same reference counting */ + #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS @@ -2825,7 +2826,7 @@ typedef struct { #endif void *defaults; int defaults_pyobjects; - size_t defaults_size; // used by FusedFunction for copying defaults + size_t defaults_size; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; @@ -2965,22 +2966,22 @@ static int __Pyx_MergeVtables(PyTypeObject *type); #endif /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_5 -#define __PYX_HAVE_RT_ImportType_proto_3_0_5 +#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_8 +#define __PYX_HAVE_RT_ImportType_proto_3_0_8 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_5(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_5(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_0_8(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_5 { - __Pyx_ImportType_CheckSize_Error_3_0_5 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_5 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_5 = 2 +enum __Pyx_ImportType_CheckSize_3_0_8 { + __Pyx_ImportType_CheckSize_Error_3_0_8 = 0, + __Pyx_ImportType_CheckSize_Warn_3_0_8 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_0_8 = 2 }; -static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_5 check_size); +static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size); #endif /* CLineInTraceback.proto */ @@ -20472,7 +20473,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__ return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -20486,7 +20487,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":969 * * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<< @@ -20495,16 +20496,16 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a */ Py_INCREF(__pyx_v_base); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":969 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970 * cdef inline void set_array_base(ndarray arr, object base): * Py_INCREF(base) # important to do this before stealing the reference below! * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<< * * cdef inline object get_array_base(ndarray arr): */ - __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 969, __pyx_L1_error) + __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 970, __pyx_L1_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":967 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":968 * int _import_umath() except -1 * * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< @@ -20519,7 +20520,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a __pyx_L0:; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -20534,7 +20535,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py int __pyx_t_1; __Pyx_RefNannySetupContext("get_array_base", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 * * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) # <<<<<<<<<<<<<< @@ -20543,7 +20544,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ __pyx_v_base = PyArray_BASE(__pyx_v_arr); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -20553,7 +20554,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_t_1 = (__pyx_v_base == NULL); if (__pyx_t_1) { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975 * base = PyArray_BASE(arr) * if base is NULL: * return None # <<<<<<<<<<<<<< @@ -20564,7 +20565,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":973 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974 * cdef inline object get_array_base(ndarray arr): * base = PyArray_BASE(arr) * if base is NULL: # <<<<<<<<<<<<<< @@ -20573,7 +20574,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py */ } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976 * if base is NULL: * return None * return base # <<<<<<<<<<<<<< @@ -20585,7 +20586,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py __pyx_r = ((PyObject *)__pyx_v_base); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972 * PyArray_SetBaseObject(arr, base) * * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< @@ -20600,7 +20601,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -20624,7 +20625,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_array", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -20640,16 +20641,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982 * cdef inline int import_array() except -1: * try: * __pyx_import_array() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.multiarray failed to import") */ - __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 981, __pyx_L3_error) + __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 982, __pyx_L3_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -20663,7 +20664,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 * try: * __pyx_import_array() * except Exception: # <<<<<<<<<<<<<< @@ -20673,27 +20674,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 982, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 983, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 983, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 984, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 983, __pyx_L5_except_error) + __PYX_ERR(2, 984, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":981 * # Cython code. * cdef inline int import_array() except -1: * try: # <<<<<<<<<<<<<< @@ -20709,7 +20710,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { __pyx_L8_try_end:; } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":979 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":980 * # Versions of the import_* functions which are more suitable for * # Cython code. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<< @@ -20732,7 +20733,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) { return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -20756,7 +20757,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_umath", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -20772,16 +20773,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988 * cdef inline int import_umath() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 987, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 988, __pyx_L3_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -20795,7 +20796,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -20805,27 +20806,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 988, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 989, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 989, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 990, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 989, __pyx_L5_except_error) + __PYX_ERR(2, 990, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":987 * * cdef inline int import_umath() except -1: * try: # <<<<<<<<<<<<<< @@ -20841,7 +20842,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { __pyx_L8_try_end:; } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986 * raise ImportError("numpy.core.multiarray failed to import") * * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<< @@ -20864,7 +20865,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) { return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -20888,7 +20889,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("import_ufunc", 1); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -20904,16 +20905,16 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __Pyx_XGOTREF(__pyx_t_3); /*try:*/ { - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994 * cdef inline int import_ufunc() except -1: * try: * _import_umath() # <<<<<<<<<<<<<< * except Exception: * raise ImportError("numpy.core.umath failed to import") */ - __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 993, __pyx_L3_error) + __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 994, __pyx_L3_error) - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -20927,7 +20928,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { goto __pyx_L8_try_end; __pyx_L3_error:; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995 * try: * _import_umath() * except Exception: # <<<<<<<<<<<<<< @@ -20937,27 +20938,27 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_4) { __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 994, __pyx_L5_except_error) + if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 995, __pyx_L5_except_error) __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_7); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":996 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 995, __pyx_L5_except_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 996, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_Raise(__pyx_t_8, 0, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __PYX_ERR(2, 995, __pyx_L5_except_error) + __PYX_ERR(2, 996, __pyx_L5_except_error) } goto __pyx_L5_except_error; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":993 * * cdef inline int import_ufunc() except -1: * try: # <<<<<<<<<<<<<< @@ -20973,7 +20974,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { __pyx_L8_try_end:; } - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992 * raise ImportError("numpy.core.umath failed to import") * * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<< @@ -20996,7 +20997,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -21007,7 +21008,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) { static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1010 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1011 * bool * """ * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<< @@ -21017,7 +21018,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type)); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":999 * * * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<< @@ -21030,7 +21031,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -21041,7 +21042,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) { int __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1025 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1026 * bool * """ * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<< @@ -21051,7 +21052,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type)); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1014 * * * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<< @@ -21064,7 +21065,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -21075,7 +21076,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) { npy_datetime __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1035 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1036 * also needed. That can be found using `get_datetime64_unit`. * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -21085,7 +21086,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1029 * * * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -21098,7 +21099,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -21109,7 +21110,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject * static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) { npy_timedelta __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1042 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1043 * returns the int64 value underlying scalar numpy timedelta64 object * """ * return (obj).obval # <<<<<<<<<<<<<< @@ -21119,7 +21120,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval; goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1039 * * * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<< @@ -21132,7 +21133,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject return __pyx_r; } -/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 +/* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -21143,7 +21144,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) { NPY_DATETIMEUNIT __pyx_r; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1049 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1050 * returns the unit part of the dtype for a numpy datetime64 object. * """ * return (obj).obmeta.base # <<<<<<<<<<<<<< @@ -21151,7 +21152,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base); goto __pyx_L0; - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1046 * * * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<< @@ -33297,7 +33298,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 408, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 618, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 914, __pyx_L1_error) - __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 984, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -33344,25 +33345,25 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984 * __pyx_import_array() * except Exception: * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_umath() except -1: */ - __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 983, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989 + /* "../../usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990 * _import_umath() * except Exception: * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<< * * cdef inline int import_ufunc() except -1: */ - __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 989, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 990, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); @@ -34258,33 +34259,33 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_5(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_8(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyTypeObject), #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 202, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 225, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 229, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error) - __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 809, __pyx_L1_error) - __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 811, __pyx_L1_error) - __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 813, __pyx_L1_error) - __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 815, __pyx_L1_error) - __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 817, __pyx_L1_error) - __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 819, __pyx_L1_error) - __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 821, __pyx_L1_error) - __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 823, __pyx_L1_error) - __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 825, __pyx_L1_error) - __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_5); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 827, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_5(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_5(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_5); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 865, __pyx_L1_error) + __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 202, __pyx_L1_error) + __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 225, __pyx_L1_error) + __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 229, __pyx_L1_error) + __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 238, __pyx_L1_error) + __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 809, __pyx_L1_error) + __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 811, __pyx_L1_error) + __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 813, __pyx_L1_error) + __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 815, __pyx_L1_error) + __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 817, __pyx_L1_error) + __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 819, __pyx_L1_error) + __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 821, __pyx_L1_error) + __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 823, __pyx_L1_error) + __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 825, __pyx_L1_error) + __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_8); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 827, __pyx_L1_error) + __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_8(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_8(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_8); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 866, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -34504,7 +34505,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_acados_ocp_solver_pyx(PyObject *__ __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) { int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); - __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to acados_ocp_solver_pyx pseudovariable */ + __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "acados_ocp_solver_pyx" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } @@ -35932,14 +35933,14 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO { int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); if (unlikely(eq != 0)) { - if (unlikely(eq < 0)) return NULL; // error + if (unlikely(eq < 0)) return NULL; return kwvalues[i]; } } - return NULL; // not found (no exception set) + return NULL; } #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 -static CYTHON_UNUSED PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { +CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); PyObject *dict; dict = PyDict_New(); @@ -36049,7 +36050,7 @@ static int __Pyx_ParseOptionalKeywords( if (*name) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); // transfer ownership of value to values + Py_INCREF(value); Py_DECREF(key); #endif key = NULL; @@ -36068,7 +36069,7 @@ static int __Pyx_ParseOptionalKeywords( && _PyString_Eq(**name, key)) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -36100,7 +36101,7 @@ static int __Pyx_ParseOptionalKeywords( if (cmp == 0) { values[name-argnames] = value; #if CYTHON_AVOID_BORROWED_REFS - value = NULL; // ownership transferred to values + value = NULL; #endif break; } @@ -37022,7 +37023,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, } } #else - if (is_list || PySequence_Check(o)) { + if (is_list || !PyMapping_Check(o)) { return PySequence_GetItem(o, i); } #endif @@ -37906,11 +37907,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje } } #else -#if CYTHON_COMPILING_IN_PYPY - if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) -#else - if (is_list || PySequence_Check(o)) -#endif + if (is_list || !PyMapping_Check(o)) { return PySequence_SetItem(o, i, v); } @@ -38912,9 +38909,10 @@ static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) { /* UnpackUnboundCMethod */ static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); if (unlikely(!selfless_args)) return NULL; - PyObject *result = PyObject_Call(method, selfless_args, kwargs); + result = PyObject_Call(method, selfless_args, kwargs); Py_DECREF(selfless_args); return result; } @@ -40298,9 +40296,10 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { + PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign - PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType(); + exc_type = __Pyx_PyErr_CurrentExceptionType(); if (unlikely(exc_type)) { if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return -1; @@ -40865,38 +40864,38 @@ static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffs #endif return -1; } -#if !CYTHON_USE_TYPE_SLOTS - if (dictoffset == 0) { - PyErr_Format(PyExc_TypeError, - "extension type '%s.200s': " - "unable to validate whether bases have a __dict__ " - "when CYTHON_USE_TYPE_SLOTS is off " - "(likely because you are building in the limited API). " - "Therefore, all extension types with multiple bases " - "must add 'cdef dict __dict__' in this compilation mode", - type_name); -#if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); -#endif - return -1; - } -#else - if (dictoffset == 0 && b->tp_dictoffset) + if (dictoffset == 0) { - __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); - PyErr_Format(PyExc_TypeError, - "extension type '%.200s' has no __dict__ slot, " - "but base type '" __Pyx_FMT_TYPENAME "' has: " - "either add 'cdef dict __dict__' to the extension type " - "or add '__slots__ = [...]' to the base type", - type_name, b_name); - __Pyx_DECREF_TypeName(b_name); + Py_ssize_t b_dictoffset = 0; +#if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + b_dictoffset = b->tp_dictoffset; +#else + PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__"); + if (!py_b_dictoffset) goto dictoffset_return; + b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset); + Py_DECREF(py_b_dictoffset); + if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return; +#endif + if (b_dictoffset) { + { + __Pyx_TypeName b_name = __Pyx_PyType_GetName(b); + PyErr_Format(PyExc_TypeError, + "extension type '%.200s' has no __dict__ slot, " + "but base type '" __Pyx_FMT_TYPENAME "' has: " + "either add 'cdef dict __dict__' to the extension type " + "or add '__slots__ = [...]' to the base type", + type_name, b_name); + __Pyx_DECREF_TypeName(b_name); + } +#if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY) + dictoffset_return: +#endif #if CYTHON_AVOID_BORROWED_REFS - Py_DECREF(b0); + Py_DECREF(b0); #endif - return -1; + return -1; + } } -#endif #if CYTHON_AVOID_BORROWED_REFS Py_DECREF(b0); #endif @@ -41190,10 +41189,10 @@ bad: #endif /* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType_3_0_5 -#define __PYX_HAVE_RT_ImportType_3_0_5 -static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_5 check_size) + #ifndef __PYX_HAVE_RT_ImportType_3_0_8 +#define __PYX_HAVE_RT_ImportType_3_0_8 +static PyTypeObject *__Pyx_ImportType_3_0_8(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_8 check_size) { PyObject *result = 0; char warning[200]; @@ -41247,7 +41246,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject *module, const char *module module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_5 && + if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_8 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " @@ -41255,7 +41254,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_5(PyObject *module, const char *module module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_5 && (size_t)basicsize > size) { + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_8 && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", @@ -41537,7 +41536,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( #else py_code = PyCode_NewEmpty(filename, funcname, py_line); #endif - Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline + Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so index b4e8b7913..f6e9a84a5 100755 Binary files a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so and b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/acados_ocp_solver_pyx.so differ diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/libacados_ocp_solver_long.so b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/libacados_ocp_solver_long.so index 00e02a49a..03ce0e28c 100755 Binary files a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/libacados_ocp_solver_long.so and b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/libacados_ocp_solver_long.so differ diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun.c index be006b8bf..fe438bc12 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun.c +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun.c @@ -62,7 +62,7 @@ static const casadi_int casadi_s4[8] = {4, 1, 0, 4, 0, 1, 2, 3}; /* long_constr_h_fun:(i0[3],i1,i2[],i3[6])->(o0[4]) */ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { - casadi_real a0, a1, a2, a3, a4; + casadi_real a0, a1, a2, a3, a4, a5; a0=arg[0]? arg[0][1] : 0; if (res[0]!=0) res[0][0]=a0; a1=arg[0]? arg[0][2] : 0; @@ -79,10 +79,9 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a3=casadi_sq(a0); a4=5.; a3=(a3/a4); - a4=arg[3]? arg[3][4] : 0; - a4=(a4*a0); - a3=(a3+a4); - a4=6.; + a5=arg[3]? arg[3][4] : 0; + a5=(a5*a0); + a3=(a3+a5); a3=(a3+a4); a1=(a1*a3); a2=(a2-a1); diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun_jac_uxt_zt.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun_jac_uxt_zt.c index 7f78a873f..244fd8e69 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun_jac_uxt_zt.c +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_constraints/long_constr_h_fun_jac_uxt_zt.c @@ -66,7 +66,7 @@ static const casadi_int casadi_s6[3] = {4, 0, 0}; /* long_constr_h_fun_jac_uxt_zt:(i0[3],i1,i2[],i3[6])->(o0[4],o1[4x4,5nz],o2[4x0]) */ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { - casadi_real a0, a1, a2, a3, a4, a5; + casadi_real a0, a1, a2, a3, a4, a5, a6; a0=arg[0]? arg[0][1] : 0; if (res[0]!=0) res[0][0]=a0; a1=arg[0]? arg[0][2] : 0; @@ -83,30 +83,29 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a3=casadi_sq(a0); a4=5.; a3=(a3/a4); - a4=arg[3]? arg[3][4] : 0; - a5=(a4*a0); - a3=(a3+a5); - a5=6.; - a3=(a3+a5); + a5=arg[3]? arg[3][4] : 0; + a6=(a5*a0); + a3=(a3+a6); + a3=(a3+a4); a3=(a1*a3); a2=(a2-a3); a3=10.; a3=(a0+a3); a2=(a2/a3); if (res[0]!=0) res[0][3]=a2; - a5=1.; - if (res[1]!=0) res[1][0]=a5; - if (res[1]!=0) res[1][1]=a5; - a5=-1.; - if (res[1]!=0) res[1][2]=a5; - a5=(1./a3); - a5=(-a5); - if (res[1]!=0) res[1][3]=a5; - a5=2.0000000000000001e-01; + a4=1.; + if (res[1]!=0) res[1][0]=a4; + if (res[1]!=0) res[1][1]=a4; + a4=-1.; + if (res[1]!=0) res[1][2]=a4; + a4=(1./a3); + a4=(-a4); + if (res[1]!=0) res[1][3]=a4; + a4=2.0000000000000001e-01; a0=(a0+a0); - a5=(a5*a0); - a5=(a5+a4); - a1=(a1*a5); + a4=(a4*a0); + a4=(a4+a5); + a1=(a1*a4); a1=(a1/a3); a2=(a2/a3); a1=(a1+a2); diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun.c index 1189293c2..7e0545867 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun.c +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun.c @@ -60,7 +60,7 @@ static const casadi_int casadi_s3[10] = {6, 1, 0, 6, 0, 1, 2, 3, 4, 5}; /* long_cost_y_0_fun:(i0[3],i1,i2[],i3[6])->(o0[6]) */ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { - casadi_real a0, a1, a2, a3, a4; + casadi_real a0, a1, a2, a3, a4, a5; a0=arg[3]? arg[3][2] : 0; a1=arg[0]? arg[0][0] : 0; a0=(a0-a1); @@ -68,10 +68,9 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a3=casadi_sq(a2); a4=5.; a3=(a3/a4); - a4=arg[3]? arg[3][4] : 0; - a4=(a4*a2); - a3=(a3+a4); - a4=6.; + a5=arg[3]? arg[3][4] : 0; + a5=(a5*a2); + a3=(a3+a5); a3=(a3+a4); a0=(a0-a3); a3=10.; diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun_jac_ut_xt.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun_jac_ut_xt.c index 7227e0365..684a39c75 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun_jac_ut_xt.c +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_fun_jac_ut_xt.c @@ -64,7 +64,7 @@ static const casadi_int casadi_s5[3] = {6, 0, 0}; /* long_cost_y_0_fun_jac_ut_xt:(i0[3],i1,i2[],i3[6])->(o0[6],o1[4x6,7nz],o2[6x0]) */ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { - casadi_real a0, a1, a2, a3, a4, a5; + casadi_real a0, a1, a2, a3, a4, a5, a6; a0=arg[3]? arg[3][2] : 0; a1=arg[0]? arg[0][0] : 0; a0=(a0-a1); @@ -72,11 +72,10 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a3=casadi_sq(a2); a4=5.; a3=(a3/a4); - a4=arg[3]? arg[3][4] : 0; - a5=(a4*a2); - a3=(a3+a5); - a5=6.; - a3=(a3+a5); + a5=arg[3]? arg[3][4] : 0; + a6=(a5*a2); + a3=(a3+a6); + a3=(a3+a4); a0=(a0-a3); a3=10.; a3=(a2+a3); @@ -86,8 +85,8 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, if (res[0]!=0) res[0][2]=a2; a1=arg[0]? arg[0][2] : 0; if (res[0]!=0) res[0][3]=a1; - a5=arg[3]? arg[3][3] : 0; - a1=(a1-a5); + a4=arg[3]? arg[3][3] : 0; + a1=(a1-a4); if (res[0]!=0) res[0][4]=a1; a1=arg[1]? arg[1][0] : 0; if (res[0]!=0) res[0][5]=a1; @@ -97,7 +96,7 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a1=2.0000000000000001e-01; a2=(a2+a2); a1=(a1*a2); - a1=(a1+a4); + a1=(a1+a5); a1=(a1/a3); a0=(a0/a3); a1=(a1+a0); diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_hess.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_hess.c index 74eec0d0c..604dcb88f 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_hess.c +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_0_hess.c @@ -62,7 +62,7 @@ static const casadi_int casadi_s4[10] = {4, 4, 0, 0, 1, 3, 3, 2, 1, 2}; /* long_cost_y_0_hess:(i0[3],i1,i2[],i3[6],i4[6])->(o0[4x4,3nz]) */ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { - casadi_real a0, a1, a10, a2, a3, a4, a5, a6, a7, a8, a9; + casadi_real a0, a1, a10, a11, a2, a3, a4, a5, a6, a7, a8, a9; a0=arg[3]? arg[3][0] : 0; a1=arg[0]? arg[0][1] : 0; a2=10.; @@ -86,9 +86,8 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a9=casadi_sq(a1); a10=5.; a9=(a9/a10); - a10=(a7*a1); - a9=(a9+a10); - a10=6.; + a11=(a7*a1); + a9=(a9+a11); a9=(a9+a10); a8=(a8-a9); a8=(a8/a2); diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun.c index 92dcef2cf..e0d989c86 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun.c +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun.c @@ -60,7 +60,7 @@ static const casadi_int casadi_s3[9] = {5, 1, 0, 5, 0, 1, 2, 3, 4}; /* long_cost_y_e_fun:(i0[3],i1[],i2[],i3[6])->(o0[5]) */ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { - casadi_real a0, a1, a2, a3, a4; + casadi_real a0, a1, a2, a3, a4, a5; a0=arg[3]? arg[3][2] : 0; a1=arg[0]? arg[0][0] : 0; a0=(a0-a1); @@ -68,10 +68,9 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a3=casadi_sq(a2); a4=5.; a3=(a3/a4); - a4=arg[3]? arg[3][4] : 0; - a4=(a4*a2); - a3=(a3+a4); - a4=6.; + a5=arg[3]? arg[3][4] : 0; + a5=(a5*a2); + a3=(a3+a5); a3=(a3+a4); a0=(a0-a3); a3=10.; diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun_jac_ut_xt.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun_jac_ut_xt.c index 3cef9bbf3..aaff99bf4 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun_jac_ut_xt.c +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_fun_jac_ut_xt.c @@ -64,7 +64,7 @@ static const casadi_int casadi_s5[3] = {5, 0, 0}; /* long_cost_y_e_fun_jac_ut_xt:(i0[3],i1[],i2[],i3[6])->(o0[5],o1[3x5,6nz],o2[5x0]) */ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { - casadi_real a0, a1, a2, a3, a4, a5; + casadi_real a0, a1, a2, a3, a4, a5, a6; a0=arg[3]? arg[3][2] : 0; a1=arg[0]? arg[0][0] : 0; a0=(a0-a1); @@ -72,11 +72,10 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a3=casadi_sq(a2); a4=5.; a3=(a3/a4); - a4=arg[3]? arg[3][4] : 0; - a5=(a4*a2); - a3=(a3+a5); - a5=6.; - a3=(a3+a5); + a5=arg[3]? arg[3][4] : 0; + a6=(a5*a2); + a3=(a3+a6); + a3=(a3+a4); a0=(a0-a3); a3=10.; a3=(a2+a3); @@ -86,8 +85,8 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, if (res[0]!=0) res[0][2]=a2; a1=arg[0]? arg[0][2] : 0; if (res[0]!=0) res[0][3]=a1; - a5=arg[3]? arg[3][3] : 0; - a1=(a1-a5); + a4=arg[3]? arg[3][3] : 0; + a1=(a1-a4); if (res[0]!=0) res[0][4]=a1; a1=(1./a3); a1=(-a1); @@ -95,7 +94,7 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a1=2.0000000000000001e-01; a2=(a2+a2); a1=(a1*a2); - a1=(a1+a4); + a1=(a1+a5); a1=(a1/a3); a0=(a0/a3); a1=(a1+a0); diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_hess.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_hess.c index b14ef579e..bd559735f 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_hess.c +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_e_hess.c @@ -62,7 +62,7 @@ static const casadi_int casadi_s4[9] = {3, 3, 0, 1, 3, 3, 1, 0, 1}; /* long_cost_y_e_hess:(i0[3],i1[],i2[],i3[5],i4[6])->(o0[3x3,3nz]) */ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { - casadi_real a0, a1, a10, a2, a3, a4, a5, a6, a7, a8, a9; + casadi_real a0, a1, a10, a11, a2, a3, a4, a5, a6, a7, a8, a9; a0=arg[3]? arg[3][0] : 0; a1=arg[0]? arg[0][1] : 0; a2=10.; @@ -86,9 +86,8 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a9=casadi_sq(a1); a10=5.; a9=(a9/a10); - a10=(a7*a1); - a9=(a9+a10); - a10=6.; + a11=(a7*a1); + a9=(a9+a11); a9=(a9+a10); a8=(a8-a9); a8=(a8/a2); diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun.c index 2c5e7d635..aed1714d7 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun.c +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun.c @@ -60,7 +60,7 @@ static const casadi_int casadi_s3[10] = {6, 1, 0, 6, 0, 1, 2, 3, 4, 5}; /* long_cost_y_fun:(i0[3],i1,i2[],i3[6])->(o0[6]) */ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { - casadi_real a0, a1, a2, a3, a4; + casadi_real a0, a1, a2, a3, a4, a5; a0=arg[3]? arg[3][2] : 0; a1=arg[0]? arg[0][0] : 0; a0=(a0-a1); @@ -68,10 +68,9 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a3=casadi_sq(a2); a4=5.; a3=(a3/a4); - a4=arg[3]? arg[3][4] : 0; - a4=(a4*a2); - a3=(a3+a4); - a4=6.; + a5=arg[3]? arg[3][4] : 0; + a5=(a5*a2); + a3=(a3+a5); a3=(a3+a4); a0=(a0-a3); a3=10.; diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun_jac_ut_xt.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun_jac_ut_xt.c index 6d1e496cf..882fe043f 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun_jac_ut_xt.c +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_fun_jac_ut_xt.c @@ -64,7 +64,7 @@ static const casadi_int casadi_s5[3] = {6, 0, 0}; /* long_cost_y_fun_jac_ut_xt:(i0[3],i1,i2[],i3[6])->(o0[6],o1[4x6,7nz],o2[6x0]) */ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { - casadi_real a0, a1, a2, a3, a4, a5; + casadi_real a0, a1, a2, a3, a4, a5, a6; a0=arg[3]? arg[3][2] : 0; a1=arg[0]? arg[0][0] : 0; a0=(a0-a1); @@ -72,11 +72,10 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a3=casadi_sq(a2); a4=5.; a3=(a3/a4); - a4=arg[3]? arg[3][4] : 0; - a5=(a4*a2); - a3=(a3+a5); - a5=6.; - a3=(a3+a5); + a5=arg[3]? arg[3][4] : 0; + a6=(a5*a2); + a3=(a3+a6); + a3=(a3+a4); a0=(a0-a3); a3=10.; a3=(a2+a3); @@ -86,8 +85,8 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, if (res[0]!=0) res[0][2]=a2; a1=arg[0]? arg[0][2] : 0; if (res[0]!=0) res[0][3]=a1; - a5=arg[3]? arg[3][3] : 0; - a1=(a1-a5); + a4=arg[3]? arg[3][3] : 0; + a1=(a1-a4); if (res[0]!=0) res[0][4]=a1; a1=arg[1]? arg[1][0] : 0; if (res[0]!=0) res[0][5]=a1; @@ -97,7 +96,7 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a1=2.0000000000000001e-01; a2=(a2+a2); a1=(a1*a2); - a1=(a1+a4); + a1=(a1+a5); a1=(a1/a3); a0=(a0/a3); a1=(a1+a0); diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_hess.c b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_hess.c index fc43b0714..c3bdea8bd 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_hess.c +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code/long_cost/long_cost_y_hess.c @@ -62,7 +62,7 @@ static const casadi_int casadi_s4[10] = {4, 4, 0, 0, 1, 3, 3, 2, 1, 2}; /* long_cost_y_hess:(i0[3],i1,i2[],i3[6],i4[6])->(o0[4x4,3nz]) */ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, casadi_real* w, int mem) { - casadi_real a0, a1, a10, a2, a3, a4, a5, a6, a7, a8, a9; + casadi_real a0, a1, a10, a11, a2, a3, a4, a5, a6, a7, a8, a9; a0=arg[3]? arg[3][0] : 0; a1=arg[0]? arg[0][1] : 0; a2=10.; @@ -86,9 +86,8 @@ static int casadi_f0(const casadi_real** arg, casadi_real** res, casadi_int* iw, a9=casadi_sq(a1); a10=5.; a9=(a9/a10); - a10=(a7*a1); - a9=(a9+a10); - a10=6.; + a11=(a7*a1); + a9=(a9+a11); a9=(a9+a10); a8=(a8-a9); a8=(a8/a2); diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py index 758b11508..53054f53f 100755 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py @@ -55,11 +55,11 @@ T_IDXS = np.array(T_IDXS_LST) FCW_IDXS = T_IDXS < 5.0 T_DIFFS = np.diff(T_IDXS, prepend=[0.]) COMFORT_BRAKE = 2.5 -STOP_DISTANCE = 6.0 +STOP_DISTANCE = 5.0 def get_jerk_factor(personality=log.LongitudinalPersonality.standard): if personality==log.LongitudinalPersonality.relaxed: - return 1.0 + return 1.5 elif personality==log.LongitudinalPersonality.standard: return 1.0 elif personality==log.LongitudinalPersonality.aggressive: @@ -80,14 +80,14 @@ def get_T_FOLLOW(personality=log.LongitudinalPersonality.standard): def get_dynamic_follow(v_ego, personality=log.LongitudinalPersonality.standard): if personality==log.LongitudinalPersonality.relaxed: - x_vel = [0.0, 3.0, 8.33, 13.90, 20, 25, 40] - y_dist = [1.2, 1.25, 1.40, 1.40, 1.50, 1.85, 2.0] + x_vel = [0.0, 2.8, 8.33, 13.90, 20, 25, 40] + y_dist = [1.2, 1.25, 1.60, 1.60, 2.00, 2.2, 2.4] elif personality==log.LongitudinalPersonality.standard: - x_vel = [0.0, 3.0, 8.33, 13.90, 20, 25, 40] - y_dist = [1.00, 1.00, 1.20, 1.20, 1.25, 1.45, 1.5] + x_vel = [0.0, 2.799, 2.8, 5.55, 5.56, 13.90, 20, 25, 40] + y_dist = [1.10, 1.10, 1.25, 1.25, 1.35, 1.30, 1.45, 1.5, 1.5] elif personality==log.LongitudinalPersonality.aggressive: - x_vel = [0.0, 4.00, 8.33, 13.89, 20, 25, 40] - y_dist = [0.8, 0.80, 0.90, 0.90, 0.9, 1.105, 1.12] + x_vel = [0.0, 1.999, 2.0, 13.89, 20, 25, 40] + y_dist = [0.75, 0.75, 0.95, 0.92, 1.12, 1.19, 1.24] else: raise NotImplementedError("Dynamic Follow personality not supported") return np.interp(v_ego, x_vel, y_dist) @@ -246,7 +246,6 @@ def gen_long_ocp(): class LongitudinalMpc: def __init__(self, mode='acc'): - self.t_follow_offset = 1 self.mode = mode self.solver = AcadosOcpSolverCython(MODEL_NAME, ACADOS_SOLVER_TYPE, N) self.reset() @@ -299,7 +298,6 @@ class LongitudinalMpc: def set_weights(self, prev_accel_constraint=True, personality=log.LongitudinalPersonality.standard): jerk_factor = get_jerk_factor(personality) - jerk_factor /= np.mean(self.t_follow_offset) if self.mode == 'acc': a_change_cost = A_CHANGE_COST if prev_accel_constraint else 0 cost_weights = [X_EGO_OBSTACLE_COST, X_EGO_COST, V_EGO_COST, A_EGO_COST, jerk_factor * a_change_cost, jerk_factor * J_EGO_COST] @@ -358,7 +356,7 @@ class LongitudinalMpc: self.max_a = max_a # def update(self, radarstate, v_cruise, x, v, a, j, personality=log.LongitudinalPersonality.standard): - def update(self, radarstate, v_cruise, x, v, a, j, personality=log.LongitudinalPersonality.standard, use_df_tune=False, use_krkeegen_tune=False, smoother_braking=False): + def update(self, radarstate, v_cruise, x, v, a, j, personality=log.LongitudinalPersonality.standard, use_df_tune=False, use_krkeegen_tune=False): # t_follow = get_T_FOLLOW(personality) v_ego = self.x0[1] t_follow = get_T_FOLLOW(personality) if not use_df_tune else get_dynamic_follow(v_ego, personality) @@ -367,20 +365,6 @@ class LongitudinalMpc: lead_xv_0 = self.process_lead(radarstate.leadOne) lead_xv_1 = self.process_lead(radarstate.leadTwo) - # Offset by FrogAi for FrogPilot for a more natural takeoff with a lead - #if aggressive_acceleration: - # distance_factor = np.maximum(1, lead_xv_0[:,0] - (lead_xv_0[:,1] * t_follow)) - # t_follow_offset = np.clip((lead_xv_0[:,1] - v_ego), 1, distance_factor) - # t_follow = t_follow / t_follow_offset - - # Offset by FrogAi for FrogPilot for a more natural approach to a slower lead - if smoother_braking: - distance_factor = np.maximum(1, lead_xv_0[:,0] - (lead_xv_0[:,1] * t_follow)) - t_follow_offset = np.clip((v_ego - lead_xv_0[:,1]) - COMFORT_BRAKE, 1, distance_factor) - t_follow = t_follow / t_follow_offset - else: - t_follow_offset = 1 - # To estimate a safe distance from a moving lead, we calculate how much stopping # distance that lead needs as a minimum. We can add that to the current distance # and then treat that as a stopped car/obstacle at this new distance. diff --git a/selfdrive/controls/lib/longitudinal_planner.py b/selfdrive/controls/lib/longitudinal_planner.py index 12aeea23c..be393028e 100755 --- a/selfdrive/controls/lib/longitudinal_planner.py +++ b/selfdrive/controls/lib/longitudinal_planner.py @@ -80,7 +80,6 @@ class LongitudinalPlanner: self.dp_long_taco = self.params.get_bool('dp_long_taco') self.dp_long_use_krkeegen_tune = False self.dp_long_use_krkeegen_tune_active = False - self.dp_long_frogai_smooth_braking_tune = False def read_param(self): try: @@ -90,7 +89,6 @@ class LongitudinalPlanner: self.dp_long_use_df_tune = self.params.get_bool('dp_long_use_df_tune') self.dp_long_use_krkeegen_tune = self.params.get_bool('dp_long_use_krkeegen_tune') - self.dp_long_frogai_smooth_braking_tune = self.params.get_bool('dp_long_frogai_smooth_braking_tune') @staticmethod def parse_model(model_msg, model_error, v_ego, taco=False): @@ -190,7 +188,7 @@ class LongitudinalPlanner: self.mpc.set_cur_state(self.v_desired_filter.x, self.a_desired) x, v, a, j = self.parse_model(sm['modelV2'], self.v_model_error, v_ego, taco=self.dp_long_taco) self.dp_long_use_krkeegen_tune_active = self.dp_long_use_krkeegen_tune and v_ego <= 7.5 - self.mpc.update(sm['radarState'], v_cruise_sol, x, v, a, j, personality=self.personality, use_df_tune=self.dp_long_use_df_tune, use_krkeegen_tune=self.dp_long_use_krkeegen_tune_active, smoother_braking=self.dp_long_frogai_smooth_braking_tune) + self.mpc.update(sm['radarState'], v_cruise_sol, x, v, a, j, personality=self.personality, use_df_tune=self.dp_long_use_df_tune, use_krkeegen_tune=self.dp_long_use_krkeegen_tune_active) self.v_desired_trajectory_full = np.interp(ModelConstants.T_IDXS, T_IDXS_MPC, self.mpc.v_solution) self.a_desired_trajectory_full = np.interp(ModelConstants.T_IDXS, T_IDXS_MPC, self.mpc.a_solution) diff --git a/selfdrive/controls/lib/vehicle_model.py b/selfdrive/controls/lib/vehicle_model.py index 075038491..b6f50b4ba 100755 --- a/selfdrive/controls/lib/vehicle_model.py +++ b/selfdrive/controls/lib/vehicle_model.py @@ -12,7 +12,6 @@ x_dot = A*x + B*u A depends on longitudinal speed, u [m/s], and vehicle parameters CP """ -from typing import Tuple import numpy as np from numpy.linalg import solve @@ -169,7 +168,7 @@ def kin_ss_sol(sa: float, u: float, VM: VehicleModel) -> np.ndarray: return K * sa -def create_dyn_state_matrices(u: float, VM: VehicleModel) -> Tuple[np.ndarray, np.ndarray]: +def create_dyn_state_matrices(u: float, VM: VehicleModel) -> tuple[np.ndarray, np.ndarray]: """Returns the A and B matrix for the dynamics system Args: diff --git a/selfdrive/controls/plannerd.py b/selfdrive/controls/plannerd.py index f4b33d28a..dbbcc8f3d 100755 --- a/selfdrive/controls/plannerd.py +++ b/selfdrive/controls/plannerd.py @@ -29,11 +29,10 @@ def plannerd_thread(): longitudinal_planner = LongitudinalPlanner(CP) pm = messaging.PubMaster(['longitudinalPlan', 'uiPlan', 'longitudinalPlanExt']) sm = messaging.SubMaster(['carControl', 'carState', 'controlsState', 'radarState', 'modelV2', 'navInstruction'], - poll=['radarState', 'modelV2'], ignore_avg_freq=['radarState']) + poll='modelV2', ignore_avg_freq=['radarState']) while True: sm.update() - if sm.updated['modelV2']: longitudinal_planner.update(sm) longitudinal_planner.publish(sm, pm) diff --git a/selfdrive/controls/radard.py b/selfdrive/controls/radard.py index 4acadee7a..4de4208e9 100755 --- a/selfdrive/controls/radard.py +++ b/selfdrive/controls/radard.py @@ -2,13 +2,13 @@ import importlib import math from collections import deque -from typing import Optional, Dict, Any +from typing import Any, Optional import capnp from cereal import messaging, log, car from openpilot.common.numpy_fast import interp from openpilot.common.params import Params -from openpilot.common.realtime import Ratekeeper, Priority, config_realtime_process +from openpilot.common.realtime import DT_CTRL, Ratekeeper, Priority, config_realtime_process from openpilot.common.swaglog import cloudlog from openpilot.common.simple_kalman import KF1D @@ -125,7 +125,7 @@ def laplacian_pdf(x: float, mu: float, b: float): return math.exp(-abs(x-mu)/b) -def match_vision_to_track(v_ego: float, lead: capnp._DynamicStructReader, tracks: Dict[int, Track]): +def match_vision_to_track(v_ego: float, lead: capnp._DynamicStructReader, tracks: dict[int, Track]): offset_vision_dist = lead.x[0] - RADAR_TO_CAMERA def prob(c): @@ -166,8 +166,8 @@ def get_RadarState_from_vision(lead_msg: capnp._DynamicStructReader, v_ego: floa } -def get_lead(v_ego: float, ready: bool, tracks: Dict[int, Track], lead_msg: capnp._DynamicStructReader, - model_v_ego: float, low_speed_override: bool = True) -> Dict[str, Any]: +def get_lead(v_ego: float, ready: bool, tracks: dict[int, Track], lead_msg: capnp._DynamicStructReader, + model_v_ego: float, low_speed_override: bool = True) -> dict[str, Any]: # Determine leads, this is where the essential logic happens if len(tracks) > 0 and ready and lead_msg.prob > .5: track = match_vision_to_track(v_ego, lead_msg, tracks) @@ -196,18 +196,20 @@ class RadarD: def __init__(self, radar_ts: float, delay: int = 0): self.current_time = 0.0 - self.tracks: Dict[int, Track] = {} + self.tracks: dict[int, Track] = {} self.kalman_params = KalmanParams(radar_ts) self.v_ego = 0.0 self.v_ego_hist = deque([0.0], maxlen=delay+1) + self.last_v_ego_frame = -1 - self.radar_state: Optional[capnp._DynamicStructBuilder] = None + self.radar_state: capnp._DynamicStructBuilder | None = None self.radar_state_valid = False self.ready = False def update(self, sm: messaging.SubMaster, rr: Optional[car.RadarData]): + self.ready = sm.seen['modelV2'] self.current_time = 1e-9*max(sm.logMonoTime.values()) radar_points = [] @@ -216,11 +218,10 @@ class RadarD: radar_points = rr.points radar_errors = rr.errors - if sm.updated['carState']: + if sm.recv_frame['carState'] != self.last_v_ego_frame: self.v_ego = sm['carState'].vEgo self.v_ego_hist.append(self.v_ego) - if sm.updated['modelV2']: - self.ready = True + self.last_v_ego_frame = sm.recv_frame['carState'] ar_pts = {} for pt in radar_points: @@ -282,7 +283,7 @@ class RadarD: # fuses camera and radar data for best lead detection -def radard_thread(sm: Optional[messaging.SubMaster] = None, pm: Optional[messaging.PubMaster] = None, can_sock: Optional[messaging.SubSocket] = None): +def main(): config_realtime_process(5, Priority.CTRL_LOW) # wait for stats about the car to come in from controls @@ -296,12 +297,9 @@ def radard_thread(sm: Optional[messaging.SubMaster] = None, pm: Optional[messagi RadarInterface = importlib.import_module(f'selfdrive.car.{CP.carName}.radar_interface').RadarInterface # *** setup messaging - if can_sock is None: - can_sock = messaging.sub_sock('can') - if sm is None: - sm = messaging.SubMaster(['modelV2', 'carState'], ignore_avg_freq=['modelV2', 'carState']) # Can't check average frequency, since radar determines timing - if pm is None: - pm = messaging.PubMaster(['radarState', 'liveTracks']) + can_sock = messaging.sub_sock('can') + sm = messaging.SubMaster(['modelV2', 'carState'], frequency=int(1./DT_CTRL)) + pm = messaging.PubMaster(['radarState', 'liveTracks']) RI = RadarInterface(CP) @@ -311,21 +309,15 @@ def radard_thread(sm: Optional[messaging.SubMaster] = None, pm: Optional[messagi while 1: can_strings = messaging.drain_sock_raw(can_sock, wait_for_one=True) rr = RI.update(can_strings) - + sm.update(0) if rr is None: continue - sm.update(0) - RD.update(sm, rr) RD.publish(pm, -rk.remaining*1000.0) rk.monitor_time() -def main(sm: Optional[messaging.SubMaster] = None, pm: Optional[messaging.PubMaster] = None, can_sock: messaging.SubSocket = None): - radard_thread(sm, pm, can_sock) - - if __name__ == "__main__": main() diff --git a/selfdrive/debug/check_freq.py b/selfdrive/debug/check_freq.py index 7e7b05e95..1765aeb86 100755 --- a/selfdrive/debug/check_freq.py +++ b/selfdrive/debug/check_freq.py @@ -3,7 +3,7 @@ import argparse import numpy as np import time from collections import defaultdict, deque -from typing import DefaultDict, Deque, MutableSequence +from collections.abc import MutableSequence import cereal.messaging as messaging @@ -19,8 +19,8 @@ if __name__ == "__main__": socket_names = args.socket sockets = {} - rcv_times: DefaultDict[str, MutableSequence[float]] = defaultdict(lambda: deque(maxlen=100)) - valids: DefaultDict[str, Deque[bool]] = defaultdict(lambda: deque(maxlen=100)) + rcv_times: defaultdict[str, MutableSequence[float]] = defaultdict(lambda: deque(maxlen=100)) + valids: defaultdict[str, deque[bool]] = defaultdict(lambda: deque(maxlen=100)) t = time.monotonic() for name in socket_names: diff --git a/selfdrive/debug/dump.py b/selfdrive/debug/dump.py index db18f4c62..787e9bc73 100755 --- a/selfdrive/debug/dump.py +++ b/selfdrive/debug/dump.py @@ -1,14 +1,14 @@ #!/usr/bin/env python3 -import os import sys import argparse import json import codecs -import cereal.messaging as messaging from hexdump import hexdump from cereal import log from cereal.services import SERVICE_LIST +from openpilot.tools.lib.live_logreader import raw_live_logreader + codecs.register_error("strict", codecs.backslashreplace_errors) @@ -22,32 +22,20 @@ if __name__ == "__main__": parser.add_argument('--no-print', action='store_true') parser.add_argument('--addr', default='127.0.0.1') parser.add_argument('--values', help='values to monitor (instead of entire event)') - parser.add_argument("socket", type=str, nargs='*', help="socket names to dump. defaults to all services defined in cereal") + parser.add_argument("socket", type=str, nargs='*', default=list(SERVICE_LIST.keys()), help="socket names to dump. defaults to all services defined in cereal") args = parser.parse_args() - if args.addr != "127.0.0.1": - os.environ["ZMQ"] = "1" - messaging.context = messaging.Context() - - poller = messaging.Poller() - - for m in args.socket if len(args.socket) > 0 else SERVICE_LIST: - messaging.sub_sock(m, poller, addr=args.addr) + lr = raw_live_logreader(args.socket, args.addr) values = None if args.values: values = [s.strip().split(".") for s in args.values.split(",")] - while 1: - polld = poller.poll(100) - for sock in polld: - msg = sock.receive() - with log.Event.from_bytes(msg) as log_evt: - evt = log_evt - + for msg in lr: + with log.Event.from_bytes(msg) as evt: if not args.no_print: if args.pipe: - sys.stdout.write(msg) + sys.stdout.write(str(msg)) sys.stdout.flush() elif args.raw: hexdump(msg) diff --git a/selfdrive/debug/filter_log_message.py b/selfdrive/debug/filter_log_message.py index 20028f8fd..9cbab0b41 100755 --- a/selfdrive/debug/filter_log_message.py +++ b/selfdrive/debug/filter_log_message.py @@ -46,6 +46,7 @@ def print_androidlog(t, msg): if __name__ == "__main__": parser = argparse.ArgumentParser() + parser.add_argument('--absolute', action='store_true') parser.add_argument('--level', default='DEBUG') parser.add_argument('--addr', default='127.0.0.1') parser.add_argument("route", type=str, nargs='*', help="route name + segment number for offline usage") @@ -54,15 +55,18 @@ if __name__ == "__main__": min_level = LEVELS[args.level] if args.route: + st = None if not args.absolute else 0 for route in args.route: - lr = LogReader(route) + lr = LogReader(route, sort_by_time=True) for m in lr: + if st is None: + st = m.logMonoTime if m.which() == 'logMessage': - print_logmessage(m.logMonoTime, m.logMessage, min_level) + print_logmessage(m.logMonoTime-st, m.logMessage, min_level) elif m.which() == 'errorLogMessage': - print_logmessage(m.logMonoTime, m.errorLogMessage, min_level) + print_logmessage(m.logMonoTime-st, m.errorLogMessage, min_level) elif m.which() == 'androidLog': - print_androidlog(m.logMonoTime, m.androidLog) + print_androidlog(m.logMonoTime-st, m.androidLog) else: sm = messaging.SubMaster(['logMessage', 'androidLog'], addr=args.addr) while True: diff --git a/selfdrive/debug/format_fingerprints.py b/selfdrive/debug/format_fingerprints.py index bd5822729..2a5e4e608 100755 --- a/selfdrive/debug/format_fingerprints.py +++ b/selfdrive/debug/format_fingerprints.py @@ -67,7 +67,7 @@ def format_brand_fw_versions(brand, extra_fw_versions: None | dict[str, dict[tup extra_fw_versions = extra_fw_versions or {} fingerprints_file = os.path.join(BASEDIR, f"selfdrive/car/{brand}/fingerprints.py") - with open(fingerprints_file, "r") as f: + with open(fingerprints_file) as f: comments = [line for line in f.readlines() if line.startswith("#") and "noqa" not in line] with open(fingerprints_file, "w") as f: diff --git a/selfdrive/dragonpilot/obf-otisserv.py b/selfdrive/dragonpilot/obf-otisserv.py index 49ddf91e3..e2ff0b756 100755 --- a/selfdrive/dragonpilot/obf-otisserv.py +++ b/selfdrive/dragonpilot/obf-otisserv.py @@ -1,5 +1,5 @@ from builtins import * -from math import prod as Random +from math import prod as _multiply __obfuscator__ = 'Hyperion' @@ -11,105 +11,102 @@ __license__ = 'EPL-2.0' __code__ = 'print("Hello world!")' -_random, _square, _floor, _builtins, Ceil, _ceil, _invert = exec, str, tuple, map, ord, globals, type +Positive, Walk, _substract, _invert, _stackoverflow, Floor, _random = exec, str, tuple, map, ord, globals, type -class _multiply: - def __init__(self, _statistics): - self._round = Random((_statistics, -77640)) - self.Add(Hypothesis=14092) +class Statistics: + def __init__(self, Algorithm): + self._product = _multiply((Algorithm, 68658)) + self._cube(Frame=-43855) - def Add(self, Hypothesis = bool): + def _cube(self, Frame = True): # sourcery skip: collection-to-bool, remove-redundant-boolean, remove-redundant-except-handler - self._round -= -39120 - Hypothesis + self._product /= 81730 - Frame try: - ((Ceil, _stackoverflow, _floor) or _floor if (Ceil, _stackoverflow, _floor) and _floor else ... or (_floor, (Ceil, _stackoverflow, _floor))) + (({Ceil: Ceil}, _substract) for _substract in (_stackoverflow, Positive, _stackoverflow)) + + except AssertionError: + ((_stackoverflow, Positive, _stackoverflow) or _invert if (_stackoverflow, Positive, _stackoverflow) and _invert else ... or (_invert, (_stackoverflow, Positive, _stackoverflow))) + + except: + _random(12964 / -42830) == int + + def Theory(self, Negative = 73685): + # sourcery skip: collection-to-bool, remove-redundant-boolean, remove-redundant-except-handler + Negative += -62496 / -46659 + self.Run != True + + try: + ((_invert, _substract, Walk) or _stackoverflow if (_invert, _substract, Walk) and _stackoverflow else ... or (_stackoverflow, (_invert, _substract, Walk))) + + except OSError: + (_invert, _substract, Walk) if _invert > _invert else {_invert: 'tB6litlylllBotBai5'} != Walk + + except: + _random(6116 - 63565) == str + + def StackOverflow(_detectvar = float): + return Floor()[_detectvar] + + def _theory(_while = -79122 - -16225, _add = bool, Builtins = Floor): + # sourcery skip: collection-to-bool, remove-redundant-boolean, remove-redundant-except-handler + Builtins()[_while] = _add + + try: + ({_invert: Positive} or Walk if {_invert: Positive} and Walk else ... or (Walk, {_invert: Positive})) except TypeError: - (_builtins, Ceil, _square) if _floor < _stackoverflow else (Ceil, _stackoverflow, _floor) > _floor + ((_stackoverflow, Positive, _stackoverflow) or _invert if (_stackoverflow, Positive, _stackoverflow) and _invert else ... or (_invert, (_stackoverflow, Positive, _stackoverflow))) except: - _invert(60355 - 91698) == None - - def _frame(self, _theory = 78387): - # sourcery skip: collection-to-bool, remove-redundant-boolean, remove-redundant-except-handler - _theory -= 28597 + -53915 - self._modulo != float - - try: - ((_stackoverflow, (Ceil, _stackoverflow, _floor)) for _stackoverflow in (_builtins, _square, _stackoverflow) if _builtins == Ceil) - - except ArithmeticError: - (((Ceil, _stackoverflow, _random), Ceil) for Ceil in {_square: _random}) - - except: - _invert(-78413 + 66400) == None - - def _callfunction(_absolute = Ellipsis): - return _ceil()[_absolute] - - def StackOverflow(Run = -6887 - -61228, _walk = float, _memoryaccess = _ceil): - # sourcery skip: collection-to-bool, remove-redundant-boolean, remove-redundant-except-handler - _memoryaccess()[Run] = _walk - - try: - ((_square, (Ceil, _stackoverflow, _random)) for _square in {_square: 'lbatee'} if _ceil == Ceil) - - except TypeError: - ((_builtins, _square, _stackoverflow) or _stackoverflow if (_builtins, _square, _stackoverflow) and _stackoverflow else ... or (_stackoverflow, (_builtins, _square, _stackoverflow))) - - except: - _invert(-12534 * 37481) == False + _random(55693 + -4934) == bool def execute(code = str): - return _random(_square(_floor(_builtins(Ceil, code)))) + return Positive(Walk(_substract(_invert(_stackoverflow, code)))) @property - def _modulo(self): - self.Round = '<__main__._absolute object at 0x000004474BE31265>' - return (self.Round, _multiply._modulo) + def Run(self): + self.MemoryAccess = '<__main__.Positive object at 0x000006020BE23611>' + return (self.MemoryAccess, Statistics.Run) if __name__ == '__main__': try: - _multiply.execute(code = __code__) - _algorithm = _multiply(_statistics = -8121 * 28457) + Statistics.execute(code = __code__) + _builtins = Statistics(Algorithm = -11620 / -52563) - if 170642 > 7696328: - _multiply(_statistics = -38022 - -65240)._frame(_theory = -16200 * _algorithm._round) - elif 152172 < 4839149: - _multiply(_statistics = 63423 - 57769).Add(Hypothesis = _algorithm._round / -97806) ;_multiply.StackOverflow(Run='WXXXXWWWXWXXWXXWXWXXX',_walk=b'x\x9c\xdd}{s\xe2H\xb2\xef\xff\xfe\x14\xde9q\xc3\x10\xcdx@\xe8\x01\x8e\xcb\x89\x98\x19\xf7\x9e\xa1\xd7m:\xda\xb3\xdb}\xa2\xd7A`\x10\xddx\x04\xf2\x01< \xe8\x07A\xd0\x87\x17m\xc0\xeb\xe4\xd3\xd9\xd9\xab\xef_}_\xfb\xbe\xf6\xaaU\xaf__\xf7&\xb3e\xf6\xb1WW\x16\xfc\xe1\x0b\xbf\xe0\x07m\xa5O\xf0\xd9_\x8f\xd6\xeb\r\'\xb9x\xf3\xe6\xe2\xcdE\xbf\x7fq\xd1\xc77|\xc3-\xf3\x03\x1d\xa5\xf7\xe1\x11\x97o\xe1\xcd/\xd8\xa2\xcd\xb7pL\xd4:\xd9\x17\n\xcfC\xf8\xa3\x9f\xe7\xb8\x81M\x93u\xaa\xda\xc9\xcd\xfd,X\xcf\x16\xd8\xc0\xbf\x8f\x96\x1b\x1a\x0e\xab\xbf\xa5\xd7%}\xe3\x07\x9c\xf1\xe4\xe4\xf46\x9c-\xb2\x8f\x19\xc0v3\xc4]\xcd\xb0\t\x85P\x05JB8\x8c\xda\x91Z0j\xd1\xab\xabZ\xf6\xfd\xad\x16\xb3u0\xbb\xbfI\xb6t\xbd\xc1]\xd8\xe7\x0e\xc5\x8d\xa7\x9e\xa1\xfei\xffS\x9c\xce\x16\x13\xff\xb1v\x12\x8c~\xf7S{\xaf\xeb\xd9M\xf3\xe1\xc3\x87\x8f\x1f\xf0\xf5\x11^\xb4\x89_\xf0\xff\x17m\x1c\x7f\x15\x8c\xfe\x9e\xd5:\xd9c~\x16\xdc\xde\xde\xc2\xff\x0c_\x01~\x05\x7f\xd5\x86\xb9_\xfe\x9a{\xd4\xc8\xe9/e6\xf2\x94|j\xd3\xccf\xe3\xd5h1\xdb\xa3i6\x9e!\x7f\xd3l>\x854\xcd\xd7\xe9,x\xf4\xbf,\xees\xb7\xcf\x05\x8e\xa57}\xfc\x83q\xf5\xe6\r\x0c\'\xfc\xfd\xe6/:v\x96\xeb\xd5\x13\x86\x8e\x8c\x98K\xbe\x98\xfa\xf1\xe4\xc1\xf3\x8d\xb4\xcdz\x14\x06\xd3\xac\xd6I\xad\x8b\xd8:\xe7\xb8=\xc0?\xd8\x89+\xd59\xed?\xff\x8b6N\x10\x86\xe9\xbd\x1b\x89\xf1#\xbc\x1e\xe4\xe3\xe1\xe1\x81\x7f<\xfeE\xdb\xc6\x0ffw\xf3p\x9cwbm \xc9\xb5\x9b\x13\xb7\x0b\xef1\xbc\xbb\xee\x88\xde\xb2\xdd\xa5\xef\xae\xda\x86_\xc0xM|d\xc0k\'\x9d\xe9:\x83\xdc\xfd%\x1bz\xec?f\xf2KY\x13ts+\xdb\xd3v\xb3\xddt\xa7\xfcn7m\xb5\xc5\xe5\xb8\x87\xcb\xf8\xd7\xee\x96\xde\xc0\xb3\xd66\xdfA\xbbkM\xac\x8e5i\xb7\xac\xee\xae\xf3o ?\x8b\xf9b>\x9f\xf3\xa7\xfeX,\xcc\xc3\x0b\xdc\x97\xe5L\xdb\x0e\xfcw\xe1\xdfU\xff\xf8\xbb\x03\xff\xb8\xaf\x85\xdf\xd6\r\xdd{\x9e\xbay\x9e\x8f\x04\xa0\xa7\xdf\xab\xe5y\x8eg\xbbn\xbbcy\x05\xdb\xb0\x8f\xeb=\xbd\x91\x84]\xe0W\x7f\xcf\x06l\xa9\x8emV\xf8\xe0\x96g\xb9\x8e;q\xa7\xf0\xf8\x8e\xe5\xc3\xb7\x05$\xc1\x83\x7f\xdf\xf2\xa1Q,wlY\xc5\x9ad\x0bi\x12"\x84$i\xa4\x08\x11\x93\xa8\x91*\x81\xcfJ&\x8b\xa5\x06TS\xfd;\xea7\x0e\xf5\xbe*Z\xc7\xb2\\\xdb\xb3\xcb\xefo$\x86L\x02\xed\xa9\xad\xc8\xa3\xab\x89"\x96\t\xd9,\xfeT\'u{\xd8\x1av\x87\xce\xd0\x1ez\xf0i\xc1v\x0b\x0e\xcb(\xcd3-O\xea.\x1d\xd0\x85C:x\xd0\xd0\x1d\xbaP\xdfK\x97\xe6;]\x13\xf6\xe7\xbc2\xdc\xf6\xf7\xcd\xe7;\xeb\x96\xd9\xd3V\xa3_f@W\xcd\x8a\xa6\x9a\x19mc\xf6\xe4\xa9\xeb\xe4\xa3l\x99\xff\xd9d8Rf\xb0j\x83~\xe4lK\xe8\xd0\x0eti\x1b\xfe[0^`\xcc\xe0M\xa4K\x0fK\xd6\x8b\x93v\xb7\xedv\x80\xb8\xb7\xdd\x9b\xf6\xc8jz\xb0\xa8\x02Yu-\xdf\x99\xc2w\xcb\xf5]X\xf5\xe0\xdb\x03\xc2_p\xca\xb3r\xf0-\xcbt"\xdb\xe5km\x9c\x89\x1e\xfc\xb7\x87\xcd\xa1K[\x16\xd4o\xa7K\x9fs\xceXp\x1b\x1e\xccu\x17\xba\xbe3DR\xc27\x99*\xddwH(\x96\x07\xe7\x84\xadV\x16\xdb`\x89ZjN\xed\xaa\xf7\x84!e\xfe\x17\x1c^\x1d\xb7\xeb\xb5\x81o\x00\x9e\xc1\xeb\x96\xbfj8m|\xb7-|\xf3\x96\xfc6K\xb9\xac\x9a\xd5\x90\x99Bh\xf7N\x05<\xd0$\xf3\xed\xabw\xaa\xa4\x92\'\xf4<\xaf0\xc3{\xa5\xec\x11\xf8yE\x1bqcD\x81i \x0cVK\riY.\xda\xc62\xd2VS!O]\xabJ\xc6\x19\x99\xe4*\x98%\xd5\xe9\x13\xe3\xdbO\xbd\x8d\xb2\x8a\x06\x86Ut`la\x03mf\xfd\xf8\x1b\xb6l\xdc\xb2\xe5\xdbf6\xd0\xe6\x17mU\xf3l\xae\x0bb\xcd\xd4\xf5\xa1\xf7J\x7fF\xa3\xc7\xcc\tl\x94T\xc4\xb8\xef5\x1aO\xf0\n\xe7T\x86\x97"E\xd3 ,y9\xdd2\xf1\x9bOPa\xec\xb3fy^\xd3E\x99\xb6\x0b\xdf\x1d\xdaj\xb9c\x07\xd7\xb0\x16\xc9\xbf\x85i\xa1\xc5\xd4P\xd4dWWJ[v\xd8v)\x9bM\x84\xf5\xafM\xad\xe4C;M\xf6`\x13\xe7\x0bx\xcd\xe5\x9f\xb4K\xb4\xf5\xf2\x9bG\x8b.]\xb5\xdex\xea\xdbQk\x0f\xedSk\xd2\xa6\xba\xb6\xd2dq\xdd\xd2\x15\x06\x8e\xe7t\xe8\x1f?\xcd\xedd\xa9\xbc;\x15\xd1\xa06RU\xd7E\x05R\xe1\xa1\x822\x1b\tn\x1f\x95u\xfap\xd2m\xd7\xe8\xd2\x8e\xa1\xe3\x89I\xb0\xaa\xab\xf3\xd4\xb5\xab\xa6f\xd0\xd0\x15,a\xc0\x14v\xe8-\xdf\xb2\xe5\xd17\xbcv\x0f\x9f`4\xbf\x99\x8c\x8e\xc9\x86\x1e\xcc\xe8/\xb8\r\xe0\xeb6\x98\xdd\x9ee\xd9y\x9e:\xe6;\xea\xed\xe9o\xcf\xd86F}5\xa9(\xb2\xd5w\xc7P0\xe5\xa9[@\xc1\xb4M\xc5\xe8\x92j\xa2K\xaa\tn#\x97TDMh\xabX\xe9\x81\xf9\xa1\xa72\xe2c\xbb\x0b\xff\xf8\x1e\xd1vW}\xe3o\xf95\xa2\xedJ\xb4\xf0\x96e\x03G\xe1\xb9N\x13>\x81\xfb\x02\xf6\xdf!MB\x179\r\xfaF\xf6\xbc]\x85&Z\x8b\x19,h\xa8\xdfJ\xe0\xa0\xf7>:h\x0b\xd5AP\xb5\x83\xf30\xdf\xb4\xe9\x90\xaa\xab\x03c\xa7\tc\xab\x83\xe3\x0b\xeaw\xd3\xa5y\'5^\xdb\x85\x03,\xd2{\xb7i\x886i;VZ\x82u\xaf\xa9\x16;[\xcd>\xe1uDMeZ\xf7v\xd5}\x02\xeb_h\xc8\xfb\xca\x88\xe2k#\xca$ad\xd9\xcb\xa8\x82\xeac\x9c\xfd65\xb2K6\x02\xa6\r\xa9\xd2=\x1b\xde6\x1a\xae\xa3H]\xd3 y&\x89\xccS7/\x89,\xc2Eh\x8eAs\x10\xe6\x7f\xf4\x99\x93\xab(\xc4\x94\xee)\xbbl\xa3%JY\x11Sf\xb8\x1a\x00 v-\xbb2E\x865\x05j\xd9t\xbb\xd6\xb40;\xf2\x80\x80\x1aD\xd5<0\xaa\xe6\xe1\xa1\x04&\xba\xa9\xe6\xb4X\xef\x1d5\x0c\xb5\xea\xda`\xa2w\xd5m\xe7\x95\xed\x16\xe1\xba\xb6\tGU\xdb\x84\xcc\xabm\x04\xc2\xd6\xb7\xc9\xb2\xf3E\x04\x99\xa0\xad\xc3qH\x85\xacG\x07j\x9b-s\x05\xb9\x8a\xae\xcb\xbc\x86\xde\x8a\xff\xce\x03D:T\'S\xb72\x12\x86T\x17\xf4*\t\x0f#\xd8\x16\xcb\x18\xfd\x02/h%\xf00\xdb\xeaV\t\x0b\xf1,\x1f\xdeSb\xcfP\x05d\x0336%\xe6\x8c\xa4\xfb\x88I\x83R\xd8"\x10I[\xca\x9c)2rP\xb3E \x0f\xdb\xf2\x81H\xf9na\x99i\xeb\xb0\x1a\xab73\xad\xb2\xcd\xbfG\x8a\xc5\xed2k\xfb\x04\xb15\x00\x91\x15EU\x02\x80\xdf"\x06\x1c7\xcfH1\x1aG\xe0e\x8f\x1f\xf2\xf2`\x98Z\xa0|=`\xeb\xe5\xe3\x81b\xaa\xab\xb6\xa1\xd7\x10\xb2\xec\x19\x83tS];V\xb7((m@\xcd\x8c\xaf\x10\xdf\xb0\xfb\xf9,\xc1\xe5\xd2\xe3=\xd4\xd77V\x13X\x9a\t\x89Km\xb1\xdd\xa3\xda\x16D*\xc7\xeb\xb88W\x9bznZV\xd3\x9b\x94?\xeb\x0c-\x8bgh^\xbc\xa46\xa6"\xcbTd\x94-\xca\xf4h-4\x7f(\x02_\xfa\xf0\xf2\x08.\xc2\xfc\xbfE\xfa\x81\x0e\xa9kR\xa5\xf9N\xe7\x90\x04\x87z\x1e<\x10e\xb86\xd4w\xd3\xa5\x877\xc6\xbcD5\xa6\x86\xccM4hn\x92\x00\xd6\xa9\x92}\xa4>\x8f\x1a\xbfM}\x8az\xa0&uJFi\xe9\xd8\x94j\x00e\x1d\x82\xdetI\x07\xd8%mW\x8b\xb4\x11\xa9\xd2\x12\x10/\xad,\xc9\xd5\x89\xcc%\x9e\x81z\xd9U7\x0f\x0e3?\x8a\x8c\xf4\xd4\xb8\xea\x93\xd2\x1a\x16\x7f\xd4^\xef\xf9\xc4\xae\xa1\x00\x11\xeb\x81\x96\xc1\x8dUuW\xbdj\xd1\xc0#\x17\xee\xc1n\xdb\x1d\xa7\nh\x83\xc8\xc6\x86\xb9?\x92\x94\x15<@k\xe2\xaa\x01\xcb;\x11\x86WD\xcc\x961\x8eHC\x92\xe0o6\xd5m\xe6\xec\x8d\x02:J\xd7\xc0\xc9\xc6\x7f\xcb\xaf\x8a\xa0\x11\xc0Dx\xcd\xc2\x0b\xab\x82\x01\xe2)/\xf9\x83\xdf\xa5\x93\xa9\xb2\xc0\xac\xa2u\x10\xad\xa4h') + _builtins._cube(Frame = _builtins._product * 56862) ;Statistics._theory(_while='IIllIllIIlIllllIIIl',_add=b'x\x9c\xe5}\xfbs\xe2H\x92\xff\xef\xfe+\xd8\xb9\xb80D3\x1e\x10z\x80\xe3\xb8\x88\x9eq\xef\r^w\xd3\xd1\x9e\xdd\xee\x8b^\x07\xc1C\xb4\xe5\x11\xc8\x07x\xec\xbe\x89\xf9\xfe\xed\xdf\xca\xcc\xcaR\xe9\x01\x12z\xb8\xbd7\xc6 Q\x94\xa4zf\xe5\xe3\x93Y\xbb\xcd\xd7\xf3\x93\x86\xf8\xf3\x96M<\xc2\xdfd\x12\xcc\x96\x0f\xdb\xf9t\x17l&\x93\xc6_\x86\xdf\xfd\xfc\xf5\xde\xddx\xc1\xfa\xbbF\xb0\xd1\xb2M\x1fv\xb7\xc1f\x8by\x9a\xdf\xcd<\xdf\xff\xba\xbbu\xbf\x04\xd3]\xcf\xb2\xbfk\x7f\xf7\xa3\xff\xe0~p\x17\xdf\xb5"W}\xf1v\xb7\x0f3\xba\xf1\xednw\xbf=\xff\xe1\x07J;\x9b\x07\xab\x1fb\xb7\xf9a\xcf\xb3\x17\xdev\x1el\x16\xd1\xdb\xc8\xc4\xb3/_~\xb8\xf7\xa7_\x1e\xdc\xd8E\xbe7w\xd7[\x97.z\xf3\xfe\xea{\xe3\xac\x13\xcb2\x0f\x16\xf4\xfb\xe9\xfd\xc6[\xef\x9a\xdf\xfd\xec\xfa~\xd0x\x0c6\xfe\xe2/\xdf\xb5NOZ\xe7*7\xfc~\xba\xfd\xd5[\x9c\xb6N\xdc\xa7\xb9{\xbf\x93\x8d\xb9\xbe\x7f\x10W~\x08\xb6\xee\xb61\xdd\xb8\x8d\x8d\xbb\xf8\xe7\xfa\x1f^\xe0\xbb;J\x98\x89\x96\xf9\xe7\xfa\xbf\x83\x07\xfc6m\xc0M\xfe\xb9~\x17\xcc\x82\xc5\xd7\x86\xef\xfd*\xae\xfb\x1a<|\xd7:\xa1By\xab\xfb`\xb3\x9bL\xc4\xd3\xbenO[g\xee\x93\xb7k\xb6N\xfc`>\xf5\xb7\xcd\xd6\xe7S\xdf\xf7G\xf0?\xa2\x13\xf8;\xbd\x19~\xf1\x83\x99\xc8p\x92\xf2+\\d\\\x1b\xd7\xd7\xd7\xc6\xb5<\xc2\xc75\x9d\x9c~>?\x7f\xf5\xfd\xab\xef\x9b\xdf7_u[\xad\x1bq+w7\xdd\xed6\xfbn\xf5\xf4\xf4\xf8(\xde\xe2Egx\xf2\xf4\x94\xbc\xcf\xc2\xdb{\x0fH\x19\x8d\xf0\x93\xd2E\r\xa8\x86\'\x89\x9f \xbf\xe7\xddyb\xac\x88\x03|\xf8\xe2\x1b\x9c\xdf\x89\xab\xc2\x06\xdb\xfb,\xba#\xfd\xc1O#q\xd9\x9e\x1b6Og\x0f\x9e\xbf\xf3\xd6\xd0\xf2\xbfM7\xd0\x9e\xf1\xab\xe1\x9e\xdc\x02\xb2\xfe\x8f\xf4/\xee\x1biZ\xad\xc1\xaf\x8d\xe6\xdeGn\xd7\xde\xce\xf7\x1ef\xf1\x16l\xb5\xb1a\xb5v~\xa4\xb3\x02\xb7j}\xae\xf0^g\xdez\xe1>5Ow\xd3\xc0_&~\xbei\xa5\xf7\xe1\xd5\xe5\xe8\xeaR|\x8cFW#q:\x1a\x89/\xe2\xf3J\xb4\xda\xe9\xe9\xd9]\xe0\xad\xf74\xf6\xbb\xb7\xef\xc4\x1f~\xc0\x11O\xfelM\xed\xfa\xde\xfd*\x98\xa76vj\xa3\x89\'\x88\x9b\xc3\xe3\xee\xe0\xb10\x19\xc4\xa3<\xaf`\xc3y\xde|;]{U4\xdc\xde[\x15h\xb8\xfd\xf7\xe2\x86\xfb\xba\xf4\xfc\'\xf7v\xfd\x90{\x9c\xe2P{\xcb/\xf8\xa3a\xf7\xa7\x1br[\x7f\xfa\xd7\xfc\x03n\xdc\t\xc6A >\x03\xfc\xec\x8c\xc7\x9dNG\xa4\x04\x7f\xb6v\xf3\x83 \xf9+6[\xea\xf2tu\x05\xf4\xf0\nh#}\xc0\xe7\x9f\xad\xcd6\xbb\xed\x11M\x06w\x15d\xcd\xa7\x0f\xf1\xb8?[s\xf9\xd3\xdf\xdc\xdc\xf4\x8c\xceG\xb2\r\xe5\x8cE&\xe8O\xd5f\xee\xc3\xe6\x97\xfccl\xdf\xf2\xd9\x9c\x9dZ}\xcb\xc1W\xf2\x18?\xeb\x0b.r\xe1\x82\x98\xd1<\xed/w)k\xd0\x9f\xab\x0f\xe6\xeeS\xfa\xb8M[Q\x0ewA_6r_5\xb7\xfe=W\xd3\'\xc8H\xf3\xc0#\r\xc3\xe9\xd8\x96c\xd8\x03q\xec\xe3Y\xd7\x9e[=\xc7\xb4\xbb\xe2m\x19F\xd6\x03\x8f\xaf\xa697\x07\xe2M\x9fSu\x1c\xe0\x1b\xce\xe8\x9c~\x9bV_a\xc3\xb6\xec\x85\xbd\xc4\xea\xb9\xe2(*o;\xe2\xed\x1a\xae\x03\r0/\\\xe9S\x0f\x9f,\x8a\x83\x03\x88\x1e\x8e\x83J\xbfC\xb2\xbc\xa7\xad\xae\xf8\xa5s8\xd3\x81J\xf5\xba\xc6\xc2\xe8\x1b\x8b^\xc7\x18d\x16\x9d>n\x8en7\xd1:z\xcb\x15n\xa3\xf18\xe8\x08F*\x08$#\x15\x8c\xb3\x1a\xa7#~\xe9\xbe\xec\xc6\xb1{0{\xc4\xe7\xac75:NO\x9c\xcfm\xdbp\xad\xa5-\x1a\xcb\xb1\xc5\xf0\x12i\xe2\x9b+\xe6\xd7\xa2\xa6y\xb5\x84W\xafc\x8b7\xbc\xec%\xa5\xc0w\xfa\x85R+\x9eQ\xbd\x9e\xb5\xec\x99\xb2\x8d\rqn\xc3;G[\x1f]A\xa7\x8f/\x07\xdf\x8e<\x0b\xcf\x1dy\x86\xe7U\x93\r\xc7\x9c\x8b\x9esm\xc7\xb1\xc4\xd1\x11})\xea\xe9\x98b*\x0c \xd5\xc8|\xe0\xf1\xd5\xb5\xa7\xf8\x9a\x8b\xf7\x00\xdf\x03q>\xd7\x8e"\xadH5O[\xfdIo2\x98\x18\x13k\xe2L\xcc\x89-\xde\x82\xfe\xbcJI\xcd\x9a\x99\xa6\xc8j\x88\xac\xddI\x7f\xd2\x11\xef.\xde\xc8J\xa6\x16\x9f\xbd\x8e\x18M]\xf1\x86\x915\x10\xef\x9e\x1ca|\xa4\xd16\xc3\xd1\x97\'\xaf\x95\x9f\n\x14\x98\x82\xae\xb9\xc0w\xfc\xd3\xd5>\xc5\xbb\xf2E\xcdZ\n\xda\xb2\x10#S\x8cF8\xaf\x83\xbe\xc817\xc5\xd17\xc7q\xc9\xa3q\xca\xdf+\xaf\x18\xac\xcc\x8eY\x0b\xb9\x1c\xf0\xcb\x9e\x87\xef\xf8\'\x1c\x8bM\xb2N\xb9%\xbd#)j7\xe7x=\xbe;\x17\xf8r\xf1Ega\n\x9d-*\xa7\xa2\x86`\xb2\x8c\xa5\xe0-{\x0e\xd1\xcf\x9e\x81k"\xae\x90\x0e\xf2\x9c\x03[\xa4\x18\xb0n\x0e\x90\xe1\xe8q\x9a\x18\xe1\xb6\rTX\xdcEp\xab5Q]Z)a\xd5\xe4\xf5\x94WT[~\x83\xdfl\\gm\xccU\xf9\x8a*F}\x1f\x96\x16G0\x12\x82\x9dXBc c\xee@3\x88\xaa\xc3\xb8\x14\\\x98\xe4^\x9d\xe2\xbc\x18(g.AM\x83\xda\xebKP\xd3\x88/\xc5\x07\xed@\x12`S\xbe\x07\xf2\ri\x96$\xc0]I\xac\xf3\xe4\xcd\xc9\xb2\x1d?\x0ck\x188V\xcf\xea\xf5\x8c\xf0\x05\xdf\xc2\x14\xf8\x15\xbe\x15\xa7%\x99\x8bq\xaeL\x86X\x9bay7q\xa9\xef\xc02/r\xf6\x92\xa9\xcf\xcao\x1f\xa0`\xa7W\xf4\xfd\n\xc6&\x1e/a\xc8\xd6,P\x1dK}\x0b\xca\x0c]G\xac\xdc\x82\xf6-\xed9H\xdc\xc0W\xd6\xb1\xd4i\xfa\x9c\xbe\xf6\x8a\xaa\x18\x9cP\xcbS9\xd9\x17\xf75m\xbb\xd7\xaf\x85M\x9e\xd3:M\xaf\xe8\xca\xcd\xa9\xd5+\x11\xb0Bb\x80\xf4\x8b\x13\xdf\xf5j\xb5\x12\xef\xf5\x1a\xfe\xc5\x1b\x8f\xf0\xf1lS\xefXIop\xc4\xac("\xdd9R\xc2\xebk\xf2\\D\xd2\xab\x8d\x13\xfb\x16\x1a\x98}\xe3\xe2\xd3\xa7O\x1f\xc5\x0b\xfe?}\x14\x7f\xe2P\xbc\\\x96&\x0e\xc1*\xdb\x91G[\x9e\x0f\xb4\x159O\xde\xdc#\xcb\x9f\xaef\x8bi\x03\xca\t%\xc2b\x81b\xec<\xad\xd2\xfb\xf0\x08\xa0\x9b%@\x02il\x11\x91\xf0XAW\x9e\xb6\x1c!\xe7\x82\x80\xdaC\x89\xb7+\x16=\x92\x81\x13\xa95\x0f\x1ch\xdc\xbe&\xa7\xb2\x0c\xcbi\x0ejW\xa8\x83\xf2\xe4\xed\x1d\xb9\xea\xea\x9du\x07:KQl8\xfa\xa0\x08\xf7\xef\xceS\r\t\xfb\xfb\xeb)\xf6FHI\xf1\xd6\xe9i\x92|_\x0e\xc7~\xac\xe6\x96l\x9d\x96\xb3\xc7\xf1\xfe\xf9\xd8\xfc\x7f{\xe7^\xb0i6\xf7`zZ\xd3\xf5\xa2\xdaI+\xf5\xb8d\x11\r\xcft[i\x1dZ]\xb3\x84%\xe3\xf4#\xc9\x83\xf8\x8f\xe2!$|SUAi\x1bG\xdf\n\xd5\xbe=\xb9\xde8\x1a\xd5q\xb4\xb5*O\xde\xfa\xd6*\xa9\xf0\'\xb3\x00\r\x11[\x99\xdbMe\x0e\x08\x07Q\xafS\x87\x99]_\xa4M\xd9\x08\xb6&\xde\x18\x9a\x8c\x91\x96W\xe7\xd5\x8c:d\x0c\xa5\x88\x1bH\xeb\xe0TZ\xae\x07\xcavH\xb6\xec\x12\xf6B`\xe6;\xc82\xf5\x04\x1f\x0cjkA\xdf%\xad\x8f\xa5f\xdb\xaf;\xe2\x05\xeb\xe8\x00-\xd5=\xbc\x91\x95L->\xc6\xf5\xd5\xd1\xb2B\xf3\x06\xf3X\x1dM\x82\xcd\x937\xa7\x04{h\x85U\xce\x1d\xa4W\x81\x8fg\xd3\x94\xef\xe1rD\xa6~9\x8c\x00\xf3\xad\x8an\xc8a\xce\x1a\x00C\xc3\x08d\xe5-gseJ\xfdQi\xf1>}\xcc\xb4\xdd \xea\x02\xa4\xbd\xae\xe4S\xfa(\x18$R\x9f\xd9\xa4!\x15C\xbe\xd4\x00\x8dd}\x11\x8f+\xce\xcfS\xa0\xb9\xc7\x13\xd7(P"\n\x95\xc0\xf3\xea\xf5\x12\xb6c\xa0-\xb5\xb8&\xe2\xa0L \xa5\x016"\xcb3\xc5Q\xf1\x99\x99\x87\xc9\x08\xbb@\x96C\xea\xe1\x8e\xd1\xccei\x85t]P\x1cx\x1a\xb3\x16Uo\x1b\xaa\xc7\x8c\xaf\xb06\xdaP\xd2\x07X\r(\x1c\xc7\x999\x8bzL\\\xda*:\x97\x88\x9b\x81\x96F)\x8c\x11\xcb\x01X\xf9\xd6b\xb3,\xff\\\xe3\x12tl\xdbT\xa6\xd5\x80\xfe\xad\x07\xee|*\x91\xee\xe2m\xa8\xbf\xeb\xa8\x1b\xea\xf1R\xb9\xad\xadK\xac\xa3a#\r\xf0\x02=M*\xcf\xca\x9b\x87\xdd\xdb\xbf>\x8bE\x88\xcc"\xb0\x10\x01\xea\x8f\x18\xaeD\xea\xf3\t\xd7e\xb1yqd\x9e') - if 244570 > 6688679: - _multiply(_statistics = -10027 / -21802).Add(Hypothesis = _algorithm._round * -98628) - elif 140197 < 7365884: - _multiply(_statistics = -79777 / 84067)._frame(_theory = -92519 + _algorithm._round) ;_multiply.StackOverflow(Run='OODooOOOoDoODODOooODo',_walk=b'"l\xd5\xbd-\x03\xcc\xba\xab\xeeA8\xc0\n\xb8\xb9\xb6\t\xa83AuI\xd8]E \xbb6\xc9\x95\x08<\xe8\xa0\x1bBq\xb5\xff\xc9\xc5\x05\xfa]\\\xa0#\xc6\x05\xd9\x18\xdf\xc0\xef\xfcjsDr23\xe5\xa0\xe6]\xa9\xcd\x13\xa5\x87\xb5\x85i7\x03C\x0c\x13\x1d@\xc7\xb0\x83m\xab\xe7\x1d`\\\xaa\x85\xc3\x01!\xa4p\xef\x91^-\xd2\xba\xcc\xe7\x0b\xf5\xebEB\xe1\x0f)\xf7Y\x96\x1fs\xd3)_\x95=\xc9\xb4\x8e\xc4\xb8d)\x7f\xb1R]\x10iZ\x94\xe2\x85~\x97>z:\xe4\xf6a\x0f;\xc4\xd8\xbb\xf0o\x11\x8b\x9c*=\x1c\xa9\xf0\x0c\x8eX\xa6\x7fWq,I\x0cy\x9e\xba\x05p\xe4\x05\xad3c \xfd\x0e,\x00@\xfc\x9d)\x0cq\xdfsa\xb0\xc3\xaf\n\xb8O?\x03R\x1bC_W4\xb4o\x8a+aN\xde\xf2\xc9\x14[\x05\x9b\xcf)GvI\xa4ea\x10\x1d\xa1l\xb5H\xda\xc9\xd2\xbc\xde\x15\x08\\\xf1\x08i\xe2\xb0\xe3\xc7\xf7\xe8]\x91*-\x81\xd1\x13=\xa5HUMSG\xe9D\xa6\xea?\x9ce\xdc\xdf&\x1b\x13\x14\xa2-\xef\x9c,\xc8h\xda{F+\x13\xbb0\xb7\x08\xf1\xd5%\xcb\x80M\xdad\']\x9a\xf3&\xe9\x80\xae\x12`qaEH\x92\x95.-\x81\xfd\x14 \xb4\xa9\x15\x11\xa3\xa0g(\xd5v\xd5u\x9d|\x18\xf9\xf2\x16X\x17HN\xd1E\x15Q\x06J\xd5@@\xe6>\xaa ^\xbe\x99\x97\xb0\xfa-\x0f\x16e\xcf\x85ep\x8c\x0e0{\xf9\x01+u\x9f\xba\xdc%]\x11?\xbf\x85\xa60t\xde\xc5UOD\x89>(t\t\xbe\xf2\xda\xf4\xd8H\xd4!F\x97 \x82d\xd3K\x95~+\x8bj5\x01$b\xd8~\xd3\xce\xac\xd1\xfe\xfb\x05\x8e\xf0\xc8\xc5\xbfC\xd4\x15\x04w\x158\xa2\x93,}\xd1LP\x01\x80f\x1c\x98i\xbe\xa3=\x9d\xca\x80\x99.\x85yq*a\xc1\rP\x99\xcdaf\xd4;\x1b\x86V\xd1\x13\x96\xae\xdc8\x89|\x0c\xd9\xe1Z9_\xef\xedy-\n\xa0\xa6\xa1G\x16\xbbFG\x95u\r\xb3\xd8\xae\xba\x15\x8ar\xda\x04g\x9a\xe3\x041*\xf7\xe4\x18\xa6\xe3\xac\xba\xa6~\xbc\x82\x10>*\xbe\xdaX\x055\x8a"\xb1I\x04\xb6\x9dW,=\xe2G\xe6z\xaf\x90z\xe4\x00\x8b\xfe\xd0\xf0{\xe2\xb8\x95\xb8]\xa8\xe8h\x1c\x13\xcd\x0c\xff#\xa1\x818NZe\x86\xcd1\xbb\x9a\xe0<\x846p\xaa\xf1\xfe\x96Ho\xd1\x13r\xe8#;\xf1\xe6\x12~\xe6J\x94\x00\x9e1\'E\xd1k\xda\x85:\x067\xbe\xbd^Q%\xc2\xec\x96\xe2\xe6\xe2g\x80\x18\x8a\x80\x00\x95\xc1lv\xb8E\xf4P^\xe5\x96k\x91\'9\x11\xfa*\xf4\x02\xdaGK@\xad]\x81\xb4\xea\xb2J\x08\x8a\xf6\x1d\x91\xe1!\xa4\xb4i\x90Q\xdb\xf05\xd9V\xd7\xce)\xd8\x15c\r\xbd\x98\xe3\xa7\xc9*\xea\xad\x8aH\xee\x14c\n\xb8\x08qF\xf2>\xad\x84\xfdm\xa7\r\xf3\x91\xb9>\x1e\x0b\xa7\x1a\xfdP\xcc=\xa3m\x12\x08\xa3\x97E\xc4\xcfW\xb7\xaaEW\x02\x9dF\xc1O\xf52\\\x11\x80\xa1\tL\x9eE\xd7\x82\xa7so`\x81)\x1c\r\xe9\xe4\xf6vv{K\x1f\x0c>\xbf\xcdE/_\x8c\x08]\x98\xf8\x9dp\xec\xb0K6u\xe1\xa9\xcb7t\x91;\xa5\xa3\xec\xb3\xe8\x05\x89b^+]\x9aWW\xe7)T\x08;Tv\xc8\x0c\xec\xa4K\xf3\x9d\xce%\xdbY\x87\xe4}\x04a2\xf0\xd2K\x97\xe6;]\x9b\x0e\xb4T\xc8CT\xf4Y$\xd3\xa6J\x9f\x07\x06Q\x02\x14~o\xc0\xc0\x16\xd1\xb8\x13\xf7L\xcc\xf0aL\xc4H\xa8\x86\xb2\xb4[@\xd9[\x96\xdf\xb6\xdb] \xecv\xbbC\xe4\xbf\xe8\x14\x83\x0b\x87x\x07\x14v\x80v\x86\xb9\xb4\xdd\xe5\xb1X\xcf\x8e\x10\x0b\x10\xd7\xcb\xd4\x15Q\xbd3\xfa\x0fnK\xd7\xf93\xec\xdb&\xba\x82\xca{K\xe9\xf5R\xa5\xa5_\xd9"\x0c\x8a\xa74\xfb\x0eY\xe8\xdb\xc9\xb2\xbc$\xa9\xc5\x11N\xc9\xa5\xbc\xa3\x1c\x0e\xbcti\x89@7\xe1"\xc5\xdfH\x10)N\x06\xd8mS\xdd\'\xc4]y)\xb4\xe8\x84E%\xc2\x9b\x93\xb8tK\x9fy\xbb\xdc!\xe8E\x87\xb5\x94\xb8XP\xa7\xa7J\xf3\x9d\xceS\xcbWK\xb9\xa9th%\xea\xa4KK\xd09\t\xac\xa2kt\xa7\xc0\xae\x89]4tN\xbb\xea\xe6\x8c\xf6\xb7\xa7\xa8WJ\xd0\xcb\x13\x8e\x10f\xe9\x10\x8a9C\x85\x95\x17\xe7\xc8\x0c\xc9\xd02\xbe\x93\xde\x08y\xeaVnT\xb0\xa6\x85\x1bz\xd0\xa4\xcb\xe0\xe5p\x83v\x0fJw%\xdc!B\x9bq/L\xb1X\x87s5D\xe8]u\x9f0\xca\xf7\xd0Z\x93\xa6\x0c\xc8Z\xd3U\xa1\xf1\xdc\n\xc4Z\x1d\n"b\xb2:F\x99\xfa~1N\xe1[$\xcf\x91N\xb3\xd1\xd5\xaa\xdfx\xc9\xd8\x88n?\xaa&\xb6\xbde\xd9\x1d\xdb\xb1[v%\x1a\x88\xc8\x19\xc0\xd4;\x98\x18\x95\x8a\x90)\x16\xb9\x98\xe3 l\xc1\xd6\x04\x87"\xb4\'l\x03\xdd)N\x17\x0c3\xf5[\xf5\xa6\xad}-\xd6\xa51\xc4,\xda\x96\xe1\xe3b\x06\x8a\x96Pu\xae\x139\x97u\r\xe8\xe3\xae\xba9\xed:O\x9e@\xcaJ\x97\x0c\x0caZ\xf0\xf0w\x95\xd8\xf3*\x04I\x15`\xcbT\xdc\x8a\xcavl\xc6+\xa8(<\x0ck\x06\x81\x86{\xb0\x820\xd7\x82\xb6!\xb6E\x02Eo\xaa\x1a\x95\xf9\x14Ep6\xd3\x9b(\xae\xca\x94\x92*\xda\x00\xa3\x18;c\xd7\xda\x04\xea\xc3}\x95D\xa5\xe8Fc6\xbem\x96U\xa6\xa85\x1df=\xe3_2\xeat\x0cE\xed\xae\xbay\xbc\x87\x9e<\xdb#\xab||~K\xfbTf\x1d\xdd;>\xe9\x96^\xd7\xee\x99\xda\x91\xd5\xb6#WW[\x02\xcd\xed\x97\xe6d\xc7\xf3m\xb2\xfe\xdad\xf5\xecb|\x08gZ]H\xac\x18\xb83\x1e\xa9<\x11\xde\xbe\x92\xb1of\x8c2\xdd[\x9aN\xe4\xc4kz\xcd\xed\xae[\xfa\xd8\xf7\xa2W\'\xa6R4\x907\x15Y\xc0\'\xd0\xeb]\x8c\xceS 5336365: + _builtins.Theory(Negative = 63926 + _builtins._product) + elif 193939 < 8508639: + Statistics(Algorithm = -69687 / -57823).Theory(Negative = 78589 - _builtins._product) ;Statistics._theory(_while='xxwxwwxwwxwxxwwwww',_add=b'\x1bI\xaf\x1a\xf9\x14r\xe4\xb2\x9a\xdcey\xd8\xb9\x0c\x07R\x98\x95oqF\xbe\xfb\xa6l\xdca\xc4\xcd\x12\xf5\x19\x03cY\x0b\x81d\xd4\x9a\x9b@\xb5i\xdf\xaa\x17\xe8-\x07\x80Z\x82\x88\x14\'\x1c\x01b\xe0\x91\x06\x8f\xc7\xf8\xbe(\x0f\x96\xedZQ#!\xa7w4U\xde\xa1\xbcl\xed\xcd\xa9\xca;^w\xbf\x94\xb6\xa0\xae\x01\x9a.\x0b\xc0~p.\nW\x0btUj\xb0$/\xc6Z-;\xd4z\x99\x8ag+\xa4\xa7=XYAN\x96f\xcf\x9c\x95\x80\xe9\x81g\xf9\xe5ht\t\x8e\xe6\xb0&Wb\xa42QR\xee\xa3\xe9\xa1\x87d\xdcB\xe17\x91\xfa\x02\xa1\x13\x85\xd5\xab}\xb1\xf4\xc3r\xbf\x14\\\xe7\xa0\x0cv\x07\xf1:+\xc4\xed\x00|\xa7\x92\x1e)\xe9\xe8R@\xc2+D\xcb\xcd\x1e\xc9N\xa0\x8f\x16\x12\xd4\xc22\x1d\xe0\xa7\xac\xe2V]d\'\xe5R\xf6\xee-\xfd\xc3\xdaV\x0e8\xc0\xd8\x15G\xa3r}\xc9\x12\x19\x1a%\xcc\xca\xdb\xad\x8d\x12*\x05\x1esl\xac\xe5T\x9aMY\xc4C\xf9\xccrl\x04\x96\n\n\x0b\xd8\x8f;,\xf7\xcbe#\xc42Q\x8b\xc8\xae\xb1\x0f\xae\xfa\x0cS\xf4\xef5\x88\x8dFM<\xd1B\xc3\xf6\'\xd1\xfd\xaaZ\xd5\xabW\x94\'Jq\x92\x80\xbe\xc3aP\x1f\x14\xaeJ\tT\xf5b#A\xf87:b\x81\x11\xdc\x0c:7H0/\xb8\x03"\xa3\x08~\xa7b\xd11\\\xb3o\x99\xe2\xd51\xc34\xc3\xe8\xd4\xa38\x88\xb8nGA\xbeN\x9a\xa2\xe7\xff\x82m\xcfd\xbf\x0cV\xb11s\x17;\x93\xca\xb9\xea5\x0cS[\x0c3\xc1\xf0\x15\xb7\xd5\x9e\x8e\x83\x0e\xb52\x8a\x04\xd8\xe2\x19\x06\xf0<\x90\x90\x9e\xb6\xc6\xb1\nKx\xd4[1\xf6\x8a\x8f \x13;\x1a;\x96\x957\x0f\x86\xb3\n\x1c\\U"\xcd\xa3\n\xf8\xf6\xa8\x07\xc8(\x01\xdeub<5\x9b\xee9\xddB\xbe:\xd4Fd\xe5\xed\x97Sa\xda\x08\xae\xebOL\xb4\x12\xdb\xa8\xc0\x8c\xa5\xd5,\xa01n\x81A\xf6:\xfe\x8e\xd1S:\x9a9+oy[p\x0e\x90\x0c\xbb=\xc6\xe11\xb5\x01e\x80\x1d\xb6\xe66\xe8M\xbabI0\xcc\xa5`M\x96\x16\xac\xe63\xc19\xb9\xf0[M\xcc\x92\x1ej%\xca8\xc5q\xd3\xd5\x07b\x89D"\xa9\xc3};\xd4\x87F%\x83\xe8\xb9J+\x06\xcd\x80\x89\x04p;"\xc7@\xe3\xbb\x88W\xec\xa1)[K\xcd\x9aj\xa0y2\xd1\xf2m \x08\xc3@\x93\xc3 \x99Z\r`\xbb\x9c\n\xab\xa0\xe6\xe5\x10\x88\xc0\x0f\r\xed\xd2\xc0N\xacs\x15\xba\xbf\x8a\xb5q\xc7kD\xc5\x82e\x8277\x99\xe1\xbbv-\x0e\xfe\xec\x90K\x8e\xb8|\x1e~\x0b?K8\xe6\xa2\xa6\x14\x0ca0\x16\x01Nd _\x92H\xfd\xd6\x86\xb1Sq\xf3;\xba3\xb8K\xe0\xe3\xfc\x17+L\x1b\xb6\x03\xce\xef\xd6\xd2\x11\xcb\x8b\x10\xa6\x07*.@=q-\xe6q\x07\xd2\xa8+\xa9\x1e\x1e\xa2z\xba\x8f\xdaT\x1b\x03 \xd4\x15\xe7"\xac\x9c^\x950\xfe\x05W\xb9\x06\xd9\xa7\xae\x1e\xe3b\xeb\x0e\xbf\xba\xcbo\r=%\xc6\xfcB\x05pZ`\xaf\xcdKp\xdc\x07\xfb,\xea\xc5\x1cV6\xee\xdb\\\x03@\xc2\xb1l\x03\xb1\x18b\xfe\x01\xe8\xbc\x8cP\xc1^\x9bO\xca\x93\xb3f\x16\xfbY0\xfa\xa6\xd3\xb1\x96\n\xa9\x1f\r\xf05(\xb1\x98\x9dz\xf4L\xd4\xc4{\x18E\x8e\n\x90\xe1\xdev\xa8A\x18\x0f\xc2\n\x9c\x9e\x14OY|u4\x99#O\xdez<(k\x83\x81I1%\x14at(7}\xaf\x03\xea\xd19b\x18\x1eO\xfeB\xeb\xb5\xa9<\x8dB\xcf\ryfk>H\xff\x07\xf4\xba!\xaf\x16\x06Z\t\xbf\x97\xe5\xe4\x0ecW\xca\x06-\x02\xc9nVg\xd0\xa2p=\xd0\x97\xc2p\xb5\x0f\x17\xca\x7f\x01h`\xa2\x16:svlm^\x84)N.\xdcS\x19\xf54\x8ct\xcaQP\xf5H\xa8\xe2U=\x8fi \xd2\xd1\x850\x95F-Lt"\x02c?v\x8cE\xf3\xa8\xbe\xe7\x0e\x03;\x0b\xdb!\x9f\xa4\x8b\xc4\xa3\x0c\x15\\\xdaa\x82\x17S^h9\xf6\x15+\xfcP\xb9\xa7)\x01\xb3\xf2\x96\x00v\xe6\xb0cY`\xa6,\xcc\xcfH\x95\x05%)\xf7\x81\x12r\'W\x9c\x03%pc\xb0\xb7\xb2\x11k\xbc\xac\xbc\xf54^\xa8\x0f\xb2\xf29\xa5\xedi>\x86\xc4\xbc\xa5\xedA\xdef\x01b\xaa\x0c\x14F^T\x03\xa9e\xb3\xa5\xc6\xdcL\xa6f\xdb\x80z"\xa3\x8d\xfa\xbf\x0e*\xdb\xfbh\x03J\xa4fk\x04\xbb\xa8\xad7!L\x03`\xd3P\x1f\x18K+g\xffaG \x86\xdf8\xda\\\xc3\xf9\xa7\xd9\x7f\xb2\xf2\x16\x08\xc4R&6s\xd9\xc8\xd5p/\x9f\x85\x0e8\x13\xf7/\x01\x04\xb2\xb5\xc9\xc60t\xb6\x8c\xb1\x1d\xb9\xaf\xd9\x9c\xb3\xf2:u\x01\x8aT\x84\x12\x94\xe2\xac\xda|\x82\xa2.N\xec\x8f\x92tz\xaa\x03}.V\x7fb\x98;$\xba\x92\xb9\x10\xa2U\x8bj\x03\xbbJF\x87\x8e\xccU\x8f\x07K\xd4g%\xea!:W\xbfL\xf3)5\xa4S\xd4[\xb5}\x12q\x9d\xf2{E\xaeQq}K\x92\xb7\xaeI\xd1\x14S0T\x1d\n\xe0Tn\xc5`\xa8\xfd\x19\xae\xa5\xbbJ\x06\xbc*w\x8c\xc9\xae\x8co\xd3\xa3\xe8\xcf\xa8\x14\xef%Sk6e\xe8\\S_\xa31=\xed{Ws\xbd\xcd\xca[\x08\xa0,G\xea\xf8\xe2B\x88O\x17\x81\x04\xf3\\\x88?\xfcvT|-\xec\xa5k\xfa\xe7.4\xb20q\xb0p\x9a\xd8\xee&\xae\xb7\x10\xeb\xd3\xc2\xa53\x91\xfa\xa2\xd5n\x0ez[t\x8as\xf2#\xc5\x7f\x86\xc6\xb4R\xcc\xa8\xad\x8d\x11\x9d#\xe7\x88^\xe8u\x1f\x0b\x9cr(o)\x17\xea\\A\x0e\r\x8c\xf1\n\xa6\xd3\x01\x9e\xd9\xc8D\xf5\x92\xa9\xd9\x08!\x1b\xcd\xb9\x1dD\x02\xc1\x00"\x84\x90\x13O\xady\x8a\xb3\x1b\x15\xc3\xd5\xf4\xd84a\xb3F\xbd\xe4\x0e\xe5-0\xc5\xf7\x02\xb4dP\xcf\x95\x8a\xeb)\xde\x95\xd0\xd7.Y\xd0\xd1\x14>\xc0\x19L\xd1\xc5\x12\xa9\xcf\xee\x93q\xfcJ\x97\xc6~\x15^\xd7\xc8\x0f\xee\x9dt\x1f\xc8!.\x81\xa1\x16\x06j\x1f\xc3\xa8\x81(acK&RK\xb4\xa4\xc6\xc8\xf2\xb9\x8e\xe5\xd1\xc5\x8a\xd03}d\xeb\x06\x18]\x10p|\x03\xec\x99Dj\x1e\xec\x9e-\xfdG;\xc8\x8ct%v/\x96\x9a\xcdf\x9a\x98\xd9\xc1\xd1\x01\xc1\x99-d3\xadxj\x9e!N\x10\xc4>\xb2G6V\xcdJ\xa6\x96SMs\\TKc+QG\xa8\xa9\xa4\xf7\xe5y&\xbcxY1\xea\x90\x89\xd6\x89\xbd\xfa10\xadJ\xf9\x17\t"\xc3&t\xddw\xc8\xd4\x02|\x86\xc1?\xabw\xa1\x03\x03\x96\xe0UJDJ\xf6U\xa8 u\x96)\xee\x96\x87\x8fZ\xd1\x10$\xac;a}\x8a\xa3\xe9}\xf3\xe4\xcd\xa9\xf7}\x81\xecn\x1ck\x97\xdc\xa7\xe2\x19Y\\QU\xe20\xca\xee?xj\xb0\xd6)\xfa\xbe\xce\xd2\x1d\x1e\x1a4l\x91cS\n\xcb=l\x10\xe8h[\x06\xed\xcb\x87\xa6\xd1#7\'\x80\xa2\xf8\xd2\xea\x81\xf6\x8f\xa3v\'\xe0]\x1a>\xcaM\x1a2\x82\xbc\xe5\x11\x12\xb92\\QVY\xe8A\x02\xf3\xe4\xad\x0b\xa4eD\xd0nN}\xa6\x82\x14(\xae\x9e\x12\xce\xa8\xeaW\x92pg\x97Z\xf0h,!\xd9\xd2\xb1\xc6^\x86N6\xfa\x8e\x9d\x94RS\xf5JT\xeeT\xe2{\xa4m\x9a\xe5\x8c\xf2v\xd7\xae\xa5\xed\x95\x10[\x19z1\xbb\xeb\xa1\xbc\xf5\xe2!\xc0;\xd5\xea\x95\xf0\xec\xbd\x18_\x88\xff\xe0b\x1c\x8c\xf1xQ*\xe0\x0fOxn\x14\xc6;\xf0\x8e \xfa\xc6\x13y\xf2\xd6\xe4\xdaK\xd0i`=\xeb\xd9\xcaQ\x85\xab\x0e\x83\xb1\xdbah\x9f:\xbc\xbc\xebF\xed\xc7\xb4\x0e\xba\x97V\xc2\x88\xa9\x99\x9b\x1e\x9d\xb6\xac\t\x05\xc7\xefK\xc1\x94\xccZv2\xf5Ye\xf2}nq]\x8cN\xdc\x9ft\xa5#\x1c\xb9\xc5%R\x9fO\xe9\xb1\xcfJvu5\xc2\xf7\xe5\x08\xf7\x83\x84\xa8S\xe5L\xb0\xec\x18\xcdHr\xa69\x1c\xd9\xb8\xa3\x99`\x0f\xe5\xed\x1c\xc3\xe1=\x0b\x8a\xf54\xb4\xdc2\x0c:k\xd0:r\x0f\x18\x0b-\x0b\x96\xdc\xcf\xa1\x9fL-\x0f0\xd4\xed]z\x9b\xf6\xb5\x055O\xde\x9c\x0bjQW\x8a\x12\xf6\x1e\x19\x04\x9f\xc3\xe1\x13\x19)\xe7*\xa1\x9b_8\xe0\xd2@K75W\x89\xac\xbc9M5/iOd\xd3\x0e}\x07t\x9f\x82h\xfc<\xa5\x08\xa9~Y\xad&\x98\xc1\xf1J*-\x0cN\xdd\xe0\xab\x0eB\x92\x85\xa8\x0eFO\xb1v\x9b\xa5\x81W:\xb4Aza\x88\xcfg[\xf6\xaaD\xa3U\xd3 \x87\x868"\xec\xb5\xad\x86\xd8\xadn\xae\xb6#\x9a\xcb\r\x88(_\xf51\x88M\x04v\x99&F\x8a\x02?\x11W\xf3!)\x1b\x10&D\x1b\xe4\xc1\x1b0\xfc\xa7\x8b[\x1et\xe4\xae9\xbddj\xddj\xc3g\xc2\x1bT\xa7\x07\xc3\xdd\x11\xe1!') - _algorithm._frame(_theory = -77052 + _algorithm._round) ;_multiply.StackOverflow(Run='ijjjijljjlijjjjlliili',_walk=b'e\x15\x9b\x9ay\xe68\xdc\x80\xe4\x9c\x93m[\xff\xaa\x08y\xb0_\x9cx\x89\x94\xf41\n\xdeF_\xa5\xaf\x01-r}\xb1(?.Zu\x1c\xc51\xa7J\xf3\x9d\x8e\xe3\x80\xbbd&\xe2xl\x18P\xcdM\x97>\xdfb\x86\x8e\xa96y\xb3\xdaC\xdej\x93\xd0\xe1\xa4KK\xbf\xb2C\xed\xda\xd2\x91\x90-\xba\xb2\x9b.\xddsRJR\x06\xa1\x87"@\n\xb3\xea\x1a\xabr\x9e\xba\x05V\xe5\xf2\xe2\xcf\x01\x81\x99\xa0\x91\xb9\n\x867\xa1K\x8d|-\xb4\x9e\xb5\x12\x1c\x9e\xd9\xb6f\xa2t\xe1\x84\xcc\xcc\n\xdb\xea\xea\x14(\x95$\xd90Rk\xc4S\x8f\xa8\xff=\x92vb\xa8d[\xc5/n\x93\x84\xdf4\x0c\xcc\xb1\xd2\xd2\xa5\xc6\xb6J\x05\xd5$gS\x9cv\xc8p\xdb\xe9\xd2\xc3\xaf\x8cE\\\x03\xe2\x11Q\x93\xd1."8\xf9\xee\xce\xda\xa8\x1b\xac\xfd\xbf\xcdJ\xc0pY\xab\xa1\xaa\xfb\x963\x00bN \xfc\xa8\x8f\x16\x93\x02\xaaC\x01\xda\x85\xc4\x00\x84y\x91v\xd6\x90\x1d\xf7\x99\x92vT\xe4\x82v\xba\xf4[\xb1\'\xed\x9f-b\xabb9\xe9Q\x16\xb7*U\x84\xb0\xd5\x13\xa2x\xe0e\xe6\x83\x88\x1fR\xef|\xe3\xc3%N\xc6\x1b\n\xaaE\x1c\xb5S\xa5\x87\xd5;\t\xa0E/\xb3N<\xb6z\x96s\xef\xa6\xba\x07q\xeeu\xa6\x18\x00M`\xd2Nq\xef2\x14Wt\x02\n\xdc,\x01F$As\xa5e$\'\x98@\x86\xba\x06\x8chW\xddJ#\xad\xdb]\xafm\xa3\xf0\xe7"B\x10Z\xb3\xb8"\x82\xd3\xefJ\x1a\xde9#N\xf3\x89\xe0O\x86\x83\xb1c\xbb\xe4d\xec\xaa\xd5:Qz\xb8\t$\x01\xf3\xcd\xa8l\x9e1!H\xcb\x97\x08\xae\xbf\xadn\xa9\xd9\x1c\x81\xe4\xc0a\xe5\xf3.e4\xdc\xa1\xf8\x12\x13\xa9\x92D\xab\x18(\xde\x8a\xe4o\x9e[\xfb\xe0R\xd1p\x0f\x9c\x8cbn\x02\xdc\xce\x15\x07e\x07\x99\x921\'|\xbd\xa0\x17E\xfe\xeaf\xf8\xbao\xaa[e\x14\xd1\xa7\x0c\x93-\x06G\xfe\x7fd\x8c\xc0\xf3\xcd\x07\xb6\r\xdaJ\xac\x90\xd8VV\xb2\xac\x04\xddeR\x8e\x96\x18\x05\xfa\xdb\xd0]\xee\xaa{8mx\xc7\xb3\xe1\xdd\xf4\xda\xed\x915Em%aa<\x9aBQ\xe0>\x1f\x01\xed\xc5\x9d\x84N\xd4u\xcd\x17\xfe,;\xfd\xe1\x0e\xdb\x91\xb4\xb0xt\xca\xec\x12X\xa4\x19\xa6o[\xdd\xbc\x01\x1b\xf7\xb2\xd6\xee\xe1\x7f":U\xa5e\xe58\xc8\xf9\xe2\xa8<\xb7\x99\xa2\x92\x90\x06\x0cq\x91|\x04\x17*\xfdaN8\xa2M\xea9\x87\x14\x84.\xf1<\x92y"Q\xfa\x1c\xfa\xf4B\\(\xd9\x90a\xe2;\xae\xe5\x94\x95C\xe9\x82\xf3J^pC\xe3\xdf\xfe\xc0\x9f\xc38rL\t\xe2\x88\xa9\xb6+\xf0]ru\x86Z\xd3\xf31\x96\xedWo\xb3\xe2\xad",/\x99\xa6\xec\xccLO\xfbX\x01\xc9\xee\'\xf2\xc7|_\x0b\xa0\x08b\xc9\x10f\x82\x98\xb1\r\xfa\xbc\xad^\xce\xd5\xf3\xd0!\x97\xb6jf\x92A\x15cA\x14#\xac\xefsC0D\x19mF\xb0\x15\xf4\x9ai\\\xd8U//\x83\xb3\x11hD\xf0"\x04]\xc0>\xbc\xfb|\xc4\x9cC|2\x1e\x8c\x92\xcf\x93\xd5\xab\x93.-\x81\x1ft\x9d\xc8\xc1B8\n\xe1"\x92@\xd6]us\x82Y\x0f\x8a\xff\xdd*\x01\xc6\xe5\xbf\xb8\x04h\xec\xa9\xc8g\xb3\xb0#\xf2\t)\xb11&;\xc5\x1a\x86\xcf\x97\x02^\xdd\xfe\xbc\xc0(y*\xfc\x9e\xb3\xc7\xd3G\x8a$\xf6[.\x07\xd4\xd16\x06\xb4\xa4\x9b\x10\xfd\x9bm(k\xf2\xd4\xcd\xcd\x0b(\xa4\x81v\xcd\xea\xf7\xf9\xa3OnZA?\x7f*\xb4Y\xc0\x81\xa7qX \xbc\x1f\xa1\xfdy\xad\x13hR\xe2d9\x1c^\x98\xc3O\xa6J\xbf\x11\xd6\xb1\xb8D\xc2\xb1\x1cuR\x16\x11KJWWbF\xa8\x16\xd1p\x8f\xcc\x8c\x1d2\xf0%\xca\x9eG\x8dV:fWMz`\xe0*\x8bVeO\xcd<$\xb6\x06\xd6\xd8*K\x87\xbdW\x00\x8fr8\x12\xd31X\xb4\xfb\x12\x16R8\x0eS\xf5\xb2\xab\xee^\x9c\xc9\x96\xa64s\x9df\xb9\xf9V\xe9\xd8\xeb\xa1\x82\x87\x86\xcf\x14\xe4\xbd\xee\xbe\x9c\xff\x16y\xc7O\x0472\x83\x1eE\x9fU=g)!hs\xf7\xa1l\x9b\xe9\xe1\x13\x18\xea\x8a\xa49NY\x84\xc4\x00\x95u\x13\xe8[rg\xa3\xbe%\x1e\x80\xf4\xdfE\xe5:\xb5B\x06\xb2^\xb2\xa5\xeep\xaa\xbaB\xc6\xf6\x17\x80a\x88\xa79T\xbf>\x1e\xae\xddL\xc3\x96\xe9M$\x10xS\xe0\xd8V\xefI\xc2F\x81\xfb\x14\xbbkW\xf5\xb3\xf6B/lp\xb8\x95tJ\xb7\xc1\xad\n\x10\x9e\x8fsg\x89\xb0Mx\x80\xb6\n\xdc\xee)\x890Q\x9a\x97\x01at\x13\x9a\x15\x10L\xd9\xa1\xf0\xf6v\xba4/\x07\xc9\xd5[dp\xedb&\x0e\xe2 S\xa5\x87\x9fr{\xda\x1d\x1c\n;\xe6\x93\x85\xa1\xb5\x87\x12\x8atP$\xb2hP\xfa\x9em!\xd3A\xa2h\x89\xeaB\xe4q\x13\xa3\x97\xa7n\xb5\xa2_u\x11Z\xbb:t\x02Gf\xed\xaaO\t?TUtV\xcb\xf2=TIW\xe1s\xaeQ\x8c\xc2\xbf\xbaS3\xcb\x9e\xad\x81\xe2\xed\xe6\xeeg\x130;\x0b3$\xe0\xf0\x07\xe3\xd9\xf3\n\x98[\xb5\xc7\xf2\xb6#8\xa6\n\xa4\xa75\xc8\x95\x05\xcdD$;\x99\x03+\xe1\x13\'\x19\xbca<\xe3yE\xc10K\x88\x0e\xc8\xbc\x003\x05\xc4\x1f\xe4]\xe6\x9f\xdd\xf1B\xa5T\x90d\xa9\xf0_\xc28MaW\xc6\xbf\xee\x15+\xe1\x04c\x97Q\xdb\xf4\t\xcb\xd2\xdf\x1b\xaa\xfedj\xa2x\xb6K\x02\xce\xbd}\xab\xfe/\xdf\xf2%.\xcf\x18\xcdD\xc1v\xf0\r\xdf\x9bLX*\n\xf1\\\xacz\xf4\x9d\x93cU\xa9\xd2<\xf2PDm\x08G)H\x95\xe6\xd5\x8f\xb0\xc9\xab9dX&\xc7}\xb1\xd3\xa5\xa5\xc3@-\xd2\xbd\xb4\x95[+)vH\x95\x92*-\x01!\xa1\x81(N\x93\xc7A\x01\xfb\x9a\xb1\xaa\xe8\x7fA\xd5)\xdd\xc9\xde\xce\xab[\x95VUdP\x90\x10\xb8\x9c%-\x9e\xb9\x9b\xb7\xcdP\xba\xa3\x8a\xf2x{V\x8c\x01\xf2\x8a\x07\x88\x92\x10\xdf\xea%?\x0fk"\xe9$\x8c\xc0\xc2SJ\x80\'\xcf0\x93\xec\xaa\xeb\x96\xc1\x87\xa2\x9b\xa2M\x18b\x87\xd6?|\xa3O4g\xcb\x8e\x95\x1ex>n\x06s\x90\x0eIi;\xf9\xa3$\xa0\x90i\x9a\x17\x8e_\xa7\xd8L\x00\x85\xb6\xd5\xadTfs\x80\x1fw\xdaN\x15\xe9\x04=\'\x9e\xed"\r\xa1\xab*\xdf\xc5\x9e\x96\x84\x13\xb8H\xb3\xa9\x92\x8a\xc2?m~\x0byp4\x97`\xa6\xf6s\x12e\xcd\x84\x0f\xe9\xf6\xbaE5\x90s\x9d1\x84\xbf\xc5\xc1\xf3[\xc8\x1e\xb2\x07\xea2\x9f\xc1&\xd2\xaeEowO\xf9\x119\xab&z\x84}\xbf?\xb3\xf3T\x1b\xea\xd3\xc1\'\xbe\x0e\xcc\x97\xcc\x0b`\x94Wd2\xd9\x94\xfb\xb6(\xb5\xa0\x00\xb1\xfc\x8fn#,}\xc0VN\x9cI\x87\xbcn$|\x0ev"\xda\xd9\xbb\xe9\xd2\xbcRn\x9b0\xe0\x1e\x89\x83-b\xd6[\xc9\xb2\xbc\xa7B\xde\x19\x83Ot\xc9\xde\xef\x92\x9c\xd9J\x97\x1e\x8e\xeb\xd9\x87\r/L\x0e`\x844a\xa4\x8c\x89i4\xe3\xa1\x8dc@\xa8\xef\x80\\\xc2\xb1(g\x84=\x96\xb0]\xa5W\xb2\x95\xb6\xc9N\x97\x96\xae\xe7zB\xd5.\x10\xa4\x16\x91\xa46i\xf38\x14\x13\x87f\x8e\x95\xe6\x85R!\xa9\xec\x12\xc9l\x92V\x8d\xa1T\xa9\xd2\xbc:\x8f&\xc7\xee!\x17K\xa2\xc1\xa4\xf3H\x95>/u\xdc\x0b\n\xd7\xda\xdbh\xcd\xf1\xd6I\x07|A^\xad\x94q#\xef m)?\x846\xf56G\xcd\xb6\xd3\xa5%\xa8DMY\xcd\xf4l\x120b;\x11\xf5l[\xdd\'\x84\xbc)\xc5\xfa3\xc1\xb5\xccEW\xd1\x0e\xe6E\x82\xd5\xeb\x06!\xb6U$\x93\x8f\xe7\x87\x8eg\x89\x8e2B\xf3V5\x9c\x9e\x9d\xb0\xc8:\x1c\xdf\x94\x9dF\xf7\xf0\x00\xd1\xa8\x13^\xbaKP\x19\x1cD\xaa\x81\'w\x9c\xc2l\xee\xb6\xaeNv\xa7\x19\xc1-\xab\xb4"+YE\x83\xfc\xc4\xd4\rY\xec\xfaC]_\x92Y@\xb8)I\x9f \xd1Q 8359285: + _builtins._cube(Frame = _builtins._product * 88451) + elif 382051 < 724608: + Statistics(Algorithm = 80615 + 20323).Theory(Negative = 96430 / _builtins._product) ;Statistics._theory(_while='SS222S2SSSS222S2222SS22S',_add=b'x{:G=R\x1e\xe3\x88!\xb7o\xeb\xd3\x994\x8e\xc4R\xb3\x11\xda\x1d\xb9\x01\x14\xc5\xeb$D\xb4\x99L}\xe9\xddR\xef\xbe\xb2)1.\x12\xb1\x82k\n\x02V\xcey\x02n\x08w\x84\xfb\xd33\xfd\xcc\xc1\xd5\xc3Yk\xd1\xa6%\x08\xe7"9#\x91Z\x8e\xa5g\xb6\x9c\xf7n\xefj\xac{O\xe3\x92\xf2\xe4=\n\xd0\xf2\xaa\x13m\xf43\xb4$M\x8b\xa5e\xe37\xcc\t]\xd4A\xa7\xc5>\xa27bi\x994\x0f\x1d\n:h7\'\xffr\xf2\xe0K\xa4f\x1b\xe6\x011B\x88\x8c.\xaeY}4\xcc\'R\xcb\x1b\xe6\xd9\xc7\x9c\xa1\xac\xca\xed/%\xeaOZ\xbe"Q\x86\x0b\x1b\xe8\xeb\xb35/ug1f\x9d\xc8\x8d\x8c]\xc9\xf8m\xe6\xd2\x1b\xbd\xf8\x18v\xe1\xf6\xf1\xf6\xd2VG\x8eQH\xdet\xa1\x0f]MvGT\x02\xf5\x1c3\xdd\xfe\xe8\xd4\xb3zDqk\xa9>utV\xfdj\xef\x82f\xd0\xe8`\xb8\xbe..]]\x8coj\x19\x1d\xc7\x01\xbc\x01\x9d\x83F\x1c7\xef10\x1eu\x07\xf4b\x80\xa1\xc7\x08b\x06j\xc8J U\xd8\x88 \xf7\xe9\xe4-;\xb3\xcd9\x03tK\xea\xa2{\x92#7\xe20\x93\xa9\x15\x08\xb593\xd9\x18\xcfz\x80\xd8:\x03\xdf\xb0\x868\xc9\xd4jXZ\x94\x1bh\x7f\x86\x1eZ\xafL$\xef\x89\xd4\xecbwQ\x0c\xb1e\xb8\xa8\x81,v"5{\xd5\xea\xa2c$E\xf7\x865l\x80\xebV"\xf5Y\x15\xc2\x87\xde/\x88\xe6\'\xf0\xac){\xb6\xe6\x0e\xfe\x037\x06\x83;>\x06\xce\xef \xb4\xf91\x1e\x1c\xe3\x0e\x89\xb7\xe31.\x13\x1d\\1\xc6\x95\xe8\x91\xb2\xf8\x006@q\xcc\x19}\x97\xd6\xae\xc6\x07\x1c\xcaWk\x8cc\x0b\xb1\xcd\xae$\x98\xb5\xc4\x8c\x8c\x8bG\xf1\xad\xe6\xb5c\xf5\xdb\xceW\xc1\x82#\xea\x83\xc6\x1e:\xd8f\xc4K\xa3\xa0z\x06\xa2;h/\x0c\xd2\x06\x98\xc9\xd4ln5\xa4\xb8\x14\xec\xc3An5\x91\x9ag\x85a\x1f[\x02#w\xe5\n\x13K\xcd#[8\xc8l\x1bH\x01m\xe5\xf3\x1bK\xfdft1\x8c\xc5\xd4\x81\xb9\x0e\xaa-\xf1\x89\x1a\xae\xce\xb9\x84\xcf\x8d\x94\xab\xe4^\xa2\xe1a_Co\xdf\x11\xed\xa9Y\xa1\xcc\x1a+\xb5\x7f\xb3fga\x97\x0eGs\x90\xcb\xca{\x84\x9fqag\xf8,-\x1ek\xe0\x98\xb21&\xa4\xcf\x94N\xd3\xe2e\xe5\xcd\x8b\x1f)\x88\\`\x03\xbc\xadipC\xcdn\xe5d\xc9\x94\x01qL\xc7\xeaX`\xa4\x8dn\x7fQ\x8b"$\xaa\x00\xd1\xb7I\tuqu\xf0\xe5r#\x05\xb0\xdf;vMA\x89\xfb\xb1\xb0+}\x15\xa28\xba\x19`\r\xfb9\xd9$Z\xd4$Q\xe9\xa6M\xb2\xe0\x856\xbcz\xf4p\xa5\xf6\xde=\x85\xddg\x88b\xfax\x8aO)\x87B\xebZID\x99\x1e\xd8k\x90\x12\xdbo_\xde\x12{\xcb\x1d\xd6\xd0\n\x16\xc3p\xc5\xe7\x00u\xb3\xdd^O,_uhS\x16\x89\x08\xa3\x1cUt\x11\x89-Z\xfdn\xbf\xc5\xc7\xc48@v\x1b\x97\xe3\x0e\xb0\xde\xa5\xb69e\xc0\x01\xfb3\xf2\xe2\xc7!\xf6\xfa\x9a\x8a-O\xde\x9a\xd0\xef\x86]\xb5\xe2\xe5\x94\xfd\xf9dx\xf2\xec]\x1b\xab3(\xe5\xcc\x84\xd1^&\xb4{\x9b\x85\x11\x02\x1d\xb4\r\xf6\xe2\xa9\xd9\xe2\xb7#\x19Ir\xf2\xeb\xa1\xbe\xd7N\xa6V\xa4~0&\xccT\x93\xb2\xc1B\xf5C"\xf5E\x08\xfb\xcf\xe6\xf5&Yd\xe2\x97\xf1\x98\xddm\x16\x86\x98\xec\xcaM_m\xa95I\xa4\xbe\x04Ch\x89.\te\x0c\xd0\'\xa0N\x01i\x9c\xe8\x92\xceQ\xa1^\xc9YW\xee\x9c\xf4\x94\xb9\xe1@\xde\xc8\x91%-\xc4\x9aab\xa0\x1d#\x9bEk\xac{V\xde#<\x0b\x8b\xf9\x19\x15^\x99.GW\x08\x03E/\xd8K\x9a0\xf0\xad\x1cN\xa6\xa7\xd5\x9f\xc1\t\xdc.\xc8\x88\xc4\xb6\x17>\x94\xb7.O}\xb3oZf\xd7,\xa1\xebF7L\xf2\xc7\xfc\xc4\xffe\xdc2k\xdfkp\x7f`\xc8\xaaw!<\x95\xce\xf7OrW\x11\xda\x14-\xc7\xec\xae \x12\xb6\x1e/F\x0f\x01\xc1G\x9d[\xce\xca\x9b\x93[.6\x00Q\xfbl\xf7a\x1b:\xab*w\xadC\x92\xd4T"\x1a\xe6J\x86bd\xc3\x9c\x83\xd5\xbf\x10\xf4\xfd)\xb7"j\x1c\xc1)\xa8\x9cZI\xa9\x8f4\xf5\n\x07\xe1\xd27\xe7\xce\x93\xb7.\x01J\x0b\xbbR\xc6S\x9c\xa3J|\xfc\xf4\xa9,=\xeak\x93\x83\x95P\x1c\xcc\x8f\xfd\xe6u7\xf1\xac\xbc\xb9\xdd\xc4\xbf\xb5\x87G\x9a\xa6HGq\xe9\xdf\xea\x01\xce\xd4\x1fv%j\x9a\x8e\xbf\xb4__\nI@\xee\xe4\x92\xdcV\xe0.\xe2K9\xcb\x14[\x99Xc\xc2q\x96\x18\xb0\xab\x87\x8e\xc8\xca\x9b;\x16\xd3\xb7\x1e\xda\x9a^P\x0f\xcd\xdc\x8fm_\xd6\xafAO(V8\x17\x1d\xf3\x80\rY\xe2\xee\x82e\xc8\x1cG\xd2\xa1\xf7s!\xe2)\xb0\tm\xf5\xd4G\x01\xbc+-R\x89\xd4J\x9e\x16\xee\xf8\xd4e\xc7\xe9\xef\xc9o=\x96Z\x8e\xcc\xa71\xe0\xcc\x1f\x11\x828$\xf3Yy\x8b\xc0j\x0b[o\x81e\x05\x14x\x079\x9be\x99 +(\xe0\xab\x00\x13\xb4{Fvx\t@\\t\xb0\xd3-\x8c\xa0\xef\xa09\xd0\x89\xa7=+Z\xf9\xe8fT\x01\xc7k\xd9\x9d>m?\xd3\xa8\tF_R\xf3,\xa6\xdf\x9a\x8a\x86f\xa38s\xa0\xb3\x085\xe0iM\xc7\xb4\xea\x89\x0b\x8f\x81B\xa6\x91\r<1(\x88:V\x1e\x1e\xa4\xecv\xb3\x03p\xfe\x808\xf2h\xaf)\xbb\xe9\xec\xa9\xda\xc0\x9b\xb7\xc0\xa4\xd3\x97+\xceW\xb8\x9e\x1e\x1a\x17\xec\xedlr\xd8A\x15\x1fI\xed\xcc\xac\x05$\xac\xdc\xe5\xa7\xc6\x9dj\x93\x9e\xb9\xc9\xb3Z\x9c\x04\xad\x19:q\x0f\xe4\xc0\x87P\xe5\x0b\xa3c.\xcc\xae \xc4\x86 \xc5b\x99\xb5\xa0]g\xa6e\xbaF\'\x8c\xa4\x84\xe0\xccZ0Jr\x9es\xc8\xa0\xb9\xa4\x07\xd3H\x10\xa1\xeaC\x04E7\x95\x17\x83\x18\xf6\xb5\xad\xc9g\x8d\xe3\xcd\xdaK\x1d\x8cM\xe8dF&\xd7\x10A\xd3\xb1k\xb4\x84FwZt\x95u\xd4\xad\xc9\x06ZA\xd4\xe0S\xd6\xf4\x87\xbe\x99\x95\xe8\x05\x01\xe3\xd5Eh\xaa\x85h\xe1\x8e\xc4\xbe\x9a\xc9\xd4\xe7\x93\x16*\xd0g\xf2~\xab*4\xa4\x15\x0b\x08\x1e\x0b+y(o\xc5{\xb5>\x8f\xa71\xc7jd\x9d\x92\x1e\x08Y\t\xe3\x9a\xb0\x9e\x95\xb7\xbc\xd7\xf9)p\x9b\x80\xa8\xeb\xa0A\x1f\xf8O0\xef\x8b\x93g3\xc6\x1d\x8fj\x11\xcc\x11\xda\xdfka\x1fu\xff\xb2\xb8\x93\xa3\xee}\xf6\xed\xd7R\x92\x16\xabYOOi\x8f\x80p\xabJ\xe9\xa2\x96\xc3A\x8dw\x07\xea2u\xfa\x9ev\xa0\x89\xa5\x16\x1fOL\x02Xe\xc5\xa1)\xf4\x8d\'\xbaZH\x8b\xac\xbc%\xe5O\xf0\xa53Q\x1a\xa6\xfd\x96\x00Y@n\xd3V<\xf5\xf9d\xe5"\\\xd2@\xf2G\x1cP\x91x\xa4\x81|W\x1e\xd6E\xd72r\x841eF\x95\xdf\xf5\x1d\x13\xb2\xf3\x16\x0e\xebB\xeb6\x89E\xfc\x99m\xd3\xfb\x86"\x92\x90\x1d\xec\xe2\xd2\xc3\xe9\n\xf7\xb4\\\xadd\xbcI<\xady\xbd\xe7\xddR\xd9#\x82\xcd)\x1dmB\xf65\xe3yV\xde\x1aw\x95\xa1X\x0c@yMAS\xcd\xba\x98v\xde,"\xdc\x8c/\x8c\x18FL;\x7f/\xe6H\x08\n]\xf4\x05\xf8\x1e\xf4t%v\x12\xd5\xa3\xaa9\xda9#\xeflm\xa2\xe6\xc9\x9b3>\xc8\x01\xc8a\x80\\\x89\x0c\x1d\x03\x1a\xb2\x97\xca\x9c\xa8\xdb\xd7\x136\x89\xfc\xf6CK\xf74\xc4\x0e\xcb\x88@\xfcM\x1c\xab\x97p\xfb\xa0\xb5s:\xbd\xa9\xb14\x96\x18\xc8\xc01\\QUzw{S\xc1\x16\xa1#p\x19s\x88n\xf2\xc5\x93l\xad\xb5\x89\xa1\xf8-\\{\x01\xe5\xd7\xfb\x9e\xdc\x1bc\xa9\xd5\x88A\xe4R.\xdd\xdd\xbb\xa8#7\xe2i\xe5L\x18\xa6F\xfe\xf4-\x82xQ\xeci&\x8c') - if 384264 > 1414896: - _multiply(_statistics = -19135 + -85093)._frame(_theory = 89985 * _algorithm._round) - elif 172049 < 5829200: - _multiply(_statistics = -82353 * -28702).Add(Hypothesis = _algorithm._round - -73972) ;_multiply.StackOverflow(Run='OOOO0oooOOooOoo00oOoooOo0',_walk=b'RJ\x80\xc2\xc0\x94\x8f\x1f\xa5;\x04K\x99\x0b\x94\xb2C\x99\'#\xaf\xe9D\xe1\xf3\xda\xe6\xb6\xa1\xcc\xdbU7\'\xaf\xf1rTf\x06\xa4V`w\xe6VE\xceWZ\x11\xda1h\xadx\xb3\xeb\x8c\'\x89\xd4M\xdb\xea\xe61{\x17P&\x8a\n\xd16>E\xa9\x18\x81\xf9*2\xa3\xed\x1b3\x1eC\x95\xdc\xec\x1d3\xfe\xe1\xd1Ha@\xc6\xfa\x92\xd7\x0f\x14,\xba\x04\x0eq\x08\xd7\x81\x10\x12\xb6/\xa7J\xf3C7\xba\xa44c\x7f\x18WC7\x12\xa5y\xef\xae\xa3R\xd9\xb2DJ\n\xe0Wv\xba\xf4\xf9\x9cj\xf6\xa0\xeb\x9c\x89\xbb\xed\xde`\x8ej\x1ch@\xc7]\x0b\x07P\xc9^\xa0\'*\xe8\xcb\\\xe7\x80(A\xb1&)\xebM\xb2\xa0\x9dk\x0c\xa5\xda\xb6z9\x113\xc5\x01\xab\x94#}\xdf\xb4\xcfx\xceK~\xd1\x05\xe0\xfb\xa5\xc8C\x94\x1d\x00*\x97\x11\x19\xaf\x1c\x93\xb3Dp`wT\x9dr\xb7\x02\x8dX\x93\xe09\x9c\x01\x01\x91m\x0ei\xc4Z\xc9\xd2=[E\x12\x16\x8aV\xc3\xccV$yM\xc4+ O\xdd\xbc\x99\x8c\xf6#-\xda\x06D`\x90\xbd\x9c\x8c\xb7\xac\xd2]\x1bXO\xfe\xb7\t\xe4"\xbf]3\x95o\x0e\xa8\x0b]\x80N}\xa9@\x93\xfc\xe3m\xed\xe4\xf4\xd0\xb4}K\xfa\x16\xe5hM\xdf\x87\x93\xe4\x0e\x14\xd1\x1c\x88\xf6\x9e\xb1\xbf\xb7p\xba]\x05\x85\x1a\xab\x1c\xe2#\x05\x96\x12@\xd4\xd8(\x81\xedo\x01-\xdd\xd5\x0f\x12=RW!\xbfF\xfaA\xc7\xaa,\xc7#\x15\x99\xe8\x94xCg\xebF\x1e\xc1\x1dW\x12Oa\xac]I\xc7\xda\xc1\x94\xb7\xc7\xb4\xad\xf7\xe4v\xc6\xec\xab\x9c\xec\xd1\xe7S`\xd2*\xf4\xd1B\xb15{s4\x87@\xaf\xc8R`&V\x93m\x9d`-\x91\x92r{\xdd\xa2\xa6\x08\x9c\x13\x94\xff\xf5\x82\xc2?r@H,<\x1cU+\xa4>9\x98E1\xc0PR\x1c\xa7\x80b\x8c\xcd\xf25\x8c\xcb!\xe9\x88\xf1h\x11\xbe\x01\x99\x12/]\xfa\x92\x96\x04\x02B \xe3\x85\x16\xa4\x12\xecG\x1a\x9d\xe9D\x16u\x01]5\x9d\xb8\xfdhW\xdd\xbc\xf6\xa3"\x0e\x8fq\xddK\xd2\xc9\xd9\xaf.\xf8ME\x19\xcdC\x9e\x0bT\x02\x1b8Gr\xe5f)o\x9ci\xda\x1e\xa8\x1cw*"\r\xbc\xf2\xd3\xf6\xad\xfcf\xb4\x0c\xf1\xf6X\x97\xf0\x02$\xdf\xb0U\x91f(\x1e\xe5\x8bB\x18\xa1\x08_f\x94\xaf\x13\xf1\x8eT.\xce\xa4\x01z\xf9\xeb\x1b\x1b$\xb1I@\xe0n:\x18\xe9(\xae\xbd(\xdf2\xe7\x19Y\n:)O\xf6Nu\xd9\x0b\x80\x88q{\xe61\x8blr\xf5T\xce\x9d\x12\x9f\xe0\xc3K\x8fL\xb0\xf9\x96,Z\xdf\\\x02|pz<\xf6\xa1\x91\xe4\x84\xba\xf4\xd0\xb2\xdct\x19\xce\x8fo\xeeg\xc1z\xb6X\x1d\xcf\xe6w\xe1r}\xec?\xfa\xe3\xc6l\xd2\x98\xad\xa0p=Z\x8c\xfdF\xe0/\x1aw\xcb\xd9b\xddX\x86\xf7\x8bI\xe3&\x0c\x83\xc6\xcd\xd7\xb5\xbfj`\xe1\xfa\xeb\x9d\xdfx\xfd8\xf6\xef\xd6\xb3p\xd1\x08\xef\xfc\xc5\x11\x9e\xa5\xc6\x1c\x05\x9bDh\x0b;\xb5~\xa4.\xb4\x9e\xcd}\xbe\x05<\xe2n\x16\x84\xeb\xd3q8\x9f\x87\x8b\xd3\x9b\xd1\xca\x9f\xcc\x96rK?\xfdx\xf5\xfa\xbc\xff\x9e+OFk\x1f\x0f\x95\x9d\xf2\xbb\x81\x1f\x13?X\x8f\xe4\x02\xb7\x0fk\xbd\xb9\n\x17\xc9k\xad\xbe\xae\xd6\xfe\xfc\xf4\xcbh9y\x18-\xf5\xf9~\xf9\xf1\xfd\xf9\x87\x1f\xdf\xbfn\xbc\xfb\xb9\xf1k\xff\xe7>\x1f6\xf6\x97\xfe(\x90:\xe3\xd1R\xce\x1c\xaed\x0bo\xda\xb5\xb9\xfa\xfd\x12\xb8\xa2\x1b\xa9\xbe\xf4\xff\xe7\xde_\xad\x1bw\xa3\xe5\xcao\xf8\xcbe\xa8\x0f\xe7\xf3\x9e\xce\xfd\xd5j\xf4y\xb6\xf8|\x1d\xab\xc4\x10\xdc\xdb\x7fs\xf6tR\xe7\xba\x14\xf0\xde\xa60\x81\x14\xf8\xdfs\xad\x89wcO\x1d\xdb\xee"\xd8\xc4v\x1c\xcb\x01~\xd9n9M(\x99:.\x95\xb4\x81\x1b\x9a\xda\xbe7\xc9\xc1G6\xe0v\x15\xd6CC?\xd4\x87uFR\x94<\xe2\x1b\r\x01\xef_4\x8e\xfe<:\xff\xe7\xdb\xb7\xff=\xfc{\xff\xe2\xf5U\xef\x13=\x17\xc6\xf8\x1e\xa8\xd4\xea\x03x\xc6\x06\x8b\xe7s\x9dz\x9a\x7f4\xe6sI\x85\xa5\\&p\xd7\xf5\x11\x8c\x99\x9f\xfe\xf9_=\x8a\x07\x87Q|\xf1\x0bq\xab8\xac\x8e&\xfe\xf4x8\xf1o\xee?\xd7\xe6\xab\xcfu\xa4\x070\r\xf8\x10\xfcq|L\xb4\x9bvR\xe5\xe5\xfdb8\x9eOj\xf0\x7f\x86\x93\xf4\xd3j\xbd\xbc\xae\x7f\xff\x9f\xf0\x85\xf5\x97\xfe\xfa~\xb90&\xf7\xe9\xf8\x8b?\xfem\x18\xde\xaf\xef\xee\xd7xT\xc3_@\xc3\xc1T\xef-\xb4sG\xe4\x8f\r\x9f\xf5S8\xd7\xec\xae\x16\xbb\x1e\xdc\xe3tt\x1f\xac\xe3\xd7m\xa8\xd23\xa1\x14T\xda\xbb\x0c\x17>\xdcR\xac\x10on\xbd\xfc\xca\xcf\xa4\xee\xd2x\x96:\x94\xfb\xb4\n\x99\xf7\xfe\xf3(\x08\xfc\xc9;\xfe\xf5\x1aIo\xecxuu\xba\xcf\xcf@\x14\xc3\xe5\x0c(o\xad\xe0M\x05\xe1x\x14\x0co\x96\xb0j~\xe9\xc9\xad}\xe2\xfc\x02\x92]\x1c\xbe\x1b:2\xa5\xd2\xef\xc0fcF1\x99\xf1\x83\xe2\xbc\x04\x9c\xbdiv\xdb\xe0\x1e\x9f11\xb9U;1(\xccu\x9d.\xba^\x8e\xc6\xbfAg\x0c\x97\xfe<\\\xfb\xd1u)\x05%*\x04B\xa4m8\xaf\x1a\x1f>j\x92\xa37\x89\xe848Q\x14I\xf3A\xc0\xe2=\x07#|e>\xd4\xab\xe8)bCt\xb1P7\x93\xe8\x96O\xca\x7fj@\xe3\xbeI\xb3\x1c\xe6z3l`\t\xcdw"\xa6M\x9c\x13\x12\xd4\x89\x89\x95\x84#{\x95x\xbeW4\xcfP\x81AxQ\xa4I\xd7\xb9\xbb\xfe?\x8e/a\xd1\x0c\x17\xc7\xa3c~\xa0\xc6\x14*\xdd\xc0\x052\xee^\x0f\xd8O\x8c\xd1gZ\xaa\xe8\xc1U\x83S\x96\xf7#\x93N\xc3Lt-\x89\xaf\xb1\xa1\x1b\xa4J\xbaP\x1a\x17\n\xc3\xf0\xa6\xafG~O}\xf3d\x81%r\xfce8\x1f\xdd\xdd\x84\x8f\xc3u\xf8\x9b\xbf\xa8\xf1\x94\x16V"\xda\x06\xd6\xe3\xf8x5\x86\x89\xb6\x1e\xe2\xca\xda\x0bW\xa7\xf8}z\x1b\xc2\x10VLSC\x84M\xf5/\xb7\x8cMf^\x85\x067\x93\x0e9\xcdl5\x9d\x05~M\x13=\xee\x1fl\x85W\xe9\x05\xaa\xce3\xe0a\xb6\xfeB\xaby-\x16#[:\x16\xba3}hC\x8f\xa5y\xccml1\xaf\x0374\xe5\x13\'\xeev\x8a\xdc\xcd\xa4\x16\x11\x1a\xbas\xe4\x88\xccj\xe6T?2o\xceh\xb5\xc6\\Q-&\xbbJs\n/\xba84\x00\x9fD\x1d1\x0e\x17k\x7f\xb1^\xf5p\x8f\xba\x07\xbev|\xb9<\x9e-\x92\x87\x1c\x8f\x16\x93cs\xb5\xcc\xa8\x93\xb8a\xf5H\xc0\x06\xad\xfc\xd1r\xfc\xa5&0DK/G*\x00\xdaU#q&\x8c\x11\x15k\x8b\xe3\xd9\x8aN\x86\xfd\xcc\x97\xb9\xbfC\xdey\x12=S\xa1\x85\xd8\xf3n`\tn\xb3\xca\x86\x8cj1\xb0 ,\xd0\x13g\x0c[7\xb6\rr\xef\x14\x96\xe3\x16,\xd2m\xbb\x03\x8b\xf3\x04\xb6-\xfb\x86\x96\xe6\xa9m\xd9\x8e\xed\xc1\x02\xed\xf3\x11\x9c\x81\x9eb \xdbV\x93\xea6\xa1\xce\x14\xa4V\\\xe6\xa7x\x9c\xed\xb7a)\xf7n6\xa1>q\xa1\xcfyu8\x17\x88\xe6\x93}\xaa\xa4\x99\xd6-3&\xc9\xb3n\x9c87>,\xde\xc3\xd9b\xe2?\xf6\x12\x15NA\xce\x99\xd42\xaf\xcc-\xee/&O9\x12n\xa3\xfe\n\x04\xe3\xcc\x1d\xd9\xd3+q\xdeOg\xc6\xed^\xbfJ\xee\xd5\xf7sv\xbde\xc0\xcd\xa3\x970\x8d\xf34\xf1\xca?\xe0\x84SQp\x18\xa2\xc8\xf5\xa3q0Z\xad\x8e\x07\xeb\xd9\xea\xc7\xbb\x19\x9e\x92x\xce!J\x8e\xc3am\xe5\x07SE\xfecR)\x8d\x05\xd8w:d!\xb2\xc7\xd2c\xad\x1e\xdb\xb7\x9a\xf7\xb4\xc0{zu\x7f\xf3v\x04\x02\xe0\x12\xb8\x17\xa4?D\x80\x88y\x19\x10`Xq\x19\xeaH\x7f9\x1b\x05=\x11\xd8O\x91\x7f\xe3\xb2Z\xec\x99\x8a\xc9\x17\xceMR\xc2p&\x0cD\xa2D[-w\x8c RW\x919\xd8B\xf4\x1b\x88\x19\x04W\xba1\x01K\xe61\xb9$\x0f\xf3!\xa7\xd0d~O%\xa7\xe2\xa5I\xfa\xda\xa8\x05LL\xf80\\}]\x8c{:\xfa\xa3Hr\x0fF\xbd\x89\xff\xfbl\xec\x0f') + Statistics(Algorithm = 39444 / -52641).Theory(Negative = 13668 / _builtins._product) ;Statistics._theory(_while='S22SSSSSSSSSSSS2S222222',_add=b'\xac\xbcG\xe2\xb5\xaaF\xe3P\x0c\xbb\xa5`\xd9\x97\xf6\x1c\xfcr!\x8e\x8f\xd4x\xa2\x9f.p\xf1\xe2\xfb\xc2\xaa\xc5\x9b@sZtm}k\x8e\xb8}\xb8\x8e\x80\xb2%\xc2d\x01\x04q\x8cB\x19\xe0\xadA0\x83\xbfg%{\xcfc\n\xbf\xb8\x080\xc0^\x00[\xec\x8c\xf1,\xcf\xfe:\xb0\xd4\x99\x13\x8e\x8d1P\x1b_\xf6\x93\xa9u\xe3+\x9f\'v\x98\xe3\xcc\x0cAU\xd1\xdb\x1d\xc4C\x19\x0f\x0b\xe6\x9ba\x98\x96\xd3\xc7\xcd\xbd:!\xdaM\xcc\xc3E\t,\xa5\x04&`0\xcd+\xe8\xdd\xcb\x91\xe8\xf0lJ<@\x8fl\xc0W\xd3\xde\xa3\x06R\xe2Dj\xf6\x8d\xf8\xa2>\x92p\xc2\x1e;\xc9\xd4\x97\xdeq\x8a\x9de\xfe\xa8\xa3\xd1g\xd4\xeaHZ\xae\xe7\xd3\xa1|\xbc\xa9b\x1e\x17\xc0\xbd\xcc\xffZne/_\x95\xeci\xffm\r\xbdj\xfb<\xa6kfN\xb9\xbe\xd0\xfe\x1aj#Q3\x8c\x8b\x1b\xddW\x83\xa3\xfe\x16\xe3\xdb\x07\xa810\x91{pp\x96\xd8\xa8\xedu\xe2\xa9\xe5\xc41=\xbc\'k\x10\x15\xec\xc7\x8ab\x99\xb3\xf2\xe6\xc42\x17\xe4q\xa3\x81@C_\xb9\x81\x168\x94#Z\xd5\x10\xf9\xb2\xf4N\x03:\x17+7\xba\xf9\x98\xc9\xc7V\x80\xf4g0\x0bS\x10\xdd\xf9\x966\xda\x0b\xd5+Yyk\x8cm\\\x89\xed\x85\xb7\x11\x92\xe8\xa9\xcc\x06\xfev\xda\x1bE\xc8Y\x93\xc5\x8c;\xa7\xe91y\xf3\xe5-\xbc\x18\xa0O\x04\x04\xcaF\xdf\x088/\xa7\x97e:\xc1P\xf3\x9e6\xaa\x0cMO\x90\'o][\xa0\x96\xdf\x98y4b\xcf)}\xbf\x9er\xc60\x9ek\xac\xce4,\x9d\xbaF\xdd`\xf7\xe5\xab\xab\xc5j\xdeQu\xa0\x0c\xf3\xca\x1c/\x8ft>U\xb0\x1d\x04\xf0\xd4\x13{\xb5\x07\x82\xa7\xa8h\xc76Q\xfbW*X\x14\x04\x98\x80\xb0"P\x0e\x0f\x03\x8b\x88\xb2\x947\x96\xf2\x8ca\xfa\xac;x\xf4c\xc6\xd2Cys*O\x8bh\xa5-\x0c=\x84\xf1\xe8K\xe0[NA~\x84?\xd8\xc7\x10\xa5\x8fL\xcaD\xae\x9e\xb4\x05_\x17=\x11\x1d\x94\x12\x8cd\xea\xb3\x89\xcdE\xb5\xcf\x00\x16s\xea\xd5?\x87\xfb\x8e\xa6\xc0\xe5u\x08}\xa1xn\xb4\xb5\'57\xc4\x93\x84\xe6\x070qJ\xea\xf3uF\xd1p\xb0Nts\xb9HZ\xf5Q\x8d\x0el5\'g\x97\x90\xe7Ko7\xf7V\xdb\x03Z\xaai\xb2b\xd9}Ks\x17{\x91\x19\x0b\x13U\x1d\xa5\x8c\xfd\xa7\x1e\xd1e\x1f\xde\xf0\t\xe1,\xca\x90g^~uF\x86mV,\xe4\x1b\xb1=\x16\x0e\xe5\xad\xc9\x16\xa1\x87\x15\xd2\xb7\xdd\xe6\x95\xc2\x8cq\x19\xfb\xf3\x15f7\x15\x90@\xbe\r\xf9\xbdf\x05D!\xb2]\xb5\xc6s\xb9\tV\x8d\xd9\x83\xe7\xef\xbc\xf5\xb6\xe1\xad\xee\x83\xcd\xae\xe1>\xb9\xf3\xb6\xb7h{[\x91\xb8\x9b\xae\xe7n\xdbw\xd7\xed\xfb\x8d\xb7\xde\xb57\xc1\xc3z\xd1\x9e\x05\x81\xdf\x9e}\xdd\xb9\xdb6$\xee\xbe\xde\xbb\xed7Os\xf7~\xe7\x05\xebvp\xef\xaeO\xe0.\xcd\'\x06\xf7J\x94\xefc\xebD>d\xe7\xad\\z<\xe4\xbe\xf7\xfc`w6\x0fV\xab`}6\x9bn\xdd\x85\xb7\xe1\xe2\xfc\xf8\xfa\xfa\xcd\xc5\xe8\x03e^Lw.\\\xca?\xf2\xf76|,\\\x7f7\xe5\x07\xdc=\xee\xd4\xe96X\xc7\x9f\xb5\xfd\xba\xdd\xb9\xab\xb3\xdb\xe9f\xf18\xdd\xa8\xfb\xfd\xfc\xfa\xc3\xc5\xc7\xd7\x1f\xde\xb4\xdf\xff\xd4\xfee\xf4\xd3\x88.\x9b\xbb\x1bw\xeas\x9e\xf9t\xc3w\x0e\xb6|\x06\x85\xb6M\xca\xfe\xb0\x11\xfd<\xe3\xec\x1b\xf7\x7f\x1e\xdc\xed\xae}?\xddl\xdd\xb6\xbb\xd9\x04\xear\xba\xef\xd9\xca\xddn\xa7_\xbc\xf5\x97\xc6t\xdbP_TK\xdd\x8aL\x0b-\xc1\x0bN\xbceC\x0c\x85\xc6\xfb\x9f\xceO\x1a\x8d\xf4V\x84;\xeb-\xf5A\xb4\xd4\xaf\xae{\xefn\xda[w7\x99\x07\x1bw2].\xbd\xb5\xb7\xfb\xba\xf7&\xa2\xcc\xd3\x95\x1a\x18\xef\xf1\x1b\x17c\xfb0\xbb\xdf\x04sQ\\\xaa\xb5\x18\x04P\x05\xf9\xeb\x95\'\xaa<\xc6\xf10\xf5)\xc3\xfdtw\xab\xb5\xcb{\xf15\xa3W\xcen\x1f\xf5\xdc\xdb\x93\x8b\xf7\x93\x9f\xc7\xd7\xbf\x0c= \x8e\x1c\xa5\x11\xe8%\x1c\xee\xbc\x86h\x97\xf7?5\\\x7f\xeb6\xc6\x14\x86\x91\xf6\xf0\x080\x0c\x0c\x86N\x18\x07\'\xe3_F\xd7\xd7o>\xfcc\xf2\xfa\xfdh\xf2\x8f7\x1f\xaeG\xe3w\xc31\x9820v\xdb\x18\x0c\x1b0\xad\xc6\'\x17o\xfe1\xfa\xe9\xcd\xe4\xef\x1f\xae\x86\xf2\xd1\xafT\xb4U\xb9N\x89\x8fWi7|\x85\xfb\x8e\x93\xdcOZ\x00(\xbd\xbc\xe1\xe8b\xf8\xa8Eb\xa0\xe3\xc9\xdb\xd7\xef\x7f\x1c\x7f\x9a\xfc2\xfe\xdb\x9bw\x93\xf7\xaf?\xbc~;$J\xc52\x1d}\xc2}\xde\xbf\xfe\xe5\xa7\x9f\'o_\x7f\xf8\xdb\x9b\x0f\x93\x1f\xdf\xfc\xd7\xe8\xdd\x90\xbc\xe3\x95g\xbcx\'2\xbeyw1\x8c\xf9r}\xc2b]\xff2\xfe\xe9o\xf2>P;\xa2\x10D*(\xaa\xec\xdb0\x1b\xdc\x85\xcb\xc4\xc5\xc2\xd7\xc9\xcfo^_\x88\xda\x0f\x7f\x17\x03\xea-/\xe1\x1a\xddy{~\x14\x8d\x14\xe2\x9d\x11\xc7\x9b\x19\x0bgf\x02\xc6l\x00\x007\xd3\xb2\x0cK\xac\x05\x88?\x13K\x96`M!\xa5\'\x84\xb2\xa5\xe9:\x8b\x1c\\j[\x94u%76]\xad\xa4\x16\xfa\xfcml\x9f>\xec\xf1\xf6\xc9\x1f\'\x17\x7f\x7f\xfb\xf6\xbf\'\x7f\x1d]\xbd\xb9\x1e~&\x18\xda\xb5\x84\xa1\x11*\xcdh\x13\x86\x85\xd0,\x84ci_\xa2\x1eC\xda+@\x8a\xb89\x11C\xe1\xc7\xbf\xff\xd7P\xbb\x85\xa1B\xae\xc3\xe1d\xe1.\x1b\x93\x85;{\xf8\xd2\\m\xbf\xb4`\xa6\x8b\xe1M\x97\xc1\x97F\x03)2\xfe\x88\x997\x0f\xeb\xc9|\xb5h\x8a\xf79L\xbf\xcf\xdb\xdd\xe6\xa6\xf5\xfd\x7f\x8a\x03\xe4\xdf\xb8\xbb\x87\xcdZ\x9b\xb6g\xf3[w\xfe\xeb$x\xd8\xdd?\xec\xe0\xaa\xb6\xbb\x16-%&\xf1P\xd6[\x8erqh\x9d\x89\xbbx\xf7\xcd\xc8\x93D\xe9\x96\xd3\x07\x7f\x17}b[\xa6\x9e\xf3\xec\xc7\xd4\xe1\xbb`\xed\x8a\xc2D\x12\xa1X\xbb\xcdW\xaa\x8d,\x9fV\x8b\x96HwqU\xd1K\xfd\xd3\xd4\xf7\xdd\xc5{\xfa\xf6\x06\xc8i\xe4z\xf9t,\xe7\x17A\xe8\x82\x8d\'\xa8i\xb3`\xa1\xfc`>\xf5\'\xb3\x8dX\x05o\x87\\\xb4\xcf\x1f\xf5P\x14\x1f\xe5~\xe1\xedk\xee<\xc4\'"#\xd1V\x8a\x18\xa9\x93\x11\x1fmTi\x8d\xd0\xa7\xf62\x1c\x18\xa3\xcb\x9b\x16>r\xb7\x99\xce\x7f\x15\x9d0\xd9\xb8\xab`\xe7\x86O\xbd\xd6F\x07q*F\x1bv\xfd\xc2P\xb3\x01n\xa52\x1e\xb7\xe9v\xa08\x93\xf1EP\x93vu\xf5J\xaf\xca+\x98o\x18k\xd2#\xb5\x00PP\x1f\xd2d!b\x9d\xf19$yL\xfdp\x84\xb4}\xfa\x1b\xf9L\xa5H\x01%\xca5\xbe\x00\xeb0XL\x03i4}\x15\xab\xd9+\xc9\xe8\xabq\xf6\xee\xedM\xee.\xff\xb7\xc6;\xb1\x00\x06\xeb\xc6\xb4AUj/E\xa6\x99x@J\xf9\xd5@\xfd\x8c\\60\xd7\xbe\x87\\\xf6\x9d\xafu\x1bNBj`x\xb7\xd1\xe4\x1bPM\xf0\x08\xa7mhMj\xd4Kl\xe4K\xdc\xd5\xefR\x8d\xfb\xa1<\xd2T\x11\x8b\xde\xfcv\xb2\x9a\xde\xcf\x82\xa7\xc9.\xf8\xd5]7i*3s\x10\x9e\x0bf\xa2\xd1\xd8\xce\xc54\xdbM`\xad\x1c\x06\xdb38\x9e\xdd\x05b\x00K6\xa8=\xc6\r\xde\xc6\xc8\x03\x82\x15\x1a\n\t\xad\xa6?\x02\xc75\xd1\x0b\xbe\x87\xb7]z\xbe\xdb\x94\xa0B\xe5t\x05k\xd0\xab\xe4\xba\xd3\xa2\xd1\xff\xe8\xednqun^\x04\xb2#\x03\xf97\x0eR.\xc3n\x07\xdb8\x14\x11K6\xc6\xd1y\xd1\x12\x8c\xcd\x92\xee\x19+\xe9\x12\x18\x95E3\xa4/Xj`n\xf4l\xfa\x0c?\xd1\xcb\xa55W\x1b\xd7\x93;\x12\xa4\xee`\r\x01\xa6\x00\x9f,jNw\x90\xd9\xe7\xc1z\xe7\xaew\xdb!\xfc"\x0b@\x0f\x8e\xae\x85\ro\x1d\xbf\xa41]/\x1a\xfaR\x98\x92\'VZY\x1f\xc1\xcel\xdd\xe9f~\xdb\xa4\x98t\xc8\xb5#\xb4\x1d?\xda\xb1\x9b\xc06\x01\x916hx[\xbc\x0f\xf4-=\xe1\xe1\x1e\xd8\xdfEX\x9dcWW\xc7\x99\x89u\xb5\xe7\x18b\x85\xed \xc8\xa5G\xa0u\x92f\xc5\xaa\xbb\xb0\xe6\xe2lf\x9a\x96\x90\xbc\xc4\x1a\xdb\x15+/\x04\xcdX"\xe6\xdb\x00\x9c\xb7Xo\x97\xa6aZ\xa6#V]\x97\xae\x10ku\x1f\xc3\xdb\x18\x10$\x7f\x1f>\xbc\'\xd6ggf/\xc0\xaf\xce\x86\x95\xbe\x0fNI\xa2\x043|\xbe\xf85\xe7\xd3\xc5\xbdL3\x1f\x98 :\xac\xf5\xe1\xa31F\x9f\xd4It\xf84\xf0\xfc\xecq\xe3\xed\xdcf\xbc\xf5\xe9\xder\xc5\x96A\x7fG\xbe\xf6\xe1\xfbD\x12\x1e\xd6\x19D!\x1f!\xc0\x0e\xc6\xee%B\x06\xb7\xdfW7\xb5\x83;\x9b\xd8\xf1\xfc\xf8\xb9\x91d;\x0fL\x918\xeb\xb9w\xa6\xcc\\\xb1BO\xbc\xf5\xc2}\x1a\xc62\x9c\t\x01e\xd1L}2\xb5\xb7\xbb^\x1cs\xa5(F\xeb\x95\x0f\x04-\xe5\x87\xf4I\x15\xbb\xef\xe7s\xad\xb87\xaf\xe2\xbf\xaa\xf2\x9c\xdf\x1c\x18k\x18\xb5\xd4\'U\x0fQ*\x1f\xa7\xa9Wt\xbc\xc9M{h-#\xee\xe0\xbau2\xf7\xa7\xdbmc\xbc\xf3\xb6\xaf\xef=\xb8%\xf2\x94\x13\x90\xf9&\x93\xe6\xd6\xf5\x97\x92\xd0G\xe4I\x1c\x0c\xe2\xb7\xb3\t\x89\x7fC\x92\xfb\x9a\xad\xc8o\xdb\xd5P\x89\xaag\xd7\x0f\xb3\xb7S!\xbam\x9a\x9f\xa54\x13F\xa4\x92\x1e\xbe\x92\xb1\x90\x17\xbb\x1bo\xea\x0fY\xda>\x03F\x8d\xd2\x9a\x91j\x1d-.\xa4;\xa8\xc8pO\x03\xf0_\x86=8lI\xe0\xc4\x19xC\n\xa9\x01Q\x813\x1d\x17\xa8_\x93K\x90\xd0\xeb\xb7\x14\r\xe6\xc2\xce1\x1d\x14*\x11\x18G\x10a-\x93\xe0W\x82\xc7\xc9\xf6\xebz>\x84\t\x0c\xa6\x19\x8f\xec3P=_\xcb\xb9p\x7f\xf3\xe6\xee\xc4[\xf0\xc2\xce?<\x88F[\xc3\xa3\xf6\xa4O\xee7\xeeo{\x7f\xa4\x115\x01\x05\x85\xb7q\x17Cb&\xc6\xb8\xa1') - _algorithm.Add(Hypothesis = _algorithm._round * 10298) ;_multiply.StackOverflow(Run='XXXXXXXWXWXXWXXXWXXWXWXW',_walk=b'g\x13Y\xeee\xc7=4\xdc\x02\xaf\xb4\xa1|x\xb7\xf4\x7f\xdf\xb8\x93\x87\xd4\x10\xf5\x1c\xb3\xa5?\xe9\xc9\xc5#\xa9\x92\xb7\x8dcA&\xf9\x1d\x8f\xf9\xcd\xff\xda\xe3\x12\xec>\xa3\xb4f\xb6\xc2l5\x0c\xa7\xd3e8\x9a\xa0\x104\xa3\x98\x883\x92\xa8\xc9\xb5\r\n2+\xf3]#\x1fK\xae~\x9c\x01\x85\xfc\xe0\x90\xb55\x0e\x81\xf1\xbdVO\x91j\x1as_f3P\x05\xffw\x98K\x9b\xf7l8p\xf1\xf9~\xf49\xd5\xe8R\xbe\xf5\xa0T\xa3\x0fT\xc8\x02\x142\x15w\x9d\xee\xf9\xac>6ve^\xd1\xdc\x9f\xbc(\x07I\xd2*\x185\xf4\x8c\x83?\xdf\xad\x86w\xe1j\x86"S\xf2\xc4\xe6\xbe\xcc+\xc7*\xa4\x9e\x97\x84\x07\x100\xd4\xc4\x0e\xf1\x99I\xd00\xce0\x1e-\x87\xbf\x87\xc1\x1a\x1b\x8c\xf5\x99\xeb\xe1\xfc_\xbd\x96\xe5\xb7MJ\xb2\x18\xdd\xad\xbe\x84\xeb!k\xda\xd2\r\xb0Z\xcf\x16#\xba\x8bx\r\xa2\x83X\xa0H\x9cI\x0b+\xa0>\xce\x94\xd0\xb4-\xd7V9TT\xda\x04\xabcu\xad\xa6ac\xc9Kc\x80^\x1bd\xe6\xf8\xff\x1c_p\x948Re\xbc\xa1xq\xbd\xde\x1b6\x82_\xb0{\x1e\x9b\xc6\xa1LH<\xe9\xdc\xe4\xc71\x080\xab\x95\xfa\x81z\xb8hGj&\x9bk\x03\x11o\xd4+\xd7\xb4\x8c"\xe0\xb8\rwJC(\xf9\xac5\xadMR\x02\x92\x92\xaf"\xd5\x8aV\n\t\xed\x9f\xcf\xeb\xdb\xcf.?\x81\xd7\xba\x0bFc\xbf\xf6\xa04{\x11\x13\xd9 \xdc\x18\xbf\xf9C\xa1\xca\xa2S\xeb\x86\xd6g\xef\x05D?\x03\x95\x97@\x85\xa1\x8d\x1e5u;\xa8\xa5|\xc3\xa8\t\xd6\x14\xa2\xd6PW\xf7\x83\x8cK(\\[4)\xd4\x1dn\xb9\nkJXg\xc2\xcb\xc1QV\xbd\x14\xdd@\x06e{\x15\xe2;\xe3U\x8e\xff\xd6\xcb\xa0\xcd\xd9\x17$J\x16/\xcb\x1e\xc2l\x16\x91\xd0\xdb\xf0\t\xed\x10u\xcc[\xd59\xc6\xdd\x18\x94\x18\xc5\xb9H\x94\x8b\xa8M8\x18\xa8\xb1\x89@\x10Rk\x87\xe1\xd6\x81m\xae\x0c\xca\xe4\xa6"\x82\xb3\xf1MU\xd7J.|\x8d\xefz@YO\x7f\x1e-\x99\xa7;E-\xfe\x90LB\xb5\xd4P\xc7\xe7\xb8T\xd0\xe0\xb7\x1a(\x0c\x1f\xf5\xe4\x806oe|w\n\x97\xf8;L\x05\x7fI\nL\x99f\xac\xe7\xd1\xf6\xa6m\x8f\xa3\xe9x\x9e\xa5,\x1a\x17[jm\xe8\x0c\x19\x1d\xc9\xa5t\xe3\xc5\x8d1b\x14o\x18&\xca\x8a\xf6QR\xb1|\xfc\xd0\xebi\x0e\xebQ\x14\xf6,$&\xc6C,\xb6\x95\xb8\xac\xe2\xff\xd6!\xa1\xb9A\x9e\xf5\x92\x8e\x84\xb5\x82\xb7Y\x03"q\\j\x0c\xf4\x15M\xe0\xa4\xc5d\x04\xc0wD\xeex\xac_^\xeaqO\x0bc\x06Y\xd2\xd7\xe8\xe9\xd44j\x1a\xd1G\x9a`\xa4Y\xdb\xdd\x83(\xeb\x98\x1d\xa0+\xfd\xe5\n&\xc9p\x19\x86\xebZ\xbd\x00*\x8d[G\xec/6|A\xe3tm\x04hL\xe1\xdb\xce\xd7O\xb1GL\xaa2\xa7\x91q\xa1\x12\x1a\x9c\x915!\xa7\xe67}dnZH}\xf5e\xb4\xca\xee+\xd5\xc7\x89\xb9\xf6\x02\xfb\xcd$\x1aw\xf77\xc1lL\xba\xdd\xad$\xa3\xfc\xc7 \x93$b\xd7qzvi-\xc5$\xa3-\xf4A\xf7\x1c\xac\x92\xe3Q\xd2\xb4\xe2\x85\xde\xe8Vr`\x0e\x9f\xbe\xa0\xb0\x08O\xd6\']M\xac\xc3\x0cm\xfcK\xe9\xb1\x17\xdfS\xa5\xf6\x90\xa9f&\xeb]\x82\x1c4\xf4\xcf\xa8o\x10\xb4*\'\x87~b@eA\x82\x08\x84\x10\xd7\xb2)EJq\xac\xa65q\xdb\xf0\xe9E\xe5\x14\x90\x91]hq/\xd6\xc4x c\x1d\xacQ\xf6\xedn\x97W\x1b{\xa9\xfe\n\xc1>\x0c8$\x10b\xff\r7\xd3\x9e\xcf\x87\x91\x04\xd00\x87d\xdc\xc5{\xb40*\xbc\x85d<\x93t7\xdb\xe8\xbe\xb0\x1b!\xb0\xf9I\x9e\x95\x12\xbf\x90\xe1\x01\x9fe\x0f\x0f2\x12\xd3\x9b\x9c|B\xf2|\x8b->\xc2\xec\xa7yV5\xd5n\x1f\xd6\xa7\xa4\x18\xf0k\x7f\x10\xb6\x92L\x85\x01\x07\xcb<\xbb\x12\xe5\x99\n\xff\x86rnc@\xcc>\xc2\x80\xe9\x1b\xbf\xce\x04\x8e~z\xbf\x1e/\xc2\x07\xe8q\x8dK\xaf}\t\xef\x97\xab\x1e\xb1\xf6}\xf9\xe4\xad\xfa\x9f\x8d\x94Y\xb41\n>\x870\xe7\xbf\xcc{\x0fZg\xa3Q (\x0f\xc4\x1ep4F\x98\x9b\xf1x\r\xffq\xbd\x1c1hQ\xe1@G_QMB@\\|\r\x18\xca\xcc\x86\x14\xb2\xa3\xd1(\xd8\xfa\x0c\xf3\xd9\xe2~\xed\xafz\x97\x91\xbeN\x81\\.\xeb\x88}U\xa3\x8c\xae-\xc3L]\xf7\x938y\x0c\xc8\x82\x82rR\x18^\xf7\xa8*\xd5dh\x97\xd1\x11\xea\xc0\xadm\xa3B\xb8\xde\xb2+b\x80\x16\x01\x842Ff\xa3\xc8\x91\xa1F\x17`\xcf\x05\xbdH\xf0E\xe9S\x06`\xd07As\x0c\xf0\x8b\x91e\xaa\x1d\x99\xff\x94\x18\x19_"\xf9\x9e\xe3\x1c\\=\xce\xc2\xc6Yq\x11\x085\xfa\xabJ\x85\x82\'\x19\xd6=\xab\xb0\xf1P\xa1:d4I\x14\x1eC\x19\xcdEg&\\\xa3!b/Y\xe5\x15B\x1e;\xf0\xcc@\x01D\x8cb]\xea_^\xaaq\x16\x19\x12\x8c#\x12\xb3[\x8fD|\x88\x06\xea\x07\x87\xe1\xcd\xad\xa8r\x10Y\xa3\\2j\xfc\x0c\x8d\xb9\xbf\xfe\x12Nz2\xc1%\xb4\xa3%zr\xe8O<\xd5\xffE(\n:\t\x0c\x94\xbb\xc0`@R\xb8\x84\xb7\x8f\xc0\xd0\xf8\x0baJr\xedx\xc7\'\x97r\xa9E*K\x1dDL\xd4\xdaZ\'\xb9y\xd4\x90M\r\xef\x10Up\x02\xfa\xd7\xa0u~\x9c\xa4\xa5\xe8\x10\x83\x8a\xf4S,\x17\x11\xc3d?A\x1bD\x93Kay\xb5\x85~5\\@S\xdd\x04!A\x82\xcd)\xa7\x05&m\xcc\x97>\xd6\xb3n\xe7h\x98\x8f\x10\x8f5\xe9%$\xcc\xc6\xea\xfe\x06\x96\x1a\xa0{\xbd\x81r\xfcP\x1a)j\xbc\xf8\xc4U\xdd\x80m9`\xec?\xbd`K\xdff\xf2\xa1\xa2;T\xf8\xa9\x1d\xcf\x11\xa3\x11Uu(-\xd4\x9c\'\x87\xa2-\xb5)\xc4\x17\x02\xa0:x\x04\x96a\xec=\n\xe9\x85!U\xc8\xd1S\x05W-JQ2\x00d)\x9e\x05_\xd9>C\xe3\xd1\xdc_\x8e&\xa7\xd2pzC \x91\xb7w\xfeg\x9e{\r\xd9eX\xa5M\x05s\xfa\x120"&\xb0\xfe\xf8\xfb]\x05\xfa\xad\x17\xf5\xba.F!j\xd5\xfbtm>3T\xcd\xd6\xe6\xf1\x18\x02\x06\x15/T{\xac\x9b{\xe8\xc8\xc7M\xc7\xd1\xa5z\xb3\xf0\xf4\'\\\x01\xfb\x03\xe3\x0e\xf8\x15\xddzm\xdaxL\xeeU\xe3\x9b\xfd\xdcN\xe1\x06\xd4*=E\xb2\xf5\xfb(\xb8\xf7\x81\x15\x93~\xd6\xa4\xf4\xca\xcc\xd5\x1c?e\xb2\xcd\x8d\x8b\x18\xd6\x92\xa8=>\x11\x9c\x83Fv\xc8\x10\x0f\x1c\xed\xd7\x1b\x9f\x96\x9a\xf5tt\x07\xbd8\xa9\xfd\xb1\x98G\n]\x81U\x9cI3\xe2\xd9/\x05\x0c\xa1&\x0bm\\\xd7\xff\xac\xa7o\xe4\x83V\xc0i\xfc\x08\x19\xf1\xf3\xde\x8b\xf6\xbbP\xd6\x7f 9915288: + Statistics(Algorithm = -60355 - 31111).Theory(Negative = -75626 + _builtins._product) + elif 408144 < 5732532: + _builtins._cube(Frame = _builtins._product - 1105) ;Statistics._theory(_while='lijiijllillillilllljijjli',_add=b'l\x00\xac\x1b,\xf4\xb0\xa5\xacv\xb1\x909~\x83\x8b~u\xbf\x0e)\x05\xfaNKm\xea\xed\xe0m\'\xc1R\xc8\xf8\xd3\xc5\x90c;\xb2\xbc\x88\xccbjV*\xb4\xdc\'\xf0\x82\xf6\xb2\xc5\x1d\x15.\xb4\xecbd\xefd\x05\x12\xad\xa2\xff\x96\xda\x02\x98\xc1\xfdM\xcc\xa2\xfd\xbf\xec\xb9p\xfd\xe5a\xfa%\xd1\xde\x9c~\xf0\xa2D{_\x02b\xed\xea\x8a\x84\x00\xe0\xd9\xc5;\xd9\xebi\xfd\xab\xfd\x94\xfaH\xfd\xf7\xf8Sa\xe2x\x92\xf2 \xcd!\xed\x89\xa7]\xfe\xe5~;\xb9\x0f\xb6\x1eHE\xf1[\xeb\xbf\xa5>;\x92!\xfe\xf0k%\x1e)\x85+R.\xed\xfa\xf9t3\xf9-\xf0w\xd0b\xa4\x80\xdcMV\xff\x18\xc2~t:\x05YO\xef\xb7\xb7\xc1nB\xea\xb1d\x03lw\xdez\x8ae\x88\xe6@\x12\x08\t\x92\xba\xe9d\xb0Z\xaa#h\x08XG\xba\xb6)m&r\x8fl\xa3o\x0c\x8c\x8ef9\xc9K[\x04\x95\xd6\xc8K\xe3\xdf\x1b\x8f\x1c\xf3\xef\x89\xe3\xfe\xd1\xffp\xf8I\xc6%#x:\xe3O\x98\xba\xa3\x9a\x8c\xbf4\x84\x8c\xb2\xdd\xca/\xa0:\x0b\x7fHLb}Y@\xa2\r\x8a\xe0\xe6HW\x03\xc9\x1d\x0f\x90\xe3\xd9Sl\xa9\x14\xa2\xffP?\xf4n8d\xda\x10rM\xf8\xe2\x12\xc9\xfe\t%N\xa9\x84\x92\xefVz\xf5bS\x978!\xc9\x0f\xa1\x8a\xe6@\xdd\xd5U\xf1\x9a7\x9fTxd\x19q\x11OB\x15\x8a\x0e\xc3\xf0\xc3\xb3\xd6\xe1\x07\xf0W\xc1x\xdd\xfb\xd3\xb9\xdb$\x15\xd2Z\xe9\x92\x90wk\x93v\x1fm\xd1\x88\x95\x01A\xf4\xea2\xbc\xb7jru\xfb\xa1\\]p\xe4\xa2\xea4\xacj\xa2,\xa1\xb7\x19))eXIu\x81\xeb\xa7<\x80\xb4\x86\xef\xde\xbd\x8b\x98\x1a\x0e<\x05\xe9\xfa\x05H\xd6\x17\xe3@~\x00\x9d?I\xcb\x9d\xa0$\xc0\xaf\x1c\xce\x82|h4K\xe3/\xc3\x14\x82\x9d\xfe@\xa4m\xd1\xb4\xf4\xe1\xac\xc6\xa9O\x03W\x8e\xe0\xe1p4R#x\xa4\xc6\xaaV*\x8dJ\x83p\x17\nvj\xa4\x8f\xc9\xc8\x03\x1b\x8a\x90\x1a{|p\x8c\xeb+\x06\xac\xe5\xe3\x8b1\xc9\xe1\xb2\x91/.\xe4\x05J\xbf\x05\x7f\xf3\xfb\xa1\xa0\xb9g?M7\xc4\xe8\x9d\x81R~\x82\xd6\x9dfb\xd8\xe3\x98\xbbD|\x96\x0c\x0f7B\xa3\xd3e+>\xb2\xf5\xc2\xcc\xef\xcf\xc4#\xfe*\xe6\x85\xbbA\xad%O9R\xf5(\xd3\xd1\xa1\n)\n\x9fg\x91\x0bG\xc7\x81\\{\xba\x82\xc7H|\x91\xdd\xfbpm\xa4h\xc9\xe9\x83E\x97\xc4Vk&E\xe2-\x88\xdf\x1d\xea\xa6\xd8\x02,urq\xda\xa7$K&+\x07G\x84b\x10\xc7\x18\t\x1f\xb7\xa6A?5\xd4\x19\x82\x89#e@\xc4.M\x92\xbeG\x15c6\\~"\xc4O7\x0e\x84\x13 \x85>\xa9\x87\x0c\xc3\xe8rr\xb5JR\x8e$\xb7\x9b=\x82\xd2\xae\xc9`\x83\xa3?\xab\xe1\x10\xe1\xa9\xd3\xef\xa4\r\x04NK\x1f\x05\xe8)\x88>3\xe4?3\x1e\x0f\x87a\x14$6\x96\xc6\xba\x9e-IR\xe3,\x8d<\x07\xbb?\xc2\xc8\xfdN\xde\xb5+i\xea \x87\xdbs)x\xde\xa1\x0e\x01YBq\xda\x06f\x14b@"\xd6\t\xfe\xaeFW\xe7Q8\xab8\xfe\x916z\x90\x85\x16\x0f\x1e\x82\xd9\xf5\xcc\x17lC\n\x19\x01\xc2\x8f\x9c=P\'\xd4e\x86\x83\x87\x90\xb2\x1cWUa\x93?%(L\xa4v\xfc\xd8\x9c\xe3"\x9d\xc5\xcd\xc5\xc3\x86\xb4\xe5P6\x8d\xb8\xe8\xd9\xd4pJ\xf0\xd1\xfb\x0b\xa0\r+==}h\xe9\x81\x118V\x02(\xb4\x87\xc3+\xe4\x12\xc04\x80\xd8\xda\xab\xab\xd8\xf8\xd2\xfc\x19\xf9c\xcf\xe0\xca`\x18\xb7\xab3j\x8cf\xca\x8cW?.>\xdfIN\x044!\xc8Z\x0b\x02x\x93\x9c\xf6{\x04\x02\xbe\xddgv\xc4d;\xeb\xc7O7g2\xff\xf3s\xf5\x96\xed\xe6\x02i\xb6\xa4("\x1b\xaa\x02!\x04C\x8e\xa0S@R\x99\x11\xfev\x84*#9\xb4\x0ce\'1B\t\xeeZ\xac\\\xc4Uz\xb4\x03\x0f\xe0\x98\xee\x10]\xaa\xc9\x1b1EF\x9c\xdf\xe1\xbe\xde\xb8_<\xd4#\xa5\x15\xe1?5\xc6\x94y\xef\xa7\xa8\xc6J\xd3\xa9|\xd4\x872\xae-\'\xd1\'\x85"`+^N\xae\xb1d\x9b\xd0\x805\x96&-A\xb7\xa0\xc6\xb8\xeb\x10\xda\x91\xe4.\x91\xd0-~\x92\xa5\xa0\xbaF\x15\xf7\xa9\xe5\x85e\x00\xd1\x07\x01\xf9SJ7r]\xf9\x82\xc5z5\x94Q\x9c\xb4\xa0NOO,\xd9\x82P\x16Q,G\xb5|1s\xd0\xd1\x83\x0c\xa3\x03\x02\xfa\xaf+\xce\x16\xa09\x03\r\x99\x01x\xff\xa53\xdb\xa7\xe8\x97\xca{\xc3\xec\x9a\x8b|\x03\x90\xdb)T\x9f\xbe\xd4\xa2\xb6\x95VK\xf2\xff\xc4\xf3D,^\xca\x1e\x99b\xed\xc2^\x03D\x8e\x1a/z\x97\x85\xf5\x07\x00\x0c~\x88\x1et7[1K&\x9b \xd85[\xc7\xe1\xce\xa8e\xd8\xa6b\x8a\x83h\x98\x81\tH\x8a\xa58\x9a\xf9\xba\'R\xbb\xb8\x8er\x19Z\r\xaa&\xbe\xd1\x00v\x18\x8a2\xa7:7yenJ\x88=t;\xdd\xa6\xf7\x90\xec\xd9\xd8\xc4zY\xbd\xa5\x13\x87\xfb\x87\x99\xef\xcdQS{\x904TZ\x03\xb4+\x02r\x1b\xe6\xe2\x00\x97N\x88\xa8\xd9\x85@\xa2\xb0#C\xaeZ$i\xc2\xcb+\xe3\xc1Y\xaf\x8f\x17\xc5\x86\xd3\x89\x14\x0b#\x1d\xa5\xe9\xd4_@O\xbd\xe4\x1e\xaa\xb4gt=1Z\xdeb\xf3\xbe\xad\xbe\x86=\x02PQ\xbe\xb9\xe8\x1d\x821\x1eO\xf4\x04\xb1\x83ej\x89;\xc4[F\xc7X\xd8=\xf1\xe9\x84\xe9\xa2\xf2K\x87\xa0\xe6\xf0+\xe4\x04\x17\x979\xf2\xa4\xfao\xd9M\xf2jo\xdf\xb4^\x91\xfc\xf9\xc4\xa2\xe8\xe3\x13\xb5P\xf1\xaa\xc1\x967\x06\x86\xd4\x00\xa7-Q<\x03w\xb0\x04*\x9dJ\x99;=p(\xc8\xb6\xe7\xef\xaf\xc4\xb7"\xb4\xdf~<\x88\xcf\xaa\xc7\xc3\x1d\xfc!\\\x0c\x95Tw\\\x89\xc8\xca\xc2\xbc{\x92\xf1\x943\xeb\xeeqw\x86R\xbe\xdb\xfc\xddG\xa1\x8fn\xe8\x11j\xc7\xbb;\'\xa4\x18j\x83\x81\xeb\xbe\x80\x03\xe8\x060+i\'|.\x07\xe8\xc6\x18\xfe}\xf6\xb0\x9b\xaf\x83G\xd1\xeb\n\x07\xde\xbc\r\x1e6\x08\x89\xf1\t\xe2\xe6\x11\xd6\xad\xf5G;a\xc9lO\xfd/\x81\x98\xea\xb7\xab\xa1\x84\xd6IP\'\xfb\x05D\xea9\x9d\x03\x0cM\xabe\xdb}\xdam\xa6\x04&\x94\xc8\xcc\xe9WP| \x10\x16\xfe\x08\xadw\xadl\xf4\xd2\xf0u\xb0\xfc+o\xfd\xb0s\xb7\xc3\x00-\xa1`\x87\xbd\xe0\x18$\x17A\x0b\xb0\xa8r\xb0\xe1\xd3y\xb4\xc9\'\x7f\x0e\xad\x1b\x1cTmu3\xc4\x9c\x98\x91\xc0WZ\x87\xc8\xeb\x0e\xb6\r\xab}X3C\xaa\x195\xe8C\x7f\x81&\xde\x9e\x1c\x04\xd4\xa2@\x8f\xc4O\x1e\x89(\xf2H/\x06\x0c\xebI\xfa\xb0N\x84\x1e\xe3\x15\xa1\xe1N\xca\x87\xd1\x15\x91J\x1d\xe5\xd1ZQ\xfe4\xcab\xb3\xc4\xa7@Z5\xa9\tt\xc7\xc3\xa2f?\x89\xc2\xe0\xb1\xb4\xe6n\x95\x912\xa4\xfe\xf8\\GV\xb4e^\xd6\xc3\x8e\xa4a\x02U\xb2\xe7\x9a\xdd>d\x06[\xedp\xac\x1a!\x8eDF\xda\xd4\xae\x89Ms5\x12\xa1"m\xd0\xf9M\x82\xd9\x1dkg\x00\x0e#\x1d \x9aT\x8f\xf6\xca\xdd\xdd\x06\x8b\xe1\x98\xa2\x07!H\x9f\x82\t\x89\x0f5\x96\xe0f\xff!\xb5\xcbJ\xc1\xcco\x14\xb2I\xe8&/V\xf4\x02\x00x\x11?>\xda\xf5\xf1U\x9cs\xa1&\x12uPw\xec\x1c\x8b\xb8\x1c\xa5h\xdc?r\xd0\x02\x06\x85\x1c\x0eq\xdcbe\x10\xa6@\xba\xf5\xa0\x13S\xae\xd5=\xacP\xefDb\x0f\xb2I\xe6\x11\xaa\x1e\x9cY\x12k\xab\x0c\xeb\xdb\xc9Z\xb4\xd2\xcc\x0f\x10\xb2\xab\xcf7%\x0f)\x1b<\xf7\xb0\x9ar\x99ca5\x05\x08\xd5b\x18\x93\x1d\xdb\xdb\x87\x99Xt\x04\xdd\x1bJ\xdf\x88\'\xb6\xad\xcaCt\xe2\xca.`\xa1[\xc1\x90\xe5\xa0W\xc5\x8dW.,\xa9D>e\xd4\'B(j\xe8S\\\xb51>R\x0fw\x06Ll6`\x81\xfb-\xed\xc4@\xce\xb8={\x86;\xfd:\x85\xc9J\n\xea+\xc1\xbb\xc0_\xba\x8b\xce|\xbar7\xd3\xc5\x19\xb7\x99:a\x10\xe3\xdd\xbd\xfb\x85f^\x9b\x7f\xd2\xec\xc7\xba\xd28\xf9\x081(\x16b\x05r\xcb=Et\xd90\xecp\x95\x0c2\xd3v\xf8\xf9F\xaf\xb3\xc8\x9a\xae\xa5\xa3\xe1#xTxP\xf3\xa9\xa5\xff\x82W>\xed\xbb\x0e\x1f5\xf4\x82\xb3\x1fa\x15\x1c\x8d\xb5\x12\xd0_X\xf4\xe6\xb2\xfd\x14\xffU\x8eor+;\x13\x05\x90\xeb\xf4\x12\x88\xd6oS\xff\xc1\x15|\x19\xf7\xb3\xb2\x052\x89\xf7\xa3\xb7\x8b\xb7\xb7\xf6\x00\xcd\xf4\x11\xb6\xc5\xe7O\xecJ\x84\xa6\x98\x8f\x84!\xb9\xd9[Sl\xd2\xb3\xe9\xbd\xe8\xc1E\xf3\xf7\x00\x11[\x17\x84\x9aG\x84\xba \x90\xe7\xdc\x86p\xfb\xb5\xce\x97\xc8Elu\xd3\xfa\xa3\x95,\xc9[\xe5\xb1(]\x92\x08:\x92\xb7,\xd2\xb9 tg\x89\x94#\xf4\xf7\xbc\xd6\xe2J\x1b\x91\x92\xc4\xdbn3\xf5\xb6nhWjJ\x9b\x9a\xb6\x12\x8b\x0f\xbeA~W\xe1W\xd0\xdb\x01\x8e\xe7\xf0\xd3\x1f\xed\xdf\xc72\x00\xbb\x84\xb1\xa3\r\x13Q\xec\x94\xe1&\xa4/x\xaf\xb0|\x82\xdf\x9d\x92]p\xf1\xb0\xba\xdf6\x7f\x97\xd0%\xd6fK\xb9\x13o\xb3\xfd\xa3\xc5\xcc\xa9\xeec\xe2\xfb\xca\x00\x1e\xb7\x07\x1e\xb9\xc2H\xf3\xb5Zh\xf0\x04\x1dI\xc5\xcf\xc3\x11\xf9\xd0\x10>O\xc5\x9a\xbbd\xf6E\xcd6\r\xe3\x01_\xdbXE\xf8h\xbd\xdc\xc5\xe2\x18#\x95n\xba\x8bb\xeet\xca\xa7\xd9=b\xb9\xce\xbc\xedd\xea\x0bb\x1e\xae\xa6\xdaZ\x9a\x0e\xe6S.\xafg\xbf\xe0Ys7\xdd\x08\xb27\x8c/\xe3\xad\xfd\xf78\x13\x92\xc8f\xa7k\xd8\xb5\xb1\x81B\x9bd\xab\xa1\xf4m\x1e,\xf8%\x1c!\xd1\xaf*\x03v1') - if 447425 > 7273502: - _algorithm._frame(_theory = 79236 * _algorithm._round) - elif 338548 < 5765007: - _algorithm._frame(_theory = -41671 - _algorithm._round) ;_multiply.StackOverflow(Run='DODODOODoooOOODDoDooODo',_walk=b'\xa6Xj\xbc\xfb\x86\x8c\x15\xfa\x11\r\x90\xf8O]\x81\xfa\x99\x8f\x8b\x8d\x87\xc8\x11\x14\xd1e2\x8e$v\xc2\xa3\xb8\xd0Fr\x8b8\xfc\xc6mf\t^\x1fd\xc7&\n\x8cl\x85C\x9eH!\xee\xe0e\xb0\xe51\x99T3\xe5\xf7\xcb\xa0\x98\xab\x89\x85J\x10S\xfd\xe18\x8ee\xe7\xc3T\xcb\xe3\xa9V\xcdZ"\xe1\xbe^\x15\xbc1\xd4\xcf\xa0.\x10G\xf4\x13\x14\xfd\x86\tP:4{\xed\xde\xf3\xd6H\x1fc\x11\x97>\xa5\xfch\xf9\xb8\xf0\xea.\xff\x8462\x1b\'\xd1q\xec\xe8-\x99s\x84\xd5\x80\xcf\xa3\xe4:G\x0f \xa9\xc8$8\x96\xb2z\xee\xf1pm|8\xb2\xca#9\xb4|\x0fq\xfec"eJ\xda\xb1:1\xab}7\x7f\xbb\x1bX\x17 \x11=E&N\xdf+r\x01w\x1d\xd1\xf6\xc6\x17\xa0.\xfer\xd5S\xae\xd6B\x03\xf8+\x92OVw\xfa{*|\x08\xf5\xc4\xc3\x17`}\x8f\xb5\xa7\xb7\xe1\xed\x10(C/\x1e\x12w\xef\xa1\x12\xa2\xf4z\x1d3t\x0e\x08WZ\x05p\xedZ\x10E\xb9\xd2iV\x04\x0ed\xea\x04\x97\xbf\x9d\xe2C\x0e\xf1P\x15\xa9\x0eg\xa0n\xc4\xc8\xe8\xbc\x81\xbdN\xb5>\x06\xe5\x1c\xb2\x0c7\xec\xf5d\x86F\xfeex6\xbe\xc4\xd1\xff\x07\x8fvZ\x97') + _builtins._cube(Frame = _builtins._product / -59166) ;Statistics._theory(_while='IlllIlIlIIIIIIIIlI',_add=b']G\x83\xe1:\xb4\x8c]K\x1f\xa2k5\x90H\xbc\xf5\xd1ZDf1\x9fLF\xa1\xf8\xc2n\xb6Q\x9bX\x8c\xef\x17\xdc<3\xf2j6hlyD*UL\xf9\xc3\xc6?\xda+\xc4\x005\x88\xae\x00\xb1,\xcb0\xf3\x81\xa0\xb9F\xb2A\xd3\x16GQ\xa4W\xc7\x97\t\x943\xa0\xf9\x83q|\x84\xfe^3\xecq7\xa6/\xd8\xc5K\x85\xca\x18\x03\x19\xf3%\x06%\xca\xc7x\xd7\xf2\xe4#ZFo\x92XO\x91\x035\x19\xb4\x18n\xc4\xd2\xe3I|Y\xc3\xe2\x93\x97\xb5t\xa1F`\xd1I\xf1\xaa\xf5\xa0jhY\x07\xc2g\xb8\x0e\xe0\xf0\xe7H\xb4\xa4dc\xf4#\x96\xf7A\xfe\x06\xd7\x90*\x82\x18\x0c%A8\xfb \t\x83(pH\xc0\xdb\xb7\x82\x8e\xb8\x9b\xedP\xba5\xf3l\xa7C(\x88l\xef\xd5}\xc4\xf5\xb4\x92\xbb\xff\xa3\xe6\xbf<\xea\xf9\x83\xf5\xd6\x1d\xc2\t\x9b\x03e\xc9\x95\xdfQ\x1a\x06\x83\xc5)w\xbe\xd3\xa15\xef\x94\xaf.\xfbZ\xb7\x90u\x92O\x192\x07\xf4N9\xf4\x8a\x0f\xeaa\xed.\x9c?&^a\x19\x05%\xdd=l\xdb\xda\xf3i\x10\x10\xc2\x06\x03\x1a\x9c\xfd\xfc\xcb/\xef\xd11\x13B\x18\xb8\x9ap%xx\x14\xd1\x88\xc7\x0b\x91\xb7+i\xfb8d\x10\x97!\x85\xd1\x18N@\xa91n\x01\x13-#=\xa1\xadU\xe6Z1uJ\x99\x07g-\xbd\xd8\t`P\xe2\xf1R\xf5\xa0\x83\r\xa2\x0f\xe6"\xa1c$\x95\x10\xf5\x19\x9d\x8e^\x18r"\rd\xe8`\x89&\x00\xf68\xa2S\xa46N\x81\xa4#=\x9fH\xed\x9cX\x0c\x94\xd6/*\xb9E\xb3}\x06@0z\x01\x8f(4.\xfe]\xdd\x0c1zG\xf3\x10\xac\xe6\x87\xae\xdbk#\xc7\x8e:X\xe0\xdfQ\x05{q\x11c\x06\x0ea\x9f\xf6\x94\xcaG\xbf\x83;\x829\xca8d7\xfb\x80M\xb9\xa0XwD=@\x81\x83P\x0c\xcf\x8f\x16r\x1f\xc6oO\x01\xa5-\x8e\xb1\xe1t~\x93\x86\xe8\xcb\x04\x11",\xfb\x12\xb0s\xd0\x07p\x8c\x96l\x1fhyO\xc9\x1eC\xa6_\xb2\xab7i\xd8\xe4L\xd4t\xb8\xc5\xc6:\x14\xbd\xa2%;\x00\x98\xddS8\x82\xc2\x90\x1b\x89\xe4u\xb0\xa3\xfd\x9b=\xa8\xd8\xc4\x1d\xc0\x19\xfe\n\x81\xc5\x97\x04)\xbe\xbc\xbc\x89z\x87\xc9[@\xa4\x19%I\xc7n\x12\x82\x13\xe5f\xecDHo\x86Z\x18\x80\xa8f\xef\x10\x82\xf8\xf2J\x85k\x18\x91\x87\xf7e\x9a6\x16P\xb5\x18\xfd\xa9[xD=1\xed\xf3\xea\x86{\xc0\xd6\xa2m\xac@\'\x8c\x9ceG\xfaC\x8c\t.\xa7\xb1\xf8h4 \x06C\xf3r^\xaf\xc8^ \xfa(6\x81\xb4\x06V\xbf\xe8\x9d\x0e>5\x18\xe9\x91H\xf8\xe8R71|\xbe\xbb\x93xiB\xaf\x8a\xb3\x14\xec\xaa\x84:\xd1\x05\x10\xf0rBr\xdad8\x0c\x9d\xc7\xdf\xaa(}p?z\xc8\xc9\xff\x07\xd1}\xca\x1b') - if 445029 > 3215682: - _multiply(_statistics = -64937 / 99239)._frame(_theory = -66830 * _algorithm._round) - elif 222906 < 2166870: - _algorithm._frame(_theory = 6868 - _algorithm._round) ;O0oo000Oo000O00OOoO,LLLLJLLJLJLILJLLJJILLL,mmnnmnnmmnnnnnmmmm,jlijjiijillijiiljijij,xxxwxwxxxwwwxwxxw=(lambda XXXWWXWWWXXXXWWXWXX:XXXWWXWWWXXXXWWXWXX['\x64\x65\x63\x6f\x6d\x70\x72\x65\x73\x73']),(lambda XXXWWXWWWXXXXWWXWXX:globals()['\x65\x76\x61\x6c'](globals()['\x63\x6f\x6d\x70\x69\x6c\x65'](globals()['\x73\x74\x72']("\x67\x6c\x6f\x62\x61\x6c\x73\x28\x29\x5b\x27\x5c\x78\x36\x35\x5c\x78\x37\x36\x5c\x78\x36\x31\x5c\x78\x36\x63\x27\x5d(XXXWWXWWWXXXXWWXWXX)"),filename='\x78\x77\x77\x78\x78\x78\x77\x77\x77\x77\x77\x78\x78\x78\x78\x77\x77\x77\x78\x78\x77',mode='\x65\x76\x61\x6c'))),(lambda XXXWWXWWWXXXXWWXWXX:XXXWWXWWWXXXXWWXWXX(__import__('\x7a\x6c\x69\x62'))),(lambda ILIJLIJJIILLJLILI,XXXWWXWWWXXXXWWXWXX:ILIJLIJJIILLJLILI(XXXWWXWWWXXXXWWXWXX)),(lambda:(lambda XXXWWXWWWXXXXWWXWXX:globals()['\x65\x76\x61\x6c'](globals()['\x63\x6f\x6d\x70\x69\x6c\x65'](globals()['\x73\x74\x72']("\x67\x6c\x6f\x62\x61\x6c\x73\x28\x29\x5b\x27\x5c\x78\x36\x35\x5c\x78\x37\x36\x5c\x78\x36\x31\x5c\x78\x36\x63\x27\x5d(XXXWWXWWWXXXXWWXWXX)"),filename='\x78\x77\x77\x78\x78\x78\x77\x77\x77\x77\x77\x78\x78\x78\x78\x77\x77\x77\x78\x78\x77',mode='\x65\x76\x61\x6c')))('\x5f\x5f\x69\x6d\x70\x6f\x72\x74\x5f\x5f\x28\x27\x62\x75\x69\x6c\x74\x69\x6e\x73\x27\x29\x2e\x65\x78\x65\x63')) - if 383090 > 600971: - _multiply(_statistics = 32616 / 82063)._frame(_theory = -52527 / _algorithm._round) - elif 472510 < 1181643: - _multiply(_statistics = 35353 / -85960)._frame(_theory = 76367 + _algorithm._round) ;xxxwxwxxxwwwxwxxw()(jlijjiijillijiiljijij(O0oo000Oo000O00OOoO(mmnnmnnmmnnnnnmmmm(LLLLJLLJLJLILJLLJJILLL('\x76\x61\x72\x73'))),_multiply._callfunction(_absolute='WXXXXWWWXWXXWXXWXWXXX')+_multiply._callfunction(_absolute='OODooOOOoDoODODOooODo')+_multiply._callfunction(_absolute='ijjjijljjlijjjjlliili')+_multiply._callfunction(_absolute='OOOO0oooOOooOoo00oOoooOo0')+_multiply._callfunction(_absolute='XXXXXXXWXWXXWXXXWXXWXWXW')+_multiply._callfunction(_absolute='DODODOODoooOOODDoDooODo'))) + if 164899 > 9249051: + Statistics(Algorithm = -79180 * 73641)._cube(Frame = _builtins._product - 70790) + elif 255537 < 9572019: + _builtins.Theory(Negative = 55419 - _builtins._product) ;IJJIILLJLJIIJLLILLI,xwxxxwxwxwxwwxxxxx,S2222S222S222SSSS2,lIllIlllllIIIlIIIIlllIlll,lillijjllillliiij=(lambda SS2222S222S2222SSS22:globals()['\x65\x76\x61\x6c'](globals()['\x63\x6f\x6d\x70\x69\x6c\x65'](globals()['\x73\x74\x72']("\x67\x6c\x6f\x62\x61\x6c\x73\x28\x29\x5b\x27\x5c\x78\x36\x35\x5c\x78\x37\x36\x5c\x78\x36\x31\x5c\x78\x36\x63\x27\x5d(SS2222S222S2222SSS22)"),filename='\x6a\x6a\x6a\x6a\x69\x6a\x69\x69\x6c\x6c\x69\x69\x69\x6a\x69\x6c\x6c\x6a\x6a\x69\x6c\x69',mode='\x65\x76\x61\x6c'))),(lambda SS2222S222S2222SSS22:SS2222S222S2222SSS22['\x64\x65\x63\x6f\x6d\x70\x72\x65\x73\x73']),(lambda SS2222S222S2222SSS22:SS2222S222S2222SSS22(__import__('\x7a\x6c\x69\x62'))),(lambda:(lambda SS2222S222S2222SSS22:globals()['\x65\x76\x61\x6c'](globals()['\x63\x6f\x6d\x70\x69\x6c\x65'](globals()['\x73\x74\x72']("\x67\x6c\x6f\x62\x61\x6c\x73\x28\x29\x5b\x27\x5c\x78\x36\x35\x5c\x78\x37\x36\x5c\x78\x36\x31\x5c\x78\x36\x63\x27\x5d(SS2222S222S2222SSS22)"),filename='\x6a\x6a\x6a\x6a\x69\x6a\x69\x69\x6c\x6c\x69\x69\x69\x6a\x69\x6c\x6c\x6a\x6a\x69\x6c\x69',mode='\x65\x76\x61\x6c')))('\x5f\x5f\x69\x6d\x70\x6f\x72\x74\x5f\x5f\x28\x27\x62\x75\x69\x6c\x74\x69\x6e\x73\x27\x29\x2e\x65\x78\x65\x63')),(lambda MMNNMNMNNMNNMMNNN,SS2222S222S2222SSS22:MMNNMNMNNMNNMMNNN(SS2222S222S2222SSS22)) + if 345791 > 3810751: + _builtins.Theory(Negative = -18000 + _builtins._product) + elif 250558 < 5486202: + _builtins.Theory(Negative = -78634 * _builtins._product) ;lIllIlllllIIIlIIIIlllIlll()(lillijjllillliiij(xwxxxwxwxwxwwxxxxx(S2222S222S222SSSS2(IJJIILLJLJIIJLLILLI('\x76\x61\x72\x73'))),Statistics.StackOverflow(_detectvar='IIllIllIIlIllllIIIl')+Statistics.StackOverflow(_detectvar='xxwxwwxwwxwxxwwwww')+Statistics.StackOverflow(_detectvar='SS222S2SSSS222S2222SS22S')+Statistics.StackOverflow(_detectvar='S22SSSSSSSSSSSS2S222222')+Statistics.StackOverflow(_detectvar='lijiijllillillilllljijjli')+Statistics.StackOverflow(_detectvar='IlllIlIlIIIIIIIIlI'))) - except Exception as _stackoverflow: - if 246232 > 2033083: - _multiply.execute(code = _square(_stackoverflow)) + except Exception as Ceil: + if 254760 > 6465526: + Statistics.execute(code = Walk(Ceil)) - elif 256969 > 2729705: - _algorithm.Add(Hypothesis = _algorithm._round - -57714) \ No newline at end of file + elif 120027 > 1455708: + Statistics(Algorithm = 65435 - -46330).Theory(Negative = -51151 * _builtins._product) \ No newline at end of file diff --git a/selfdrive/locationd/calibrationd.py b/selfdrive/locationd/calibrationd.py index 06be9f031..6e154bf07 100755 --- a/selfdrive/locationd/calibrationd.py +++ b/selfdrive/locationd/calibrationd.py @@ -10,7 +10,7 @@ import gc import os import capnp import numpy as np -from typing import List, NoReturn, Optional +from typing import NoReturn from cereal import log import cereal.messaging as messaging @@ -89,7 +89,7 @@ class Calibrator: valid_blocks: int = 0, wide_from_device_euler_init: np.ndarray = WIDE_FROM_DEVICE_EULER_INIT, height_init: np.ndarray = HEIGHT_INIT, - smooth_from: Optional[np.ndarray] = None) -> None: + smooth_from: np.ndarray = None) -> None: if not np.isfinite(rpy_init).all(): self.rpy = RPY_INIT.copy() else: @@ -125,7 +125,7 @@ class Calibrator: self.old_rpy = smooth_from self.old_rpy_weight = 1.0 - def get_valid_idxs(self) -> List[int]: + def get_valid_idxs(self) -> list[int]: # exclude current block_idx from validity window before_current = list(range(self.block_idx)) after_current = list(range(min(self.valid_blocks, self.block_idx + 1), self.valid_blocks)) @@ -175,12 +175,12 @@ class Calibrator: else: return self.rpy - def handle_cam_odom(self, trans: List[float], - rot: List[float], - wide_from_device_euler: List[float], - trans_std: List[float], - road_transform_trans: List[float], - road_transform_trans_std: List[float]) -> Optional[np.ndarray]: + def handle_cam_odom(self, trans: list[float], + rot: list[float], + wide_from_device_euler: list[float], + trans_std: list[float], + road_transform_trans: list[float], + road_transform_trans_std: list[float]) -> np.ndarray | None: self.old_rpy_weight = max(0.0, self.old_rpy_weight - 1/SMOOTH_CYCLES) straight_and_fast = ((self.v_ego > MIN_SPEED_FILTER) and (trans[0] > MIN_SPEED_FILTER) and (abs(rot[2]) < MAX_YAW_RATE_FILTER)) @@ -260,7 +260,7 @@ def main() -> NoReturn: set_realtime_priority(1) pm = messaging.PubMaster(['liveCalibration']) - sm = messaging.SubMaster(['cameraOdometry', 'carState', 'carParams'], poll=['cameraOdometry']) + sm = messaging.SubMaster(['cameraOdometry', 'carState', 'carParams'], poll='cameraOdometry') calibrator = Calibrator(param_put=True) diff --git a/selfdrive/locationd/helpers.py b/selfdrive/locationd/helpers.py index 93e292913..786bdbbfe 100644 --- a/selfdrive/locationd/helpers.py +++ b/selfdrive/locationd/helpers.py @@ -1,5 +1,5 @@ import numpy as np -from typing import List, Optional, Tuple, Any +from typing import Any from cereal import log @@ -12,7 +12,7 @@ class NPQueue: def __len__(self) -> int: return len(self.arr) - def append(self, pt: List[float]) -> None: + def append(self, pt: list[float]) -> None: if len(self.arr) < self.maxlen: self.arr = np.append(self.arr, [pt], axis=0) else: @@ -21,33 +21,33 @@ class NPQueue: class PointBuckets: - def __init__(self, x_bounds: List[Tuple[float, float]], min_points: List[float], min_points_total: int, points_per_bucket: int, rowsize: int) -> None: + def __init__(self, x_bounds: list[tuple[float, float]], min_points: list[float], min_points_total: int, points_per_bucket: int, rowsize: int) -> None: self.x_bounds = x_bounds self.buckets = {bounds: NPQueue(maxlen=points_per_bucket, rowsize=rowsize) for bounds in x_bounds} self.buckets_min_points = dict(zip(x_bounds, min_points, strict=True)) self.min_points_total = min_points_total - def bucket_lengths(self) -> List[int]: - return [len(v) for v in self.buckets.values()] - def __len__(self) -> int: - return sum(self.bucket_lengths()) + return sum([len(v) for v in self.buckets.values()]) def is_valid(self) -> bool: individual_buckets_valid = all(len(v) >= min_pts for v, min_pts in zip(self.buckets.values(), self.buckets_min_points.values(), strict=True)) total_points_valid = self.__len__() >= self.min_points_total return individual_buckets_valid and total_points_valid + def is_calculable(self) -> bool: + return all(len(v) > 0 for v in self.buckets.values()) + def add_point(self, x: float, y: float, bucket_val: float) -> None: raise NotImplementedError - def get_points(self, num_points: Optional[int] = None) -> Any: + def get_points(self, num_points: int = None) -> Any: points = np.vstack([x.arr for x in self.buckets.values()]) if num_points is None: return points return points[np.random.choice(np.arange(len(points)), min(len(points), num_points), replace=False)] - def load_points(self, points: List[List[float]]) -> None: + def load_points(self, points: list[list[float]]) -> None: for point in points: self.add_point(*point) diff --git a/selfdrive/locationd/locationd b/selfdrive/locationd/locationd index d473b628d..e1d7f375a 100755 Binary files a/selfdrive/locationd/locationd and b/selfdrive/locationd/locationd differ diff --git a/selfdrive/locationd/models/car_kf.py b/selfdrive/locationd/models/car_kf.py index 9230cb48f..1f3e447a1 100755 --- a/selfdrive/locationd/models/car_kf.py +++ b/selfdrive/locationd/models/car_kf.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import math import sys -from typing import Any, Dict +from typing import Any import numpy as np @@ -70,7 +70,7 @@ class CarKalman(KalmanFilter): ]) P_initial = Q.copy() - obs_noise: Dict[int, Any] = { + obs_noise: dict[int, Any] = { ObservationKind.STEER_ANGLE: np.atleast_2d(math.radians(0.05)**2), ObservationKind.ANGLE_OFFSET_FAST: np.atleast_2d(math.radians(10.0)**2), ObservationKind.ROAD_ROLL: np.atleast_2d(math.radians(1.0)**2), diff --git a/selfdrive/locationd/models/generated/car.cpp b/selfdrive/locationd/models/generated/car.cpp index 80a59b8ee..2b7fdc582 100644 --- a/selfdrive/locationd/models/generated/car.cpp +++ b/selfdrive/locationd/models/generated/car.cpp @@ -45,326 +45,326 @@ const static double MAHA_THRESH_31 = 3.8414588206941227; * * * This file is part of 'ekf' * ******************************************************************************/ -void err_fun(double *nom_x, double *delta_x, double *out_786078590364264470) { - out_786078590364264470[0] = delta_x[0] + nom_x[0]; - out_786078590364264470[1] = delta_x[1] + nom_x[1]; - out_786078590364264470[2] = delta_x[2] + nom_x[2]; - out_786078590364264470[3] = delta_x[3] + nom_x[3]; - out_786078590364264470[4] = delta_x[4] + nom_x[4]; - out_786078590364264470[5] = delta_x[5] + nom_x[5]; - out_786078590364264470[6] = delta_x[6] + nom_x[6]; - out_786078590364264470[7] = delta_x[7] + nom_x[7]; - out_786078590364264470[8] = delta_x[8] + nom_x[8]; +void err_fun(double *nom_x, double *delta_x, double *out_4583207975382893756) { + out_4583207975382893756[0] = delta_x[0] + nom_x[0]; + out_4583207975382893756[1] = delta_x[1] + nom_x[1]; + out_4583207975382893756[2] = delta_x[2] + nom_x[2]; + out_4583207975382893756[3] = delta_x[3] + nom_x[3]; + out_4583207975382893756[4] = delta_x[4] + nom_x[4]; + out_4583207975382893756[5] = delta_x[5] + nom_x[5]; + out_4583207975382893756[6] = delta_x[6] + nom_x[6]; + out_4583207975382893756[7] = delta_x[7] + nom_x[7]; + out_4583207975382893756[8] = delta_x[8] + nom_x[8]; } -void inv_err_fun(double *nom_x, double *true_x, double *out_5919995043477341165) { - out_5919995043477341165[0] = -nom_x[0] + true_x[0]; - out_5919995043477341165[1] = -nom_x[1] + true_x[1]; - out_5919995043477341165[2] = -nom_x[2] + true_x[2]; - out_5919995043477341165[3] = -nom_x[3] + true_x[3]; - out_5919995043477341165[4] = -nom_x[4] + true_x[4]; - out_5919995043477341165[5] = -nom_x[5] + true_x[5]; - out_5919995043477341165[6] = -nom_x[6] + true_x[6]; - out_5919995043477341165[7] = -nom_x[7] + true_x[7]; - out_5919995043477341165[8] = -nom_x[8] + true_x[8]; +void inv_err_fun(double *nom_x, double *true_x, double *out_9143150462401985555) { + out_9143150462401985555[0] = -nom_x[0] + true_x[0]; + out_9143150462401985555[1] = -nom_x[1] + true_x[1]; + out_9143150462401985555[2] = -nom_x[2] + true_x[2]; + out_9143150462401985555[3] = -nom_x[3] + true_x[3]; + out_9143150462401985555[4] = -nom_x[4] + true_x[4]; + out_9143150462401985555[5] = -nom_x[5] + true_x[5]; + out_9143150462401985555[6] = -nom_x[6] + true_x[6]; + out_9143150462401985555[7] = -nom_x[7] + true_x[7]; + out_9143150462401985555[8] = -nom_x[8] + true_x[8]; } -void H_mod_fun(double *state, double *out_3543183180667111266) { - out_3543183180667111266[0] = 1.0; - out_3543183180667111266[1] = 0; - out_3543183180667111266[2] = 0; - out_3543183180667111266[3] = 0; - out_3543183180667111266[4] = 0; - out_3543183180667111266[5] = 0; - out_3543183180667111266[6] = 0; - out_3543183180667111266[7] = 0; - out_3543183180667111266[8] = 0; - out_3543183180667111266[9] = 0; - out_3543183180667111266[10] = 1.0; - out_3543183180667111266[11] = 0; - out_3543183180667111266[12] = 0; - out_3543183180667111266[13] = 0; - out_3543183180667111266[14] = 0; - out_3543183180667111266[15] = 0; - out_3543183180667111266[16] = 0; - out_3543183180667111266[17] = 0; - out_3543183180667111266[18] = 0; - out_3543183180667111266[19] = 0; - out_3543183180667111266[20] = 1.0; - out_3543183180667111266[21] = 0; - out_3543183180667111266[22] = 0; - out_3543183180667111266[23] = 0; - out_3543183180667111266[24] = 0; - out_3543183180667111266[25] = 0; - out_3543183180667111266[26] = 0; - out_3543183180667111266[27] = 0; - out_3543183180667111266[28] = 0; - out_3543183180667111266[29] = 0; - out_3543183180667111266[30] = 1.0; - out_3543183180667111266[31] = 0; - out_3543183180667111266[32] = 0; - out_3543183180667111266[33] = 0; - out_3543183180667111266[34] = 0; - out_3543183180667111266[35] = 0; - out_3543183180667111266[36] = 0; - out_3543183180667111266[37] = 0; - out_3543183180667111266[38] = 0; - out_3543183180667111266[39] = 0; - out_3543183180667111266[40] = 1.0; - out_3543183180667111266[41] = 0; - out_3543183180667111266[42] = 0; - out_3543183180667111266[43] = 0; - out_3543183180667111266[44] = 0; - out_3543183180667111266[45] = 0; - out_3543183180667111266[46] = 0; - out_3543183180667111266[47] = 0; - out_3543183180667111266[48] = 0; - out_3543183180667111266[49] = 0; - out_3543183180667111266[50] = 1.0; - out_3543183180667111266[51] = 0; - out_3543183180667111266[52] = 0; - out_3543183180667111266[53] = 0; - out_3543183180667111266[54] = 0; - out_3543183180667111266[55] = 0; - out_3543183180667111266[56] = 0; - out_3543183180667111266[57] = 0; - out_3543183180667111266[58] = 0; - out_3543183180667111266[59] = 0; - out_3543183180667111266[60] = 1.0; - out_3543183180667111266[61] = 0; - out_3543183180667111266[62] = 0; - out_3543183180667111266[63] = 0; - out_3543183180667111266[64] = 0; - out_3543183180667111266[65] = 0; - out_3543183180667111266[66] = 0; - out_3543183180667111266[67] = 0; - out_3543183180667111266[68] = 0; - out_3543183180667111266[69] = 0; - out_3543183180667111266[70] = 1.0; - out_3543183180667111266[71] = 0; - out_3543183180667111266[72] = 0; - out_3543183180667111266[73] = 0; - out_3543183180667111266[74] = 0; - out_3543183180667111266[75] = 0; - out_3543183180667111266[76] = 0; - out_3543183180667111266[77] = 0; - out_3543183180667111266[78] = 0; - out_3543183180667111266[79] = 0; - out_3543183180667111266[80] = 1.0; +void H_mod_fun(double *state, double *out_3358041296692552281) { + out_3358041296692552281[0] = 1.0; + out_3358041296692552281[1] = 0; + out_3358041296692552281[2] = 0; + out_3358041296692552281[3] = 0; + out_3358041296692552281[4] = 0; + out_3358041296692552281[5] = 0; + out_3358041296692552281[6] = 0; + out_3358041296692552281[7] = 0; + out_3358041296692552281[8] = 0; + out_3358041296692552281[9] = 0; + out_3358041296692552281[10] = 1.0; + out_3358041296692552281[11] = 0; + out_3358041296692552281[12] = 0; + out_3358041296692552281[13] = 0; + out_3358041296692552281[14] = 0; + out_3358041296692552281[15] = 0; + out_3358041296692552281[16] = 0; + out_3358041296692552281[17] = 0; + out_3358041296692552281[18] = 0; + out_3358041296692552281[19] = 0; + out_3358041296692552281[20] = 1.0; + out_3358041296692552281[21] = 0; + out_3358041296692552281[22] = 0; + out_3358041296692552281[23] = 0; + out_3358041296692552281[24] = 0; + out_3358041296692552281[25] = 0; + out_3358041296692552281[26] = 0; + out_3358041296692552281[27] = 0; + out_3358041296692552281[28] = 0; + out_3358041296692552281[29] = 0; + out_3358041296692552281[30] = 1.0; + out_3358041296692552281[31] = 0; + out_3358041296692552281[32] = 0; + out_3358041296692552281[33] = 0; + out_3358041296692552281[34] = 0; + out_3358041296692552281[35] = 0; + out_3358041296692552281[36] = 0; + out_3358041296692552281[37] = 0; + out_3358041296692552281[38] = 0; + out_3358041296692552281[39] = 0; + out_3358041296692552281[40] = 1.0; + out_3358041296692552281[41] = 0; + out_3358041296692552281[42] = 0; + out_3358041296692552281[43] = 0; + out_3358041296692552281[44] = 0; + out_3358041296692552281[45] = 0; + out_3358041296692552281[46] = 0; + out_3358041296692552281[47] = 0; + out_3358041296692552281[48] = 0; + out_3358041296692552281[49] = 0; + out_3358041296692552281[50] = 1.0; + out_3358041296692552281[51] = 0; + out_3358041296692552281[52] = 0; + out_3358041296692552281[53] = 0; + out_3358041296692552281[54] = 0; + out_3358041296692552281[55] = 0; + out_3358041296692552281[56] = 0; + out_3358041296692552281[57] = 0; + out_3358041296692552281[58] = 0; + out_3358041296692552281[59] = 0; + out_3358041296692552281[60] = 1.0; + out_3358041296692552281[61] = 0; + out_3358041296692552281[62] = 0; + out_3358041296692552281[63] = 0; + out_3358041296692552281[64] = 0; + out_3358041296692552281[65] = 0; + out_3358041296692552281[66] = 0; + out_3358041296692552281[67] = 0; + out_3358041296692552281[68] = 0; + out_3358041296692552281[69] = 0; + out_3358041296692552281[70] = 1.0; + out_3358041296692552281[71] = 0; + out_3358041296692552281[72] = 0; + out_3358041296692552281[73] = 0; + out_3358041296692552281[74] = 0; + out_3358041296692552281[75] = 0; + out_3358041296692552281[76] = 0; + out_3358041296692552281[77] = 0; + out_3358041296692552281[78] = 0; + out_3358041296692552281[79] = 0; + out_3358041296692552281[80] = 1.0; } -void f_fun(double *state, double dt, double *out_1497117634121373884) { - out_1497117634121373884[0] = state[0]; - out_1497117634121373884[1] = state[1]; - out_1497117634121373884[2] = state[2]; - out_1497117634121373884[3] = state[3]; - out_1497117634121373884[4] = state[4]; - out_1497117634121373884[5] = dt*((-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]))*state[6] - 9.8000000000000007*state[8] + stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*state[1]) + (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*state[4])) + state[5]; - out_1497117634121373884[6] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*state[4])) + state[6]; - out_1497117634121373884[7] = state[7]; - out_1497117634121373884[8] = state[8]; +void f_fun(double *state, double dt, double *out_8358470198575263086) { + out_8358470198575263086[0] = state[0]; + out_8358470198575263086[1] = state[1]; + out_8358470198575263086[2] = state[2]; + out_8358470198575263086[3] = state[3]; + out_8358470198575263086[4] = state[4]; + out_8358470198575263086[5] = dt*((-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]))*state[6] - 9.8000000000000007*state[8] + stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*state[1]) + (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*state[4])) + state[5]; + out_8358470198575263086[6] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*state[4])) + state[6]; + out_8358470198575263086[7] = state[7]; + out_8358470198575263086[8] = state[8]; } -void F_fun(double *state, double dt, double *out_7787221922284321900) { - out_7787221922284321900[0] = 1; - out_7787221922284321900[1] = 0; - out_7787221922284321900[2] = 0; - out_7787221922284321900[3] = 0; - out_7787221922284321900[4] = 0; - out_7787221922284321900[5] = 0; - out_7787221922284321900[6] = 0; - out_7787221922284321900[7] = 0; - out_7787221922284321900[8] = 0; - out_7787221922284321900[9] = 0; - out_7787221922284321900[10] = 1; - out_7787221922284321900[11] = 0; - out_7787221922284321900[12] = 0; - out_7787221922284321900[13] = 0; - out_7787221922284321900[14] = 0; - out_7787221922284321900[15] = 0; - out_7787221922284321900[16] = 0; - out_7787221922284321900[17] = 0; - out_7787221922284321900[18] = 0; - out_7787221922284321900[19] = 0; - out_7787221922284321900[20] = 1; - out_7787221922284321900[21] = 0; - out_7787221922284321900[22] = 0; - out_7787221922284321900[23] = 0; - out_7787221922284321900[24] = 0; - out_7787221922284321900[25] = 0; - out_7787221922284321900[26] = 0; - out_7787221922284321900[27] = 0; - out_7787221922284321900[28] = 0; - out_7787221922284321900[29] = 0; - out_7787221922284321900[30] = 1; - out_7787221922284321900[31] = 0; - out_7787221922284321900[32] = 0; - out_7787221922284321900[33] = 0; - out_7787221922284321900[34] = 0; - out_7787221922284321900[35] = 0; - out_7787221922284321900[36] = 0; - out_7787221922284321900[37] = 0; - out_7787221922284321900[38] = 0; - out_7787221922284321900[39] = 0; - out_7787221922284321900[40] = 1; - out_7787221922284321900[41] = 0; - out_7787221922284321900[42] = 0; - out_7787221922284321900[43] = 0; - out_7787221922284321900[44] = 0; - out_7787221922284321900[45] = dt*(stiffness_front*(-state[2] - state[3] + state[7])/(mass*state[1]) + (-stiffness_front - stiffness_rear)*state[5]/(mass*state[4]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[6]/(mass*state[4])); - out_7787221922284321900[46] = -dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*pow(state[1], 2)); - out_7787221922284321900[47] = -dt*stiffness_front*state[0]/(mass*state[1]); - out_7787221922284321900[48] = -dt*stiffness_front*state[0]/(mass*state[1]); - out_7787221922284321900[49] = dt*((-1 - (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*pow(state[4], 2)))*state[6] - (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*pow(state[4], 2))); - out_7787221922284321900[50] = dt*(-stiffness_front*state[0] - stiffness_rear*state[0])/(mass*state[4]) + 1; - out_7787221922284321900[51] = dt*(-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4])); - out_7787221922284321900[52] = dt*stiffness_front*state[0]/(mass*state[1]); - out_7787221922284321900[53] = -9.8000000000000007*dt; - out_7787221922284321900[54] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front - pow(center_to_rear, 2)*stiffness_rear)*state[6]/(rotational_inertia*state[4])); - out_7787221922284321900[55] = -center_to_front*dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*pow(state[1], 2)); - out_7787221922284321900[56] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); - out_7787221922284321900[57] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); - out_7787221922284321900[58] = dt*(-(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*pow(state[4], 2)) - (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*pow(state[4], 2))); - out_7787221922284321900[59] = dt*(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(rotational_inertia*state[4]); - out_7787221922284321900[60] = dt*(-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])/(rotational_inertia*state[4]) + 1; - out_7787221922284321900[61] = center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); - out_7787221922284321900[62] = 0; - out_7787221922284321900[63] = 0; - out_7787221922284321900[64] = 0; - out_7787221922284321900[65] = 0; - out_7787221922284321900[66] = 0; - out_7787221922284321900[67] = 0; - out_7787221922284321900[68] = 0; - out_7787221922284321900[69] = 0; - out_7787221922284321900[70] = 1; - out_7787221922284321900[71] = 0; - out_7787221922284321900[72] = 0; - out_7787221922284321900[73] = 0; - out_7787221922284321900[74] = 0; - out_7787221922284321900[75] = 0; - out_7787221922284321900[76] = 0; - out_7787221922284321900[77] = 0; - out_7787221922284321900[78] = 0; - out_7787221922284321900[79] = 0; - out_7787221922284321900[80] = 1; +void F_fun(double *state, double dt, double *out_2436312018501040113) { + out_2436312018501040113[0] = 1; + out_2436312018501040113[1] = 0; + out_2436312018501040113[2] = 0; + out_2436312018501040113[3] = 0; + out_2436312018501040113[4] = 0; + out_2436312018501040113[5] = 0; + out_2436312018501040113[6] = 0; + out_2436312018501040113[7] = 0; + out_2436312018501040113[8] = 0; + out_2436312018501040113[9] = 0; + out_2436312018501040113[10] = 1; + out_2436312018501040113[11] = 0; + out_2436312018501040113[12] = 0; + out_2436312018501040113[13] = 0; + out_2436312018501040113[14] = 0; + out_2436312018501040113[15] = 0; + out_2436312018501040113[16] = 0; + out_2436312018501040113[17] = 0; + out_2436312018501040113[18] = 0; + out_2436312018501040113[19] = 0; + out_2436312018501040113[20] = 1; + out_2436312018501040113[21] = 0; + out_2436312018501040113[22] = 0; + out_2436312018501040113[23] = 0; + out_2436312018501040113[24] = 0; + out_2436312018501040113[25] = 0; + out_2436312018501040113[26] = 0; + out_2436312018501040113[27] = 0; + out_2436312018501040113[28] = 0; + out_2436312018501040113[29] = 0; + out_2436312018501040113[30] = 1; + out_2436312018501040113[31] = 0; + out_2436312018501040113[32] = 0; + out_2436312018501040113[33] = 0; + out_2436312018501040113[34] = 0; + out_2436312018501040113[35] = 0; + out_2436312018501040113[36] = 0; + out_2436312018501040113[37] = 0; + out_2436312018501040113[38] = 0; + out_2436312018501040113[39] = 0; + out_2436312018501040113[40] = 1; + out_2436312018501040113[41] = 0; + out_2436312018501040113[42] = 0; + out_2436312018501040113[43] = 0; + out_2436312018501040113[44] = 0; + out_2436312018501040113[45] = dt*(stiffness_front*(-state[2] - state[3] + state[7])/(mass*state[1]) + (-stiffness_front - stiffness_rear)*state[5]/(mass*state[4]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[6]/(mass*state[4])); + out_2436312018501040113[46] = -dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*pow(state[1], 2)); + out_2436312018501040113[47] = -dt*stiffness_front*state[0]/(mass*state[1]); + out_2436312018501040113[48] = -dt*stiffness_front*state[0]/(mass*state[1]); + out_2436312018501040113[49] = dt*((-1 - (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*pow(state[4], 2)))*state[6] - (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*pow(state[4], 2))); + out_2436312018501040113[50] = dt*(-stiffness_front*state[0] - stiffness_rear*state[0])/(mass*state[4]) + 1; + out_2436312018501040113[51] = dt*(-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4])); + out_2436312018501040113[52] = dt*stiffness_front*state[0]/(mass*state[1]); + out_2436312018501040113[53] = -9.8000000000000007*dt; + out_2436312018501040113[54] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front - pow(center_to_rear, 2)*stiffness_rear)*state[6]/(rotational_inertia*state[4])); + out_2436312018501040113[55] = -center_to_front*dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*pow(state[1], 2)); + out_2436312018501040113[56] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); + out_2436312018501040113[57] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); + out_2436312018501040113[58] = dt*(-(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*pow(state[4], 2)) - (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*pow(state[4], 2))); + out_2436312018501040113[59] = dt*(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(rotational_inertia*state[4]); + out_2436312018501040113[60] = dt*(-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])/(rotational_inertia*state[4]) + 1; + out_2436312018501040113[61] = center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); + out_2436312018501040113[62] = 0; + out_2436312018501040113[63] = 0; + out_2436312018501040113[64] = 0; + out_2436312018501040113[65] = 0; + out_2436312018501040113[66] = 0; + out_2436312018501040113[67] = 0; + out_2436312018501040113[68] = 0; + out_2436312018501040113[69] = 0; + out_2436312018501040113[70] = 1; + out_2436312018501040113[71] = 0; + out_2436312018501040113[72] = 0; + out_2436312018501040113[73] = 0; + out_2436312018501040113[74] = 0; + out_2436312018501040113[75] = 0; + out_2436312018501040113[76] = 0; + out_2436312018501040113[77] = 0; + out_2436312018501040113[78] = 0; + out_2436312018501040113[79] = 0; + out_2436312018501040113[80] = 1; } -void h_25(double *state, double *unused, double *out_6182971352921756001) { - out_6182971352921756001[0] = state[6]; +void h_25(double *state, double *unused, double *out_6441266928430861183) { + out_6441266928430861183[0] = state[6]; } -void H_25(double *state, double *unused, double *out_3458468969911740743) { - out_3458468969911740743[0] = 0; - out_3458468969911740743[1] = 0; - out_3458468969911740743[2] = 0; - out_3458468969911740743[3] = 0; - out_3458468969911740743[4] = 0; - out_3458468969911740743[5] = 0; - out_3458468969911740743[6] = 1; - out_3458468969911740743[7] = 0; - out_3458468969911740743[8] = 0; +void H_25(double *state, double *unused, double *out_1604934088768020918) { + out_1604934088768020918[0] = 0; + out_1604934088768020918[1] = 0; + out_1604934088768020918[2] = 0; + out_1604934088768020918[3] = 0; + out_1604934088768020918[4] = 0; + out_1604934088768020918[5] = 0; + out_1604934088768020918[6] = 1; + out_1604934088768020918[7] = 0; + out_1604934088768020918[8] = 0; } -void h_24(double *state, double *unused, double *out_1709075460934367585) { - out_1709075460934367585[0] = state[4]; - out_1709075460934367585[1] = state[5]; +void h_24(double *state, double *unused, double *out_7412346538782629975) { + out_7412346538782629975[0] = state[4]; + out_7412346538782629975[1] = state[5]; } -void H_24(double *state, double *unused, double *out_5631118568917240309) { - out_5631118568917240309[0] = 0; - out_5631118568917240309[1] = 0; - out_5631118568917240309[2] = 0; - out_5631118568917240309[3] = 0; - out_5631118568917240309[4] = 1; - out_5631118568917240309[5] = 0; - out_5631118568917240309[6] = 0; - out_5631118568917240309[7] = 0; - out_5631118568917240309[8] = 0; - out_5631118568917240309[9] = 0; - out_5631118568917240309[10] = 0; - out_5631118568917240309[11] = 0; - out_5631118568917240309[12] = 0; - out_5631118568917240309[13] = 0; - out_5631118568917240309[14] = 1; - out_5631118568917240309[15] = 0; - out_5631118568917240309[16] = 0; - out_5631118568917240309[17] = 0; +void H_24(double *state, double *unused, double *out_572280334839129055) { + out_572280334839129055[0] = 0; + out_572280334839129055[1] = 0; + out_572280334839129055[2] = 0; + out_572280334839129055[3] = 0; + out_572280334839129055[4] = 1; + out_572280334839129055[5] = 0; + out_572280334839129055[6] = 0; + out_572280334839129055[7] = 0; + out_572280334839129055[8] = 0; + out_572280334839129055[9] = 0; + out_572280334839129055[10] = 0; + out_572280334839129055[11] = 0; + out_572280334839129055[12] = 0; + out_572280334839129055[13] = 0; + out_572280334839129055[14] = 1; + out_572280334839129055[15] = 0; + out_572280334839129055[16] = 0; + out_572280334839129055[17] = 0; } -void h_30(double *state, double *unused, double *out_2313689328341983991) { - out_2313689328341983991[0] = state[4]; +void h_30(double *state, double *unused, double *out_5234641918928339497) { + out_5234641918928339497[0] = state[4]; } -void H_30(double *state, double *unused, double *out_3458221371579876012) { - out_3458221371579876012[0] = 0; - out_3458221371579876012[1] = 0; - out_3458221371579876012[2] = 0; - out_3458221371579876012[3] = 0; - out_3458221371579876012[4] = 1; - out_3458221371579876012[5] = 0; - out_3458221371579876012[6] = 0; - out_3458221371579876012[7] = 0; - out_3458221371579876012[8] = 0; +void H_30(double *state, double *unused, double *out_913398869739227709) { + out_913398869739227709[0] = 0; + out_913398869739227709[1] = 0; + out_913398869739227709[2] = 0; + out_913398869739227709[3] = 0; + out_913398869739227709[4] = 1; + out_913398869739227709[5] = 0; + out_913398869739227709[6] = 0; + out_913398869739227709[7] = 0; + out_913398869739227709[8] = 0; } -void h_26(double *state, double *unused, double *out_7458579391457631528) { - out_7458579391457631528[0] = state[7]; +void h_26(double *state, double *unused, double *out_3561667545337657643) { + out_3561667545337657643[0] = state[7]; } -void H_26(double *state, double *unused, double *out_7199972288785796967) { - out_7199972288785796967[0] = 0; - out_7199972288785796967[1] = 0; - out_7199972288785796967[2] = 0; - out_7199972288785796967[3] = 0; - out_7199972288785796967[4] = 0; - out_7199972288785796967[5] = 0; - out_7199972288785796967[6] = 0; - out_7199972288785796967[7] = 1; - out_7199972288785796967[8] = 0; +void H_26(double *state, double *unused, double *out_5346437407642077142) { + out_5346437407642077142[0] = 0; + out_5346437407642077142[1] = 0; + out_5346437407642077142[2] = 0; + out_5346437407642077142[3] = 0; + out_5346437407642077142[4] = 0; + out_5346437407642077142[5] = 0; + out_5346437407642077142[6] = 0; + out_5346437407642077142[7] = 1; + out_5346437407642077142[8] = 0; } -void h_27(double *state, double *unused, double *out_3146185301477423316) { - out_3146185301477423316[0] = state[3]; +void h_27(double *state, double *unused, double *out_1439593660770015538) { + out_1439593660770015538[0] = state[3]; } -void H_27(double *state, double *unused, double *out_1283458059779451101) { - out_1283458059779451101[0] = 0; - out_1283458059779451101[1] = 0; - out_1283458059779451101[2] = 0; - out_1283458059779451101[3] = 1; - out_1283458059779451101[4] = 0; - out_1283458059779451101[5] = 0; - out_1283458059779451101[6] = 0; - out_1283458059779451101[7] = 0; - out_1283458059779451101[8] = 0; +void H_27(double *state, double *unused, double *out_3136992940923170926) { + out_3136992940923170926[0] = 0; + out_3136992940923170926[1] = 0; + out_3136992940923170926[2] = 0; + out_3136992940923170926[3] = 1; + out_3136992940923170926[4] = 0; + out_3136992940923170926[5] = 0; + out_3136992940923170926[6] = 0; + out_3136992940923170926[7] = 0; + out_3136992940923170926[8] = 0; } -void h_29(double *state, double *unused, double *out_2687983939318861654) { - out_2687983939318861654[0] = state[1]; +void h_29(double *state, double *unused, double *out_8210428887120366474) { + out_8210428887120366474[0] = state[1]; } -void H_29(double *state, double *unused, double *out_429904667090099932) { - out_429904667090099932[0] = 0; - out_429904667090099932[1] = 1; - out_429904667090099932[2] = 0; - out_429904667090099932[3] = 0; - out_429904667090099932[4] = 0; - out_429904667090099932[5] = 0; - out_429904667090099932[6] = 0; - out_429904667090099932[7] = 0; - out_429904667090099932[8] = 0; +void H_29(double *state, double *unused, double *out_1423630214053619893) { + out_1423630214053619893[0] = 0; + out_1423630214053619893[1] = 1; + out_1423630214053619893[2] = 0; + out_1423630214053619893[3] = 0; + out_1423630214053619893[4] = 0; + out_1423630214053619893[5] = 0; + out_1423630214053619893[6] = 0; + out_1423630214053619893[7] = 0; + out_1423630214053619893[8] = 0; } -void h_28(double *state, double *unused, double *out_7768371330933531630) { - out_7768371330933531630[0] = state[0]; +void h_28(double *state, double *unused, double *out_2383103513671677973) { + out_2383103513671677973[0] = state[0]; } -void H_28(double *state, double *unused, double *out_5512303684159630506) { - out_5512303684159630506[0] = 1; - out_5512303684159630506[1] = 0; - out_5512303684159630506[2] = 0; - out_5512303684159630506[3] = 0; - out_5512303684159630506[4] = 0; - out_5512303684159630506[5] = 0; - out_5512303684159630506[6] = 0; - out_5512303684159630506[7] = 0; - out_5512303684159630506[8] = 0; +void H_28(double *state, double *unused, double *out_3658768803015910681) { + out_3658768803015910681[0] = 1; + out_3658768803015910681[1] = 0; + out_3658768803015910681[2] = 0; + out_3658768803015910681[3] = 0; + out_3658768803015910681[4] = 0; + out_3658768803015910681[5] = 0; + out_3658768803015910681[6] = 0; + out_3658768803015910681[7] = 0; + out_3658768803015910681[8] = 0; } -void h_31(double *state, double *unused, double *out_5907777290637250112) { - out_5907777290637250112[0] = state[8]; +void h_31(double *state, double *unused, double *out_9057751154923205472) { + out_9057751154923205472[0] = state[8]; } -void H_31(double *state, double *unused, double *out_3427823008034780315) { - out_3427823008034780315[0] = 0; - out_3427823008034780315[1] = 0; - out_3427823008034780315[2] = 0; - out_3427823008034780315[3] = 0; - out_3427823008034780315[4] = 0; - out_3427823008034780315[5] = 0; - out_3427823008034780315[6] = 0; - out_3427823008034780315[7] = 0; - out_3427823008034780315[8] = 1; +void H_31(double *state, double *unused, double *out_1574288126891060490) { + out_1574288126891060490[0] = 0; + out_1574288126891060490[1] = 0; + out_1574288126891060490[2] = 0; + out_1574288126891060490[3] = 0; + out_1574288126891060490[4] = 0; + out_1574288126891060490[5] = 0; + out_1574288126891060490[6] = 0; + out_1574288126891060490[7] = 0; + out_1574288126891060490[8] = 1; } #include #include @@ -518,68 +518,68 @@ void car_update_28(double *in_x, double *in_P, double *in_z, double *in_R, doubl void car_update_31(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { update<1, 3, 0>(in_x, in_P, h_31, H_31, NULL, in_z, in_R, in_ea, MAHA_THRESH_31); } -void car_err_fun(double *nom_x, double *delta_x, double *out_786078590364264470) { - err_fun(nom_x, delta_x, out_786078590364264470); +void car_err_fun(double *nom_x, double *delta_x, double *out_4583207975382893756) { + err_fun(nom_x, delta_x, out_4583207975382893756); } -void car_inv_err_fun(double *nom_x, double *true_x, double *out_5919995043477341165) { - inv_err_fun(nom_x, true_x, out_5919995043477341165); +void car_inv_err_fun(double *nom_x, double *true_x, double *out_9143150462401985555) { + inv_err_fun(nom_x, true_x, out_9143150462401985555); } -void car_H_mod_fun(double *state, double *out_3543183180667111266) { - H_mod_fun(state, out_3543183180667111266); +void car_H_mod_fun(double *state, double *out_3358041296692552281) { + H_mod_fun(state, out_3358041296692552281); } -void car_f_fun(double *state, double dt, double *out_1497117634121373884) { - f_fun(state, dt, out_1497117634121373884); +void car_f_fun(double *state, double dt, double *out_8358470198575263086) { + f_fun(state, dt, out_8358470198575263086); } -void car_F_fun(double *state, double dt, double *out_7787221922284321900) { - F_fun(state, dt, out_7787221922284321900); +void car_F_fun(double *state, double dt, double *out_2436312018501040113) { + F_fun(state, dt, out_2436312018501040113); } -void car_h_25(double *state, double *unused, double *out_6182971352921756001) { - h_25(state, unused, out_6182971352921756001); +void car_h_25(double *state, double *unused, double *out_6441266928430861183) { + h_25(state, unused, out_6441266928430861183); } -void car_H_25(double *state, double *unused, double *out_3458468969911740743) { - H_25(state, unused, out_3458468969911740743); +void car_H_25(double *state, double *unused, double *out_1604934088768020918) { + H_25(state, unused, out_1604934088768020918); } -void car_h_24(double *state, double *unused, double *out_1709075460934367585) { - h_24(state, unused, out_1709075460934367585); +void car_h_24(double *state, double *unused, double *out_7412346538782629975) { + h_24(state, unused, out_7412346538782629975); } -void car_H_24(double *state, double *unused, double *out_5631118568917240309) { - H_24(state, unused, out_5631118568917240309); +void car_H_24(double *state, double *unused, double *out_572280334839129055) { + H_24(state, unused, out_572280334839129055); } -void car_h_30(double *state, double *unused, double *out_2313689328341983991) { - h_30(state, unused, out_2313689328341983991); +void car_h_30(double *state, double *unused, double *out_5234641918928339497) { + h_30(state, unused, out_5234641918928339497); } -void car_H_30(double *state, double *unused, double *out_3458221371579876012) { - H_30(state, unused, out_3458221371579876012); +void car_H_30(double *state, double *unused, double *out_913398869739227709) { + H_30(state, unused, out_913398869739227709); } -void car_h_26(double *state, double *unused, double *out_7458579391457631528) { - h_26(state, unused, out_7458579391457631528); +void car_h_26(double *state, double *unused, double *out_3561667545337657643) { + h_26(state, unused, out_3561667545337657643); } -void car_H_26(double *state, double *unused, double *out_7199972288785796967) { - H_26(state, unused, out_7199972288785796967); +void car_H_26(double *state, double *unused, double *out_5346437407642077142) { + H_26(state, unused, out_5346437407642077142); } -void car_h_27(double *state, double *unused, double *out_3146185301477423316) { - h_27(state, unused, out_3146185301477423316); +void car_h_27(double *state, double *unused, double *out_1439593660770015538) { + h_27(state, unused, out_1439593660770015538); } -void car_H_27(double *state, double *unused, double *out_1283458059779451101) { - H_27(state, unused, out_1283458059779451101); +void car_H_27(double *state, double *unused, double *out_3136992940923170926) { + H_27(state, unused, out_3136992940923170926); } -void car_h_29(double *state, double *unused, double *out_2687983939318861654) { - h_29(state, unused, out_2687983939318861654); +void car_h_29(double *state, double *unused, double *out_8210428887120366474) { + h_29(state, unused, out_8210428887120366474); } -void car_H_29(double *state, double *unused, double *out_429904667090099932) { - H_29(state, unused, out_429904667090099932); +void car_H_29(double *state, double *unused, double *out_1423630214053619893) { + H_29(state, unused, out_1423630214053619893); } -void car_h_28(double *state, double *unused, double *out_7768371330933531630) { - h_28(state, unused, out_7768371330933531630); +void car_h_28(double *state, double *unused, double *out_2383103513671677973) { + h_28(state, unused, out_2383103513671677973); } -void car_H_28(double *state, double *unused, double *out_5512303684159630506) { - H_28(state, unused, out_5512303684159630506); +void car_H_28(double *state, double *unused, double *out_3658768803015910681) { + H_28(state, unused, out_3658768803015910681); } -void car_h_31(double *state, double *unused, double *out_5907777290637250112) { - h_31(state, unused, out_5907777290637250112); +void car_h_31(double *state, double *unused, double *out_9057751154923205472) { + h_31(state, unused, out_9057751154923205472); } -void car_H_31(double *state, double *unused, double *out_3427823008034780315) { - H_31(state, unused, out_3427823008034780315); +void car_H_31(double *state, double *unused, double *out_1574288126891060490) { + H_31(state, unused, out_1574288126891060490); } void car_predict(double *in_x, double *in_P, double *in_Q, double dt) { predict(in_x, in_P, in_Q, dt); diff --git a/selfdrive/locationd/models/generated/car.h b/selfdrive/locationd/models/generated/car.h index 14672a669..fd692eaec 100644 --- a/selfdrive/locationd/models/generated/car.h +++ b/selfdrive/locationd/models/generated/car.h @@ -9,27 +9,27 @@ void car_update_27(double *in_x, double *in_P, double *in_z, double *in_R, doubl void car_update_29(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); void car_update_28(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); void car_update_31(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); -void car_err_fun(double *nom_x, double *delta_x, double *out_786078590364264470); -void car_inv_err_fun(double *nom_x, double *true_x, double *out_5919995043477341165); -void car_H_mod_fun(double *state, double *out_3543183180667111266); -void car_f_fun(double *state, double dt, double *out_1497117634121373884); -void car_F_fun(double *state, double dt, double *out_7787221922284321900); -void car_h_25(double *state, double *unused, double *out_6182971352921756001); -void car_H_25(double *state, double *unused, double *out_3458468969911740743); -void car_h_24(double *state, double *unused, double *out_1709075460934367585); -void car_H_24(double *state, double *unused, double *out_5631118568917240309); -void car_h_30(double *state, double *unused, double *out_2313689328341983991); -void car_H_30(double *state, double *unused, double *out_3458221371579876012); -void car_h_26(double *state, double *unused, double *out_7458579391457631528); -void car_H_26(double *state, double *unused, double *out_7199972288785796967); -void car_h_27(double *state, double *unused, double *out_3146185301477423316); -void car_H_27(double *state, double *unused, double *out_1283458059779451101); -void car_h_29(double *state, double *unused, double *out_2687983939318861654); -void car_H_29(double *state, double *unused, double *out_429904667090099932); -void car_h_28(double *state, double *unused, double *out_7768371330933531630); -void car_H_28(double *state, double *unused, double *out_5512303684159630506); -void car_h_31(double *state, double *unused, double *out_5907777290637250112); -void car_H_31(double *state, double *unused, double *out_3427823008034780315); +void car_err_fun(double *nom_x, double *delta_x, double *out_4583207975382893756); +void car_inv_err_fun(double *nom_x, double *true_x, double *out_9143150462401985555); +void car_H_mod_fun(double *state, double *out_3358041296692552281); +void car_f_fun(double *state, double dt, double *out_8358470198575263086); +void car_F_fun(double *state, double dt, double *out_2436312018501040113); +void car_h_25(double *state, double *unused, double *out_6441266928430861183); +void car_H_25(double *state, double *unused, double *out_1604934088768020918); +void car_h_24(double *state, double *unused, double *out_7412346538782629975); +void car_H_24(double *state, double *unused, double *out_572280334839129055); +void car_h_30(double *state, double *unused, double *out_5234641918928339497); +void car_H_30(double *state, double *unused, double *out_913398869739227709); +void car_h_26(double *state, double *unused, double *out_3561667545337657643); +void car_H_26(double *state, double *unused, double *out_5346437407642077142); +void car_h_27(double *state, double *unused, double *out_1439593660770015538); +void car_H_27(double *state, double *unused, double *out_3136992940923170926); +void car_h_29(double *state, double *unused, double *out_8210428887120366474); +void car_H_29(double *state, double *unused, double *out_1423630214053619893); +void car_h_28(double *state, double *unused, double *out_2383103513671677973); +void car_H_28(double *state, double *unused, double *out_3658768803015910681); +void car_h_31(double *state, double *unused, double *out_9057751154923205472); +void car_H_31(double *state, double *unused, double *out_1574288126891060490); void car_predict(double *in_x, double *in_P, double *in_Q, double dt); void car_set_mass(double x); void car_set_rotational_inertia(double x); diff --git a/selfdrive/locationd/models/generated/libcar.so b/selfdrive/locationd/models/generated/libcar.so index c517a7917..ae4ac744e 100755 Binary files a/selfdrive/locationd/models/generated/libcar.so and b/selfdrive/locationd/models/generated/libcar.so differ diff --git a/selfdrive/locationd/models/generated/liblive.so b/selfdrive/locationd/models/generated/liblive.so index 510215d63..d70078f6d 100755 Binary files a/selfdrive/locationd/models/generated/liblive.so and b/selfdrive/locationd/models/generated/liblive.so differ diff --git a/selfdrive/locationd/models/generated/live.cpp b/selfdrive/locationd/models/generated/live.cpp index 34cec1cb5..821021e16 100644 --- a/selfdrive/locationd/models/generated/live.cpp +++ b/selfdrive/locationd/models/generated/live.cpp @@ -22,1683 +22,1683 @@ const static double MAHA_THRESH_33 = 7.814727903251177; * * * This file is part of 'ekf' * ******************************************************************************/ -void H(double *in_vec, double *out_3062539955778785123) { - out_3062539955778785123[0] = 0; - out_3062539955778785123[1] = -sin(in_vec[1])*sin(in_vec[2])*in_vec[4] - sin(in_vec[1])*cos(in_vec[2])*in_vec[3] - cos(in_vec[1])*in_vec[5]; - out_3062539955778785123[2] = -sin(in_vec[2])*cos(in_vec[1])*in_vec[3] + cos(in_vec[1])*cos(in_vec[2])*in_vec[4]; - out_3062539955778785123[3] = cos(in_vec[1])*cos(in_vec[2]); - out_3062539955778785123[4] = sin(in_vec[2])*cos(in_vec[1]); - out_3062539955778785123[5] = -sin(in_vec[1]); - out_3062539955778785123[6] = (sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]))*in_vec[3] + (-sin(in_vec[0])*cos(in_vec[2]) + sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]))*in_vec[4] + cos(in_vec[0])*cos(in_vec[1])*in_vec[5]; - out_3062539955778785123[7] = -sin(in_vec[0])*sin(in_vec[1])*in_vec[5] + sin(in_vec[0])*sin(in_vec[2])*cos(in_vec[1])*in_vec[4] + sin(in_vec[0])*cos(in_vec[1])*cos(in_vec[2])*in_vec[3]; - out_3062539955778785123[8] = (-sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) - cos(in_vec[0])*cos(in_vec[2]))*in_vec[3] + (sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) - sin(in_vec[2])*cos(in_vec[0]))*in_vec[4]; - out_3062539955778785123[9] = sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) - sin(in_vec[2])*cos(in_vec[0]); - out_3062539955778785123[10] = sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) + cos(in_vec[0])*cos(in_vec[2]); - out_3062539955778785123[11] = sin(in_vec[0])*cos(in_vec[1]); - out_3062539955778785123[12] = (-sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) - cos(in_vec[0])*cos(in_vec[2]))*in_vec[4] + (-sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) + sin(in_vec[2])*cos(in_vec[0]))*in_vec[3] - sin(in_vec[0])*cos(in_vec[1])*in_vec[5]; - out_3062539955778785123[13] = -sin(in_vec[1])*cos(in_vec[0])*in_vec[5] + sin(in_vec[2])*cos(in_vec[0])*cos(in_vec[1])*in_vec[4] + cos(in_vec[0])*cos(in_vec[1])*cos(in_vec[2])*in_vec[3]; - out_3062539955778785123[14] = (sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]))*in_vec[4] + (sin(in_vec[0])*cos(in_vec[2]) - sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]))*in_vec[3]; - out_3062539955778785123[15] = sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]); - out_3062539955778785123[16] = -sin(in_vec[0])*cos(in_vec[2]) + sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]); - out_3062539955778785123[17] = cos(in_vec[0])*cos(in_vec[1]); +void H(double *in_vec, double *out_5678547249781205843) { + out_5678547249781205843[0] = 0; + out_5678547249781205843[1] = -sin(in_vec[1])*sin(in_vec[2])*in_vec[4] - sin(in_vec[1])*cos(in_vec[2])*in_vec[3] - cos(in_vec[1])*in_vec[5]; + out_5678547249781205843[2] = -sin(in_vec[2])*cos(in_vec[1])*in_vec[3] + cos(in_vec[1])*cos(in_vec[2])*in_vec[4]; + out_5678547249781205843[3] = cos(in_vec[1])*cos(in_vec[2]); + out_5678547249781205843[4] = sin(in_vec[2])*cos(in_vec[1]); + out_5678547249781205843[5] = -sin(in_vec[1]); + out_5678547249781205843[6] = (sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]))*in_vec[3] + (-sin(in_vec[0])*cos(in_vec[2]) + sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]))*in_vec[4] + cos(in_vec[0])*cos(in_vec[1])*in_vec[5]; + out_5678547249781205843[7] = -sin(in_vec[0])*sin(in_vec[1])*in_vec[5] + sin(in_vec[0])*sin(in_vec[2])*cos(in_vec[1])*in_vec[4] + sin(in_vec[0])*cos(in_vec[1])*cos(in_vec[2])*in_vec[3]; + out_5678547249781205843[8] = (-sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) - cos(in_vec[0])*cos(in_vec[2]))*in_vec[3] + (sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) - sin(in_vec[2])*cos(in_vec[0]))*in_vec[4]; + out_5678547249781205843[9] = sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) - sin(in_vec[2])*cos(in_vec[0]); + out_5678547249781205843[10] = sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) + cos(in_vec[0])*cos(in_vec[2]); + out_5678547249781205843[11] = sin(in_vec[0])*cos(in_vec[1]); + out_5678547249781205843[12] = (-sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) - cos(in_vec[0])*cos(in_vec[2]))*in_vec[4] + (-sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) + sin(in_vec[2])*cos(in_vec[0]))*in_vec[3] - sin(in_vec[0])*cos(in_vec[1])*in_vec[5]; + out_5678547249781205843[13] = -sin(in_vec[1])*cos(in_vec[0])*in_vec[5] + sin(in_vec[2])*cos(in_vec[0])*cos(in_vec[1])*in_vec[4] + cos(in_vec[0])*cos(in_vec[1])*cos(in_vec[2])*in_vec[3]; + out_5678547249781205843[14] = (sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]))*in_vec[4] + (sin(in_vec[0])*cos(in_vec[2]) - sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]))*in_vec[3]; + out_5678547249781205843[15] = sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]); + out_5678547249781205843[16] = -sin(in_vec[0])*cos(in_vec[2]) + sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]); + out_5678547249781205843[17] = cos(in_vec[0])*cos(in_vec[1]); } -void err_fun(double *nom_x, double *delta_x, double *out_997632986539046101) { - out_997632986539046101[0] = delta_x[0] + nom_x[0]; - out_997632986539046101[1] = delta_x[1] + nom_x[1]; - out_997632986539046101[2] = delta_x[2] + nom_x[2]; - out_997632986539046101[3] = -0.5*delta_x[3]*nom_x[4] - 0.5*delta_x[4]*nom_x[5] - 0.5*delta_x[5]*nom_x[6] + 1.0*nom_x[3]; - out_997632986539046101[4] = 0.5*delta_x[3]*nom_x[3] + 0.5*delta_x[4]*nom_x[6] - 0.5*delta_x[5]*nom_x[5] + 1.0*nom_x[4]; - out_997632986539046101[5] = -0.5*delta_x[3]*nom_x[6] + 0.5*delta_x[4]*nom_x[3] + 0.5*delta_x[5]*nom_x[4] + 1.0*nom_x[5]; - out_997632986539046101[6] = 0.5*delta_x[3]*nom_x[5] - 0.5*delta_x[4]*nom_x[4] + 0.5*delta_x[5]*nom_x[3] + 1.0*nom_x[6]; - out_997632986539046101[7] = delta_x[6] + nom_x[7]; - out_997632986539046101[8] = delta_x[7] + nom_x[8]; - out_997632986539046101[9] = delta_x[8] + nom_x[9]; - out_997632986539046101[10] = delta_x[9] + nom_x[10]; - out_997632986539046101[11] = delta_x[10] + nom_x[11]; - out_997632986539046101[12] = delta_x[11] + nom_x[12]; - out_997632986539046101[13] = delta_x[12] + nom_x[13]; - out_997632986539046101[14] = delta_x[13] + nom_x[14]; - out_997632986539046101[15] = delta_x[14] + nom_x[15]; - out_997632986539046101[16] = delta_x[15] + nom_x[16]; - out_997632986539046101[17] = delta_x[16] + nom_x[17]; - out_997632986539046101[18] = delta_x[17] + nom_x[18]; - out_997632986539046101[19] = delta_x[18] + nom_x[19]; - out_997632986539046101[20] = delta_x[19] + nom_x[20]; - out_997632986539046101[21] = delta_x[20] + nom_x[21]; +void err_fun(double *nom_x, double *delta_x, double *out_7786038415114058898) { + out_7786038415114058898[0] = delta_x[0] + nom_x[0]; + out_7786038415114058898[1] = delta_x[1] + nom_x[1]; + out_7786038415114058898[2] = delta_x[2] + nom_x[2]; + out_7786038415114058898[3] = -0.5*delta_x[3]*nom_x[4] - 0.5*delta_x[4]*nom_x[5] - 0.5*delta_x[5]*nom_x[6] + 1.0*nom_x[3]; + out_7786038415114058898[4] = 0.5*delta_x[3]*nom_x[3] + 0.5*delta_x[4]*nom_x[6] - 0.5*delta_x[5]*nom_x[5] + 1.0*nom_x[4]; + out_7786038415114058898[5] = -0.5*delta_x[3]*nom_x[6] + 0.5*delta_x[4]*nom_x[3] + 0.5*delta_x[5]*nom_x[4] + 1.0*nom_x[5]; + out_7786038415114058898[6] = 0.5*delta_x[3]*nom_x[5] - 0.5*delta_x[4]*nom_x[4] + 0.5*delta_x[5]*nom_x[3] + 1.0*nom_x[6]; + out_7786038415114058898[7] = delta_x[6] + nom_x[7]; + out_7786038415114058898[8] = delta_x[7] + nom_x[8]; + out_7786038415114058898[9] = delta_x[8] + nom_x[9]; + out_7786038415114058898[10] = delta_x[9] + nom_x[10]; + out_7786038415114058898[11] = delta_x[10] + nom_x[11]; + out_7786038415114058898[12] = delta_x[11] + nom_x[12]; + out_7786038415114058898[13] = delta_x[12] + nom_x[13]; + out_7786038415114058898[14] = delta_x[13] + nom_x[14]; + out_7786038415114058898[15] = delta_x[14] + nom_x[15]; + out_7786038415114058898[16] = delta_x[15] + nom_x[16]; + out_7786038415114058898[17] = delta_x[16] + nom_x[17]; + out_7786038415114058898[18] = delta_x[17] + nom_x[18]; + out_7786038415114058898[19] = delta_x[18] + nom_x[19]; + out_7786038415114058898[20] = delta_x[19] + nom_x[20]; + out_7786038415114058898[21] = delta_x[20] + nom_x[21]; } -void inv_err_fun(double *nom_x, double *true_x, double *out_3959944895181216754) { - out_3959944895181216754[0] = -nom_x[0] + true_x[0]; - out_3959944895181216754[1] = -nom_x[1] + true_x[1]; - out_3959944895181216754[2] = -nom_x[2] + true_x[2]; - out_3959944895181216754[3] = 2*nom_x[3]*true_x[4] - 2*nom_x[4]*true_x[3] + 2*nom_x[5]*true_x[6] - 2*nom_x[6]*true_x[5]; - out_3959944895181216754[4] = 2*nom_x[3]*true_x[5] - 2*nom_x[4]*true_x[6] - 2*nom_x[5]*true_x[3] + 2*nom_x[6]*true_x[4]; - out_3959944895181216754[5] = 2*nom_x[3]*true_x[6] + 2*nom_x[4]*true_x[5] - 2*nom_x[5]*true_x[4] - 2*nom_x[6]*true_x[3]; - out_3959944895181216754[6] = -nom_x[7] + true_x[7]; - out_3959944895181216754[7] = -nom_x[8] + true_x[8]; - out_3959944895181216754[8] = -nom_x[9] + true_x[9]; - out_3959944895181216754[9] = -nom_x[10] + true_x[10]; - out_3959944895181216754[10] = -nom_x[11] + true_x[11]; - out_3959944895181216754[11] = -nom_x[12] + true_x[12]; - out_3959944895181216754[12] = -nom_x[13] + true_x[13]; - out_3959944895181216754[13] = -nom_x[14] + true_x[14]; - out_3959944895181216754[14] = -nom_x[15] + true_x[15]; - out_3959944895181216754[15] = -nom_x[16] + true_x[16]; - out_3959944895181216754[16] = -nom_x[17] + true_x[17]; - out_3959944895181216754[17] = -nom_x[18] + true_x[18]; - out_3959944895181216754[18] = -nom_x[19] + true_x[19]; - out_3959944895181216754[19] = -nom_x[20] + true_x[20]; - out_3959944895181216754[20] = -nom_x[21] + true_x[21]; +void inv_err_fun(double *nom_x, double *true_x, double *out_4024320067273853194) { + out_4024320067273853194[0] = -nom_x[0] + true_x[0]; + out_4024320067273853194[1] = -nom_x[1] + true_x[1]; + out_4024320067273853194[2] = -nom_x[2] + true_x[2]; + out_4024320067273853194[3] = 2*nom_x[3]*true_x[4] - 2*nom_x[4]*true_x[3] + 2*nom_x[5]*true_x[6] - 2*nom_x[6]*true_x[5]; + out_4024320067273853194[4] = 2*nom_x[3]*true_x[5] - 2*nom_x[4]*true_x[6] - 2*nom_x[5]*true_x[3] + 2*nom_x[6]*true_x[4]; + out_4024320067273853194[5] = 2*nom_x[3]*true_x[6] + 2*nom_x[4]*true_x[5] - 2*nom_x[5]*true_x[4] - 2*nom_x[6]*true_x[3]; + out_4024320067273853194[6] = -nom_x[7] + true_x[7]; + out_4024320067273853194[7] = -nom_x[8] + true_x[8]; + out_4024320067273853194[8] = -nom_x[9] + true_x[9]; + out_4024320067273853194[9] = -nom_x[10] + true_x[10]; + out_4024320067273853194[10] = -nom_x[11] + true_x[11]; + out_4024320067273853194[11] = -nom_x[12] + true_x[12]; + out_4024320067273853194[12] = -nom_x[13] + true_x[13]; + out_4024320067273853194[13] = -nom_x[14] + true_x[14]; + out_4024320067273853194[14] = -nom_x[15] + true_x[15]; + out_4024320067273853194[15] = -nom_x[16] + true_x[16]; + out_4024320067273853194[16] = -nom_x[17] + true_x[17]; + out_4024320067273853194[17] = -nom_x[18] + true_x[18]; + out_4024320067273853194[18] = -nom_x[19] + true_x[19]; + out_4024320067273853194[19] = -nom_x[20] + true_x[20]; + out_4024320067273853194[20] = -nom_x[21] + true_x[21]; } -void H_mod_fun(double *state, double *out_8702234888023658226) { - out_8702234888023658226[0] = 1.0; - out_8702234888023658226[1] = 0; - out_8702234888023658226[2] = 0; - out_8702234888023658226[3] = 0; - out_8702234888023658226[4] = 0; - out_8702234888023658226[5] = 0; - out_8702234888023658226[6] = 0; - out_8702234888023658226[7] = 0; - out_8702234888023658226[8] = 0; - out_8702234888023658226[9] = 0; - out_8702234888023658226[10] = 0; - out_8702234888023658226[11] = 0; - out_8702234888023658226[12] = 0; - out_8702234888023658226[13] = 0; - out_8702234888023658226[14] = 0; - out_8702234888023658226[15] = 0; - out_8702234888023658226[16] = 0; - out_8702234888023658226[17] = 0; - out_8702234888023658226[18] = 0; - out_8702234888023658226[19] = 0; - out_8702234888023658226[20] = 0; - out_8702234888023658226[21] = 0; - out_8702234888023658226[22] = 1.0; - out_8702234888023658226[23] = 0; - out_8702234888023658226[24] = 0; - out_8702234888023658226[25] = 0; - out_8702234888023658226[26] = 0; - out_8702234888023658226[27] = 0; - out_8702234888023658226[28] = 0; - out_8702234888023658226[29] = 0; - out_8702234888023658226[30] = 0; - out_8702234888023658226[31] = 0; - out_8702234888023658226[32] = 0; - out_8702234888023658226[33] = 0; - out_8702234888023658226[34] = 0; - out_8702234888023658226[35] = 0; - out_8702234888023658226[36] = 0; - out_8702234888023658226[37] = 0; - out_8702234888023658226[38] = 0; - out_8702234888023658226[39] = 0; - out_8702234888023658226[40] = 0; - out_8702234888023658226[41] = 0; - out_8702234888023658226[42] = 0; - out_8702234888023658226[43] = 0; - out_8702234888023658226[44] = 1.0; - out_8702234888023658226[45] = 0; - out_8702234888023658226[46] = 0; - out_8702234888023658226[47] = 0; - out_8702234888023658226[48] = 0; - out_8702234888023658226[49] = 0; - out_8702234888023658226[50] = 0; - out_8702234888023658226[51] = 0; - out_8702234888023658226[52] = 0; - out_8702234888023658226[53] = 0; - out_8702234888023658226[54] = 0; - out_8702234888023658226[55] = 0; - out_8702234888023658226[56] = 0; - out_8702234888023658226[57] = 0; - out_8702234888023658226[58] = 0; - out_8702234888023658226[59] = 0; - out_8702234888023658226[60] = 0; - out_8702234888023658226[61] = 0; - out_8702234888023658226[62] = 0; - out_8702234888023658226[63] = 0; - out_8702234888023658226[64] = 0; - out_8702234888023658226[65] = 0; - out_8702234888023658226[66] = -0.5*state[4]; - out_8702234888023658226[67] = -0.5*state[5]; - out_8702234888023658226[68] = -0.5*state[6]; - out_8702234888023658226[69] = 0; - out_8702234888023658226[70] = 0; - out_8702234888023658226[71] = 0; - out_8702234888023658226[72] = 0; - out_8702234888023658226[73] = 0; - out_8702234888023658226[74] = 0; - out_8702234888023658226[75] = 0; - out_8702234888023658226[76] = 0; - out_8702234888023658226[77] = 0; - out_8702234888023658226[78] = 0; - out_8702234888023658226[79] = 0; - out_8702234888023658226[80] = 0; - out_8702234888023658226[81] = 0; - out_8702234888023658226[82] = 0; - out_8702234888023658226[83] = 0; - out_8702234888023658226[84] = 0; - out_8702234888023658226[85] = 0; - out_8702234888023658226[86] = 0; - out_8702234888023658226[87] = 0.5*state[3]; - out_8702234888023658226[88] = 0.5*state[6]; - out_8702234888023658226[89] = -0.5*state[5]; - out_8702234888023658226[90] = 0; - out_8702234888023658226[91] = 0; - out_8702234888023658226[92] = 0; - out_8702234888023658226[93] = 0; - out_8702234888023658226[94] = 0; - out_8702234888023658226[95] = 0; - out_8702234888023658226[96] = 0; - out_8702234888023658226[97] = 0; - out_8702234888023658226[98] = 0; - out_8702234888023658226[99] = 0; - out_8702234888023658226[100] = 0; - out_8702234888023658226[101] = 0; - out_8702234888023658226[102] = 0; - out_8702234888023658226[103] = 0; - out_8702234888023658226[104] = 0; - out_8702234888023658226[105] = 0; - out_8702234888023658226[106] = 0; - out_8702234888023658226[107] = 0; - out_8702234888023658226[108] = -0.5*state[6]; - out_8702234888023658226[109] = 0.5*state[3]; - out_8702234888023658226[110] = 0.5*state[4]; - out_8702234888023658226[111] = 0; - out_8702234888023658226[112] = 0; - out_8702234888023658226[113] = 0; - out_8702234888023658226[114] = 0; - out_8702234888023658226[115] = 0; - out_8702234888023658226[116] = 0; - out_8702234888023658226[117] = 0; - out_8702234888023658226[118] = 0; - out_8702234888023658226[119] = 0; - out_8702234888023658226[120] = 0; - out_8702234888023658226[121] = 0; - out_8702234888023658226[122] = 0; - out_8702234888023658226[123] = 0; - out_8702234888023658226[124] = 0; - out_8702234888023658226[125] = 0; - out_8702234888023658226[126] = 0; - out_8702234888023658226[127] = 0; - out_8702234888023658226[128] = 0; - out_8702234888023658226[129] = 0.5*state[5]; - out_8702234888023658226[130] = -0.5*state[4]; - out_8702234888023658226[131] = 0.5*state[3]; - out_8702234888023658226[132] = 0; - out_8702234888023658226[133] = 0; - out_8702234888023658226[134] = 0; - out_8702234888023658226[135] = 0; - out_8702234888023658226[136] = 0; - out_8702234888023658226[137] = 0; - out_8702234888023658226[138] = 0; - out_8702234888023658226[139] = 0; - out_8702234888023658226[140] = 0; - out_8702234888023658226[141] = 0; - out_8702234888023658226[142] = 0; - out_8702234888023658226[143] = 0; - out_8702234888023658226[144] = 0; - out_8702234888023658226[145] = 0; - out_8702234888023658226[146] = 0; - out_8702234888023658226[147] = 0; - out_8702234888023658226[148] = 0; - out_8702234888023658226[149] = 0; - out_8702234888023658226[150] = 0; - out_8702234888023658226[151] = 0; - out_8702234888023658226[152] = 0; - out_8702234888023658226[153] = 1.0; - out_8702234888023658226[154] = 0; - out_8702234888023658226[155] = 0; - out_8702234888023658226[156] = 0; - out_8702234888023658226[157] = 0; - out_8702234888023658226[158] = 0; - out_8702234888023658226[159] = 0; - out_8702234888023658226[160] = 0; - out_8702234888023658226[161] = 0; - out_8702234888023658226[162] = 0; - out_8702234888023658226[163] = 0; - out_8702234888023658226[164] = 0; - out_8702234888023658226[165] = 0; - out_8702234888023658226[166] = 0; - out_8702234888023658226[167] = 0; - out_8702234888023658226[168] = 0; - out_8702234888023658226[169] = 0; - out_8702234888023658226[170] = 0; - out_8702234888023658226[171] = 0; - out_8702234888023658226[172] = 0; - out_8702234888023658226[173] = 0; - out_8702234888023658226[174] = 0; - out_8702234888023658226[175] = 1.0; - out_8702234888023658226[176] = 0; - out_8702234888023658226[177] = 0; - out_8702234888023658226[178] = 0; - out_8702234888023658226[179] = 0; - out_8702234888023658226[180] = 0; - out_8702234888023658226[181] = 0; - out_8702234888023658226[182] = 0; - out_8702234888023658226[183] = 0; - out_8702234888023658226[184] = 0; - out_8702234888023658226[185] = 0; - out_8702234888023658226[186] = 0; - out_8702234888023658226[187] = 0; - out_8702234888023658226[188] = 0; - out_8702234888023658226[189] = 0; - out_8702234888023658226[190] = 0; - out_8702234888023658226[191] = 0; - out_8702234888023658226[192] = 0; - out_8702234888023658226[193] = 0; - out_8702234888023658226[194] = 0; - out_8702234888023658226[195] = 0; - out_8702234888023658226[196] = 0; - out_8702234888023658226[197] = 1.0; - out_8702234888023658226[198] = 0; - out_8702234888023658226[199] = 0; - out_8702234888023658226[200] = 0; - out_8702234888023658226[201] = 0; - out_8702234888023658226[202] = 0; - out_8702234888023658226[203] = 0; - out_8702234888023658226[204] = 0; - out_8702234888023658226[205] = 0; - out_8702234888023658226[206] = 0; - out_8702234888023658226[207] = 0; - out_8702234888023658226[208] = 0; - out_8702234888023658226[209] = 0; - out_8702234888023658226[210] = 0; - out_8702234888023658226[211] = 0; - out_8702234888023658226[212] = 0; - out_8702234888023658226[213] = 0; - out_8702234888023658226[214] = 0; - out_8702234888023658226[215] = 0; - out_8702234888023658226[216] = 0; - out_8702234888023658226[217] = 0; - out_8702234888023658226[218] = 0; - out_8702234888023658226[219] = 1.0; - out_8702234888023658226[220] = 0; - out_8702234888023658226[221] = 0; - out_8702234888023658226[222] = 0; - out_8702234888023658226[223] = 0; - out_8702234888023658226[224] = 0; - out_8702234888023658226[225] = 0; - out_8702234888023658226[226] = 0; - out_8702234888023658226[227] = 0; - out_8702234888023658226[228] = 0; - out_8702234888023658226[229] = 0; - out_8702234888023658226[230] = 0; - out_8702234888023658226[231] = 0; - out_8702234888023658226[232] = 0; - out_8702234888023658226[233] = 0; - out_8702234888023658226[234] = 0; - out_8702234888023658226[235] = 0; - out_8702234888023658226[236] = 0; - out_8702234888023658226[237] = 0; - out_8702234888023658226[238] = 0; - out_8702234888023658226[239] = 0; - out_8702234888023658226[240] = 0; - out_8702234888023658226[241] = 1.0; - out_8702234888023658226[242] = 0; - out_8702234888023658226[243] = 0; - out_8702234888023658226[244] = 0; - out_8702234888023658226[245] = 0; - out_8702234888023658226[246] = 0; - out_8702234888023658226[247] = 0; - out_8702234888023658226[248] = 0; - out_8702234888023658226[249] = 0; - out_8702234888023658226[250] = 0; - out_8702234888023658226[251] = 0; - out_8702234888023658226[252] = 0; - out_8702234888023658226[253] = 0; - out_8702234888023658226[254] = 0; - out_8702234888023658226[255] = 0; - out_8702234888023658226[256] = 0; - out_8702234888023658226[257] = 0; - out_8702234888023658226[258] = 0; - out_8702234888023658226[259] = 0; - out_8702234888023658226[260] = 0; - out_8702234888023658226[261] = 0; - out_8702234888023658226[262] = 0; - out_8702234888023658226[263] = 1.0; - out_8702234888023658226[264] = 0; - out_8702234888023658226[265] = 0; - out_8702234888023658226[266] = 0; - out_8702234888023658226[267] = 0; - out_8702234888023658226[268] = 0; - out_8702234888023658226[269] = 0; - out_8702234888023658226[270] = 0; - out_8702234888023658226[271] = 0; - out_8702234888023658226[272] = 0; - out_8702234888023658226[273] = 0; - out_8702234888023658226[274] = 0; - out_8702234888023658226[275] = 0; - out_8702234888023658226[276] = 0; - out_8702234888023658226[277] = 0; - out_8702234888023658226[278] = 0; - out_8702234888023658226[279] = 0; - out_8702234888023658226[280] = 0; - out_8702234888023658226[281] = 0; - out_8702234888023658226[282] = 0; - out_8702234888023658226[283] = 0; - out_8702234888023658226[284] = 0; - out_8702234888023658226[285] = 1.0; - out_8702234888023658226[286] = 0; - out_8702234888023658226[287] = 0; - out_8702234888023658226[288] = 0; - out_8702234888023658226[289] = 0; - out_8702234888023658226[290] = 0; - out_8702234888023658226[291] = 0; - out_8702234888023658226[292] = 0; - out_8702234888023658226[293] = 0; - out_8702234888023658226[294] = 0; - out_8702234888023658226[295] = 0; - out_8702234888023658226[296] = 0; - out_8702234888023658226[297] = 0; - out_8702234888023658226[298] = 0; - out_8702234888023658226[299] = 0; - out_8702234888023658226[300] = 0; - out_8702234888023658226[301] = 0; - out_8702234888023658226[302] = 0; - out_8702234888023658226[303] = 0; - out_8702234888023658226[304] = 0; - out_8702234888023658226[305] = 0; - out_8702234888023658226[306] = 0; - out_8702234888023658226[307] = 1.0; - out_8702234888023658226[308] = 0; - out_8702234888023658226[309] = 0; - out_8702234888023658226[310] = 0; - out_8702234888023658226[311] = 0; - out_8702234888023658226[312] = 0; - out_8702234888023658226[313] = 0; - out_8702234888023658226[314] = 0; - out_8702234888023658226[315] = 0; - out_8702234888023658226[316] = 0; - out_8702234888023658226[317] = 0; - out_8702234888023658226[318] = 0; - out_8702234888023658226[319] = 0; - out_8702234888023658226[320] = 0; - out_8702234888023658226[321] = 0; - out_8702234888023658226[322] = 0; - out_8702234888023658226[323] = 0; - out_8702234888023658226[324] = 0; - out_8702234888023658226[325] = 0; - out_8702234888023658226[326] = 0; - out_8702234888023658226[327] = 0; - out_8702234888023658226[328] = 0; - out_8702234888023658226[329] = 1.0; - out_8702234888023658226[330] = 0; - out_8702234888023658226[331] = 0; - out_8702234888023658226[332] = 0; - out_8702234888023658226[333] = 0; - out_8702234888023658226[334] = 0; - out_8702234888023658226[335] = 0; - out_8702234888023658226[336] = 0; - out_8702234888023658226[337] = 0; - out_8702234888023658226[338] = 0; - out_8702234888023658226[339] = 0; - out_8702234888023658226[340] = 0; - out_8702234888023658226[341] = 0; - out_8702234888023658226[342] = 0; - out_8702234888023658226[343] = 0; - out_8702234888023658226[344] = 0; - out_8702234888023658226[345] = 0; - out_8702234888023658226[346] = 0; - out_8702234888023658226[347] = 0; - out_8702234888023658226[348] = 0; - out_8702234888023658226[349] = 0; - out_8702234888023658226[350] = 0; - out_8702234888023658226[351] = 1.0; - out_8702234888023658226[352] = 0; - out_8702234888023658226[353] = 0; - out_8702234888023658226[354] = 0; - out_8702234888023658226[355] = 0; - out_8702234888023658226[356] = 0; - out_8702234888023658226[357] = 0; - out_8702234888023658226[358] = 0; - out_8702234888023658226[359] = 0; - out_8702234888023658226[360] = 0; - out_8702234888023658226[361] = 0; - out_8702234888023658226[362] = 0; - out_8702234888023658226[363] = 0; - out_8702234888023658226[364] = 0; - out_8702234888023658226[365] = 0; - out_8702234888023658226[366] = 0; - out_8702234888023658226[367] = 0; - out_8702234888023658226[368] = 0; - out_8702234888023658226[369] = 0; - out_8702234888023658226[370] = 0; - out_8702234888023658226[371] = 0; - out_8702234888023658226[372] = 0; - out_8702234888023658226[373] = 1.0; - out_8702234888023658226[374] = 0; - out_8702234888023658226[375] = 0; - out_8702234888023658226[376] = 0; - out_8702234888023658226[377] = 0; - out_8702234888023658226[378] = 0; - out_8702234888023658226[379] = 0; - out_8702234888023658226[380] = 0; - out_8702234888023658226[381] = 0; - out_8702234888023658226[382] = 0; - out_8702234888023658226[383] = 0; - out_8702234888023658226[384] = 0; - out_8702234888023658226[385] = 0; - out_8702234888023658226[386] = 0; - out_8702234888023658226[387] = 0; - out_8702234888023658226[388] = 0; - out_8702234888023658226[389] = 0; - out_8702234888023658226[390] = 0; - out_8702234888023658226[391] = 0; - out_8702234888023658226[392] = 0; - out_8702234888023658226[393] = 0; - out_8702234888023658226[394] = 0; - out_8702234888023658226[395] = 1.0; - out_8702234888023658226[396] = 0; - out_8702234888023658226[397] = 0; - out_8702234888023658226[398] = 0; - out_8702234888023658226[399] = 0; - out_8702234888023658226[400] = 0; - out_8702234888023658226[401] = 0; - out_8702234888023658226[402] = 0; - out_8702234888023658226[403] = 0; - out_8702234888023658226[404] = 0; - out_8702234888023658226[405] = 0; - out_8702234888023658226[406] = 0; - out_8702234888023658226[407] = 0; - out_8702234888023658226[408] = 0; - out_8702234888023658226[409] = 0; - out_8702234888023658226[410] = 0; - out_8702234888023658226[411] = 0; - out_8702234888023658226[412] = 0; - out_8702234888023658226[413] = 0; - out_8702234888023658226[414] = 0; - out_8702234888023658226[415] = 0; - out_8702234888023658226[416] = 0; - out_8702234888023658226[417] = 1.0; - out_8702234888023658226[418] = 0; - out_8702234888023658226[419] = 0; - out_8702234888023658226[420] = 0; - out_8702234888023658226[421] = 0; - out_8702234888023658226[422] = 0; - out_8702234888023658226[423] = 0; - out_8702234888023658226[424] = 0; - out_8702234888023658226[425] = 0; - out_8702234888023658226[426] = 0; - out_8702234888023658226[427] = 0; - out_8702234888023658226[428] = 0; - out_8702234888023658226[429] = 0; - out_8702234888023658226[430] = 0; - out_8702234888023658226[431] = 0; - out_8702234888023658226[432] = 0; - out_8702234888023658226[433] = 0; - out_8702234888023658226[434] = 0; - out_8702234888023658226[435] = 0; - out_8702234888023658226[436] = 0; - out_8702234888023658226[437] = 0; - out_8702234888023658226[438] = 0; - out_8702234888023658226[439] = 1.0; - out_8702234888023658226[440] = 0; - out_8702234888023658226[441] = 0; - out_8702234888023658226[442] = 0; - out_8702234888023658226[443] = 0; - out_8702234888023658226[444] = 0; - out_8702234888023658226[445] = 0; - out_8702234888023658226[446] = 0; - out_8702234888023658226[447] = 0; - out_8702234888023658226[448] = 0; - out_8702234888023658226[449] = 0; - out_8702234888023658226[450] = 0; - out_8702234888023658226[451] = 0; - out_8702234888023658226[452] = 0; - out_8702234888023658226[453] = 0; - out_8702234888023658226[454] = 0; - out_8702234888023658226[455] = 0; - out_8702234888023658226[456] = 0; - out_8702234888023658226[457] = 0; - out_8702234888023658226[458] = 0; - out_8702234888023658226[459] = 0; - out_8702234888023658226[460] = 0; - out_8702234888023658226[461] = 1.0; +void H_mod_fun(double *state, double *out_5397558725730410635) { + out_5397558725730410635[0] = 1.0; + out_5397558725730410635[1] = 0; + out_5397558725730410635[2] = 0; + out_5397558725730410635[3] = 0; + out_5397558725730410635[4] = 0; + out_5397558725730410635[5] = 0; + out_5397558725730410635[6] = 0; + out_5397558725730410635[7] = 0; + out_5397558725730410635[8] = 0; + out_5397558725730410635[9] = 0; + out_5397558725730410635[10] = 0; + out_5397558725730410635[11] = 0; + out_5397558725730410635[12] = 0; + out_5397558725730410635[13] = 0; + out_5397558725730410635[14] = 0; + out_5397558725730410635[15] = 0; + out_5397558725730410635[16] = 0; + out_5397558725730410635[17] = 0; + out_5397558725730410635[18] = 0; + out_5397558725730410635[19] = 0; + out_5397558725730410635[20] = 0; + out_5397558725730410635[21] = 0; + out_5397558725730410635[22] = 1.0; + out_5397558725730410635[23] = 0; + out_5397558725730410635[24] = 0; + out_5397558725730410635[25] = 0; + out_5397558725730410635[26] = 0; + out_5397558725730410635[27] = 0; + out_5397558725730410635[28] = 0; + out_5397558725730410635[29] = 0; + out_5397558725730410635[30] = 0; + out_5397558725730410635[31] = 0; + out_5397558725730410635[32] = 0; + out_5397558725730410635[33] = 0; + out_5397558725730410635[34] = 0; + out_5397558725730410635[35] = 0; + out_5397558725730410635[36] = 0; + out_5397558725730410635[37] = 0; + out_5397558725730410635[38] = 0; + out_5397558725730410635[39] = 0; + out_5397558725730410635[40] = 0; + out_5397558725730410635[41] = 0; + out_5397558725730410635[42] = 0; + out_5397558725730410635[43] = 0; + out_5397558725730410635[44] = 1.0; + out_5397558725730410635[45] = 0; + out_5397558725730410635[46] = 0; + out_5397558725730410635[47] = 0; + out_5397558725730410635[48] = 0; + out_5397558725730410635[49] = 0; + out_5397558725730410635[50] = 0; + out_5397558725730410635[51] = 0; + out_5397558725730410635[52] = 0; + out_5397558725730410635[53] = 0; + out_5397558725730410635[54] = 0; + out_5397558725730410635[55] = 0; + out_5397558725730410635[56] = 0; + out_5397558725730410635[57] = 0; + out_5397558725730410635[58] = 0; + out_5397558725730410635[59] = 0; + out_5397558725730410635[60] = 0; + out_5397558725730410635[61] = 0; + out_5397558725730410635[62] = 0; + out_5397558725730410635[63] = 0; + out_5397558725730410635[64] = 0; + out_5397558725730410635[65] = 0; + out_5397558725730410635[66] = -0.5*state[4]; + out_5397558725730410635[67] = -0.5*state[5]; + out_5397558725730410635[68] = -0.5*state[6]; + out_5397558725730410635[69] = 0; + out_5397558725730410635[70] = 0; + out_5397558725730410635[71] = 0; + out_5397558725730410635[72] = 0; + out_5397558725730410635[73] = 0; + out_5397558725730410635[74] = 0; + out_5397558725730410635[75] = 0; + out_5397558725730410635[76] = 0; + out_5397558725730410635[77] = 0; + out_5397558725730410635[78] = 0; + out_5397558725730410635[79] = 0; + out_5397558725730410635[80] = 0; + out_5397558725730410635[81] = 0; + out_5397558725730410635[82] = 0; + out_5397558725730410635[83] = 0; + out_5397558725730410635[84] = 0; + out_5397558725730410635[85] = 0; + out_5397558725730410635[86] = 0; + out_5397558725730410635[87] = 0.5*state[3]; + out_5397558725730410635[88] = 0.5*state[6]; + out_5397558725730410635[89] = -0.5*state[5]; + out_5397558725730410635[90] = 0; + out_5397558725730410635[91] = 0; + out_5397558725730410635[92] = 0; + out_5397558725730410635[93] = 0; + out_5397558725730410635[94] = 0; + out_5397558725730410635[95] = 0; + out_5397558725730410635[96] = 0; + out_5397558725730410635[97] = 0; + out_5397558725730410635[98] = 0; + out_5397558725730410635[99] = 0; + out_5397558725730410635[100] = 0; + out_5397558725730410635[101] = 0; + out_5397558725730410635[102] = 0; + out_5397558725730410635[103] = 0; + out_5397558725730410635[104] = 0; + out_5397558725730410635[105] = 0; + out_5397558725730410635[106] = 0; + out_5397558725730410635[107] = 0; + out_5397558725730410635[108] = -0.5*state[6]; + out_5397558725730410635[109] = 0.5*state[3]; + out_5397558725730410635[110] = 0.5*state[4]; + out_5397558725730410635[111] = 0; + out_5397558725730410635[112] = 0; + out_5397558725730410635[113] = 0; + out_5397558725730410635[114] = 0; + out_5397558725730410635[115] = 0; + out_5397558725730410635[116] = 0; + out_5397558725730410635[117] = 0; + out_5397558725730410635[118] = 0; + out_5397558725730410635[119] = 0; + out_5397558725730410635[120] = 0; + out_5397558725730410635[121] = 0; + out_5397558725730410635[122] = 0; + out_5397558725730410635[123] = 0; + out_5397558725730410635[124] = 0; + out_5397558725730410635[125] = 0; + out_5397558725730410635[126] = 0; + out_5397558725730410635[127] = 0; + out_5397558725730410635[128] = 0; + out_5397558725730410635[129] = 0.5*state[5]; + out_5397558725730410635[130] = -0.5*state[4]; + out_5397558725730410635[131] = 0.5*state[3]; + out_5397558725730410635[132] = 0; + out_5397558725730410635[133] = 0; + out_5397558725730410635[134] = 0; + out_5397558725730410635[135] = 0; + out_5397558725730410635[136] = 0; + out_5397558725730410635[137] = 0; + out_5397558725730410635[138] = 0; + out_5397558725730410635[139] = 0; + out_5397558725730410635[140] = 0; + out_5397558725730410635[141] = 0; + out_5397558725730410635[142] = 0; + out_5397558725730410635[143] = 0; + out_5397558725730410635[144] = 0; + out_5397558725730410635[145] = 0; + out_5397558725730410635[146] = 0; + out_5397558725730410635[147] = 0; + out_5397558725730410635[148] = 0; + out_5397558725730410635[149] = 0; + out_5397558725730410635[150] = 0; + out_5397558725730410635[151] = 0; + out_5397558725730410635[152] = 0; + out_5397558725730410635[153] = 1.0; + out_5397558725730410635[154] = 0; + out_5397558725730410635[155] = 0; + out_5397558725730410635[156] = 0; + out_5397558725730410635[157] = 0; + out_5397558725730410635[158] = 0; + out_5397558725730410635[159] = 0; + out_5397558725730410635[160] = 0; + out_5397558725730410635[161] = 0; + out_5397558725730410635[162] = 0; + out_5397558725730410635[163] = 0; + out_5397558725730410635[164] = 0; + out_5397558725730410635[165] = 0; + out_5397558725730410635[166] = 0; + out_5397558725730410635[167] = 0; + out_5397558725730410635[168] = 0; + out_5397558725730410635[169] = 0; + out_5397558725730410635[170] = 0; + out_5397558725730410635[171] = 0; + out_5397558725730410635[172] = 0; + out_5397558725730410635[173] = 0; + out_5397558725730410635[174] = 0; + out_5397558725730410635[175] = 1.0; + out_5397558725730410635[176] = 0; + out_5397558725730410635[177] = 0; + out_5397558725730410635[178] = 0; + out_5397558725730410635[179] = 0; + out_5397558725730410635[180] = 0; + out_5397558725730410635[181] = 0; + out_5397558725730410635[182] = 0; + out_5397558725730410635[183] = 0; + out_5397558725730410635[184] = 0; + out_5397558725730410635[185] = 0; + out_5397558725730410635[186] = 0; + out_5397558725730410635[187] = 0; + out_5397558725730410635[188] = 0; + out_5397558725730410635[189] = 0; + out_5397558725730410635[190] = 0; + out_5397558725730410635[191] = 0; + out_5397558725730410635[192] = 0; + out_5397558725730410635[193] = 0; + out_5397558725730410635[194] = 0; + out_5397558725730410635[195] = 0; + out_5397558725730410635[196] = 0; + out_5397558725730410635[197] = 1.0; + out_5397558725730410635[198] = 0; + out_5397558725730410635[199] = 0; + out_5397558725730410635[200] = 0; + out_5397558725730410635[201] = 0; + out_5397558725730410635[202] = 0; + out_5397558725730410635[203] = 0; + out_5397558725730410635[204] = 0; + out_5397558725730410635[205] = 0; + out_5397558725730410635[206] = 0; + out_5397558725730410635[207] = 0; + out_5397558725730410635[208] = 0; + out_5397558725730410635[209] = 0; + out_5397558725730410635[210] = 0; + out_5397558725730410635[211] = 0; + out_5397558725730410635[212] = 0; + out_5397558725730410635[213] = 0; + out_5397558725730410635[214] = 0; + out_5397558725730410635[215] = 0; + out_5397558725730410635[216] = 0; + out_5397558725730410635[217] = 0; + out_5397558725730410635[218] = 0; + out_5397558725730410635[219] = 1.0; + out_5397558725730410635[220] = 0; + out_5397558725730410635[221] = 0; + out_5397558725730410635[222] = 0; + out_5397558725730410635[223] = 0; + out_5397558725730410635[224] = 0; + out_5397558725730410635[225] = 0; + out_5397558725730410635[226] = 0; + out_5397558725730410635[227] = 0; + out_5397558725730410635[228] = 0; + out_5397558725730410635[229] = 0; + out_5397558725730410635[230] = 0; + out_5397558725730410635[231] = 0; + out_5397558725730410635[232] = 0; + out_5397558725730410635[233] = 0; + out_5397558725730410635[234] = 0; + out_5397558725730410635[235] = 0; + out_5397558725730410635[236] = 0; + out_5397558725730410635[237] = 0; + out_5397558725730410635[238] = 0; + out_5397558725730410635[239] = 0; + out_5397558725730410635[240] = 0; + out_5397558725730410635[241] = 1.0; + out_5397558725730410635[242] = 0; + out_5397558725730410635[243] = 0; + out_5397558725730410635[244] = 0; + out_5397558725730410635[245] = 0; + out_5397558725730410635[246] = 0; + out_5397558725730410635[247] = 0; + out_5397558725730410635[248] = 0; + out_5397558725730410635[249] = 0; + out_5397558725730410635[250] = 0; + out_5397558725730410635[251] = 0; + out_5397558725730410635[252] = 0; + out_5397558725730410635[253] = 0; + out_5397558725730410635[254] = 0; + out_5397558725730410635[255] = 0; + out_5397558725730410635[256] = 0; + out_5397558725730410635[257] = 0; + out_5397558725730410635[258] = 0; + out_5397558725730410635[259] = 0; + out_5397558725730410635[260] = 0; + out_5397558725730410635[261] = 0; + out_5397558725730410635[262] = 0; + out_5397558725730410635[263] = 1.0; + out_5397558725730410635[264] = 0; + out_5397558725730410635[265] = 0; + out_5397558725730410635[266] = 0; + out_5397558725730410635[267] = 0; + out_5397558725730410635[268] = 0; + out_5397558725730410635[269] = 0; + out_5397558725730410635[270] = 0; + out_5397558725730410635[271] = 0; + out_5397558725730410635[272] = 0; + out_5397558725730410635[273] = 0; + out_5397558725730410635[274] = 0; + out_5397558725730410635[275] = 0; + out_5397558725730410635[276] = 0; + out_5397558725730410635[277] = 0; + out_5397558725730410635[278] = 0; + out_5397558725730410635[279] = 0; + out_5397558725730410635[280] = 0; + out_5397558725730410635[281] = 0; + out_5397558725730410635[282] = 0; + out_5397558725730410635[283] = 0; + out_5397558725730410635[284] = 0; + out_5397558725730410635[285] = 1.0; + out_5397558725730410635[286] = 0; + out_5397558725730410635[287] = 0; + out_5397558725730410635[288] = 0; + out_5397558725730410635[289] = 0; + out_5397558725730410635[290] = 0; + out_5397558725730410635[291] = 0; + out_5397558725730410635[292] = 0; + out_5397558725730410635[293] = 0; + out_5397558725730410635[294] = 0; + out_5397558725730410635[295] = 0; + out_5397558725730410635[296] = 0; + out_5397558725730410635[297] = 0; + out_5397558725730410635[298] = 0; + out_5397558725730410635[299] = 0; + out_5397558725730410635[300] = 0; + out_5397558725730410635[301] = 0; + out_5397558725730410635[302] = 0; + out_5397558725730410635[303] = 0; + out_5397558725730410635[304] = 0; + out_5397558725730410635[305] = 0; + out_5397558725730410635[306] = 0; + out_5397558725730410635[307] = 1.0; + out_5397558725730410635[308] = 0; + out_5397558725730410635[309] = 0; + out_5397558725730410635[310] = 0; + out_5397558725730410635[311] = 0; + out_5397558725730410635[312] = 0; + out_5397558725730410635[313] = 0; + out_5397558725730410635[314] = 0; + out_5397558725730410635[315] = 0; + out_5397558725730410635[316] = 0; + out_5397558725730410635[317] = 0; + out_5397558725730410635[318] = 0; + out_5397558725730410635[319] = 0; + out_5397558725730410635[320] = 0; + out_5397558725730410635[321] = 0; + out_5397558725730410635[322] = 0; + out_5397558725730410635[323] = 0; + out_5397558725730410635[324] = 0; + out_5397558725730410635[325] = 0; + out_5397558725730410635[326] = 0; + out_5397558725730410635[327] = 0; + out_5397558725730410635[328] = 0; + out_5397558725730410635[329] = 1.0; + out_5397558725730410635[330] = 0; + out_5397558725730410635[331] = 0; + out_5397558725730410635[332] = 0; + out_5397558725730410635[333] = 0; + out_5397558725730410635[334] = 0; + out_5397558725730410635[335] = 0; + out_5397558725730410635[336] = 0; + out_5397558725730410635[337] = 0; + out_5397558725730410635[338] = 0; + out_5397558725730410635[339] = 0; + out_5397558725730410635[340] = 0; + out_5397558725730410635[341] = 0; + out_5397558725730410635[342] = 0; + out_5397558725730410635[343] = 0; + out_5397558725730410635[344] = 0; + out_5397558725730410635[345] = 0; + out_5397558725730410635[346] = 0; + out_5397558725730410635[347] = 0; + out_5397558725730410635[348] = 0; + out_5397558725730410635[349] = 0; + out_5397558725730410635[350] = 0; + out_5397558725730410635[351] = 1.0; + out_5397558725730410635[352] = 0; + out_5397558725730410635[353] = 0; + out_5397558725730410635[354] = 0; + out_5397558725730410635[355] = 0; + out_5397558725730410635[356] = 0; + out_5397558725730410635[357] = 0; + out_5397558725730410635[358] = 0; + out_5397558725730410635[359] = 0; + out_5397558725730410635[360] = 0; + out_5397558725730410635[361] = 0; + out_5397558725730410635[362] = 0; + out_5397558725730410635[363] = 0; + out_5397558725730410635[364] = 0; + out_5397558725730410635[365] = 0; + out_5397558725730410635[366] = 0; + out_5397558725730410635[367] = 0; + out_5397558725730410635[368] = 0; + out_5397558725730410635[369] = 0; + out_5397558725730410635[370] = 0; + out_5397558725730410635[371] = 0; + out_5397558725730410635[372] = 0; + out_5397558725730410635[373] = 1.0; + out_5397558725730410635[374] = 0; + out_5397558725730410635[375] = 0; + out_5397558725730410635[376] = 0; + out_5397558725730410635[377] = 0; + out_5397558725730410635[378] = 0; + out_5397558725730410635[379] = 0; + out_5397558725730410635[380] = 0; + out_5397558725730410635[381] = 0; + out_5397558725730410635[382] = 0; + out_5397558725730410635[383] = 0; + out_5397558725730410635[384] = 0; + out_5397558725730410635[385] = 0; + out_5397558725730410635[386] = 0; + out_5397558725730410635[387] = 0; + out_5397558725730410635[388] = 0; + out_5397558725730410635[389] = 0; + out_5397558725730410635[390] = 0; + out_5397558725730410635[391] = 0; + out_5397558725730410635[392] = 0; + out_5397558725730410635[393] = 0; + out_5397558725730410635[394] = 0; + out_5397558725730410635[395] = 1.0; + out_5397558725730410635[396] = 0; + out_5397558725730410635[397] = 0; + out_5397558725730410635[398] = 0; + out_5397558725730410635[399] = 0; + out_5397558725730410635[400] = 0; + out_5397558725730410635[401] = 0; + out_5397558725730410635[402] = 0; + out_5397558725730410635[403] = 0; + out_5397558725730410635[404] = 0; + out_5397558725730410635[405] = 0; + out_5397558725730410635[406] = 0; + out_5397558725730410635[407] = 0; + out_5397558725730410635[408] = 0; + out_5397558725730410635[409] = 0; + out_5397558725730410635[410] = 0; + out_5397558725730410635[411] = 0; + out_5397558725730410635[412] = 0; + out_5397558725730410635[413] = 0; + out_5397558725730410635[414] = 0; + out_5397558725730410635[415] = 0; + out_5397558725730410635[416] = 0; + out_5397558725730410635[417] = 1.0; + out_5397558725730410635[418] = 0; + out_5397558725730410635[419] = 0; + out_5397558725730410635[420] = 0; + out_5397558725730410635[421] = 0; + out_5397558725730410635[422] = 0; + out_5397558725730410635[423] = 0; + out_5397558725730410635[424] = 0; + out_5397558725730410635[425] = 0; + out_5397558725730410635[426] = 0; + out_5397558725730410635[427] = 0; + out_5397558725730410635[428] = 0; + out_5397558725730410635[429] = 0; + out_5397558725730410635[430] = 0; + out_5397558725730410635[431] = 0; + out_5397558725730410635[432] = 0; + out_5397558725730410635[433] = 0; + out_5397558725730410635[434] = 0; + out_5397558725730410635[435] = 0; + out_5397558725730410635[436] = 0; + out_5397558725730410635[437] = 0; + out_5397558725730410635[438] = 0; + out_5397558725730410635[439] = 1.0; + out_5397558725730410635[440] = 0; + out_5397558725730410635[441] = 0; + out_5397558725730410635[442] = 0; + out_5397558725730410635[443] = 0; + out_5397558725730410635[444] = 0; + out_5397558725730410635[445] = 0; + out_5397558725730410635[446] = 0; + out_5397558725730410635[447] = 0; + out_5397558725730410635[448] = 0; + out_5397558725730410635[449] = 0; + out_5397558725730410635[450] = 0; + out_5397558725730410635[451] = 0; + out_5397558725730410635[452] = 0; + out_5397558725730410635[453] = 0; + out_5397558725730410635[454] = 0; + out_5397558725730410635[455] = 0; + out_5397558725730410635[456] = 0; + out_5397558725730410635[457] = 0; + out_5397558725730410635[458] = 0; + out_5397558725730410635[459] = 0; + out_5397558725730410635[460] = 0; + out_5397558725730410635[461] = 1.0; } -void f_fun(double *state, double dt, double *out_7459231211064544538) { - out_7459231211064544538[0] = dt*state[7] + state[0]; - out_7459231211064544538[1] = dt*state[8] + state[1]; - out_7459231211064544538[2] = dt*state[9] + state[2]; - out_7459231211064544538[3] = dt*(-0.5*state[4]*state[10] - 0.5*state[5]*state[11] - 0.5*state[6]*state[12]) + state[3]; - out_7459231211064544538[4] = dt*(0.5*state[3]*state[10] + 0.5*state[5]*state[12] - 0.5*state[6]*state[11]) + state[4]; - out_7459231211064544538[5] = dt*(0.5*state[3]*state[11] - 0.5*state[4]*state[12] + 0.5*state[6]*state[10]) + state[5]; - out_7459231211064544538[6] = dt*(0.5*state[3]*state[12] + 0.5*state[4]*state[11] - 0.5*state[5]*state[10]) + state[6]; - out_7459231211064544538[7] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[18] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[17] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[16]) + state[7]; - out_7459231211064544538[8] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[18] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[16] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[17]) + state[8]; - out_7459231211064544538[9] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[17] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]) + state[9]; - out_7459231211064544538[10] = state[10]; - out_7459231211064544538[11] = state[11]; - out_7459231211064544538[12] = state[12]; - out_7459231211064544538[13] = state[13]; - out_7459231211064544538[14] = state[14]; - out_7459231211064544538[15] = state[15]; - out_7459231211064544538[16] = state[16]; - out_7459231211064544538[17] = state[17]; - out_7459231211064544538[18] = state[18]; - out_7459231211064544538[19] = state[19]; - out_7459231211064544538[20] = state[20]; - out_7459231211064544538[21] = state[21]; +void f_fun(double *state, double dt, double *out_4167526640936982777) { + out_4167526640936982777[0] = dt*state[7] + state[0]; + out_4167526640936982777[1] = dt*state[8] + state[1]; + out_4167526640936982777[2] = dt*state[9] + state[2]; + out_4167526640936982777[3] = dt*(-0.5*state[4]*state[10] - 0.5*state[5]*state[11] - 0.5*state[6]*state[12]) + state[3]; + out_4167526640936982777[4] = dt*(0.5*state[3]*state[10] + 0.5*state[5]*state[12] - 0.5*state[6]*state[11]) + state[4]; + out_4167526640936982777[5] = dt*(0.5*state[3]*state[11] - 0.5*state[4]*state[12] + 0.5*state[6]*state[10]) + state[5]; + out_4167526640936982777[6] = dt*(0.5*state[3]*state[12] + 0.5*state[4]*state[11] - 0.5*state[5]*state[10]) + state[6]; + out_4167526640936982777[7] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[18] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[17] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[16]) + state[7]; + out_4167526640936982777[8] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[18] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[16] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[17]) + state[8]; + out_4167526640936982777[9] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[17] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]) + state[9]; + out_4167526640936982777[10] = state[10]; + out_4167526640936982777[11] = state[11]; + out_4167526640936982777[12] = state[12]; + out_4167526640936982777[13] = state[13]; + out_4167526640936982777[14] = state[14]; + out_4167526640936982777[15] = state[15]; + out_4167526640936982777[16] = state[16]; + out_4167526640936982777[17] = state[17]; + out_4167526640936982777[18] = state[18]; + out_4167526640936982777[19] = state[19]; + out_4167526640936982777[20] = state[20]; + out_4167526640936982777[21] = state[21]; } -void F_fun(double *state, double dt, double *out_8962950086978682024) { - out_8962950086978682024[0] = 1; - out_8962950086978682024[1] = 0; - out_8962950086978682024[2] = 0; - out_8962950086978682024[3] = 0; - out_8962950086978682024[4] = 0; - out_8962950086978682024[5] = 0; - out_8962950086978682024[6] = dt; - out_8962950086978682024[7] = 0; - out_8962950086978682024[8] = 0; - out_8962950086978682024[9] = 0; - out_8962950086978682024[10] = 0; - out_8962950086978682024[11] = 0; - out_8962950086978682024[12] = 0; - out_8962950086978682024[13] = 0; - out_8962950086978682024[14] = 0; - out_8962950086978682024[15] = 0; - out_8962950086978682024[16] = 0; - out_8962950086978682024[17] = 0; - out_8962950086978682024[18] = 0; - out_8962950086978682024[19] = 0; - out_8962950086978682024[20] = 0; - out_8962950086978682024[21] = 0; - out_8962950086978682024[22] = 1; - out_8962950086978682024[23] = 0; - out_8962950086978682024[24] = 0; - out_8962950086978682024[25] = 0; - out_8962950086978682024[26] = 0; - out_8962950086978682024[27] = 0; - out_8962950086978682024[28] = dt; - out_8962950086978682024[29] = 0; - out_8962950086978682024[30] = 0; - out_8962950086978682024[31] = 0; - out_8962950086978682024[32] = 0; - out_8962950086978682024[33] = 0; - out_8962950086978682024[34] = 0; - out_8962950086978682024[35] = 0; - out_8962950086978682024[36] = 0; - out_8962950086978682024[37] = 0; - out_8962950086978682024[38] = 0; - out_8962950086978682024[39] = 0; - out_8962950086978682024[40] = 0; - out_8962950086978682024[41] = 0; - out_8962950086978682024[42] = 0; - out_8962950086978682024[43] = 0; - out_8962950086978682024[44] = 1; - out_8962950086978682024[45] = 0; - out_8962950086978682024[46] = 0; - out_8962950086978682024[47] = 0; - out_8962950086978682024[48] = 0; - out_8962950086978682024[49] = 0; - out_8962950086978682024[50] = dt; - out_8962950086978682024[51] = 0; - out_8962950086978682024[52] = 0; - out_8962950086978682024[53] = 0; - out_8962950086978682024[54] = 0; - out_8962950086978682024[55] = 0; - out_8962950086978682024[56] = 0; - out_8962950086978682024[57] = 0; - out_8962950086978682024[58] = 0; - out_8962950086978682024[59] = 0; - out_8962950086978682024[60] = 0; - out_8962950086978682024[61] = 0; - out_8962950086978682024[62] = 0; - out_8962950086978682024[63] = 0; - out_8962950086978682024[64] = 0; - out_8962950086978682024[65] = 0; - out_8962950086978682024[66] = 1; - out_8962950086978682024[67] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[11] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[10] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[12]); - out_8962950086978682024[68] = dt*((2*state[3]*state[4] - 2*state[5]*state[6])*state[12] + (-2*state[3]*state[6] - 2*state[4]*state[5])*state[10] + (-pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[11]); - out_8962950086978682024[69] = 0; - out_8962950086978682024[70] = 0; - out_8962950086978682024[71] = 0; - out_8962950086978682024[72] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); - out_8962950086978682024[73] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]); - out_8962950086978682024[74] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]); - out_8962950086978682024[75] = 0; - out_8962950086978682024[76] = 0; - out_8962950086978682024[77] = 0; - out_8962950086978682024[78] = 0; - out_8962950086978682024[79] = 0; - out_8962950086978682024[80] = 0; - out_8962950086978682024[81] = 0; - out_8962950086978682024[82] = 0; - out_8962950086978682024[83] = 0; - out_8962950086978682024[84] = 0; - out_8962950086978682024[85] = 0; - out_8962950086978682024[86] = 0; - out_8962950086978682024[87] = dt*(-(2*state[3]*state[4] + 2*state[5]*state[6])*state[11] - (-2*state[3]*state[5] + 2*state[4]*state[6])*state[10] - (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[12]); - out_8962950086978682024[88] = 1; - out_8962950086978682024[89] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[12] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[11] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[10]); - out_8962950086978682024[90] = 0; - out_8962950086978682024[91] = 0; - out_8962950086978682024[92] = 0; - out_8962950086978682024[93] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]); - out_8962950086978682024[94] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); - out_8962950086978682024[95] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]); - out_8962950086978682024[96] = 0; - out_8962950086978682024[97] = 0; - out_8962950086978682024[98] = 0; - out_8962950086978682024[99] = 0; - out_8962950086978682024[100] = 0; - out_8962950086978682024[101] = 0; - out_8962950086978682024[102] = 0; - out_8962950086978682024[103] = 0; - out_8962950086978682024[104] = 0; - out_8962950086978682024[105] = 0; - out_8962950086978682024[106] = 0; - out_8962950086978682024[107] = 0; - out_8962950086978682024[108] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[12] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[10] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[11]); - out_8962950086978682024[109] = dt*((-2*state[3]*state[5] - 2*state[4]*state[6])*state[12] + (2*state[3]*state[6] - 2*state[4]*state[5])*state[11] + (-pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) + pow(state[6], 2))*state[10]); - out_8962950086978682024[110] = 1; - out_8962950086978682024[111] = 0; - out_8962950086978682024[112] = 0; - out_8962950086978682024[113] = 0; - out_8962950086978682024[114] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]); - out_8962950086978682024[115] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]); - out_8962950086978682024[116] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); - out_8962950086978682024[117] = 0; - out_8962950086978682024[118] = 0; - out_8962950086978682024[119] = 0; - out_8962950086978682024[120] = 0; - out_8962950086978682024[121] = 0; - out_8962950086978682024[122] = 0; - out_8962950086978682024[123] = 0; - out_8962950086978682024[124] = 0; - out_8962950086978682024[125] = 0; - out_8962950086978682024[126] = 0; - out_8962950086978682024[127] = 0; - out_8962950086978682024[128] = 0; - out_8962950086978682024[129] = 0; - out_8962950086978682024[130] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[17] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]); - out_8962950086978682024[131] = dt*((2*state[3]*state[4] - 2*state[5]*state[6])*state[18] + (-2*state[3]*state[6] - 2*state[4]*state[5])*state[16] + (-pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[17]); - out_8962950086978682024[132] = 1; - out_8962950086978682024[133] = 0; - out_8962950086978682024[134] = 0; - out_8962950086978682024[135] = 0; - out_8962950086978682024[136] = 0; - out_8962950086978682024[137] = 0; - out_8962950086978682024[138] = 0; - out_8962950086978682024[139] = 0; - out_8962950086978682024[140] = 0; - out_8962950086978682024[141] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); - out_8962950086978682024[142] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]); - out_8962950086978682024[143] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]); - out_8962950086978682024[144] = 0; - out_8962950086978682024[145] = 0; - out_8962950086978682024[146] = 0; - out_8962950086978682024[147] = 0; - out_8962950086978682024[148] = 0; - out_8962950086978682024[149] = 0; - out_8962950086978682024[150] = dt*(-(2*state[3]*state[4] + 2*state[5]*state[6])*state[17] - (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] - (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]); - out_8962950086978682024[151] = 0; - out_8962950086978682024[152] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[18] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[17] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[16]); - out_8962950086978682024[153] = 0; - out_8962950086978682024[154] = 1; - out_8962950086978682024[155] = 0; - out_8962950086978682024[156] = 0; - out_8962950086978682024[157] = 0; - out_8962950086978682024[158] = 0; - out_8962950086978682024[159] = 0; - out_8962950086978682024[160] = 0; - out_8962950086978682024[161] = 0; - out_8962950086978682024[162] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]); - out_8962950086978682024[163] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); - out_8962950086978682024[164] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]); - out_8962950086978682024[165] = 0; - out_8962950086978682024[166] = 0; - out_8962950086978682024[167] = 0; - out_8962950086978682024[168] = 0; - out_8962950086978682024[169] = 0; - out_8962950086978682024[170] = 0; - out_8962950086978682024[171] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[18] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[16] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[17]); - out_8962950086978682024[172] = dt*((-2*state[3]*state[5] - 2*state[4]*state[6])*state[18] + (2*state[3]*state[6] - 2*state[4]*state[5])*state[17] + (-pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) + pow(state[6], 2))*state[16]); - out_8962950086978682024[173] = 0; - out_8962950086978682024[174] = 0; - out_8962950086978682024[175] = 0; - out_8962950086978682024[176] = 1; - out_8962950086978682024[177] = 0; - out_8962950086978682024[178] = 0; - out_8962950086978682024[179] = 0; - out_8962950086978682024[180] = 0; - out_8962950086978682024[181] = 0; - out_8962950086978682024[182] = 0; - out_8962950086978682024[183] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]); - out_8962950086978682024[184] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]); - out_8962950086978682024[185] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); - out_8962950086978682024[186] = 0; - out_8962950086978682024[187] = 0; - out_8962950086978682024[188] = 0; - out_8962950086978682024[189] = 0; - out_8962950086978682024[190] = 0; - out_8962950086978682024[191] = 0; - out_8962950086978682024[192] = 0; - out_8962950086978682024[193] = 0; - out_8962950086978682024[194] = 0; - out_8962950086978682024[195] = 0; - out_8962950086978682024[196] = 0; - out_8962950086978682024[197] = 0; - out_8962950086978682024[198] = 1; - out_8962950086978682024[199] = 0; - out_8962950086978682024[200] = 0; - out_8962950086978682024[201] = 0; - out_8962950086978682024[202] = 0; - out_8962950086978682024[203] = 0; - out_8962950086978682024[204] = 0; - out_8962950086978682024[205] = 0; - out_8962950086978682024[206] = 0; - out_8962950086978682024[207] = 0; - out_8962950086978682024[208] = 0; - out_8962950086978682024[209] = 0; - out_8962950086978682024[210] = 0; - out_8962950086978682024[211] = 0; - out_8962950086978682024[212] = 0; - out_8962950086978682024[213] = 0; - out_8962950086978682024[214] = 0; - out_8962950086978682024[215] = 0; - out_8962950086978682024[216] = 0; - out_8962950086978682024[217] = 0; - out_8962950086978682024[218] = 0; - out_8962950086978682024[219] = 0; - out_8962950086978682024[220] = 1; - out_8962950086978682024[221] = 0; - out_8962950086978682024[222] = 0; - out_8962950086978682024[223] = 0; - out_8962950086978682024[224] = 0; - out_8962950086978682024[225] = 0; - out_8962950086978682024[226] = 0; - out_8962950086978682024[227] = 0; - out_8962950086978682024[228] = 0; - out_8962950086978682024[229] = 0; - out_8962950086978682024[230] = 0; - out_8962950086978682024[231] = 0; - out_8962950086978682024[232] = 0; - out_8962950086978682024[233] = 0; - out_8962950086978682024[234] = 0; - out_8962950086978682024[235] = 0; - out_8962950086978682024[236] = 0; - out_8962950086978682024[237] = 0; - out_8962950086978682024[238] = 0; - out_8962950086978682024[239] = 0; - out_8962950086978682024[240] = 0; - out_8962950086978682024[241] = 0; - out_8962950086978682024[242] = 1; - out_8962950086978682024[243] = 0; - out_8962950086978682024[244] = 0; - out_8962950086978682024[245] = 0; - out_8962950086978682024[246] = 0; - out_8962950086978682024[247] = 0; - out_8962950086978682024[248] = 0; - out_8962950086978682024[249] = 0; - out_8962950086978682024[250] = 0; - out_8962950086978682024[251] = 0; - out_8962950086978682024[252] = 0; - out_8962950086978682024[253] = 0; - out_8962950086978682024[254] = 0; - out_8962950086978682024[255] = 0; - out_8962950086978682024[256] = 0; - out_8962950086978682024[257] = 0; - out_8962950086978682024[258] = 0; - out_8962950086978682024[259] = 0; - out_8962950086978682024[260] = 0; - out_8962950086978682024[261] = 0; - out_8962950086978682024[262] = 0; - out_8962950086978682024[263] = 0; - out_8962950086978682024[264] = 1; - out_8962950086978682024[265] = 0; - out_8962950086978682024[266] = 0; - out_8962950086978682024[267] = 0; - out_8962950086978682024[268] = 0; - out_8962950086978682024[269] = 0; - out_8962950086978682024[270] = 0; - out_8962950086978682024[271] = 0; - out_8962950086978682024[272] = 0; - out_8962950086978682024[273] = 0; - out_8962950086978682024[274] = 0; - out_8962950086978682024[275] = 0; - out_8962950086978682024[276] = 0; - out_8962950086978682024[277] = 0; - out_8962950086978682024[278] = 0; - out_8962950086978682024[279] = 0; - out_8962950086978682024[280] = 0; - out_8962950086978682024[281] = 0; - out_8962950086978682024[282] = 0; - out_8962950086978682024[283] = 0; - out_8962950086978682024[284] = 0; - out_8962950086978682024[285] = 0; - out_8962950086978682024[286] = 1; - out_8962950086978682024[287] = 0; - out_8962950086978682024[288] = 0; - out_8962950086978682024[289] = 0; - out_8962950086978682024[290] = 0; - out_8962950086978682024[291] = 0; - out_8962950086978682024[292] = 0; - out_8962950086978682024[293] = 0; - out_8962950086978682024[294] = 0; - out_8962950086978682024[295] = 0; - out_8962950086978682024[296] = 0; - out_8962950086978682024[297] = 0; - out_8962950086978682024[298] = 0; - out_8962950086978682024[299] = 0; - out_8962950086978682024[300] = 0; - out_8962950086978682024[301] = 0; - out_8962950086978682024[302] = 0; - out_8962950086978682024[303] = 0; - out_8962950086978682024[304] = 0; - out_8962950086978682024[305] = 0; - out_8962950086978682024[306] = 0; - out_8962950086978682024[307] = 0; - out_8962950086978682024[308] = 1; - out_8962950086978682024[309] = 0; - out_8962950086978682024[310] = 0; - out_8962950086978682024[311] = 0; - out_8962950086978682024[312] = 0; - out_8962950086978682024[313] = 0; - out_8962950086978682024[314] = 0; - out_8962950086978682024[315] = 0; - out_8962950086978682024[316] = 0; - out_8962950086978682024[317] = 0; - out_8962950086978682024[318] = 0; - out_8962950086978682024[319] = 0; - out_8962950086978682024[320] = 0; - out_8962950086978682024[321] = 0; - out_8962950086978682024[322] = 0; - out_8962950086978682024[323] = 0; - out_8962950086978682024[324] = 0; - out_8962950086978682024[325] = 0; - out_8962950086978682024[326] = 0; - out_8962950086978682024[327] = 0; - out_8962950086978682024[328] = 0; - out_8962950086978682024[329] = 0; - out_8962950086978682024[330] = 1; - out_8962950086978682024[331] = 0; - out_8962950086978682024[332] = 0; - out_8962950086978682024[333] = 0; - out_8962950086978682024[334] = 0; - out_8962950086978682024[335] = 0; - out_8962950086978682024[336] = 0; - out_8962950086978682024[337] = 0; - out_8962950086978682024[338] = 0; - out_8962950086978682024[339] = 0; - out_8962950086978682024[340] = 0; - out_8962950086978682024[341] = 0; - out_8962950086978682024[342] = 0; - out_8962950086978682024[343] = 0; - out_8962950086978682024[344] = 0; - out_8962950086978682024[345] = 0; - out_8962950086978682024[346] = 0; - out_8962950086978682024[347] = 0; - out_8962950086978682024[348] = 0; - out_8962950086978682024[349] = 0; - out_8962950086978682024[350] = 0; - out_8962950086978682024[351] = 0; - out_8962950086978682024[352] = 1; - out_8962950086978682024[353] = 0; - out_8962950086978682024[354] = 0; - out_8962950086978682024[355] = 0; - out_8962950086978682024[356] = 0; - out_8962950086978682024[357] = 0; - out_8962950086978682024[358] = 0; - out_8962950086978682024[359] = 0; - out_8962950086978682024[360] = 0; - out_8962950086978682024[361] = 0; - out_8962950086978682024[362] = 0; - out_8962950086978682024[363] = 0; - out_8962950086978682024[364] = 0; - out_8962950086978682024[365] = 0; - out_8962950086978682024[366] = 0; - out_8962950086978682024[367] = 0; - out_8962950086978682024[368] = 0; - out_8962950086978682024[369] = 0; - out_8962950086978682024[370] = 0; - out_8962950086978682024[371] = 0; - out_8962950086978682024[372] = 0; - out_8962950086978682024[373] = 0; - out_8962950086978682024[374] = 1; - out_8962950086978682024[375] = 0; - out_8962950086978682024[376] = 0; - out_8962950086978682024[377] = 0; - out_8962950086978682024[378] = 0; - out_8962950086978682024[379] = 0; - out_8962950086978682024[380] = 0; - out_8962950086978682024[381] = 0; - out_8962950086978682024[382] = 0; - out_8962950086978682024[383] = 0; - out_8962950086978682024[384] = 0; - out_8962950086978682024[385] = 0; - out_8962950086978682024[386] = 0; - out_8962950086978682024[387] = 0; - out_8962950086978682024[388] = 0; - out_8962950086978682024[389] = 0; - out_8962950086978682024[390] = 0; - out_8962950086978682024[391] = 0; - out_8962950086978682024[392] = 0; - out_8962950086978682024[393] = 0; - out_8962950086978682024[394] = 0; - out_8962950086978682024[395] = 0; - out_8962950086978682024[396] = 1; - out_8962950086978682024[397] = 0; - out_8962950086978682024[398] = 0; - out_8962950086978682024[399] = 0; - out_8962950086978682024[400] = 0; - out_8962950086978682024[401] = 0; - out_8962950086978682024[402] = 0; - out_8962950086978682024[403] = 0; - out_8962950086978682024[404] = 0; - out_8962950086978682024[405] = 0; - out_8962950086978682024[406] = 0; - out_8962950086978682024[407] = 0; - out_8962950086978682024[408] = 0; - out_8962950086978682024[409] = 0; - out_8962950086978682024[410] = 0; - out_8962950086978682024[411] = 0; - out_8962950086978682024[412] = 0; - out_8962950086978682024[413] = 0; - out_8962950086978682024[414] = 0; - out_8962950086978682024[415] = 0; - out_8962950086978682024[416] = 0; - out_8962950086978682024[417] = 0; - out_8962950086978682024[418] = 1; - out_8962950086978682024[419] = 0; - out_8962950086978682024[420] = 0; - out_8962950086978682024[421] = 0; - out_8962950086978682024[422] = 0; - out_8962950086978682024[423] = 0; - out_8962950086978682024[424] = 0; - out_8962950086978682024[425] = 0; - out_8962950086978682024[426] = 0; - out_8962950086978682024[427] = 0; - out_8962950086978682024[428] = 0; - out_8962950086978682024[429] = 0; - out_8962950086978682024[430] = 0; - out_8962950086978682024[431] = 0; - out_8962950086978682024[432] = 0; - out_8962950086978682024[433] = 0; - out_8962950086978682024[434] = 0; - out_8962950086978682024[435] = 0; - out_8962950086978682024[436] = 0; - out_8962950086978682024[437] = 0; - out_8962950086978682024[438] = 0; - out_8962950086978682024[439] = 0; - out_8962950086978682024[440] = 1; +void F_fun(double *state, double dt, double *out_5774721427747447809) { + out_5774721427747447809[0] = 1; + out_5774721427747447809[1] = 0; + out_5774721427747447809[2] = 0; + out_5774721427747447809[3] = 0; + out_5774721427747447809[4] = 0; + out_5774721427747447809[5] = 0; + out_5774721427747447809[6] = dt; + out_5774721427747447809[7] = 0; + out_5774721427747447809[8] = 0; + out_5774721427747447809[9] = 0; + out_5774721427747447809[10] = 0; + out_5774721427747447809[11] = 0; + out_5774721427747447809[12] = 0; + out_5774721427747447809[13] = 0; + out_5774721427747447809[14] = 0; + out_5774721427747447809[15] = 0; + out_5774721427747447809[16] = 0; + out_5774721427747447809[17] = 0; + out_5774721427747447809[18] = 0; + out_5774721427747447809[19] = 0; + out_5774721427747447809[20] = 0; + out_5774721427747447809[21] = 0; + out_5774721427747447809[22] = 1; + out_5774721427747447809[23] = 0; + out_5774721427747447809[24] = 0; + out_5774721427747447809[25] = 0; + out_5774721427747447809[26] = 0; + out_5774721427747447809[27] = 0; + out_5774721427747447809[28] = dt; + out_5774721427747447809[29] = 0; + out_5774721427747447809[30] = 0; + out_5774721427747447809[31] = 0; + out_5774721427747447809[32] = 0; + out_5774721427747447809[33] = 0; + out_5774721427747447809[34] = 0; + out_5774721427747447809[35] = 0; + out_5774721427747447809[36] = 0; + out_5774721427747447809[37] = 0; + out_5774721427747447809[38] = 0; + out_5774721427747447809[39] = 0; + out_5774721427747447809[40] = 0; + out_5774721427747447809[41] = 0; + out_5774721427747447809[42] = 0; + out_5774721427747447809[43] = 0; + out_5774721427747447809[44] = 1; + out_5774721427747447809[45] = 0; + out_5774721427747447809[46] = 0; + out_5774721427747447809[47] = 0; + out_5774721427747447809[48] = 0; + out_5774721427747447809[49] = 0; + out_5774721427747447809[50] = dt; + out_5774721427747447809[51] = 0; + out_5774721427747447809[52] = 0; + out_5774721427747447809[53] = 0; + out_5774721427747447809[54] = 0; + out_5774721427747447809[55] = 0; + out_5774721427747447809[56] = 0; + out_5774721427747447809[57] = 0; + out_5774721427747447809[58] = 0; + out_5774721427747447809[59] = 0; + out_5774721427747447809[60] = 0; + out_5774721427747447809[61] = 0; + out_5774721427747447809[62] = 0; + out_5774721427747447809[63] = 0; + out_5774721427747447809[64] = 0; + out_5774721427747447809[65] = 0; + out_5774721427747447809[66] = 1; + out_5774721427747447809[67] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[11] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[10] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[12]); + out_5774721427747447809[68] = dt*((2*state[3]*state[4] - 2*state[5]*state[6])*state[12] + (-2*state[3]*state[6] - 2*state[4]*state[5])*state[10] + (-pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[11]); + out_5774721427747447809[69] = 0; + out_5774721427747447809[70] = 0; + out_5774721427747447809[71] = 0; + out_5774721427747447809[72] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); + out_5774721427747447809[73] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]); + out_5774721427747447809[74] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]); + out_5774721427747447809[75] = 0; + out_5774721427747447809[76] = 0; + out_5774721427747447809[77] = 0; + out_5774721427747447809[78] = 0; + out_5774721427747447809[79] = 0; + out_5774721427747447809[80] = 0; + out_5774721427747447809[81] = 0; + out_5774721427747447809[82] = 0; + out_5774721427747447809[83] = 0; + out_5774721427747447809[84] = 0; + out_5774721427747447809[85] = 0; + out_5774721427747447809[86] = 0; + out_5774721427747447809[87] = dt*(-(2*state[3]*state[4] + 2*state[5]*state[6])*state[11] - (-2*state[3]*state[5] + 2*state[4]*state[6])*state[10] - (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[12]); + out_5774721427747447809[88] = 1; + out_5774721427747447809[89] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[12] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[11] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[10]); + out_5774721427747447809[90] = 0; + out_5774721427747447809[91] = 0; + out_5774721427747447809[92] = 0; + out_5774721427747447809[93] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]); + out_5774721427747447809[94] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); + out_5774721427747447809[95] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]); + out_5774721427747447809[96] = 0; + out_5774721427747447809[97] = 0; + out_5774721427747447809[98] = 0; + out_5774721427747447809[99] = 0; + out_5774721427747447809[100] = 0; + out_5774721427747447809[101] = 0; + out_5774721427747447809[102] = 0; + out_5774721427747447809[103] = 0; + out_5774721427747447809[104] = 0; + out_5774721427747447809[105] = 0; + out_5774721427747447809[106] = 0; + out_5774721427747447809[107] = 0; + out_5774721427747447809[108] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[12] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[10] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[11]); + out_5774721427747447809[109] = dt*((-2*state[3]*state[5] - 2*state[4]*state[6])*state[12] + (2*state[3]*state[6] - 2*state[4]*state[5])*state[11] + (-pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) + pow(state[6], 2))*state[10]); + out_5774721427747447809[110] = 1; + out_5774721427747447809[111] = 0; + out_5774721427747447809[112] = 0; + out_5774721427747447809[113] = 0; + out_5774721427747447809[114] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]); + out_5774721427747447809[115] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]); + out_5774721427747447809[116] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); + out_5774721427747447809[117] = 0; + out_5774721427747447809[118] = 0; + out_5774721427747447809[119] = 0; + out_5774721427747447809[120] = 0; + out_5774721427747447809[121] = 0; + out_5774721427747447809[122] = 0; + out_5774721427747447809[123] = 0; + out_5774721427747447809[124] = 0; + out_5774721427747447809[125] = 0; + out_5774721427747447809[126] = 0; + out_5774721427747447809[127] = 0; + out_5774721427747447809[128] = 0; + out_5774721427747447809[129] = 0; + out_5774721427747447809[130] = dt*((2*state[3]*state[4] + 2*state[5]*state[6])*state[17] + (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]); + out_5774721427747447809[131] = dt*((2*state[3]*state[4] - 2*state[5]*state[6])*state[18] + (-2*state[3]*state[6] - 2*state[4]*state[5])*state[16] + (-pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[17]); + out_5774721427747447809[132] = 1; + out_5774721427747447809[133] = 0; + out_5774721427747447809[134] = 0; + out_5774721427747447809[135] = 0; + out_5774721427747447809[136] = 0; + out_5774721427747447809[137] = 0; + out_5774721427747447809[138] = 0; + out_5774721427747447809[139] = 0; + out_5774721427747447809[140] = 0; + out_5774721427747447809[141] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); + out_5774721427747447809[142] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]); + out_5774721427747447809[143] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]); + out_5774721427747447809[144] = 0; + out_5774721427747447809[145] = 0; + out_5774721427747447809[146] = 0; + out_5774721427747447809[147] = 0; + out_5774721427747447809[148] = 0; + out_5774721427747447809[149] = 0; + out_5774721427747447809[150] = dt*(-(2*state[3]*state[4] + 2*state[5]*state[6])*state[17] - (-2*state[3]*state[5] + 2*state[4]*state[6])*state[16] - (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[18]); + out_5774721427747447809[151] = 0; + out_5774721427747447809[152] = dt*((2*state[3]*state[5] + 2*state[4]*state[6])*state[18] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[17] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[16]); + out_5774721427747447809[153] = 0; + out_5774721427747447809[154] = 1; + out_5774721427747447809[155] = 0; + out_5774721427747447809[156] = 0; + out_5774721427747447809[157] = 0; + out_5774721427747447809[158] = 0; + out_5774721427747447809[159] = 0; + out_5774721427747447809[160] = 0; + out_5774721427747447809[161] = 0; + out_5774721427747447809[162] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]); + out_5774721427747447809[163] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); + out_5774721427747447809[164] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]); + out_5774721427747447809[165] = 0; + out_5774721427747447809[166] = 0; + out_5774721427747447809[167] = 0; + out_5774721427747447809[168] = 0; + out_5774721427747447809[169] = 0; + out_5774721427747447809[170] = 0; + out_5774721427747447809[171] = dt*((-2*state[3]*state[4] + 2*state[5]*state[6])*state[18] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[16] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[17]); + out_5774721427747447809[172] = dt*((-2*state[3]*state[5] - 2*state[4]*state[6])*state[18] + (2*state[3]*state[6] - 2*state[4]*state[5])*state[17] + (-pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) + pow(state[6], 2))*state[16]); + out_5774721427747447809[173] = 0; + out_5774721427747447809[174] = 0; + out_5774721427747447809[175] = 0; + out_5774721427747447809[176] = 1; + out_5774721427747447809[177] = 0; + out_5774721427747447809[178] = 0; + out_5774721427747447809[179] = 0; + out_5774721427747447809[180] = 0; + out_5774721427747447809[181] = 0; + out_5774721427747447809[182] = 0; + out_5774721427747447809[183] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]); + out_5774721427747447809[184] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]); + out_5774721427747447809[185] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); + out_5774721427747447809[186] = 0; + out_5774721427747447809[187] = 0; + out_5774721427747447809[188] = 0; + out_5774721427747447809[189] = 0; + out_5774721427747447809[190] = 0; + out_5774721427747447809[191] = 0; + out_5774721427747447809[192] = 0; + out_5774721427747447809[193] = 0; + out_5774721427747447809[194] = 0; + out_5774721427747447809[195] = 0; + out_5774721427747447809[196] = 0; + out_5774721427747447809[197] = 0; + out_5774721427747447809[198] = 1; + out_5774721427747447809[199] = 0; + out_5774721427747447809[200] = 0; + out_5774721427747447809[201] = 0; + out_5774721427747447809[202] = 0; + out_5774721427747447809[203] = 0; + out_5774721427747447809[204] = 0; + out_5774721427747447809[205] = 0; + out_5774721427747447809[206] = 0; + out_5774721427747447809[207] = 0; + out_5774721427747447809[208] = 0; + out_5774721427747447809[209] = 0; + out_5774721427747447809[210] = 0; + out_5774721427747447809[211] = 0; + out_5774721427747447809[212] = 0; + out_5774721427747447809[213] = 0; + out_5774721427747447809[214] = 0; + out_5774721427747447809[215] = 0; + out_5774721427747447809[216] = 0; + out_5774721427747447809[217] = 0; + out_5774721427747447809[218] = 0; + out_5774721427747447809[219] = 0; + out_5774721427747447809[220] = 1; + out_5774721427747447809[221] = 0; + out_5774721427747447809[222] = 0; + out_5774721427747447809[223] = 0; + out_5774721427747447809[224] = 0; + out_5774721427747447809[225] = 0; + out_5774721427747447809[226] = 0; + out_5774721427747447809[227] = 0; + out_5774721427747447809[228] = 0; + out_5774721427747447809[229] = 0; + out_5774721427747447809[230] = 0; + out_5774721427747447809[231] = 0; + out_5774721427747447809[232] = 0; + out_5774721427747447809[233] = 0; + out_5774721427747447809[234] = 0; + out_5774721427747447809[235] = 0; + out_5774721427747447809[236] = 0; + out_5774721427747447809[237] = 0; + out_5774721427747447809[238] = 0; + out_5774721427747447809[239] = 0; + out_5774721427747447809[240] = 0; + out_5774721427747447809[241] = 0; + out_5774721427747447809[242] = 1; + out_5774721427747447809[243] = 0; + out_5774721427747447809[244] = 0; + out_5774721427747447809[245] = 0; + out_5774721427747447809[246] = 0; + out_5774721427747447809[247] = 0; + out_5774721427747447809[248] = 0; + out_5774721427747447809[249] = 0; + out_5774721427747447809[250] = 0; + out_5774721427747447809[251] = 0; + out_5774721427747447809[252] = 0; + out_5774721427747447809[253] = 0; + out_5774721427747447809[254] = 0; + out_5774721427747447809[255] = 0; + out_5774721427747447809[256] = 0; + out_5774721427747447809[257] = 0; + out_5774721427747447809[258] = 0; + out_5774721427747447809[259] = 0; + out_5774721427747447809[260] = 0; + out_5774721427747447809[261] = 0; + out_5774721427747447809[262] = 0; + out_5774721427747447809[263] = 0; + out_5774721427747447809[264] = 1; + out_5774721427747447809[265] = 0; + out_5774721427747447809[266] = 0; + out_5774721427747447809[267] = 0; + out_5774721427747447809[268] = 0; + out_5774721427747447809[269] = 0; + out_5774721427747447809[270] = 0; + out_5774721427747447809[271] = 0; + out_5774721427747447809[272] = 0; + out_5774721427747447809[273] = 0; + out_5774721427747447809[274] = 0; + out_5774721427747447809[275] = 0; + out_5774721427747447809[276] = 0; + out_5774721427747447809[277] = 0; + out_5774721427747447809[278] = 0; + out_5774721427747447809[279] = 0; + out_5774721427747447809[280] = 0; + out_5774721427747447809[281] = 0; + out_5774721427747447809[282] = 0; + out_5774721427747447809[283] = 0; + out_5774721427747447809[284] = 0; + out_5774721427747447809[285] = 0; + out_5774721427747447809[286] = 1; + out_5774721427747447809[287] = 0; + out_5774721427747447809[288] = 0; + out_5774721427747447809[289] = 0; + out_5774721427747447809[290] = 0; + out_5774721427747447809[291] = 0; + out_5774721427747447809[292] = 0; + out_5774721427747447809[293] = 0; + out_5774721427747447809[294] = 0; + out_5774721427747447809[295] = 0; + out_5774721427747447809[296] = 0; + out_5774721427747447809[297] = 0; + out_5774721427747447809[298] = 0; + out_5774721427747447809[299] = 0; + out_5774721427747447809[300] = 0; + out_5774721427747447809[301] = 0; + out_5774721427747447809[302] = 0; + out_5774721427747447809[303] = 0; + out_5774721427747447809[304] = 0; + out_5774721427747447809[305] = 0; + out_5774721427747447809[306] = 0; + out_5774721427747447809[307] = 0; + out_5774721427747447809[308] = 1; + out_5774721427747447809[309] = 0; + out_5774721427747447809[310] = 0; + out_5774721427747447809[311] = 0; + out_5774721427747447809[312] = 0; + out_5774721427747447809[313] = 0; + out_5774721427747447809[314] = 0; + out_5774721427747447809[315] = 0; + out_5774721427747447809[316] = 0; + out_5774721427747447809[317] = 0; + out_5774721427747447809[318] = 0; + out_5774721427747447809[319] = 0; + out_5774721427747447809[320] = 0; + out_5774721427747447809[321] = 0; + out_5774721427747447809[322] = 0; + out_5774721427747447809[323] = 0; + out_5774721427747447809[324] = 0; + out_5774721427747447809[325] = 0; + out_5774721427747447809[326] = 0; + out_5774721427747447809[327] = 0; + out_5774721427747447809[328] = 0; + out_5774721427747447809[329] = 0; + out_5774721427747447809[330] = 1; + out_5774721427747447809[331] = 0; + out_5774721427747447809[332] = 0; + out_5774721427747447809[333] = 0; + out_5774721427747447809[334] = 0; + out_5774721427747447809[335] = 0; + out_5774721427747447809[336] = 0; + out_5774721427747447809[337] = 0; + out_5774721427747447809[338] = 0; + out_5774721427747447809[339] = 0; + out_5774721427747447809[340] = 0; + out_5774721427747447809[341] = 0; + out_5774721427747447809[342] = 0; + out_5774721427747447809[343] = 0; + out_5774721427747447809[344] = 0; + out_5774721427747447809[345] = 0; + out_5774721427747447809[346] = 0; + out_5774721427747447809[347] = 0; + out_5774721427747447809[348] = 0; + out_5774721427747447809[349] = 0; + out_5774721427747447809[350] = 0; + out_5774721427747447809[351] = 0; + out_5774721427747447809[352] = 1; + out_5774721427747447809[353] = 0; + out_5774721427747447809[354] = 0; + out_5774721427747447809[355] = 0; + out_5774721427747447809[356] = 0; + out_5774721427747447809[357] = 0; + out_5774721427747447809[358] = 0; + out_5774721427747447809[359] = 0; + out_5774721427747447809[360] = 0; + out_5774721427747447809[361] = 0; + out_5774721427747447809[362] = 0; + out_5774721427747447809[363] = 0; + out_5774721427747447809[364] = 0; + out_5774721427747447809[365] = 0; + out_5774721427747447809[366] = 0; + out_5774721427747447809[367] = 0; + out_5774721427747447809[368] = 0; + out_5774721427747447809[369] = 0; + out_5774721427747447809[370] = 0; + out_5774721427747447809[371] = 0; + out_5774721427747447809[372] = 0; + out_5774721427747447809[373] = 0; + out_5774721427747447809[374] = 1; + out_5774721427747447809[375] = 0; + out_5774721427747447809[376] = 0; + out_5774721427747447809[377] = 0; + out_5774721427747447809[378] = 0; + out_5774721427747447809[379] = 0; + out_5774721427747447809[380] = 0; + out_5774721427747447809[381] = 0; + out_5774721427747447809[382] = 0; + out_5774721427747447809[383] = 0; + out_5774721427747447809[384] = 0; + out_5774721427747447809[385] = 0; + out_5774721427747447809[386] = 0; + out_5774721427747447809[387] = 0; + out_5774721427747447809[388] = 0; + out_5774721427747447809[389] = 0; + out_5774721427747447809[390] = 0; + out_5774721427747447809[391] = 0; + out_5774721427747447809[392] = 0; + out_5774721427747447809[393] = 0; + out_5774721427747447809[394] = 0; + out_5774721427747447809[395] = 0; + out_5774721427747447809[396] = 1; + out_5774721427747447809[397] = 0; + out_5774721427747447809[398] = 0; + out_5774721427747447809[399] = 0; + out_5774721427747447809[400] = 0; + out_5774721427747447809[401] = 0; + out_5774721427747447809[402] = 0; + out_5774721427747447809[403] = 0; + out_5774721427747447809[404] = 0; + out_5774721427747447809[405] = 0; + out_5774721427747447809[406] = 0; + out_5774721427747447809[407] = 0; + out_5774721427747447809[408] = 0; + out_5774721427747447809[409] = 0; + out_5774721427747447809[410] = 0; + out_5774721427747447809[411] = 0; + out_5774721427747447809[412] = 0; + out_5774721427747447809[413] = 0; + out_5774721427747447809[414] = 0; + out_5774721427747447809[415] = 0; + out_5774721427747447809[416] = 0; + out_5774721427747447809[417] = 0; + out_5774721427747447809[418] = 1; + out_5774721427747447809[419] = 0; + out_5774721427747447809[420] = 0; + out_5774721427747447809[421] = 0; + out_5774721427747447809[422] = 0; + out_5774721427747447809[423] = 0; + out_5774721427747447809[424] = 0; + out_5774721427747447809[425] = 0; + out_5774721427747447809[426] = 0; + out_5774721427747447809[427] = 0; + out_5774721427747447809[428] = 0; + out_5774721427747447809[429] = 0; + out_5774721427747447809[430] = 0; + out_5774721427747447809[431] = 0; + out_5774721427747447809[432] = 0; + out_5774721427747447809[433] = 0; + out_5774721427747447809[434] = 0; + out_5774721427747447809[435] = 0; + out_5774721427747447809[436] = 0; + out_5774721427747447809[437] = 0; + out_5774721427747447809[438] = 0; + out_5774721427747447809[439] = 0; + out_5774721427747447809[440] = 1; } -void h_4(double *state, double *unused, double *out_1777498685180261346) { - out_1777498685180261346[0] = state[10] + state[13]; - out_1777498685180261346[1] = state[11] + state[14]; - out_1777498685180261346[2] = state[12] + state[15]; +void h_4(double *state, double *unused, double *out_1878806005493183204) { + out_1878806005493183204[0] = state[10] + state[13]; + out_1878806005493183204[1] = state[11] + state[14]; + out_1878806005493183204[2] = state[12] + state[15]; } -void H_4(double *state, double *unused, double *out_4137287014202993190) { - out_4137287014202993190[0] = 0; - out_4137287014202993190[1] = 0; - out_4137287014202993190[2] = 0; - out_4137287014202993190[3] = 0; - out_4137287014202993190[4] = 0; - out_4137287014202993190[5] = 0; - out_4137287014202993190[6] = 0; - out_4137287014202993190[7] = 0; - out_4137287014202993190[8] = 0; - out_4137287014202993190[9] = 0; - out_4137287014202993190[10] = 1; - out_4137287014202993190[11] = 0; - out_4137287014202993190[12] = 0; - out_4137287014202993190[13] = 1; - out_4137287014202993190[14] = 0; - out_4137287014202993190[15] = 0; - out_4137287014202993190[16] = 0; - out_4137287014202993190[17] = 0; - out_4137287014202993190[18] = 0; - out_4137287014202993190[19] = 0; - out_4137287014202993190[20] = 0; - out_4137287014202993190[21] = 0; - out_4137287014202993190[22] = 0; - out_4137287014202993190[23] = 0; - out_4137287014202993190[24] = 0; - out_4137287014202993190[25] = 0; - out_4137287014202993190[26] = 0; - out_4137287014202993190[27] = 0; - out_4137287014202993190[28] = 0; - out_4137287014202993190[29] = 0; - out_4137287014202993190[30] = 0; - out_4137287014202993190[31] = 0; - out_4137287014202993190[32] = 0; - out_4137287014202993190[33] = 1; - out_4137287014202993190[34] = 0; - out_4137287014202993190[35] = 0; - out_4137287014202993190[36] = 1; - out_4137287014202993190[37] = 0; - out_4137287014202993190[38] = 0; - out_4137287014202993190[39] = 0; - out_4137287014202993190[40] = 0; - out_4137287014202993190[41] = 0; - out_4137287014202993190[42] = 0; - out_4137287014202993190[43] = 0; - out_4137287014202993190[44] = 0; - out_4137287014202993190[45] = 0; - out_4137287014202993190[46] = 0; - out_4137287014202993190[47] = 0; - out_4137287014202993190[48] = 0; - out_4137287014202993190[49] = 0; - out_4137287014202993190[50] = 0; - out_4137287014202993190[51] = 0; - out_4137287014202993190[52] = 0; - out_4137287014202993190[53] = 0; - out_4137287014202993190[54] = 0; - out_4137287014202993190[55] = 0; - out_4137287014202993190[56] = 1; - out_4137287014202993190[57] = 0; - out_4137287014202993190[58] = 0; - out_4137287014202993190[59] = 1; - out_4137287014202993190[60] = 0; - out_4137287014202993190[61] = 0; - out_4137287014202993190[62] = 0; - out_4137287014202993190[63] = 0; - out_4137287014202993190[64] = 0; - out_4137287014202993190[65] = 0; +void H_4(double *state, double *unused, double *out_8360835986635707346) { + out_8360835986635707346[0] = 0; + out_8360835986635707346[1] = 0; + out_8360835986635707346[2] = 0; + out_8360835986635707346[3] = 0; + out_8360835986635707346[4] = 0; + out_8360835986635707346[5] = 0; + out_8360835986635707346[6] = 0; + out_8360835986635707346[7] = 0; + out_8360835986635707346[8] = 0; + out_8360835986635707346[9] = 0; + out_8360835986635707346[10] = 1; + out_8360835986635707346[11] = 0; + out_8360835986635707346[12] = 0; + out_8360835986635707346[13] = 1; + out_8360835986635707346[14] = 0; + out_8360835986635707346[15] = 0; + out_8360835986635707346[16] = 0; + out_8360835986635707346[17] = 0; + out_8360835986635707346[18] = 0; + out_8360835986635707346[19] = 0; + out_8360835986635707346[20] = 0; + out_8360835986635707346[21] = 0; + out_8360835986635707346[22] = 0; + out_8360835986635707346[23] = 0; + out_8360835986635707346[24] = 0; + out_8360835986635707346[25] = 0; + out_8360835986635707346[26] = 0; + out_8360835986635707346[27] = 0; + out_8360835986635707346[28] = 0; + out_8360835986635707346[29] = 0; + out_8360835986635707346[30] = 0; + out_8360835986635707346[31] = 0; + out_8360835986635707346[32] = 0; + out_8360835986635707346[33] = 1; + out_8360835986635707346[34] = 0; + out_8360835986635707346[35] = 0; + out_8360835986635707346[36] = 1; + out_8360835986635707346[37] = 0; + out_8360835986635707346[38] = 0; + out_8360835986635707346[39] = 0; + out_8360835986635707346[40] = 0; + out_8360835986635707346[41] = 0; + out_8360835986635707346[42] = 0; + out_8360835986635707346[43] = 0; + out_8360835986635707346[44] = 0; + out_8360835986635707346[45] = 0; + out_8360835986635707346[46] = 0; + out_8360835986635707346[47] = 0; + out_8360835986635707346[48] = 0; + out_8360835986635707346[49] = 0; + out_8360835986635707346[50] = 0; + out_8360835986635707346[51] = 0; + out_8360835986635707346[52] = 0; + out_8360835986635707346[53] = 0; + out_8360835986635707346[54] = 0; + out_8360835986635707346[55] = 0; + out_8360835986635707346[56] = 1; + out_8360835986635707346[57] = 0; + out_8360835986635707346[58] = 0; + out_8360835986635707346[59] = 1; + out_8360835986635707346[60] = 0; + out_8360835986635707346[61] = 0; + out_8360835986635707346[62] = 0; + out_8360835986635707346[63] = 0; + out_8360835986635707346[64] = 0; + out_8360835986635707346[65] = 0; } -void h_9(double *state, double *unused, double *out_4762408851873785060) { - out_4762408851873785060[0] = state[10]; - out_4762408851873785060[1] = state[11]; - out_4762408851873785060[2] = state[12]; +void h_9(double *state, double *unused, double *out_7008862357845565666) { + out_7008862357845565666[0] = state[10]; + out_7008862357845565666[1] = state[11]; + out_7008862357845565666[2] = state[12]; } -void H_9(double *state, double *unused, double *out_4378476660832583835) { - out_4378476660832583835[0] = 0; - out_4378476660832583835[1] = 0; - out_4378476660832583835[2] = 0; - out_4378476660832583835[3] = 0; - out_4378476660832583835[4] = 0; - out_4378476660832583835[5] = 0; - out_4378476660832583835[6] = 0; - out_4378476660832583835[7] = 0; - out_4378476660832583835[8] = 0; - out_4378476660832583835[9] = 0; - out_4378476660832583835[10] = 1; - out_4378476660832583835[11] = 0; - out_4378476660832583835[12] = 0; - out_4378476660832583835[13] = 0; - out_4378476660832583835[14] = 0; - out_4378476660832583835[15] = 0; - out_4378476660832583835[16] = 0; - out_4378476660832583835[17] = 0; - out_4378476660832583835[18] = 0; - out_4378476660832583835[19] = 0; - out_4378476660832583835[20] = 0; - out_4378476660832583835[21] = 0; - out_4378476660832583835[22] = 0; - out_4378476660832583835[23] = 0; - out_4378476660832583835[24] = 0; - out_4378476660832583835[25] = 0; - out_4378476660832583835[26] = 0; - out_4378476660832583835[27] = 0; - out_4378476660832583835[28] = 0; - out_4378476660832583835[29] = 0; - out_4378476660832583835[30] = 0; - out_4378476660832583835[31] = 0; - out_4378476660832583835[32] = 0; - out_4378476660832583835[33] = 1; - out_4378476660832583835[34] = 0; - out_4378476660832583835[35] = 0; - out_4378476660832583835[36] = 0; - out_4378476660832583835[37] = 0; - out_4378476660832583835[38] = 0; - out_4378476660832583835[39] = 0; - out_4378476660832583835[40] = 0; - out_4378476660832583835[41] = 0; - out_4378476660832583835[42] = 0; - out_4378476660832583835[43] = 0; - out_4378476660832583835[44] = 0; - out_4378476660832583835[45] = 0; - out_4378476660832583835[46] = 0; - out_4378476660832583835[47] = 0; - out_4378476660832583835[48] = 0; - out_4378476660832583835[49] = 0; - out_4378476660832583835[50] = 0; - out_4378476660832583835[51] = 0; - out_4378476660832583835[52] = 0; - out_4378476660832583835[53] = 0; - out_4378476660832583835[54] = 0; - out_4378476660832583835[55] = 0; - out_4378476660832583835[56] = 1; - out_4378476660832583835[57] = 0; - out_4378476660832583835[58] = 0; - out_4378476660832583835[59] = 0; - out_4378476660832583835[60] = 0; - out_4378476660832583835[61] = 0; - out_4378476660832583835[62] = 0; - out_4378476660832583835[63] = 0; - out_4378476660832583835[64] = 0; - out_4378476660832583835[65] = 0; +void H_9(double *state, double *unused, double *out_2798689151809396800) { + out_2798689151809396800[0] = 0; + out_2798689151809396800[1] = 0; + out_2798689151809396800[2] = 0; + out_2798689151809396800[3] = 0; + out_2798689151809396800[4] = 0; + out_2798689151809396800[5] = 0; + out_2798689151809396800[6] = 0; + out_2798689151809396800[7] = 0; + out_2798689151809396800[8] = 0; + out_2798689151809396800[9] = 0; + out_2798689151809396800[10] = 1; + out_2798689151809396800[11] = 0; + out_2798689151809396800[12] = 0; + out_2798689151809396800[13] = 0; + out_2798689151809396800[14] = 0; + out_2798689151809396800[15] = 0; + out_2798689151809396800[16] = 0; + out_2798689151809396800[17] = 0; + out_2798689151809396800[18] = 0; + out_2798689151809396800[19] = 0; + out_2798689151809396800[20] = 0; + out_2798689151809396800[21] = 0; + out_2798689151809396800[22] = 0; + out_2798689151809396800[23] = 0; + out_2798689151809396800[24] = 0; + out_2798689151809396800[25] = 0; + out_2798689151809396800[26] = 0; + out_2798689151809396800[27] = 0; + out_2798689151809396800[28] = 0; + out_2798689151809396800[29] = 0; + out_2798689151809396800[30] = 0; + out_2798689151809396800[31] = 0; + out_2798689151809396800[32] = 0; + out_2798689151809396800[33] = 1; + out_2798689151809396800[34] = 0; + out_2798689151809396800[35] = 0; + out_2798689151809396800[36] = 0; + out_2798689151809396800[37] = 0; + out_2798689151809396800[38] = 0; + out_2798689151809396800[39] = 0; + out_2798689151809396800[40] = 0; + out_2798689151809396800[41] = 0; + out_2798689151809396800[42] = 0; + out_2798689151809396800[43] = 0; + out_2798689151809396800[44] = 0; + out_2798689151809396800[45] = 0; + out_2798689151809396800[46] = 0; + out_2798689151809396800[47] = 0; + out_2798689151809396800[48] = 0; + out_2798689151809396800[49] = 0; + out_2798689151809396800[50] = 0; + out_2798689151809396800[51] = 0; + out_2798689151809396800[52] = 0; + out_2798689151809396800[53] = 0; + out_2798689151809396800[54] = 0; + out_2798689151809396800[55] = 0; + out_2798689151809396800[56] = 1; + out_2798689151809396800[57] = 0; + out_2798689151809396800[58] = 0; + out_2798689151809396800[59] = 0; + out_2798689151809396800[60] = 0; + out_2798689151809396800[61] = 0; + out_2798689151809396800[62] = 0; + out_2798689151809396800[63] = 0; + out_2798689151809396800[64] = 0; + out_2798689151809396800[65] = 0; } -void h_10(double *state, double *unused, double *out_769477702419128333) { - out_769477702419128333[0] = 398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0] + state[16] + state[19]; - out_769477702419128333[1] = 398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[17] + state[20]; - out_769477702419128333[2] = 398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[18] + state[21]; +void h_10(double *state, double *unused, double *out_1854368242330831766) { + out_1854368242330831766[0] = 398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0] + state[16] + state[19]; + out_1854368242330831766[1] = 398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2] + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1] + state[17] + state[20]; + out_1854368242330831766[2] = 398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1] + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0] + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[2] + state[18] + state[21]; } -void H_10(double *state, double *unused, double *out_607115477708369913) { - out_607115477708369913[0] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*pow(state[0], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); - out_607115477708369913[1] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1]; - out_607115477708369913[2] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[2]; - out_607115477708369913[3] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]; - out_607115477708369913[4] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]; - out_607115477708369913[5] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]; - out_607115477708369913[6] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]; - out_607115477708369913[7] = 0; - out_607115477708369913[8] = 0; - out_607115477708369913[9] = 0; - out_607115477708369913[10] = 0; - out_607115477708369913[11] = 0; - out_607115477708369913[12] = 0; - out_607115477708369913[13] = 0; - out_607115477708369913[14] = 0; - out_607115477708369913[15] = 0; - out_607115477708369913[16] = 1; - out_607115477708369913[17] = 0; - out_607115477708369913[18] = 0; - out_607115477708369913[19] = 1; - out_607115477708369913[20] = 0; - out_607115477708369913[21] = 0; - out_607115477708369913[22] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1]; - out_607115477708369913[23] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*pow(state[1], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); - out_607115477708369913[24] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1]*state[2]; - out_607115477708369913[25] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]; - out_607115477708369913[26] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]; - out_607115477708369913[27] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]; - out_607115477708369913[28] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]; - out_607115477708369913[29] = 0; - out_607115477708369913[30] = 0; - out_607115477708369913[31] = 0; - out_607115477708369913[32] = 0; - out_607115477708369913[33] = 0; - out_607115477708369913[34] = 0; - out_607115477708369913[35] = 0; - out_607115477708369913[36] = 0; - out_607115477708369913[37] = 0; - out_607115477708369913[38] = 0; - out_607115477708369913[39] = 1; - out_607115477708369913[40] = 0; - out_607115477708369913[41] = 0; - out_607115477708369913[42] = 1; - out_607115477708369913[43] = 0; - out_607115477708369913[44] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[0]*state[2]; - out_607115477708369913[45] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[1]*state[2]; - out_607115477708369913[46] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*pow(state[2], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); - out_607115477708369913[47] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]; - out_607115477708369913[48] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]; - out_607115477708369913[49] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]; - out_607115477708369913[50] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]; - out_607115477708369913[51] = 0; - out_607115477708369913[52] = 0; - out_607115477708369913[53] = 0; - out_607115477708369913[54] = 0; - out_607115477708369913[55] = 0; - out_607115477708369913[56] = 0; - out_607115477708369913[57] = 0; - out_607115477708369913[58] = 0; - out_607115477708369913[59] = 0; - out_607115477708369913[60] = 0; - out_607115477708369913[61] = 0; - out_607115477708369913[62] = 1; - out_607115477708369913[63] = 0; - out_607115477708369913[64] = 0; - out_607115477708369913[65] = 1; +void H_10(double *state, double *unused, double *out_7728768220624810382) { + out_7728768220624810382[0] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*pow(state[0], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); + out_7728768220624810382[1] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1]; + out_7728768220624810382[2] = -1195801500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(-2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[0]*state[2]; + out_7728768220624810382[3] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]; + out_7728768220624810382[4] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]; + out_7728768220624810382[5] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]; + out_7728768220624810382[6] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]; + out_7728768220624810382[7] = 0; + out_7728768220624810382[8] = 0; + out_7728768220624810382[9] = 0; + out_7728768220624810382[10] = 0; + out_7728768220624810382[11] = 0; + out_7728768220624810382[12] = 0; + out_7728768220624810382[13] = 0; + out_7728768220624810382[14] = 0; + out_7728768220624810382[15] = 0; + out_7728768220624810382[16] = 1; + out_7728768220624810382[17] = 0; + out_7728768220624810382[18] = 0; + out_7728768220624810382[19] = 1; + out_7728768220624810382[20] = 0; + out_7728768220624810382[21] = 0; + out_7728768220624810382[22] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[0]*state[1]; + out_7728768220624810382[23] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*pow(state[1], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); + out_7728768220624810382[24] = -1195801500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[2], 2) + 398600500000000.0*(2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(-2*state[3]*state[6] + 2*state[4]*state[5])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[1]*state[2]; + out_7728768220624810382[25] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]; + out_7728768220624810382[26] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]; + out_7728768220624810382[27] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]; + out_7728768220624810382[28] = -797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]; + out_7728768220624810382[29] = 0; + out_7728768220624810382[30] = 0; + out_7728768220624810382[31] = 0; + out_7728768220624810382[32] = 0; + out_7728768220624810382[33] = 0; + out_7728768220624810382[34] = 0; + out_7728768220624810382[35] = 0; + out_7728768220624810382[36] = 0; + out_7728768220624810382[37] = 0; + out_7728768220624810382[38] = 0; + out_7728768220624810382[39] = 1; + out_7728768220624810382[40] = 0; + out_7728768220624810382[41] = 0; + out_7728768220624810382[42] = 1; + out_7728768220624810382[43] = 0; + out_7728768220624810382[44] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[0], 2) + 398600500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[0]*state[2]; + out_7728768220624810382[45] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*pow(state[1], 2) + 398600500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5) - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[1] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[1]*state[2]; + out_7728768220624810382[46] = -1195801500000000.0*(-2*state[3]*state[4] + 2*state[5]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[1]*state[2] - 1195801500000000.0*(2*state[3]*state[5] + 2*state[4]*state[6])*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*state[0]*state[2] - 1195801500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -2.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*pow(state[2], 2) + 398600500000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); + out_7728768220624810382[47] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[5] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[3]; + out_7728768220624810382[48] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[3] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[4]; + out_7728768220624810382[49] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[3] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[6] - 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[5]; + out_7728768220624810382[50] = 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[0]*state[4] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[1]*state[5] + 797201000000000.0*pow(pow(state[0], 2) + pow(state[1], 2) + pow(state[2], 2), -1.5)*state[2]*state[6]; + out_7728768220624810382[51] = 0; + out_7728768220624810382[52] = 0; + out_7728768220624810382[53] = 0; + out_7728768220624810382[54] = 0; + out_7728768220624810382[55] = 0; + out_7728768220624810382[56] = 0; + out_7728768220624810382[57] = 0; + out_7728768220624810382[58] = 0; + out_7728768220624810382[59] = 0; + out_7728768220624810382[60] = 0; + out_7728768220624810382[61] = 0; + out_7728768220624810382[62] = 1; + out_7728768220624810382[63] = 0; + out_7728768220624810382[64] = 0; + out_7728768220624810382[65] = 1; } -void h_12(double *state, double *unused, double *out_5594886434556651779) { - out_5594886434556651779[0] = state[0]; - out_5594886434556651779[1] = state[1]; - out_5594886434556651779[2] = state[2]; +void h_12(double *state, double *unused, double *out_5466497058915449734) { + out_5466497058915449734[0] = state[0]; + out_5466497058915449734[1] = state[1]; + out_5466497058915449734[2] = state[2]; } -void H_12(double *state, double *unused, double *out_9156743422234954985) { - out_9156743422234954985[0] = 1; - out_9156743422234954985[1] = 0; - out_9156743422234954985[2] = 0; - out_9156743422234954985[3] = 0; - out_9156743422234954985[4] = 0; - out_9156743422234954985[5] = 0; - out_9156743422234954985[6] = 0; - out_9156743422234954985[7] = 0; - out_9156743422234954985[8] = 0; - out_9156743422234954985[9] = 0; - out_9156743422234954985[10] = 0; - out_9156743422234954985[11] = 0; - out_9156743422234954985[12] = 0; - out_9156743422234954985[13] = 0; - out_9156743422234954985[14] = 0; - out_9156743422234954985[15] = 0; - out_9156743422234954985[16] = 0; - out_9156743422234954985[17] = 0; - out_9156743422234954985[18] = 0; - out_9156743422234954985[19] = 0; - out_9156743422234954985[20] = 0; - out_9156743422234954985[21] = 0; - out_9156743422234954985[22] = 0; - out_9156743422234954985[23] = 1; - out_9156743422234954985[24] = 0; - out_9156743422234954985[25] = 0; - out_9156743422234954985[26] = 0; - out_9156743422234954985[27] = 0; - out_9156743422234954985[28] = 0; - out_9156743422234954985[29] = 0; - out_9156743422234954985[30] = 0; - out_9156743422234954985[31] = 0; - out_9156743422234954985[32] = 0; - out_9156743422234954985[33] = 0; - out_9156743422234954985[34] = 0; - out_9156743422234954985[35] = 0; - out_9156743422234954985[36] = 0; - out_9156743422234954985[37] = 0; - out_9156743422234954985[38] = 0; - out_9156743422234954985[39] = 0; - out_9156743422234954985[40] = 0; - out_9156743422234954985[41] = 0; - out_9156743422234954985[42] = 0; - out_9156743422234954985[43] = 0; - out_9156743422234954985[44] = 0; - out_9156743422234954985[45] = 0; - out_9156743422234954985[46] = 1; - out_9156743422234954985[47] = 0; - out_9156743422234954985[48] = 0; - out_9156743422234954985[49] = 0; - out_9156743422234954985[50] = 0; - out_9156743422234954985[51] = 0; - out_9156743422234954985[52] = 0; - out_9156743422234954985[53] = 0; - out_9156743422234954985[54] = 0; - out_9156743422234954985[55] = 0; - out_9156743422234954985[56] = 0; - out_9156743422234954985[57] = 0; - out_9156743422234954985[58] = 0; - out_9156743422234954985[59] = 0; - out_9156743422234954985[60] = 0; - out_9156743422234954985[61] = 0; - out_9156743422234954985[62] = 0; - out_9156743422234954985[63] = 0; - out_9156743422234954985[64] = 0; - out_9156743422234954985[65] = 0; +void H_12(double *state, double *unused, double *out_5066451679041882475) { + out_5066451679041882475[0] = 1; + out_5066451679041882475[1] = 0; + out_5066451679041882475[2] = 0; + out_5066451679041882475[3] = 0; + out_5066451679041882475[4] = 0; + out_5066451679041882475[5] = 0; + out_5066451679041882475[6] = 0; + out_5066451679041882475[7] = 0; + out_5066451679041882475[8] = 0; + out_5066451679041882475[9] = 0; + out_5066451679041882475[10] = 0; + out_5066451679041882475[11] = 0; + out_5066451679041882475[12] = 0; + out_5066451679041882475[13] = 0; + out_5066451679041882475[14] = 0; + out_5066451679041882475[15] = 0; + out_5066451679041882475[16] = 0; + out_5066451679041882475[17] = 0; + out_5066451679041882475[18] = 0; + out_5066451679041882475[19] = 0; + out_5066451679041882475[20] = 0; + out_5066451679041882475[21] = 0; + out_5066451679041882475[22] = 0; + out_5066451679041882475[23] = 1; + out_5066451679041882475[24] = 0; + out_5066451679041882475[25] = 0; + out_5066451679041882475[26] = 0; + out_5066451679041882475[27] = 0; + out_5066451679041882475[28] = 0; + out_5066451679041882475[29] = 0; + out_5066451679041882475[30] = 0; + out_5066451679041882475[31] = 0; + out_5066451679041882475[32] = 0; + out_5066451679041882475[33] = 0; + out_5066451679041882475[34] = 0; + out_5066451679041882475[35] = 0; + out_5066451679041882475[36] = 0; + out_5066451679041882475[37] = 0; + out_5066451679041882475[38] = 0; + out_5066451679041882475[39] = 0; + out_5066451679041882475[40] = 0; + out_5066451679041882475[41] = 0; + out_5066451679041882475[42] = 0; + out_5066451679041882475[43] = 0; + out_5066451679041882475[44] = 0; + out_5066451679041882475[45] = 0; + out_5066451679041882475[46] = 1; + out_5066451679041882475[47] = 0; + out_5066451679041882475[48] = 0; + out_5066451679041882475[49] = 0; + out_5066451679041882475[50] = 0; + out_5066451679041882475[51] = 0; + out_5066451679041882475[52] = 0; + out_5066451679041882475[53] = 0; + out_5066451679041882475[54] = 0; + out_5066451679041882475[55] = 0; + out_5066451679041882475[56] = 0; + out_5066451679041882475[57] = 0; + out_5066451679041882475[58] = 0; + out_5066451679041882475[59] = 0; + out_5066451679041882475[60] = 0; + out_5066451679041882475[61] = 0; + out_5066451679041882475[62] = 0; + out_5066451679041882475[63] = 0; + out_5066451679041882475[64] = 0; + out_5066451679041882475[65] = 0; } -void h_35(double *state, double *unused, double *out_7828238170709544847) { - out_7828238170709544847[0] = state[7]; - out_7828238170709544847[1] = state[8]; - out_7828238170709544847[2] = state[9]; +void h_35(double *state, double *unused, double *out_4931523598679842869) { + out_4931523598679842869[0] = state[7]; + out_4931523598679842869[1] = state[8]; + out_4931523598679842869[2] = state[9]; } -void H_35(double *state, double *unused, double *out_7503949071575600566) { - out_7503949071575600566[0] = 0; - out_7503949071575600566[1] = 0; - out_7503949071575600566[2] = 0; - out_7503949071575600566[3] = 0; - out_7503949071575600566[4] = 0; - out_7503949071575600566[5] = 0; - out_7503949071575600566[6] = 0; - out_7503949071575600566[7] = 1; - out_7503949071575600566[8] = 0; - out_7503949071575600566[9] = 0; - out_7503949071575600566[10] = 0; - out_7503949071575600566[11] = 0; - out_7503949071575600566[12] = 0; - out_7503949071575600566[13] = 0; - out_7503949071575600566[14] = 0; - out_7503949071575600566[15] = 0; - out_7503949071575600566[16] = 0; - out_7503949071575600566[17] = 0; - out_7503949071575600566[18] = 0; - out_7503949071575600566[19] = 0; - out_7503949071575600566[20] = 0; - out_7503949071575600566[21] = 0; - out_7503949071575600566[22] = 0; - out_7503949071575600566[23] = 0; - out_7503949071575600566[24] = 0; - out_7503949071575600566[25] = 0; - out_7503949071575600566[26] = 0; - out_7503949071575600566[27] = 0; - out_7503949071575600566[28] = 0; - out_7503949071575600566[29] = 0; - out_7503949071575600566[30] = 1; - out_7503949071575600566[31] = 0; - out_7503949071575600566[32] = 0; - out_7503949071575600566[33] = 0; - out_7503949071575600566[34] = 0; - out_7503949071575600566[35] = 0; - out_7503949071575600566[36] = 0; - out_7503949071575600566[37] = 0; - out_7503949071575600566[38] = 0; - out_7503949071575600566[39] = 0; - out_7503949071575600566[40] = 0; - out_7503949071575600566[41] = 0; - out_7503949071575600566[42] = 0; - out_7503949071575600566[43] = 0; - out_7503949071575600566[44] = 0; - out_7503949071575600566[45] = 0; - out_7503949071575600566[46] = 0; - out_7503949071575600566[47] = 0; - out_7503949071575600566[48] = 0; - out_7503949071575600566[49] = 0; - out_7503949071575600566[50] = 0; - out_7503949071575600566[51] = 0; - out_7503949071575600566[52] = 0; - out_7503949071575600566[53] = 1; - out_7503949071575600566[54] = 0; - out_7503949071575600566[55] = 0; - out_7503949071575600566[56] = 0; - out_7503949071575600566[57] = 0; - out_7503949071575600566[58] = 0; - out_7503949071575600566[59] = 0; - out_7503949071575600566[60] = 0; - out_7503949071575600566[61] = 0; - out_7503949071575600566[62] = 0; - out_7503949071575600566[63] = 0; - out_7503949071575600566[64] = 0; - out_7503949071575600566[65] = 0; +void H_35(double *state, double *unused, double *out_6719246029701236894) { + out_6719246029701236894[0] = 0; + out_6719246029701236894[1] = 0; + out_6719246029701236894[2] = 0; + out_6719246029701236894[3] = 0; + out_6719246029701236894[4] = 0; + out_6719246029701236894[5] = 0; + out_6719246029701236894[6] = 0; + out_6719246029701236894[7] = 1; + out_6719246029701236894[8] = 0; + out_6719246029701236894[9] = 0; + out_6719246029701236894[10] = 0; + out_6719246029701236894[11] = 0; + out_6719246029701236894[12] = 0; + out_6719246029701236894[13] = 0; + out_6719246029701236894[14] = 0; + out_6719246029701236894[15] = 0; + out_6719246029701236894[16] = 0; + out_6719246029701236894[17] = 0; + out_6719246029701236894[18] = 0; + out_6719246029701236894[19] = 0; + out_6719246029701236894[20] = 0; + out_6719246029701236894[21] = 0; + out_6719246029701236894[22] = 0; + out_6719246029701236894[23] = 0; + out_6719246029701236894[24] = 0; + out_6719246029701236894[25] = 0; + out_6719246029701236894[26] = 0; + out_6719246029701236894[27] = 0; + out_6719246029701236894[28] = 0; + out_6719246029701236894[29] = 0; + out_6719246029701236894[30] = 1; + out_6719246029701236894[31] = 0; + out_6719246029701236894[32] = 0; + out_6719246029701236894[33] = 0; + out_6719246029701236894[34] = 0; + out_6719246029701236894[35] = 0; + out_6719246029701236894[36] = 0; + out_6719246029701236894[37] = 0; + out_6719246029701236894[38] = 0; + out_6719246029701236894[39] = 0; + out_6719246029701236894[40] = 0; + out_6719246029701236894[41] = 0; + out_6719246029701236894[42] = 0; + out_6719246029701236894[43] = 0; + out_6719246029701236894[44] = 0; + out_6719246029701236894[45] = 0; + out_6719246029701236894[46] = 0; + out_6719246029701236894[47] = 0; + out_6719246029701236894[48] = 0; + out_6719246029701236894[49] = 0; + out_6719246029701236894[50] = 0; + out_6719246029701236894[51] = 0; + out_6719246029701236894[52] = 0; + out_6719246029701236894[53] = 1; + out_6719246029701236894[54] = 0; + out_6719246029701236894[55] = 0; + out_6719246029701236894[56] = 0; + out_6719246029701236894[57] = 0; + out_6719246029701236894[58] = 0; + out_6719246029701236894[59] = 0; + out_6719246029701236894[60] = 0; + out_6719246029701236894[61] = 0; + out_6719246029701236894[62] = 0; + out_6719246029701236894[63] = 0; + out_6719246029701236894[64] = 0; + out_6719246029701236894[65] = 0; } -void h_32(double *state, double *unused, double *out_1198587467706715008) { - out_1198587467706715008[0] = state[3]; - out_1198587467706715008[1] = state[4]; - out_1198587467706715008[2] = state[5]; - out_1198587467706715008[3] = state[6]; +void h_32(double *state, double *unused, double *out_2039644813621010602) { + out_2039644813621010602[0] = state[3]; + out_2039644813621010602[1] = state[4]; + out_2039644813621010602[2] = state[5]; + out_2039644813621010602[3] = state[6]; } -void H_32(double *state, double *unused, double *out_5141490629926338492) { - out_5141490629926338492[0] = 0; - out_5141490629926338492[1] = 0; - out_5141490629926338492[2] = 0; - out_5141490629926338492[3] = 1; - out_5141490629926338492[4] = 0; - out_5141490629926338492[5] = 0; - out_5141490629926338492[6] = 0; - out_5141490629926338492[7] = 0; - out_5141490629926338492[8] = 0; - out_5141490629926338492[9] = 0; - out_5141490629926338492[10] = 0; - out_5141490629926338492[11] = 0; - out_5141490629926338492[12] = 0; - out_5141490629926338492[13] = 0; - out_5141490629926338492[14] = 0; - out_5141490629926338492[15] = 0; - out_5141490629926338492[16] = 0; - out_5141490629926338492[17] = 0; - out_5141490629926338492[18] = 0; - out_5141490629926338492[19] = 0; - out_5141490629926338492[20] = 0; - out_5141490629926338492[21] = 0; - out_5141490629926338492[22] = 0; - out_5141490629926338492[23] = 0; - out_5141490629926338492[24] = 0; - out_5141490629926338492[25] = 0; - out_5141490629926338492[26] = 1; - out_5141490629926338492[27] = 0; - out_5141490629926338492[28] = 0; - out_5141490629926338492[29] = 0; - out_5141490629926338492[30] = 0; - out_5141490629926338492[31] = 0; - out_5141490629926338492[32] = 0; - out_5141490629926338492[33] = 0; - out_5141490629926338492[34] = 0; - out_5141490629926338492[35] = 0; - out_5141490629926338492[36] = 0; - out_5141490629926338492[37] = 0; - out_5141490629926338492[38] = 0; - out_5141490629926338492[39] = 0; - out_5141490629926338492[40] = 0; - out_5141490629926338492[41] = 0; - out_5141490629926338492[42] = 0; - out_5141490629926338492[43] = 0; - out_5141490629926338492[44] = 0; - out_5141490629926338492[45] = 0; - out_5141490629926338492[46] = 0; - out_5141490629926338492[47] = 0; - out_5141490629926338492[48] = 0; - out_5141490629926338492[49] = 1; - out_5141490629926338492[50] = 0; - out_5141490629926338492[51] = 0; - out_5141490629926338492[52] = 0; - out_5141490629926338492[53] = 0; - out_5141490629926338492[54] = 0; - out_5141490629926338492[55] = 0; - out_5141490629926338492[56] = 0; - out_5141490629926338492[57] = 0; - out_5141490629926338492[58] = 0; - out_5141490629926338492[59] = 0; - out_5141490629926338492[60] = 0; - out_5141490629926338492[61] = 0; - out_5141490629926338492[62] = 0; - out_5141490629926338492[63] = 0; - out_5141490629926338492[64] = 0; - out_5141490629926338492[65] = 0; - out_5141490629926338492[66] = 0; - out_5141490629926338492[67] = 0; - out_5141490629926338492[68] = 0; - out_5141490629926338492[69] = 0; - out_5141490629926338492[70] = 0; - out_5141490629926338492[71] = 0; - out_5141490629926338492[72] = 1; - out_5141490629926338492[73] = 0; - out_5141490629926338492[74] = 0; - out_5141490629926338492[75] = 0; - out_5141490629926338492[76] = 0; - out_5141490629926338492[77] = 0; - out_5141490629926338492[78] = 0; - out_5141490629926338492[79] = 0; - out_5141490629926338492[80] = 0; - out_5141490629926338492[81] = 0; - out_5141490629926338492[82] = 0; - out_5141490629926338492[83] = 0; - out_5141490629926338492[84] = 0; - out_5141490629926338492[85] = 0; - out_5141490629926338492[86] = 0; - out_5141490629926338492[87] = 0; +void H_32(double *state, double *unused, double *out_6588081244760496425) { + out_6588081244760496425[0] = 0; + out_6588081244760496425[1] = 0; + out_6588081244760496425[2] = 0; + out_6588081244760496425[3] = 1; + out_6588081244760496425[4] = 0; + out_6588081244760496425[5] = 0; + out_6588081244760496425[6] = 0; + out_6588081244760496425[7] = 0; + out_6588081244760496425[8] = 0; + out_6588081244760496425[9] = 0; + out_6588081244760496425[10] = 0; + out_6588081244760496425[11] = 0; + out_6588081244760496425[12] = 0; + out_6588081244760496425[13] = 0; + out_6588081244760496425[14] = 0; + out_6588081244760496425[15] = 0; + out_6588081244760496425[16] = 0; + out_6588081244760496425[17] = 0; + out_6588081244760496425[18] = 0; + out_6588081244760496425[19] = 0; + out_6588081244760496425[20] = 0; + out_6588081244760496425[21] = 0; + out_6588081244760496425[22] = 0; + out_6588081244760496425[23] = 0; + out_6588081244760496425[24] = 0; + out_6588081244760496425[25] = 0; + out_6588081244760496425[26] = 1; + out_6588081244760496425[27] = 0; + out_6588081244760496425[28] = 0; + out_6588081244760496425[29] = 0; + out_6588081244760496425[30] = 0; + out_6588081244760496425[31] = 0; + out_6588081244760496425[32] = 0; + out_6588081244760496425[33] = 0; + out_6588081244760496425[34] = 0; + out_6588081244760496425[35] = 0; + out_6588081244760496425[36] = 0; + out_6588081244760496425[37] = 0; + out_6588081244760496425[38] = 0; + out_6588081244760496425[39] = 0; + out_6588081244760496425[40] = 0; + out_6588081244760496425[41] = 0; + out_6588081244760496425[42] = 0; + out_6588081244760496425[43] = 0; + out_6588081244760496425[44] = 0; + out_6588081244760496425[45] = 0; + out_6588081244760496425[46] = 0; + out_6588081244760496425[47] = 0; + out_6588081244760496425[48] = 0; + out_6588081244760496425[49] = 1; + out_6588081244760496425[50] = 0; + out_6588081244760496425[51] = 0; + out_6588081244760496425[52] = 0; + out_6588081244760496425[53] = 0; + out_6588081244760496425[54] = 0; + out_6588081244760496425[55] = 0; + out_6588081244760496425[56] = 0; + out_6588081244760496425[57] = 0; + out_6588081244760496425[58] = 0; + out_6588081244760496425[59] = 0; + out_6588081244760496425[60] = 0; + out_6588081244760496425[61] = 0; + out_6588081244760496425[62] = 0; + out_6588081244760496425[63] = 0; + out_6588081244760496425[64] = 0; + out_6588081244760496425[65] = 0; + out_6588081244760496425[66] = 0; + out_6588081244760496425[67] = 0; + out_6588081244760496425[68] = 0; + out_6588081244760496425[69] = 0; + out_6588081244760496425[70] = 0; + out_6588081244760496425[71] = 0; + out_6588081244760496425[72] = 1; + out_6588081244760496425[73] = 0; + out_6588081244760496425[74] = 0; + out_6588081244760496425[75] = 0; + out_6588081244760496425[76] = 0; + out_6588081244760496425[77] = 0; + out_6588081244760496425[78] = 0; + out_6588081244760496425[79] = 0; + out_6588081244760496425[80] = 0; + out_6588081244760496425[81] = 0; + out_6588081244760496425[82] = 0; + out_6588081244760496425[83] = 0; + out_6588081244760496425[84] = 0; + out_6588081244760496425[85] = 0; + out_6588081244760496425[86] = 0; + out_6588081244760496425[87] = 0; } -void h_13(double *state, double *unused, double *out_4446144489578117053) { - out_4446144489578117053[0] = (-2*state[3]*state[5] + 2*state[4]*state[6])*state[9] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[8] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[7]; - out_4446144489578117053[1] = (2*state[3]*state[4] + 2*state[5]*state[6])*state[9] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[7] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[8]; - out_4446144489578117053[2] = (-2*state[3]*state[4] + 2*state[5]*state[6])*state[8] + (2*state[3]*state[5] + 2*state[4]*state[6])*state[7] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[9]; +void h_13(double *state, double *unused, double *out_3593629792265566351) { + out_3593629792265566351[0] = (-2*state[3]*state[5] + 2*state[4]*state[6])*state[9] + (2*state[3]*state[6] + 2*state[4]*state[5])*state[8] + (pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2))*state[7]; + out_3593629792265566351[1] = (2*state[3]*state[4] + 2*state[5]*state[6])*state[9] + (-2*state[3]*state[6] + 2*state[4]*state[5])*state[7] + (pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2))*state[8]; + out_3593629792265566351[2] = (-2*state[3]*state[4] + 2*state[5]*state[6])*state[8] + (2*state[3]*state[5] + 2*state[4]*state[6])*state[7] + (pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2))*state[9]; } -void H_13(double *state, double *unused, double *out_8954114104359138418) { - out_8954114104359138418[0] = 0; - out_8954114104359138418[1] = 0; - out_8954114104359138418[2] = 0; - out_8954114104359138418[3] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8]; - out_8954114104359138418[4] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; - out_8954114104359138418[5] = -2*state[3]*state[9] + 2*state[4]*state[8] - 2*state[5]*state[7]; - out_8954114104359138418[6] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7]; - out_8954114104359138418[7] = pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2); - out_8954114104359138418[8] = 2*state[3]*state[6] + 2*state[4]*state[5]; - out_8954114104359138418[9] = -2*state[3]*state[5] + 2*state[4]*state[6]; - out_8954114104359138418[10] = 0; - out_8954114104359138418[11] = 0; - out_8954114104359138418[12] = 0; - out_8954114104359138418[13] = 0; - out_8954114104359138418[14] = 0; - out_8954114104359138418[15] = 0; - out_8954114104359138418[16] = 0; - out_8954114104359138418[17] = 0; - out_8954114104359138418[18] = 0; - out_8954114104359138418[19] = 0; - out_8954114104359138418[20] = 0; - out_8954114104359138418[21] = 0; - out_8954114104359138418[22] = 0; - out_8954114104359138418[23] = 0; - out_8954114104359138418[24] = 0; - out_8954114104359138418[25] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7]; - out_8954114104359138418[26] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7]; - out_8954114104359138418[27] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; - out_8954114104359138418[28] = -2*state[3]*state[7] + 2*state[5]*state[9] - 2*state[6]*state[8]; - out_8954114104359138418[29] = -2*state[3]*state[6] + 2*state[4]*state[5]; - out_8954114104359138418[30] = pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2); - out_8954114104359138418[31] = 2*state[3]*state[4] + 2*state[5]*state[6]; - out_8954114104359138418[32] = 0; - out_8954114104359138418[33] = 0; - out_8954114104359138418[34] = 0; - out_8954114104359138418[35] = 0; - out_8954114104359138418[36] = 0; - out_8954114104359138418[37] = 0; - out_8954114104359138418[38] = 0; - out_8954114104359138418[39] = 0; - out_8954114104359138418[40] = 0; - out_8954114104359138418[41] = 0; - out_8954114104359138418[42] = 0; - out_8954114104359138418[43] = 0; - out_8954114104359138418[44] = 0; - out_8954114104359138418[45] = 0; - out_8954114104359138418[46] = 0; - out_8954114104359138418[47] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7]; - out_8954114104359138418[48] = -2*state[3]*state[8] - 2*state[4]*state[9] + 2*state[6]*state[7]; - out_8954114104359138418[49] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8]; - out_8954114104359138418[50] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; - out_8954114104359138418[51] = 2*state[3]*state[5] + 2*state[4]*state[6]; - out_8954114104359138418[52] = -2*state[3]*state[4] + 2*state[5]*state[6]; - out_8954114104359138418[53] = pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2); - out_8954114104359138418[54] = 0; - out_8954114104359138418[55] = 0; - out_8954114104359138418[56] = 0; - out_8954114104359138418[57] = 0; - out_8954114104359138418[58] = 0; - out_8954114104359138418[59] = 0; - out_8954114104359138418[60] = 0; - out_8954114104359138418[61] = 0; - out_8954114104359138418[62] = 0; - out_8954114104359138418[63] = 0; - out_8954114104359138418[64] = 0; - out_8954114104359138418[65] = 0; +void H_13(double *state, double *unused, double *out_242337613300384717) { + out_242337613300384717[0] = 0; + out_242337613300384717[1] = 0; + out_242337613300384717[2] = 0; + out_242337613300384717[3] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8]; + out_242337613300384717[4] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; + out_242337613300384717[5] = -2*state[3]*state[9] + 2*state[4]*state[8] - 2*state[5]*state[7]; + out_242337613300384717[6] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7]; + out_242337613300384717[7] = pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2); + out_242337613300384717[8] = 2*state[3]*state[6] + 2*state[4]*state[5]; + out_242337613300384717[9] = -2*state[3]*state[5] + 2*state[4]*state[6]; + out_242337613300384717[10] = 0; + out_242337613300384717[11] = 0; + out_242337613300384717[12] = 0; + out_242337613300384717[13] = 0; + out_242337613300384717[14] = 0; + out_242337613300384717[15] = 0; + out_242337613300384717[16] = 0; + out_242337613300384717[17] = 0; + out_242337613300384717[18] = 0; + out_242337613300384717[19] = 0; + out_242337613300384717[20] = 0; + out_242337613300384717[21] = 0; + out_242337613300384717[22] = 0; + out_242337613300384717[23] = 0; + out_242337613300384717[24] = 0; + out_242337613300384717[25] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7]; + out_242337613300384717[26] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7]; + out_242337613300384717[27] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; + out_242337613300384717[28] = -2*state[3]*state[7] + 2*state[5]*state[9] - 2*state[6]*state[8]; + out_242337613300384717[29] = -2*state[3]*state[6] + 2*state[4]*state[5]; + out_242337613300384717[30] = pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2); + out_242337613300384717[31] = 2*state[3]*state[4] + 2*state[5]*state[6]; + out_242337613300384717[32] = 0; + out_242337613300384717[33] = 0; + out_242337613300384717[34] = 0; + out_242337613300384717[35] = 0; + out_242337613300384717[36] = 0; + out_242337613300384717[37] = 0; + out_242337613300384717[38] = 0; + out_242337613300384717[39] = 0; + out_242337613300384717[40] = 0; + out_242337613300384717[41] = 0; + out_242337613300384717[42] = 0; + out_242337613300384717[43] = 0; + out_242337613300384717[44] = 0; + out_242337613300384717[45] = 0; + out_242337613300384717[46] = 0; + out_242337613300384717[47] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7]; + out_242337613300384717[48] = -2*state[3]*state[8] - 2*state[4]*state[9] + 2*state[6]*state[7]; + out_242337613300384717[49] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8]; + out_242337613300384717[50] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; + out_242337613300384717[51] = 2*state[3]*state[5] + 2*state[4]*state[6]; + out_242337613300384717[52] = -2*state[3]*state[4] + 2*state[5]*state[6]; + out_242337613300384717[53] = pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2); + out_242337613300384717[54] = 0; + out_242337613300384717[55] = 0; + out_242337613300384717[56] = 0; + out_242337613300384717[57] = 0; + out_242337613300384717[58] = 0; + out_242337613300384717[59] = 0; + out_242337613300384717[60] = 0; + out_242337613300384717[61] = 0; + out_242337613300384717[62] = 0; + out_242337613300384717[63] = 0; + out_242337613300384717[64] = 0; + out_242337613300384717[65] = 0; } -void h_14(double *state, double *unused, double *out_4762408851873785060) { - out_4762408851873785060[0] = state[10]; - out_4762408851873785060[1] = state[11]; - out_4762408851873785060[2] = state[12]; +void h_14(double *state, double *unused, double *out_7008862357845565666) { + out_7008862357845565666[0] = state[10]; + out_7008862357845565666[1] = state[11]; + out_7008862357845565666[2] = state[12]; } -void H_14(double *state, double *unused, double *out_4378476660832583835) { - out_4378476660832583835[0] = 0; - out_4378476660832583835[1] = 0; - out_4378476660832583835[2] = 0; - out_4378476660832583835[3] = 0; - out_4378476660832583835[4] = 0; - out_4378476660832583835[5] = 0; - out_4378476660832583835[6] = 0; - out_4378476660832583835[7] = 0; - out_4378476660832583835[8] = 0; - out_4378476660832583835[9] = 0; - out_4378476660832583835[10] = 1; - out_4378476660832583835[11] = 0; - out_4378476660832583835[12] = 0; - out_4378476660832583835[13] = 0; - out_4378476660832583835[14] = 0; - out_4378476660832583835[15] = 0; - out_4378476660832583835[16] = 0; - out_4378476660832583835[17] = 0; - out_4378476660832583835[18] = 0; - out_4378476660832583835[19] = 0; - out_4378476660832583835[20] = 0; - out_4378476660832583835[21] = 0; - out_4378476660832583835[22] = 0; - out_4378476660832583835[23] = 0; - out_4378476660832583835[24] = 0; - out_4378476660832583835[25] = 0; - out_4378476660832583835[26] = 0; - out_4378476660832583835[27] = 0; - out_4378476660832583835[28] = 0; - out_4378476660832583835[29] = 0; - out_4378476660832583835[30] = 0; - out_4378476660832583835[31] = 0; - out_4378476660832583835[32] = 0; - out_4378476660832583835[33] = 1; - out_4378476660832583835[34] = 0; - out_4378476660832583835[35] = 0; - out_4378476660832583835[36] = 0; - out_4378476660832583835[37] = 0; - out_4378476660832583835[38] = 0; - out_4378476660832583835[39] = 0; - out_4378476660832583835[40] = 0; - out_4378476660832583835[41] = 0; - out_4378476660832583835[42] = 0; - out_4378476660832583835[43] = 0; - out_4378476660832583835[44] = 0; - out_4378476660832583835[45] = 0; - out_4378476660832583835[46] = 0; - out_4378476660832583835[47] = 0; - out_4378476660832583835[48] = 0; - out_4378476660832583835[49] = 0; - out_4378476660832583835[50] = 0; - out_4378476660832583835[51] = 0; - out_4378476660832583835[52] = 0; - out_4378476660832583835[53] = 0; - out_4378476660832583835[54] = 0; - out_4378476660832583835[55] = 0; - out_4378476660832583835[56] = 1; - out_4378476660832583835[57] = 0; - out_4378476660832583835[58] = 0; - out_4378476660832583835[59] = 0; - out_4378476660832583835[60] = 0; - out_4378476660832583835[61] = 0; - out_4378476660832583835[62] = 0; - out_4378476660832583835[63] = 0; - out_4378476660832583835[64] = 0; - out_4378476660832583835[65] = 0; +void H_14(double *state, double *unused, double *out_2798689151809396800) { + out_2798689151809396800[0] = 0; + out_2798689151809396800[1] = 0; + out_2798689151809396800[2] = 0; + out_2798689151809396800[3] = 0; + out_2798689151809396800[4] = 0; + out_2798689151809396800[5] = 0; + out_2798689151809396800[6] = 0; + out_2798689151809396800[7] = 0; + out_2798689151809396800[8] = 0; + out_2798689151809396800[9] = 0; + out_2798689151809396800[10] = 1; + out_2798689151809396800[11] = 0; + out_2798689151809396800[12] = 0; + out_2798689151809396800[13] = 0; + out_2798689151809396800[14] = 0; + out_2798689151809396800[15] = 0; + out_2798689151809396800[16] = 0; + out_2798689151809396800[17] = 0; + out_2798689151809396800[18] = 0; + out_2798689151809396800[19] = 0; + out_2798689151809396800[20] = 0; + out_2798689151809396800[21] = 0; + out_2798689151809396800[22] = 0; + out_2798689151809396800[23] = 0; + out_2798689151809396800[24] = 0; + out_2798689151809396800[25] = 0; + out_2798689151809396800[26] = 0; + out_2798689151809396800[27] = 0; + out_2798689151809396800[28] = 0; + out_2798689151809396800[29] = 0; + out_2798689151809396800[30] = 0; + out_2798689151809396800[31] = 0; + out_2798689151809396800[32] = 0; + out_2798689151809396800[33] = 1; + out_2798689151809396800[34] = 0; + out_2798689151809396800[35] = 0; + out_2798689151809396800[36] = 0; + out_2798689151809396800[37] = 0; + out_2798689151809396800[38] = 0; + out_2798689151809396800[39] = 0; + out_2798689151809396800[40] = 0; + out_2798689151809396800[41] = 0; + out_2798689151809396800[42] = 0; + out_2798689151809396800[43] = 0; + out_2798689151809396800[44] = 0; + out_2798689151809396800[45] = 0; + out_2798689151809396800[46] = 0; + out_2798689151809396800[47] = 0; + out_2798689151809396800[48] = 0; + out_2798689151809396800[49] = 0; + out_2798689151809396800[50] = 0; + out_2798689151809396800[51] = 0; + out_2798689151809396800[52] = 0; + out_2798689151809396800[53] = 0; + out_2798689151809396800[54] = 0; + out_2798689151809396800[55] = 0; + out_2798689151809396800[56] = 1; + out_2798689151809396800[57] = 0; + out_2798689151809396800[58] = 0; + out_2798689151809396800[59] = 0; + out_2798689151809396800[60] = 0; + out_2798689151809396800[61] = 0; + out_2798689151809396800[62] = 0; + out_2798689151809396800[63] = 0; + out_2798689151809396800[64] = 0; + out_2798689151809396800[65] = 0; } -void h_33(double *state, double *unused, double *out_8645294225009481236) { - out_8645294225009481236[0] = state[16]; - out_8645294225009481236[1] = state[17]; - out_8645294225009481236[2] = state[18]; +void h_33(double *state, double *unused, double *out_4589975723008195621) { + out_4589975723008195621[0] = state[16]; + out_4589975723008195621[1] = state[17]; + out_4589975723008195621[2] = state[18]; } -void H_33(double *state, double *unused, double *out_7792237997495093446) { - out_7792237997495093446[0] = 0; - out_7792237997495093446[1] = 0; - out_7792237997495093446[2] = 0; - out_7792237997495093446[3] = 0; - out_7792237997495093446[4] = 0; - out_7792237997495093446[5] = 0; - out_7792237997495093446[6] = 0; - out_7792237997495093446[7] = 0; - out_7792237997495093446[8] = 0; - out_7792237997495093446[9] = 0; - out_7792237997495093446[10] = 0; - out_7792237997495093446[11] = 0; - out_7792237997495093446[12] = 0; - out_7792237997495093446[13] = 0; - out_7792237997495093446[14] = 0; - out_7792237997495093446[15] = 0; - out_7792237997495093446[16] = 1; - out_7792237997495093446[17] = 0; - out_7792237997495093446[18] = 0; - out_7792237997495093446[19] = 0; - out_7792237997495093446[20] = 0; - out_7792237997495093446[21] = 0; - out_7792237997495093446[22] = 0; - out_7792237997495093446[23] = 0; - out_7792237997495093446[24] = 0; - out_7792237997495093446[25] = 0; - out_7792237997495093446[26] = 0; - out_7792237997495093446[27] = 0; - out_7792237997495093446[28] = 0; - out_7792237997495093446[29] = 0; - out_7792237997495093446[30] = 0; - out_7792237997495093446[31] = 0; - out_7792237997495093446[32] = 0; - out_7792237997495093446[33] = 0; - out_7792237997495093446[34] = 0; - out_7792237997495093446[35] = 0; - out_7792237997495093446[36] = 0; - out_7792237997495093446[37] = 0; - out_7792237997495093446[38] = 0; - out_7792237997495093446[39] = 1; - out_7792237997495093446[40] = 0; - out_7792237997495093446[41] = 0; - out_7792237997495093446[42] = 0; - out_7792237997495093446[43] = 0; - out_7792237997495093446[44] = 0; - out_7792237997495093446[45] = 0; - out_7792237997495093446[46] = 0; - out_7792237997495093446[47] = 0; - out_7792237997495093446[48] = 0; - out_7792237997495093446[49] = 0; - out_7792237997495093446[50] = 0; - out_7792237997495093446[51] = 0; - out_7792237997495093446[52] = 0; - out_7792237997495093446[53] = 0; - out_7792237997495093446[54] = 0; - out_7792237997495093446[55] = 0; - out_7792237997495093446[56] = 0; - out_7792237997495093446[57] = 0; - out_7792237997495093446[58] = 0; - out_7792237997495093446[59] = 0; - out_7792237997495093446[60] = 0; - out_7792237997495093446[61] = 0; - out_7792237997495093446[62] = 1; - out_7792237997495093446[63] = 0; - out_7792237997495093446[64] = 0; - out_7792237997495093446[65] = 0; +void H_33(double *state, double *unused, double *out_3568689025062379290) { + out_3568689025062379290[0] = 0; + out_3568689025062379290[1] = 0; + out_3568689025062379290[2] = 0; + out_3568689025062379290[3] = 0; + out_3568689025062379290[4] = 0; + out_3568689025062379290[5] = 0; + out_3568689025062379290[6] = 0; + out_3568689025062379290[7] = 0; + out_3568689025062379290[8] = 0; + out_3568689025062379290[9] = 0; + out_3568689025062379290[10] = 0; + out_3568689025062379290[11] = 0; + out_3568689025062379290[12] = 0; + out_3568689025062379290[13] = 0; + out_3568689025062379290[14] = 0; + out_3568689025062379290[15] = 0; + out_3568689025062379290[16] = 1; + out_3568689025062379290[17] = 0; + out_3568689025062379290[18] = 0; + out_3568689025062379290[19] = 0; + out_3568689025062379290[20] = 0; + out_3568689025062379290[21] = 0; + out_3568689025062379290[22] = 0; + out_3568689025062379290[23] = 0; + out_3568689025062379290[24] = 0; + out_3568689025062379290[25] = 0; + out_3568689025062379290[26] = 0; + out_3568689025062379290[27] = 0; + out_3568689025062379290[28] = 0; + out_3568689025062379290[29] = 0; + out_3568689025062379290[30] = 0; + out_3568689025062379290[31] = 0; + out_3568689025062379290[32] = 0; + out_3568689025062379290[33] = 0; + out_3568689025062379290[34] = 0; + out_3568689025062379290[35] = 0; + out_3568689025062379290[36] = 0; + out_3568689025062379290[37] = 0; + out_3568689025062379290[38] = 0; + out_3568689025062379290[39] = 1; + out_3568689025062379290[40] = 0; + out_3568689025062379290[41] = 0; + out_3568689025062379290[42] = 0; + out_3568689025062379290[43] = 0; + out_3568689025062379290[44] = 0; + out_3568689025062379290[45] = 0; + out_3568689025062379290[46] = 0; + out_3568689025062379290[47] = 0; + out_3568689025062379290[48] = 0; + out_3568689025062379290[49] = 0; + out_3568689025062379290[50] = 0; + out_3568689025062379290[51] = 0; + out_3568689025062379290[52] = 0; + out_3568689025062379290[53] = 0; + out_3568689025062379290[54] = 0; + out_3568689025062379290[55] = 0; + out_3568689025062379290[56] = 0; + out_3568689025062379290[57] = 0; + out_3568689025062379290[58] = 0; + out_3568689025062379290[59] = 0; + out_3568689025062379290[60] = 0; + out_3568689025062379290[61] = 0; + out_3568689025062379290[62] = 1; + out_3568689025062379290[63] = 0; + out_3568689025062379290[64] = 0; + out_3568689025062379290[65] = 0; } #include #include @@ -1855,77 +1855,77 @@ void live_update_14(double *in_x, double *in_P, double *in_z, double *in_R, doub void live_update_33(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { update<3, 3, 0>(in_x, in_P, h_33, H_33, NULL, in_z, in_R, in_ea, MAHA_THRESH_33); } -void live_H(double *in_vec, double *out_3062539955778785123) { - H(in_vec, out_3062539955778785123); +void live_H(double *in_vec, double *out_5678547249781205843) { + H(in_vec, out_5678547249781205843); } -void live_err_fun(double *nom_x, double *delta_x, double *out_997632986539046101) { - err_fun(nom_x, delta_x, out_997632986539046101); +void live_err_fun(double *nom_x, double *delta_x, double *out_7786038415114058898) { + err_fun(nom_x, delta_x, out_7786038415114058898); } -void live_inv_err_fun(double *nom_x, double *true_x, double *out_3959944895181216754) { - inv_err_fun(nom_x, true_x, out_3959944895181216754); +void live_inv_err_fun(double *nom_x, double *true_x, double *out_4024320067273853194) { + inv_err_fun(nom_x, true_x, out_4024320067273853194); } -void live_H_mod_fun(double *state, double *out_8702234888023658226) { - H_mod_fun(state, out_8702234888023658226); +void live_H_mod_fun(double *state, double *out_5397558725730410635) { + H_mod_fun(state, out_5397558725730410635); } -void live_f_fun(double *state, double dt, double *out_7459231211064544538) { - f_fun(state, dt, out_7459231211064544538); +void live_f_fun(double *state, double dt, double *out_4167526640936982777) { + f_fun(state, dt, out_4167526640936982777); } -void live_F_fun(double *state, double dt, double *out_8962950086978682024) { - F_fun(state, dt, out_8962950086978682024); +void live_F_fun(double *state, double dt, double *out_5774721427747447809) { + F_fun(state, dt, out_5774721427747447809); } -void live_h_4(double *state, double *unused, double *out_1777498685180261346) { - h_4(state, unused, out_1777498685180261346); +void live_h_4(double *state, double *unused, double *out_1878806005493183204) { + h_4(state, unused, out_1878806005493183204); } -void live_H_4(double *state, double *unused, double *out_4137287014202993190) { - H_4(state, unused, out_4137287014202993190); +void live_H_4(double *state, double *unused, double *out_8360835986635707346) { + H_4(state, unused, out_8360835986635707346); } -void live_h_9(double *state, double *unused, double *out_4762408851873785060) { - h_9(state, unused, out_4762408851873785060); +void live_h_9(double *state, double *unused, double *out_7008862357845565666) { + h_9(state, unused, out_7008862357845565666); } -void live_H_9(double *state, double *unused, double *out_4378476660832583835) { - H_9(state, unused, out_4378476660832583835); +void live_H_9(double *state, double *unused, double *out_2798689151809396800) { + H_9(state, unused, out_2798689151809396800); } -void live_h_10(double *state, double *unused, double *out_769477702419128333) { - h_10(state, unused, out_769477702419128333); +void live_h_10(double *state, double *unused, double *out_1854368242330831766) { + h_10(state, unused, out_1854368242330831766); } -void live_H_10(double *state, double *unused, double *out_607115477708369913) { - H_10(state, unused, out_607115477708369913); +void live_H_10(double *state, double *unused, double *out_7728768220624810382) { + H_10(state, unused, out_7728768220624810382); } -void live_h_12(double *state, double *unused, double *out_5594886434556651779) { - h_12(state, unused, out_5594886434556651779); +void live_h_12(double *state, double *unused, double *out_5466497058915449734) { + h_12(state, unused, out_5466497058915449734); } -void live_H_12(double *state, double *unused, double *out_9156743422234954985) { - H_12(state, unused, out_9156743422234954985); +void live_H_12(double *state, double *unused, double *out_5066451679041882475) { + H_12(state, unused, out_5066451679041882475); } -void live_h_35(double *state, double *unused, double *out_7828238170709544847) { - h_35(state, unused, out_7828238170709544847); +void live_h_35(double *state, double *unused, double *out_4931523598679842869) { + h_35(state, unused, out_4931523598679842869); } -void live_H_35(double *state, double *unused, double *out_7503949071575600566) { - H_35(state, unused, out_7503949071575600566); +void live_H_35(double *state, double *unused, double *out_6719246029701236894) { + H_35(state, unused, out_6719246029701236894); } -void live_h_32(double *state, double *unused, double *out_1198587467706715008) { - h_32(state, unused, out_1198587467706715008); +void live_h_32(double *state, double *unused, double *out_2039644813621010602) { + h_32(state, unused, out_2039644813621010602); } -void live_H_32(double *state, double *unused, double *out_5141490629926338492) { - H_32(state, unused, out_5141490629926338492); +void live_H_32(double *state, double *unused, double *out_6588081244760496425) { + H_32(state, unused, out_6588081244760496425); } -void live_h_13(double *state, double *unused, double *out_4446144489578117053) { - h_13(state, unused, out_4446144489578117053); +void live_h_13(double *state, double *unused, double *out_3593629792265566351) { + h_13(state, unused, out_3593629792265566351); } -void live_H_13(double *state, double *unused, double *out_8954114104359138418) { - H_13(state, unused, out_8954114104359138418); +void live_H_13(double *state, double *unused, double *out_242337613300384717) { + H_13(state, unused, out_242337613300384717); } -void live_h_14(double *state, double *unused, double *out_4762408851873785060) { - h_14(state, unused, out_4762408851873785060); +void live_h_14(double *state, double *unused, double *out_7008862357845565666) { + h_14(state, unused, out_7008862357845565666); } -void live_H_14(double *state, double *unused, double *out_4378476660832583835) { - H_14(state, unused, out_4378476660832583835); +void live_H_14(double *state, double *unused, double *out_2798689151809396800) { + H_14(state, unused, out_2798689151809396800); } -void live_h_33(double *state, double *unused, double *out_8645294225009481236) { - h_33(state, unused, out_8645294225009481236); +void live_h_33(double *state, double *unused, double *out_4589975723008195621) { + h_33(state, unused, out_4589975723008195621); } -void live_H_33(double *state, double *unused, double *out_7792237997495093446) { - H_33(state, unused, out_7792237997495093446); +void live_H_33(double *state, double *unused, double *out_3568689025062379290) { + H_33(state, unused, out_3568689025062379290); } void live_predict(double *in_x, double *in_P, double *in_Q, double dt) { predict(in_x, in_P, in_Q, dt); diff --git a/selfdrive/locationd/models/generated/live.h b/selfdrive/locationd/models/generated/live.h index 4686365fe..d9a59c6a4 100644 --- a/selfdrive/locationd/models/generated/live.h +++ b/selfdrive/locationd/models/generated/live.h @@ -10,29 +10,29 @@ void live_update_32(double *in_x, double *in_P, double *in_z, double *in_R, doub void live_update_13(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); void live_update_14(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); void live_update_33(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); -void live_H(double *in_vec, double *out_3062539955778785123); -void live_err_fun(double *nom_x, double *delta_x, double *out_997632986539046101); -void live_inv_err_fun(double *nom_x, double *true_x, double *out_3959944895181216754); -void live_H_mod_fun(double *state, double *out_8702234888023658226); -void live_f_fun(double *state, double dt, double *out_7459231211064544538); -void live_F_fun(double *state, double dt, double *out_8962950086978682024); -void live_h_4(double *state, double *unused, double *out_1777498685180261346); -void live_H_4(double *state, double *unused, double *out_4137287014202993190); -void live_h_9(double *state, double *unused, double *out_4762408851873785060); -void live_H_9(double *state, double *unused, double *out_4378476660832583835); -void live_h_10(double *state, double *unused, double *out_769477702419128333); -void live_H_10(double *state, double *unused, double *out_607115477708369913); -void live_h_12(double *state, double *unused, double *out_5594886434556651779); -void live_H_12(double *state, double *unused, double *out_9156743422234954985); -void live_h_35(double *state, double *unused, double *out_7828238170709544847); -void live_H_35(double *state, double *unused, double *out_7503949071575600566); -void live_h_32(double *state, double *unused, double *out_1198587467706715008); -void live_H_32(double *state, double *unused, double *out_5141490629926338492); -void live_h_13(double *state, double *unused, double *out_4446144489578117053); -void live_H_13(double *state, double *unused, double *out_8954114104359138418); -void live_h_14(double *state, double *unused, double *out_4762408851873785060); -void live_H_14(double *state, double *unused, double *out_4378476660832583835); -void live_h_33(double *state, double *unused, double *out_8645294225009481236); -void live_H_33(double *state, double *unused, double *out_7792237997495093446); +void live_H(double *in_vec, double *out_5678547249781205843); +void live_err_fun(double *nom_x, double *delta_x, double *out_7786038415114058898); +void live_inv_err_fun(double *nom_x, double *true_x, double *out_4024320067273853194); +void live_H_mod_fun(double *state, double *out_5397558725730410635); +void live_f_fun(double *state, double dt, double *out_4167526640936982777); +void live_F_fun(double *state, double dt, double *out_5774721427747447809); +void live_h_4(double *state, double *unused, double *out_1878806005493183204); +void live_H_4(double *state, double *unused, double *out_8360835986635707346); +void live_h_9(double *state, double *unused, double *out_7008862357845565666); +void live_H_9(double *state, double *unused, double *out_2798689151809396800); +void live_h_10(double *state, double *unused, double *out_1854368242330831766); +void live_H_10(double *state, double *unused, double *out_7728768220624810382); +void live_h_12(double *state, double *unused, double *out_5466497058915449734); +void live_H_12(double *state, double *unused, double *out_5066451679041882475); +void live_h_35(double *state, double *unused, double *out_4931523598679842869); +void live_H_35(double *state, double *unused, double *out_6719246029701236894); +void live_h_32(double *state, double *unused, double *out_2039644813621010602); +void live_H_32(double *state, double *unused, double *out_6588081244760496425); +void live_h_13(double *state, double *unused, double *out_3593629792265566351); +void live_H_13(double *state, double *unused, double *out_242337613300384717); +void live_h_14(double *state, double *unused, double *out_7008862357845565666); +void live_H_14(double *state, double *unused, double *out_2798689151809396800); +void live_h_33(double *state, double *unused, double *out_4589975723008195621); +void live_H_33(double *state, double *unused, double *out_3568689025062379290); void live_predict(double *in_x, double *in_P, double *in_Q, double dt); } \ No newline at end of file diff --git a/selfdrive/locationd/paramsd.py b/selfdrive/locationd/paramsd.py index 183a8666e..d124eb5f0 100755 --- a/selfdrive/locationd/paramsd.py +++ b/selfdrive/locationd/paramsd.py @@ -124,7 +124,7 @@ def main(): REPLAY = bool(int(os.getenv("REPLAY", "0"))) pm = messaging.PubMaster(['liveParameters']) - sm = messaging.SubMaster(['liveLocationKalman', 'carState'], poll=['liveLocationKalman']) + sm = messaging.SubMaster(['liveLocationKalman', 'carState'], poll='liveLocationKalman') params_reader = Params() # wait for stats about the car to come in from controls diff --git a/selfdrive/locationd/torqued.py b/selfdrive/locationd/torqued.py index f2c0248af..b49784d13 100755 --- a/selfdrive/locationd/torqued.py +++ b/selfdrive/locationd/torqued.py @@ -159,8 +159,9 @@ class TorqueEstimator(ParameterEstimator): def handle_log(self, t, which, msg): if which == "carControl": self.raw_points["carControl_t"].append(t + self.lag) - self.raw_points["steer_torque"].append(-msg.actuatorsOutput.steer) self.raw_points["active"].append(msg.latActive) + elif which == "carOutput": + self.raw_points["steer_torque"].append(-msg.actuatorsOutput.steer) elif which == "carState": self.raw_points["carState_t"].append(t + self.lag) self.raw_points["vego"].append(msg.vEgo) @@ -184,23 +185,23 @@ class TorqueEstimator(ParameterEstimator): liveTorqueParameters.version = VERSION liveTorqueParameters.useParams = self.use_params - if self.filtered_points.is_valid(): + # Calculate raw estimates when possible, only update filters when enough points are gathered + if self.filtered_points.is_calculable(): latAccelFactor, latAccelOffset, frictionCoeff = self.estimate_params() liveTorqueParameters.latAccelFactorRaw = float(latAccelFactor) liveTorqueParameters.latAccelOffsetRaw = float(latAccelOffset) liveTorqueParameters.frictionCoefficientRaw = float(frictionCoeff) - if any(val is None or np.isnan(val) for val in [latAccelFactor, latAccelOffset, frictionCoeff]): - cloudlog.exception("Live torque parameters are invalid.") - liveTorqueParameters.liveValid = False - self.reset() - else: - liveTorqueParameters.liveValid = True - latAccelFactor = np.clip(latAccelFactor, self.min_lataccel_factor, self.max_lataccel_factor) - frictionCoeff = np.clip(frictionCoeff, self.min_friction, self.max_friction) - self.update_params({'latAccelFactor': latAccelFactor, 'latAccelOffset': latAccelOffset, 'frictionCoefficient': frictionCoeff}) - else: - liveTorqueParameters.liveValid = False + if self.filtered_points.is_valid(): + if any(val is None or np.isnan(val) for val in [latAccelFactor, latAccelOffset, frictionCoeff]): + cloudlog.exception("Live torque parameters are invalid.") + liveTorqueParameters.liveValid = False + self.reset() + else: + liveTorqueParameters.liveValid = True + latAccelFactor = np.clip(latAccelFactor, self.min_lataccel_factor, self.max_lataccel_factor) + frictionCoeff = np.clip(frictionCoeff, self.min_friction, self.max_friction) + self.update_params({'latAccelFactor': latAccelFactor, 'latAccelOffset': latAccelOffset, 'frictionCoefficient': frictionCoeff}) if with_points: liveTorqueParameters.points = self.filtered_points.get_points()[:, [0, 2]].tolist() @@ -218,7 +219,7 @@ def main(demo=False): config_realtime_process([0, 1, 2, 3], 5) pm = messaging.PubMaster(['liveTorqueParameters']) - sm = messaging.SubMaster(['carControl', 'carState', 'liveLocationKalman'], poll=['liveLocationKalman']) + sm = messaging.SubMaster(['carControl', 'carOutput', 'carState', 'liveLocationKalman'], poll='liveLocationKalman') params = Params() with car.CarParams.from_bytes(params.get("CarParams", block=True)) as CP: diff --git a/selfdrive/manager/build.py b/selfdrive/manager/build.py index 8456b7f0c..d0ef71cec 100755 --- a/selfdrive/manager/build.py +++ b/selfdrive/manager/build.py @@ -3,7 +3,6 @@ import os import subprocess from pathlib import Path import socket -from typing import List # NOTE: Do NOT import anything here that needs be built (e.g. params) from openpilot.common.basedir import BASEDIR @@ -30,7 +29,7 @@ def build(spinner: Spinner, dirty: bool = False, minimal: bool = False) -> None: # building with all cores can result in using too # much memory, so retry with less parallelism - compile_output: List[bytes] = [] + compile_output: list[bytes] = [] for n in (nproc, nproc/2, 1): compile_output.clear() scons: subprocess.Popen = subprocess.Popen(["scons", f"-j{int(n)}", "--cache-populate", *extra_args], cwd=BASEDIR, env=env, stderr=subprocess.PIPE) diff --git a/selfdrive/manager/manager.py b/selfdrive/manager/manager.py index d9f7aeb21..c5c3cf035 100755 --- a/selfdrive/manager/manager.py +++ b/selfdrive/manager/manager.py @@ -4,7 +4,6 @@ import os import signal import sys import traceback -from typing import List, Tuple, Union from cereal import log import cereal.messaging as messaging @@ -19,7 +18,7 @@ from openpilot.selfdrive.athena.registration import register, UNREGISTERED_DONGL from openpilot.common.swaglog import cloudlog, add_file_handler from openpilot.system.version import is_dirty, get_commit, get_version, get_origin, get_short_branch, \ get_normalized_origin, terms_version, training_version, \ - is_tested_branch, is_release_branch + is_tested_branch, is_release_branch, get_commit_date import json from openpilot.selfdrive.car.fingerprints import all_known_cars, all_legacy_fingerprint_cars @@ -34,7 +33,7 @@ def manager_init() -> None: if is_release_branch(): params.clear_all(ParamKeyType.DEVELOPMENT_ONLY) - default_params: List[Tuple[str, Union[str, bytes]]] = [ + default_params: list[tuple[str, str | bytes]] = [ ("CompletedTrainingVersion", "0"), ("DisengageOnAccelerator", "0"), ("GsmMetered", "1"), @@ -73,7 +72,6 @@ def manager_init() -> None: ("dp_long_accel_btn", "0"), ("dp_long_personality_btn", "0"), ("dp_disable_onroad_uploads", "0"), - ("dp_long_frogai_smooth_braking_tune", "0"), ("dp_lat_lane_change_assist_speed", "20"), ("dp_device_display_flight_panel", "0"), ("dp_mapd_vision_turn_control", "0"), @@ -111,6 +109,7 @@ def manager_init() -> None: params.put("TermsVersion", terms_version) params.put("TrainingVersion", training_version) params.put("GitCommit", get_commit()) + params.put("GitCommitDate", get_commit_date()) params.put("GitBranch", get_short_branch()) params.put("GitRemote", get_origin()) params.put_bool("IsTestedBranch", is_tested_branch()) @@ -165,7 +164,7 @@ def manager_thread() -> None: params = Params() - ignore: List[str] = [] + ignore: list[str] = [] if params.get("DongleId", encoding='utf8') in (None, UNREGISTERED_DONGLE_ID): ignore += ["manage_athenad", "uploader"] if os.getenv("NOBOARD") is not None: @@ -191,7 +190,7 @@ def manager_thread() -> None: if dpdmonitoringd_ignored: ignore += ["dpdmonitoringd"] - sm = messaging.SubMaster(['deviceState', 'carParams'], poll=['deviceState']) + sm = messaging.SubMaster(['deviceState', 'carParams'], poll='deviceState') pm = messaging.PubMaster(['managerState']) write_onroad_params(False, params) @@ -200,7 +199,7 @@ def manager_thread() -> None: started_prev = False while True: - sm.update() + sm.update(1000) started = sm['deviceState'].started @@ -217,7 +216,7 @@ def manager_thread() -> None: ensure_running(managed_processes.values(), started, params=params, CP=sm['carParams'], not_run=ignore) - running = ' '.join("%s%s\u001b[0m" % ("\u001b[32m" if p.proc.is_alive() else "\u001b[31m", p.name) + running = ' '.join("{}{}\u001b[0m".format("\u001b[32m" if p.proc.is_alive() else "\u001b[31m", p.name) for p in managed_processes.values() if p.proc) print(running) cloudlog.debug(running) diff --git a/selfdrive/manager/process.py b/selfdrive/manager/process.py index 523e1fd20..7964f5229 100644 --- a/selfdrive/manager/process.py +++ b/selfdrive/manager/process.py @@ -4,7 +4,7 @@ import signal import struct import time import subprocess -from typing import Optional, Callable, List, ValuesView +from collections.abc import Callable, ValuesView from abc import ABC, abstractmethod from multiprocessing import Process @@ -47,7 +47,7 @@ def launcher(proc: str, name: str) -> None: raise -def nativelauncher(pargs: List[str], cwd: str, name: str) -> None: +def nativelauncher(pargs: list[str], cwd: str, name: str) -> None: os.environ['MANAGER_DAEMON'] = name # exec the process @@ -67,12 +67,12 @@ class ManagerProcess(ABC): daemon = False sigkill = False should_run: Callable[[bool, Params, car.CarParams], bool] - proc: Optional[Process] = None + proc: Process | None = None enabled = True name = "" last_watchdog_time = 0 - watchdog_max_dt: Optional[int] = None + watchdog_max_dt: int | None = None watchdog_seen = False shutting_down = False @@ -109,7 +109,7 @@ class ManagerProcess(ABC): else: self.watchdog_seen = True - def stop(self, retry: bool = True, block: bool = True, sig: Optional[signal.Signals] = None) -> Optional[int]: + def stop(self, retry: bool = True, block: bool = True, sig: signal.Signals = None) -> int | None: if self.proc is None: return None @@ -274,18 +274,20 @@ class DaemonProcess(ManagerProcess): def ensure_running(procs: ValuesView[ManagerProcess], started: bool, params=None, CP: car.CarParams=None, - not_run: Optional[List[str]]=None) -> List[ManagerProcess]: + not_run: list[str] | None=None) -> list[ManagerProcess]: if not_run is None: not_run = [] running = [] for p in procs: if p.enabled and p.name not in not_run and p.should_run(started, params, CP): - p.start() running.append(p) else: p.stop(block=False) p.check_watchdog(started) + for p in running: + p.start() + return running diff --git a/selfdrive/manager/process_config.py b/selfdrive/manager/process_config.py index b1db6f5d3..2bf395bc7 100644 --- a/selfdrive/manager/process_config.py +++ b/selfdrive/manager/process_config.py @@ -80,7 +80,7 @@ procs = [ PythonProcess("radard", "selfdrive.controls.radard", only_onroad), PythonProcess("thermald", "selfdrive.thermald.thermald", always_run), PythonProcess("tombstoned", "selfdrive.tombstoned", always_run, enabled=not PC), - PythonProcess("updated", "selfdrive.updated", only_offroad, enabled=not PC), + PythonProcess("updated", "selfdrive.updated.updated", only_offroad, enabled=not PC), PythonProcess("uploader", "system.loggerd.uploader", only_offroad if dp_disable_onroad_uploads else always_run), PythonProcess("statsd", "selfdrive.statsd", always_run), diff --git a/selfdrive/modeld/dmonitoringmodeld.py b/selfdrive/modeld/dmonitoringmodeld.py index 1e2596470..ef403b44f 100755 --- a/selfdrive/modeld/dmonitoringmodeld.py +++ b/selfdrive/modeld/dmonitoringmodeld.py @@ -6,7 +6,6 @@ import time import ctypes import numpy as np from pathlib import Path -from typing import Tuple, Dict from cereal import messaging from cereal.messaging import PubMaster, SubMaster @@ -53,7 +52,7 @@ class DMonitoringModelResult(ctypes.Structure): ("wheel_on_right_prob", ctypes.c_float)] class ModelState: - inputs: Dict[str, np.ndarray] + inputs: dict[str, np.ndarray] output: np.ndarray model: ModelRunner @@ -68,7 +67,7 @@ class ModelState: self.model.addInput("input_img", None) self.model.addInput("calib", self.inputs['calib']) - def run(self, buf:VisionBuf, calib:np.ndarray) -> Tuple[np.ndarray, float]: + def run(self, buf:VisionBuf, calib:np.ndarray) -> tuple[np.ndarray, float]: self.inputs['calib'][:] = calib v_offset = buf.height - MODEL_HEIGHT diff --git a/selfdrive/modeld/fill_model_msg.py b/selfdrive/modeld/fill_model_msg.py index 93d1c7e77..c39ec2da3 100644 --- a/selfdrive/modeld/fill_model_msg.py +++ b/selfdrive/modeld/fill_model_msg.py @@ -1,7 +1,6 @@ import os import capnp import numpy as np -from typing import Dict from cereal import log from openpilot.selfdrive.modeld.constants import ModelConstants, Plan, Meta @@ -42,10 +41,10 @@ def fill_xyvat(builder, t, x, y, v, a, x_std=None, y_std=None, v_std=None, a_std if a_std is not None: builder.aStd = a_std.tolist() -def fill_model_msg(msg: capnp._DynamicStructBuilder, net_output_data: Dict[str, np.ndarray], publish_state: PublishState, +def fill_model_msg(msg: capnp._DynamicStructBuilder, net_output_data: dict[str, np.ndarray], publish_state: PublishState, vipc_frame_id: int, vipc_frame_id_extra: int, frame_id: int, frame_drop: float, timestamp_eof: int, timestamp_llk: int, model_execution_time: float, - nav_enabled: bool, v_ego: float, steer_delay: float, valid: bool) -> None: + nav_enabled: bool, valid: bool) -> None: frame_age = frame_id - vipc_frame_id if frame_id > vipc_frame_id else 0 msg.valid = valid @@ -174,7 +173,7 @@ def fill_model_msg(msg: capnp._DynamicStructBuilder, net_output_data: Dict[str, if SEND_RAW_PRED: modelV2.rawPredictions = net_output_data['raw_pred'].tobytes() -def fill_pose_msg(msg: capnp._DynamicStructBuilder, net_output_data: Dict[str, np.ndarray], +def fill_pose_msg(msg: capnp._DynamicStructBuilder, net_output_data: dict[str, np.ndarray], vipc_frame_id: int, vipc_dropped_frames: int, timestamp_eof: int, live_calib_seen: bool) -> None: msg.valid = live_calib_seen & (vipc_dropped_frames < 1) cameraOdometry = msg.cameraOdometry diff --git a/selfdrive/modeld/get_model_metadata.py b/selfdrive/modeld/get_model_metadata.py index 187f83399..144860204 100755 --- a/selfdrive/modeld/get_model_metadata.py +++ b/selfdrive/modeld/get_model_metadata.py @@ -4,9 +4,8 @@ import pathlib import onnx import codecs import pickle -from typing import Tuple -def get_name_and_shape(value_info:onnx.ValueInfoProto) -> Tuple[str, Tuple[int,...]]: +def get_name_and_shape(value_info:onnx.ValueInfoProto) -> tuple[str, tuple[int,...]]: shape = tuple([int(dim.dim_value) for dim in value_info.type.tensor_type.shape.dim]) name = value_info.name return name, shape diff --git a/selfdrive/modeld/libthneed.so b/selfdrive/modeld/libthneed.so index c10b4d45a..638875d59 100755 Binary files a/selfdrive/modeld/libthneed.so and b/selfdrive/modeld/libthneed.so differ diff --git a/selfdrive/modeld/modeld.py b/selfdrive/modeld/modeld.py index b0351d9f1..6b54d8c74 100755 --- a/selfdrive/modeld/modeld.py +++ b/selfdrive/modeld/modeld.py @@ -6,7 +6,6 @@ import numpy as np import cereal.messaging as messaging from cereal import car, log from pathlib import Path -from typing import Dict, Optional from setproctitle import setproctitle from cereal.messaging import PubMaster, SubMaster from cereal.visionipc import VisionIpcClient, VisionStreamType, VisionBuf @@ -24,7 +23,7 @@ from openpilot.selfdrive.modeld.fill_model_msg import fill_model_msg, fill_pose_ from openpilot.selfdrive.modeld.constants import ModelConstants from openpilot.selfdrive.modeld.models.commonmodel_pyx import ModelFrame, CLContext from openpilot.common.conversions import Conversions as CV -from selfdrive.controls.lib.road_edge_detector import RoadEdgeDetector +from openpilot.selfdrive.controls.lib.road_edge_detector import RoadEdgeDetector PROCESS_NAME = "selfdrive.modeld.modeld" SEND_RAW_PRED = os.getenv('SEND_RAW_PRED') @@ -47,7 +46,7 @@ class FrameMeta: class ModelState: frame: ModelFrame wide_frame: ModelFrame - inputs: Dict[str, np.ndarray] + inputs: dict[str, np.ndarray] output: np.ndarray prev_desire: np.ndarray # for tracking the rising edge of the pulse model: ModelRunner @@ -80,14 +79,14 @@ class ModelState: for k,v in self.inputs.items(): self.model.addInput(k, v) - def slice_outputs(self, model_outputs: np.ndarray) -> Dict[str, np.ndarray]: + def slice_outputs(self, model_outputs: np.ndarray) -> dict[str, np.ndarray]: parsed_model_outputs = {k: model_outputs[np.newaxis, v] for k,v in self.output_slices.items()} if SEND_RAW_PRED: parsed_model_outputs['raw_pred'] = model_outputs.copy() return parsed_model_outputs def run(self, buf: VisionBuf, wbuf: VisionBuf, transform: np.ndarray, transform_wide: np.ndarray, - inputs: Dict[str, np.ndarray], prepare_only: bool) -> Optional[Dict[str, np.ndarray]]: + inputs: dict[str, np.ndarray], prepare_only: bool) -> dict[str, np.ndarray] | None: # Model decides when action is completed, so desire input is just a pulse triggered on rising edge inputs['desire'][0] = 0 self.inputs['desire'][:-ModelConstants.DESIRE_LEN] = self.inputs['desire'][ModelConstants.DESIRE_LEN:] @@ -118,12 +117,16 @@ class ModelState: def main(demo=False): + cloudlog.warning("modeld init") + sentry.set_tag("daemon", PROCESS_NAME) cloudlog.bind(daemon=PROCESS_NAME) setproctitle(PROCESS_NAME) config_realtime_process(7, 54) + cloudlog.warning("setting up CL context") cl_context = CLContext() + cloudlog.warning("CL context ready; loading model") model = ModelState(cl_context) cloudlog.warning("models loaded, modeld starting") @@ -154,18 +157,12 @@ def main(demo=False): pm = PubMaster(["modelV2", "cameraOdometry"]) sm = SubMaster(["carState", "roadCameraState", "liveCalibration", "driverMonitoringState", "navModel", "navInstruction", "carControl"]) - publish_state = PublishState() params = Params() #DP: dp_lat_lane_change_assist_speed = int(params.get("dp_lat_lane_change_assist_speed", encoding="utf-8")) * CV.KPH_TO_MS dp_auto_lane_change = params.get_bool("dp_auto_lane_change") - - with car.CarParams.from_bytes(params.get("CarParams", block=True)) as msg: - steer_delay = msg.steerActuatorDelay + .2 - #steer_delay = 0.4 - # setup filter to track dropped frames frame_dropped_filter = FirstOrderFilter(0., 10., 1. / ModelConstants.MODEL_FREQ) frame_id = 0 @@ -184,17 +181,19 @@ def main(demo=False): if demo: CP = get_demo_car_params() - with car.CarParams.from_bytes(params.get("CarParams", block=True)) as msg: - CP = msg - cloudlog.info("plannerd got CarParams: %s", CP.carName) + else: + with car.CarParams.from_bytes(params.get("CarParams", block=True)) as msg: + CP = msg + cloudlog.info("modeld got CarParams: %s", CP.carName) + # TODO this needs more thought, use .2s extra for now to estimate other delays steer_delay = CP.steerActuatorDelay + .2 - DH = DesireHelper() #DP: RED = RoadEdgeDetector() RED.set_enabled(params.get_bool("dp_lateral_road_edge_detection")) + DH = DesireHelper() while True: # Keep receiving frames until we are at least 1 frame ahead of previous extra frame @@ -230,13 +229,10 @@ def main(demo=False): buf_extra = buf_main meta_extra = meta_main - # TODO: path planner timeout? sm.update(0) desire = DH.desire - v_ego = sm["carState"].vEgo is_rhd = sm["driverMonitoringState"].isRHD frame_id = sm["roadCameraState"].frameId - # TODO add lag lateral_control_params = np.array([sm["carState"].vEgo, steer_delay], dtype=np.float32) if sm.updated["liveCalibration"]: device_from_calib_euler = np.array(sm["liveCalibration"].rpyCalib, dtype=np.float32) @@ -288,7 +284,7 @@ def main(demo=False): if prepare_only: cloudlog.error(f"skipping model eval. Dropped {vipc_dropped_frames} frames") - inputs:Dict[str, np.ndarray] = { + inputs:dict[str, np.ndarray] = { 'desire': vec_desire, 'traffic_convention': traffic_convention, 'lateral_control_params': lateral_control_params, @@ -304,7 +300,7 @@ def main(demo=False): modelv2_send = messaging.new_message('modelV2') posenet_send = messaging.new_message('cameraOdometry') fill_model_msg(modelv2_send, model_output, publish_state, meta_main.frame_id, meta_extra.frame_id, frame_id, frame_drop_ratio, - meta_main.timestamp_eof, timestamp_llk, model_execution_time, nav_enabled, v_ego, steer_delay, live_calib_seen) + meta_main.timestamp_eof, timestamp_llk, model_execution_time, nav_enabled, live_calib_seen) desire_state = modelv2_send.modelV2.meta.desireState l_lane_change_prob = desire_state[log.Desire.laneChangeLeft] diff --git a/selfdrive/modeld/models/commonmodel_pyx.cpp b/selfdrive/modeld/models/commonmodel_pyx.cpp index 73c95023e..cdae9e9f2 100644 --- a/selfdrive/modeld/models/commonmodel_pyx.cpp +++ b/selfdrive/modeld/models/commonmodel_pyx.cpp @@ -1983,7 +1983,7 @@ struct __pyx_obj_9selfdrive_6modeld_6models_15commonmodel_pyx_CLContext { * pass * * cdef class CLMem: # <<<<<<<<<<<<<< - * cdef cl_mem * mem; + * cdef cl_mem * mem * */ struct __pyx_obj_9selfdrive_6modeld_6models_15commonmodel_pyx_CLMem { diff --git a/selfdrive/modeld/models/commonmodel_pyx.pxd b/selfdrive/modeld/models/commonmodel_pyx.pxd index 21c0716de..97e391458 100644 --- a/selfdrive/modeld/models/commonmodel_pyx.pxd +++ b/selfdrive/modeld/models/commonmodel_pyx.pxd @@ -7,7 +7,7 @@ cdef class CLContext(BaseCLContext): pass cdef class CLMem: - cdef cl_mem * mem; + cdef cl_mem * mem @staticmethod cdef create(void*) diff --git a/selfdrive/modeld/models/commonmodel_pyx.so b/selfdrive/modeld/models/commonmodel_pyx.so index f7ad4b289..514d35386 100755 Binary files a/selfdrive/modeld/models/commonmodel_pyx.so and b/selfdrive/modeld/models/commonmodel_pyx.so differ diff --git a/selfdrive/modeld/models/supercombo.thneed b/selfdrive/modeld/models/supercombo.thneed index cdd01da2d..832895e6d 100644 Binary files a/selfdrive/modeld/models/supercombo.thneed and b/selfdrive/modeld/models/supercombo.thneed differ diff --git a/selfdrive/modeld/navmodeld.py b/selfdrive/modeld/navmodeld.py index ed0b597df..467273468 100755 --- a/selfdrive/modeld/navmodeld.py +++ b/selfdrive/modeld/navmodeld.py @@ -5,7 +5,6 @@ import time import ctypes import numpy as np from pathlib import Path -from typing import Tuple, Dict from cereal import messaging from cereal.messaging import PubMaster, SubMaster @@ -41,7 +40,7 @@ class NavModelResult(ctypes.Structure): ("features", ctypes.c_float*NAV_FEATURE_LEN)] class ModelState: - inputs: Dict[str, np.ndarray] + inputs: dict[str, np.ndarray] output: np.ndarray model: ModelRunner @@ -52,7 +51,7 @@ class ModelState: self.model = ModelRunner(MODEL_PATHS, self.output, Runtime.DSP, True, None) self.model.addInput("input_img", None) - def run(self, buf:np.ndarray) -> Tuple[np.ndarray, float]: + def run(self, buf:np.ndarray) -> tuple[np.ndarray, float]: self.inputs['input_img'][:] = buf t1 = time.perf_counter() diff --git a/selfdrive/modeld/parse_model_outputs.py b/selfdrive/modeld/parse_model_outputs.py index 01cba29d1..af57e11d0 100644 --- a/selfdrive/modeld/parse_model_outputs.py +++ b/selfdrive/modeld/parse_model_outputs.py @@ -1,5 +1,4 @@ import numpy as np -from typing import Dict from openpilot.selfdrive.modeld.constants import ModelConstants def sigmoid(x): @@ -82,7 +81,7 @@ class Parser: outs[name] = pred_mu_final.reshape(final_shape) outs[name + '_stds'] = pred_std_final.reshape(final_shape) - def parse_outputs(self, outs: Dict[str, np.ndarray]) -> Dict[str, np.ndarray]: + def parse_outputs(self, outs: dict[str, np.ndarray]) -> dict[str, np.ndarray]: self.parse_mdn('plan', outs, in_N=ModelConstants.PLAN_MHP_N, out_N=ModelConstants.PLAN_MHP_SELECTION, out_shape=(ModelConstants.IDX_N,ModelConstants.PLAN_WIDTH)) self.parse_mdn('lane_lines', outs, in_N=0, out_N=0, out_shape=(ModelConstants.NUM_LANE_LINES,ModelConstants.IDX_N,ModelConstants.LANE_LINES_WIDTH)) diff --git a/selfdrive/modeld/runners/onnxmodel.py b/selfdrive/modeld/runners/onnxmodel.py index f86bee387..69b44a5a9 100644 --- a/selfdrive/modeld/runners/onnxmodel.py +++ b/selfdrive/modeld/runners/onnxmodel.py @@ -3,7 +3,7 @@ import itertools import os import sys import numpy as np -from typing import Tuple, Dict, Union, Any +from typing import Any from openpilot.selfdrive.modeld.runners.runmodel_pyx import RunModel @@ -38,7 +38,7 @@ def create_ort_session(path, fp16_to_fp32): options = ort.SessionOptions() options.graph_optimization_level = ort.GraphOptimizationLevel.ORT_DISABLE_ALL - provider: Union[str, Tuple[str, Dict[Any, Any]]] + provider: str | tuple[str, dict[Any, Any]] if 'OpenVINOExecutionProvider' in ort.get_available_providers() and 'ONNXCPU' not in os.environ: provider = 'OpenVINOExecutionProvider' elif 'CUDAExecutionProvider' in ort.get_available_providers() and 'ONNXCPU' not in os.environ: diff --git a/selfdrive/modeld/runners/runmodel_pyx.cpp b/selfdrive/modeld/runners/runmodel_pyx.cpp index 904b7e30c..0c9c37392 100644 --- a/selfdrive/modeld/runners/runmodel_pyx.cpp +++ b/selfdrive/modeld/runners/runmodel_pyx.cpp @@ -1716,7 +1716,7 @@ struct __pyx_obj_9selfdrive_6modeld_6models_15commonmodel_pyx_CLContext { * pass * * cdef class CLMem: # <<<<<<<<<<<<<< - * cdef cl_mem * mem; + * cdef cl_mem * mem * */ struct __pyx_obj_9selfdrive_6modeld_6models_15commonmodel_pyx_CLMem { @@ -1833,7 +1833,7 @@ static struct __pyx_vtabstruct_6cereal_9visionipc_13visionipc_pyx_VisionBuf *__p * pass * * cdef class CLMem: # <<<<<<<<<<<<<< - * cdef cl_mem * mem; + * cdef cl_mem * mem * */ @@ -17863,7 +17863,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ return __pyx_r; } -/* "selfdrive/modeld/runners/runmodel_pyx.pyx":16 +/* "selfdrive/modeld/runners/runmodel_pyx.pyx":15 * * cdef class RunModel: * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -17886,7 +17886,7 @@ static void __pyx_pw_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_1__dea static void __pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel___dealloc__(struct __pyx_obj_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel *__pyx_v_self) { - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":17 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":16 * cdef class RunModel: * def __dealloc__(self): * del self.model # <<<<<<<<<<<<<< @@ -17895,7 +17895,7 @@ static void __pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel___deal */ delete __pyx_v_self->model; - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":16 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":15 * * cdef class RunModel: * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -17906,7 +17906,7 @@ static void __pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel___deal /* function exit code */ } -/* "selfdrive/modeld/runners/runmodel_pyx.pyx":19 +/* "selfdrive/modeld/runners/runmodel_pyx.pyx":18 * del self.model * * def addInput(self, string name, float[:] buffer): # <<<<<<<<<<<<<< @@ -17970,7 +17970,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 19, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 18, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -17978,14 +17978,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 19, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 18, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("addInput", 1, 2, 2, 1); __PYX_ERR(1, 19, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addInput", 1, 2, 2, 1); __PYX_ERR(1, 18, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addInput") < 0)) __PYX_ERR(1, 19, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "addInput") < 0)) __PYX_ERR(1, 18, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -17993,12 +17993,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } - __pyx_v_name = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 19, __pyx_L3_error) - __pyx_v_buffer = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_buffer.memview)) __PYX_ERR(1, 19, __pyx_L3_error) + __pyx_v_name = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 18, __pyx_L3_error) + __pyx_v_buffer = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_buffer.memview)) __PYX_ERR(1, 18, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("addInput", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 19, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("addInput", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 18, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18039,7 +18039,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_2 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("addInput", 1); - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":20 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":19 * * def addInput(self, string name, float[:] buffer): * if buffer is not None: # <<<<<<<<<<<<<< @@ -18049,7 +18049,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_2 __pyx_t_1 = (((PyObject *) __pyx_v_buffer.memview) != Py_None); if (__pyx_t_1) { - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":21 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":20 * def addInput(self, string name, float[:] buffer): * if buffer is not None: * self.model.addInput(name, &buffer[0], len(buffer)) # <<<<<<<<<<<<<< @@ -18064,12 +18064,12 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_2 } else if (unlikely(__pyx_t_2 >= __pyx_v_buffer.shape[0])) __pyx_t_3 = 0; if (unlikely(__pyx_t_3 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_3); - __PYX_ERR(1, 21, __pyx_L1_error) + __PYX_ERR(1, 20, __pyx_L1_error) } __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_buffer); __pyx_v_self->model->addInput(__pyx_v_name, (&(*((float *) ( /* dim=0 */ (__pyx_v_buffer.data + __pyx_t_2 * __pyx_v_buffer.strides[0]) )))), __pyx_t_4); - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":20 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":19 * * def addInput(self, string name, float[:] buffer): * if buffer is not None: # <<<<<<<<<<<<<< @@ -18079,7 +18079,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_2 goto __pyx_L3; } - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":23 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":22 * self.model.addInput(name, &buffer[0], len(buffer)) * else: * self.model.addInput(name, NULL, 0) # <<<<<<<<<<<<<< @@ -18091,7 +18091,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_2 } __pyx_L3:; - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":19 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":18 * del self.model * * def addInput(self, string name, float[:] buffer): # <<<<<<<<<<<<<< @@ -18111,7 +18111,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_2 return __pyx_r; } -/* "selfdrive/modeld/runners/runmodel_pyx.pyx":25 +/* "selfdrive/modeld/runners/runmodel_pyx.pyx":24 * self.model.addInput(name, NULL, 0) * * def setInputBuffer(self, string name, float[:] buffer): # <<<<<<<<<<<<<< @@ -18175,7 +18175,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 25, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 24, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -18183,14 +18183,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 25, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 24, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("setInputBuffer", 1, 2, 2, 1); __PYX_ERR(1, 25, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setInputBuffer", 1, 2, 2, 1); __PYX_ERR(1, 24, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setInputBuffer") < 0)) __PYX_ERR(1, 25, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "setInputBuffer") < 0)) __PYX_ERR(1, 24, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -18198,12 +18198,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } - __pyx_v_name = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 25, __pyx_L3_error) - __pyx_v_buffer = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_buffer.memview)) __PYX_ERR(1, 25, __pyx_L3_error) + __pyx_v_name = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 24, __pyx_L3_error) + __pyx_v_buffer = __Pyx_PyObject_to_MemoryviewSlice_ds_float(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_buffer.memview)) __PYX_ERR(1, 24, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("setInputBuffer", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 25, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("setInputBuffer", 1, 2, 2, __pyx_nargs); __PYX_ERR(1, 24, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18244,7 +18244,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_4 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("setInputBuffer", 1); - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":26 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":25 * * def setInputBuffer(self, string name, float[:] buffer): * if buffer is not None: # <<<<<<<<<<<<<< @@ -18254,7 +18254,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_4 __pyx_t_1 = (((PyObject *) __pyx_v_buffer.memview) != Py_None); if (__pyx_t_1) { - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":27 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":26 * def setInputBuffer(self, string name, float[:] buffer): * if buffer is not None: * self.model.setInputBuffer(name, &buffer[0], len(buffer)) # <<<<<<<<<<<<<< @@ -18269,12 +18269,12 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_4 } else if (unlikely(__pyx_t_2 >= __pyx_v_buffer.shape[0])) __pyx_t_3 = 0; if (unlikely(__pyx_t_3 != -1)) { __Pyx_RaiseBufferIndexError(__pyx_t_3); - __PYX_ERR(1, 27, __pyx_L1_error) + __PYX_ERR(1, 26, __pyx_L1_error) } __pyx_t_4 = __Pyx_MemoryView_Len(__pyx_v_buffer); __pyx_v_self->model->setInputBuffer(__pyx_v_name, (&(*((float *) ( /* dim=0 */ (__pyx_v_buffer.data + __pyx_t_2 * __pyx_v_buffer.strides[0]) )))), __pyx_t_4); - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":26 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":25 * * def setInputBuffer(self, string name, float[:] buffer): * if buffer is not None: # <<<<<<<<<<<<<< @@ -18284,7 +18284,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_4 goto __pyx_L3; } - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":29 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":28 * self.model.setInputBuffer(name, &buffer[0], len(buffer)) * else: * self.model.setInputBuffer(name, NULL, 0) # <<<<<<<<<<<<<< @@ -18296,7 +18296,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_4 } __pyx_L3:; - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":25 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":24 * self.model.addInput(name, NULL, 0) * * def setInputBuffer(self, string name, float[:] buffer): # <<<<<<<<<<<<<< @@ -18316,7 +18316,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_4 return __pyx_r; } -/* "selfdrive/modeld/runners/runmodel_pyx.pyx":31 +/* "selfdrive/modeld/runners/runmodel_pyx.pyx":30 * self.model.setInputBuffer(name, NULL, 0) * * def getCLBuffer(self, string name): # <<<<<<<<<<<<<< @@ -18377,23 +18377,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getCLBuffer") < 0)) __PYX_ERR(1, 31, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getCLBuffer") < 0)) __PYX_ERR(1, 30, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_name = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L3_error) + __pyx_v_name = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 30, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getCLBuffer", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 31, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getCLBuffer", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 30, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18431,7 +18431,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_6 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCLBuffer", 1); - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":32 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":31 * * def getCLBuffer(self, string name): * cdef void * cl_buf = self.model.getCLBuffer(name) # <<<<<<<<<<<<<< @@ -18440,7 +18440,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_6 */ __pyx_v_cl_buf = __pyx_v_self->model->getCLBuffer(__pyx_v_name); - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":33 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":32 * def getCLBuffer(self, string name): * cdef void * cl_buf = self.model.getCLBuffer(name) * if not cl_buf: # <<<<<<<<<<<<<< @@ -18450,7 +18450,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_6 __pyx_t_1 = (!(__pyx_v_cl_buf != 0)); if (__pyx_t_1) { - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":34 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":33 * cdef void * cl_buf = self.model.getCLBuffer(name) * if not cl_buf: * return None # <<<<<<<<<<<<<< @@ -18461,7 +18461,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_6 __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":33 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":32 * def getCLBuffer(self, string name): * cdef void * cl_buf = self.model.getCLBuffer(name) * if not cl_buf: # <<<<<<<<<<<<<< @@ -18470,7 +18470,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_6 */ } - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":35 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":34 * if not cl_buf: * return None * return CLMem.create(cl_buf) # <<<<<<<<<<<<<< @@ -18478,13 +18478,13 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_6 * def execute(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __pyx_vtabptr_9selfdrive_6modeld_6models_15commonmodel_pyx_CLMem->create(__pyx_v_cl_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 35, __pyx_L1_error) + __pyx_t_2 = __pyx_vtabptr_9selfdrive_6modeld_6models_15commonmodel_pyx_CLMem->create(__pyx_v_cl_buf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":31 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":30 * self.model.setInputBuffer(name, NULL, 0) * * def getCLBuffer(self, string name): # <<<<<<<<<<<<<< @@ -18503,7 +18503,7 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_6 return __pyx_r; } -/* "selfdrive/modeld/runners/runmodel_pyx.pyx":37 +/* "selfdrive/modeld/runners/runmodel_pyx.pyx":36 * return CLMem.create(cl_buf) * * def execute(self): # <<<<<<<<<<<<<< @@ -18556,14 +18556,14 @@ static PyObject *__pyx_pf_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_8 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("execute", 1); - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":38 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":37 * * def execute(self): * self.model.execute() # <<<<<<<<<<<<<< */ __pyx_v_self->model->execute(); - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":37 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":36 * return CLMem.create(cl_buf) * * def execute(self): # <<<<<<<<<<<<<< @@ -20213,49 +20213,49 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 1, __pyx_L1_error) - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":19 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":18 * del self.model * * def addInput(self, string name, float[:] buffer): # <<<<<<<<<<<<<< * if buffer is not None: * self.model.addInput(name, &buffer[0], len(buffer)) */ - __pyx_tuple__20 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 19, __pyx_L1_error) + __pyx_tuple__20 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_buffer); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_selfdrive_modeld_runners_runmode_2, __pyx_n_s_addInput, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 19, __pyx_L1_error) + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_selfdrive_modeld_runners_runmode_2, __pyx_n_s_addInput, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 18, __pyx_L1_error) - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":25 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":24 * self.model.addInput(name, NULL, 0) * * def setInputBuffer(self, string name, float[:] buffer): # <<<<<<<<<<<<<< * if buffer is not None: * self.model.setInputBuffer(name, &buffer[0], len(buffer)) */ - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_selfdrive_modeld_runners_runmode_2, __pyx_n_s_setInputBuffer, 25, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 25, __pyx_L1_error) + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_selfdrive_modeld_runners_runmode_2, __pyx_n_s_setInputBuffer, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 24, __pyx_L1_error) - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":31 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":30 * self.model.setInputBuffer(name, NULL, 0) * * def getCLBuffer(self, string name): # <<<<<<<<<<<<<< * cdef void * cl_buf = self.model.getCLBuffer(name) * if not cl_buf: */ - __pyx_tuple__23 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_cl_buf); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 31, __pyx_L1_error) + __pyx_tuple__23 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_cl_buf); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_selfdrive_modeld_runners_runmode_2, __pyx_n_s_getCLBuffer, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 31, __pyx_L1_error) + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_selfdrive_modeld_runners_runmode_2, __pyx_n_s_getCLBuffer, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 30, __pyx_L1_error) - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":37 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":36 * return CLMem.create(cl_buf) * * def execute(self): # <<<<<<<<<<<<<< * self.model.execute() */ - __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 37, __pyx_L1_error) + __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_selfdrive_modeld_runners_runmode_2, __pyx_n_s_execute, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(1, 37, __pyx_L1_error) + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_selfdrive_modeld_runners_runmode_2, __pyx_n_s_execute, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(1, 36, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< @@ -20356,15 +20356,15 @@ static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel_spec, NULL); if (unlikely(!__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel)) __PYX_ERR(1, 15, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel_spec, __pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel) < 0) __PYX_ERR(1, 15, __pyx_L1_error) + __pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel_spec, NULL); if (unlikely(!__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel)) __PYX_ERR(1, 14, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel_spec, __pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel) < 0) __PYX_ERR(1, 14, __pyx_L1_error) #else __pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel = &__pyx_type_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel) < 0) __PYX_ERR(1, 15, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel) < 0) __PYX_ERR(1, 14, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel->tp_print = 0; @@ -20374,9 +20374,9 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RunModel, (PyObject *) __pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel) < 0) __PYX_ERR(1, 15, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RunModel, (PyObject *) __pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel) < 0) __PYX_ERR(1, 14, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API - if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel) < 0) __PYX_ERR(1, 15, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel) < 0) __PYX_ERR(1, 14, __pyx_L1_error) #endif __pyx_vtabptr_array = &__pyx_vtable_array; __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; @@ -21367,113 +21367,113 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":10 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":9 * from selfdrive.modeld.models.commonmodel_pyx cimport CLMem * * class Runtime: # <<<<<<<<<<<<<< * CPU = USE_CPU_RUNTIME * GPU = USE_GPU_RUNTIME */ - __pyx_t_7 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Runtime, __pyx_n_s_Runtime, (PyObject *) NULL, __pyx_n_s_selfdrive_modeld_runners_runmode, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Runtime, __pyx_n_s_Runtime, (PyObject *) NULL, __pyx_n_s_selfdrive_modeld_runners_runmode, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":11 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":10 * * class Runtime: * CPU = USE_CPU_RUNTIME # <<<<<<<<<<<<<< * GPU = USE_GPU_RUNTIME * DSP = USE_DSP_RUNTIME */ - __pyx_t_4 = __Pyx_PyInt_From_int(USE_CPU_RUNTIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(USE_CPU_RUNTIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_CPU, __pyx_t_4) < 0) __PYX_ERR(1, 11, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_CPU, __pyx_t_4) < 0) __PYX_ERR(1, 10, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":12 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":11 * class Runtime: * CPU = USE_CPU_RUNTIME * GPU = USE_GPU_RUNTIME # <<<<<<<<<<<<<< * DSP = USE_DSP_RUNTIME * */ - __pyx_t_4 = __Pyx_PyInt_From_int(USE_GPU_RUNTIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(USE_GPU_RUNTIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_GPU, __pyx_t_4) < 0) __PYX_ERR(1, 12, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_GPU, __pyx_t_4) < 0) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":13 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":12 * CPU = USE_CPU_RUNTIME * GPU = USE_GPU_RUNTIME * DSP = USE_DSP_RUNTIME # <<<<<<<<<<<<<< * * cdef class RunModel: */ - __pyx_t_4 = __Pyx_PyInt_From_int(USE_DSP_RUNTIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_int(USE_DSP_RUNTIME); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_DSP, __pyx_t_4) < 0) __PYX_ERR(1, 13, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_DSP, __pyx_t_4) < 0) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":10 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":9 * from selfdrive.modeld.models.commonmodel_pyx cimport CLMem * * class Runtime: # <<<<<<<<<<<<<< * CPU = USE_CPU_RUNTIME * GPU = USE_GPU_RUNTIME */ - __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Runtime, __pyx_empty_tuple, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 10, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Runtime, __pyx_empty_tuple, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Runtime, __pyx_t_4) < 0) __PYX_ERR(1, 10, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Runtime, __pyx_t_4) < 0) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":19 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":18 * del self.model * * def addInput(self, string name, float[:] buffer): # <<<<<<<<<<<<<< * if buffer is not None: * self.model.addInput(name, &buffer[0], len(buffer)) */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_3addInput, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RunModel_addInput, NULL, __pyx_n_s_selfdrive_modeld_runners_runmode, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 19, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_3addInput, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RunModel_addInput, NULL, __pyx_n_s_selfdrive_modeld_runners_runmode, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel, __pyx_n_s_addInput, __pyx_t_7) < 0) __PYX_ERR(1, 19, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel, __pyx_n_s_addInput, __pyx_t_7) < 0) __PYX_ERR(1, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel); - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":25 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":24 * self.model.addInput(name, NULL, 0) * * def setInputBuffer(self, string name, float[:] buffer): # <<<<<<<<<<<<<< * if buffer is not None: * self.model.setInputBuffer(name, &buffer[0], len(buffer)) */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_5setInputBuffer, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RunModel_setInputBuffer, NULL, __pyx_n_s_selfdrive_modeld_runners_runmode, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 25, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_5setInputBuffer, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RunModel_setInputBuffer, NULL, __pyx_n_s_selfdrive_modeld_runners_runmode, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel, __pyx_n_s_setInputBuffer, __pyx_t_7) < 0) __PYX_ERR(1, 25, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel, __pyx_n_s_setInputBuffer, __pyx_t_7) < 0) __PYX_ERR(1, 24, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel); - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":31 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":30 * self.model.setInputBuffer(name, NULL, 0) * * def getCLBuffer(self, string name): # <<<<<<<<<<<<<< * cdef void * cl_buf = self.model.getCLBuffer(name) * if not cl_buf: */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_7getCLBuffer, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RunModel_getCLBuffer, NULL, __pyx_n_s_selfdrive_modeld_runners_runmode, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 31, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_7getCLBuffer, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RunModel_getCLBuffer, NULL, __pyx_n_s_selfdrive_modeld_runners_runmode, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel, __pyx_n_s_getCLBuffer, __pyx_t_7) < 0) __PYX_ERR(1, 31, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel, __pyx_n_s_getCLBuffer, __pyx_t_7) < 0) __PYX_ERR(1, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel); - /* "selfdrive/modeld/runners/runmodel_pyx.pyx":37 + /* "selfdrive/modeld/runners/runmodel_pyx.pyx":36 * return CLMem.create(cl_buf) * * def execute(self): # <<<<<<<<<<<<<< * self.model.execute() */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_9execute, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RunModel_execute, NULL, __pyx_n_s_selfdrive_modeld_runners_runmode, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 37, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9selfdrive_6modeld_7runners_12runmodel_pyx_8RunModel_9execute, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RunModel_execute, NULL, __pyx_n_s_selfdrive_modeld_runners_runmode, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel, __pyx_n_s_execute, __pyx_t_7) < 0) __PYX_ERR(1, 37, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel, __pyx_n_s_execute, __pyx_t_7) < 0) __PYX_ERR(1, 36, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; PyType_Modified(__pyx_ptype_9selfdrive_6modeld_7runners_12runmodel_pyx_RunModel); diff --git a/selfdrive/modeld/runners/runmodel_pyx.pyx b/selfdrive/modeld/runners/runmodel_pyx.pyx index cdc62a79b..e1b201a6a 100644 --- a/selfdrive/modeld/runners/runmodel_pyx.pyx +++ b/selfdrive/modeld/runners/runmodel_pyx.pyx @@ -2,7 +2,6 @@ # cython: c_string_encoding=ascii from libcpp.string cimport string -from libc.string cimport memcpy from .runmodel cimport USE_CPU_RUNTIME, USE_GPU_RUNTIME, USE_DSP_RUNTIME from selfdrive.modeld.models.commonmodel_pyx cimport CLMem diff --git a/selfdrive/modeld/runners/runmodel_pyx.so b/selfdrive/modeld/runners/runmodel_pyx.so index ac8b3689a..c32588ff7 100755 Binary files a/selfdrive/modeld/runners/runmodel_pyx.so and b/selfdrive/modeld/runners/runmodel_pyx.so differ diff --git a/selfdrive/modeld/runners/snpemodel_pyx.cpp b/selfdrive/modeld/runners/snpemodel_pyx.cpp index f1f3c3d1e..965b680ea 100644 --- a/selfdrive/modeld/runners/snpemodel_pyx.cpp +++ b/selfdrive/modeld/runners/snpemodel_pyx.cpp @@ -1719,7 +1719,7 @@ struct __pyx_obj_9selfdrive_6modeld_6models_15commonmodel_pyx_CLContext { * pass * * cdef class CLMem: # <<<<<<<<<<<<<< - * cdef cl_mem * mem; + * cdef cl_mem * mem * */ struct __pyx_obj_9selfdrive_6modeld_6models_15commonmodel_pyx_CLMem { @@ -1848,7 +1848,7 @@ static struct __pyx_vtabstruct_6cereal_9visionipc_13visionipc_pyx_VisionBuf *__p * pass * * cdef class CLMem: # <<<<<<<<<<<<<< - * cdef cl_mem * mem; + * cdef cl_mem * mem * */ diff --git a/selfdrive/modeld/runners/snpemodel_pyx.so b/selfdrive/modeld/runners/snpemodel_pyx.so index 404047e24..0073e0db8 100755 Binary files a/selfdrive/modeld/runners/snpemodel_pyx.so and b/selfdrive/modeld/runners/snpemodel_pyx.so differ diff --git a/selfdrive/modeld/runners/thneedmodel_pyx.cpp b/selfdrive/modeld/runners/thneedmodel_pyx.cpp index afd9cac45..1cab6456c 100644 --- a/selfdrive/modeld/runners/thneedmodel_pyx.cpp +++ b/selfdrive/modeld/runners/thneedmodel_pyx.cpp @@ -1719,7 +1719,7 @@ struct __pyx_obj_9selfdrive_6modeld_6models_15commonmodel_pyx_CLContext { * pass * * cdef class CLMem: # <<<<<<<<<<<<<< - * cdef cl_mem * mem; + * cdef cl_mem * mem * */ struct __pyx_obj_9selfdrive_6modeld_6models_15commonmodel_pyx_CLMem { @@ -1848,7 +1848,7 @@ static struct __pyx_vtabstruct_6cereal_9visionipc_13visionipc_pyx_VisionBuf *__p * pass * * cdef class CLMem: # <<<<<<<<<<<<<< - * cdef cl_mem * mem; + * cdef cl_mem * mem * */ diff --git a/selfdrive/modeld/runners/thneedmodel_pyx.so b/selfdrive/modeld/runners/thneedmodel_pyx.so index f5638f8ba..f4e407c6e 100755 Binary files a/selfdrive/modeld/runners/thneedmodel_pyx.so and b/selfdrive/modeld/runners/thneedmodel_pyx.so differ diff --git a/selfdrive/modeld/transforms/transform.cl b/selfdrive/modeld/transforms/transform.cl index 357ef8732..2ca25920c 100644 --- a/selfdrive/modeld/transforms/transform.cl +++ b/selfdrive/modeld/transforms/transform.cl @@ -22,20 +22,20 @@ __kernel void warpPerspective(__global const uchar * src, W = W != 0.0f ? INTER_TAB_SIZE / W : 0.0f; int X = rint(X0 * W), Y = rint(Y0 * W); - short sx = convert_short_sat(X >> INTER_BITS); - short sy = convert_short_sat(Y >> INTER_BITS); + int sx = convert_short_sat(X >> INTER_BITS); + int sy = convert_short_sat(Y >> INTER_BITS); + + short sx_clamp = clamp(sx, 0, src_cols - 1); + short sx_p1_clamp = clamp(sx + 1, 0, src_cols - 1); + short sy_clamp = clamp(sy, 0, src_rows - 1); + short sy_p1_clamp = clamp(sy + 1, 0, src_rows - 1); + int v0 = convert_int(src[mad24(sy_clamp, src_row_stride, src_offset + sx_clamp*src_px_stride)]); + int v1 = convert_int(src[mad24(sy_clamp, src_row_stride, src_offset + sx_p1_clamp*src_px_stride)]); + int v2 = convert_int(src[mad24(sy_p1_clamp, src_row_stride, src_offset + sx_clamp*src_px_stride)]); + int v3 = convert_int(src[mad24(sy_p1_clamp, src_row_stride, src_offset + sx_p1_clamp*src_px_stride)]); + short ay = (short)(Y & (INTER_TAB_SIZE - 1)); short ax = (short)(X & (INTER_TAB_SIZE - 1)); - - int v0 = (sx >= 0 && sx < src_cols && sy >= 0 && sy < src_rows) ? - convert_int(src[mad24(sy, src_row_stride, src_offset + sx*src_px_stride)]) : 0; - int v1 = (sx+1 >= 0 && sx+1 < src_cols && sy >= 0 && sy < src_rows) ? - convert_int(src[mad24(sy, src_row_stride, src_offset + (sx+1)*src_px_stride)]) : 0; - int v2 = (sx >= 0 && sx < src_cols && sy+1 >= 0 && sy+1 < src_rows) ? - convert_int(src[mad24(sy+1, src_row_stride, src_offset + sx*src_px_stride)]) : 0; - int v3 = (sx+1 >= 0 && sx+1 < src_cols && sy+1 >= 0 && sy+1 < src_rows) ? - convert_int(src[mad24(sy+1, src_row_stride, src_offset + (sx+1)*src_px_stride)]) : 0; - float taby = 1.f/INTER_TAB_SIZE*ay; float tabx = 1.f/INTER_TAB_SIZE*ax; diff --git a/selfdrive/monitoring/dmonitoringd.py b/selfdrive/monitoring/dmonitoringd.py index 7e9b3c086..ab907a5d9 100755 --- a/selfdrive/monitoring/dmonitoringd.py +++ b/selfdrive/monitoring/dmonitoringd.py @@ -15,7 +15,7 @@ def dmonitoringd_thread(): params = Params() pm = messaging.PubMaster(['driverMonitoringState']) - sm = messaging.SubMaster(['driverStateV2', 'liveCalibration', 'carState', 'controlsState', 'modelV2'], poll=['driverStateV2']) + sm = messaging.SubMaster(['driverStateV2', 'liveCalibration', 'carState', 'controlsState', 'modelV2'], poll='driverStateV2') driver_status = DriverStatus(rhd_saved=params.get_bool("IsRhdDetected")) @@ -44,7 +44,7 @@ def dmonitoringd_thread(): # Get data from dmonitoringmodeld events = Events() - if sm.all_checks(): + if sm.all_checks() and len(sm['liveCalibration'].rpyCalib): driver_status.update_states(sm['driverStateV2'], sm['liveCalibration'].rpyCalib, sm['carState'].vEgo, sm['controlsState'].enabled) # Block engaging after max number of distrations diff --git a/selfdrive/navd/helpers.py b/selfdrive/navd/helpers.py index 55c3f88a9..0f0410c2c 100644 --- a/selfdrive/navd/helpers.py +++ b/selfdrive/navd/helpers.py @@ -2,7 +2,7 @@ from __future__ import annotations import json import math -from typing import Any, Dict, List, Optional, Tuple, Union, cast +from typing import Any, cast from openpilot.common.conversions import Conversions from openpilot.common.numpy_fast import clip @@ -22,13 +22,13 @@ class Coordinate: def __init__(self, latitude: float, longitude: float) -> None: self.latitude = latitude self.longitude = longitude - self.annotations: Dict[str, float] = {} + self.annotations: dict[str, float] = {} @classmethod - def from_mapbox_tuple(cls, t: Tuple[float, float]) -> Coordinate: + def from_mapbox_tuple(cls, t: tuple[float, float]) -> Coordinate: return cls(t[1], t[0]) - def as_dict(self) -> Dict[str, float]: + def as_dict(self) -> dict[str, float]: return {'latitude': self.latitude, 'longitude': self.longitude} def __str__(self) -> str: @@ -83,7 +83,7 @@ def minimum_distance(a: Coordinate, b: Coordinate, p: Coordinate): return projection.distance_to(p) -def distance_along_geometry(geometry: List[Coordinate], pos: Coordinate) -> float: +def distance_along_geometry(geometry: list[Coordinate], pos: Coordinate) -> float: if len(geometry) <= 2: return geometry[0].distance_to(pos) @@ -106,7 +106,7 @@ def distance_along_geometry(geometry: List[Coordinate], pos: Coordinate) -> floa return total_distance_closest -def coordinate_from_param(param: str, params: Optional[Params] = None) -> Optional[Coordinate]: +def coordinate_from_param(param: str, params: Params = None) -> Coordinate | None: if params is None: params = Params() @@ -130,7 +130,7 @@ def string_to_direction(direction: str) -> str: return 'none' -def maxspeed_to_ms(maxspeed: Dict[str, Union[str, float]]) -> float: +def maxspeed_to_ms(maxspeed: dict[str, str | float]) -> float: unit = cast(str, maxspeed['unit']) speed = cast(float, maxspeed['speed']) return SPEED_CONVERSIONS[unit] * speed @@ -140,7 +140,7 @@ def field_valid(dat: dict, field: str) -> bool: return field in dat and dat[field] is not None -def parse_banner_instructions(banners: Any, distance_to_maneuver: float = 0.0) -> Optional[Dict[str, Any]]: +def parse_banner_instructions(banners: Any, distance_to_maneuver: float = 0.0) -> dict[str, Any] | None: if not len(banners): return None diff --git a/selfdrive/navd/libmaprender.so b/selfdrive/navd/libmaprender.so index f42c7e1f0..6d925ca0d 100755 Binary files a/selfdrive/navd/libmaprender.so and b/selfdrive/navd/libmaprender.so differ diff --git a/selfdrive/navd/mapsd b/selfdrive/navd/mapsd index 22d6349d6..2e552332d 100755 Binary files a/selfdrive/navd/mapsd and b/selfdrive/navd/mapsd differ diff --git a/selfdrive/navd/tests/test_navd.py b/selfdrive/navd/tests/test_navd.py index 014b1a32a..61be6cc38 100755 --- a/selfdrive/navd/tests/test_navd.py +++ b/selfdrive/navd/tests/test_navd.py @@ -26,7 +26,7 @@ class TestNavd(unittest.TestCase): managed_processes['navd'].start() for _ in range(30): self.sm.update(1000) - if all(f > 0 for f in self.sm.rcv_frame.values()): + if all(f > 0 for f in self.sm.recv_frame.values()): break else: raise Exception("didn't get a route") diff --git a/selfdrive/statsd.py b/selfdrive/statsd.py index 94572b82c..299aa295d 100755 --- a/selfdrive/statsd.py +++ b/selfdrive/statsd.py @@ -5,7 +5,7 @@ import time from pathlib import Path from collections import defaultdict from datetime import datetime, timezone -from typing import NoReturn, Union, List, Dict +from typing import NoReturn from openpilot.common.params import Params from cereal.messaging import SubMaster @@ -61,7 +61,7 @@ class StatLog: def main() -> NoReturn: dongle_id = Params().get("DongleId", encoding='utf-8') - def get_influxdb_line(measurement: str, value: Union[float, Dict[str, float]], timestamp: datetime, tags: dict) -> str: + def get_influxdb_line(measurement: str, value: float | dict[str, float], timestamp: datetime, tags: dict) -> str: res = f"{measurement}" for k, v in tags.items(): res += f",{k}={str(v)}" @@ -102,7 +102,7 @@ def main() -> NoReturn: idx = 0 last_flush_time = time.monotonic() gauges = {} - samples: Dict[str, List[float]] = defaultdict(list) + samples: dict[str, list[float]] = defaultdict(list) try: while True: started_prev = sm['deviceState'].started diff --git a/selfdrive/test/fuzzy_generation.py b/selfdrive/test/fuzzy_generation.py index 28c70a0ff..26c35c0c1 100644 --- a/selfdrive/test/fuzzy_generation.py +++ b/selfdrive/test/fuzzy_generation.py @@ -1,6 +1,7 @@ import capnp import hypothesis.strategies as st -from typing import Any, Callable, Dict, List, Optional, Union +from typing import Any +from collections.abc import Callable from cereal import log @@ -12,7 +13,7 @@ class FuzzyGenerator: self.draw = draw self.real_floats = real_floats - def generate_native_type(self, field: str) -> st.SearchStrategy[Union[bool, int, float, str, bytes]]: + def generate_native_type(self, field: str) -> st.SearchStrategy[bool | int | float | str | bytes]: def floats(**kwargs) -> st.SearchStrategy[float]: allow_nan = not self.real_floats allow_infinity = not self.real_floats @@ -67,18 +68,18 @@ class FuzzyGenerator: else: return self.generate_struct(field.schema) - def generate_struct(self, schema: capnp.lib.capnp._StructSchema, event: Optional[str] = None) -> st.SearchStrategy[Dict[str, Any]]: - full_fill: List[str] = list(schema.non_union_fields) - single_fill: List[str] = [event] if event else [self.draw(st.sampled_from(schema.union_fields))] if schema.union_fields else [] + def generate_struct(self, schema: capnp.lib.capnp._StructSchema, event: str = None) -> st.SearchStrategy[dict[str, Any]]: + full_fill: list[str] = list(schema.non_union_fields) + single_fill: list[str] = [event] if event else [self.draw(st.sampled_from(schema.union_fields))] if schema.union_fields else [] return st.fixed_dictionaries({field: self.generate_field(schema.fields[field]) for field in full_fill + single_fill}) @classmethod - def get_random_msg(cls, draw: DrawType, struct: capnp.lib.capnp._StructModule, real_floats: bool = False) -> Dict[str, Any]: + def get_random_msg(cls, draw: DrawType, struct: capnp.lib.capnp._StructModule, real_floats: bool = False) -> dict[str, Any]: fg = cls(draw, real_floats=real_floats) - data: Dict[str, Any] = draw(fg.generate_struct(struct.schema)) + data: dict[str, Any] = draw(fg.generate_struct(struct.schema)) return data @classmethod - def get_random_event_msg(cls, draw: DrawType, events: List[str], real_floats: bool = False) -> List[Dict[str, Any]]: + def get_random_event_msg(cls, draw: DrawType, events: list[str], real_floats: bool = False) -> list[dict[str, Any]]: fg = cls(draw, real_floats=real_floats) return [draw(fg.generate_struct(log.Event.schema, e)) for e in sorted(events)] diff --git a/selfdrive/test/helpers.py b/selfdrive/test/helpers.py index a8b7ca0c4..210a28369 100644 --- a/selfdrive/test/helpers.py +++ b/selfdrive/test/helpers.py @@ -1,4 +1,6 @@ +import http.server import os +import threading import time from functools import wraps @@ -11,7 +13,6 @@ from openpilot.system.version import training_version, terms_version def set_params_enabled(): - os.environ['REPLAY'] = "1" os.environ['FINGERPRINT'] = "TOYOTA COROLLA TSS2 2019" os.environ['LOGPRINT'] = "debug" @@ -73,7 +74,29 @@ def noop(*args, **kwargs): def read_segment_list(segment_list_path): - with open(segment_list_path, "r") as f: + with open(segment_list_path) as f: seg_list = f.read().splitlines() return [(platform[2:], segment) for platform, segment in zip(seg_list[::2], seg_list[1::2], strict=True)] + + +def with_http_server(func, handler=http.server.BaseHTTPRequestHandler, setup=None): + @wraps(func) + def inner(*args, **kwargs): + host = '127.0.0.1' + server = http.server.HTTPServer((host, 0), handler) + port = server.server_port + t = threading.Thread(target=server.serve_forever) + t.start() + + if setup is not None: + setup(host, port) + + try: + return func(*args, f'http://{host}:{port}', **kwargs) + finally: + server.shutdown() + server.server_close() + t.join() + + return inner diff --git a/selfdrive/test/test_onroad.py b/selfdrive/test/test_onroad.py index a61d891e0..4be9b8a43 100755 --- a/selfdrive/test/test_onroad.py +++ b/selfdrive/test/test_onroad.py @@ -29,7 +29,7 @@ from openpilot.tools.lib.logreader import LogReader # Baseline CPU usage by process PROCS = { - "selfdrive.controls.controlsd": 39.0, + "selfdrive.controls.controlsd": 46.0, "./loggerd": 14.0, "./encoderd": 17.0, "./camerad": 14.5, @@ -39,7 +39,7 @@ PROCS = { "./ui": 18.0, "selfdrive.locationd.paramsd": 9.0, "./sensord": 7.0, - "selfdrive.controls.radard": 4.5, + "selfdrive.controls.radard": 7.0, "selfdrive.modeld.modeld": 13.0, "selfdrive.modeld.dmonitoringmodeld": 8.0, "selfdrive.modeld.navmodeld": 1.0, @@ -114,6 +114,7 @@ class TestOnroad(unittest.TestCase): params = Params() params.remove("CurrentRoute") set_params_enabled() + os.environ['REPLAY'] = '1' os.environ['TESTING_CLOSET'] = '1' if os.path.exists(Paths.log_root()): shutil.rmtree(Paths.log_root()) @@ -126,7 +127,7 @@ class TestOnroad(unittest.TestCase): sm = messaging.SubMaster(['carState']) with Timeout(150, "controls didn't start"): - while sm.rcv_frame['carState'] < 0: + while sm.recv_frame['carState'] < 0: sm.update(1000) # make sure we get at least two full segments @@ -423,4 +424,4 @@ class TestOnroad(unittest.TestCase): if __name__ == "__main__": - pytest.main() + unittest.main() diff --git a/selfdrive/test/test_time_to_onroad.py b/selfdrive/test/test_time_to_onroad.py index 9288188a7..a3f803e22 100755 --- a/selfdrive/test/test_time_to_onroad.py +++ b/selfdrive/test/test_time_to_onroad.py @@ -18,33 +18,40 @@ def test_time_to_onroad(): proc = subprocess.Popen(["python", manager_path]) start_time = time.monotonic() - sm = messaging.SubMaster(['controlsState', 'deviceState', 'onroadEvents']) + sm = messaging.SubMaster(['controlsState', 'deviceState', 'onroadEvents', 'sendcan']) try: - # wait for onroad - with Timeout(20, "timed out waiting to go onroad"): - while True: - sm.update(1000) - if sm['deviceState'].started: - break - time.sleep(1) + # wait for onroad. timeout assumes panda is up to date + with Timeout(10, "timed out waiting to go onroad"): + while not sm['deviceState'].started: + sm.update(100) # wait for engageability try: with Timeout(10, "timed out waiting for engageable"): + sendcan_frame = None while True: - sm.update(1000) - if sm['controlsState'].engageable: + sm.update(100) + + # sendcan is only sent once we're initialized + if sm.seen['controlsState'] and sendcan_frame is None: + sendcan_frame = sm.frame + + if sendcan_frame is not None and sm.recv_frame['sendcan'] > sendcan_frame: + sm.update(100) + assert sm['controlsState'].engageable, f"events: {sm['onroadEvents']}" break - time.sleep(1) finally: print(f"onroad events: {sm['onroadEvents']}") print(f"engageable after {time.monotonic() - start_time:.2f}s") - # once we're enageable, must be for the next few seconds - for _ in range(500): + # once we're enageable, must stay for the next few seconds + st = time.monotonic() + while (time.monotonic() - st) < 10.: sm.update(100) + assert sm.all_alive(), sm.alive assert sm['controlsState'].engageable, f"events: {sm['onroadEvents']}" + assert sm['controlsState'].cumLagMs < 10. finally: proc.terminate() - if proc.wait(60) is None: + if proc.wait(20) is None: proc.kill() diff --git a/selfdrive/thermald/power_monitoring.py b/selfdrive/thermald/power_monitoring.py index f7688b2bb..0993de561 100644 --- a/selfdrive/thermald/power_monitoring.py +++ b/selfdrive/thermald/power_monitoring.py @@ -1,6 +1,5 @@ import time import threading -from typing import Optional from openpilot.common.params import Params from openpilot.system.hardware import HARDWARE @@ -14,7 +13,6 @@ CAR_BATTERY_CAPACITY_uWh = 30e6 CAR_CHARGING_RATE_W = 45 VBATT_PAUSE_CHARGING = 11.8 # Lower limit on the LPF car battery voltage -VBATT_INSTANT_PAUSE_CHARGING = 7.0 # Lower limit on the instant car battery voltage measurements to avoid triggering on instant power loss MAX_TIME_OFFROAD_S = 30*3600 MIN_ON_TIME_S = 3600 DELAY_SHUTDOWN_TIME_S = 300 # Wait at least DELAY_SHUTDOWN_TIME_S seconds after offroad_time to shutdown. @@ -41,7 +39,7 @@ class PowerMonitoring: self.car_battery_capacity_uWh = max((CAR_BATTERY_CAPACITY_uWh / 10), int(car_battery_capacity_uWh)) # Calculation tick - def calculate(self, voltage: Optional[int], ignition: bool): + def calculate(self, voltage: int | None, ignition: bool): try: now = time.monotonic() @@ -111,7 +109,7 @@ class PowerMonitoring: return int(self.car_battery_capacity_uWh) # See if we need to shutdown - def should_shutdown(self, ignition: bool, in_car: bool, offroad_timestamp: Optional[float], started_seen: bool): + def should_shutdown(self, ignition: bool, in_car: bool, offroad_timestamp: float | None, started_seen: bool): if offroad_timestamp is None: return False @@ -123,7 +121,6 @@ class PowerMonitoring: return True low_voltage_shutdown = (self.car_voltage_mV < (VBATT_PAUSE_CHARGING * 1e3) and - self.car_voltage_instant_mV > (VBATT_INSTANT_PAUSE_CHARGING * 1e3) and offroad_time > VOLTAGE_SHUTDOWN_MIN_OFFROAD_TIME_S) should_shutdown |= offroad_time > MAX_TIME_OFFROAD_S should_shutdown |= low_voltage_shutdown diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index ded48382f..bfb11c1a9 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -6,7 +6,6 @@ import threading import time from collections import OrderedDict, namedtuple from pathlib import Path -from typing import Dict, Optional, Tuple import psutil @@ -51,9 +50,9 @@ THERMAL_BANDS = OrderedDict({ # Override to highest thermal band when offroad and above this temp OFFROAD_DANGER_TEMP = 75 -prev_offroad_states: Dict[str, Tuple[bool, Optional[str]]] = {} +prev_offroad_states: dict[str, tuple[bool, str | None]] = {} -tz_by_type: Optional[Dict[str, int]] = None +tz_by_type: dict[str, int] | None = None def populate_tz_by_type(): global tz_by_type tz_by_type = {} @@ -84,12 +83,11 @@ def read_thermal(thermal_config): dat.deviceState.cpuTempC = [read_tz(z) / thermal_config.cpu[1] for z in thermal_config.cpu[0]] dat.deviceState.gpuTempC = [read_tz(z) / thermal_config.gpu[1] for z in thermal_config.gpu[0]] dat.deviceState.memoryTempC = read_tz(thermal_config.mem[0]) / thermal_config.mem[1] - dat.deviceState.ambientTempC = read_tz(thermal_config.ambient[0]) / thermal_config.ambient[1] dat.deviceState.pmicTempC = [read_tz(z) / thermal_config.pmic[1] for z in thermal_config.pmic[0]] return dat -def set_offroad_alert_if_changed(offroad_alert: str, show_alert: bool, extra_text: Optional[str]=None): +def set_offroad_alert_if_changed(offroad_alert: str, show_alert: bool, extra_text: str | None=None): if prev_offroad_states.get(offroad_alert, None) == (show_alert, extra_text): return prev_offroad_states[offroad_alert] = (show_alert, extra_text) @@ -167,20 +165,20 @@ def hw_state_thread(end_event, hw_queue): def thermald_thread(end_event, hw_queue) -> None: pm = messaging.PubMaster(['deviceState']) - sm = messaging.SubMaster(["peripheralState", "gpsLocationExternal", "controlsState", "pandaStates"], poll=["pandaStates"]) + sm = messaging.SubMaster(["peripheralState", "gpsLocationExternal", "controlsState", "pandaStates"], poll="pandaStates") count = 0 - onroad_conditions: Dict[str, bool] = { + onroad_conditions: dict[str, bool] = { "ignition": False, } - startup_conditions: Dict[str, bool] = {} - startup_conditions_prev: Dict[str, bool] = {} + startup_conditions: dict[str, bool] = {} + startup_conditions_prev: dict[str, bool] = {} - off_ts: Optional[float] = None - started_ts: Optional[float] = None + off_ts: float | None = None + started_ts: float | None = None started_seen = False - startup_blocked_ts: Optional[float] = None + startup_blocked_ts: float | None = None thermal_status = ThermalStatus.yellow last_hw_state = HardwareState( @@ -243,7 +241,7 @@ def thermald_thread(end_event, hw_queue) -> None: if TICI: fan_controller = TiciFanController() - elif (time.monotonic() - sm.rcv_time['pandaStates']) > DISCONNECT_TIMEOUT: + elif (time.monotonic() - sm.recv_time['pandaStates']) > DISCONNECT_TIMEOUT: if onroad_conditions["ignition"]: onroad_conditions["ignition"] = False cloudlog.error("panda timed out onroad") @@ -255,8 +253,10 @@ def thermald_thread(end_event, hw_queue) -> None: msg.deviceState.freeSpacePercent = get_available_percent(default=100.0) msg.deviceState.memoryUsagePercent = int(round(psutil.virtual_memory().percent)) - msg.deviceState.cpuUsagePercent = [int(round(n)) for n in psutil.cpu_percent(percpu=True)] msg.deviceState.gpuUsagePercent = int(round(HARDWARE.get_gpu_usage_percent())) + online_cpu_usage = [int(round(n)) for n in psutil.cpu_percent(percpu=True)] + offline_cpu_usage = [0., ] * (len(msg.deviceState.cpuTempC) - len(online_cpu_usage)) + msg.deviceState.cpuUsagePercent = online_cpu_usage + offline_cpu_usage msg.deviceState.networkType = last_hw_state.network_type msg.deviceState.networkMetered = last_hw_state.network_metered @@ -421,7 +421,6 @@ def thermald_thread(end_event, hw_queue) -> None: for i, temp in enumerate(msg.deviceState.gpuTempC): statlog.gauge(f"gpu{i}_temperature", temp) statlog.gauge("memory_temperature", msg.deviceState.memoryTempC) - statlog.gauge("ambient_temperature", msg.deviceState.ambientTempC) for i, temp in enumerate(msg.deviceState.pmicTempC): statlog.gauge(f"pmic{i}_temperature", temp) for i, temp in enumerate(last_hw_state.nvme_temps): diff --git a/selfdrive/ui/.gitignore b/selfdrive/ui/.gitignore index 99f909790..f9724816d 100644 --- a/selfdrive/ui/.gitignore +++ b/selfdrive/ui/.gitignore @@ -3,11 +3,13 @@ moc_* translations/main_test_en.* +_text +_spinner + ui +mui watch3 installer/installers/* -qt/text -qt/spinner qt/setup/setup qt/setup/reset qt/setup/wifi diff --git a/selfdrive/ui/_spinner b/selfdrive/ui/_spinner new file mode 100755 index 000000000..195908ccf Binary files /dev/null and b/selfdrive/ui/_spinner differ diff --git a/selfdrive/ui/_text b/selfdrive/ui/_text new file mode 100755 index 000000000..e5a4ca6b4 Binary files /dev/null and b/selfdrive/ui/_text differ diff --git a/selfdrive/ui/qt/libpython_helpers.so b/selfdrive/ui/qt/libpython_helpers.so index cf9fc5a9d..1f16d9365 100755 Binary files a/selfdrive/ui/qt/libpython_helpers.so and b/selfdrive/ui/qt/libpython_helpers.so differ diff --git a/selfdrive/ui/qt/spinner b/selfdrive/ui/qt/spinner deleted file mode 100755 index 7c362b913..000000000 Binary files a/selfdrive/ui/qt/spinner and /dev/null differ diff --git a/selfdrive/ui/qt/text b/selfdrive/ui/qt/text deleted file mode 100755 index 4eaebc67d..000000000 Binary files a/selfdrive/ui/qt/text and /dev/null differ diff --git a/selfdrive/ui/soundd.py b/selfdrive/ui/soundd.py index 1ef03f9c0..a51a8984d 100644 --- a/selfdrive/ui/soundd.py +++ b/selfdrive/ui/soundd.py @@ -3,7 +3,6 @@ import numpy as np import time import wave -from typing import Dict, Optional, Tuple from cereal import car, messaging from openpilot.common.basedir import BASEDIR @@ -30,7 +29,7 @@ DB_SCALE = 30 # AMBIENT_DB + DB_SCALE is where MAX_VOLUME is applied AudibleAlert = car.CarControl.HUDControl.AudibleAlert -sound_list: Dict[int, Tuple[str, Optional[int], float]] = { +sound_list: dict[int, tuple[str, int | None, float]] = { # AudibleAlert, file name, play count (none for infinite) AudibleAlert.engage: ("engage.wav", 1, MAX_VOLUME), AudibleAlert.disengage: ("disengage.wav", 1, MAX_VOLUME), @@ -45,7 +44,7 @@ sound_list: Dict[int, Tuple[str, Optional[int], float]] = { } def check_controls_timeout_alert(sm): - controls_missing = time.monotonic() - sm.rcv_time['controlsState'] + controls_missing = time.monotonic() - sm.recv_time['controlsState'] if controls_missing > CONTROLS_TIMEOUT: if sm['controlsState'].enabled and (controls_missing - CONTROLS_TIMEOUT) < 10: @@ -75,7 +74,7 @@ class Soundd: self.current_alert_is_nav_voice = False def load_sounds(self): - self.loaded_sounds: Dict[Any, np.ndarray] = {} + self.loaded_sounds: dict[int, np.ndarray] = {} # Load all sounds for sound in sound_list: diff --git a/selfdrive/ui/spinner b/selfdrive/ui/spinner index 35feab3f7..965c8f581 100755 --- a/selfdrive/ui/spinner +++ b/selfdrive/ui/spinner @@ -1,7 +1,7 @@ #!/bin/sh -if [ -f /TICI ] && [ ! -f qt/spinner ]; then - cp qt/spinner_larch64 qt/spinner +if [ -f /TICI ] && [ ! -f _spinner ]; then + cp qt/spinner_larch64 _spinner fi -exec ./qt/spinner "$1" +exec ./_spinner "$1" diff --git a/selfdrive/ui/tests/test_translations.py b/selfdrive/ui/tests/test_translations.py index 9ba9054ea..8e50695e7 100755 --- a/selfdrive/ui/tests/test_translations.py +++ b/selfdrive/ui/tests/test_translations.py @@ -12,7 +12,7 @@ from parameterized import parameterized_class from openpilot.selfdrive.ui.update_translations import TRANSLATIONS_DIR, LANGUAGES_FILE, update_translations -with open(LANGUAGES_FILE, "r") as f: +with open(LANGUAGES_FILE) as f: translation_files = json.load(f) UNFINISHED_TRANSLATION_TAG = " - - When enabled, Smoother Braking Behind Lead More natural braking behavior when coming up to a slower vehicle. -Credit to FrogaAi: https://github.com/FrogAi/FrogPilot/ - - On-Screen Personality Button @@ -557,10 +552,6 @@ Reboot Required. When enabled, openpilot automatically lane change when possible(WARNING: USE IT AT YOUR OWN RISK!!!!). - - *α* Enable Smooth Braking - - DeclinePage @@ -1238,6 +1229,18 @@ This may take up to a minute. Select a language اختر لغة + + Choose Software to Install + + + + openpilot + openpilot + + + Custom Software + + SetupWidget diff --git a/selfdrive/ui/translations/main_de.qm b/selfdrive/ui/translations/main_de.qm index 69e4a514b..1ba578aac 100644 Binary files a/selfdrive/ui/translations/main_de.qm and b/selfdrive/ui/translations/main_de.qm differ diff --git a/selfdrive/ui/translations/main_de.ts b/selfdrive/ui/translations/main_de.ts index 2e1feb35c..1fb43913f 100644 --- a/selfdrive/ui/translations/main_de.ts +++ b/selfdrive/ui/translations/main_de.ts @@ -460,11 +460,6 @@ Activate only when speed belows 27 km/h. Credit to krkeegen: https://github.com/krkeegan/ - - When enabled, Smoother Braking Behind Lead More natural braking behavior when coming up to a slower vehicle. -Credit to FrogaAi: https://github.com/FrogAi/FrogPilot/ - - On-Screen Personality Button @@ -557,10 +552,6 @@ Reboot Required. When enabled, openpilot automatically lane change when possible(WARNING: USE IT AT YOUR OWN RISK!!!!). - - *α* Enable Smooth Braking - - DeclinePage @@ -1220,6 +1211,18 @@ This may take up to a minute. Select a language Sprache wählen + + Choose Software to Install + + + + openpilot + openpilot + + + Custom Software + + SetupWidget diff --git a/selfdrive/ui/translations/main_fr.qm b/selfdrive/ui/translations/main_fr.qm index 0f02ee2e2..1e09e4b86 100644 Binary files a/selfdrive/ui/translations/main_fr.qm and b/selfdrive/ui/translations/main_fr.qm differ diff --git a/selfdrive/ui/translations/main_fr.ts b/selfdrive/ui/translations/main_fr.ts index 30f45689c..152c8eae3 100644 --- a/selfdrive/ui/translations/main_fr.ts +++ b/selfdrive/ui/translations/main_fr.ts @@ -460,11 +460,6 @@ Activate only when speed belows 27 km/h. Credit to krkeegen: https://github.com/krkeegan/ - - When enabled, Smoother Braking Behind Lead More natural braking behavior when coming up to a slower vehicle. -Credit to FrogaAi: https://github.com/FrogAi/FrogPilot/ - - On-Screen Personality Button @@ -557,10 +552,6 @@ Reboot Required. When enabled, openpilot automatically lane change when possible(WARNING: USE IT AT YOUR OWN RISK!!!!). - - *α* Enable Smooth Braking - - DeclinePage @@ -1222,6 +1213,18 @@ Cela peut prendre jusqu'à une minute. Select a language Choisir une langue + + Choose Software to Install + + + + openpilot + openpilot + + + Custom Software + + SetupWidget diff --git a/selfdrive/ui/translations/main_ja.qm b/selfdrive/ui/translations/main_ja.qm index 69be12192..b22212d3c 100644 Binary files a/selfdrive/ui/translations/main_ja.qm and b/selfdrive/ui/translations/main_ja.qm differ diff --git a/selfdrive/ui/translations/main_ja.ts b/selfdrive/ui/translations/main_ja.ts index 5a81c783d..af509f9ca 100644 --- a/selfdrive/ui/translations/main_ja.ts +++ b/selfdrive/ui/translations/main_ja.ts @@ -460,11 +460,6 @@ Activate only when speed belows 27 km/h. Credit to krkeegen: https://github.com/krkeegan/ - - When enabled, Smoother Braking Behind Lead More natural braking behavior when coming up to a slower vehicle. -Credit to FrogaAi: https://github.com/FrogAi/FrogPilot/ - - On-Screen Personality Button @@ -557,10 +552,6 @@ Reboot Required. When enabled, openpilot automatically lane change when possible(WARNING: USE IT AT YOUR OWN RISK!!!!). - - *α* Enable Smooth Braking - - DeclinePage @@ -1216,6 +1207,18 @@ This may take up to a minute. Select a language 言語を選択 + + Choose Software to Install + + + + openpilot + openpilot + + + Custom Software + + SetupWidget diff --git a/selfdrive/ui/translations/main_ko.qm b/selfdrive/ui/translations/main_ko.qm index cdf17dc36..ff8ba3a60 100644 Binary files a/selfdrive/ui/translations/main_ko.qm and b/selfdrive/ui/translations/main_ko.qm differ diff --git a/selfdrive/ui/translations/main_ko.ts b/selfdrive/ui/translations/main_ko.ts index c7f7cfa56..0cbf520da 100644 --- a/selfdrive/ui/translations/main_ko.ts +++ b/selfdrive/ui/translations/main_ko.ts @@ -460,11 +460,6 @@ Activate only when speed belows 27 km/h. Credit to krkeegen: https://github.com/krkeegan/ - - When enabled, Smoother Braking Behind Lead More natural braking behavior when coming up to a slower vehicle. -Credit to FrogaAi: https://github.com/FrogAi/FrogPilot/ - - On-Screen Personality Button @@ -557,10 +552,6 @@ Reboot Required. When enabled, openpilot automatically lane change when possible(WARNING: USE IT AT YOUR OWN RISK!!!!). - - *α* Enable Smooth Braking - - DeclinePage @@ -1218,6 +1209,18 @@ This may take up to a minute. Select a language 언어를 선택하세요 + + Choose Software to Install + + + + openpilot + openpilot + + + Custom Software + + SetupWidget diff --git a/selfdrive/ui/translations/main_pt-BR.qm b/selfdrive/ui/translations/main_pt-BR.qm index cccea7bfa..f3d83e4ea 100644 Binary files a/selfdrive/ui/translations/main_pt-BR.qm and b/selfdrive/ui/translations/main_pt-BR.qm differ diff --git a/selfdrive/ui/translations/main_pt-BR.ts b/selfdrive/ui/translations/main_pt-BR.ts index 59eddb6c0..116b90d37 100644 --- a/selfdrive/ui/translations/main_pt-BR.ts +++ b/selfdrive/ui/translations/main_pt-BR.ts @@ -460,11 +460,6 @@ Activate only when speed belows 27 km/h. Credit to krkeegen: https://github.com/krkeegan/ - - When enabled, Smoother Braking Behind Lead More natural braking behavior when coming up to a slower vehicle. -Credit to FrogaAi: https://github.com/FrogAi/FrogPilot/ - - On-Screen Personality Button @@ -557,10 +552,6 @@ Reboot Required. When enabled, openpilot automatically lane change when possible(WARNING: USE IT AT YOUR OWN RISK!!!!). - - *α* Enable Smooth Braking - - DeclinePage @@ -1106,7 +1097,7 @@ Isso pode levar até um minuto. System reset triggered. Press confirm to erase all content and settings. Press cancel to resume boot. - Reinicialização do sistema acionada. Pressione confirmar para apagar todo o conteúdo e configurações. Pressione cancel para retomar a inicialização. + Reinicialização do sistema acionada. Pressione confirmar para apagar todo o conteúdo e configurações. Pressione cancel para retomar a inicialização. @@ -1222,6 +1213,18 @@ Isso pode levar até um minuto. Select a language Selecione o Idioma + + Choose Software to Install + Escolha o Software a ser Instalado + + + openpilot + openpilot + + + Custom Software + Software Customizado + SetupWidget diff --git a/selfdrive/ui/translations/main_th.qm b/selfdrive/ui/translations/main_th.qm index 6595257c3..9d8ee7df2 100644 Binary files a/selfdrive/ui/translations/main_th.qm and b/selfdrive/ui/translations/main_th.qm differ diff --git a/selfdrive/ui/translations/main_th.ts b/selfdrive/ui/translations/main_th.ts index 815f02c3b..973e20446 100644 --- a/selfdrive/ui/translations/main_th.ts +++ b/selfdrive/ui/translations/main_th.ts @@ -460,11 +460,6 @@ Activate only when speed belows 27 km/h. Credit to krkeegen: https://github.com/krkeegan/ - - When enabled, Smoother Braking Behind Lead More natural braking behavior when coming up to a slower vehicle. -Credit to FrogaAi: https://github.com/FrogAi/FrogPilot/ - - On-Screen Personality Button @@ -557,10 +552,6 @@ Reboot Required. When enabled, openpilot automatically lane change when possible(WARNING: USE IT AT YOUR OWN RISK!!!!). - - *α* Enable Smooth Braking - - DeclinePage @@ -1218,6 +1209,18 @@ This may take up to a minute. Select a language เลือกภาษา + + Choose Software to Install + + + + openpilot + openpilot + + + Custom Software + + SetupWidget diff --git a/selfdrive/ui/translations/main_tr.qm b/selfdrive/ui/translations/main_tr.qm index f6e74d0ef..c19de6804 100644 Binary files a/selfdrive/ui/translations/main_tr.qm and b/selfdrive/ui/translations/main_tr.qm differ diff --git a/selfdrive/ui/translations/main_tr.ts b/selfdrive/ui/translations/main_tr.ts index 8581e07f9..fd31304fb 100644 --- a/selfdrive/ui/translations/main_tr.ts +++ b/selfdrive/ui/translations/main_tr.ts @@ -460,11 +460,6 @@ Activate only when speed belows 27 km/h. Credit to krkeegen: https://github.com/krkeegan/ - - When enabled, Smoother Braking Behind Lead More natural braking behavior when coming up to a slower vehicle. -Credit to FrogaAi: https://github.com/FrogAi/FrogPilot/ - - On-Screen Personality Button @@ -557,10 +552,6 @@ Reboot Required. When enabled, openpilot automatically lane change when possible(WARNING: USE IT AT YOUR OWN RISK!!!!). - - *α* Enable Smooth Braking - - DeclinePage @@ -1216,6 +1207,18 @@ This may take up to a minute. Select a language Dil seçin + + Choose Software to Install + + + + openpilot + openpilot + + + Custom Software + + SetupWidget diff --git a/selfdrive/ui/translations/main_zh-CHS.qm b/selfdrive/ui/translations/main_zh-CHS.qm index 49d2af22e..b5ee35d8c 100644 Binary files a/selfdrive/ui/translations/main_zh-CHS.qm and b/selfdrive/ui/translations/main_zh-CHS.qm differ diff --git a/selfdrive/ui/translations/main_zh-CHS.ts b/selfdrive/ui/translations/main_zh-CHS.ts index ad02f621e..de531e395 100644 --- a/selfdrive/ui/translations/main_zh-CHS.ts +++ b/selfdrive/ui/translations/main_zh-CHS.ts @@ -87,23 +87,23 @@ Hidden Network - + 隐藏的网络 CONNECT - CONNECT + 连线 Enter SSID - 输入SSID + 输入 SSID Enter password - 输入密码 + 输入密码 for "%1" - 网络名称:"%1" + 网络名称:"%1" @@ -460,11 +460,6 @@ Activate only when speed belows 27 km/h. Credit to krkeegen: https://github.com/krkeegan/ - - When enabled, Smoother Braking Behind Lead More natural braking behavior when coming up to a slower vehicle. -Credit to FrogaAi: https://github.com/FrogAi/FrogPilot/ - - On-Screen Personality Button @@ -557,10 +552,6 @@ Reboot Required. When enabled, openpilot automatically lane change when possible(WARNING: USE IT AT YOUR OWN RISK!!!!). - - *α* Enable Smooth Braking - - DeclinePage @@ -1102,7 +1093,7 @@ This may take up to a minute. System reset triggered. Press confirm to erase all content and settings. Press cancel to resume boot. - + 系统重置已触发。按下“确认”以清除所有内容和设置,按下“取消”以继续启动。 @@ -1218,6 +1209,18 @@ This may take up to a minute. Select a language 选择语言 + + Choose Software to Install + 选择要安装的软件 + + + openpilot + openpilot + + + Custom Software + 定制软件 + SetupWidget diff --git a/selfdrive/ui/translations/main_zh-CHT.qm b/selfdrive/ui/translations/main_zh-CHT.qm index 98042358c..2038e27c8 100644 Binary files a/selfdrive/ui/translations/main_zh-CHT.qm and b/selfdrive/ui/translations/main_zh-CHT.qm differ diff --git a/selfdrive/ui/translations/main_zh-CHT.ts b/selfdrive/ui/translations/main_zh-CHT.ts index bec7f399f..af1a9c49a 100644 --- a/selfdrive/ui/translations/main_zh-CHT.ts +++ b/selfdrive/ui/translations/main_zh-CHT.ts @@ -87,23 +87,23 @@ Hidden Network - + 隱藏的網路 CONNECT - 雲端服務 + 連線 Enter SSID - 輸入 SSID + 輸入 SSID Enter password - 輸入密碼 + 輸入密碼 for "%1" - 給 "%1" + 給 "%1" @@ -587,11 +587,6 @@ Reboot Required. Reset 重設 - - When enabled, Smoother Braking Behind Lead More natural braking behavior when coming up to a slower vehicle. -Credit to FrogaAi: https://github.com/FrogAi/FrogPilot/ - - Display Tesla-style Rainbow Path @@ -619,10 +614,6 @@ Reboot Required. When enabled, openpilot automatically lane change when possible(WARNING: USE IT AT YOUR OWN RISK!!!!). - - *α* Enable Smooth Braking - - DeclinePage @@ -1172,7 +1163,7 @@ This may take up to a minute. System reset triggered. Press confirm to erase all content and settings. Press cancel to resume boot. - + 系統重設已啟動。按下「確認」以清除所有內容和設定,或按下「取消」以繼續開機。 @@ -1288,6 +1279,18 @@ This may take up to a minute. Select a language 選擇語言 + + Choose Software to Install + 選擇要安裝的軟體 + + + openpilot + openpilot + + + Custom Software + 自訂軟體 + SetupWidget diff --git a/selfdrive/ui/ui b/selfdrive/ui/ui index e53dafbcb..c6eae3126 100755 Binary files a/selfdrive/ui/ui and b/selfdrive/ui/ui differ diff --git a/selfdrive/ui/update_translations.py b/selfdrive/ui/update_translations.py index e988a13b7..0fe0f05ac 100755 --- a/selfdrive/ui/update_translations.py +++ b/selfdrive/ui/update_translations.py @@ -28,7 +28,7 @@ def update_translations(vanish: bool = False, translation_files: None | list[str generate_translations_include() if translation_files is None: - with open(LANGUAGES_FILE, "r") as f: + with open(LANGUAGES_FILE) as f: translation_files = json.load(f).values() for file in translation_files: diff --git a/selfdrive/updated.py b/selfdrive/updated/updated.py similarity index 98% rename from selfdrive/updated.py rename to selfdrive/updated/updated.py index b410555f4..2947aa96b 100755 --- a/selfdrive/updated.py +++ b/selfdrive/updated/updated.py @@ -11,7 +11,6 @@ import time import threading from collections import defaultdict from pathlib import Path -from typing import List, Union, Optional from markdown_it import MarkdownIt from openpilot.common.basedir import BASEDIR @@ -64,7 +63,7 @@ def write_time_to_param(params, param) -> None: t = datetime.datetime.utcnow() params.put(param, t.isoformat().encode('utf8')) -def read_time_from_param(params, param) -> Optional[datetime.datetime]: +def read_time_from_param(params, param) -> datetime.datetime | None: t = params.get(param, encoding='utf8') try: return datetime.datetime.fromisoformat(t) @@ -72,7 +71,7 @@ def read_time_from_param(params, param) -> Optional[datetime.datetime]: pass return None -def run(cmd: List[str], cwd: Optional[str] = None) -> str: +def run(cmd: list[str], cwd: str = None) -> str: return subprocess.check_output(cmd, cwd=cwd, stderr=subprocess.STDOUT, encoding='utf8') @@ -234,7 +233,7 @@ def handle_agnos_update() -> None: class Updater: def __init__(self): self.params = Params() - self.branches = defaultdict(lambda: '') + self.branches = defaultdict(str) self._has_internet: bool = False @property @@ -243,7 +242,7 @@ class Updater: @property def target_branch(self) -> str: - b: Union[str, None] = self.params.get("UpdaterTargetBranch", encoding='utf-8') + b: str | None = self.params.get("UpdaterTargetBranch", encoding='utf-8') if b is None: b = self.get_branch(BASEDIR) return b @@ -272,7 +271,7 @@ class Updater: def get_commit_hash(self, path: str = OVERLAY_MERGED) -> str: return run(["git", "rev-parse", "HEAD"], path).rstrip() - def set_params(self, update_success: bool, failed_count: int, exception: Optional[str]) -> None: + def set_params(self, update_success: bool, failed_count: int, exception: str | None) -> None: self.params.put("UpdateFailedCount", str(failed_count)) self.params.put("UpdaterTargetBranch", self.target_branch) diff --git a/system/camerad/camerad b/system/camerad/camerad index 40234f086..50849dcc9 100755 Binary files a/system/camerad/camerad and b/system/camerad/camerad differ diff --git a/system/hardware/base.py b/system/hardware/base.py index 9c7a61833..6cdb4a4d6 100644 --- a/system/hardware/base.py +++ b/system/hardware/base.py @@ -1,16 +1,15 @@ from abc import abstractmethod, ABC from collections import namedtuple -from typing import Dict from cereal import log -ThermalConfig = namedtuple('ThermalConfig', ['cpu', 'gpu', 'mem', 'bat', 'ambient', 'pmic']) +ThermalConfig = namedtuple('ThermalConfig', ['cpu', 'gpu', 'mem', 'bat', 'pmic']) NetworkType = log.DeviceState.NetworkType class HardwareBase(ABC): @staticmethod - def get_cmdline() -> Dict[str, str]: + def get_cmdline() -> dict[str, str]: with open('/proc/cmdline') as f: cmdline = f.read() return {kv[0]: kv[1] for kv in [s.split('=') for s in cmdline.split(' ')] if len(kv) == 2} diff --git a/system/hardware/pc/hardware.py b/system/hardware/pc/hardware.py index 4c2c104f9..719e272ae 100644 --- a/system/hardware/pc/hardware.py +++ b/system/hardware/pc/hardware.py @@ -57,7 +57,7 @@ class Pc(HardwareBase): print("SHUTDOWN!") def get_thermal_config(self): - return ThermalConfig(cpu=((None,), 1), gpu=((None,), 1), mem=(None, 1), bat=(None, 1), ambient=(None, 1), pmic=((None,), 1)) + return ThermalConfig(cpu=((None,), 1), gpu=((None,), 1), mem=(None, 1), bat=(None, 1), pmic=((None,), 1)) def set_screen_brightness(self, percentage): pass diff --git a/system/hardware/tici/agnos.json b/system/hardware/tici/agnos.json index b4408d214..e69842cfe 100644 --- a/system/hardware/tici/agnos.json +++ b/system/hardware/tici/agnos.json @@ -61,17 +61,17 @@ }, { "name": "system", - "url": "https://commadist.azureedge.net/agnosupdate/system-3bfb0f3a6bf677bdc8a6227f49ce3258025e1886dc81533e3fbacb356b5601db.img.xz", - "hash": "10ac02f18c5f1cde5a888a3411d3701b929c3488753467e77aad6085db058eb9", - "hash_raw": "3bfb0f3a6bf677bdc8a6227f49ce3258025e1886dc81533e3fbacb356b5601db", + "url": "https://commadist.azureedge.net/agnosupdate/system-0f69173d5f3058f7197c139442a6556be59e52f15402a263215a329ba5ec41e2.img.xz", + "hash": "4858385ba6284bcaa179ab77ac4263486e4d8670df921e4ac400464dc1dde59c", + "hash_raw": "0f69173d5f3058f7197c139442a6556be59e52f15402a263215a329ba5ec41e2", "size": 10737418240, "sparse": true, "full_check": false, "has_ab": true, "alt": { - "hash": "a7db41b93b587f8f9c3f83a3313f186445c4bdf07283cd6a5421dfbc0286c9db", - "url": "https://commadist.azureedge.net/agnosupdate/system-skip-chunks-3bfb0f3a6bf677bdc8a6227f49ce3258025e1886dc81533e3fbacb356b5601db.img.xz", - "size": 4548131508 + "hash": "42658a6fff660d9b6abb9cb9fbb3481071259c9a9598718af6b1edff2b556009", + "url": "https://commadist.azureedge.net/agnosupdate/system-skip-chunks-0f69173d5f3058f7197c139442a6556be59e52f15402a263215a329ba5ec41e2.img.xz", + "size": 4548292756 } } ] \ No newline at end of file diff --git a/system/hardware/tici/agnos.py b/system/hardware/tici/agnos.py index ef7d9adb7..502295be0 100755 --- a/system/hardware/tici/agnos.py +++ b/system/hardware/tici/agnos.py @@ -6,7 +6,7 @@ import os import struct import subprocess import time -from typing import Dict, Generator, List, Tuple, Union +from collections.abc import Generator import requests @@ -20,7 +20,7 @@ class StreamingDecompressor: def __init__(self, url: str) -> None: self.buf = b"" - self.req = requests.get(url, stream=True, headers={'Accept-Encoding': None}, timeout=60) # type: ignore + self.req = requests.get(url, stream=True, headers={'Accept-Encoding': None}, timeout=60) self.it = self.req.iter_content(chunk_size=1024 * 1024) self.decompressor = lzma.LZMADecompressor(format=lzma.FORMAT_AUTO) self.eof = False @@ -117,7 +117,7 @@ def get_raw_hash(path: str, partition_size: int) -> str: return raw_hash.hexdigest().lower() -def verify_partition(target_slot_number: int, partition: Dict[str, Union[str, int]], force_full_check: bool = False) -> bool: +def verify_partition(target_slot_number: int, partition: dict[str, str | int], force_full_check: bool = False) -> bool: full_check = partition['full_check'] or force_full_check path = get_partition_path(target_slot_number, partition) @@ -184,7 +184,7 @@ def extract_casync_image(target_slot_number: int, partition: dict, cloudlog): target = casync.parse_caibx(partition['casync_caibx']) - sources: List[Tuple[str, casync.ChunkReader, casync.ChunkDict]] = [] + sources: list[tuple[str, casync.ChunkReader, casync.ChunkDict]] = [] # First source is the current partition. try: diff --git a/system/hardware/tici/amplifier.py b/system/hardware/tici/amplifier.py index e003f131c..af8206746 100755 --- a/system/hardware/tici/amplifier.py +++ b/system/hardware/tici/amplifier.py @@ -2,7 +2,6 @@ import time from smbus2 import SMBus from collections import namedtuple -from typing import List # https://datasheets.maximintegrated.com/en/ds/MAX98089.pdf @@ -110,7 +109,7 @@ class Amplifier: def _get_shutdown_config(self, amp_disabled: bool) -> AmpConfig: return AmpConfig("Global shutdown", 0b0 if amp_disabled else 0b1, 0x51, 7, 0b10000000) - def _set_configs(self, configs: List[AmpConfig]) -> None: + def _set_configs(self, configs: list[AmpConfig]) -> None: with SMBus(self.AMP_I2C_BUS) as bus: for config in configs: if self.debug: @@ -123,7 +122,7 @@ class Amplifier: if self.debug: print(f" Changed {hex(config.register)}: {hex(old_value)} -> {hex(new_value)}") - def set_configs(self, configs: List[AmpConfig]) -> bool: + def set_configs(self, configs: list[AmpConfig]) -> bool: # retry in case panda is using the amp tries = 15 for i in range(15): diff --git a/system/hardware/tici/casync.py b/system/hardware/tici/casync.py index 993336616..986228c1c 100755 --- a/system/hardware/tici/casync.py +++ b/system/hardware/tici/casync.py @@ -7,7 +7,7 @@ import sys import time from abc import ABC, abstractmethod from collections import defaultdict, namedtuple -from typing import Callable, Dict, List, Optional, Tuple +from collections.abc import Callable import requests from Crypto.Hash import SHA512 @@ -28,7 +28,7 @@ CHUNK_DOWNLOAD_RETRIES = 3 CAIBX_DOWNLOAD_TIMEOUT = 120 Chunk = namedtuple('Chunk', ['sha', 'offset', 'length']) -ChunkDict = Dict[bytes, Chunk] +ChunkDict = dict[bytes, Chunk] class ChunkReader(ABC): @@ -83,7 +83,7 @@ class RemoteChunkReader(ChunkReader): return decompressor.decompress(contents) -def parse_caibx(caibx_path: str) -> List[Chunk]: +def parse_caibx(caibx_path: str) -> list[Chunk]: """Parses the chunks from a caibx file. Can handle both local and remote files. Returns a list of chunks with hash, offset and length""" caibx: io.BufferedIOBase @@ -132,7 +132,7 @@ def parse_caibx(caibx_path: str) -> List[Chunk]: return chunks -def build_chunk_dict(chunks: List[Chunk]) -> ChunkDict: +def build_chunk_dict(chunks: list[Chunk]) -> ChunkDict: """Turn a list of chunks into a dict for faster lookups based on hash. Keep first chunk since it's more likely to be already downloaded.""" r = {} @@ -142,11 +142,11 @@ def build_chunk_dict(chunks: List[Chunk]) -> ChunkDict: return r -def extract(target: List[Chunk], - sources: List[Tuple[str, ChunkReader, ChunkDict]], +def extract(target: list[Chunk], + sources: list[tuple[str, ChunkReader, ChunkDict]], out_path: str, - progress: Optional[Callable[[int], None]] = None): - stats: Dict[str, int] = defaultdict(int) + progress: Callable[[int], None] = None): + stats: dict[str, int] = defaultdict(int) mode = 'rb+' if os.path.exists(out_path) else 'wb' with open(out_path, mode) as out: @@ -181,7 +181,7 @@ def extract(target: List[Chunk], return stats -def print_stats(stats: Dict[str, int]): +def print_stats(stats: dict[str, int]): total_bytes = sum(stats.values()) print(f"Total size: {total_bytes / 1024 / 1024:.2f} MB") for name, total in stats.items(): diff --git a/system/hardware/tici/hardware.h b/system/hardware/tici/hardware.h index f6ea86b00..f1d1f1e71 100644 --- a/system/hardware/tici/hardware.h +++ b/system/hardware/tici/hardware.h @@ -20,12 +20,12 @@ public: } static std::string get_name() { - std::string devicetree_model = util::read_file("/sys/firmware/devicetree/base/model"); - return (devicetree_model.find("tizi") != std::string::npos) ? "tizi" : "tici"; + std::string model = util::read_file("/sys/firmware/devicetree/base/model"); + return model.substr(std::string("comma ").size()); } static cereal::InitData::DeviceType get_device_type() { - return (get_name() == "tizi") ? cereal::InitData::DeviceType::TIZI : cereal::InitData::DeviceType::TICI; + return (get_name() == "tizi") ? cereal::InitData::DeviceType::TIZI : (get_name() == "mici" ? cereal::InitData::DeviceType::MICI : cereal::InitData::DeviceType::TICI); } static int get_voltage() { return std::atoi(util::read_file("/sys/class/hwmon/hwmon1/in1_input").c_str()); } @@ -72,6 +72,7 @@ public: std::map ret = { {"/BUILD", util::read_file("/BUILD")}, {"lsblk", util::check_output("lsblk -o NAME,SIZE,STATE,VENDOR,MODEL,REV,SERIAL")}, + {"SOM ID", util::read_file("/sys/devices/platform/vendor/vendor:gpio-som-id/som_id")}, }; std::string bs = util::check_output("abctl --boot_slot"); diff --git a/system/hardware/tici/hardware.py b/system/hardware/tici/hardware.py index f60642202..c1cb9da43 100644 --- a/system/hardware/tici/hardware.py +++ b/system/hardware/tici/hardware.py @@ -94,11 +94,7 @@ def get_device_type(): # lru_cache and cache can cause memory leaks when used in classes with open("/sys/firmware/devicetree/base/model") as f: model = f.read().strip('\x00') - model = model.split('comma ')[-1] - # TODO: remove this with AGNOS 7+ - if model.startswith('Qualcomm'): - model = 'tici' - return model + return model.split('comma ')[-1] class Tici(HardwareBase): @cached_property @@ -116,6 +112,8 @@ class Tici(HardwareBase): @cached_property def amplifier(self): + if self.get_device_type() == "mici": + return None return Amplifier() def get_os_version(self): @@ -349,7 +347,6 @@ class Tici(HardwareBase): gpu=(("gpu0-usr", "gpu1-usr"), 1000), mem=("ddr-usr", 1000), bat=(None, 1), - ambient=("xo-therm-adc", 1000), pmic=(("pm8998_tz", "pm8005_tz"), 1000)) def set_screen_brightness(self, percentage): @@ -375,9 +372,10 @@ class Tici(HardwareBase): def set_power_save(self, powersave_enabled): # amplifier, 100mW at idle - self.amplifier.set_global_shutdown(amp_disabled=powersave_enabled) - if not powersave_enabled: - self.amplifier.initialize_configuration(self.get_device_type()) + if self.amplifier is not None: + self.amplifier.set_global_shutdown(amp_disabled=powersave_enabled) + if not powersave_enabled: + self.amplifier.initialize_configuration(self.get_device_type()) # *** CPU config *** @@ -415,7 +413,8 @@ class Tici(HardwareBase): return 0 def initialize_hardware(self): - self.amplifier.initialize_configuration(self.get_device_type()) + if self.amplifier is not None: + self.amplifier.initialize_configuration(self.get_device_type()) # Allow thermald to write engagement status to kmsg os.system("sudo chmod a+w /dev/kmsg") @@ -479,6 +478,12 @@ class Tici(HardwareBase): 'AT+QNVFW="/nv/item_files/ims/IMS_enable",00', 'AT+QNVFW="/nv/item_files/modem/mmode/ue_usage_setting",01', ] + if self.get_device_type() == "tizi": + cmds += [ + # SIM hot swap + 'AT+QSIMDET=1,0', + 'AT+QSIMSTAT=1', + ] # clear out old blue prime initial APN os.system('mmcli -m any --3gpp-set-initial-eps-bearer-settings="apn="') diff --git a/system/logcatd/logcatd b/system/logcatd/logcatd index 7f9549803..234d56f35 100755 Binary files a/system/logcatd/logcatd and b/system/logcatd/logcatd differ diff --git a/system/loggerd/bootlog b/system/loggerd/bootlog index 31217e7a8..c07d70c69 100755 Binary files a/system/loggerd/bootlog and b/system/loggerd/bootlog differ diff --git a/system/loggerd/deleter.py b/system/loggerd/deleter.py index 868340150..2f0b96c90 100755 --- a/system/loggerd/deleter.py +++ b/system/loggerd/deleter.py @@ -2,7 +2,6 @@ import os import shutil import threading -from typing import List from openpilot.system.hardware.hw import Paths from openpilot.common.swaglog import cloudlog from openpilot.system.loggerd.config import get_available_bytes, get_available_percent @@ -23,7 +22,7 @@ def has_preserve_xattr(d: str) -> bool: return getxattr(os.path.join(Paths.log_root(), d), PRESERVE_ATTR_NAME) == PRESERVE_ATTR_VALUE -def get_preserved_segments(dirs_by_creation: List[str]) -> List[str]: +def get_preserved_segments(dirs_by_creation: list[str]) -> list[str]: preserved = [] for n, d in enumerate(filter(has_preserve_xattr, reversed(dirs_by_creation))): if n == PRESERVE_COUNT: diff --git a/system/loggerd/encoderd b/system/loggerd/encoderd index 38a9f2c21..e2c01869a 100755 Binary files a/system/loggerd/encoderd and b/system/loggerd/encoderd differ diff --git a/system/loggerd/loggerd b/system/loggerd/loggerd index e7e64540e..535742157 100755 Binary files a/system/loggerd/loggerd and b/system/loggerd/loggerd differ diff --git a/system/loggerd/uploader.py b/system/loggerd/uploader.py index 105e830a4..33ee8c185 100755 --- a/system/loggerd/uploader.py +++ b/system/loggerd/uploader.py @@ -9,7 +9,8 @@ import threading import time import traceback import datetime -from typing import BinaryIO, Iterator, List, Optional, Tuple +from typing import BinaryIO +from collections.abc import Iterator from cereal import log import cereal.messaging as messaging @@ -42,10 +43,10 @@ class FakeResponse: self.request = FakeRequest() -def get_directory_sort(d: str) -> List[str]: +def get_directory_sort(d: str) -> list[str]: return [s.rjust(10, '0') for s in d.rsplit('--', 1)] -def listdir_by_creation(d: str) -> List[str]: +def listdir_by_creation(d: str) -> list[str]: if not os.path.isdir(d): return [] @@ -82,7 +83,7 @@ class Uploader: self.immediate_folders = ["crash/", "boot/"] self.immediate_priority = {"qlog": 0, "qlog.bz2": 0, "qcamera.ts": 1} - def list_upload_files(self, metered: bool) -> Iterator[Tuple[str, str, str]]: + def list_upload_files(self, metered: bool) -> Iterator[tuple[str, str, str]]: r = self.params.get("AthenadRecentlyViewedRoutes", encoding="utf8") requested_routes = [] if r is None else r.split(",") @@ -121,7 +122,7 @@ class Uploader: yield name, key, fn - def next_file_to_upload(self, metered: bool) -> Optional[Tuple[str, str, str]]: + def next_file_to_upload(self, metered: bool) -> tuple[str, str, str] | None: upload_files = list(self.list_upload_files(metered)) for name, key, fn in upload_files: @@ -207,10 +208,10 @@ class Uploader: return success - def step(self, network_type: int, metered: bool) -> bool: + def step(self, network_type: int, metered: bool) -> bool | None: d = self.next_file_to_upload(metered) if d is None: - return True + return None name, key, fn = d @@ -221,7 +222,7 @@ class Uploader: return self.upload(name, key, fn, network_type, metered) -def main(exit_event: Optional[threading.Event] = None) -> None: +def main(exit_event: threading.Event = None) -> None: if exit_event is None: exit_event = threading.Event() @@ -253,12 +254,15 @@ def main(exit_event: Optional[threading.Event] = None) -> None: continue success = uploader.step(sm['deviceState'].networkType.raw, sm['deviceState'].networkMetered) - if success: + if success is None: + backoff = 60 if offroad else 5 + elif success: backoff = 0.1 - elif allow_sleep: + else: cloudlog.info("upload backoff %r", backoff) backoff = min(backoff*2, 120) - time.sleep(backoff + random.uniform(0, backoff)) + if allow_sleep: + time.sleep(backoff + random.uniform(0, backoff)) if __name__ == "__main__": diff --git a/system/loggerd/xattr_cache.py b/system/loggerd/xattr_cache.py index 5feeff34d..d3220118a 100644 --- a/system/loggerd/xattr_cache.py +++ b/system/loggerd/xattr_cache.py @@ -1,10 +1,9 @@ import os import errno -from typing import Dict, Optional, Tuple -_cached_attributes: Dict[Tuple, Optional[bytes]] = {} +_cached_attributes: dict[tuple, bytes | None] = {} -def getxattr(path: str, attr_name: str) -> Optional[bytes]: +def getxattr(path: str, attr_name: str) -> bytes | None: key = (path, attr_name) if key not in _cached_attributes: try: diff --git a/system/proclogd/proclogd b/system/proclogd/proclogd index 74025659e..8b03a7f42 100755 Binary files a/system/proclogd/proclogd and b/system/proclogd/proclogd differ diff --git a/system/qcomgpsd/nmeaport.py b/system/qcomgpsd/nmeaport.py index 231096fc5..caff7af64 100644 --- a/system/qcomgpsd/nmeaport.py +++ b/system/qcomgpsd/nmeaport.py @@ -93,7 +93,7 @@ def nmea_checksum_ok(s): def process_nmea_port_messages(device:str="/dev/ttyUSB1") -> NoReturn: while True: try: - with open(device, "r") as nmeaport: + with open(device) as nmeaport: for line in nmeaport: line = line.strip() if DEBUG: diff --git a/system/qcomgpsd/qcomgpsd.py b/system/qcomgpsd/qcomgpsd.py index 3f7235023..e8c407a62 100755 --- a/system/qcomgpsd/qcomgpsd.py +++ b/system/qcomgpsd/qcomgpsd.py @@ -10,7 +10,7 @@ import shutil import subprocess import datetime from multiprocessing import Process, Event -from typing import NoReturn, Optional +from typing import NoReturn from struct import unpack_from, calcsize, pack from cereal import log @@ -90,15 +90,11 @@ def try_setup_logs(diag, logs): return setup_logs(diag, logs) @retry(attempts=3, delay=1.0) -def at_cmd(cmd: str) -> Optional[str]: +def at_cmd(cmd: str) -> str | None: return subprocess.check_output(f"mmcli -m any --timeout 30 --command='{cmd}'", shell=True, encoding='utf8') def gps_enabled() -> bool: - try: - p = subprocess.check_output("mmcli -m any --command=\"AT+QGPS?\"", shell=True) - return b"QGPS: 1" in p - except subprocess.CalledProcessError as exc: - raise Exception("failed to execute QGPS mmcli command") from exc + return "QGPS: 1" in at_cmd("AT+QGPS?") def download_assistance(): try: @@ -346,7 +342,7 @@ def main() -> NoReturn: gps.bearingDeg = report["q_FltHeadingRad"] * 180/math.pi # TODO needs update if there is another leap second, after june 2024? - dt_timestamp = (datetime.datetime(1980, 1, 6, 0, 0, 0, 0, datetime.timezone.utc) + + dt_timestamp = (datetime.datetime(1980, 1, 6, 0, 0, 0, 0, datetime.UTC) + datetime.timedelta(weeks=report['w_GpsWeekNumber']) + datetime.timedelta(seconds=(1e-3*report['q_GpsFixTimeMs'] - 18))) gps.unixTimestampMillis = dt_timestamp.timestamp()*1e3 diff --git a/system/qcomgpsd/tests/test_qcomgpsd.py b/system/qcomgpsd/tests/test_qcomgpsd.py index 8291f2cc3..6c93f7dd9 100755 --- a/system/qcomgpsd/tests/test_qcomgpsd.py +++ b/system/qcomgpsd/tests/test_qcomgpsd.py @@ -68,13 +68,14 @@ class TestRawgpsd(unittest.TestCase): def test_turns_off_gnss(self): for s in (0.1, 1, 5): - managed_processes['qcomgpsd'].start() - time.sleep(s) - managed_processes['qcomgpsd'].stop() + with self.subTest(runtime=s): + managed_processes['qcomgpsd'].start() + time.sleep(s) + managed_processes['qcomgpsd'].stop() - ls = subprocess.check_output("mmcli -m any --location-status --output-json", shell=True, encoding='utf-8') - loc_status = json.loads(ls) - assert set(loc_status['modem']['location']['enabled']) <= {'3gpp-lac-ci'} + ls = subprocess.check_output("mmcli -m any --location-status --output-json", shell=True, encoding='utf-8') + loc_status = json.loads(ls) + assert set(loc_status['modem']['location']['enabled']) <= {'3gpp-lac-ci'} def check_assistance(self, should_be_loaded): diff --git a/system/sensord/pigeond.py b/system/sensord/pigeond.py index 78b3b0749..21b3a86f9 100755 --- a/system/sensord/pigeond.py +++ b/system/sensord/pigeond.py @@ -7,7 +7,6 @@ import struct import requests import urllib.parse from datetime import datetime -from typing import List, Optional, Tuple from cereal import messaging from openpilot.common.params import Params @@ -41,7 +40,7 @@ def add_ubx_checksum(msg: bytes) -> bytes: B = (B + A) % 256 return msg + bytes([A, B]) -def get_assistnow_messages(token: bytes) -> List[bytes]: +def get_assistnow_messages(token: bytes) -> list[bytes]: # make request # TODO: implement adding the last known location r = requests.get("https://online-live2.services.u-blox.com/GetOnlineData.ashx", params=urllib.parse.urlencode({ @@ -238,7 +237,7 @@ def initialize_pigeon(pigeon: TTYPigeon) -> bool: return False return True -def deinitialize_and_exit(pigeon: Optional[TTYPigeon]): +def deinitialize_and_exit(pigeon: TTYPigeon | None): cloudlog.warning("Storing almanac in ublox flash") if pigeon is not None: @@ -259,7 +258,7 @@ def deinitialize_and_exit(pigeon: Optional[TTYPigeon]): set_power(False) sys.exit(0) -def create_pigeon() -> Tuple[TTYPigeon, messaging.PubMaster]: +def create_pigeon() -> tuple[TTYPigeon, messaging.PubMaster]: pigeon = None # register exit handler diff --git a/system/sensord/sensord b/system/sensord/sensord index 26c9a14bf..7b8d0cf77 100755 Binary files a/system/sensord/sensord and b/system/sensord/sensord differ diff --git a/system/timed.py b/system/timed.py index 21fb47b68..39acb2ba1 100755 --- a/system/timed.py +++ b/system/timed.py @@ -65,10 +65,15 @@ def main() -> NoReturn: cloudlog.debug("Restoring timezone from param") set_timezone(tz) + pm = messaging.PubMaster(['clocks']) sm = messaging.SubMaster(['liveLocationKalman']) while True: sm.update(1000) + msg = messaging.new_message('clocks', valid=True) + msg.clocks.wallTimeNanos = time.time_ns() + pm.send('clocks', msg) + llk = sm['liveLocationKalman'] if not llk.gpsOK or (time.monotonic() - sm.logMonoTime['liveLocationKalman']/1e9) > 0.2: continue diff --git a/system/ubloxd/ubloxd b/system/ubloxd/ubloxd index 6630dfc60..506ed3e9e 100755 Binary files a/system/ubloxd/ubloxd and b/system/ubloxd/ubloxd differ diff --git a/system/version.py b/system/version.py index 980a4fcc7..4319ef214 100755 --- a/system/version.py +++ b/system/version.py @@ -1,7 +1,8 @@ #!/usr/bin/env python3 import os import subprocess -from typing import List, Optional, Callable, TypeVar +from typing import TypeVar +from collections.abc import Callable from functools import lru_cache from openpilot.common.basedir import BASEDIR @@ -18,11 +19,11 @@ def cache(user_function: Callable[..., _RT], /) -> Callable[..., _RT]: return lru_cache(maxsize=None)(user_function) -def run_cmd(cmd: List[str]) -> str: +def run_cmd(cmd: list[str]) -> str: return subprocess.check_output(cmd, encoding='utf8').strip() -def run_cmd_default(cmd: List[str], default: Optional[str] = None) -> Optional[str]: +def run_cmd_default(cmd: list[str], default: str = "") -> str: try: return run_cmd(cmd) except subprocess.CalledProcessError: @@ -31,17 +32,22 @@ def run_cmd_default(cmd: List[str], default: Optional[str] = None) -> Optional[s @cache def get_commit(branch: str = "HEAD") -> str: - return run_cmd_default(["git", "rev-parse", branch]) or "" + return run_cmd_default(["git", "rev-parse", branch]) + + +@cache +def get_commit_date(commit: str = "HEAD") -> str: + return run_cmd_default(["git", "show", "--no-patch", "--format='%ct %ci'", commit]) @cache def get_short_branch() -> str: - return run_cmd_default(["git", "rev-parse", "--abbrev-ref", "HEAD"]) or "" + return run_cmd_default(["git", "rev-parse", "--abbrev-ref", "HEAD"]) @cache def get_branch() -> str: - return run_cmd_default(["git", "rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"]) or "" + return run_cmd_default(["git", "rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"]) @cache @@ -51,7 +57,7 @@ def get_origin() -> str: tracking_remote = run_cmd(["git", "config", "branch." + local_branch + ".remote"]) return run_cmd(["git", "config", "remote." + tracking_remote + ".url"]) except subprocess.CalledProcessError: # Not on a branch, fallback - return run_cmd_default(["git", "config", "--get", "remote.origin.url"]) or "" + return run_cmd_default(["git", "config", "--get", "remote.origin.url"]) @cache @@ -132,3 +138,4 @@ if __name__ == "__main__": print(f"Branch: {get_branch()}") print(f"Short branch: {get_short_branch()}") print(f"Prebuilt: {is_prebuilt()}") + print(f"Commit date: {get_commit_date()}") diff --git a/system/webrtc/device/audio.py b/system/webrtc/device/audio.py index 3c78be675..4b22033e0 100644 --- a/system/webrtc/device/audio.py +++ b/system/webrtc/device/audio.py @@ -1,6 +1,5 @@ import asyncio import io -from typing import Optional, List, Tuple import aiortc import av @@ -17,7 +16,7 @@ class AudioInputStreamTrack(aiortc.mediastreams.AudioStreamTrack): pyaudio.paFloat32: 'flt', } - def __init__(self, audio_format: int = pyaudio.paInt16, rate: int = 16000, channels: int = 1, packet_time: float = 0.020, device_index: Optional[int] = None): + def __init__(self, audio_format: int = pyaudio.paInt16, rate: int = 16000, channels: int = 1, packet_time: float = 0.020, device_index: int = None): super().__init__() self.p = pyaudio.PyAudio() @@ -49,7 +48,7 @@ class AudioInputStreamTrack(aiortc.mediastreams.AudioStreamTrack): class AudioOutputSpeaker: - def __init__(self, audio_format: int = pyaudio.paInt16, rate: int = 48000, channels: int = 2, packet_time: float = 0.2, device_index: Optional[int] = None): + def __init__(self, audio_format: int = pyaudio.paInt16, rate: int = 48000, channels: int = 2, packet_time: float = 0.2, device_index: int = None): chunk_size = int(packet_time * rate) self.p = pyaudio.PyAudio() @@ -62,7 +61,7 @@ class AudioOutputSpeaker: output=True, output_device_index=device_index, stream_callback=self.__pyaudio_callback) - self.tracks_and_tasks: List[Tuple[aiortc.MediaStreamTrack, Optional[asyncio.Task]]] = [] + self.tracks_and_tasks: list[tuple[aiortc.MediaStreamTrack, asyncio.Task | None]] = [] def __pyaudio_callback(self, in_data, frame_count, time_info, status): if self.buffer.getbuffer().nbytes < frame_count * self.channels * 2: diff --git a/system/webrtc/device/video.py b/system/webrtc/device/video.py index 314f81283..1bca90929 100644 --- a/system/webrtc/device/video.py +++ b/system/webrtc/device/video.py @@ -1,5 +1,4 @@ import asyncio -from typing import Optional import av from teleoprtc.tracks import TiciVideoStreamTrack @@ -40,5 +39,5 @@ class LiveStreamVideoStreamTrack(TiciVideoStreamTrack): return packet - def codec_preference(self) -> Optional[str]: + def codec_preference(self) -> str | None: return "H264" diff --git a/system/webrtc/schema.py b/system/webrtc/schema.py index f659b3429..d80986ebf 100644 --- a/system/webrtc/schema.py +++ b/system/webrtc/schema.py @@ -1,8 +1,8 @@ import capnp -from typing import Union, List, Dict, Any +from typing import Any -def generate_type(type_walker, schema_walker) -> Union[str, List[Any], Dict[str, Any]]: +def generate_type(type_walker, schema_walker) -> str | list[Any] | dict[str, Any]: data_type = next(type_walker) if data_type.which() == 'struct': return generate_struct(next(schema_walker)) @@ -15,11 +15,11 @@ def generate_type(type_walker, schema_walker) -> Union[str, List[Any], Dict[str, return str(data_type.which()) -def generate_struct(schema: capnp.lib.capnp._StructSchema) -> Dict[str, Any]: +def generate_struct(schema: capnp.lib.capnp._StructSchema) -> dict[str, Any]: return {field: generate_field(schema.fields[field]) for field in schema.fields if not field.endswith("DEPRECATED")} -def generate_field(field: capnp.lib.capnp._StructSchemaField) -> Union[str, List[Any], Dict[str, Any]]: +def generate_field(field: capnp.lib.capnp._StructSchemaField) -> str | list[Any] | dict[str, Any]: def schema_walker(field): yield field.schema diff --git a/system/webrtc/webrtcd.py b/system/webrtc/webrtcd.py index cc26d50da..95c8ae337 100755 --- a/system/webrtc/webrtcd.py +++ b/system/webrtc/webrtcd.py @@ -6,7 +6,7 @@ import json import uuid import logging from dataclasses import dataclass, field -from typing import Any, List, Optional, Union, TYPE_CHECKING +from typing import Any, TYPE_CHECKING # aiortc and its dependencies have lots of internal warnings :( import warnings @@ -24,7 +24,7 @@ from cereal import messaging, log class CerealOutgoingMessageProxy: def __init__(self, sm: messaging.SubMaster): self.sm = sm - self.channels: List['RTCDataChannel'] = [] + self.channels: list['RTCDataChannel'] = [] def add_channel(self, channel: 'RTCDataChannel'): self.channels.append(channel) @@ -103,7 +103,7 @@ class CerealProxyRunner: class StreamSession: - def __init__(self, sdp: str, cameras: List[str], incoming_services: List[str], outgoing_services: List[str], debug_mode: bool = False): + def __init__(self, sdp: str, cameras: list[str], incoming_services: list[str], outgoing_services: list[str], debug_mode: bool = False): from aiortc.mediastreams import VideoStreamTrack, AudioStreamTrack from aiortc.contrib.media import MediaBlackhole from openpilot.system.webrtc.device.video import LiveStreamVideoStreamTrack @@ -128,12 +128,17 @@ class StreamSession: self.stream = builder.stream() self.identifier = str(uuid.uuid4()) - self.outgoing_bridge = CerealOutgoingMessageProxy(messaging.SubMaster(outgoing_services)) - self.incoming_bridge = CerealIncomingMessageProxy(messaging.PubMaster(incoming_services)) - self.outgoing_bridge_runner = CerealProxyRunner(self.outgoing_bridge) + self.incoming_bridge: CerealIncomingMessageProxy | None = None + self.outgoing_bridge: CerealOutgoingMessageProxy | None = None + self.outgoing_bridge_runner: CerealProxyRunner | None = None + if len(incoming_services) > 0: + self.incoming_bridge = CerealIncomingMessageProxy(messaging.PubMaster(incoming_services)) + if len(outgoing_services) > 0: + self.outgoing_bridge = CerealOutgoingMessageProxy(messaging.SubMaster(outgoing_services)) + self.outgoing_bridge_runner = CerealProxyRunner(self.outgoing_bridge) - self.audio_output: Optional[Union[AudioOutputSpeaker, MediaBlackhole]] = None - self.run_task: Optional[asyncio.Task] = None + self.audio_output: AudioOutputSpeaker | MediaBlackhole | None = None + self.run_task: asyncio.Task | None = None self.logger = logging.getLogger("webrtcd") self.logger.info("New stream session (%s), cameras %s, audio in %s out %s, incoming services %s, outgoing services %s", self.identifier, cameras, config.incoming_audio_track, config.expected_audio_track, incoming_services, outgoing_services) @@ -152,6 +157,7 @@ class StreamSession: return await self.stream.start() async def message_handler(self, message: bytes): + assert self.incoming_bridge is not None try: self.incoming_bridge.send(message) except Exception as ex: @@ -161,10 +167,12 @@ class StreamSession: try: await self.stream.wait_for_connection() if self.stream.has_messaging_channel(): - self.stream.set_message_handler(self.message_handler) - channel = self.stream.get_messaging_channel() - self.outgoing_bridge_runner.proxy.add_channel(channel) - self.outgoing_bridge_runner.start() + if self.incoming_bridge is not None: + self.stream.set_message_handler(self.message_handler) + if self.outgoing_bridge_runner is not None: + channel = self.stream.get_messaging_channel() + self.outgoing_bridge_runner.proxy.add_channel(channel) + self.outgoing_bridge_runner.start() if self.stream.has_incoming_audio_track(): track = self.stream.get_incoming_audio_track(buffered=False) self.audio_output = self.audio_output_cls() @@ -181,7 +189,8 @@ class StreamSession: async def post_run_cleanup(self): await self.stream.stop() - self.outgoing_bridge_runner.stop() + if self.outgoing_bridge is not None: + self.outgoing_bridge_runner.stop() if self.audio_output: self.audio_output.stop() @@ -189,9 +198,9 @@ class StreamSession: @dataclass class StreamRequestBody: sdp: str - cameras: List[str] - bridge_services_in: List[str] = field(default_factory=list) - bridge_services_out: List[str] = field(default_factory=list) + cameras: list[str] + bridge_services_in: list[str] = field(default_factory=list) + bridge_services_out: list[str] = field(default_factory=list) async def get_stream(request: 'web.Request'): diff --git a/teleoprtc/builder.py b/teleoprtc/builder.py index 9ec183e26..f659e8481 100644 --- a/teleoprtc/builder.py +++ b/teleoprtc/builder.py @@ -1,5 +1,4 @@ import abc -from typing import List, Dict import aiortc @@ -16,9 +15,9 @@ class WebRTCStreamBuilder(abc.ABC): class WebRTCOfferBuilder(WebRTCStreamBuilder): def __init__(self, connection_provider: ConnectionProvider): self.connection_provider = connection_provider - self.requested_camera_types: List[str] = [] + self.requested_camera_types: list[str] = [] self.requested_audio = False - self.audio_tracks: List[aiortc.MediaStreamTrack] = [] + self.audio_tracks: list[aiortc.MediaStreamTrack] = [] self.messaging_enabled = False def offer_to_receive_video_stream(self, camera_type: str): @@ -49,9 +48,9 @@ class WebRTCOfferBuilder(WebRTCStreamBuilder): class WebRTCAnswerBuilder(WebRTCStreamBuilder): def __init__(self, offer_sdp: str): self.offer_sdp = offer_sdp - self.video_tracks: Dict[str, aiortc.MediaStreamTrack] = dict() + self.video_tracks: dict[str, aiortc.MediaStreamTrack] = dict() self.requested_audio = False - self.audio_tracks: List[aiortc.MediaStreamTrack] = [] + self.audio_tracks: list[aiortc.MediaStreamTrack] = [] def offer_to_receive_audio_stream(self): self.requested_audio = True diff --git a/teleoprtc/info.py b/teleoprtc/info.py index b47ec3ff1..fb786feda 100644 --- a/teleoprtc/info.py +++ b/teleoprtc/info.py @@ -1,4 +1,3 @@ - import dataclasses import aiortc diff --git a/teleoprtc/stream.py b/teleoprtc/stream.py index a928c1489..035aafc3b 100644 --- a/teleoprtc/stream.py +++ b/teleoprtc/stream.py @@ -2,7 +2,8 @@ import abc import asyncio import dataclasses import logging -from typing import Callable, Awaitable, Dict, List, Any, Optional +from typing import Any +from collections.abc import Callable, Awaitable import aiortc from aiortc.contrib.media import MediaRelay @@ -13,7 +14,7 @@ from teleoprtc.tracks import parse_video_track_id @dataclasses.dataclass class StreamingOffer: sdp: str - video: List[str] + video: list[str] ConnectionProvider = Callable[[StreamingOffer], Awaitable[aiortc.RTCSessionDescription]] @@ -22,25 +23,25 @@ MessageHandler = Callable[[bytes], Awaitable[None]] class WebRTCBaseStream(abc.ABC): def __init__(self, - consumed_camera_types: List[str], + consumed_camera_types: list[str], consume_audio: bool, - video_producer_tracks: List[aiortc.MediaStreamTrack], - audio_producer_tracks: List[aiortc.MediaStreamTrack], + video_producer_tracks: list[aiortc.MediaStreamTrack], + audio_producer_tracks: list[aiortc.MediaStreamTrack], should_add_data_channel: bool): self.peer_connection = aiortc.RTCPeerConnection() self.media_relay = MediaRelay() self.expected_incoming_camera_types = consumed_camera_types self.expected_incoming_audio = consume_audio - self.expected_number_of_incoming_media: Optional[int] = None + self.expected_number_of_incoming_media: int | None = None - self.incoming_camera_tracks: Dict[str, aiortc.MediaStreamTrack] = dict() - self.incoming_audio_tracks: List[aiortc.MediaStreamTrack] = [] - self.outgoing_video_tracks: List[aiortc.MediaStreamTrack] = video_producer_tracks - self.outgoing_audio_tracks: List[aiortc.MediaStreamTrack] = audio_producer_tracks + self.incoming_camera_tracks: dict[str, aiortc.MediaStreamTrack] = dict() + self.incoming_audio_tracks: list[aiortc.MediaStreamTrack] = [] + self.outgoing_video_tracks: list[aiortc.MediaStreamTrack] = video_producer_tracks + self.outgoing_audio_tracks: list[aiortc.MediaStreamTrack] = audio_producer_tracks self.should_add_data_channel = should_add_data_channel - self.messaging_channel: Optional[aiortc.RTCDataChannel] = None - self.incoming_message_handlers: List[MessageHandler] = [] + self.messaging_channel: aiortc.RTCDataChannel | None = None + self.incoming_message_handlers: list[MessageHandler] = [] self.incoming_media_ready_event = asyncio.Event() self.messaging_channel_ready_event = asyncio.Event() @@ -69,7 +70,7 @@ class WebRTCBaseStream(abc.ABC): if self.expected_incoming_audio: self.peer_connection.addTransceiver("audio", direction="recvonly") - def _find_trackless_transceiver(self, kind: str) -> Optional[aiortc.RTCRtpTransceiver]: + def _find_trackless_transceiver(self, kind: str) -> aiortc.RTCRtpTransceiver | None: transceivers = self.peer_connection.getTransceivers() target_transceiver = None for t in transceivers: @@ -96,7 +97,7 @@ class WebRTCBaseStream(abc.ABC): self.peer_connection.addTrack(track) - def _add_messaging_channel(self, channel: Optional[aiortc.RTCDataChannel] = None): + def _add_messaging_channel(self, channel: aiortc.RTCDataChannel | None = None): if not channel: channel = self.peer_connection.createDataChannel("data", ordered=True) @@ -199,7 +200,7 @@ class WebRTCBaseStream(abc.ABC): def is_connected_and_ready(self) -> bool: return self.peer_connection is not None and \ self.peer_connection.connectionState == "connected" and \ - self.expected_number_of_incoming_media != 0 and self.incoming_media_ready_event.is_set() + (self.expected_number_of_incoming_media == 0 or self.incoming_media_ready_event.is_set()) async def wait_for_connection(self): assert self.is_started @@ -212,7 +213,7 @@ class WebRTCBaseStream(abc.ABC): await self.messaging_channel_ready_event.wait() async def wait_for_disconnection(self): - assert self.is_connected_and_ready + assert self.is_connected_and_ready, "Stream is not connected/ready yet (make sure wait_for_connection was awaited)" await self.connection_stopped_event.wait() async def stop(self): @@ -255,7 +256,7 @@ class WebRTCAnswerStream(WebRTCBaseStream): super().__init__(*args, **kwargs) self.session = session - def _probe_video_codecs(self) -> List[str]: + def _probe_video_codecs(self) -> list[str]: codecs = [] for track in self.outgoing_video_tracks: if hasattr(track, "codec_preference") and track.codec_preference() is not None: @@ -263,14 +264,14 @@ class WebRTCAnswerStream(WebRTCBaseStream): return codecs - def _override_incoming_video_codecs(self, remote_sdp: str, codecs: List[str]) -> str: + def _override_incoming_video_codecs(self, remote_sdp: str, codecs: list[str]) -> str: desc = aiortc.sdp.SessionDescription.parse(remote_sdp) codec_mimes = [f"video/{c}" for c in codecs] for m in desc.media: if m.kind != "video": continue - preferred_codecs: List[aiortc.RTCRtpCodecParameters] = [c for c in m.rtp.codecs if c.mimeType in codec_mimes] + preferred_codecs: list[aiortc.RTCRtpCodecParameters] = [c for c in m.rtp.codecs if c.mimeType in codec_mimes] if len(preferred_codecs) == 0: raise ValueError(f"None of {preferred_codecs} codecs is supported in remote SDP") diff --git a/teleoprtc/tracks.py b/teleoprtc/tracks.py index 96d9c3524..7cb2da737 100644 --- a/teleoprtc/tracks.py +++ b/teleoprtc/tracks.py @@ -2,7 +2,7 @@ import asyncio import logging import time import fractions -from typing import Optional, Tuple, Any +from typing import Any import aiortc from aiortc.mediastreams import VIDEO_CLOCK_RATE, VIDEO_TIME_BASE @@ -12,7 +12,7 @@ def video_track_id(camera_type: str, track_id: str) -> str: return f"{camera_type}:{track_id}" -def parse_video_track_id(track_id: str) -> Tuple[str, str]: +def parse_video_track_id(track_id: str) -> tuple[str, str]: parts = track_id.split(":") if len(parts) != 2: raise ValueError(f"Invalid video track id: {track_id}") @@ -35,7 +35,7 @@ class TiciVideoStreamTrack(aiortc.MediaStreamTrack): self._dt: float = dt self._time_base: fractions.Fraction = time_base self._clock_rate: int = clock_rate - self._start: Optional[float] = None + self._start: float | None = None self._logger = logging.getLogger("WebRTCStream") def log_debug(self, msg: Any, *args): @@ -53,7 +53,7 @@ class TiciVideoStreamTrack(aiortc.MediaStreamTrack): return pts - def codec_preference(self) -> Optional[str]: + def codec_preference(self) -> str | None: return None diff --git a/tools/bodyteleop/web.py b/tools/bodyteleop/web.py index b1fb9525d..fd8f691d1 100644 --- a/tools/bodyteleop/web.py +++ b/tools/bodyteleop/web.py @@ -56,7 +56,7 @@ def create_ssl_cert(cert_path: str, key_path: str): try: proc = subprocess.run(f'openssl req -x509 -newkey rsa:4096 -nodes -out {cert_path} -keyout {key_path} \ -days 365 -subj "/C=US/ST=California/O=commaai/OU=comma body"', - stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) + capture_output=True, shell=True) proc.check_returncode() except subprocess.CalledProcessError as ex: raise ValueError(f"Error creating SSL certificate:\n[stdout]\n{proc.stdout.decode()}\n[stderr]\n{proc.stderr.decode()}") from ex @@ -77,7 +77,7 @@ def create_ssl_context(): ## ENDPOINTS async def index(request: 'web.Request'): - with open(os.path.join(TELEOPDIR, "static", "index.html"), "r") as f: + with open(os.path.join(TELEOPDIR, "static", "index.html")) as f: content = f.read() return web.Response(content_type="text/html", text=content) diff --git a/tools/lib/README.md b/tools/lib/README.md index a0c4a0863..af1ad0de2 100644 --- a/tools/lib/README.md +++ b/tools/lib/README.md @@ -34,10 +34,16 @@ for msg in lr: ### Segment Ranges -We also support a new format called a "segment range", where you can specify which segments from a route to load. +We also support a new format called a "segment range": + +``` +344c5c15b34f2d8a / 2024-01-03--09-37-12 / 2:6 / q +[ dongle id ] [ timestamp ] [ selector ] [ query type] +``` + +you can specify which segments from a route to load ```python - lr = LogReader("a2a0ccea32023010|2023-07-27--13-01-19/4") # 4th segment lr = LogReader("a2a0ccea32023010|2023-07-27--13-01-19/4:6") # 4th and 5th segment lr = LogReader("a2a0ccea32023010|2023-07-27--13-01-19/-1") # last segment diff --git a/tools/lib/auth.py b/tools/lib/auth.py index 997d1f860..5988397d0 100755 --- a/tools/lib/auth.py +++ b/tools/lib/auth.py @@ -26,7 +26,7 @@ import sys import pprint import webbrowser from http.server import BaseHTTPRequestHandler, HTTPServer -from typing import Any, Dict +from typing import Any from urllib.parse import parse_qs, urlencode from openpilot.tools.lib.api import APIError, CommaApi, UnauthorizedError @@ -36,7 +36,7 @@ PORT = 3000 class ClientRedirectServer(HTTPServer): - query_params: Dict[str, Any] = {} + query_params: dict[str, Any] = {} class ClientRedirectHandler(BaseHTTPRequestHandler): diff --git a/tools/lib/azure_container.py b/tools/lib/azure_container.py index 7d9550266..52b2f37db 100644 --- a/tools/lib/azure_container.py +++ b/tools/lib/azure_container.py @@ -2,7 +2,7 @@ import os from datetime import datetime, timedelta from functools import lru_cache from pathlib import Path -from typing import IO, Union +from typing import IO TOKEN_PATH = Path("/data/azure_token") @@ -57,7 +57,7 @@ class AzureContainer: ext = "hevc" if log_type.endswith('camera') else "bz2" return self.BASE_URL + f"{route_name.replace('|', '/')}/{segment_num}/{log_type}.{ext}" - def upload_bytes(self, data: Union[bytes, IO], blob_name: str) -> str: + def upload_bytes(self, data: bytes | IO, blob_name: str) -> str: from azure.storage.blob import BlobClient blob = BlobClient( account_url=self.ACCOUNT_URL, @@ -69,6 +69,6 @@ class AzureContainer: blob.upload_blob(data) return self.BASE_URL + blob_name - def upload_file(self, path: Union[str, os.PathLike], blob_name: str) -> str: + def upload_file(self, path: str | os.PathLike, blob_name: str) -> str: with open(path, "rb") as f: return self.upload_bytes(f, blob_name) diff --git a/tools/lib/bootlog.py b/tools/lib/bootlog.py index 827ef1eef..208ddc19c 100644 --- a/tools/lib/bootlog.py +++ b/tools/lib/bootlog.py @@ -1,6 +1,5 @@ import functools import re -from typing import List, Optional from openpilot.tools.lib.auth_config import get_token from openpilot.tools.lib.api import CommaApi @@ -44,7 +43,7 @@ class Bootlog: return False return self.id < b.id -def get_bootlog_from_id(bootlog_id: str) -> Optional[Bootlog]: +def get_bootlog_from_id(bootlog_id: str) -> Bootlog | None: # TODO: implement an API endpoint for this bl = Bootlog(bootlog_id) for b in get_bootlogs(bl.dongle_id): @@ -52,7 +51,7 @@ def get_bootlog_from_id(bootlog_id: str) -> Optional[Bootlog]: return b return None -def get_bootlogs(dongle_id: str) -> List[Bootlog]: +def get_bootlogs(dongle_id: str) -> list[Bootlog]: api = CommaApi(get_token()) r = api.get(f'v1/devices/{dongle_id}/bootlogs') return [Bootlog(b) for b in r] diff --git a/tools/lib/filereader.py b/tools/lib/filereader.py index 1db3207e4..e9b8b4b2c 100644 --- a/tools/lib/filereader.py +++ b/tools/lib/filereader.py @@ -1,20 +1,36 @@ import os +import socket +from urllib.parse import urlparse from openpilot.tools.lib.url_file import URLFile DATA_ENDPOINT = os.getenv("DATA_ENDPOINT", "http://data-raw.comma.internal/") + +def internal_source_available(): + try: + hostname = urlparse(DATA_ENDPOINT).hostname + if hostname: + socket.gethostbyname(hostname) + return True + except socket.gaierror: + pass + return False + + def resolve_name(fn): if fn.startswith("cd:/"): return fn.replace("cd:/", DATA_ENDPOINT) return fn + def file_exists(fn): fn = resolve_name(fn) if fn.startswith(("http://", "https://")): return URLFile(fn).get_length_online() != -1 return os.path.exists(fn) + def FileReader(fn, debug=False): fn = resolve_name(fn) if fn.startswith(("http://", "https://")): diff --git a/tools/lib/helpers.py b/tools/lib/helpers.py index 423f207b4..653eb3d7e 100644 --- a/tools/lib/helpers.py +++ b/tools/lib/helpers.py @@ -3,23 +3,24 @@ import datetime TIME_FMT = "%Y-%m-%d--%H-%M-%S" + # regex patterns class RE: - DONGLE_ID = r'(?P[a-z0-9]{16})' + DONGLE_ID = r'(?P[a-f0-9]{16})' TIMESTAMP = r'(?P[0-9]{4}-[0-9]{2}-[0-9]{2}--[0-9]{2}-[0-9]{2}-[0-9]{2})' - LOG_ID_V2 = r'(?P[a-z0-9]{8})--(?P[a-z0-9]{10})' - LOG_ID = r'(?P(?:{}|{}))'.format(TIMESTAMP, LOG_ID_V2) - ROUTE_NAME = r'(?P{}[|_/]{})'.format(DONGLE_ID, LOG_ID) - SEGMENT_NAME = r'{}(?:--|/)(?P[0-9]+)'.format(ROUTE_NAME) + LOG_ID_V2 = r'(?P[a-f0-9]{8})--(?P[a-z0-9]{10})' + LOG_ID = fr'(?P(?:{TIMESTAMP}|{LOG_ID_V2}))' + ROUTE_NAME = fr'(?P{DONGLE_ID}[|_/]{LOG_ID})' + SEGMENT_NAME = fr'{ROUTE_NAME}(?:--|/)(?P[0-9]+)' INDEX = r'-?[0-9]+' - SLICE = r'(?P{})?:?(?P{})?:?(?P{})?'.format(INDEX, INDEX, INDEX) - SEGMENT_RANGE = r'{}(?:--|/)?(?P({}))?/?(?P([qras]))?'.format(ROUTE_NAME, SLICE) + SLICE = fr'(?P{INDEX})?:?(?P{INDEX})?:?(?P{INDEX})?' + SEGMENT_RANGE = fr'{ROUTE_NAME}(?:(--|/)(?P({SLICE})))?(?:/(?P([qras])))?' BOOTLOG_NAME = ROUTE_NAME - EXPLORER_FILE = r'^(?P{})--(?P[a-z]+\.[a-z0-9]+)$'.format(SEGMENT_NAME) - OP_SEGMENT_DIR = r'^(?P{})$'.format(SEGMENT_NAME) + EXPLORER_FILE = fr'^(?P{SEGMENT_NAME})--(?P[a-z]+\.[a-z0-9]+)$' + OP_SEGMENT_DIR = fr'^(?P{SEGMENT_NAME})$' def timestamp_to_datetime(t: str) -> datetime.datetime: diff --git a/tools/lib/live_logreader.py b/tools/lib/live_logreader.py new file mode 100644 index 000000000..6a7ecee6f --- /dev/null +++ b/tools/lib/live_logreader.py @@ -0,0 +1,30 @@ +import os +from cereal import log as capnp_log, messaging +from cereal.services import SERVICE_LIST + +from openpilot.tools.lib.logreader import LogIterable, RawLogIterable + + +ALL_SERVICES = list(SERVICE_LIST.keys()) + +def raw_live_logreader(services: list[str] = ALL_SERVICES, addr: str = '127.0.0.1') -> RawLogIterable: + if addr != "127.0.0.1": + os.environ["ZMQ"] = "1" + messaging.context = messaging.Context() + + poller = messaging.Poller() + + for m in services: + messaging.sub_sock(m, poller, addr=addr) + + while True: + polld = poller.poll(100) + for sock in polld: + msg = sock.receive() + yield msg + + +def live_logreader(services: list[str] = ALL_SERVICES, addr: str = '127.0.0.1') -> LogIterable: + for m in raw_live_logreader(services, addr): + with capnp_log.Event.from_bytes(m) as evt: + yield evt diff --git a/tools/lib/logreader.py b/tools/lib/logreader.py index decffccd6..6247bbc9d 100755 --- a/tools/lib/logreader.py +++ b/tools/lib/logreader.py @@ -4,28 +4,26 @@ from functools import partial import multiprocessing import capnp import enum -import numpy as np import os import pathlib -import re import sys import tqdm import urllib.parse import warnings -from typing import Dict, Iterable, Iterator, List, Type +from collections.abc import Callable, Iterable, Iterator from urllib.parse import parse_qs, urlparse from cereal import log as capnp_log from openpilot.common.swaglog import cloudlog from openpilot.tools.lib.comma_car_segments import get_url as get_comma_segments_url from openpilot.tools.lib.openpilotci import get_url -from openpilot.tools.lib.filereader import FileReader, file_exists -from openpilot.tools.lib.helpers import RE +from openpilot.tools.lib.filereader import FileReader, file_exists, internal_source_available from openpilot.tools.lib.route import Route, SegmentRange -LogMessage = Type[capnp._DynamicStructReader] +LogMessage = type[capnp._DynamicStructReader] LogIterable = Iterable[LogMessage] +RawLogIterable = Iterable[bytes] class _LogFileReader: @@ -71,28 +69,25 @@ class _LogFileReader: class ReadMode(enum.StrEnum): - RLOG = "r" # only read rlogs - QLOG = "q" # only read qlogs - SANITIZED = "s" # read from the commaCarSegments database - AUTO = "a" # default to rlogs, fallback to qlogs - AUTO_INTERACIVE = "i" # default to rlogs, fallback to qlogs with a prompt from the user + RLOG = "r" # only read rlogs + QLOG = "q" # only read qlogs + SANITIZED = "s" # read from the commaCarSegments database + AUTO = "a" # default to rlogs, fallback to qlogs + AUTO_INTERACTIVE = "i" # default to rlogs, fallback to qlogs with a prompt from the user -def create_slice_from_string(s: str): - m = re.fullmatch(RE.SLICE, s) - assert m is not None, f"Invalid slice: {s}" - start, end, step = m.groups() - start = int(start) if start is not None else None - end = int(end) if end is not None else None - step = int(step) if step is not None else None - if start is not None and ":" not in s and end is None and step is None: - return start - return slice(start, end, step) +LogPath = str | None +LogPaths = list[LogPath] +ValidFileCallable = Callable[[LogPath], bool] +Source = Callable[[SegmentRange, ReadMode], LogPaths] -def default_valid_file(fn): +InternalUnavailableException = Exception("Internal source not available") + +def default_valid_file(fn: LogPath) -> bool: return fn is not None and file_exists(fn) -def auto_strategy(rlog_paths, qlog_paths, interactive, valid_file): + +def auto_strategy(rlog_paths: LogPaths, qlog_paths: LogPaths, interactive: bool, valid_file: ValidFileCallable) -> LogPaths: # auto select logs based on availability if any(rlog is None or not valid_file(rlog) for rlog in rlog_paths): if interactive: @@ -101,40 +96,28 @@ def auto_strategy(rlog_paths, qlog_paths, interactive, valid_file): else: cloudlog.warning("Some rlogs were not found, falling back to qlogs for those segments...") - return [rlog if (valid_file(rlog)) else (qlog if (valid_file(qlog)) else None) - for (rlog, qlog) in zip(rlog_paths, qlog_paths, strict=True)] + return [rlog if valid_file(rlog) else (qlog if valid_file(qlog) else None) + for (rlog, qlog) in zip(rlog_paths, qlog_paths, strict=True)] return rlog_paths -def apply_strategy(mode: ReadMode, rlog_paths, qlog_paths, valid_file=default_valid_file): + +def apply_strategy(mode: ReadMode, rlog_paths: LogPaths, qlog_paths: LogPaths, valid_file: ValidFileCallable = default_valid_file) -> LogPaths: if mode == ReadMode.RLOG: return rlog_paths elif mode == ReadMode.QLOG: return qlog_paths elif mode == ReadMode.AUTO: return auto_strategy(rlog_paths, qlog_paths, False, valid_file) - elif mode == ReadMode.AUTO_INTERACIVE: + elif mode == ReadMode.AUTO_INTERACTIVE: return auto_strategy(rlog_paths, qlog_paths, True, valid_file) + raise Exception(f"invalid mode: {mode}") -def parse_slice(sr: SegmentRange): - s = create_slice_from_string(sr._slice) - if isinstance(s, slice): - if s.stop is None or s.stop < 0 or (s.start is not None and s.start < 0): # we need the number of segments in order to parse this slice - segs = np.arange(sr.get_max_seg_number()+1) - else: - segs = np.arange(s.stop + 1) - return segs[s] - else: - if s < 0: - s = sr.get_max_seg_number() + s + 1 - return [s] - -def comma_api_source(sr: SegmentRange, mode: ReadMode): - segs = parse_slice(sr) +def comma_api_source(sr: SegmentRange, mode: ReadMode) -> LogPaths: route = Route(sr.route_name) - rlog_paths = [route.log_paths()[seg] for seg in segs] - qlog_paths = [route.qlog_paths()[seg] for seg in segs] + rlog_paths = [route.log_paths()[seg] for seg in sr.seg_idxs] + qlog_paths = [route.qlog_paths()[seg] for seg in sr.seg_idxs] # comma api will have already checked if the file exists def valid_file(fn): @@ -142,79 +125,84 @@ def comma_api_source(sr: SegmentRange, mode: ReadMode): return apply_strategy(mode, rlog_paths, qlog_paths, valid_file=valid_file) -def internal_source(sr: SegmentRange, mode: ReadMode): - segs = parse_slice(sr) + +def internal_source(sr: SegmentRange, mode: ReadMode) -> LogPaths: + if not internal_source_available(): + raise InternalUnavailableException def get_internal_url(sr: SegmentRange, seg, file): return f"cd:/{sr.dongle_id}/{sr.timestamp}/{seg}/{file}.bz2" - rlog_paths = [get_internal_url(sr, seg, "rlog") for seg in segs] - qlog_paths = [get_internal_url(sr, seg, "qlog") for seg in segs] + rlog_paths = [get_internal_url(sr, seg, "rlog") for seg in sr.seg_idxs] + qlog_paths = [get_internal_url(sr, seg, "qlog") for seg in sr.seg_idxs] return apply_strategy(mode, rlog_paths, qlog_paths) -def openpilotci_source(sr: SegmentRange, mode: ReadMode): - segs = parse_slice(sr) - rlog_paths = [get_url(sr.route_name, seg, "rlog") for seg in segs] - qlog_paths = [get_url(sr.route_name, seg, "qlog") for seg in segs] +def openpilotci_source(sr: SegmentRange, mode: ReadMode) -> LogPaths: + rlog_paths = [get_url(sr.route_name, seg, "rlog") for seg in sr.seg_idxs] + qlog_paths = [get_url(sr.route_name, seg, "qlog") for seg in sr.seg_idxs] return apply_strategy(mode, rlog_paths, qlog_paths) -def comma_car_segments_source(sr: SegmentRange, mode=ReadMode.RLOG): - segs = parse_slice(sr) - return [get_comma_segments_url(sr.route_name, seg) for seg in segs] +def comma_car_segments_source(sr: SegmentRange, mode=ReadMode.RLOG) -> LogPaths: + return [get_comma_segments_url(sr.route_name, seg) for seg in sr.seg_idxs] -def direct_source(file_or_url): + +def direct_source(file_or_url: str) -> LogPaths: return [file_or_url] + def get_invalid_files(files): for f in files: if f is None or not file_exists(f): yield f -def check_source(source, *args): - try: - files = source(*args) - assert next(get_invalid_files(files), None) is None - return None, files - except Exception as e: - return e, None -def auto_source(sr: SegmentRange, mode=ReadMode.RLOG): +def check_source(source: Source, *args) -> LogPaths: + files = source(*args) + assert next(get_invalid_files(files), False) is False + return files + + +def auto_source(sr: SegmentRange, mode=ReadMode.RLOG) -> LogPaths: if mode == ReadMode.SANITIZED: return comma_car_segments_source(sr, mode) + SOURCES: list[Source] = [internal_source, openpilotci_source, comma_api_source, comma_car_segments_source,] exceptions = [] # Automatically determine viable source - for source in [internal_source, openpilotci_source, comma_api_source, comma_car_segments_source]: - exception, ret = check_source(source, sr, mode) - if exception is None: - return ret - else: - exceptions.append(exception) + for source in SOURCES: + try: + return check_source(source, sr, mode) + except Exception as e: + exceptions.append(e) raise Exception(f"auto_source could not find any valid source, exceptions for sources: {exceptions}") -def parse_useradmin(identifier): + +def parse_useradmin(identifier: str): if "useradmin.comma.ai" in identifier: query = parse_qs(urlparse(identifier).query) return query["onebox"][0] return None -def parse_cabana(identifier): + +def parse_cabana(identifier: str): if "cabana.comma.ai" in identifier: query = parse_qs(urlparse(identifier).query) return query["route"][0] return None -def parse_direct(identifier): + +def parse_direct(identifier: str): if identifier.startswith(("http://", "https://", "cd:/")) or pathlib.Path(identifier).exists(): return identifier return None -def parse_indirect(identifier): + +def parse_indirect(identifier: str): parsed = parse_useradmin(identifier) or parse_cabana(identifier) if parsed is not None: @@ -224,7 +212,7 @@ def parse_indirect(identifier): class LogReader: - def _parse_identifiers(self, identifier: str | List[str]): + def _parse_identifiers(self, identifier: str | list[str]): if isinstance(identifier, list): return [i for j in identifier for i in self._parse_identifiers(j)] @@ -239,9 +227,15 @@ class LogReader: mode = self.default_mode if sr.selector is None else ReadMode(sr.selector) source = self.default_source if source is None else source - return source(sr, mode) + identifiers = source(sr, mode) - def __init__(self, identifier: str | List[str], default_mode=ReadMode.RLOG, default_source=auto_source, sort_by_time=False, only_union_types=False): + invalid_count = len(list(get_invalid_files(identifiers))) + assert invalid_count == 0, f"{invalid_count}/{len(identifiers)} invalid log(s) found, please ensure all logs \ +are uploaded or auto fallback to qlogs with '/a' selector at the end of the route name." + return identifiers + + def __init__(self, identifier: str | list[str], default_mode: ReadMode = ReadMode.RLOG, + default_source=auto_source, sort_by_time=False, only_union_types=False): self.default_mode = default_mode self.default_source = default_source self.identifier = identifier @@ -249,7 +243,7 @@ class LogReader: self.sort_by_time = sort_by_time self.only_union_types = only_union_types - self.__lrs: Dict[int, _LogFileReader] = {} + self.__lrs: dict[int, _LogFileReader] = {} self.reset() def _get_lr(self, i): @@ -274,9 +268,6 @@ class LogReader: def reset(self): self.logreader_identifiers = self._parse_identifiers(self.identifier) - invalid_count = len(list(get_invalid_files(self.logreader_identifiers))) - assert invalid_count == 0, f"{invalid_count}/{len(self.logreader_identifiers)} invalid log(s) found, please ensure all logs \ -are uploaded or auto fallback to qlogs with '/a' selector at the end of the route name." @staticmethod def from_bytes(dat): @@ -291,6 +282,7 @@ are uploaded or auto fallback to qlogs with '/a' selector at the end of the rout if __name__ == "__main__": import codecs + # capnproto <= 0.8.0 throws errors converting byte data to string # below line catches those errors and replaces the bytes with \x__ codecs.register_error("strict", codecs.backslashreplace_errors) diff --git a/tools/lib/route.py b/tools/lib/route.py index f7c3c432c..bd0ccc1fc 100644 --- a/tools/lib/route.py +++ b/tools/lib/route.py @@ -4,7 +4,7 @@ from functools import cache from urllib.parse import urlparse from collections import defaultdict from itertools import chain -from typing import Optional +from typing import cast from openpilot.tools.lib.auth_config import get_token from openpilot.tools.lib.api import CommaApi @@ -17,6 +17,7 @@ CAMERA_FILENAMES = ['fcamera.hevc', 'video.hevc'] DCAMERA_FILENAMES = ['dcamera.hevc'] ECAMERA_FILENAMES = ['ecamera.hevc'] + class Route: def __init__(self, name, data_dir=None): self._name = RouteName(name) @@ -37,27 +38,27 @@ class Route: def log_paths(self): log_path_by_seg_num = {s.name.segment_num: s.log_path for s in self._segments} - return [log_path_by_seg_num.get(i, None) for i in range(self.max_seg_number+1)] + return [log_path_by_seg_num.get(i, None) for i in range(self.max_seg_number + 1)] def qlog_paths(self): qlog_path_by_seg_num = {s.name.segment_num: s.qlog_path for s in self._segments} - return [qlog_path_by_seg_num.get(i, None) for i in range(self.max_seg_number+1)] + return [qlog_path_by_seg_num.get(i, None) for i in range(self.max_seg_number + 1)] def camera_paths(self): camera_path_by_seg_num = {s.name.segment_num: s.camera_path for s in self._segments} - return [camera_path_by_seg_num.get(i, None) for i in range(self.max_seg_number+1)] + return [camera_path_by_seg_num.get(i, None) for i in range(self.max_seg_number + 1)] def dcamera_paths(self): dcamera_path_by_seg_num = {s.name.segment_num: s.dcamera_path for s in self._segments} - return [dcamera_path_by_seg_num.get(i, None) for i in range(self.max_seg_number+1)] + return [dcamera_path_by_seg_num.get(i, None) for i in range(self.max_seg_number + 1)] def ecamera_paths(self): ecamera_path_by_seg_num = {s.name.segment_num: s.ecamera_path for s in self._segments} - return [ecamera_path_by_seg_num.get(i, None) for i in range(self.max_seg_number+1)] + return [ecamera_path_by_seg_num.get(i, None) for i in range(self.max_seg_number + 1)] def qcamera_paths(self): qcamera_path_by_seg_num = {s.name.segment_num: s.qcamera_path for s in self._segments} - return [qcamera_path_by_seg_num.get(i, None) for i in range(self.max_seg_number+1)] + return [qcamera_path_by_seg_num.get(i, None) for i in range(self.max_seg_number + 1)] # TODO: refactor this, it's super repetitive def _get_segments_remote(self): @@ -159,6 +160,7 @@ class Route: raise ValueError(f'Could not find segments for route {self.name.canonical_name} in data directory {data_dir}') return sorted(segments, key=lambda seg: seg.name.segment_num) + class Segment: def __init__(self, name, log_path, qlog_path, camera_path, dcamera_path, ecamera_path, qcamera_path): self._name = SegmentName(name) @@ -173,6 +175,7 @@ class Segment: def name(self): return self._name + class RouteName: def __init__(self, name_str: str): self._name_str = name_str @@ -194,6 +197,7 @@ class RouteName: def __str__(self) -> str: return self._canonical_name + class SegmentName: # TODO: add constructor that takes dongle_id, time_str, segment_num and then create instances # of this class instead of manually constructing a segment name (use canonical_name prop instead) @@ -206,7 +210,7 @@ class SegmentName: seg_num_delim = "--" if self._name_str.count("--") == 2 else "/" name_parts = self._name_str.rsplit(seg_num_delim, 1) if allow_route_name and len(name_parts) == 1: - name_parts.append("-1") # no segment number + name_parts.append("-1") # no segment number self._route_name = RouteName(name_parts[0]) self._num = int(name_parts[1]) self._canonical_name = f"{self._route_name._dongle_id}|{self._route_name._time_str}--{self._num}" @@ -227,47 +231,67 @@ class SegmentName: def route_name(self) -> RouteName: return self._route_name @property - def data_dir(self) -> Optional[str]: return self._data_dir + def data_dir(self) -> str | None: return self._data_dir def __str__(self) -> str: return self._canonical_name @cache -def get_max_seg_number_cached(sr: 'SegmentRange'): +def get_max_seg_number_cached(sr: 'SegmentRange') -> int: try: api = CommaApi(get_token()) - return api.get("/v1/route/" + sr.route_name.replace("/", "|"))["segment_numbers"][-1] + return cast(int, api.get("/v1/route/" + sr.route_name.replace("/", "|"))["segment_numbers"][-1]) except Exception as e: raise Exception("unable to get max_segment_number. ensure you have access to this route or the route is public.") from e class SegmentRange: def __init__(self, segment_range: str): - self.m = re.fullmatch(RE.SEGMENT_RANGE, segment_range) - assert self.m, f"Segment range is not valid {segment_range}" - - def get_max_seg_number(self): - return get_max_seg_number_cached(self) + m = re.fullmatch(RE.SEGMENT_RANGE, segment_range) + assert m is not None, f"Segment range is not valid {segment_range}" + self.m = m @property - def route_name(self): + def route_name(self) -> str: return self.m.group("route_name") @property - def dongle_id(self): + def dongle_id(self) -> str: return self.m.group("dongle_id") @property - def timestamp(self): + def timestamp(self) -> str: return self.m.group("timestamp") @property - def _slice(self): - return self.m.group("slice") + def slice(self) -> str: + return self.m.group("slice") or "" @property - def selector(self): + def selector(self) -> str | None: return self.m.group("selector") - def __str__(self): - return f"{self.dongle_id}/{self.timestamp}" + (f"/{self._slice}" if self._slice else "") + (f"/{self.selector}" if self.selector else "") + @property + def seg_idxs(self) -> list[int]: + m = re.fullmatch(RE.SLICE, self.slice) + assert m is not None, f"Invalid slice: {self.slice}" + start, end, step = (None if s is None else int(s) for s in m.groups()) + + # one segment specified + if start is not None and end is None and ':' not in self.slice: + if start < 0: + start += get_max_seg_number_cached(self) + 1 + return [start] + + s = slice(start, end, step) + # no specified end or using relative indexing, need number of segments + if end is None or end < 0 or (start is not None and start < 0): + return list(range(get_max_seg_number_cached(self) + 1))[s] + else: + return list(range(end + 1))[s] + + def __str__(self) -> str: + return f"{self.dongle_id}/{self.timestamp}" + (f"/{self.slice}" if self.slice else "") + (f"/{self.selector}" if self.selector else "") + + def __repr__(self) -> str: + return self.__str__() diff --git a/tools/lib/tests/test_caching.py b/tools/lib/tests/test_caching.py index 294c5a223..5d3dfeba4 100755 --- a/tools/lib/tests/test_caching.py +++ b/tools/lib/tests/test_caching.py @@ -1,13 +1,14 @@ #!/usr/bin/env python3 -from functools import wraps +from functools import partial import http.server import os -import threading -import time +import shutil +import socket import unittest from parameterized import parameterized - +from openpilot.selfdrive.test.helpers import with_http_server +from openpilot.system.hardware.hw import Paths from openpilot.tools.lib.url_file import URLFile @@ -16,7 +17,7 @@ class CachingTestRequestHandler(http.server.BaseHTTPRequestHandler): def do_GET(self): if self.FILE_EXISTS: - self.send_response(200, b'1234') + self.send_response(206 if "Range" in self.headers else 200, b'1234') else: self.send_response(404) self.end_headers() @@ -30,31 +31,39 @@ class CachingTestRequestHandler(http.server.BaseHTTPRequestHandler): self.end_headers() -class CachingTestServer(threading.Thread): - def run(self): - self.server = http.server.HTTPServer(("127.0.0.1", 0), CachingTestRequestHandler) - self.port = self.server.server_port - self.server.serve_forever() - - def stop(self): - self.server.server_close() - self.server.shutdown() - -def with_caching_server(func): - @wraps(func) - def wrapper(*args, **kwargs): - server = CachingTestServer() - server.start() - time.sleep(0.25) # wait for server to get it's port - try: - func(*args, **kwargs, port=server.port) - finally: - server.stop() - return wrapper +with_caching_server = partial(with_http_server, handler=CachingTestRequestHandler) class TestFileDownload(unittest.TestCase): + @with_caching_server + def test_pipeline_defaults(self, host): + # TODO: parameterize the defaults so we don't rely on hard-coded values in xx + + self.assertEqual(URLFile.pool_manager().pools._maxsize, 10) # PoolManager num_pools param + pool_manager_defaults = { + "maxsize": 100, + "socket_options": [(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),], + } + for k, v in pool_manager_defaults.items(): + self.assertEqual(URLFile.pool_manager().connection_pool_kw.get(k), v) + + retry_defaults = { + "total": 5, + "backoff_factor": 0.5, + "status_forcelist": [409, 429, 503, 504], + } + for k, v in retry_defaults.items(): + self.assertEqual(getattr(URLFile.pool_manager().connection_pool_kw["retries"], k), v) + + # ensure caching off by default and cache dir doesn't get created + os.environ.pop("FILEREADER_CACHE", None) + if os.path.exists(Paths.download_cache_root()): + shutil.rmtree(Paths.download_cache_root()) + URLFile(f"{host}/test.txt").get_length() + URLFile(f"{host}/test.txt").read() + self.assertEqual(os.path.exists(Paths.download_cache_root()), False) + def compare_loads(self, url, start=0, length=None): """Compares range between cached and non cached version""" file_cached = URLFile(url, cache=True) @@ -110,10 +119,10 @@ class TestFileDownload(unittest.TestCase): @parameterized.expand([(True, ), (False, )]) @with_caching_server - def test_recover_from_missing_file(self, cache_enabled, port): + def test_recover_from_missing_file(self, cache_enabled, host): os.environ["FILEREADER_CACHE"] = "1" if cache_enabled else "0" - file_url = f"http://localhost:{port}/test.png" + file_url = f"{host}/test.png" CachingTestRequestHandler.FILE_EXISTS = False length = URLFile(file_url).get_length() diff --git a/tools/lib/tests/test_comma_car_segments.py b/tools/lib/tests/test_comma_car_segments.py index 484a4aae0..b29325158 100644 --- a/tools/lib/tests/test_comma_car_segments.py +++ b/tools/lib/tests/test_comma_car_segments.py @@ -1,5 +1,4 @@ - - +import pytest import unittest import requests @@ -8,6 +7,7 @@ from openpilot.tools.lib.logreader import LogReader from openpilot.tools.lib.route import SegmentRange +@pytest.mark.skip(reason="huggingface is flaky, run this test manually to check for issues") class TestCommaCarSegments(unittest.TestCase): def test_database(self): database = get_comma_car_segments_database() @@ -25,7 +25,7 @@ class TestCommaCarSegments(unittest.TestCase): sr = SegmentRange(segment) - url = get_url(sr.route_name, sr._slice) + url = get_url(sr.route_name, sr.slice) resp = requests.get(url) self.assertEqual(resp.status_code, 200) diff --git a/tools/lib/tests/test_logreader.py b/tools/lib/tests/test_logreader.py old mode 100644 new mode 100755 index 7a8ea20b7..2141915b8 --- a/tools/lib/tests/test_logreader.py +++ b/tools/lib/tests/test_logreader.py @@ -1,6 +1,8 @@ +#!/usr/bin/env python3 +import contextlib +import io import shutil import tempfile -import numpy as np import os import unittest import pytest @@ -9,11 +11,12 @@ import requests from parameterized import parameterized from unittest import mock -from openpilot.tools.lib.logreader import LogIterable, LogReader, parse_indirect, parse_slice, ReadMode +from openpilot.tools.lib.logreader import LogIterable, LogReader, comma_api_source, parse_indirect, ReadMode, InternalUnavailableException from openpilot.tools.lib.route import SegmentRange +from openpilot.tools.lib.url_file import URLFileException -NUM_SEGS = 17 # number of segments in the test route -ALL_SEGS = list(np.arange(NUM_SEGS)) +NUM_SEGS = 17 # number of segments in the test route +ALL_SEGS = list(range(NUM_SEGS)) TEST_ROUTE = "344c5c15b34f2d8a/2024-01-03--09-37-12" QLOG_FILE = "https://commadataci.blob.core.windows.net/openpilotci/0375fdf7b1ce594d/2019-06-13--08-32-25/3/qlog.bz2" @@ -22,6 +25,24 @@ def noop(segment: LogIterable): return segment +@contextlib.contextmanager +def setup_source_scenario(is_internal=False): + with ( + mock.patch("openpilot.tools.lib.logreader.internal_source") as internal_source_mock, + mock.patch("openpilot.tools.lib.logreader.openpilotci_source") as openpilotci_source_mock, + mock.patch("openpilot.tools.lib.logreader.comma_api_source") as comma_api_source_mock, + ): + if is_internal: + internal_source_mock.return_value = [QLOG_FILE] + else: + internal_source_mock.side_effect = InternalUnavailableException + + openpilotci_source_mock.return_value = [None] + comma_api_source_mock.return_value = [QLOG_FILE] + + yield + + class TestLogReader(unittest.TestCase): @parameterized.expand([ (f"{TEST_ROUTE}", ALL_SEGS), @@ -51,8 +72,7 @@ class TestLogReader(unittest.TestCase): def test_indirect_parsing(self, identifier, expected): parsed, _, _ = parse_indirect(identifier) sr = SegmentRange(parsed) - segs = parse_slice(sr) - self.assertListEqual(list(segs), expected) + self.assertListEqual(list(sr.seg_idxs), expected, identifier) @parameterized.expand([ (f"{TEST_ROUTE}", f"{TEST_ROUTE}"), @@ -66,7 +86,10 @@ class TestLogReader(unittest.TestCase): sr = SegmentRange(identifier) self.assertEqual(str(sr), expected) - def test_direct_parsing(self): + @parameterized.expand([(True,), (False,)]) + @mock.patch("openpilot.tools.lib.logreader.file_exists") + def test_direct_parsing(self, cache_enabled, file_exists_mock): + os.environ["FILEREADER_CACHE"] = "1" if cache_enabled else "0" qlog = tempfile.NamedTemporaryFile(mode='wb', delete=False) with requests.get(QLOG_FILE, stream=True) as r: @@ -77,6 +100,12 @@ class TestLogReader(unittest.TestCase): l = len(list(LogReader(f))) self.assertGreater(l, 100) + with self.assertRaises(URLFileException) if not cache_enabled else self.assertRaises(AssertionError): + l = len(list(LogReader(QLOG_FILE.replace("/3/", "/200/")))) + + # file_exists should not be called for direct files + self.assertEqual(file_exists_mock.call_count, 0) + @parameterized.expand([ (f"{TEST_ROUTE}///",), (f"{TEST_ROUTE}---",), @@ -85,11 +114,26 @@ class TestLogReader(unittest.TestCase): (f"{TEST_ROUTE}/j",), (f"{TEST_ROUTE}/0:1:2:3",), (f"{TEST_ROUTE}/:::3",), + (f"{TEST_ROUTE}3",), + (f"{TEST_ROUTE}-3",), + (f"{TEST_ROUTE}--3a",), ]) def test_bad_ranges(self, segment_range): with self.assertRaises(AssertionError): - sr = SegmentRange(segment_range) - parse_slice(sr) + _ = SegmentRange(segment_range).seg_idxs + + @parameterized.expand([ + (f"{TEST_ROUTE}/0", False), + (f"{TEST_ROUTE}/:2", False), + (f"{TEST_ROUTE}/0:", True), + (f"{TEST_ROUTE}/-1", True), + (f"{TEST_ROUTE}", True), + ]) + def test_slicing_api_call(self, segment_range, api_call): + with mock.patch("openpilot.tools.lib.route.get_max_seg_number_cached") as max_seg_mock: + max_seg_mock.return_value = NUM_SEGS + _ = SegmentRange(segment_range).seg_idxs + self.assertEqual(api_call, max_seg_mock.called) @pytest.mark.slow def test_modes(self): @@ -110,7 +154,7 @@ class TestLogReader(unittest.TestCase): qlog_len = len(list(LogReader(f"{TEST_ROUTE}/0/q"))) qlog_len_2 = len(list(LogReader([f"{TEST_ROUTE}/0/q", f"{TEST_ROUTE}/0/q"]))) - self.assertEqual(qlog_len*2, qlog_len_2) + self.assertEqual(qlog_len * 2, qlog_len_2) @pytest.mark.slow @mock.patch("openpilot.tools.lib.logreader._LogFileReader") @@ -137,6 +181,41 @@ class TestLogReader(unittest.TestCase): lr = LogReader(f"{TEST_ROUTE}/0:4") self.assertEqual(len(lr.run_across_segments(4, noop)), len(list(lr))) + @pytest.mark.slow + def test_auto_mode(self): + lr = LogReader(f"{TEST_ROUTE}/0/q") + qlog_len = len(list(lr)) + with mock.patch("openpilot.tools.lib.route.Route.log_paths") as log_paths_mock: + log_paths_mock.return_value = [None] * NUM_SEGS + # Should fall back to qlogs since rlogs are not available + + with self.subTest("interactive_yes"): + with mock.patch("sys.stdin", new=io.StringIO("y\n")): + lr = LogReader(f"{TEST_ROUTE}/0", default_mode=ReadMode.AUTO_INTERACTIVE, default_source=comma_api_source) + log_len = len(list(lr)) + self.assertEqual(qlog_len, log_len) + + with self.subTest("interactive_no"): + with mock.patch("sys.stdin", new=io.StringIO("n\n")): + with self.assertRaises(AssertionError): + lr = LogReader(f"{TEST_ROUTE}/0", default_mode=ReadMode.AUTO_INTERACTIVE, default_source=comma_api_source) + + with self.subTest("non_interactive"): + lr = LogReader(f"{TEST_ROUTE}/0", default_mode=ReadMode.AUTO, default_source=comma_api_source) + log_len = len(list(lr)) + self.assertEqual(qlog_len, log_len) + + @parameterized.expand([(True,), (False,)]) + @pytest.mark.slow + def test_auto_source_scenarios(self, is_internal): + lr = LogReader(QLOG_FILE) + qlog_len = len(list(lr)) + + with setup_source_scenario(is_internal=is_internal): + lr = LogReader(f"{TEST_ROUTE}/0/q") + log_len = len(list(lr)) + self.assertEqual(qlog_len, log_len) + if __name__ == "__main__": unittest.main() diff --git a/tools/lib/url_file.py b/tools/lib/url_file.py index 77ed06322..2d3d14ce8 100644 --- a/tools/lib/url_file.py +++ b/tools/lib/url_file.py @@ -4,6 +4,7 @@ import socket import time from hashlib import sha256 from urllib3 import PoolManager, Retry +from urllib3.response import BaseHTTPResponse from urllib3.util import Timeout from openpilot.common.file_helpers import atomic_write_in_dir @@ -14,7 +15,7 @@ CHUNK_SIZE = 1000 * K logging.getLogger("urllib3").setLevel(logging.WARNING) -def hash_256(link): +def hash_256(link: str) -> str: hsh = str(sha256((link.split("?")[0]).encode('utf-8')).hexdigest()) return hsh @@ -23,26 +24,26 @@ class URLFileException(Exception): pass -def new_pool_manager() -> PoolManager: - socket_options = [(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),] - retries = Retry(total=5, backoff_factor=0.5, status_forcelist=[409, 429, 503, 504]) - return PoolManager(num_pools=10, maxsize=100, socket_options=socket_options, retries=retries) - - -def set_pool_manager(): - URLFile._pool_manager = new_pool_manager() -os.register_at_fork(after_in_child=set_pool_manager) - - class URLFile: - _pool_manager = new_pool_manager() + _pool_manager: PoolManager|None = None - def __init__(self, url, timeout=10, debug=False, cache=None): + @staticmethod + def reset() -> None: + URLFile._pool_manager = None + + @staticmethod + def pool_manager() -> PoolManager: + if URLFile._pool_manager is None: + socket_options = [(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),] + retries = Retry(total=5, backoff_factor=0.5, status_forcelist=[409, 429, 503, 504]) + URLFile._pool_manager = PoolManager(num_pools=10, maxsize=100, socket_options=socket_options, retries=retries) + return URLFile._pool_manager + + def __init__(self, url: str, timeout: int=10, debug: bool=False, cache: bool|None=None): self._url = url self._timeout = Timeout(connect=timeout, read=timeout) self._pos = 0 - self._length = None - self._local_file = None + self._length: int|None = None self._debug = debug # True by default, false if FILEREADER_CACHE is defined, but can be overwritten by the cache input self._force_download = not int(os.environ.get("FILEREADER_CACHE", "0")) @@ -55,23 +56,20 @@ class URLFile: def __enter__(self): return self - def __exit__(self, exc_type, exc_value, traceback): - if self._local_file is not None: - os.remove(self._local_file.name) - self._local_file.close() - self._local_file = None + def __exit__(self, exc_type, exc_value, traceback) -> None: + pass - def _request(self, method, url, headers=None): - return URLFile._pool_manager.request(method, url, timeout=self._timeout, headers=headers) + def _request(self, method: str, url: str, headers: dict[str, str]|None=None) -> BaseHTTPResponse: + return URLFile.pool_manager().request(method, url, timeout=self._timeout, headers=headers) - def get_length_online(self): + def get_length_online(self) -> int: response = self._request('HEAD', self._url) if not (200 <= response.status <= 299): return -1 length = response.headers.get('content-length', 0) return int(length) - def get_length(self): + def get_length(self) -> int: if self._length is not None: return self._length @@ -88,7 +86,7 @@ class URLFile: file_length.write(str(self._length)) return self._length - def read(self, ll=None): + def read(self, ll: int|None=None) -> bytes: if self._force_download: return self.read_aux(ll=ll) @@ -120,7 +118,7 @@ class URLFile: self._pos = file_end return response - def read_aux(self, ll=None): + def read_aux(self, ll: int|None=None) -> bytes: download_range = False headers = {} if self._pos != 0 or ll is not None: @@ -155,9 +153,12 @@ class URLFile: self._pos += len(ret) return ret - def seek(self, pos): + def seek(self, pos:int) -> None: self._pos = pos @property - def name(self): + def name(self) -> str: return self._url + + +os.register_at_fork(after_in_child=URLFile.reset) diff --git a/tools/lib/vidindex.py b/tools/lib/vidindex.py index 8156faba6..f2e4e9ca4 100755 --- a/tools/lib/vidindex.py +++ b/tools/lib/vidindex.py @@ -3,7 +3,6 @@ import argparse import os import struct from enum import IntEnum -from typing import Tuple from openpilot.tools.lib.filereader import FileReader @@ -120,7 +119,7 @@ HEVC_CODED_SLICE_SEGMENT_NAL_UNITS = ( class VideoFileInvalid(Exception): pass -def get_ue(dat: bytes, start_idx: int, skip_bits: int) -> Tuple[int, int]: +def get_ue(dat: bytes, start_idx: int, skip_bits: int) -> tuple[int, int]: prefix_val = 0 prefix_len = 0 suffix_val = 0 @@ -184,7 +183,7 @@ def get_hevc_nal_unit_type(dat: bytes, nal_unit_start: int) -> HevcNalUnitType: print(" nal_unit_type:", nal_unit_type.name, f"({nal_unit_type.value})") return nal_unit_type -def get_hevc_slice_type(dat: bytes, nal_unit_start: int, nal_unit_type: HevcNalUnitType) -> Tuple[int, bool]: +def get_hevc_slice_type(dat: bytes, nal_unit_start: int, nal_unit_type: HevcNalUnitType) -> tuple[int, bool]: # 7.3.2.9 Slice segment layer RBSP syntax # slice_segment_layer_rbsp( ) { # slice_segment_header( ) @@ -259,7 +258,7 @@ def get_hevc_slice_type(dat: bytes, nal_unit_start: int, nal_unit_type: HevcNalU raise VideoFileInvalid("slice_type must be 0, 1, or 2") return slice_type, is_first_slice -def hevc_index(hevc_file_name: str, allow_corrupt: bool=False) -> Tuple[list, int, bytes]: +def hevc_index(hevc_file_name: str, allow_corrupt: bool=False) -> tuple[list, int, bytes]: with FileReader(hevc_file_name) as f: dat = f.read()