diff --git a/CHANGELOGS.md b/CHANGELOGS.md index dc92b1c62..bba9bcf94 100644 --- a/CHANGELOGS.md +++ b/CHANGELOGS.md @@ -1,13 +1,27 @@ dragonpilot [latest] - EON/C2 Release ======================== -* Synced with openpilot master 2022.09.01 commits. +* Synced with openpilot master 2022.10.04 commits. + * Live Torque Tune (Only available to certain vehicle models with op long.) +* NEW: TOYOTA - Added a TSS2 RAV4 Special PID Tune toggle. +* NEW: TOYOTA - Added a PRIUS 2017 Special Torque Tune toggle. +* NEW: TOYOTA - PRIUS_TSS2 (2020-2022) now uses torque as default and auto learns. +* NEW: Added a toggle to force enable torque controller. (may not work on some vehicles) +* NEW: Added a toggle to force enable live torque tune. (may not work on some vehicles) +* NEW: Added Dyanmic End to End long. +* NEW: VAG - Added auto resume fix toggle. +* NEW: refactored dynamic follow. support all car with op long. +* FIXED: Minor bug fixes and improvement. + +dragonpilot 2022.09.22 - EON/C2 Release +======================== +* Synced with openpilot master 2022.09.17 commits. * e2e longitudinal toggle. (Extremely alpha feature) * Deprecated SNPE lib and switched to tinygrad. * NEW: Added back nav support on EON/C2. * WARNING: DUE TO THE INTRODUCTION OF END TO END LONGITUDINAL FEATURE, FOLLOWING FEATURES HAS BEEN CHANGED: * WIP: Dynamic Follow has been temporary removed for refactoring. * WIP: Vision Turn Control has been temporary removed for refactoring. - * REMOVED: Camera offset has been removed permanently. + * REMOVED: Camera offset has been removed permanently due to new e2e implementation. * EON/C2 WILL NO LONGER RECEIVE ANY DRIVING/DRIVER MONITORING MODEL UPDATES. dragonpilot 2022.08.29 - EON/C2 Release @@ -39,7 +53,37 @@ dragonpilot 2022.07.29 - EON/C2 Release * FIXED: Fixed Panda Flash/Recovery buttons. * FIXED: Included dp_patcher.py execution. -dragonpilot 2022.07.20 - EON/C2 Release +dragonpilot [latest] +======================= +* Synced with openpilot master 2022.10.04 commits. +* ADDED: Dynamic End to End long. For more detail read the setting description. +* ADDED: Mpad now support's Stop Sign, Yield, Speed Bump, Sharp Curve. (For best experience map you area. https://www.openstreetmap.org/) +* ADDED: Chevron can display either distance or speed. +* ADDED: Toggles to force enabling torque control / torque tune for some vehicles +* Improvement: Dynamic Follow, Toyota Longitudinal and Decel tune. +* bug fix and improvement + +dragonpilot [2022.09.27] +======================= +* Synced with openpilot master 2022.09.27 commits. +* ADDED: Always On Lateral toggle under dp-controls! +* ADDED: Live torque fix pr#25868 +* ADDED: RAV4 and HIGHLANDER with sdsu can use follow distance button on the wheel. +* bug fix and improvement + +dragonpilot [2022.09.19] +======================== +* Synced with openpilot master 2022.09.19 commits. +* READD: refactored dyanmaic follow. support all car with op long. +* ADDED: PRIUS_TSS2 (2020-2022) now uses torque as default and auto learns. +* ADDED: Added a TSS2 RAV4 Special PID Tune toggle. +* ADDED: Added a PRIUS 2017 Special Torque Tune toggle. +* ADDED: Toggle to turn on and off Torque controller. +* ADDED: Toggle to turn on and off auto tune torque controller. +* ADDED: Vision Turn Controller. +* bug fix and improvement + +dragonpilot [2022.09.09] ======================== * Synced with openpilot master 2022.09.09 commits. * ADDED: us-west coast can now use mapd without data. See toggle description for more detail. @@ -47,6 +91,7 @@ dragonpilot 2022.07.20 - EON/C2 Release * bug fix and improvement dragonpilot [2022.09.04] +======================== * Synced with openpilot master 2022.09.01 commits. * Refactor: Dynamic Follow has been removerd temporary. Needs a refactor. (wip) * ADDED: Auto Toyota door lock/unlock **only works on some car** @@ -72,6 +117,9 @@ TWEAK: Enlarged lead car distance text. TWEAK: TOYOTA - Updated lowest speed override feature. FIXED: Fixed Panda Flash/Recovery buttons. FIXED: Included dp_patcher.py execution. + +dragonpilot 2022.07.20 - EON/C2 Release +======================== * FIXED: Included correct camera/path offset values for EON/C2. * FIXED: Param bug in HKG. (Thanks to @sunnyhaibin). * FIXED: Included fan controller for UNO (C2). diff --git a/RELEASES.md b/RELEASES.md index 56cffeebe..35ed1b952 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -2,6 +2,16 @@ Version 0.8.17 (2022-XX-XX) ======================== * New driving model * Internal feature space accuracy increased tenfold during training, this makes the model dramatically more accurate. +* Self-tuning torque lateral controller parameters + * Parameters learned live for each car + * Enabled only on Toyota Corolla for now +* UI updates + * Multi-language in navigation + * Matched speeds shown on car's dash + * Improved update experience + * Border turns grey while overriding steering + * Added button to bookmark events while driving; view them later in comma connect +* AGNOS 6 Version 0.8.16 (2022-08-26) ======================== diff --git a/cereal/car.capnp b/cereal/car.capnp index b49bb66a1..7fb0b36d9 100644 --- a/cereal/car.capnp +++ b/cereal/car.capnp @@ -17,7 +17,8 @@ struct CarEvent @0x9b1657f34caf3ad3 { immediateDisable @6 :Bool; preEnable @7 :Bool; permanent @8 :Bool; # alerts presented regardless of openpilot state - override @9 :Bool; + overrideLateral @10 :Bool; + overrideLongitudinal @9 :Bool; enum EventName @0xbaa8c5d505f727de { canError @0; @@ -35,6 +36,7 @@ struct CarEvent @0x9b1657f34caf3ad3 { pedalPressed @13; # exits active state pedalPressedPreEnable @73; # added during pre-enable state for either pedal gasPressedOverride @108; # added when user is pressing gas with no disengage on gas + steerOverride @114; cruiseDisabled @14; speedTooLow @17; outOfSpace @18; @@ -114,8 +116,8 @@ struct CarEvent @0x9b1657f34caf3ad3 { resumeBlocked @113; #dp - speedLimitActive @114; - speedLimitValueChange @115; + speedLimitActive @115; + speedLimitValueChange @116; radarCanErrorDEPRECATED @15; communityFeatureDisallowedDEPRECATED @62; @@ -515,6 +517,8 @@ struct CarParams { friction @3 :Float32; kf @4 :Float32; steeringAngleDeadzoneDeg @5 :Float32; + latAccelFactor @6 :Float32; + latAccelOffset @7 :Float32; } struct LongitudinalPIDTuning { @@ -625,6 +629,9 @@ struct CarParams { gateway @10; # can gateway hud @11; # heads up display combinationMeter @12; # instrument cluster + electricBrakeBooster @15; + shiftByWire @16; + adas @19; # Toyota only dsu @6; @@ -633,12 +640,13 @@ struct CarParams { # Honda only vsa @13; # Vehicle Stability Assist programmedFuelInjection @14; - electricBrakeBooster @15; - shiftByWire @16; # Chrysler only hcp @18; # Hybrid Control Processor + # Hyundai only + vcu @20; # Vehicle (Motor) Control Unit + debug @17; } diff --git a/cereal/dp.capnp b/cereal/dp.capnp index 147eef63c..addceee5d 100644 --- a/cereal/dp.capnp +++ b/cereal/dp.capnp @@ -20,16 +20,22 @@ struct DragonConf { dpUiSpeed @12 :Bool; dpUiEvent @13 :Bool; dpUiFace @14 :Bool; - dpToyotaSng @15 :Bool; - dpAccelProfileCtrl @16 :Bool; - dpAccelProfile @17 :UInt8; - dpToyotaCruiseOverride @18 :Bool; - dpToyotaCruiseOverrideSpeed @19 :UInt8; - dpToyotaAutoLock @20 :Bool; - dpToyotaAutoUnlock @21 :Bool; - dpMapd @22 :Bool; - dpLocalDb @23 :Bool; - dpDashcamd @24 :Bool; - dpMazdaSteerAlert @25 :Bool; - dpSpeedCheck @26 :Bool; + dpUiChevronDist @15 :Bool; + dpUiChevronSpeed @16 :Bool; + dpToyotaSng @17 :Bool; + dpAccelProfileCtrl @18 :Bool; + dpAccelProfile @19 :UInt8; + dpToyotaCruiseOverride @20 :Bool; + dpToyotaCruiseOverrideSpeed @21 :UInt8; + dpToyotaAutoLock @22 :Bool; + dpToyotaAutoUnlock @23 :Bool; + dpMapd @24 :Bool; + dpLocalDb @25 :Bool; + dpDashcamd @26 :Bool; + dpMazdaSteerAlert @27 :Bool; + dpSpeedCheck @28 :Bool; + dpFollowingProfileCtrl @29 :Bool; + dpFollowingProfile @30 :UInt8; + dpE2EConditional @31 :Bool; + dpE2EConditionalAtSpeed @32 :UInt8; } diff --git a/cereal/libcereal_shared.so b/cereal/libcereal_shared.so index 44070c389..45f6c1f1d 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 72eb08e02..2622193dc 100644 --- a/cereal/log.capnp +++ b/cereal/log.capnp @@ -138,6 +138,7 @@ struct FrameData { gain @15 :Float32; # This includes highConversionGain if enabled measuredGreyFraction @21 :Float32; targetGreyFraction @22 :Float32; + exposureValPercent @27 :Float32; # Focus lensPos @11 :Int32; @@ -151,10 +152,7 @@ struct FrameData { transform @10 :List(Float32); - androidCaptureResult @9 :AndroidCaptureResult; - image @6 :Data; - globalGainDEPRECATED @5 :Int32; temperaturesC @24 :List(Float32); @@ -165,6 +163,15 @@ struct FrameData { front @3; } + sensor @26 :ImageSensor; + enum ImageSensor { + unknown @0; + ar0321 @1; + ox03c10 @2; + } + + globalGainDEPRECATED @5 :Int32; + androidCaptureResultDEPRECATED @9 :AndroidCaptureResult; struct AndroidCaptureResult { sensitivity @0 :Int32; frameDuration @1 :Int64; @@ -221,9 +228,9 @@ struct SensorEventData { fiber @2; velodyne @3; # Velodyne IMU bno055 @4; # Bosch accelerometer - lsm6ds3 @5; # accelerometer (c2) - bmp280 @6; # barometer (c2) - mmc3416x @7; # magnetometer (c2) + lsm6ds3 @5; # includes LSM6DS3 and LSM6DS3TR, TR = tape reel + bmp280 @6; # barometer + mmc3416x @7; # magnetometer bmx055 @8; rpr0521 @9; lsm6ds3trc @10; @@ -393,27 +400,35 @@ struct DeviceState @0xa4d8b5af2aa492eb { struct PandaState @0xa7649e2575e4591e { ignitionLine @2 :Bool; - controlsAllowed @3 :Bool; gasInterceptorDetected @4 :Bool; - canSendErrs @7 :UInt32; - canFwdErrs @8 :UInt32; - canRxErrs @19 :UInt32; + rxBufferOverflow @7 :UInt32; + txBufferOverflow @8 :UInt32; gmlanSendErrs @9 :UInt32; pandaType @10 :PandaType; ignitionCan @13 :Bool; - safetyModel @14 :Car.CarParams.SafetyModel; - safetyParam @27 :UInt16; - alternativeExperience @23 :Int16; faultStatus @15 :FaultStatus; powerSaveEnabled @16 :Bool; uptime @17 :UInt32; faults @18 :List(FaultType); harnessStatus @21 :HarnessStatus; heartbeatLost @22 :Bool; - blockedCnt @24 :UInt32; interruptLoad @25 :Float32; fanPower @28 :UInt8; + # can health + canState0 @29 :PandaCanState; + canState1 @30 :PandaCanState; + canState2 @31 :PandaCanState; + + # safety stuff + controlsAllowed @3 :Bool; + safetyRxInvalid @19 :UInt32; + safetyTxBlocked @24 :UInt32; + safetyModel @14 :Car.CarParams.SafetyModel; + safetyParam @27 :UInt16; + alternativeExperience @23 :Int16; + safetyRxChecksInvalid @32 :Bool; + enum FaultStatus { none @0; faultTemp @1; @@ -456,6 +471,7 @@ struct PandaState @0xa7649e2575e4591e { uno @5; dos @6; redPanda @7; + redPandaV2 @8; } enum HarnessStatus { @@ -469,9 +485,43 @@ struct PandaState @0xa7649e2575e4591e { currentDEPRECATED @1 :UInt32; hasGpsDEPRECATED @6 :Bool; fanSpeedRpmDEPRECATED @11 :UInt16; - usbPowerModeDEPRECATED @12 :PeripheralState.UsbPowerMode; + usbPowerMode @12 :PeripheralState.UsbPowerMode; safetyParamDEPRECATED @20 :Int16; safetyParam2DEPRECATED @26 :UInt32; + + struct PandaCanState { + busOff @0 :Bool; + busOffCnt @1 :UInt32; + errorWarning @2 :Bool; + errorPassive @3 :Bool; + lastError @4 :LecErrorCode; + lastStoredError @5 :LecErrorCode; + lastDataError @6 :LecErrorCode; + lastDataStoredError @7 :LecErrorCode; + receiveErrorCnt @8 :UInt8; + transmitErrorCnt @9 :UInt8; + totalErrorCnt @10 :UInt32; + totalTxLostCnt @11 :UInt32; + totalRxLostCnt @12 :UInt32; + totalTxCnt @13 :UInt32; + totalRxCnt @14 :UInt32; + totalFwdCnt @15 :UInt32; + canSpeed @16 :UInt16; + canDataSpeed @17 :UInt16; + canfdEnabled @18 :Bool; + brsEnabled @19 :Bool; + + enum LecErrorCode { + noError @0; + stuffError @1; + formError @2; + ackError @3; + bit1Error @4; + bit0Error @5; + crcError @6; + noChange @7; + } + } } struct PeripheralState { @@ -609,7 +659,7 @@ struct ControlsState @0x97ff69c53601abf1 { preEnabled @1; enabled @2; softDisabling @3; - overriding @4; + overriding @4; # superset of overriding with steering or accelerator } enum AlertStatus { @@ -889,6 +939,8 @@ struct LongitudinalPlan @0xe00b5b3eba12876c { turnSpeedControlState @45 :SpeedLimitControlState; turnSign @46 :Int16; + dpE2EIsBlended @49 :Bool; + enum LongitudinalPlanSource { cruise @0; lead0 @1; @@ -1792,6 +1844,22 @@ struct LiveParametersData { roll @14 :Float32; } +struct LiveTorqueParametersData { + liveValid @0 :Bool; + latAccelFactorRaw @1 :Float32; + latAccelOffsetRaw @2 :Float32; + frictionCoefficientRaw @3 :Float32; + latAccelFactorFiltered @4 :Float32; + latAccelOffsetFiltered @5 :Float32; + frictionCoefficientFiltered @6 :Float32; + totalBucketPoints @7 :Float32; + decay @8 :Float32; + maxResets @9 :Float32; + points @10 :List(List(Float32)); + version @11 :Int32; + useParams @12 :Bool; +} + struct LiveMapDataDEPRECATED { speedLimitValid @0 :Bool; speedLimit @1 :Float32; @@ -1950,7 +2018,13 @@ struct Event { gpsNMEA @3 :GPSNMEAData; can @5 :List(CanData); controlsState @7 :ControlsState; - sensorEvents @11 :List(SensorEventData); + gyroscope @99 :SensorEventData; + gyroscope2 @100 :SensorEventData; + accelerometer @98 :SensorEventData; + accelerometer2 @101 :SensorEventData; + magnetometer @95 :SensorEventData; + lightSensor @96 :SensorEventData; + temperatureSensor @97 :SensorEventData; pandaStates @81 :List(PandaState); peripheralState @80 :PeripheralState; radarState @13 :RadarState; @@ -1968,6 +2042,7 @@ struct Event { gpsLocation @21 :GpsLocationData; gnssMeasurements @91 :GnssMeasurements; liveParameters @61 :LiveParametersData; + liveTorqueParameters @94 :LiveTorqueParametersData; cameraOdometry @63 :CameraOdometry; thumbnail @66: Thumbnail; carEvents @68: List(Car.CarEvent); @@ -2011,8 +2086,8 @@ struct Event { wideRoadEncodeData @88 :EncodeData; qRoadEncodeData @89 :EncodeData; - dragonConf @94 :Dp.DragonConf; - liveMapData @95: LiveMapData; + dragonConf @102 :Dp.DragonConf; + liveMapData @103: LiveMapData; # *********** legacy + deprecated *********** model @9 :Legacy.ModelData; # TODO: rename modelV2 and mark this as deprecated @@ -2051,5 +2126,6 @@ struct Event { uiLayoutStateDEPRECATED @57 :Legacy.UiLayoutState; pandaStateDEPRECATED @12 :PandaState; driverState @59 :DriverState; + sensorEvents @11 :List(SensorEventData); } } diff --git a/cereal/messaging/bridge b/cereal/messaging/bridge index 484c75cff..2af968bae 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 1f778aff0..7c1657b37 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 79b959644..610dc46c9 100644 --- a/cereal/services.h +++ b/cereal/services.h @@ -4,61 +4,69 @@ struct service { char name[0x100]; int port; bool should_log; int frequency; int decimation; }; static struct service services[] = { { "sensorEvents", 8001, true, 100, 100 }, - { "gpsNMEA", 8002, true, 9, -1 }, - { "deviceState", 8003, true, 2, 1 }, - { "can", 8004, true, 100, -1 }, - { "controlsState", 8005, true, 100, 10 }, - { "pandaStates", 8006, true, 2, 1 }, - { "peripheralState", 8007, true, 2, 1 }, - { "radarState", 8008, true, 20, 5 }, - { "roadEncodeIdx", 8009, false, 20, 1 }, - { "liveTracks", 8010, true, 20, -1 }, - { "sendcan", 8011, true, 100, 139 }, - { "logMessage", 8012, true, 0, -1 }, - { "errorLogMessage", 8013, true, 0, 1 }, - { "liveCalibration", 8014, true, 4, 4 }, - { "androidLog", 8015, true, 0, -1 }, - { "carState", 8016, true, 100, 10 }, - { "carControl", 8017, true, 100, 10 }, - { "longitudinalPlan", 8018, true, 20, 5 }, - { "procLog", 8019, true, 0, -1 }, - { "gpsLocationExternal", 8020, true, 10, 10 }, - { "gpsLocation", 8021, true, 1, 1 }, - { "ubloxGnss", 8023, true, 10, -1 }, - { "qcomGnss", 8024, true, 2, -1 }, - { "gnssMeasurements", 8025, true, 10, 10 }, - { "clocks", 8026, true, 1, 1 }, - { "ubloxRaw", 8027, true, 20, -1 }, - { "liveLocationKalman", 8028, true, 20, 5 }, - { "liveParameters", 8029, true, 20, 5 }, - { "cameraOdometry", 8030, true, 20, 5 }, - { "lateralPlan", 8031, true, 20, 5 }, - { "thumbnail", 8032, true, 0, 1 }, - { "carEvents", 8033, true, 1, 1 }, - { "carParams", 8034, true, 0, 1 }, - { "roadCameraState", 8035, true, 20, 20 }, - { "driverCameraState", 8036, true, 10, 10 }, - { "driverEncodeIdx", 8037, false, 10, 1 }, - { "driverStateV2", 8038, true, 20, 10 }, - { "driverState", 8039, true, 10, 5 }, - { "driverMonitoringState", 8040, true, 10, 5 }, - { "wideRoadEncodeIdx", 8041, false, 20, 1 }, - { "wideRoadCameraState", 8042, true, 20, 20 }, - { "modelV2", 8043, true, 20, 40 }, - { "managerState", 8044, true, 2, 1 }, - { "uploaderState", 8045, true, 0, 1 }, - { "navInstruction", 8046, true, 1, 10 }, - { "navRoute", 8047, true, 0, -1 }, - { "navThumbnail", 8048, true, 0, -1 }, - { "qRoadEncodeIdx", 8049, false, 20, -1 }, - { "userFlag", 8050, true, 0, 1 }, - { "testJoystick", 8051, true, 0, -1 }, - { "roadEncodeData", 8052, false, 20, -1 }, - { "driverEncodeData", 8053, false, 20, -1 }, - { "wideRoadEncodeData", 8054, false, 20, -1 }, - { "qRoadEncodeData", 8055, false, 20, -1 }, - { "dragonConf", 8056, false, 1, -1 }, - { "liveMapData", 8057, true, 0, -1 }, + { "gyroscope", 8002, true, 104, 104 }, + { "gyroscope2", 8003, true, 100, 100 }, + { "accelerometer", 8004, true, 104, 104 }, + { "accelerometer2", 8005, true, 100, 100 }, + { "magnetometer", 8006, true, 100, 100 }, + { "lightSensor", 8007, true, 100, 100 }, + { "temperatureSensor", 8008, true, 100, 100 }, + { "gpsNMEA", 8009, true, 9, -1 }, + { "deviceState", 8010, true, 2, 1 }, + { "can", 8011, true, 100, -1 }, + { "controlsState", 8012, true, 100, 10 }, + { "pandaStates", 8013, true, 2, 1 }, + { "peripheralState", 8014, true, 2, 1 }, + { "radarState", 8015, true, 20, 5 }, + { "roadEncodeIdx", 8016, false, 20, 1 }, + { "liveTracks", 8017, true, 20, -1 }, + { "sendcan", 8018, true, 100, 139 }, + { "logMessage", 8019, true, 0, -1 }, + { "errorLogMessage", 8020, true, 0, 1 }, + { "liveCalibration", 8021, true, 4, 4 }, + { "liveTorqueParameters", 8023, true, 4, 1 }, + { "androidLog", 8024, true, 0, -1 }, + { "carState", 8025, true, 100, 10 }, + { "carControl", 8026, true, 100, 10 }, + { "longitudinalPlan", 8027, true, 20, 5 }, + { "procLog", 8028, true, 0, -1 }, + { "gpsLocationExternal", 8029, true, 10, 10 }, + { "gpsLocation", 8030, true, 1, 1 }, + { "ubloxGnss", 8031, true, 10, -1 }, + { "qcomGnss", 8032, true, 2, -1 }, + { "gnssMeasurements", 8033, true, 10, 10 }, + { "clocks", 8034, true, 1, 1 }, + { "ubloxRaw", 8035, true, 20, -1 }, + { "liveLocationKalman", 8036, true, 20, 5 }, + { "liveParameters", 8037, true, 20, 5 }, + { "cameraOdometry", 8038, true, 20, 5 }, + { "lateralPlan", 8039, true, 20, 5 }, + { "thumbnail", 8040, true, 0, 1 }, + { "carEvents", 8041, true, 1, 1 }, + { "carParams", 8042, true, 0, 1 }, + { "roadCameraState", 8043, true, 20, 20 }, + { "driverCameraState", 8044, true, 10, 10 }, + { "driverEncodeIdx", 8045, false, 10, 1 }, + { "driverStateV2", 8046, true, 20, 10 }, + { "driverState", 8047, true, 10, 5 }, + { "driverMonitoringState", 8048, true, 10, 5 }, + { "wideRoadEncodeIdx", 8049, false, 20, 1 }, + { "wideRoadCameraState", 8050, true, 20, 20 }, + { "modelV2", 8051, true, 20, 40 }, + { "managerState", 8052, true, 2, 1 }, + { "uploaderState", 8053, true, 0, 1 }, + { "navInstruction", 8054, true, 1, 10 }, + { "navRoute", 8055, true, 0, -1 }, + { "navThumbnail", 8056, true, 0, -1 }, + { "qRoadEncodeIdx", 8057, false, 20, -1 }, + { "userFlag", 8058, true, 0, 1 }, + { "testJoystick", 8059, true, 0, -1 }, + { "roadEncodeData", 8060, false, 20, -1 }, + { "driverEncodeData", 8061, false, 20, -1 }, + { "wideRoadEncodeData", 8062, false, 20, -1 }, + { "qRoadEncodeData", 8063, false, 20, -1 }, + { "dragonConf", 8064, false, 1, -1 }, + { "liveMapData", 8065, true, 0, -1 }, }; #endif diff --git a/cereal/services.py b/cereal/services.py index 4ce412a99..4edbc2b0b 100755 --- a/cereal/services.py +++ b/cereal/services.py @@ -22,6 +22,13 @@ services = { # service: (should_log, frequency, qlog decimation (optional)) # note: the "EncodeIdx" packets will still be in the log "sensorEvents": (True, 100., 100), + "gyroscope": (True, 104., 104), + "gyroscope2": (True, 100., 100), + "accelerometer": (True, 104., 104), + "accelerometer2": (True, 100., 100), + "magnetometer": (True, 100., 100), + "lightSensor": (True, 100., 100), + "temperatureSensor": (True, 100., 100), "gpsNMEA": (True, 9.), "deviceState": (True, 2., 1), "can": (True, 100.), @@ -35,6 +42,7 @@ services = { "logMessage": (True, 0.), "errorLogMessage": (True, 0., 1), "liveCalibration": (True, 4., 4), + "liveTorqueParameters": (True, 4., 1), "androidLog": (True, 0.), "carState": (True, 100., 10), "carControl": (True, 100., 10), diff --git a/cereal/visionipc/visionipc_pyx.so b/cereal/visionipc/visionipc_pyx.so index 388616f17..48fa73e5c 100755 Binary files a/cereal/visionipc/visionipc_pyx.so and b/cereal/visionipc/visionipc_pyx.so differ diff --git a/common/dp_conf.py b/common/dp_conf.py index a03dab96b..e47d0a572 100644 --- a/common/dp_conf.py +++ b/common/dp_conf.py @@ -63,6 +63,8 @@ confs = [ {'name': 'dp_ui_speed', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']}, {'name': 'dp_ui_event', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']}, {'name': 'dp_ui_face', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']}, + {'name': 'dp_ui_chevron_dist', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']}, + {'name': 'dp_ui_chevron_speed', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']}, #toyota {'name': 'dp_toyota_sng', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']}, @@ -73,6 +75,7 @@ confs = [ {'name': 'dp_toyota_cruise_override_speed', 'default': 30, 'type': 'UInt8', 'min': 5, 'max': 60, 'depends': [{'name': 'dp_accel_profile_ctrl', 'vals': [True]}], 'conf_type': ['param', 'struct']}, {'name': 'dp_toyota_auto_lock', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']}, {'name': 'dp_toyota_auto_unlock', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']}, + {'name': 'dp_toyota_fp_btn_link', 'default': False, 'type': 'Bool', 'conf_type': ['param']}, {'name': 'dp_mapd', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']}, {'name': 'dp_local_db', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']}, @@ -104,8 +107,10 @@ confs = [ # {'name': 'dp_lane_less_mode', 'default': 2, 'type': 'UInt8', 'min': 0, 'max': 2, 'depends': [{'name': 'dp_lane_less_mode_ctrl', 'vals': [True]}], 'conf_type': ['param', 'struct']}, # # long ctrl # {'name': 'dp_allow_gas', 'default': False, 'type': 'Bool', 'depends': [{'name': 'dp_atl', 'vals': [False]}], 'conf_type': ['param', 'struct']}, - # #{'name': 'dp_following_profile_ctrl', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']}, - # #{'name': 'dp_following_profile', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 3, 'depends': [{'name': 'dp_following_profile_ctrl', 'vals': [True]}], 'conf_type': ['param', 'struct']}, + {'name': 'dp_following_profile_ctrl', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']}, + {'name': 'dp_following_profile', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 2, 'depends': [{'name': 'dp_following_profile_ctrl', 'vals': [True]}], 'conf_type': ['param', 'struct']}, + {'name': 'dp_lateral_torque', 'default': False, 'type': 'Bool', 'conf_type': ['param']}, + {'name': 'dp_lateral_torque_live_tune', 'default': False, 'type': 'Bool', 'conf_type': ['param']}, # {'name': 'dp_accel_profile_ctrl', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']}, # {'name': 'dp_accel_profile', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 2, 'depends': [{'name': 'dp_accel_profile_ctrl', 'vals': [True]}], 'conf_type': ['param', 'struct']}, # # safety @@ -124,6 +129,10 @@ confs = [ # {'name': 'dp_ui_brightness', 'default': 0, 'type': 'UInt8', 'min': 0, 'max': 100, 'conf_type': ['param', 'struct']}, # {'name': 'dp_ui_volume', 'default': -5, 'type': 'Int8', 'min': -5, 'max': 100, 'conf_type': ['param', 'struct']}, # # toyota + {'name': 'dp_toyota_rav4_tss2_tune', 'default': False, 'type': 'Bool', 'conf_type': ['param']}, + {'name': 'dp_toyota_prius_bad_angle_tune', 'default': False, 'type': 'Bool', 'conf_type': ['param']}, + {'name': 'dp_e2e_conditional', 'default': False, 'type': 'Bool', 'conf_type': ['param', 'struct']}, + {'name': 'dp_e2e_conditional_at_speed', 'default': 60, 'type': 'UInt8', 'min': 30, 'max': 80, 'depends': [{'name': 'dp_e2e_conditional', 'vals': [True]}], 'conf_type': ['param', 'struct']}, # {'name': 'dp_toyota_no_min_acc_limit', 'default': False, 'type': 'Bool', 'conf_type': ['param']}, # {'name': 'dp_toyota_ldw', 'default': True, 'type': 'Bool', 'conf_type': ['param', 'struct']}, # {'name': 'dp_toyota_zss', 'default': False, 'type': 'Bool', 'conf_type': ['param']}, diff --git a/common/gpio.h b/common/gpio.h index e03001987..b2f67f8ba 100644 --- a/common/gpio.h +++ b/common/gpio.h @@ -8,6 +8,11 @@ #define GPIO_UBLOX_PWR_EN 34 #define GPIO_STM_RST_N 124 #define GPIO_STM_BOOT0 134 + #define GPIO_BMX_ACCEL_INT 21 + #define GPIO_BMX_GYRO_INT 23 + #define GPIO_BMX_MAGN_INT 87 + #define GPIO_LSM_INT 84 + #define GPIOCHIP_INT 0 #else #define GPIO_HUB_RST_N 0 #define GPIO_UBLOX_RST_N 0 @@ -15,7 +20,14 @@ #define GPIO_UBLOX_PWR_EN 0 #define GPIO_STM_RST_N 0 #define GPIO_STM_BOOT0 0 + #define GPIO_BMX_ACCEL_INT 0 + #define GPIO_BMX_GYRO_INT 0 + #define GPIO_BMX_MAGN_INT 0 + #define GPIO_LSM_INT 0 + #define GPIOCHIP_INT 0 #endif int gpio_init(int pin_nr, bool output); int gpio_set(int pin_nr, bool high); + +int gpiochip_get_ro_value_fd(const char* consumer_label, int gpiochiop_id, int pin_nr); diff --git a/common/modeldata.h b/common/modeldata.h index 7b1ab5152..13d349899 100644 --- a/common/modeldata.h +++ b/common/modeldata.h @@ -4,7 +4,7 @@ #include "common/mat.h" #include "system/hardware/hw.h" -const int TRAJECTORY_SIZE = 33; +const int TRAJECTORY_SIZE = 33; const int LAT_MPC_N = 16; const int LON_MPC_N = 32; const float MIN_DRAW_DISTANCE = 10.0; diff --git a/common/params.h b/common/params.h index aa4b1d7af..7758a015f 100644 --- a/common/params.h +++ b/common/params.h @@ -2,6 +2,7 @@ #include #include +#include enum ParamKeyType { PERSISTENT = 0x02, @@ -15,6 +16,7 @@ enum ParamKeyType { class Params { public: Params(const std::string &path = {}); + std::vector allKeys() const; bool checkKey(const std::string &key); ParamKeyType getKeyType(const std::string &key); inline std::string getParamPath(const std::string &key = {}) { diff --git a/common/params_pyx.cpp b/common/params_pyx.cpp index a84118979..75dfaed87 100644 --- a/common/params_pyx.cpp +++ b/common/params_pyx.cpp @@ -712,6 +712,7 @@ static CYTHON_INLINE float __PYX_NAN() { #include "new" #include "stdexcept" #include "typeinfo" +#include #include "common/params.h" #ifdef _OPENMP #include @@ -944,7 +945,7 @@ struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking; struct __pyx_obj_6common_10params_pyx___pyx_scope_struct_1_put_bool_nonblocking; struct __pyx_obj___Pyx_EnumMeta; -/* "common/params_pyx.pyx":33 +/* "common/params_pyx.pyx":35 * pass * * cdef class Params: # <<<<<<<<<<<<<< @@ -957,8 +958,8 @@ struct __pyx_obj_6common_10params_pyx_Params { }; -/* "common/params_pyx.pyx":102 - * return self.p.getParamPath(key_bytes).decode("utf-8") +/* "common/params_pyx.pyx":107 + * return self.p.allKeys() * * def put_nonblocking(key, val, d=""): # <<<<<<<<<<<<<< * threading.Thread(target=lambda: Params(d).put(key, val)).start() @@ -972,7 +973,7 @@ struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking { }; -/* "common/params_pyx.pyx":105 +/* "common/params_pyx.pyx":110 * threading.Thread(target=lambda: Params(d).put(key, val)).start() * * def put_bool_nonblocking(key, bool val, d=""): # <<<<<<<<<<<<<< @@ -1325,6 +1326,23 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, PyObject *module, PyObject *globals, PyObject* code); +/* ListCompAppend.proto */ +#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS +static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); + if (likely(L->allocated > len)) { + Py_INCREF(x); + PyList_SET_ITEM(list, len, x); + __Pyx_SET_SIZE(list, len + 1); + return 0; + } + return PyList_Append(list, x); +} +#else +#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) +#endif + /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) @@ -1469,6 +1487,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ParamKeyType(enum ParamKey /* CIntFromPy.proto */ static CYTHON_INLINE enum ParamKeyType __Pyx_PyInt_As_enum__ParamKeyType(PyObject *); +/* CIntFromPy.proto */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *); + /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); @@ -1504,6 +1525,8 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libcpp.string' */ +/* Module declarations from 'libcpp.vector' */ + /* Module declarations from 'common.params_pyx' */ static PyTypeObject *__pyx_ptype_6common_10params_pyx_Params = 0; static PyTypeObject *__pyx_ptype_6common_10params_pyx___pyx_scope_struct__put_nonblocking = 0; @@ -1518,6 +1541,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_stri static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/ static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/ +static PyObject *__pyx_convert_vector_to_py_std_3a__3a_string(const std::vector &); /*proto*/ static PyObject *__pyx_unpickle___Pyx_EnumMeta__set_state(struct __pyx_obj___Pyx_EnumMeta *, PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "common.params_pyx" extern int __pyx_module_is_main_common__params_pyx; @@ -1526,6 +1550,7 @@ int __pyx_module_is_main_common__params_pyx = 0; /* Implementation of 'common.params_pyx' */ static PyObject *__pyx_builtin_KeyboardInterrupt; static PyObject *__pyx_builtin_TypeError; +static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_ValueError; static const char __pyx_k_[] = ""; static const char __pyx_k_d[] = "d"; @@ -1552,6 +1577,7 @@ static const char __pyx_k_self[] = "self"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_block[] = "block"; static const char __pyx_k_class[] = "__class__"; +static const char __pyx_k_range[] = "range"; static const char __pyx_k_s_s_d[] = "<%s.%s: %d>"; static const char __pyx_k_start[] = "start"; static const char __pyx_k_value[] = "value"; @@ -1689,6 +1715,7 @@ static PyObject *__pyx_n_s_pyx_state; static PyObject *__pyx_n_s_pyx_type; static PyObject *__pyx_n_s_pyx_unpickle___Pyx_EnumMeta; static PyObject *__pyx_n_s_qualname; +static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_reduce; static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_reduce_ex; @@ -1722,8 +1749,9 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_12put(struct __pyx_obj_6c static PyObject *__pyx_pf_6common_10params_pyx_6Params_14put_bool(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key, bool __pyx_v_val); /* proto */ static PyObject *__pyx_pf_6common_10params_pyx_6Params_16remove(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_6common_10params_pyx_6Params_18get_param_path(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, PyObject *__pyx_v_key); /* proto */ -static PyObject *__pyx_pf_6common_10params_pyx_6Params_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_6common_10params_pyx_6Params_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_6Params_20all_keys(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_6Params_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_6common_10params_pyx_6Params_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_6common_10params_pyx_2put_nonblocking(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val, PyObject *__pyx_v_d); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self); /* proto */ @@ -1762,7 +1790,7 @@ static PyObject *__pyx_codeobj__17; static PyObject *__pyx_codeobj__19; /* Late includes */ -/* "common/params_pyx.pyx":27 +/* "common/params_pyx.pyx":29 * * * def ensure_bytes(v): # <<<<<<<<<<<<<< @@ -1797,7 +1825,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_ensure_bytes(CYTHON_UNUSED PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("ensure_bytes", 0); - /* "common/params_pyx.pyx":28 + /* "common/params_pyx.pyx":30 * * def ensure_bytes(v): * return v.encode() if isinstance(v, str) else v; # <<<<<<<<<<<<<< @@ -1807,7 +1835,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_ensure_bytes(CYTHON_UNUSED PyObje __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyUnicode_Check(__pyx_v_v); if ((__pyx_t_2 != 0)) { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -1821,7 +1849,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_ensure_bytes(CYTHON_UNUSED PyObje } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_3; @@ -1834,7 +1862,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_ensure_bytes(CYTHON_UNUSED PyObje __pyx_t_1 = 0; goto __pyx_L0; - /* "common/params_pyx.pyx":27 + /* "common/params_pyx.pyx":29 * * * def ensure_bytes(v): # <<<<<<<<<<<<<< @@ -1856,7 +1884,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_ensure_bytes(CYTHON_UNUSED PyObje return __pyx_r; } -/* "common/params_pyx.pyx":36 +/* "common/params_pyx.pyx":38 * cdef c_Params* p * * def __cinit__(self, d=""): # <<<<<<<<<<<<<< @@ -1896,7 +1924,7 @@ static int __pyx_pw_6common_10params_pyx_6Params_1__cinit__(PyObject *__pyx_v_se } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 36, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 38, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -1910,7 +1938,7 @@ static int __pyx_pw_6common_10params_pyx_6Params_1__cinit__(PyObject *__pyx_v_se } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 38, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("common.params_pyx.Params.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -1936,14 +1964,14 @@ static int __pyx_pf_6common_10params_pyx_6Params___cinit__(struct __pyx_obj_6com int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "common/params_pyx.pyx":37 + /* "common/params_pyx.pyx":39 * * def __cinit__(self, d=""): * cdef string path = d.encode() # <<<<<<<<<<<<<< * with nogil: * self.p = new c_Params(path) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -1957,14 +1985,14 @@ static int __pyx_pf_6common_10params_pyx_6Params___cinit__(struct __pyx_obj_6com } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_path = ((std::string)__pyx_t_4); - /* "common/params_pyx.pyx":38 + /* "common/params_pyx.pyx":40 * def __cinit__(self, d=""): * cdef string path = d.encode() * with nogil: # <<<<<<<<<<<<<< @@ -1979,7 +2007,7 @@ static int __pyx_pf_6common_10params_pyx_6Params___cinit__(struct __pyx_obj_6com #endif /*try:*/ { - /* "common/params_pyx.pyx":39 + /* "common/params_pyx.pyx":41 * cdef string path = d.encode() * with nogil: * self.p = new c_Params(path) # <<<<<<<<<<<<<< @@ -1989,7 +2017,7 @@ static int __pyx_pf_6common_10params_pyx_6Params___cinit__(struct __pyx_obj_6com __pyx_v_self->p = new Params(__pyx_v_path); } - /* "common/params_pyx.pyx":38 + /* "common/params_pyx.pyx":40 * def __cinit__(self, d=""): * cdef string path = d.encode() * with nogil: # <<<<<<<<<<<<<< @@ -2008,7 +2036,7 @@ static int __pyx_pf_6common_10params_pyx_6Params___cinit__(struct __pyx_obj_6com } } - /* "common/params_pyx.pyx":36 + /* "common/params_pyx.pyx":38 * cdef c_Params* p * * def __cinit__(self, d=""): # <<<<<<<<<<<<<< @@ -2030,7 +2058,7 @@ static int __pyx_pf_6common_10params_pyx_6Params___cinit__(struct __pyx_obj_6com return __pyx_r; } -/* "common/params_pyx.pyx":41 +/* "common/params_pyx.pyx":43 * self.p = new c_Params(path) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2053,7 +2081,7 @@ static void __pyx_pf_6common_10params_pyx_6Params_2__dealloc__(struct __pyx_obj_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "common/params_pyx.pyx":42 + /* "common/params_pyx.pyx":44 * * def __dealloc__(self): * del self.p # <<<<<<<<<<<<<< @@ -2062,7 +2090,7 @@ static void __pyx_pf_6common_10params_pyx_6Params_2__dealloc__(struct __pyx_obj_ */ delete __pyx_v_self->p; - /* "common/params_pyx.pyx":41 + /* "common/params_pyx.pyx":43 * self.p = new c_Params(path) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2074,7 +2102,7 @@ static void __pyx_pf_6common_10params_pyx_6Params_2__dealloc__(struct __pyx_obj_ __Pyx_RefNannyFinishContext(); } -/* "common/params_pyx.pyx":44 +/* "common/params_pyx.pyx":46 * del self.p * * def clear_all(self, tx_type=ParamKeyType.ALL): # <<<<<<<<<<<<<< @@ -2114,7 +2142,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_6Params_5clear_all(PyObject *__py } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clear_all") < 0)) __PYX_ERR(0, 44, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clear_all") < 0)) __PYX_ERR(0, 46, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2128,7 +2156,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_6Params_5clear_all(PyObject *__py } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("clear_all", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("clear_all", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 46, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("common.params_pyx.Params.clear_all", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2150,17 +2178,17 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_4clear_all(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("clear_all", 0); - /* "common/params_pyx.pyx":45 + /* "common/params_pyx.pyx":47 * * def clear_all(self, tx_type=ParamKeyType.ALL): * self.p.clearAll(tx_type) # <<<<<<<<<<<<<< * * def check_key(self, key): */ - __pyx_t_1 = ((enum ParamKeyType)__Pyx_PyInt_As_enum__ParamKeyType(__pyx_v_tx_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error) + __pyx_t_1 = ((enum ParamKeyType)__Pyx_PyInt_As_enum__ParamKeyType(__pyx_v_tx_type)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_v_self->p->clearAll(__pyx_t_1); - /* "common/params_pyx.pyx":44 + /* "common/params_pyx.pyx":46 * del self.p * * def clear_all(self, tx_type=ParamKeyType.ALL): # <<<<<<<<<<<<<< @@ -2180,7 +2208,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_4clear_all(struct __pyx_o return __pyx_r; } -/* "common/params_pyx.pyx":47 +/* "common/params_pyx.pyx":49 * self.p.clearAll(tx_type) * * def check_key(self, key): # <<<<<<<<<<<<<< @@ -2215,14 +2243,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_6check_key(struct __pyx_o __Pyx_RefNannySetupContext("check_key", 0); __Pyx_INCREF(__pyx_v_key); - /* "common/params_pyx.pyx":48 + /* "common/params_pyx.pyx":50 * * def check_key(self, key): * key = ensure_bytes(key) # <<<<<<<<<<<<<< * if not self.p.checkKey(key): * raise UnknownKeyName(key) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -2236,31 +2264,31 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_6check_key(struct __pyx_o } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); __pyx_t_1 = 0; - /* "common/params_pyx.pyx":49 + /* "common/params_pyx.pyx":51 * def check_key(self, key): * key = ensure_bytes(key) * if not self.p.checkKey(key): # <<<<<<<<<<<<<< * raise UnknownKeyName(key) * return key */ - __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error) __pyx_t_5 = ((!(__pyx_v_self->p->checkKey(__pyx_t_4) != 0)) != 0); if (unlikely(__pyx_t_5)) { - /* "common/params_pyx.pyx":50 + /* "common/params_pyx.pyx":52 * key = ensure_bytes(key) * if not self.p.checkKey(key): * raise UnknownKeyName(key) # <<<<<<<<<<<<<< * return key * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnknownKeyName); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnknownKeyName); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -2274,14 +2302,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_6check_key(struct __pyx_o } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 50, __pyx_L1_error) + __PYX_ERR(0, 52, __pyx_L1_error) - /* "common/params_pyx.pyx":49 + /* "common/params_pyx.pyx":51 * def check_key(self, key): * key = ensure_bytes(key) * if not self.p.checkKey(key): # <<<<<<<<<<<<<< @@ -2290,7 +2318,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_6check_key(struct __pyx_o */ } - /* "common/params_pyx.pyx":51 + /* "common/params_pyx.pyx":53 * if not self.p.checkKey(key): * raise UnknownKeyName(key) * return key # <<<<<<<<<<<<<< @@ -2302,7 +2330,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_6check_key(struct __pyx_o __pyx_r = __pyx_v_key; goto __pyx_L0; - /* "common/params_pyx.pyx":47 + /* "common/params_pyx.pyx":49 * self.p.clearAll(tx_type) * * def check_key(self, key): # <<<<<<<<<<<<<< @@ -2324,7 +2352,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_6check_key(struct __pyx_o return __pyx_r; } -/* "common/params_pyx.pyx":53 +/* "common/params_pyx.pyx":55 * return key * * def get(self, key, bool block=False, encoding=None): # <<<<<<<<<<<<<< @@ -2380,7 +2408,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_6Params_9get(PyObject *__pyx_v_se } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 53, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(0, 55, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -2395,7 +2423,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_6Params_9get(PyObject *__pyx_v_se } __pyx_v_key = values[0]; if (values[1]) { - __pyx_v_block = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_block == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L3_error) + __pyx_v_block = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_block == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error) } else { __pyx_v_block = ((bool)0); } @@ -2403,7 +2431,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_6Params_9get(PyObject *__pyx_v_se } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 53, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 55, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("common.params_pyx.Params.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2432,14 +2460,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get", 0); - /* "common/params_pyx.pyx":54 + /* "common/params_pyx.pyx":56 * * def get(self, key, bool block=False, encoding=None): * cdef string k = self.check_key(key) # <<<<<<<<<<<<<< * cdef string val * with nogil: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -2453,14 +2481,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_k = __pyx_t_4; - /* "common/params_pyx.pyx":56 + /* "common/params_pyx.pyx":58 * cdef string k = self.check_key(key) * cdef string val * with nogil: # <<<<<<<<<<<<<< @@ -2475,7 +2503,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co #endif /*try:*/ { - /* "common/params_pyx.pyx":57 + /* "common/params_pyx.pyx":59 * cdef string val * with nogil: * val = self.p.get(k, block) # <<<<<<<<<<<<<< @@ -2485,7 +2513,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co __pyx_v_val = __pyx_v_self->p->get(__pyx_v_k, __pyx_v_block); } - /* "common/params_pyx.pyx":56 + /* "common/params_pyx.pyx":58 * cdef string k = self.check_key(key) * cdef string val * with nogil: # <<<<<<<<<<<<<< @@ -2504,7 +2532,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co } } - /* "common/params_pyx.pyx":59 + /* "common/params_pyx.pyx":61 * val = self.p.get(k, block) * * if val == b"": # <<<<<<<<<<<<<< @@ -2514,7 +2542,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co __pyx_t_5 = ((__pyx_v_val == ((char const *)"")) != 0); if (__pyx_t_5) { - /* "common/params_pyx.pyx":60 + /* "common/params_pyx.pyx":62 * * if val == b"": * if block: # <<<<<<<<<<<<<< @@ -2524,7 +2552,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co __pyx_t_5 = (__pyx_v_block != 0); if (unlikely(__pyx_t_5)) { - /* "common/params_pyx.pyx":63 + /* "common/params_pyx.pyx":65 * # If we got no value while running in blocked mode * # it means we got an interrupt while waiting * raise KeyboardInterrupt # <<<<<<<<<<<<<< @@ -2532,9 +2560,9 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co * return None */ __Pyx_Raise(__pyx_builtin_KeyboardInterrupt, 0, 0, 0); - __PYX_ERR(0, 63, __pyx_L1_error) + __PYX_ERR(0, 65, __pyx_L1_error) - /* "common/params_pyx.pyx":60 + /* "common/params_pyx.pyx":62 * * if val == b"": * if block: # <<<<<<<<<<<<<< @@ -2543,7 +2571,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co */ } - /* "common/params_pyx.pyx":65 + /* "common/params_pyx.pyx":67 * raise KeyboardInterrupt * else: * return None # <<<<<<<<<<<<<< @@ -2556,7 +2584,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co goto __pyx_L0; } - /* "common/params_pyx.pyx":59 + /* "common/params_pyx.pyx":61 * val = self.p.get(k, block) * * if val == b"": # <<<<<<<<<<<<<< @@ -2565,7 +2593,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co */ } - /* "common/params_pyx.pyx":67 + /* "common/params_pyx.pyx":69 * return None * * return val if encoding is None else val.decode(encoding) # <<<<<<<<<<<<<< @@ -2575,14 +2603,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co __Pyx_XDECREF(__pyx_r); __pyx_t_5 = (__pyx_v_encoding == Py_None); if ((__pyx_t_5 != 0)) { - __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { - __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 67, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_decode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -2597,7 +2625,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_encoding) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_encoding); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_1 = __pyx_t_2; @@ -2607,7 +2635,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co __pyx_t_1 = 0; goto __pyx_L0; - /* "common/params_pyx.pyx":53 + /* "common/params_pyx.pyx":55 * return key * * def get(self, key, bool block=False, encoding=None): # <<<<<<<<<<<<<< @@ -2629,7 +2657,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_8get(struct __pyx_obj_6co return __pyx_r; } -/* "common/params_pyx.pyx":69 +/* "common/params_pyx.pyx":71 * return val if encoding is None else val.decode(encoding) * * def get_bool(self, key): # <<<<<<<<<<<<<< @@ -2664,14 +2692,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_10get_bool(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_bool", 0); - /* "common/params_pyx.pyx":70 + /* "common/params_pyx.pyx":72 * * def get_bool(self, key): * cdef string k = self.check_key(key) # <<<<<<<<<<<<<< * cdef bool r * with nogil: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -2685,14 +2713,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_10get_bool(struct __pyx_o } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 72, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_k = __pyx_t_4; - /* "common/params_pyx.pyx":72 + /* "common/params_pyx.pyx":74 * cdef string k = self.check_key(key) * cdef bool r * with nogil: # <<<<<<<<<<<<<< @@ -2707,7 +2735,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_10get_bool(struct __pyx_o #endif /*try:*/ { - /* "common/params_pyx.pyx":73 + /* "common/params_pyx.pyx":75 * cdef bool r * with nogil: * r = self.p.getBool(k) # <<<<<<<<<<<<<< @@ -2717,7 +2745,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_10get_bool(struct __pyx_o __pyx_v_r = __pyx_v_self->p->getBool(__pyx_v_k); } - /* "common/params_pyx.pyx":72 + /* "common/params_pyx.pyx":74 * cdef string k = self.check_key(key) * cdef bool r * with nogil: # <<<<<<<<<<<<<< @@ -2736,7 +2764,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_10get_bool(struct __pyx_o } } - /* "common/params_pyx.pyx":74 + /* "common/params_pyx.pyx":76 * with nogil: * r = self.p.getBool(k) * return r # <<<<<<<<<<<<<< @@ -2744,13 +2772,13 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_10get_bool(struct __pyx_o * def put(self, key, dat): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "common/params_pyx.pyx":69 + /* "common/params_pyx.pyx":71 * return val if encoding is None else val.decode(encoding) * * def get_bool(self, key): # <<<<<<<<<<<<<< @@ -2771,7 +2799,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_10get_bool(struct __pyx_o return __pyx_r; } -/* "common/params_pyx.pyx":76 +/* "common/params_pyx.pyx":78 * return r * * def put(self, key, dat): # <<<<<<<<<<<<<< @@ -2814,11 +2842,11 @@ static PyObject *__pyx_pw_6common_10params_pyx_6Params_13put(PyObject *__pyx_v_s case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dat)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, 1); __PYX_ERR(0, 76, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, 1); __PYX_ERR(0, 78, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 76, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put") < 0)) __PYX_ERR(0, 78, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -2831,7 +2859,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_6Params_13put(PyObject *__pyx_v_s } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 76, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 78, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("common.params_pyx.Params.put", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -2858,14 +2886,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_12put(struct __pyx_obj_6c int __pyx_clineno = 0; __Pyx_RefNannySetupContext("put", 0); - /* "common/params_pyx.pyx":83 + /* "common/params_pyx.pyx":85 * in general try to avoid writing params as much as possible. * """ * cdef string k = self.check_key(key) # <<<<<<<<<<<<<< * cdef string dat_bytes = ensure_bytes(dat) * with nogil: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -2879,21 +2907,21 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_12put(struct __pyx_obj_6c } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 85, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_k = __pyx_t_4; - /* "common/params_pyx.pyx":84 + /* "common/params_pyx.pyx":86 * """ * cdef string k = self.check_key(key) * cdef string dat_bytes = ensure_bytes(dat) # <<<<<<<<<<<<<< * with nogil: * self.p.put(k, dat_bytes) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -2907,14 +2935,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_12put(struct __pyx_obj_6c } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_dat) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_dat); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dat_bytes = __pyx_t_4; - /* "common/params_pyx.pyx":85 + /* "common/params_pyx.pyx":87 * cdef string k = self.check_key(key) * cdef string dat_bytes = ensure_bytes(dat) * with nogil: # <<<<<<<<<<<<<< @@ -2929,7 +2957,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_12put(struct __pyx_obj_6c #endif /*try:*/ { - /* "common/params_pyx.pyx":86 + /* "common/params_pyx.pyx":88 * cdef string dat_bytes = ensure_bytes(dat) * with nogil: * self.p.put(k, dat_bytes) # <<<<<<<<<<<<<< @@ -2939,7 +2967,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_12put(struct __pyx_obj_6c (void)(__pyx_v_self->p->put(__pyx_v_k, __pyx_v_dat_bytes)); } - /* "common/params_pyx.pyx":85 + /* "common/params_pyx.pyx":87 * cdef string k = self.check_key(key) * cdef string dat_bytes = ensure_bytes(dat) * with nogil: # <<<<<<<<<<<<<< @@ -2958,7 +2986,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_12put(struct __pyx_obj_6c } } - /* "common/params_pyx.pyx":76 + /* "common/params_pyx.pyx":78 * return r * * def put(self, key, dat): # <<<<<<<<<<<<<< @@ -2981,7 +3009,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_12put(struct __pyx_obj_6c return __pyx_r; } -/* "common/params_pyx.pyx":88 +/* "common/params_pyx.pyx":90 * self.p.put(k, dat_bytes) * * def put_bool(self, key, bool val): # <<<<<<<<<<<<<< @@ -3023,11 +3051,11 @@ static PyObject *__pyx_pw_6common_10params_pyx_6Params_15put_bool(PyObject *__py case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("put_bool", 1, 2, 2, 1); __PYX_ERR(0, 88, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("put_bool", 1, 2, 2, 1); __PYX_ERR(0, 90, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put_bool") < 0)) __PYX_ERR(0, 88, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put_bool") < 0)) __PYX_ERR(0, 90, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -3036,11 +3064,11 @@ static PyObject *__pyx_pw_6common_10params_pyx_6Params_15put_bool(PyObject *__py values[1] = PyTuple_GET_ITEM(__pyx_args, 1); } __pyx_v_key = values[0]; - __pyx_v_val = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_val == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L3_error) + __pyx_v_val = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_val == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 90, __pyx_L3_error) } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("put_bool", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 88, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("put_bool", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 90, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("common.params_pyx.Params.put_bool", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3066,14 +3094,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_14put_bool(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("put_bool", 0); - /* "common/params_pyx.pyx":89 + /* "common/params_pyx.pyx":91 * * def put_bool(self, key, bool val): * cdef string k = self.check_key(key) # <<<<<<<<<<<<<< * with nogil: * self.p.putBool(k, val) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -3087,14 +3115,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_14put_bool(struct __pyx_o } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_k = __pyx_t_4; - /* "common/params_pyx.pyx":90 + /* "common/params_pyx.pyx":92 * def put_bool(self, key, bool val): * cdef string k = self.check_key(key) * with nogil: # <<<<<<<<<<<<<< @@ -3109,7 +3137,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_14put_bool(struct __pyx_o #endif /*try:*/ { - /* "common/params_pyx.pyx":91 + /* "common/params_pyx.pyx":93 * cdef string k = self.check_key(key) * with nogil: * self.p.putBool(k, val) # <<<<<<<<<<<<<< @@ -3119,7 +3147,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_14put_bool(struct __pyx_o (void)(__pyx_v_self->p->putBool(__pyx_v_k, __pyx_v_val)); } - /* "common/params_pyx.pyx":90 + /* "common/params_pyx.pyx":92 * def put_bool(self, key, bool val): * cdef string k = self.check_key(key) * with nogil: # <<<<<<<<<<<<<< @@ -3138,7 +3166,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_14put_bool(struct __pyx_o } } - /* "common/params_pyx.pyx":88 + /* "common/params_pyx.pyx":90 * self.p.put(k, dat_bytes) * * def put_bool(self, key, bool val): # <<<<<<<<<<<<<< @@ -3161,7 +3189,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_14put_bool(struct __pyx_o return __pyx_r; } -/* "common/params_pyx.pyx":93 +/* "common/params_pyx.pyx":95 * self.p.putBool(k, val) * * def remove(self, key): # <<<<<<<<<<<<<< @@ -3195,14 +3223,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_16remove(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove", 0); - /* "common/params_pyx.pyx":94 + /* "common/params_pyx.pyx":96 * * def remove(self, key): * cdef string k = self.check_key(key) # <<<<<<<<<<<<<< * with nogil: * self.p.remove(k) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_check_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -3216,14 +3244,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_16remove(struct __pyx_obj } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 94, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_k = __pyx_t_4; - /* "common/params_pyx.pyx":95 + /* "common/params_pyx.pyx":97 * def remove(self, key): * cdef string k = self.check_key(key) * with nogil: # <<<<<<<<<<<<<< @@ -3238,7 +3266,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_16remove(struct __pyx_obj #endif /*try:*/ { - /* "common/params_pyx.pyx":96 + /* "common/params_pyx.pyx":98 * cdef string k = self.check_key(key) * with nogil: * self.p.remove(k) # <<<<<<<<<<<<<< @@ -3248,7 +3276,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_16remove(struct __pyx_obj (void)(__pyx_v_self->p->remove(__pyx_v_k)); } - /* "common/params_pyx.pyx":95 + /* "common/params_pyx.pyx":97 * def remove(self, key): * cdef string k = self.check_key(key) * with nogil: # <<<<<<<<<<<<<< @@ -3267,7 +3295,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_16remove(struct __pyx_obj } } - /* "common/params_pyx.pyx":93 + /* "common/params_pyx.pyx":95 * self.p.putBool(k, val) * * def remove(self, key): # <<<<<<<<<<<<<< @@ -3290,7 +3318,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_16remove(struct __pyx_obj return __pyx_r; } -/* "common/params_pyx.pyx":98 +/* "common/params_pyx.pyx":100 * self.p.remove(k) * * def get_param_path(self, key=""): # <<<<<<<<<<<<<< @@ -3330,7 +3358,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_6Params_19get_param_path(PyObject } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_param_path") < 0)) __PYX_ERR(0, 98, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_param_path") < 0)) __PYX_ERR(0, 100, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3344,7 +3372,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_6Params_19get_param_path(PyObject } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_param_path", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 98, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_param_path", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("common.params_pyx.Params.get_param_path", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3370,14 +3398,14 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_18get_param_path(struct _ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_param_path", 0); - /* "common/params_pyx.pyx":99 + /* "common/params_pyx.pyx":101 * * def get_param_path(self, key=""): * cdef string key_bytes = ensure_bytes(key) # <<<<<<<<<<<<<< * return self.p.getParamPath(key_bytes).decode("utf-8") * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ensure_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { @@ -3391,28 +3419,28 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_18get_param_path(struct _ } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_key) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_key_bytes = __pyx_t_4; - /* "common/params_pyx.pyx":100 + /* "common/params_pyx.pyx":102 * def get_param_path(self, key=""): * cdef string key_bytes = ensure_bytes(key) * return self.p.getParamPath(key_bytes).decode("utf-8") # <<<<<<<<<<<<<< * - * def put_nonblocking(key, val, d=""): + * def all_keys(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->p->getParamPath(__pyx_v_key_bytes), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->p->getParamPath(__pyx_v_key_bytes), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "common/params_pyx.pyx":98 + /* "common/params_pyx.pyx":100 * self.p.remove(k) * * def get_param_path(self, key=""): # <<<<<<<<<<<<<< @@ -3433,6 +3461,69 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_18get_param_path(struct _ return __pyx_r; } +/* "common/params_pyx.pyx":104 + * return self.p.getParamPath(key_bytes).decode("utf-8") + * + * def all_keys(self): # <<<<<<<<<<<<<< + * return self.p.allKeys() + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_21all_keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_21all_keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("all_keys (wrapper)", 0); + __pyx_r = __pyx_pf_6common_10params_pyx_6Params_20all_keys(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_6common_10params_pyx_6Params_20all_keys(struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("all_keys", 0); + + /* "common/params_pyx.pyx":105 + * + * def all_keys(self): + * return self.p.allKeys() # <<<<<<<<<<<<<< + * + * def put_nonblocking(key, val, d=""): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __pyx_convert_vector_to_py_std_3a__3a_string(__pyx_v_self->p->allKeys()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "common/params_pyx.pyx":104 + * return self.p.getParamPath(key_bytes).decode("utf-8") + * + * def all_keys(self): # <<<<<<<<<<<<<< + * return self.p.allKeys() + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("common.params_pyx.Params.all_keys", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") @@ -3440,19 +3531,19 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_18get_param_path(struct _ */ /* Python wrapper */ -static PyObject *__pyx_pw_6common_10params_pyx_6Params_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pw_6common_10params_pyx_6Params_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pw_6common_10params_pyx_6Params_23__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_23__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_6common_10params_pyx_6Params_20__reduce_cython__(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self)); + __pyx_r = __pyx_pf_6common_10params_pyx_6Params_22__reduce_cython__(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6common_10params_pyx_6Params_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self) { +static PyObject *__pyx_pf_6common_10params_pyx_6Params_22__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -3497,19 +3588,19 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_20__reduce_cython__(CYTHO */ /* Python wrapper */ -static PyObject *__pyx_pw_6common_10params_pyx_6Params_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ -static PyObject *__pyx_pw_6common_10params_pyx_6Params_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pw_6common_10params_pyx_6Params_25__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ +static PyObject *__pyx_pw_6common_10params_pyx_6Params_25__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); - __pyx_r = __pyx_pf_6common_10params_pyx_6Params_22__setstate_cython__(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); + __pyx_r = __pyx_pf_6common_10params_pyx_6Params_24__setstate_cython__(((struct __pyx_obj_6common_10params_pyx_Params *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_6common_10params_pyx_6Params_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_6common_10params_pyx_6Params_24__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6common_10params_pyx_Params *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -3546,8 +3637,8 @@ static PyObject *__pyx_pf_6common_10params_pyx_6Params_22__setstate_cython__(CYT return __pyx_r; } -/* "common/params_pyx.pyx":102 - * return self.p.getParamPath(key_bytes).decode("utf-8") +/* "common/params_pyx.pyx":107 + * return self.p.allKeys() * * def put_nonblocking(key, val, d=""): # <<<<<<<<<<<<<< * threading.Thread(target=lambda: Params(d).put(key, val)).start() @@ -3593,7 +3684,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_3put_nonblocking(PyObject *__pyx_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("put_nonblocking", 0, 2, 3, 1); __PYX_ERR(0, 102, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("put_nonblocking", 0, 2, 3, 1); __PYX_ERR(0, 107, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -3603,7 +3694,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_3put_nonblocking(PyObject *__pyx_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put_nonblocking") < 0)) __PYX_ERR(0, 102, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put_nonblocking") < 0)) __PYX_ERR(0, 107, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3621,7 +3712,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_3put_nonblocking(PyObject *__pyx_ } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("put_nonblocking", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 102, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("put_nonblocking", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 107, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("common.params_pyx.put_nonblocking", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3634,7 +3725,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_3put_nonblocking(PyObject *__pyx_ return __pyx_r; } -/* "common/params_pyx.pyx":103 +/* "common/params_pyx.pyx":108 * * def put_nonblocking(key, val, d=""): * threading.Thread(target=lambda: Params(d).put(key, val)).start() # <<<<<<<<<<<<<< @@ -3673,14 +3764,14 @@ static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self) { __pyx_outer_scope = (struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_v_d)) { __Pyx_RaiseClosureNameError("d"); __PYX_ERR(0, 103, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6common_10params_pyx_Params), __pyx_cur_scope->__pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_d)) { __Pyx_RaiseClosureNameError("d"); __PYX_ERR(0, 108, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6common_10params_pyx_Params), __pyx_cur_scope->__pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_put); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 103, __pyx_L1_error) } - if (unlikely(!__pyx_cur_scope->__pyx_v_val)) { __Pyx_RaiseClosureNameError("val"); __PYX_ERR(0, 103, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 108, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_v_val)) { __Pyx_RaiseClosureNameError("val"); __PYX_ERR(0, 108, __pyx_L1_error) } __pyx_t_2 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -3696,7 +3787,7 @@ static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v_val}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else @@ -3704,13 +3795,13 @@ static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self) { #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_key, __pyx_cur_scope->__pyx_v_val}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { - __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -3721,7 +3812,7 @@ static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self) { __Pyx_INCREF(__pyx_cur_scope->__pyx_v_val); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_val); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -3744,8 +3835,8 @@ static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self) { return __pyx_r; } -/* "common/params_pyx.pyx":102 - * return self.p.getParamPath(key_bytes).decode("utf-8") +/* "common/params_pyx.pyx":107 + * return self.p.allKeys() * * def put_nonblocking(key, val, d=""): # <<<<<<<<<<<<<< * threading.Thread(target=lambda: Params(d).put(key, val)).start() @@ -3768,7 +3859,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_2put_nonblocking(CYTHON_UNUSED Py if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_6common_10params_pyx___pyx_scope_struct__put_nonblocking *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 102, __pyx_L1_error) + __PYX_ERR(0, 107, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -3782,29 +3873,29 @@ static PyObject *__pyx_pf_6common_10params_pyx_2put_nonblocking(CYTHON_UNUSED Py __Pyx_INCREF(__pyx_cur_scope->__pyx_v_d); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_d); - /* "common/params_pyx.pyx":103 + /* "common/params_pyx.pyx":108 * * def put_nonblocking(key, val, d=""): * threading.Thread(target=lambda: Params(d).put(key, val)).start() # <<<<<<<<<<<<<< * * def put_bool_nonblocking(key, bool val, d=""): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Thread); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Thread); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6common_10params_pyx_15put_nonblocking_lambda, 0, __pyx_n_s_put_nonblocking_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_common_params_pyx, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6common_10params_pyx_15put_nonblocking_lambda, 0, __pyx_n_s_put_nonblocking_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_common_params_pyx, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target, __pyx_t_4) < 0) __PYX_ERR(0, 103, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target, __pyx_t_4) < 0) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -3819,13 +3910,13 @@ static PyObject *__pyx_pf_6common_10params_pyx_2put_nonblocking(CYTHON_UNUSED Py } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "common/params_pyx.pyx":102 - * return self.p.getParamPath(key_bytes).decode("utf-8") + /* "common/params_pyx.pyx":107 + * return self.p.allKeys() * * def put_nonblocking(key, val, d=""): # <<<<<<<<<<<<<< * threading.Thread(target=lambda: Params(d).put(key, val)).start() @@ -3849,7 +3940,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_2put_nonblocking(CYTHON_UNUSED Py return __pyx_r; } -/* "common/params_pyx.pyx":105 +/* "common/params_pyx.pyx":110 * threading.Thread(target=lambda: Params(d).put(key, val)).start() * * def put_bool_nonblocking(key, bool val, d=""): # <<<<<<<<<<<<<< @@ -3895,7 +3986,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_5put_bool_nonblocking(PyObject *_ case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("put_bool_nonblocking", 0, 2, 3, 1); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("put_bool_nonblocking", 0, 2, 3, 1); __PYX_ERR(0, 110, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -3905,7 +3996,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_5put_bool_nonblocking(PyObject *_ } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put_bool_nonblocking") < 0)) __PYX_ERR(0, 105, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "put_bool_nonblocking") < 0)) __PYX_ERR(0, 110, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -3918,12 +4009,12 @@ static PyObject *__pyx_pw_6common_10params_pyx_5put_bool_nonblocking(PyObject *_ } } __pyx_v_key = values[0]; - __pyx_v_val = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_val == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L3_error) + __pyx_v_val = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_val == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 110, __pyx_L3_error) __pyx_v_d = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("put_bool_nonblocking", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 105, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("put_bool_nonblocking", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 110, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("common.params_pyx.put_bool_nonblocking", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3936,7 +4027,7 @@ static PyObject *__pyx_pw_6common_10params_pyx_5put_bool_nonblocking(PyObject *_ return __pyx_r; } -/* "common/params_pyx.pyx":106 +/* "common/params_pyx.pyx":111 * * def put_bool_nonblocking(key, bool val, d=""): * threading.Thread(target=lambda: Params(d).put_bool(key, val)).start() # <<<<<<<<<<<<<< @@ -3974,14 +4065,14 @@ static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self) { __pyx_outer_scope = (struct __pyx_obj_6common_10params_pyx___pyx_scope_struct_1_put_bool_nonblocking *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_v_d)) { __Pyx_RaiseClosureNameError("d"); __PYX_ERR(0, 106, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6common_10params_pyx_Params), __pyx_cur_scope->__pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_d)) { __Pyx_RaiseClosureNameError("d"); __PYX_ERR(0, 111, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_6common_10params_pyx_Params), __pyx_cur_scope->__pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_put_bool); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_put_bool); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 106, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_key)) { __Pyx_RaiseClosureNameError("key"); __PYX_ERR(0, 111, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -3998,7 +4089,7 @@ static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_key, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -4007,14 +4098,14 @@ static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self) { #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_key, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; @@ -4025,7 +4116,7 @@ static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -4049,7 +4140,7 @@ static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self) { return __pyx_r; } -/* "common/params_pyx.pyx":105 +/* "common/params_pyx.pyx":110 * threading.Thread(target=lambda: Params(d).put(key, val)).start() * * def put_bool_nonblocking(key, bool val, d=""): # <<<<<<<<<<<<<< @@ -4072,7 +4163,7 @@ static PyObject *__pyx_pf_6common_10params_pyx_4put_bool_nonblocking(CYTHON_UNUS if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_6common_10params_pyx___pyx_scope_struct_1_put_bool_nonblocking *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 105, __pyx_L1_error) + __PYX_ERR(0, 110, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } @@ -4084,27 +4175,27 @@ static PyObject *__pyx_pf_6common_10params_pyx_4put_bool_nonblocking(CYTHON_UNUS __Pyx_INCREF(__pyx_cur_scope->__pyx_v_d); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_d); - /* "common/params_pyx.pyx":106 + /* "common/params_pyx.pyx":111 * * def put_bool_nonblocking(key, bool val, d=""): * threading.Thread(target=lambda: Params(d).put_bool(key, val)).start() # <<<<<<<<<<<<<< */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Thread); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Thread); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6common_10params_pyx_20put_bool_nonblocking_lambda1, 0, __pyx_n_s_put_bool_nonblocking_locals_lamb, ((PyObject*)__pyx_cur_scope), __pyx_n_s_common_params_pyx, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_6common_10params_pyx_20put_bool_nonblocking_lambda1, 0, __pyx_n_s_put_bool_nonblocking_locals_lamb, ((PyObject*)__pyx_cur_scope), __pyx_n_s_common_params_pyx, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target, __pyx_t_4) < 0) __PYX_ERR(0, 106, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target, __pyx_t_4) < 0) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -4119,12 +4210,12 @@ static PyObject *__pyx_pf_6common_10params_pyx_4put_bool_nonblocking(CYTHON_UNUS } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "common/params_pyx.pyx":105 + /* "common/params_pyx.pyx":110 * threading.Thread(target=lambda: Params(d).put(key, val)).start() * * def put_bool_nonblocking(key, bool val, d=""): # <<<<<<<<<<<<<< @@ -4462,6 +4553,71 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_st return __pyx_r; } +/* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py_std_3a__3a_string") + * cdef object __pyx_convert_vector_to_py_std_3a__3a_string(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + +static PyObject *__pyx_convert_vector_to_py_std_3a__3a_string(const std::vector &__pyx_v_v) { + size_t __pyx_v_i; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + size_t __pyx_t_2; + size_t __pyx_t_3; + size_t __pyx_t_4; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_string", 0); + + /* "vector.to_py":61 + * @cname("__pyx_convert_vector_to_py_std_3a__3a_string") + * cdef object __pyx_convert_vector_to_py_std_3a__3a_string(vector[X]& v): + * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<< + * + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_v_v.size(); + __pyx_t_3 = __pyx_t_2; + for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { + __pyx_v_i = __pyx_t_4; + __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "vector.to_py":60 + * + * @cname("__pyx_convert_vector_to_py_std_3a__3a_string") + * cdef object __pyx_convert_vector_to_py_std_3a__3a_string(vector[X]& v): # <<<<<<<<<<<<<< + * return [v[i] for i in range(v.size())] + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* "EnumBase":16 * @cython.internal * cdef class __Pyx_EnumMeta(type): @@ -6062,8 +6218,9 @@ static PyMethodDef __pyx_methods_6common_10params_pyx_Params[] = { {"put_bool", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6common_10params_pyx_6Params_15put_bool, METH_VARARGS|METH_KEYWORDS, 0}, {"remove", (PyCFunction)__pyx_pw_6common_10params_pyx_6Params_17remove, METH_O, 0}, {"get_param_path", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6common_10params_pyx_6Params_19get_param_path, METH_VARARGS|METH_KEYWORDS, 0}, - {"__reduce_cython__", (PyCFunction)__pyx_pw_6common_10params_pyx_6Params_21__reduce_cython__, METH_NOARGS, 0}, - {"__setstate_cython__", (PyCFunction)__pyx_pw_6common_10params_pyx_6Params_23__setstate_cython__, METH_O, 0}, + {"all_keys", (PyCFunction)__pyx_pw_6common_10params_pyx_6Params_21all_keys, METH_NOARGS, 0}, + {"__reduce_cython__", (PyCFunction)__pyx_pw_6common_10params_pyx_6Params_23__reduce_cython__, METH_NOARGS, 0}, + {"__setstate_cython__", (PyCFunction)__pyx_pw_6common_10params_pyx_6Params_25__setstate_cython__, METH_O, 0}, {0, 0, 0, 0} }; @@ -6644,6 +6801,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle___Pyx_EnumMeta, __pyx_k_pyx_unpickle___Pyx_EnumMeta, sizeof(__pyx_k_pyx_unpickle___Pyx_EnumMeta), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, + {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, @@ -6669,8 +6827,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_KeyboardInterrupt = __Pyx_GetBuiltinName(__pyx_n_s_KeyboardInterrupt); if (!__pyx_builtin_KeyboardInterrupt) __PYX_ERR(0, 63, __pyx_L1_error) + __pyx_builtin_KeyboardInterrupt = __Pyx_GetBuiltinName(__pyx_n_s_KeyboardInterrupt); if (!__pyx_builtin_KeyboardInterrupt) __PYX_ERR(0, 65, __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_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 61, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 33, __pyx_L1_error) return 0; __pyx_L1_error:; @@ -6700,40 +6859,40 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); - /* "common/params_pyx.pyx":27 + /* "common/params_pyx.pyx":29 * * * def ensure_bytes(v): # <<<<<<<<<<<<<< * return v.encode() if isinstance(v, str) else v; * */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_v); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_v); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_params_pyx_pyx, __pyx_n_s_ensure_bytes, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_params_pyx_pyx, __pyx_n_s_ensure_bytes, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 29, __pyx_L1_error) - /* "common/params_pyx.pyx":102 - * return self.p.getParamPath(key_bytes).decode("utf-8") + /* "common/params_pyx.pyx":107 + * return self.p.allKeys() * * def put_nonblocking(key, val, d=""): # <<<<<<<<<<<<<< * threading.Thread(target=lambda: Params(d).put(key, val)).start() * */ - __pyx_tuple__7 = PyTuple_Pack(3, __pyx_n_s_key, __pyx_n_s_val, __pyx_n_s_d); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_tuple__7 = PyTuple_Pack(3, __pyx_n_s_key, __pyx_n_s_val, __pyx_n_s_d); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_params_pyx_pyx, __pyx_n_s_put_nonblocking, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_params_pyx_pyx, __pyx_n_s_put_nonblocking, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 107, __pyx_L1_error) - /* "common/params_pyx.pyx":105 + /* "common/params_pyx.pyx":110 * threading.Thread(target=lambda: Params(d).put(key, val)).start() * * def put_bool_nonblocking(key, bool val, d=""): # <<<<<<<<<<<<<< * threading.Thread(target=lambda: Params(d).put_bool(key, val)).start() */ - __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_key, __pyx_n_s_val, __pyx_n_s_d); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_key, __pyx_n_s_val, __pyx_n_s_d); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_params_pyx_pyx, __pyx_n_s_put_bool_nonblocking, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_common_params_pyx_pyx, __pyx_n_s_put_bool_nonblocking, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 110, __pyx_L1_error) /* "EnumBase":28 * class __Pyx_EnumBase(int): @@ -6840,17 +6999,17 @@ static int __Pyx_modinit_type_init_code(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_6common_10params_pyx_Params) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_6common_10params_pyx_Params) < 0) __PYX_ERR(0, 35, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_6common_10params_pyx_Params.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6common_10params_pyx_Params.tp_dictoffset && __pyx_type_6common_10params_pyx_Params.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_6common_10params_pyx_Params.tp_getattro = __Pyx_PyObject_GenericGetAttr; } - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Params, (PyObject *)&__pyx_type_6common_10params_pyx_Params) < 0) __PYX_ERR(0, 33, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6common_10params_pyx_Params) < 0) __PYX_ERR(0, 33, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Params, (PyObject *)&__pyx_type_6common_10params_pyx_Params) < 0) __PYX_ERR(0, 35, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6common_10params_pyx_Params) < 0) __PYX_ERR(0, 35, __pyx_L1_error) __pyx_ptype_6common_10params_pyx_Params = &__pyx_type_6common_10params_pyx_Params; - if (PyType_Ready(&__pyx_type_6common_10params_pyx___pyx_scope_struct__put_nonblocking) < 0) __PYX_ERR(0, 102, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_6common_10params_pyx___pyx_scope_struct__put_nonblocking) < 0) __PYX_ERR(0, 107, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_6common_10params_pyx___pyx_scope_struct__put_nonblocking.tp_print = 0; #endif @@ -6858,7 +7017,7 @@ static int __Pyx_modinit_type_init_code(void) { __pyx_type_6common_10params_pyx___pyx_scope_struct__put_nonblocking.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_6common_10params_pyx___pyx_scope_struct__put_nonblocking = &__pyx_type_6common_10params_pyx___pyx_scope_struct__put_nonblocking; - if (PyType_Ready(&__pyx_type_6common_10params_pyx___pyx_scope_struct_1_put_bool_nonblocking) < 0) __PYX_ERR(0, 105, __pyx_L1_error) + if (PyType_Ready(&__pyx_type_6common_10params_pyx___pyx_scope_struct_1_put_bool_nonblocking) < 0) __PYX_ERR(0, 110, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_6common_10params_pyx___pyx_scope_struct_1_put_bool_nonblocking.tp_print = 0; #endif @@ -7113,88 +7272,88 @@ if (!__Pyx_RefNanny) { if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - /* "common/params_pyx.pyx":5 - * from libcpp cimport bool + /* "common/params_pyx.pyx":6 * from libcpp.string cimport string + * from libcpp.vector cimport vector * import threading # <<<<<<<<<<<<<< * * cdef extern from "common/params.h": */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) + __pyx_t_1 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_1) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "common/params_pyx.pyx":27 + /* "common/params_pyx.pyx":29 * * * def ensure_bytes(v): # <<<<<<<<<<<<<< * return v.encode() if isinstance(v, str) else v; * */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_10params_pyx_1ensure_bytes, NULL, __pyx_n_s_common_params_pyx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_10params_pyx_1ensure_bytes, NULL, __pyx_n_s_common_params_pyx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ensure_bytes, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ensure_bytes, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "common/params_pyx.pyx":30 + /* "common/params_pyx.pyx":32 * return v.encode() if isinstance(v, str) else v; * * class UnknownKeyName(Exception): # <<<<<<<<<<<<<< * pass * */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_UnknownKeyName, __pyx_n_s_UnknownKeyName, (PyObject *) NULL, __pyx_n_s_common_params_pyx, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_UnknownKeyName, __pyx_n_s_UnknownKeyName, (PyObject *) NULL, __pyx_n_s_common_params_pyx, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_UnknownKeyName, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error) + __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_UnknownKeyName, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnknownKeyName, __pyx_t_4) < 0) __PYX_ERR(0, 30, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnknownKeyName, __pyx_t_4) < 0) __PYX_ERR(0, 32, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "common/params_pyx.pyx":44 + /* "common/params_pyx.pyx":46 * del self.p * * def clear_all(self, tx_type=ParamKeyType.ALL): # <<<<<<<<<<<<<< * self.p.clearAll(tx_type) * */ - __pyx_t_1 = __Pyx_PyInt_From_enum__ParamKeyType(ALL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_enum__ParamKeyType(ALL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_k__2 = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - /* "common/params_pyx.pyx":102 - * return self.p.getParamPath(key_bytes).decode("utf-8") + /* "common/params_pyx.pyx":107 + * return self.p.allKeys() * * def put_nonblocking(key, val, d=""): # <<<<<<<<<<<<<< * threading.Thread(target=lambda: Params(d).put(key, val)).start() * */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_10params_pyx_3put_nonblocking, NULL, __pyx_n_s_common_params_pyx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_10params_pyx_3put_nonblocking, NULL, __pyx_n_s_common_params_pyx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_put_nonblocking, __pyx_t_1) < 0) __PYX_ERR(0, 102, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_put_nonblocking, __pyx_t_1) < 0) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "common/params_pyx.pyx":105 + /* "common/params_pyx.pyx":110 * threading.Thread(target=lambda: Params(d).put(key, val)).start() * * def put_bool_nonblocking(key, bool val, d=""): # <<<<<<<<<<<<<< * threading.Thread(target=lambda: Params(d).put_bool(key, val)).start() */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_10params_pyx_5put_bool_nonblocking, NULL, __pyx_n_s_common_params_pyx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6common_10params_pyx_5put_bool_nonblocking, NULL, __pyx_n_s_common_params_pyx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_put_bool_nonblocking, __pyx_t_1) < 0) __PYX_ERR(0, 105, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_put_bool_nonblocking, __pyx_t_1) < 0) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "common/params_pyx.pyx":1 @@ -10317,6 +10476,202 @@ raise_neg_overflow: return (enum ParamKeyType) -1; } +/* CIntFromPy */ +static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) { +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wconversion" +#endif + const size_t neg_one = (size_t) -1, const_zero = (size_t) 0; +#ifdef __Pyx_HAS_GCC_DIAGNOSTIC +#pragma GCC diagnostic pop +#endif + const int is_unsigned = neg_one > const_zero; +#if PY_MAJOR_VERSION < 3 + if (likely(PyInt_Check(x))) { + if (sizeof(size_t) < sizeof(long)) { + __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x)) + } else { + long val = PyInt_AS_LONG(x); + if (is_unsigned && unlikely(val < 0)) { + goto raise_neg_overflow; + } + return (size_t) val; + } + } else +#endif + if (likely(PyLong_Check(x))) { + if (is_unsigned) { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0]) + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) { + return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) { + return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) { + return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); + } + } + break; + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON + if (unlikely(Py_SIZE(x) < 0)) { + goto raise_neg_overflow; + } +#else + { + int result = PyObject_RichCompareBool(x, Py_False, Py_LT); + if (unlikely(result < 0)) + return (size_t) -1; + if (unlikely(result == 1)) + goto raise_neg_overflow; + } +#endif + if (sizeof(size_t) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) +#endif + } + } else { +#if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (size_t) 0; + case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0]) + case -2: + if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 2: + if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -3: + if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 3: + if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case -4: + if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + case 4: + if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) { + if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { + __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) + } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) { + return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]))); + } + } + break; + } +#endif + if (sizeof(size_t) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x)) +#ifdef HAVE_LONG_LONG + } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x)) +#endif + } + } + { +#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) + PyErr_SetString(PyExc_RuntimeError, + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); +#else + size_t val; + PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; + v = PyNumber_Long(tmp); + Py_DECREF(tmp); + } + #endif + if (likely(v)) { + int one = 1; int is_little = (int)*(unsigned char *)&one; + unsigned char *bytes = (unsigned char *)&val; + int ret = _PyLong_AsByteArray((PyLongObject *)v, + bytes, sizeof(val), + is_little, !is_unsigned); + Py_DECREF(v); + if (likely(!ret)) + return val; + } +#endif + return (size_t) -1; + } + } else { + size_t val; + PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (size_t) -1; + val = __Pyx_PyInt_As_size_t(tmp); + Py_DECREF(tmp); + return val; + } +raise_overflow: + PyErr_SetString(PyExc_OverflowError, + "value too large to convert to size_t"); + return (size_t) -1; +raise_neg_overflow: + PyErr_SetString(PyExc_OverflowError, + "can't convert negative value to size_t"); + return (size_t) -1; +} + /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC diff --git a/common/params_pyx.pyx b/common/params_pyx.pyx index 8d52b8d3f..bbddda46e 100755 --- a/common/params_pyx.pyx +++ b/common/params_pyx.pyx @@ -2,6 +2,7 @@ # cython: language_level = 3 from libcpp cimport bool from libcpp.string cimport string +from libcpp.vector cimport vector import threading cdef extern from "common/params.h": @@ -22,6 +23,7 @@ cdef extern from "common/params.h": bool checkKey(string) nogil string getParamPath(string) nogil void clearAll(ParamKeyType) + vector[string] allKeys() def ensure_bytes(v): @@ -99,6 +101,9 @@ cdef class Params: cdef string key_bytes = ensure_bytes(key) return self.p.getParamPath(key_bytes).decode("utf-8") + def all_keys(self): + return self.p.allKeys() + def put_nonblocking(key, val, d=""): threading.Thread(target=lambda: Params(d).put(key, val)).start() diff --git a/common/params_pyx.so b/common/params_pyx.so index 1323317d1..6a351d747 100755 Binary files a/common/params_pyx.so and b/common/params_pyx.so differ diff --git a/common/realtime.py b/common/realtime.py index 3a3149201..af45a63ea 100644 --- a/common/realtime.py +++ b/common/realtime.py @@ -31,7 +31,7 @@ class Priority: def set_realtime_priority(level: int) -> None: if not PC: - os.sched_setscheduler(0, os.SCHED_FIFO, os.sched_param(level)) # type: ignore[attr-defined] # pylint: disable=no-member + os.sched_setscheduler(0, os.SCHED_FIFO, os.sched_param(level)) # pylint: disable=no-member def set_core_affinity(cores: List[int]) -> None: diff --git a/common/version.h b/common/version.h index feff36f3c..e236d2ea6 100644 --- a/common/version.h +++ b/common/version.h @@ -1 +1 @@ -#define COMMA_VERSION "2022.09.15" +#define COMMA_VERSION "2022.10.07" diff --git a/docs/CARS.md b/docs/CARS.md index 47694fffe..ecd6932e8 100644 --- a/docs/CARS.md +++ b/docs/CARS.md @@ -4,34 +4,34 @@ A supported vehicle is one that just works when you install a comma three. All supported cars provide a better experience than any stock system. -# 205 Supported Cars +# 204 Supported Cars |Make|Model|Supported Package|ACC|No ACC accel below|No ALC below|Steering Torque|Resume from stop|Harness| |---|---|---|:---:|:---:|:---:|:---:|:---:|:---:| |Acura|ILX 2016-19|AcuraWatch Plus|openpilot|25 mph|25 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Honda Nidec| |Acura|RDX 2016-18|AcuraWatch Plus|openpilot|25 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Honda Nidec| |Acura|RDX 2019-22|All|openpilot|0 mph|3 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Honda Bosch A| -|Audi|A3 2014-19|ACC + Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Audi|A3 Sportback e-tron 2017-18|ACC + Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Audi|Q2 2018|ACC + Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Audi|Q3 2020-21|ACC + Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Audi|RS3 2018|ACC + Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Audi|S3 2015-17|ACC + Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Audi|A3 2014-19|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Audi|A3 Sportback e-tron 2017-18|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Audi|Q2 2018|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Audi|Q3 2020-21|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Audi|RS3 2018|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Audi|S3 2015-17|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| |Cadillac|Escalade ESV 2016[1](#footnotes)|Adaptive Cruise Control (ACC) & LKAS|openpilot|0 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|OBD-II| |Chevrolet|Bolt EUV 2022-23|Premier or Premier Redline Trim without Super Cruise Package|Stock|0 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|GM| |Chevrolet|Silverado 1500 2020-21|Safety Package II|Stock|0 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|GM| -|Chevrolet|Volt 2017-18[1](#footnotes)|Adaptive Cruise Control|openpilot|0 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|OBD-II| -|Chrysler|Pacifica 2017-18|Adaptive Cruise Control|Stock|0 mph|9 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| -|Chrysler|Pacifica 2019-20|Adaptive Cruise Control|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| +|Chevrolet|Volt 2017-18[1](#footnotes)|Adaptive Cruise Control (ACC)|openpilot|0 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|OBD-II| +|Chrysler|Pacifica 2017-18|Adaptive Cruise Control (ACC)|Stock|0 mph|9 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| +|Chrysler|Pacifica 2019-20|Adaptive Cruise Control (ACC)|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| |Chrysler|Pacifica 2021|All|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| -|Chrysler|Pacifica Hybrid 2017-18|Adaptive Cruise Control|Stock|0 mph|9 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| -|Chrysler|Pacifica Hybrid 2019-22|Adaptive Cruise Control|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| +|Chrysler|Pacifica Hybrid 2017-18|Adaptive Cruise Control (ACC)|Stock|0 mph|9 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| +|Chrysler|Pacifica Hybrid 2019-22|Adaptive Cruise Control (ACC)|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| |comma|body|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|None| |Genesis|G70 2018-19|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai F| |Genesis|G70 2020|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai F| |Genesis|G80 2017-19|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| |Genesis|G90 2017-18|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| -|GMC|Acadia 2018[1](#footnotes)|Adaptive Cruise Control|openpilot|0 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|OBD-II| +|GMC|Acadia 2018[1](#footnotes)|Adaptive Cruise Control (ACC)|openpilot|0 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|OBD-II| |GMC|Sierra 1500 2020-21|Driver Alert Package II|Stock|0 mph|6 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|GM| |Honda|Accord 2018-22|All|openpilot|0 mph|3 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Honda Bosch A| |Honda|Accord Hybrid 2018-22|All|openpilot|0 mph|3 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Honda Bosch A| @@ -53,53 +53,52 @@ A supported vehicle is one that just works when you install a comma three. All s |Honda|Passport 2019-21|All|openpilot|25 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Honda Nidec| |Honda|Pilot 2016-22|Honda Sensing|openpilot|25 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Honda Nidec| |Honda|Ridgeline 2017-22|Honda Sensing|openpilot|25 mph|12 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Honda Nidec| -|Hyundai|Elantra 2017-19|Smart Cruise Control (SCC) & LKAS|Stock|19 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai B| -|Hyundai|Elantra 2021-22|Smart Cruise Control (SCC) & LKAS|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai K| +|Hyundai|Elantra 2017-19|Smart Cruise Control (SCC)|Stock|19 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai B| +|Hyundai|Elantra 2021-22|Smart Cruise Control (SCC)|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai K| |Hyundai|Elantra Hybrid 2021-22|Smart Cruise Control (SCC)|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai K| -|Hyundai|Genesis 2015-16|Smart Cruise Control (SCC) & LKAS|Stock|19 mph|37 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai J| +|Hyundai|Genesis 2015-16|Smart Cruise Control (SCC)|Stock|19 mph|37 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai J| |Hyundai|Ioniq 5 2022|Highway Driving Assist II|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai Q| -|Hyundai|Ioniq Electric 2019|Smart Cruise Control (SCC) & LKAS|Stock|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| -|Hyundai|Ioniq Electric 2020|Smart Cruise Control (SCC) & LKAS|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| -|Hyundai|Ioniq Hybrid 2017-19|Smart Cruise Control (SCC) & LKAS|Stock|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| -|Hyundai|Ioniq Hybrid 2020-22|Smart Cruise Control (SCC) & LFA|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| -|Hyundai|Ioniq Plug-in Hybrid 2019|Smart Cruise Control (SCC) & LKAS|openpilot|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| -|Hyundai|Ioniq Plug-in Hybrid 2020-21|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| +|Hyundai|Ioniq Electric 2019|Smart Cruise Control (SCC)|Stock|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| +|Hyundai|Ioniq Electric 2020|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| +|Hyundai|Ioniq Hybrid 2017-19|Smart Cruise Control (SCC)|Stock|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| +|Hyundai|Ioniq Hybrid 2020-22|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| +|Hyundai|Ioniq Plug-in Hybrid 2019|Smart Cruise Control (SCC)|openpilot|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| +|Hyundai|Ioniq Plug-in Hybrid 2020-21|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| |Hyundai|Kona 2020|Smart Cruise Control (SCC)|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai B| -|Hyundai|Kona Electric 2018-21|Smart Cruise Control (SCC) & LKAS|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai G| +|Hyundai|Kona Electric 2018-21|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai G| |Hyundai|Kona Electric 2022|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai O| -|Hyundai|Kona Hybrid 2020|Smart Cruise Control (SCC) & LKAS|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai I| +|Hyundai|Kona Hybrid 2020|Smart Cruise Control (SCC)|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai I| |Hyundai|Palisade 2020-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| |Hyundai|Santa Fe 2019-20|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai D| |Hyundai|Santa Fe 2021-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai L| |Hyundai|Santa Fe Hybrid 2022|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai L| |Hyundai|Santa Fe Plug-in Hybrid 2022|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai L| -|Hyundai|Sonata 2018-19|Smart Cruise Control (SCC) & LKAS|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai E| +|Hyundai|Sonata 2018-19|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai E| |Hyundai|Sonata 2020-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai A| |Hyundai|Sonata Hybrid 2020-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai A| |Hyundai|Tucson 2021|Smart Cruise Control (SCC)|openpilot|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai L| |Hyundai|Tucson Diesel 2019|Smart Cruise Control (SCC)|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai L| |Hyundai|Tucson Hybrid 2022|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai N| |Hyundai|Veloster 2019-20|Smart Cruise Control (SCC)|Stock|5 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai E| -|Jeep|Grand Cherokee 2016-18|Adaptive Cruise Control|Stock|0 mph|9 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| -|Jeep|Grand Cherokee 2019-21|Adaptive Cruise Control|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| -|Kia|Ceed 2019|Smart Cruise Control (SCC) & LKAS|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai E| +|Jeep|Grand Cherokee 2016-18|Adaptive Cruise Control (ACC)|Stock|0 mph|9 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| +|Jeep|Grand Cherokee 2019-21|Adaptive Cruise Control (ACC)|Stock|0 mph|39 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|FCA| +|Kia|Ceed 2019|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai E| |Kia|EV6 2022|Highway Driving Assist II|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai P| -|Kia|Forte 2018|Smart Cruise Control (SCC) & LKAS|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai B| -|Kia|Forte 2019-21|Smart Cruise Control (SCC) & LKAS|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai G| +|Kia|Forte 2019-21|Smart Cruise Control (SCC)|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai G| |Kia|K5 2021-22|Smart Cruise Control (SCC)|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai A| -|Kia|Niro Electric 2019|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| -|Kia|Niro Electric 2020|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai F| -|Kia|Niro Electric 2021|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| -|Kia|Niro Electric 2022|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| -|Kia|Niro Hybrid 2021|Smart Cruise Control (SCC) & LKAS|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai F| -|Kia|Niro Hybrid 2022|Smart Cruise Control (SCC) & LKAS|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| -|Kia|Niro Plug-in Hybrid 2018-19|Smart Cruise Control (SCC) & LKAS|openpilot|10 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| -|Kia|Optima 2017|Smart Cruise Control (SCC) & LKAS|Stock|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai B| -|Kia|Optima 2019|Smart Cruise Control (SCC) & LKAS|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai G| +|Kia|Niro EV 2019|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| +|Kia|Niro EV 2020|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai F| +|Kia|Niro EV 2021|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| +|Kia|Niro EV 2022|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| +|Kia|Niro Hybrid 2021|Smart Cruise Control (SCC)|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai F| +|Kia|Niro Hybrid 2022|Smart Cruise Control (SCC)|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| +|Kia|Niro Plug-in Hybrid 2018-19|All|openpilot|10 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| +|Kia|Optima 2017|Advanced Smart Cruise Control|Stock|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai B| +|Kia|Optima 2019-20|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai G| |Kia|Seltos 2021|Smart Cruise Control (SCC)|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai A| -|Kia|Sorento 2018|Smart Cruise Control (SCC) & LKAS|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| -|Kia|Sorento 2019|Smart Cruise Control (SCC) & LKAS|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai E| -|Kia|Stinger 2018-20|Smart Cruise Control (SCC) & LKAS|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| +|Kia|Sorento 2018|Advanced Smart Cruise Control|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| +|Kia|Sorento 2019|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai E| +|Kia|Stinger 2018-20|Smart Cruise Control (SCC)|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai C| |Kia|Telluride 2020|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Hyundai H| |Lexus|CT Hybrid 2017-18|Lexus Safety System+|Stock[3](#footnotes)|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|Toyota| |Lexus|ES 2019-22|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Toyota| @@ -122,9 +121,9 @@ A supported vehicle is one that just works when you install a comma three. All s |Nissan|Leaf 2018-22|ProPILOT Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|Nissan A| |Nissan|Rogue 2018-20|ProPILOT Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|Nissan A| |Nissan|X-Trail 2017|ProPILOT Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|Nissan A| -|Ram|1500 2019-22|Adaptive Cruise Control|Stock|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Ram| -|SEAT|Ateca 2018|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|SEAT|Leon 2014-20|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Ram|1500 2019-22|Adaptive Cruise Control (ACC)|Stock|0 mph|32 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Ram| +|SEAT|Ateca 2018|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|SEAT|Leon 2014-20|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| |Subaru|Ascent 2019-21|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|Subaru A| |Subaru|Crosstrek 2018-19|EyeSight Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|Subaru A| |Subaru|Crosstrek 2020-21|EyeSight Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|Subaru A| @@ -135,13 +134,13 @@ A supported vehicle is one that just works when you install a comma three. All s |Subaru|Outback 2020-22|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|Subaru B| |Subaru|XV 2018-19|EyeSight Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-empty.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|Subaru A| |Subaru|XV 2020-21|EyeSight Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|Subaru A| -|Škoda|Kamiq 2021[5](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Škoda|Karoq 2019-21[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Škoda|Kodiaq 2018-19|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Škoda|Octavia 2015, 2018-19|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Škoda|Octavia RS 2016|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Škoda|Scala 2020|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Škoda|Superb 2015-18|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Škoda|Kamiq 2021[5](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Škoda|Karoq 2019-21[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Škoda|Kodiaq 2018-19|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Škoda|Octavia 2015, 2018-19|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Škoda|Octavia RS 2016|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Škoda|Scala 2020|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Škoda|Superb 2015-18|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| |Toyota|Alphard 2019-20|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Toyota| |Toyota|Alphard Hybrid 2021|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Toyota| |Toyota|Avalon 2016|Toyota Safety Sense P|Stock[3](#footnotes)|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|Toyota| @@ -182,37 +181,37 @@ A supported vehicle is one that just works when you install a comma three. All s |Toyota|RAV4 Hybrid 2019-21|All|openpilot|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|Toyota| |Toyota|RAV4 Hybrid 2022|All|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|Toyota| |Toyota|Sienna 2018-20|All|Stock[3](#footnotes)|19 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-empty.svg)](##)|Toyota| -|Volkswagen|Arteon 2018-22[7,8](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Arteon eHybrid 2020-22[7,8](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Arteon R 2020-22[7,8](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Atlas 2018-23[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Atlas Cross Sport 2021-22[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|California 2021[7](#footnotes)|Driver Assistance|Stock|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Caravelle 2020[7](#footnotes)|Driver Assistance|Stock|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|CC 2018-22[7,8](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|e-Golf 2014-20|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Volkswagen|Golf 2015-20[8](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Volkswagen|Golf Alltrack 2015-19|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Volkswagen|Golf GTD 2015-20|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Volkswagen|Golf GTE 2015-20|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Volkswagen|Golf GTI 2015-21|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Volkswagen|Golf R 2015-19[8](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Volkswagen|Golf SportsVan 2015-20|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| -|Volkswagen|Jetta 2018-22[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Jetta GLI 2021-22[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Passat 2015-22[6,7,8](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Passat Alltrack 2015-22[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Passat GTE 2015-22[7,8](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Polo 2020-22[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Polo GTI 2020-22[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|T-Cross 2021[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|T-Roc 2021[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Taos 2022[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Teramont 2018-22[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Teramont Cross Sport 2021-22[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Teramont X 2021-22[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Tiguan 2019-22[7](#footnotes)|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| -|Volkswagen|Touran 2017|Driver Assistance|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Volkswagen|Arteon 2018-22[7,8](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Arteon eHybrid 2020-22[7,8](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Arteon R 2020-22[7,8](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Atlas 2018-23[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Atlas Cross Sport 2021-22[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|California 2021[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Caravelle 2020[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|31 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|CC 2018-22[7,8](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|e-Golf 2014-20|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Volkswagen|Golf 2015-20[8](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Volkswagen|Golf Alltrack 2015-19|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Volkswagen|Golf GTD 2015-20|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Volkswagen|Golf GTE 2015-20|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Volkswagen|Golf GTI 2015-21|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Volkswagen|Golf R 2015-19[8](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Volkswagen|Golf SportsVan 2015-20|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| +|Volkswagen|Jetta 2018-22[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Jetta GLI 2021-22[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Passat 2015-22[6,7,8](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Passat Alltrack 2015-22[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Passat GTE 2015-22[7,8](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Polo 2020-22[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Polo GTI 2020-22[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|T-Cross 2021[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|T-Roc 2021[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Taos 2022[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Teramont 2018-22[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Teramont Cross Sport 2021-22[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Teramont X 2021-22[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Tiguan 2019-22[7](#footnotes)|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|J533| +|Volkswagen|Touran 2017|Adaptive Cruise Control (ACC) & Lane Assist|Stock|0 mph|0 mph|[![star](assets/icon-star-full.svg)](##)|[![star](assets/icon-star-full.svg)](##)|VW| 1Requires a community built ASCM harness. NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).
diff --git a/launch_env.sh b/launch_env.sh index 320bfe736..20b57a378 100755 --- a/launch_env.sh +++ b/launch_env.sh @@ -11,7 +11,7 @@ if [ -z "$NEOS_VERSION" ]; then fi if [ -z "$AGNOS_VERSION" ]; then - export AGNOS_VERSION="5.2" + export AGNOS_VERSION="6" fi if [ -z "$PASSIVE" ]; then diff --git a/opendbc/can/libdbc.so b/opendbc/can/libdbc.so index e83fc7ddb..f58a39a5a 100755 Binary files a/opendbc/can/libdbc.so and b/opendbc/can/libdbc.so differ diff --git a/opendbc/can/parser_pyx.so b/opendbc/can/parser_pyx.so index 89ec8f733..803e3e929 100755 Binary files a/opendbc/can/parser_pyx.so and b/opendbc/can/parser_pyx.so differ diff --git a/opendbc/generator/honda/honda_civic_ex_2022_can.dbc b/opendbc/generator/honda/honda_civic_ex_2022_can.dbc index b55c80305..e4a8fdce3 100644 --- a/opendbc/generator/honda/honda_civic_ex_2022_can.dbc +++ b/opendbc/generator/honda/honda_civic_ex_2022_can.dbc @@ -22,6 +22,7 @@ BO_ 432 STANDSTILL: 7 VSA BO_ 456 ACC_CONTROL: 8 XXX SG_ ACCEL_COMMAND : 7|12@0- (0.01,0) [0|0] "m/s^2" XXX SG_ CONTROL_OFF : 8|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL : 9|1@0+ (1,0) [0|1] "" XXX SG_ CONTROL_ON : 10|1@0+ (1,0) [0|1] "" XXX SG_ BOH : 23|1@0+ (1,0) [0|1] "" XXX SG_ AEB_STATUS : 33|1@1+ (1,0) [0|7] "" XXX @@ -70,8 +71,7 @@ BO_ 254913108 LKAS_HUD_2: 8 ADAS SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX CM_ BO 456 "not sure which bit enables cruise"; -CM_ SG_ 456 ACCEL_COMMAND "seems to be m/s^2? need to verify"; -CM_ SG_ 456 BOH "could be cruise standstill?"; +CM_ SG_ 456 STANDSTILL "set to 1 when camera requests -4.0 m/s^2"; VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P"; VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P"; diff --git a/opendbc/generator/hyundai/.gitignore b/opendbc/generator/hyundai/.gitignore new file mode 100644 index 000000000..2bee453e2 --- /dev/null +++ b/opendbc/generator/hyundai/.gitignore @@ -0,0 +1 @@ +hyundai_kia_mando_front_radar.dbc diff --git a/opendbc/generator/hyundai/hyundai_kia_mando_front_radar.py b/opendbc/generator/hyundai/hyundai_kia_mando_front_radar.py new file mode 100755 index 000000000..8870bf0cd --- /dev/null +++ b/opendbc/generator/hyundai/hyundai_kia_mando_front_radar.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 +import os + +if __name__ == "__main__": + dbc_name = os.path.basename(__file__).replace(".py", ".dbc") + hyundai_path = os.path.dirname(os.path.realpath(__file__)) + with open(os.path.join(hyundai_path, dbc_name), "w") as f: + f.write(""" +VERSION "" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: XXX + """) + + # note: 0x501/0x502 seem to be special in 0x5XX range + for a in range(0x500, 0x500 + 32): + f.write(f""" +BO_ {a} RADAR_TRACK_{a:x}: 8 RADAR + SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX + SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX + SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX + SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX + SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX + SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX + SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX + SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX + SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX + SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX + """) diff --git a/opendbc/honda_civic_ex_2022_can_generated.dbc b/opendbc/honda_civic_ex_2022_can_generated.dbc index 782316108..194c2e9c6 100644 --- a/opendbc/honda_civic_ex_2022_can_generated.dbc +++ b/opendbc/honda_civic_ex_2022_can_generated.dbc @@ -448,6 +448,7 @@ BO_ 432 STANDSTILL: 7 VSA BO_ 456 ACC_CONTROL: 8 XXX SG_ ACCEL_COMMAND : 7|12@0- (0.01,0) [0|0] "m/s^2" XXX SG_ CONTROL_OFF : 8|1@0+ (1,0) [0|1] "" XXX + SG_ STANDSTILL : 9|1@0+ (1,0) [0|1] "" XXX SG_ CONTROL_ON : 10|1@0+ (1,0) [0|1] "" XXX SG_ BOH : 23|1@0+ (1,0) [0|1] "" XXX SG_ AEB_STATUS : 33|1@1+ (1,0) [0|7] "" XXX @@ -496,8 +497,7 @@ BO_ 254913108 LKAS_HUD_2: 8 ADAS SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX CM_ BO 456 "not sure which bit enables cruise"; -CM_ SG_ 456 ACCEL_COMMAND "seems to be m/s^2? need to verify"; -CM_ SG_ 456 BOH "could be cruise standstill?"; +CM_ SG_ 456 STANDSTILL "set to 1 when camera requests -4.0 m/s^2"; VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P"; VAL_ 401 GEAR 7 "L" 10 "S" 4 "D" 3 "N" 2 "R" 1 "P"; diff --git a/opendbc/hyundai_canfd.dbc b/opendbc/hyundai_canfd.dbc index a7a051189..d3d22f794 100644 --- a/opendbc/hyundai_canfd.dbc +++ b/opendbc/hyundai_canfd.dbc @@ -101,7 +101,7 @@ BO_ 261 ACCELERATOR_ALT: 32 XXX BO_ 293 STEERING_SENSORS: 16 XXX SG_ CHECKSUM : 0|16@1+ (1,0) [0|65535] "" XXX SG_ COUNTER : 16|8@1+ (1,0) [0|255] "" XXX - SG_ STEERING_RATE : 40|8@1- (-0.1,0) [0|255] "deg/s" XXX + SG_ STEERING_RATE : 40|8@1+ (4.0,0) [0|1016] "deg/s" XXX SG_ STEERING_ANGLE : 24|16@1- (-0.1,0) [0|255] "deg" XXX BO_ 298 LFA: 16 XXX diff --git a/opendbc/hyundai_kia_generic.dbc b/opendbc/hyundai_kia_generic.dbc index f35199100..c14193440 100644 --- a/opendbc/hyundai_kia_generic.dbc +++ b/opendbc/hyundai_kia_generic.dbc @@ -1440,11 +1440,10 @@ BO_ 909 FCA11: 8 FCA SG_ FCA_DrvSetStatus : 22|3@1+ (1,0) [0|7] "" CLU,ESC SG_ CF_VSM_DecCmdAct : 31|1@1+ (1,0) [0|1] "" ESC SG_ FCA_Failinfo : 32|3@1+ (1,0) [0|7] "" ACU,CLU,ESC + SG_ CR_FCA_Alive : 35|4@1+ (1,0) [0|15] "" ESC SG_ FCA_RelativeVelocity : 39|9@1+ (0.1,-25.5) [-25.5|25.5] "m/s" iBAU SG_ FCA_TimetoCollision : 48|8@1+ (10,0) [0|2540] "ms" iBAU - SG_ CR_FCA_Alive : 56|4@1+ (1,0) [0|15] "" ESC - SG_ CR_FCA_ChkSum : 60|4@1+ (1,0) [0|15] "" ESC - SG_ Supplemental_Counter : 35|4@1+ (1,0) [0|15] "" XXX + SG_ CR_FCA_ChkSum : 56|8@1+ (1,0) [0|255] "" ESC SG_ PAINT1_Status : 16|2@1+ (1,0) [0|1] "" XXX BO_ 1156 HDA11_MFC: 8 XXX @@ -1649,6 +1648,7 @@ VAL_ 871 CF_Lvr_Gear 12 "T" 5 "D" 8 "S" 6 "N" 7 "R" 0 "P"; VAL_ 882 Elect_Gear_Shifter 5 "D" 8 "S" 6 "N" 7 "R" 0 "P"; VAL_ 905 ACCMode 0 "off" 1 "enabled" 2 "driver_override" 3 "off_maybe_fault" 4 "cancelled"; VAL_ 909 CF_VSM_Warn 2 "FCW" 3 "AEB"; +VAL_ 916 ACCEnable 0 "SCC ready" 1 "SCC temp fault" 2 "SCC permanent fault" 3 "SCC permanent fault, communication issue"; VAL_ 1057 ACCMode 0 "off" 1 "enabled" 2 "driver_override" 3 "off_maybe_fault"; VAL_ 1157 HDA_Icon_State 0 "no_hda" 1 "white_hda" 2 "green_hda"; VAL_ 1157 LFA_SysWarning 0 "no_message" 1 "switching_to_hda" 2 "switching_to_scc" 3 "lfa_error" 4 "check_hda" 5 "keep_hands_on_wheel_orange" 6 "keep_hands_on_wheel_red"; diff --git a/opendbc/hyundai_kia_mando_front_radar_gen.py b/opendbc/hyundai_kia_mando_front_radar_gen.py deleted file mode 100755 index c262c50ee..000000000 --- a/opendbc/hyundai_kia_mando_front_radar_gen.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python3 - -if __name__ == "__main__": - print(""" -VERSION "" - - -NS_ : - NS_DESC_ - CM_ - BA_DEF_ - BA_ - VAL_ - CAT_DEF_ - CAT_ - FILTER - BA_DEF_DEF_ - EV_DATA_ - ENVVAR_DATA_ - SGTYPE_ - SGTYPE_VAL_ - BA_DEF_SGTYPE_ - BA_SGTYPE_ - SIG_TYPE_REF_ - VAL_TABLE_ - SIG_GROUP_ - SIG_VALTYPE_ - SIGTYPE_VALTYPE_ - BO_TX_BU_ - BA_DEF_REL_ - BA_REL_ - BA_DEF_DEF_REL_ - BU_SG_REL_ - BU_EV_REL_ - BU_BO_REL_ - SG_MUL_VAL_ - -BS_: - -BU_: XXX - """) - - # note: 0x501/0x502 seem to be special in 0x5XX range - for a in range(0x500, 0x500 + 32): - print(f""" -BO_ {a} RADAR_TRACK_{a:x}: 8 RADAR -SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX -SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX -SG_ STATE : 15|3@0+ (1,0) [0|7] "" XXX -SG_ LONG_DIST : 18|11@0+ (0.1,0) [0|204.7] "" XXX -SG_ REL_ACCEL : 33|10@0- (0.02,0) [-10.24|10.22] "" XXX -SG_ ZEROS : 37|4@0+ (1,0) [0|255] "" XXX -SG_ COUNTER : 38|1@0+ (1,0) [0|1] "" XXX -SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX -SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX -SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - """) diff --git a/opendbc/hyundai_kia_mando_front_radar.dbc b/opendbc/hyundai_kia_mando_front_radar_generated.dbc similarity index 98% rename from opendbc/hyundai_kia_mando_front_radar.dbc rename to opendbc/hyundai_kia_mando_front_radar_generated.dbc index 552cdddea..4abd25331 100644 --- a/opendbc/hyundai_kia_mando_front_radar.dbc +++ b/opendbc/hyundai_kia_mando_front_radar_generated.dbc @@ -1,3 +1,6 @@ +CM_ "AUTOGENERATED FILE, DO NOT EDIT"; + +CM_ "hyundai_kia_mando_front_radar.dbc starts here"; VERSION "" @@ -35,8 +38,7 @@ NS_ : BS_: BU_: XXX - - + BO_ 1280 RADAR_TRACK_500: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -48,8 +50,7 @@ BO_ 1280 RADAR_TRACK_500: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1281 RADAR_TRACK_501: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -61,8 +62,7 @@ BO_ 1281 RADAR_TRACK_501: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1282 RADAR_TRACK_502: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -74,8 +74,7 @@ BO_ 1282 RADAR_TRACK_502: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1283 RADAR_TRACK_503: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -87,8 +86,7 @@ BO_ 1283 RADAR_TRACK_503: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1284 RADAR_TRACK_504: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -100,8 +98,7 @@ BO_ 1284 RADAR_TRACK_504: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1285 RADAR_TRACK_505: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -113,8 +110,7 @@ BO_ 1285 RADAR_TRACK_505: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1286 RADAR_TRACK_506: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -126,8 +122,7 @@ BO_ 1286 RADAR_TRACK_506: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1287 RADAR_TRACK_507: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -139,8 +134,7 @@ BO_ 1287 RADAR_TRACK_507: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1288 RADAR_TRACK_508: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -152,8 +146,7 @@ BO_ 1288 RADAR_TRACK_508: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1289 RADAR_TRACK_509: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -165,8 +158,7 @@ BO_ 1289 RADAR_TRACK_509: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1290 RADAR_TRACK_50a: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -178,8 +170,7 @@ BO_ 1290 RADAR_TRACK_50a: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1291 RADAR_TRACK_50b: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -191,8 +182,7 @@ BO_ 1291 RADAR_TRACK_50b: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1292 RADAR_TRACK_50c: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -204,8 +194,7 @@ BO_ 1292 RADAR_TRACK_50c: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1293 RADAR_TRACK_50d: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -217,8 +206,7 @@ BO_ 1293 RADAR_TRACK_50d: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1294 RADAR_TRACK_50e: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -230,8 +218,7 @@ BO_ 1294 RADAR_TRACK_50e: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1295 RADAR_TRACK_50f: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -243,8 +230,7 @@ BO_ 1295 RADAR_TRACK_50f: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1296 RADAR_TRACK_510: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -256,8 +242,7 @@ BO_ 1296 RADAR_TRACK_510: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1297 RADAR_TRACK_511: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -269,8 +254,7 @@ BO_ 1297 RADAR_TRACK_511: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1298 RADAR_TRACK_512: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -282,8 +266,7 @@ BO_ 1298 RADAR_TRACK_512: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1299 RADAR_TRACK_513: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -295,8 +278,7 @@ BO_ 1299 RADAR_TRACK_513: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1300 RADAR_TRACK_514: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -308,8 +290,7 @@ BO_ 1300 RADAR_TRACK_514: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1301 RADAR_TRACK_515: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -321,8 +302,7 @@ BO_ 1301 RADAR_TRACK_515: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1302 RADAR_TRACK_516: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -334,8 +314,7 @@ BO_ 1302 RADAR_TRACK_516: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1303 RADAR_TRACK_517: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -347,8 +326,7 @@ BO_ 1303 RADAR_TRACK_517: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1304 RADAR_TRACK_518: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -360,8 +338,7 @@ BO_ 1304 RADAR_TRACK_518: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1305 RADAR_TRACK_519: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -373,8 +350,7 @@ BO_ 1305 RADAR_TRACK_519: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1306 RADAR_TRACK_51a: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -386,8 +362,7 @@ BO_ 1306 RADAR_TRACK_51a: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1307 RADAR_TRACK_51b: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -399,8 +374,7 @@ BO_ 1307 RADAR_TRACK_51b: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1308 RADAR_TRACK_51c: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -412,8 +386,7 @@ BO_ 1308 RADAR_TRACK_51c: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1309 RADAR_TRACK_51d: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -425,8 +398,7 @@ BO_ 1309 RADAR_TRACK_51d: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1310 RADAR_TRACK_51e: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -438,8 +410,7 @@ BO_ 1310 RADAR_TRACK_51e: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - - + BO_ 1311 RADAR_TRACK_51f: 8 RADAR SG_ UNKNOWN_1 : 7|8@0- (1,0) [-128|127] "" XXX SG_ AZIMUTH : 12|10@0- (0.2,0) [-102.4|102.2] "" XXX @@ -451,4 +422,4 @@ BO_ 1311 RADAR_TRACK_51f: 8 RADAR SG_ STATE_3 : 39|1@0+ (1,0) [0|1] "" XXX SG_ REL_SPEED : 53|14@0- (0.01,0) [-81.92|81.92] "" XXX SG_ STATE_2 : 55|2@0+ (1,0) [0|3] "" XXX - + \ No newline at end of file diff --git a/panda/board/obj/bootstub.panda.bin b/panda/board/obj/bootstub.panda.bin index a48c8c4d6..78786352c 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/panda.bin.signed b/panda/board/obj/panda.bin.signed index 2640db76b..e1c51b1a7 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.bin.sspoof.signed b/panda/board/obj/panda.bin.sspoof.signed index fdfe941b0..989541b46 100644 Binary files a/panda/board/obj/panda.bin.sspoof.signed and b/panda/board/obj/panda.bin.sspoof.signed differ diff --git a/panda/board/obj/panda.bin.testing.signed b/panda/board/obj/panda.bin.testing.signed index 3f97aedc7..a398a2876 100644 Binary files a/panda/board/obj/panda.bin.testing.signed and b/panda/board/obj/panda.bin.testing.signed differ diff --git a/panda/board/obj/panda.bin.testing.sspoof.signed b/panda/board/obj/panda.bin.testing.sspoof.signed index 7cb763ad7..cda54bfcd 100644 Binary files a/panda/board/obj/panda.bin.testing.sspoof.signed and b/panda/board/obj/panda.bin.testing.sspoof.signed differ diff --git a/panda/python/__init__.py b/panda/python/__init__.py index 2b4e701d7..117fec65e 100644 --- a/panda/python/__init__.py +++ b/panda/python/__init__.py @@ -117,6 +117,16 @@ def ensure_can_packet_version(fn): return fn(self, *args, **kwargs) return wrapper +def ensure_can_health_packet_version(fn): + @wraps(fn) + def wrapper(self, *args, **kwargs): + if self.can_health_version < self.CAN_HEALTH_PACKET_VERSION: + raise RuntimeError("Panda firmware has outdated CAN health packet definition. Reflash panda firmware.") + elif self.can_health_version > self.CAN_HEALTH_PACKET_VERSION: + raise RuntimeError("Panda python library has outdated CAN health packet definition. Update panda python library.") + return fn(self, *args, **kwargs) + return wrapper + class ALTERNATIVE_EXPERIENCE: DEFAULT = 0 DISABLE_DISENGAGE_ON_GAS = 1 @@ -172,17 +182,20 @@ class Panda: HW_TYPE_UNO = b'\x05' HW_TYPE_DOS = b'\x06' HW_TYPE_RED_PANDA = b'\x07' + HW_TYPE_RED_PANDA_V2 = b'\x08' CAN_PACKET_VERSION = 2 - HEALTH_PACKET_VERSION = 8 - HEALTH_STRUCT = struct.Struct(" None: + def send(self, dat: bytes, setup_only: bool = False) -> None: # throw away any stale data self._can_client.recv(drain=True) @@ -396,39 +396,42 @@ class IsoTpMessage(): self.rx_idx = 0 self.rx_done = False - if self.debug: + if self.debug and not setup_only: print(f"ISO-TP: REQUEST - {hex(self._can_client.tx_addr)} 0x{bytes.hex(self.tx_dat)}") - self._tx_first_frame() + self._tx_first_frame(setup_only=setup_only) - def _tx_first_frame(self) -> None: + def _tx_first_frame(self, setup_only: bool = False) -> None: if self.tx_len < self.max_len: # single frame (send all bytes) - if self.debug: + if self.debug and not setup_only: print(f"ISO-TP: TX - single frame - {hex(self._can_client.tx_addr)}") msg = (bytes([self.tx_len]) + self.tx_dat).ljust(self.max_len, b"\x00") self.tx_done = True else: # first frame (send first 6 bytes) - if self.debug: + if self.debug and not setup_only: print(f"ISO-TP: TX - first frame - {hex(self._can_client.tx_addr)}") msg = (struct.pack("!H", 0x1000 | self.tx_len) + self.tx_dat[:self.max_len - 2]).ljust(self.max_len - 2, b"\x00") - self._can_client.send([msg]) + if not setup_only: + self._can_client.send([msg]) - def recv(self, timeout=None) -> Optional[bytes]: + def recv(self, timeout=None) -> Tuple[Optional[bytes], bool]: if timeout is None: timeout = self.timeout start_time = time.monotonic() + updated = False try: while True: for msg in self._can_client.recv(): self._isotp_rx_next(msg) start_time = time.monotonic() + updated = True if self.tx_done and self.rx_done: - return self.rx_dat + return self.rx_dat, updated # no timeout indicates non-blocking if timeout == 0: - return None + return None, updated if time.monotonic() - start_time > timeout: raise MessageTimeoutError("timeout waiting for response") finally: @@ -456,8 +459,8 @@ class IsoTpMessage(): print(f"ISO-TP: RX - first frame - {hex(self._can_client.rx_addr)} idx={self.rx_idx} done={self.rx_done}") if self.debug: print(f"ISO-TP: TX - flow control continue - {hex(self._can_client.tx_addr)}") - # send flow control message (send all bytes) - msg = b"\x30\x00\x00".ljust(self.max_len, b"\x00") + # send flow control message (send all bytes) with a separation time of 10 ms + msg = b"\x30\x00\x0a".ljust(self.max_len, b"\x00") self._can_client.send([msg]) return @@ -553,7 +556,7 @@ class UdsClient(): response_pending = False while True: timeout = self.response_pending_timeout if response_pending else self.timeout - resp = isotp_msg.recv(timeout) + resp, _ = isotp_msg.recv(timeout) if resp is None: continue diff --git a/rednose/helpers/ekf_sym_pyx.so b/rednose/helpers/ekf_sym_pyx.so index d3aed61f9..00dba8c87 100755 Binary files a/rednose/helpers/ekf_sym_pyx.so and b/rednose/helpers/ekf_sym_pyx.so differ diff --git a/selfdrive/assets/images/button_flag.png b/selfdrive/assets/images/button_flag.png new file mode 100644 index 000000000..cac4db6d4 Binary files /dev/null and b/selfdrive/assets/images/button_flag.png differ diff --git a/selfdrive/boardd/boardd b/selfdrive/boardd/boardd index ddeccfd07..528c44807 100755 Binary files a/selfdrive/boardd/boardd and b/selfdrive/boardd/boardd differ diff --git a/selfdrive/boardd/boardd_api_impl.so b/selfdrive/boardd/boardd_api_impl.so index 5096b2b99..ae76e3043 100755 Binary files a/selfdrive/boardd/boardd_api_impl.so and b/selfdrive/boardd/boardd_api_impl.so differ diff --git a/selfdrive/boardd/panda.h b/selfdrive/boardd/panda.h index dc9516699..ffe071ff4 100644 --- a/selfdrive/boardd/panda.h +++ b/selfdrive/boardd/panda.h @@ -16,6 +16,7 @@ #include "panda/board/health.h" #define TIMEOUT 0 +#define PANDA_CAN_CNT 3 #define PANDA_BUS_CNT 4 #define RECV_SIZE (0x4000U) #define USB_TX_SOFT_LIMIT (0x100U) @@ -82,6 +83,7 @@ class Panda { uint16_t get_fan_speed(); void set_ir_pwr(uint16_t ir_pwr); std::optional get_state(); + std::optional get_can_state(uint16_t can_number); void set_loopback(bool loopback); std::optional> get_firmware_version(); std::optional get_serial(); diff --git a/selfdrive/car/__init__.py b/selfdrive/car/__init__.py index f2d198338..8ff39ceae 100644 --- a/selfdrive/car/__init__.py +++ b/selfdrive/car/__init__.py @@ -12,6 +12,14 @@ ButtonType = car.CarState.ButtonEvent.Type EventName = car.CarEvent.EventName +def apply_hysteresis(val: float, val_steady: float, hyst_gap: float) -> float: + if val > val_steady + hyst_gap: + val_steady = val - hyst_gap + elif val < val_steady - hyst_gap: + val_steady = val + hyst_gap + return val_steady + + def create_button_event(cur_but: int, prev_but: int, buttons_dict: Dict[int, capnp.lib.capnp._EnumModule], unpressed: int = 0) -> capnp.lib.capnp._DynamicStructBuilder: if cur_but != unpressed: diff --git a/selfdrive/car/body/values.py b/selfdrive/car/body/values.py index 61b72d5ad..66f1b947a 100644 --- a/selfdrive/car/body/values.py +++ b/selfdrive/car/body/values.py @@ -3,10 +3,13 @@ from typing import Dict from cereal import car from selfdrive.car import dbc_dict from selfdrive.car.docs_definitions import CarInfo +from selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries + Ecu = car.CarParams.Ecu SPEED_FROM_RPM = 0.008587 + class CarControllerParams: ANGLE_DELTA_BP = [0., 5., 15.] ANGLE_DELTA_V = [5., .8, .15] # windup limit @@ -14,13 +17,25 @@ class CarControllerParams: LKAS_MAX_TORQUE = 1 # A value of 1 is easy to overpower STEER_THRESHOLD = 1.0 + class CAR: BODY = "COMMA BODY" + CAR_INFO: Dict[str, CarInfo] = { CAR.BODY: CarInfo("comma body", package="All"), } +FW_QUERY_CONFIG = FwQueryConfig( + requests=[ + Request( + [StdQueries.TESTER_PRESENT_REQUEST, StdQueries.UDS_VERSION_REQUEST], + [StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.UDS_VERSION_RESPONSE], + bus=0, + ), + ], +) + FW_VERSIONS = { CAR.BODY: { (Ecu.engine, 0x720, None): [ diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 6713f9d64..a3f739e9b 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -106,7 +106,7 @@ def fingerprint(logcan, sendcan): car_fw = list(cached_params.carFw) else: cloudlog.warning("Getting VIN & FW versions") - _, vin_rx_addr, vin = get_vin(logcan, sendcan, bus) + vin_rx_addr, vin = get_vin(logcan, sendcan, bus) ecu_rx_addrs = get_present_ecus(logcan, sendcan) car_fw = get_fw_versions_ordered(logcan, sendcan, ecu_rx_addrs) diff --git a/selfdrive/car/chrysler/interface.py b/selfdrive/car/chrysler/interface.py index 94612ec8c..6344242ff 100755 --- a/selfdrive/car/chrysler/interface.py +++ b/selfdrive/car/chrysler/interface.py @@ -74,6 +74,8 @@ class CarInterface(CarInterfaceBase): else: raise ValueError(f"Unsupported car: {candidate}") + CarInterfaceBase.configure_dp_tune(candidate, ret.lateralTuning) + ret.centerToFront = ret.wheelbase * 0.44 # starting with reasonable value for civic and scaling by mass and wheelbase diff --git a/selfdrive/car/chrysler/values.py b/selfdrive/car/chrysler/values.py index f495d06a1..7180ace52 100644 --- a/selfdrive/car/chrysler/values.py +++ b/selfdrive/car/chrysler/values.py @@ -3,8 +3,11 @@ from enum import Enum from typing import Dict, List, Optional, Union from cereal import car +from panda.python import uds from selfdrive.car import dbc_dict from selfdrive.car.docs_definitions import CarInfo, Harness +from selfdrive.car.fw_query_definitions import FwQueryConfig, Request, p16 + Ecu = car.CarParams.Ecu @@ -49,7 +52,7 @@ RAM_CARS = RAM_DT | RAM_HD @dataclass class ChryslerCarInfo(CarInfo): - package: str = "Adaptive Cruise Control" + package: str = "Adaptive Cruise Control (ACC)" harness: Enum = Harness.fca CAR_INFO: Dict[str, Optional[Union[ChryslerCarInfo, List[ChryslerCarInfo]]]] = { @@ -129,6 +132,42 @@ FINGERPRINTS = { }], } +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]) + \ + p16(0xf132) + +CHRYSLER_SOFTWARE_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.SYSTEM_SUPPLIER_ECU_SOFTWARE_NUMBER) +CHRYSLER_SOFTWARE_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.SYSTEM_SUPPLIER_ECU_SOFTWARE_NUMBER) + +CHRYSLER_RX_OFFSET = -0x280 + +FW_QUERY_CONFIG = FwQueryConfig( + requests=[ + Request( + [CHRYSLER_VERSION_REQUEST], + [CHRYSLER_VERSION_RESPONSE], + whitelist_ecus=[Ecu.abs, Ecu.eps, Ecu.srs, Ecu.fwdRadar, Ecu.fwdCamera, Ecu.combinationMeter], + rx_offset=CHRYSLER_RX_OFFSET, + bus=0, + ), + Request( + [CHRYSLER_VERSION_REQUEST], + [CHRYSLER_VERSION_RESPONSE], + whitelist_ecus=[Ecu.abs, Ecu.hcp, Ecu.engine, Ecu.transmission], + bus=0, + ), + Request( + [CHRYSLER_SOFTWARE_VERSION_REQUEST], + [CHRYSLER_SOFTWARE_VERSION_RESPONSE], + whitelist_ecus=[Ecu.engine, Ecu.transmission], + bus=0, + ), + ], +) + FW_VERSIONS = { CAR.PACIFICA_2019_HYBRID: { (Ecu.hcp, 0x7e2, None): [], @@ -187,12 +226,6 @@ FW_VERSIONS = { b'68540431AB', b'68484467AC', ], - (Ecu.gateway, 0x18DACBF1, None): [ - b'68402660AB', - b'68445283AB', - b'68533631AB', - b'68500483AB', - ], }, CAR.RAM_HD: { @@ -224,10 +257,6 @@ FW_VERSIONS = { b'M2370131MB', b'M2421132MB', ], - (Ecu.gateway, 0x18DACBF1, None): [ - b'68488419AB', - b'68535476AB', - ], }, } diff --git a/selfdrive/car/ecu_addrs.py b/selfdrive/car/ecu_addrs.py index 267701509..9f6ace2b5 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 -import traceback from typing import Optional, Set, Tuple import cereal.messaging as messaging @@ -62,7 +61,7 @@ def get_ecu_addrs(logcan: messaging.SubSocket, sendcan: messaging.PubSocket, que print(f"Duplicate ECU address: {hex(msg.address)}") ecu_responses.add((msg.address, subaddr, msg.src)) except Exception: - cloudlog.warning(f"ECU addr scan exception: {traceback.format_exc()}") + cloudlog.exception("ECU addr scan exception") return ecu_responses @@ -71,6 +70,8 @@ if __name__ == "__main__": parser = argparse.ArgumentParser(description='Get addresses of all ECUs') parser.add_argument('--debug', action='store_true') + parser.add_argument('--bus', type=int, default=1) + parser.add_argument('--timeout', type=float, default=1.0) args = parser.parse_args() logcan = messaging.sub_sock('can') @@ -79,7 +80,7 @@ if __name__ == "__main__": time.sleep(1.0) print("Getting ECU addresses ...") - ecu_addrs = get_all_ecu_addrs(logcan, sendcan, 1, debug=args.debug) + ecu_addrs = get_all_ecu_addrs(logcan, sendcan, args.bus, args.timeout, debug=args.debug) print() print("Found ECUs on addresses:") diff --git a/selfdrive/car/ford/interface.py b/selfdrive/car/ford/interface.py index 9f38f5535..cdb8f1dcf 100644 --- a/selfdrive/car/ford/interface.py +++ b/selfdrive/car/ford/interface.py @@ -45,6 +45,8 @@ class CarInterface(CarInterfaceBase): else: raise ValueError(f"Unsupported car: ${candidate}") + CarInterfaceBase.configure_dp_tune(candidate, ret.lateralTuning) + # 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[0]: diff --git a/selfdrive/car/ford/values.py b/selfdrive/car/ford/values.py index 54ff043a3..5820b5c9f 100644 --- a/selfdrive/car/ford/values.py +++ b/selfdrive/car/ford/values.py @@ -6,6 +6,7 @@ from typing import Dict, List, Union from cereal import car from selfdrive.car import dbc_dict from selfdrive.car.docs_definitions import CarInfo, Harness +from selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries Ecu = car.CarParams.Ecu TransmissionType = car.CarParams.TransmissionType @@ -61,6 +62,21 @@ CAR_INFO: Dict[str, Union[CarInfo, List[CarInfo]]] = { CAR.FOCUS_MK4: FordCarInfo("Ford Focus EU 2019", "Driver Assistance Pack"), } +FW_QUERY_CONFIG = FwQueryConfig( + requests=[ + Request( + [StdQueries.TESTER_PRESENT_REQUEST, StdQueries.MANUFACTURER_SOFTWARE_VERSION_REQUEST], + [StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.MANUFACTURER_SOFTWARE_VERSION_RESPONSE], + whitelist_ecus=[Ecu.engine], + ), + Request( + [StdQueries.TESTER_PRESENT_REQUEST, StdQueries.MANUFACTURER_SOFTWARE_VERSION_REQUEST], + [StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.MANUFACTURER_SOFTWARE_VERSION_RESPONSE], + bus=0, + whitelist_ecus=[Ecu.eps, Ecu.abs, Ecu.fwdRadar, Ecu.fwdCamera, Ecu.shiftByWire], + ), + ], +) FW_VERSIONS = { CAR.ESCAPE_MK4: { diff --git a/selfdrive/car/fw_query_definitions.py b/selfdrive/car/fw_query_definitions.py new file mode 100755 index 000000000..c3b74da92 --- /dev/null +++ b/selfdrive/car/fw_query_definitions.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python3 +import capnp +from dataclasses import dataclass, field +import struct +from typing import Dict, List + +import panda.python.uds as uds + + +def p16(val): + return struct.pack("!H", val) + + +class StdQueries: + # FW queries + TESTER_PRESENT_REQUEST = bytes([uds.SERVICE_TYPE.TESTER_PRESENT, 0x0]) + TESTER_PRESENT_RESPONSE = bytes([uds.SERVICE_TYPE.TESTER_PRESENT + 0x40, 0x0]) + + SHORT_TESTER_PRESENT_REQUEST = bytes([uds.SERVICE_TYPE.TESTER_PRESENT]) + SHORT_TESTER_PRESENT_RESPONSE = bytes([uds.SERVICE_TYPE.TESTER_PRESENT + 0x40]) + + DEFAULT_DIAGNOSTIC_REQUEST = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL, + uds.SESSION_TYPE.DEFAULT]) + DEFAULT_DIAGNOSTIC_RESPONSE = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL + 0x40, + uds.SESSION_TYPE.DEFAULT, 0x0, 0x32, 0x1, 0xf4]) + + EXTENDED_DIAGNOSTIC_REQUEST = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL, + uds.SESSION_TYPE.EXTENDED_DIAGNOSTIC]) + EXTENDED_DIAGNOSTIC_RESPONSE = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL + 0x40, + uds.SESSION_TYPE.EXTENDED_DIAGNOSTIC, 0x0, 0x32, 0x1, 0xf4]) + + MANUFACTURER_SOFTWARE_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER) + MANUFACTURER_SOFTWARE_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER) + + UDS_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_SOFTWARE_IDENTIFICATION) + UDS_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_SOFTWARE_IDENTIFICATION) + + OBD_VERSION_REQUEST = b'\x09\x04' + OBD_VERSION_RESPONSE = b'\x49\x04' + + # VIN queries + OBD_VIN_REQUEST = b'\x09\x02' + OBD_VIN_RESPONSE = b'\x49\x02\x01' + + UDS_VIN_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + p16(uds.DATA_IDENTIFIER_TYPE.VIN) + UDS_VIN_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + p16(uds.DATA_IDENTIFIER_TYPE.VIN) + + +@dataclass +class Request: + request: List[bytes] + response: List[bytes] + whitelist_ecus: List[int] = field(default_factory=list) + rx_offset: int = 0x8 + bus: int = 1 + + +@dataclass +class FwQueryConfig: + requests: List[Request] + # 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) diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py index 376a743df..7e03f4b02 100755 --- a/selfdrive/car/fw_versions.py +++ b/selfdrive/car/fw_versions.py @@ -1,9 +1,6 @@ #!/usr/bin/env python3 -import struct -import traceback from collections import defaultdict -from dataclasses import dataclass, field -from typing import Any, List, Optional, Set, Tuple +from typing import Any, Optional, Set, Tuple from tqdm import tqdm import panda.python.uds as uds @@ -12,237 +9,16 @@ from selfdrive.car.ecu_addrs import get_ecu_addrs from selfdrive.car.interfaces import get_interface_attr from selfdrive.car.fingerprints import FW_VERSIONS from selfdrive.car.isotp_parallel_query import IsoTpParallelQuery -from selfdrive.car.toyota.values import CAR as TOYOTA from system.swaglog import cloudlog Ecu = car.CarParams.Ecu ESSENTIAL_ECUS = [Ecu.engine, Ecu.eps, Ecu.abs, Ecu.fwdRadar, Ecu.fwdCamera, Ecu.vsa] +FW_QUERY_CONFIGS = get_interface_attr('FW_QUERY_CONFIG', ignore_none=True) +VERSIONS = get_interface_attr('FW_VERSIONS', ignore_none=True) -def p16(val): - return struct.pack("!H", val) - - -TESTER_PRESENT_REQUEST = bytes([uds.SERVICE_TYPE.TESTER_PRESENT, 0x0]) -TESTER_PRESENT_RESPONSE = bytes([uds.SERVICE_TYPE.TESTER_PRESENT + 0x40, 0x0]) - -SHORT_TESTER_PRESENT_REQUEST = bytes([uds.SERVICE_TYPE.TESTER_PRESENT]) -SHORT_TESTER_PRESENT_RESPONSE = bytes([uds.SERVICE_TYPE.TESTER_PRESENT + 0x40]) - -DEFAULT_DIAGNOSTIC_REQUEST = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL, - uds.SESSION_TYPE.DEFAULT]) -DEFAULT_DIAGNOSTIC_RESPONSE = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL + 0x40, - uds.SESSION_TYPE.DEFAULT, 0x0, 0x32, 0x1, 0xf4]) - -EXTENDED_DIAGNOSTIC_REQUEST = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL, - uds.SESSION_TYPE.EXTENDED_DIAGNOSTIC]) -EXTENDED_DIAGNOSTIC_RESPONSE = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL + 0x40, - uds.SESSION_TYPE.EXTENDED_DIAGNOSTIC, 0x0, 0x32, 0x1, 0xf4]) - -UDS_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_SOFTWARE_IDENTIFICATION) -UDS_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_SOFTWARE_IDENTIFICATION) - - -HYUNDAI_VERSION_REQUEST_LONG = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ - p16(0xf100) # Long description -HYUNDAI_VERSION_REQUEST_MULTI = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_SPARE_PART_NUMBER) + \ - p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_SOFTWARE_IDENTIFICATION) + \ - p16(0xf100) -HYUNDAI_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) - - -TOYOTA_VERSION_REQUEST = b'\x1a\x88\x01' -TOYOTA_VERSION_RESPONSE = b'\x5a\x88\x01' - -VOLKSWAGEN_VERSION_REQUEST_MULTI = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_SPARE_PART_NUMBER) + \ - p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_VERSION_NUMBER) + \ - p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_DATA_IDENTIFICATION) -VOLKSWAGEN_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) - -OBD_VERSION_REQUEST = b'\x09\x04' -OBD_VERSION_RESPONSE = b'\x49\x04' - -DEFAULT_RX_OFFSET = 0x8 -VOLKSWAGEN_RX_OFFSET = 0x6a - -MAZDA_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER) -MAZDA_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER) - -NISSAN_DIAGNOSTIC_REQUEST_KWP = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL, 0xc0]) -NISSAN_DIAGNOSTIC_RESPONSE_KWP = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL + 0x40, 0xc0]) - -NISSAN_VERSION_REQUEST_KWP = b'\x21\x83' -NISSAN_VERSION_RESPONSE_KWP = b'\x61\x83' - -NISSAN_VERSION_REQUEST_STANDARD = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER) -NISSAN_VERSION_RESPONSE_STANDARD = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER) - -NISSAN_RX_OFFSET = 0x20 - -SUBARU_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_DATA_IDENTIFICATION) -SUBARU_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_DATA_IDENTIFICATION) - -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]) + \ - p16(0xf132) - -CHRYSLER_SOFTWARE_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.SYSTEM_SUPPLIER_ECU_SOFTWARE_NUMBER) -CHRYSLER_SOFTWARE_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.SYSTEM_SUPPLIER_ECU_SOFTWARE_NUMBER) - -CHRYSLER_RX_OFFSET = -0x280 - -FORD_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER) -FORD_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ - p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_NUMBER) - - -@dataclass -class Request: - brand: str - request: List[bytes] - response: List[bytes] - whitelist_ecus: List[int] = field(default_factory=list) - rx_offset: int = DEFAULT_RX_OFFSET - bus: int = 1 - - -REQUESTS: List[Request] = [ - # Subaru - Request( - "subaru", - [TESTER_PRESENT_REQUEST, SUBARU_VERSION_REQUEST], - [TESTER_PRESENT_RESPONSE, SUBARU_VERSION_RESPONSE], - ), - # Hyundai - Request( - "hyundai", - [HYUNDAI_VERSION_REQUEST_LONG], - [HYUNDAI_VERSION_RESPONSE], - ), - Request( - "hyundai", - [HYUNDAI_VERSION_REQUEST_MULTI], - [HYUNDAI_VERSION_RESPONSE], - ), - # Honda - Request( - "honda", - [UDS_VERSION_REQUEST], - [UDS_VERSION_RESPONSE], - ), - # Toyota - Request( - "toyota", - [SHORT_TESTER_PRESENT_REQUEST, TOYOTA_VERSION_REQUEST], - [SHORT_TESTER_PRESENT_RESPONSE, TOYOTA_VERSION_RESPONSE], - bus=0, - ), - Request( - "toyota", - [SHORT_TESTER_PRESENT_REQUEST, OBD_VERSION_REQUEST], - [SHORT_TESTER_PRESENT_RESPONSE, OBD_VERSION_RESPONSE], - bus=0, - ), - Request( - "toyota", - [TESTER_PRESENT_REQUEST, DEFAULT_DIAGNOSTIC_REQUEST, EXTENDED_DIAGNOSTIC_REQUEST, UDS_VERSION_REQUEST], - [TESTER_PRESENT_RESPONSE, DEFAULT_DIAGNOSTIC_RESPONSE, EXTENDED_DIAGNOSTIC_RESPONSE, UDS_VERSION_RESPONSE], - bus=0, - ), - # Volkswagen - Request( - "volkswagen", - [VOLKSWAGEN_VERSION_REQUEST_MULTI], - [VOLKSWAGEN_VERSION_RESPONSE], - whitelist_ecus=[Ecu.srs, Ecu.eps, Ecu.fwdRadar], - rx_offset=VOLKSWAGEN_RX_OFFSET, - ), - Request( - "volkswagen", - [VOLKSWAGEN_VERSION_REQUEST_MULTI], - [VOLKSWAGEN_VERSION_RESPONSE], - whitelist_ecus=[Ecu.engine, Ecu.transmission], - ), - # Mazda - Request( - "mazda", - [MAZDA_VERSION_REQUEST], - [MAZDA_VERSION_RESPONSE], - ), - # Nissan - Request( - "nissan", - [NISSAN_DIAGNOSTIC_REQUEST_KWP, NISSAN_VERSION_REQUEST_KWP], - [NISSAN_DIAGNOSTIC_RESPONSE_KWP, NISSAN_VERSION_RESPONSE_KWP], - ), - Request( - "nissan", - [NISSAN_DIAGNOSTIC_REQUEST_KWP, NISSAN_VERSION_REQUEST_KWP], - [NISSAN_DIAGNOSTIC_RESPONSE_KWP, NISSAN_VERSION_RESPONSE_KWP], - rx_offset=NISSAN_RX_OFFSET, - ), - Request( - "nissan", - [NISSAN_VERSION_REQUEST_STANDARD], - [NISSAN_VERSION_RESPONSE_STANDARD], - rx_offset=NISSAN_RX_OFFSET, - ), - # Body - Request( - "body", - [TESTER_PRESENT_REQUEST, UDS_VERSION_REQUEST], - [TESTER_PRESENT_RESPONSE, UDS_VERSION_RESPONSE], - bus=0, - ), - # Chrysler / FCA / Stellantis - Request( - "chrysler", - [CHRYSLER_VERSION_REQUEST], - [CHRYSLER_VERSION_RESPONSE], - whitelist_ecus=[Ecu.abs, Ecu.eps, Ecu.srs, Ecu.gateway, Ecu.fwdRadar, Ecu.fwdCamera, Ecu.combinationMeter], - rx_offset=CHRYSLER_RX_OFFSET, - ), - Request( - "chrysler", - [CHRYSLER_VERSION_REQUEST], - [CHRYSLER_VERSION_RESPONSE], - whitelist_ecus=[Ecu.abs, Ecu.hcp, Ecu.engine, Ecu.transmission], - ), - Request( - "chrysler", - [CHRYSLER_SOFTWARE_VERSION_REQUEST], - [CHRYSLER_SOFTWARE_VERSION_RESPONSE], - whitelist_ecus=[Ecu.engine, Ecu.transmission], - ), - # Ford - Request( - "ford", - [TESTER_PRESENT_REQUEST, FORD_VERSION_REQUEST], - [TESTER_PRESENT_RESPONSE, FORD_VERSION_RESPONSE], - whitelist_ecus=[Ecu.engine], - ), - Request( - "ford", - [TESTER_PRESENT_REQUEST, FORD_VERSION_REQUEST], - [TESTER_PRESENT_RESPONSE, FORD_VERSION_RESPONSE], - bus=0, - whitelist_ecus=[Ecu.eps, Ecu.abs, Ecu.fwdRadar, Ecu.fwdCamera, Ecu.shiftByWire], - ), -] +MODEL_TO_BRAND = {c: b for b, e in VERSIONS.items() for c in e} +REQUESTS = [(brand, r) for brand, config in FW_QUERY_CONFIGS.items() for r in config.requests] def chunks(l, n=128): @@ -261,9 +37,8 @@ def build_fw_dict(fw_versions, filter_brand=None): def get_brand_addrs(): - versions = get_interface_attr('FW_VERSIONS', ignore_none=True) brand_addrs = defaultdict(set) - for brand, cars in versions.items(): + for brand, cars in VERSIONS.items(): for fw in cars.values(): brand_addrs[brand] |= {(addr, sub_addr) for _, addr, sub_addr in fw.keys()} return brand_addrs @@ -325,19 +100,19 @@ def match_fw_to_car_exact(fw_versions_dict): for candidate, fws in candidates.items(): for ecu, expected_versions in fws.items(): + config = FW_QUERY_CONFIGS[MODEL_TO_BRAND[candidate]] ecu_type = ecu[0] addr = ecu[1:] + found_versions = fw_versions_dict.get(addr, set()) - if ecu_type == Ecu.abs and candidate in (TOYOTA.RAV4, TOYOTA.COROLLA, TOYOTA.HIGHLANDER, TOYOTA.SIENNA, TOYOTA.LEXUS_IS) and not len(found_versions): - continue + if not len(found_versions): + # Some models can sometimes miss an ecu, or show on two different addresses + if candidate in config.non_essential_ecus.get(ecu_type, []): + continue - # On some Toyota models, the engine can show on two different addresses - if ecu_type == Ecu.engine and candidate in (TOYOTA.CAMRY, TOYOTA.COROLLA_TSS2, TOYOTA.CHR, TOYOTA.LEXUS_IS) and not len(found_versions): - continue - - # Ignore non essential ecus - if ecu_type not in ESSENTIAL_ECUS and not len(found_versions): - continue + # Ignore non essential ecus + if ecu_type not in ESSENTIAL_ECUS: + continue # Virtual debug ecu doesn't need to match the database if ecu_type == Ecu.debug: @@ -358,11 +133,10 @@ def match_fw_to_car(fw_versions, allow_exact=True, allow_fuzzy=True): if allow_fuzzy: exact_matches.append((False, match_fw_to_car_fuzzy)) - brands = get_interface_attr('FW_VERSIONS', ignore_none=True).keys() for exact_match, match_func in exact_matches: # For each brand, attempt to fingerprint using all FW returned from its queries matches = set() - for brand in brands: + for brand in VERSIONS.keys(): fw_versions_dict = build_fw_dict(fw_versions, filter_brand=brand) matches |= match_func(fw_versions_dict) @@ -376,13 +150,9 @@ def get_present_ecus(logcan, sendcan): queries = list() parallel_queries = list() responses = set() - versions = get_interface_attr('FW_VERSIONS', ignore_none=True) - for r in REQUESTS: - if r.brand not in versions: - continue - - for brand_versions in versions[r.brand].values(): + for brand, r in REQUESTS: + for brand_versions in VERSIONS[brand].values(): for ecu_type, addr, sub_addr in brand_versions: # Only query ecus in whitelist if whitelist is not empty if len(r.whitelist_ecus) == 0 or ecu_type in r.whitelist_ecus: @@ -411,9 +181,9 @@ def get_brand_ecu_matches(ecu_rx_addrs): """Returns dictionary of brands and matches with ECUs in their FW versions""" brand_addrs = get_brand_addrs() - brand_matches = {r.brand: set() for r in REQUESTS} + brand_matches = {brand: set() for brand, _ in REQUESTS} - brand_rx_offsets = set((r.brand, r.rx_offset) for r in REQUESTS) + brand_rx_offsets = set((brand, r.rx_offset) for brand, r in REQUESTS) for addr, sub_addr, _ in ecu_rx_addrs: # Since we can't know what request an ecu responded to, add matches for all possible rx offsets for brand, rx_offset in brand_rx_offsets: @@ -442,7 +212,7 @@ def get_fw_versions_ordered(logcan, sendcan, ecu_rx_addrs, timeout=0.1, debug=Fa def get_fw_versions(logcan, sendcan, query_brand=None, extra=None, timeout=0.1, debug=False, progress=False): - versions = get_interface_attr('FW_VERSIONS', ignore_none=True) + versions = VERSIONS.copy() if query_brand is not None: versions = {query_brand: versions[query_brand]} @@ -473,33 +243,33 @@ def get_fw_versions(logcan, sendcan, query_brand=None, extra=None, timeout=0.1, # Get versions and build capnp list to put into CarParams car_fw = [] - requests = [r for r in REQUESTS if query_brand is None or r.brand == query_brand] + requests = [(brand, r) for brand, r in REQUESTS if query_brand is None or brand == query_brand] for addr in tqdm(addrs, disable=not progress): for addr_chunk in chunks(addr): - for r in requests: + for brand, r in requests: try: - addrs = [(a, s) for (b, a, s) in addr_chunk if b in (r.brand, 'any') and + addrs = [(a, s) for (b, a, s) in addr_chunk if b in (brand, 'any') and (len(r.whitelist_ecus) == 0 or ecu_types[(b, a, s)] in r.whitelist_ecus)] if addrs: query = IsoTpParallelQuery(sendcan, logcan, r.bus, addrs, r.request, r.response, r.rx_offset, debug=debug) - for (addr, rx_addr), version in query.get_data(timeout).items(): + for (tx_addr, sub_addr), version in query.get_data(timeout).items(): f = car.CarParams.CarFw.new_message() - f.ecu = ecu_types.get((r.brand, addr[0], addr[1]), Ecu.unknown) + f.ecu = ecu_types.get((brand, tx_addr, sub_addr), Ecu.unknown) f.fwVersion = version - f.address = addr[0] - f.responseAddress = rx_addr + f.address = tx_addr + f.responseAddress = uds.get_rx_addr_for_tx_addr(tx_addr, r.rx_offset) f.request = r.request - f.brand = r.brand + f.brand = brand f.bus = r.bus - if addr[1] is not None: - f.subAddress = addr[1] + if sub_addr is not None: + f.subAddress = sub_addr car_fw.append(f) except Exception: - cloudlog.warning(f"FW query exception: {traceback.format_exc()}") + cloudlog.exception("FW query exception") return car_fw @@ -533,8 +303,8 @@ if __name__ == "__main__": t = time.time() print("Getting vin...") - addr, vin_rx_addr, vin = get_vin(logcan, sendcan, 1, retry=10, debug=args.debug) - print(f'TX: {hex(addr)}, RX: {hex(vin_rx_addr)}, VIN: {vin}') + vin_rx_addr, vin = get_vin(logcan, sendcan, 1, retry=10, debug=args.debug) + print(f'RX: {hex(vin_rx_addr)}, VIN: {vin}') print(f"Getting VIN took {time.time() - t:.3f} s") print() diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 9a04f7a92..09d4b0d06 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -68,13 +68,16 @@ class CarInterface(CarInterfaceBase): ret.radarOffCan = False ret.pcmCruise = False # stock non-adaptive cruise control is kept off + CarInterfaceBase.configure_dp_tune(candidate, ret.lateralTuning) + # 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} + ret.dashcamOnly = candidate in {CAR.CADILLAC_ATS, CAR.HOLDEN_ASTRA, CAR.MALIBU, CAR.BUICK_REGAL, CAR.EQUINOX, CAR.BOLT_EV} # Start with a baseline tuning for all GM vehicles. Override tuning as needed in each model section below. - ret.minSteerSpeed = 10 * CV.KPH_TO_MS + # Some GMs need some tolerance above 10 kph to avoid a fault + ret.minSteerSpeed = 10.1 * CV.KPH_TO_MS ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2], [0.00]] ret.lateralTuning.pid.kf = 0.00004 # full torque for 20 deg at 80mph means 0.00007818594 @@ -138,25 +141,25 @@ class CarInterface(CarInterfaceBase): ret.mass = 1601. + STD_CARGO_KG ret.wheelbase = 2.78 ret.steerRatio = 15.3 - ret.centerToFront = ret.wheelbase * 0.49 + ret.centerToFront = ret.wheelbase * 0.5 elif candidate == CAR.ESCALADE_ESV: ret.minEnableSpeed = -1. # engage speed is decided by pcm ret.mass = 2739. + STD_CARGO_KG ret.wheelbase = 3.302 ret.steerRatio = 17.3 - ret.centerToFront = ret.wheelbase * 0.49 + ret.centerToFront = ret.wheelbase * 0.5 ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[10., 41.0], [10., 41.0]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.13, 0.24], [0.01, 0.02]] ret.lateralTuning.pid.kf = 0.000045 tire_stiffness_factor = 1.0 - elif candidate == CAR.BOLT_EUV: + elif candidate in (CAR.BOLT_EV, CAR.BOLT_EUV): ret.minEnableSpeed = -1 ret.mass = 1669. + STD_CARGO_KG - ret.wheelbase = 2.675 + ret.wheelbase = 2.63779 ret.steerRatio = 16.8 - ret.centerToFront = ret.wheelbase * 0.4 + ret.centerToFront = 2.15 # measured tire_stiffness_factor = 1.0 ret.steerActuatorDelay = 0.2 CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) @@ -170,6 +173,14 @@ class CarInterface(CarInterfaceBase): tire_stiffness_factor = 1.0 CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) + elif candidate == CAR.EQUINOX: + ret.minEnableSpeed = -1 + ret.mass = 3500. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.72 + ret.steerRatio = 14.4 + ret.centerToFront = ret.wheelbase * 0.4 + CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) + # TODO: get actual value, for now starting with reasonable value for # civic and scaling by mass and wheelbase ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) diff --git a/selfdrive/car/gm/values.py b/selfdrive/car/gm/values.py index 21ede171e..999dabfee 100644 --- a/selfdrive/car/gm/values.py +++ b/selfdrive/car/gm/values.py @@ -23,11 +23,12 @@ class CarControllerParams: ADAS_KEEPALIVE_STEP = 100 CAMERA_KEEPALIVE_STEP = 100 - # Volt gasbrake lookups - # TODO: These values should be confirmed on non-Volt vehicles + # Volt gas/brake lookups + # TODO: These values should be confirmed on non-Volt vehicles. + # MAX_GAS should achieve 2 m/s^2 and MAX_BRAKE with regen should achieve -4.0 m/s^2 MAX_GAS = 3072 # Safety limit, not ACC max. Stock ACC >4096 from standstill. ZERO_GAS = 2048 # Coasting - MAX_BRAKE = 350 # ~ -3.5 m/s^2 with regen + MAX_BRAKE = 400 # ~ -4.0 m/s^2 with regen MAX_ACC_REGEN = 1404 # Max ACC regen is slightly less than max paddle regen # Allow small margin below -3.5 m/s^2 from ISO 15622:2018 since we @@ -38,15 +39,14 @@ class CarControllerParams: ACCEL_MAX = 2. # m/s^2 ACCEL_MIN = -4. # m/s^2 - EV_GAS_LOOKUP_BP = [-1., 0., ACCEL_MAX] - EV_BRAKE_LOOKUP_BP = [ACCEL_MIN, -1.] - # ICE has much less engine braking force compared to regen in EVs, # lower threshold removes some braking deadzone GAS_LOOKUP_BP = [-0.1, 0., ACCEL_MAX] - BRAKE_LOOKUP_BP = [ACCEL_MIN, -0.1] - + EV_GAS_LOOKUP_BP = [-1., 0., ACCEL_MAX] GAS_LOOKUP_V = [MAX_ACC_REGEN, ZERO_GAS, MAX_GAS] + + BRAKE_LOOKUP_BP = [ACCEL_MIN, -0.1] + EV_BRAKE_LOOKUP_BP = [ACCEL_MIN, -1.] BRAKE_LOOKUP_V = [MAX_BRAKE, 0.] @@ -58,8 +58,10 @@ class CAR: ACADIA = "GMC ACADIA DENALI 2018" BUICK_REGAL = "BUICK REGAL ESSENCE 2018" ESCALADE_ESV = "CADILLAC ESCALADE ESV 2016" + BOLT_EV = "CHEVROLET BOLT EV 2022" BOLT_EUV = "CHEVROLET BOLT EUV 2022" SILVERADO = "CHEVROLET SILVERADO 1500 2020" + EQUINOX = "CHEVROLET EQUINOX 2019" class Footnote(Enum): @@ -71,7 +73,7 @@ class Footnote(Enum): @dataclass class GMCarInfo(CarInfo): - package: str = "Adaptive Cruise Control" + package: str = "Adaptive Cruise Control (ACC)" harness: Enum = Harness.obd_ii footnotes: List[Enum] = field(default_factory=lambda: [Footnote.OBD_II]) @@ -84,11 +86,13 @@ CAR_INFO: Dict[str, Union[GMCarInfo, List[GMCarInfo]]] = { CAR.ACADIA: GMCarInfo("GMC Acadia 2018", video_link="https://www.youtube.com/watch?v=0ZN6DdsBUZo"), CAR.BUICK_REGAL: GMCarInfo("Buick Regal Essence 2018"), CAR.ESCALADE_ESV: GMCarInfo("Cadillac Escalade ESV 2016", "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", footnotes=[], harness=Harness.gm), + CAR.BOLT_EV: GMCarInfo("Chevrolet Bolt EV 2022-23", footnotes=[], harness=Harness.gm), + CAR.BOLT_EUV: GMCarInfo("Chevrolet Bolt EUV 2022-23", "Premier or Premier Redline Trim without Super Cruise Package", "https://youtu.be/xvwzGMUA210", footnotes=[], harness=Harness.gm), CAR.SILVERADO: [ GMCarInfo("Chevrolet Silverado 1500 2020-21", "Safety Package II", footnotes=[], harness=Harness.gm), GMCarInfo("GMC Sierra 1500 2020-21", "Driver Alert Package II", footnotes=[], harness=Harness.gm), ], + CAR.EQUINOX: GMCarInfo("Chevrolet Equinox 2019-22", footnotes=[], harness=Harness.gm), } @@ -166,13 +170,17 @@ FINGERPRINTS = { { 190: 6, 193: 8, 197: 8, 201: 8, 208: 8, 209: 7, 211: 2, 241: 6, 249: 8, 257: 8, 288: 5, 289: 8, 298: 8, 304: 3, 309: 8, 311: 8, 313: 8, 320: 4, 322: 7, 328: 1, 352: 5, 381: 8, 384: 4, 386: 8, 388: 8, 413: 8, 451: 8, 452: 8, 453: 6, 455: 7, 460: 5, 463: 3, 479: 3, 481: 7, 485: 8, 489: 8, 497: 8, 500: 6, 501: 8, 528: 5, 532: 6, 534: 2, 560: 8, 562: 8, 563: 5, 565: 5, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 707: 8, 715: 8, 717: 5, 761: 7, 789: 5, 800: 6, 801: 8, 810: 8, 840: 5, 842: 5, 844: 8, 848: 4, 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, 1930: 7 }], + 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, 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, 1930: 7 + }], } 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} +EV_CAR = {CAR.VOLT, CAR.BOLT_EV, 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} +CAMERA_ACC_CAR = {CAR.BOLT_EV, CAR.BOLT_EUV, CAR.SILVERADO, CAR.EQUINOX} STEER_THRESHOLD = 1.0 diff --git a/selfdrive/car/honda/carstate.py b/selfdrive/car/honda/carstate.py index e898c9c67..11b82e990 100644 --- a/selfdrive/car/honda/carstate.py +++ b/selfdrive/car/honda/carstate.py @@ -24,6 +24,7 @@ def get_can_signals(CP, gearbox_msg, main_on_sig_msg): ("MOTOR_TORQUE", "STEER_MOTOR_TORQUE"), ("STEER_TORQUE_SENSOR", "STEER_STATUS"), ("IMPERIAL_UNIT", "CAR_SPEED"), + ("ROUGH_CAR_SPEED_2", "CAR_SPEED"), ("LEFT_BLINKER", "SCM_FEEDBACK"), ("RIGHT_BLINKER", "SCM_FEEDBACK"), ("SEATBELT_DRIVER_LAMP", "SEATBELT_STATUS"), @@ -150,6 +151,10 @@ class CarState(CarStateBase): self.cruise_setting = 0 self.v_cruise_pcm_prev = 0 + # When available we use cp.vl["CAR_SPEED"]["ROUGH_CAR_SPEED_2"] to populate vEgoCluster + # However, on cars without a digital speedometer this is not always present (HRV, FIT, CRV 2016, ILX and RDX) + self.dash_speed_seen = False + def update(self, cp, cp_cam, cp_body): ret = car.CarState.new_message() @@ -203,6 +208,11 @@ class CarState(CarStateBase): ret.vEgoRaw = (1. - v_weight) * cp.vl["ENGINE_DATA"]["XMISSION_SPEED"] * CV.KPH_TO_MS * self.CP.wheelSpeedFactor + v_weight * v_wheel ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) + self.dash_speed_seen = self.dash_speed_seen or cp.vl["CAR_SPEED"]["ROUGH_CAR_SPEED_2"] > 1e-3 + if self.dash_speed_seen: + conversion = CV.KPH_TO_MS if self.is_metric else CV.MPH_TO_MS + ret.vEgoCluster = cp.vl["CAR_SPEED"]["ROUGH_CAR_SPEED_2"] * conversion + ret.steeringAngleDeg = cp.vl["STEERING_SENSORS"]["STEER_ANGLE"] ret.steeringRateDeg = cp.vl["STEERING_SENSORS"]["STEER_ANGLE_RATE"] @@ -237,9 +247,9 @@ class CarState(CarStateBase): ret.cruiseState.standstill = acc_hud["CRUISE_SPEED"] == 252. # on certain cars, CRUISE_SPEED changes to imperial with car's unit setting - conversion_factor = CV.MPH_TO_MS if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS and not self.is_metric else CV.KPH_TO_MS + conversion = CV.MPH_TO_MS if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS and not self.is_metric else CV.KPH_TO_MS # On set, cruise set speed pulses between 254~255 and the set speed prev is set to avoid this. - ret.cruiseState.speed = self.v_cruise_pcm_prev if acc_hud["CRUISE_SPEED"] > 160.0 else acc_hud["CRUISE_SPEED"] * conversion_factor + ret.cruiseState.speed = self.v_cruise_pcm_prev if acc_hud["CRUISE_SPEED"] > 160.0 else acc_hud["CRUISE_SPEED"] * conversion self.v_cruise_pcm_prev = ret.cruiseState.speed else: ret.cruiseState.speed = cp.vl["CRUISE"]["CRUISE_SPEED_PCM"] * CV.KPH_TO_MS diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index bfd43e525..99ed5d8fc 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -329,8 +329,8 @@ class CarInterface(CarInterfaceBase): ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0x0, 0xB5, 0x161, 0x2D6, 0x4C0, 0x70D, 0xC42, 0x1058, 0x2C00], [0x0, 0x160, 0x1F0, 0x2E0, 0x378, 0x4A0, 0x5F0, 0x804, 0xF00]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.21], [0.07]] #still needs to finish tuning for the new car ret.lateralTuning.pid.kf = 0.00004 - - CarInterfaceBase.configure_lqr_tune(ret.lateralTuning) + else: + CarInterfaceBase.configure_dp_tune(candidate, ret.lateralTuning) return ret @staticmethod diff --git a/selfdrive/car/honda/values.py b/selfdrive/car/honda/values.py index ff9756e86..d2f0eb138 100644 --- a/selfdrive/car/honda/values.py +++ b/selfdrive/car/honda/values.py @@ -6,6 +6,7 @@ from cereal import car from common.conversions import Conversions as CV from selfdrive.car import dbc_dict from selfdrive.car.docs_definitions import CarFootnote, CarInfo, Column, Harness +from selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries Ecu = car.CarParams.Ecu VisualAlert = car.CarControl.HUDControl.VisualAlert @@ -109,13 +110,13 @@ class HondaCarInfo(CarInfo): 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, harness=Harness.bosch_a), + HondaCarInfo("Honda Accord 2018-22", "All", "https://www.youtube.com/watch?v=mrUwlj3Mi58", min_steer_speed=3. * CV.MPH_TO_MS, harness=Harness.bosch_a), HondaCarInfo("Honda Inspire 2018", "All", min_steer_speed=3. * CV.MPH_TO_MS, harness=Harness.bosch_a), ], CAR.ACCORDH: HondaCarInfo("Honda Accord Hybrid 2018-22", "All", min_steer_speed=3. * CV.MPH_TO_MS, harness=Harness.bosch_a), CAR.CIVIC: HondaCarInfo("Honda Civic 2016-18", harness=Harness.nidec, 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, harness=Harness.bosch_a), + HondaCarInfo("Honda Civic 2019-21", "All", "https://www.youtube.com/watch?v=4Iz1Mz5LGF8", [Footnote.CIVIC_DIESEL], min_steer_speed=2. * CV.MPH_TO_MS, harness=Harness.bosch_a), HondaCarInfo("Honda Civic Hatchback 2017-21", harness=Harness.bosch_a), ], CAR.CIVIC_BOSCH_DIESEL: None, # same platform @@ -142,6 +143,14 @@ CAR_INFO: Dict[str, Optional[Union[HondaCarInfo, List[HondaCarInfo]]]] = { CAR.HONDA_E: HondaCarInfo("Honda e 2020", "All", min_steer_speed=3. * CV.MPH_TO_MS, harness=Harness.bosch_a), } +FW_QUERY_CONFIG = FwQueryConfig( + requests=[ + Request( + [StdQueries.UDS_VERSION_REQUEST], + [StdQueries.UDS_VERSION_RESPONSE], + ), + ], +) FW_VERSIONS = { CAR.ODYSSEY_CHN: {(Ecu.vsa, 0xfff, None): [b'\x00']}, diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index db80bcdf4..6f7cc319e 100644 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -97,7 +97,8 @@ class CarController: # cruise standstill resume elif CC.cruiseControl.resume: if not (self.CP.flags & HyundaiFlags.CANFD_ALT_BUTTONS): - can_sends.append(hyundaicanfd.create_buttons(self.packer, CS.buttons_counter+1, Buttons.RES_ACCEL)) + for _ in range(20): + can_sends.append(hyundaicanfd.create_buttons(self.packer, CS.buttons_counter+1, Buttons.RES_ACCEL)) self.last_button_frame = self.frame else: diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index d2562d5f8..cec088241 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -1,5 +1,6 @@ from collections import deque import copy +import math from cereal import car from common.conversions import Conversions as CV @@ -9,6 +10,7 @@ from selfdrive.car.hyundai.values import HyundaiFlags, DBC, FEATURES, CAMERA_SCC from selfdrive.car.interfaces import CarStateBase PREV_BUTTON_SAMPLES = 8 +CLUSTER_SAMPLE_RATE = 20 # frames class CarState(CarStateBase): @@ -29,9 +31,12 @@ class CarState(CarStateBase): self.shifter_values = can_define.dv["LVR12"]["CF_Lvr_Gear"] self.brake_error = False - self.park_brake = False self.buttons_counter = 0 + # On some cars, CLU15->CF_Clu_VehicleSpeed can oscillate faster than the dash updates. Sample at 5 Hz + self.cluster_speed = 0 + self.cluster_speed_counter = CLUSTER_SAMPLE_RATE + self.params = CarControllerParams(CP) def update(self, cp, cp_cam): @@ -39,8 +44,9 @@ class CarState(CarStateBase): return self.update_canfd(cp, cp_cam) ret = car.CarState.new_message() - cp_cruise = cp_cam if self.CP.carFingerprint in CAMERA_SCC_CAR else cp + is_metric = cp.vl["CLU11"]["CF_Clu_SPEED_UNIT"] == 0 + speed_conv = CV.KPH_TO_MS if is_metric else CV.MPH_TO_MS ret.doorOpen = any([cp.vl["CGW1"]["CF_Gway_DrvDrSw"], cp.vl["CGW1"]["CF_Gway_AstDrSw"], cp.vl["CGW2"]["CF_Gway_RLDrSw"], cp.vl["CGW2"]["CF_Gway_RRDrSw"]]) @@ -55,9 +61,19 @@ 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.vEgoRaw < 0.1 + self.cluster_speed_counter += 1 + if self.cluster_speed_counter > CLUSTER_SAMPLE_RATE: + self.cluster_speed = cp.vl["CLU15"]["CF_Clu_VehicleSpeed"] + self.cluster_speed_counter = 0 + + # mimic how dash converts to imperial + if not is_metric: + self.cluster_speed = math.floor(self.cluster_speed * CV.KPH_TO_MPH + CV.KPH_TO_MPH) + + ret.vEgoCluster = self.cluster_speed * speed_conv + ret.steeringAngleDeg = cp.vl["SAS11"]["SAS_Angle"] ret.steeringRateDeg = cp.vl["SAS11"]["SAS_Speed"] ret.yawRate = cp.vl["ESP12"]["YAW_RATE"] @@ -78,7 +94,6 @@ class CarState(CarStateBase): ret.cruiseState.available = cp_cruise.vl["SCC11"]["MainMode_ACC"] == 1 ret.cruiseState.enabled = cp_cruise.vl["SCC12"]["ACCMode"] != 0 ret.cruiseState.standstill = cp_cruise.vl["SCC11"]["SCCInfoDisplay"] == 4. - speed_conv = CV.MPH_TO_MS if cp.vl["CLU11"]["CF_Clu_SPEED_UNIT"] else CV.KPH_TO_MS ret.cruiseState.speed = cp_cruise.vl["SCC11"]["VSetDis"] * speed_conv # TODO: Find brake pressure @@ -228,6 +243,8 @@ class CarState(CarStateBase): ("CF_Clu_AmpInfo", "CLU11"), ("CF_Clu_AliveCnt1", "CLU11"), + ("CF_Clu_VehicleSpeed", "CLU15"), + ("ACCEnable", "TCS13"), ("ACC_REQ", "TCS13"), ("DriverBraking", "TCS13"), @@ -252,6 +269,7 @@ class CarState(CarStateBase): ("TCS13", 50), ("TCS15", 10), ("CLU11", 50), + ("CLU15", 5), ("ESP12", 100), ("CGW1", 10), ("CGW2", 5), @@ -310,7 +328,6 @@ class CarState(CarStateBase): if CP.carFingerprint in FEATURES["use_cluster_gears"]: signals.append(("CF_Clu_Gear", "CLU15")) - checks.append(("CLU15", 5)) elif CP.carFingerprint in FEATURES["use_tcu_gears"]: signals.append(("CUR_GR", "TCU12")) checks.append(("TCU12", 100)) diff --git a/selfdrive/car/hyundai/hyundaican.py b/selfdrive/car/hyundai/hyundaican.py index df5cb6ae6..139a14d5e 100644 --- a/selfdrive/car/hyundai/hyundaican.py +++ b/selfdrive/car/hyundai/hyundaican.py @@ -38,7 +38,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,): + elif car_fingerprint in (CAR.KIA_OPTIMA, CAR.KIA_OPTIMA_2019): # SysWarning 4 = keep hands on wheel + beep values["CF_Lkas_SysWarning"] = 4 if sys_warning else 0 @@ -132,18 +132,16 @@ def create_acc_commands(packer, enabled, accel, upper_jerk, idx, lead_visible, s } commands.append(packer.make_can_msg("SCC14", 0, scc14_values)) + # note that some vehicles most likely have an alternate checksum/counter definition + # https://github.com/commaai/opendbc/commit/9ddcdb22c4929baf310295e832668e6e7fcfa602 fca11_values = { - # seems to count 2,1,0,3,2,1,0,3,2,1,0,3,2,1,0,repeat... - # (where first value is aligned to Supplemental_Counter == 0) - # test: [(idx % 0xF, -((idx % 0xF) + 2) % 4) for idx in range(0x14)] - "CR_FCA_Alive": ((-((idx % 0xF) + 2) % 4) << 2) + 1, - "Supplemental_Counter": idx % 0xF, + "CR_FCA_Alive": idx % 0xF, "PAINT1_Status": 1, "FCA_DrvSetStatus": 1, "FCA_Status": 1, # AEB disabled } fca11_dat = packer.make_can_msg("FCA11", 0, fca11_values)[2] - fca11_values["CR_FCA_ChkSum"] = 0x10 - sum(sum(divmod(i, 16)) for i in fca11_dat) % 0x10 + fca11_values["CR_FCA_ChkSum"] = hyundai_checksum(fca11_dat[:7]) commands.append(packer.make_can_msg("FCA11", 0, fca11_values)) return commands diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index 5c725b3dd..e90914723 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -203,11 +203,13 @@ class CarInterface(CarInterfaceBase): ret.lateralTuning.indi.timeConstantV = [1.4] ret.lateralTuning.indi.actuatorEffectivenessBP = [0.] ret.lateralTuning.indi.actuatorEffectivenessV = [1.8] - elif candidate in (CAR.KIA_OPTIMA, CAR.KIA_OPTIMA_H): + elif candidate in (CAR.KIA_OPTIMA, CAR.KIA_OPTIMA_2019, CAR.KIA_OPTIMA_H): ret.mass = 3558. * CV.LB_TO_KG ret.wheelbase = 2.80 ret.steerRatio = 13.75 tire_stiffness_factor = 0.5 + if candidate == CAR.KIA_OPTIMA: + ret.minSteerSpeed = 32 * CV.MPH_TO_MS CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) elif candidate == CAR.KIA_STINGER: ret.lateralTuning.pid.kf = 0.00005 @@ -290,6 +292,8 @@ class CarInterface(CarInterfaceBase): ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.16], [0.01]] + CarInterfaceBase.configure_dp_tune(candidate, ret.lateralTuning) + # panda safety config if candidate in CANFD_CAR: ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.noOutput), @@ -339,7 +343,6 @@ class CarInterface(CarInterfaceBase): if int(Params().get("dp_atl").decode('utf-8')) == 1: ret.openpilotLongitudinalControl = False - CarInterfaceBase.configure_lqr_tune(ret.lateralTuning) return ret @staticmethod diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index e2374a1c0..52a508831 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -3,9 +3,12 @@ from dataclasses import dataclass from typing import Dict, List, Optional, Union from cereal import car +from panda.python import uds from common.conversions import Conversions as CV from selfdrive.car import dbc_dict from selfdrive.car.docs_definitions import CarInfo, Harness +from selfdrive.car.fw_query_definitions import FwQueryConfig, Request, p16 + Ecu = car.CarParams.Ecu @@ -26,6 +29,8 @@ class CarControllerParams: self.STEER_DRIVER_ALLOWANCE = 250 self.STEER_DRIVER_MULTIPLIER = 2 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. @@ -80,7 +85,8 @@ class CAR: KIA_NIRO_EV = "KIA NIRO EV 2020" KIA_NIRO_PHEV = "KIA NIRO HYBRID 2019" KIA_NIRO_HEV_2021 = "KIA NIRO HYBRID 2021" - KIA_OPTIMA = "KIA OPTIMA SX 2019 & 2016" + KIA_OPTIMA = "KIA OPTIMA 2016" + KIA_OPTIMA_2019 = "KIA OPTIMA 2019" KIA_OPTIMA_H = "KIA OPTIMA HYBRID 2017 & SPORTS 2019" KIA_SELTOS = "KIA SELTOS 2021" KIA_SORENTO = "KIA SORENTO GT LINE 2018" @@ -97,71 +103,67 @@ class CAR: @dataclass class HyundaiCarInfo(CarInfo): - # TODO: we can probably remove LKAS. LKAS is standard on many - # HKG and for others, it's likely packaged together with SCC - package: str = "Smart Cruise Control (SCC) & LKAS" + package: str = "Smart Cruise Control (SCC)" CAR_INFO: Dict[str, Optional[Union[HyundaiCarInfo, List[HyundaiCarInfo]]]] = { CAR.ELANTRA: HyundaiCarInfo("Hyundai Elantra 2017-19", min_enable_speed=19 * CV.MPH_TO_MS, harness=Harness.hyundai_b), CAR.ELANTRA_2021: HyundaiCarInfo("Hyundai Elantra 2021-22", video_link="https://youtu.be/_EdYQtV52-c", harness=Harness.hyundai_k), - CAR.ELANTRA_HEV_2021: HyundaiCarInfo("Hyundai Elantra Hybrid 2021-22", "Smart Cruise Control (SCC)", video_link="https://youtu.be/_EdYQtV52-c", harness=Harness.hyundai_k), + CAR.ELANTRA_HEV_2021: HyundaiCarInfo("Hyundai Elantra Hybrid 2021-22", video_link="https://youtu.be/_EdYQtV52-c", harness=Harness.hyundai_k), CAR.ELANTRA_GT_I30: None, # dashcamOnly and same platform as CAR.ELANTRA - CAR.HYUNDAI_GENESIS: HyundaiCarInfo("Hyundai Genesis 2015-16", min_enable_speed=19 * CV.MPH_TO_MS, harness=Harness.hyundai_j), + CAR.HYUNDAI_GENESIS: HyundaiCarInfo("Hyundai Genesis 2015-16", min_enable_speed=19 * CV.MPH_TO_MS, harness=Harness.hyundai_j), # TODO: check 2015 packages CAR.IONIQ: HyundaiCarInfo("Hyundai Ioniq Hybrid 2017-19", harness=Harness.hyundai_c), - CAR.IONIQ_HEV_2022: HyundaiCarInfo("Hyundai Ioniq Hybrid 2020-22", "Smart Cruise Control (SCC) & LFA", harness=Harness.hyundai_h), + CAR.IONIQ_HEV_2022: HyundaiCarInfo("Hyundai Ioniq Hybrid 2020-22", harness=Harness.hyundai_h), # TODO: confirm 2020-21 harness CAR.IONIQ_EV_LTD: HyundaiCarInfo("Hyundai Ioniq Electric 2019", harness=Harness.hyundai_c), - CAR.IONIQ_EV_2020: HyundaiCarInfo("Hyundai Ioniq Electric 2020", harness=Harness.hyundai_h), + CAR.IONIQ_EV_2020: HyundaiCarInfo("Hyundai Ioniq Electric 2020", "All", harness=Harness.hyundai_h), CAR.IONIQ_PHEV_2019: HyundaiCarInfo("Hyundai Ioniq Plug-in Hybrid 2019", harness=Harness.hyundai_c), - CAR.IONIQ_PHEV: HyundaiCarInfo("Hyundai Ioniq Plug-in Hybrid 2020-21", "Smart Cruise Control (SCC)", harness=Harness.hyundai_h), - CAR.KONA: HyundaiCarInfo("Hyundai Kona 2020", "Smart Cruise Control (SCC)", harness=Harness.hyundai_b), + CAR.IONIQ_PHEV: HyundaiCarInfo("Hyundai Ioniq Plug-in Hybrid 2020-21", "All", harness=Harness.hyundai_h), + CAR.KONA: HyundaiCarInfo("Hyundai Kona 2020", harness=Harness.hyundai_b), CAR.KONA_EV: HyundaiCarInfo("Hyundai Kona Electric 2018-21", harness=Harness.hyundai_g), - CAR.KONA_EV_2022: HyundaiCarInfo("Hyundai Kona Electric 2022", "Smart Cruise Control (SCC)", harness=Harness.hyundai_o), - CAR.KONA_HEV: HyundaiCarInfo("Hyundai Kona Hybrid 2020", video_link="https://youtu.be/0dwpAHiZgFo", harness=Harness.hyundai_i), + CAR.KONA_EV_2022: HyundaiCarInfo("Hyundai Kona Electric 2022", harness=Harness.hyundai_o), + CAR.KONA_HEV: HyundaiCarInfo("Hyundai Kona Hybrid 2020", video_link="https://youtu.be/0dwpAHiZgFo", harness=Harness.hyundai_i), # TODO: check packages CAR.SANTA_FE: HyundaiCarInfo("Hyundai Santa Fe 2019-20", "All", harness=Harness.hyundai_d), - CAR.SANTA_FE_2022: HyundaiCarInfo("Hyundai Santa Fe 2021-22", "All", video_link="https://youtu.be/VnHzSTygTS4", harness=Harness.hyundai_l), + CAR.SANTA_FE_2022: HyundaiCarInfo("Hyundai Santa Fe 2021-22", "All", "https://youtu.be/VnHzSTygTS4", harness=Harness.hyundai_l), CAR.SANTA_FE_HEV_2022: HyundaiCarInfo("Hyundai Santa Fe Hybrid 2022", "All", harness=Harness.hyundai_l), CAR.SANTA_FE_PHEV_2022: HyundaiCarInfo("Hyundai Santa Fe Plug-in Hybrid 2022", "All", harness=Harness.hyundai_l), - CAR.SONATA: HyundaiCarInfo("Hyundai Sonata 2020-22", "All", video_link="https://www.youtube.com/watch?v=ix63r9kE3Fw", harness=Harness.hyundai_a), + CAR.SONATA: HyundaiCarInfo("Hyundai Sonata 2020-22", "All", "https://www.youtube.com/watch?v=ix63r9kE3Fw", harness=Harness.hyundai_a), CAR.SONATA_LF: HyundaiCarInfo("Hyundai Sonata 2018-19", harness=Harness.hyundai_e), CAR.TUCSON: [ - HyundaiCarInfo("Hyundai Tucson 2021", "Smart Cruise Control (SCC)", min_enable_speed=19 * CV.MPH_TO_MS, harness=Harness.hyundai_l), - HyundaiCarInfo("Hyundai Tucson Diesel 2019", "Smart Cruise Control (SCC)", harness=Harness.hyundai_l), + HyundaiCarInfo("Hyundai Tucson 2021", min_enable_speed=19 * CV.MPH_TO_MS, harness=Harness.hyundai_l), + HyundaiCarInfo("Hyundai Tucson Diesel 2019", harness=Harness.hyundai_l), ], CAR.PALISADE: [ - HyundaiCarInfo("Hyundai Palisade 2020-22", "All", video_link="https://youtu.be/TAnDqjF4fDY?t=456", harness=Harness.hyundai_h), + HyundaiCarInfo("Hyundai Palisade 2020-22", "All", "https://youtu.be/TAnDqjF4fDY?t=456", harness=Harness.hyundai_h), HyundaiCarInfo("Kia Telluride 2020", "All", harness=Harness.hyundai_h), ], - CAR.VELOSTER: HyundaiCarInfo("Hyundai Veloster 2019-20", "Smart Cruise Control (SCC)", min_enable_speed=5. * CV.MPH_TO_MS, harness=Harness.hyundai_e), + CAR.VELOSTER: HyundaiCarInfo("Hyundai Veloster 2019-20", min_enable_speed=5. * CV.MPH_TO_MS, harness=Harness.hyundai_e), CAR.SONATA_HYBRID: HyundaiCarInfo("Hyundai Sonata Hybrid 2020-22", "All", harness=Harness.hyundai_a), CAR.IONIQ_5: HyundaiCarInfo("Hyundai Ioniq 5 2022", "Highway Driving Assist II", harness=Harness.hyundai_q), CAR.TUCSON_HYBRID_4TH_GEN: HyundaiCarInfo("Hyundai Tucson Hybrid 2022", "All", harness=Harness.hyundai_n), # Kia - CAR.KIA_FORTE: [ - HyundaiCarInfo("Kia Forte 2018", harness=Harness.hyundai_b), - HyundaiCarInfo("Kia Forte 2019-21", harness=Harness.hyundai_g), - ], - CAR.KIA_K5_2021: HyundaiCarInfo("Kia K5 2021-22", "Smart Cruise Control (SCC)", harness=Harness.hyundai_a), + CAR.KIA_FORTE: HyundaiCarInfo("Kia Forte 2019-21", harness=Harness.hyundai_g), + CAR.KIA_K5_2021: HyundaiCarInfo("Kia K5 2021-22", harness=Harness.hyundai_a), CAR.KIA_NIRO_EV: [ - HyundaiCarInfo("Kia Niro Electric 2019", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", harness=Harness.hyundai_h), - HyundaiCarInfo("Kia Niro Electric 2020", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", harness=Harness.hyundai_f), - HyundaiCarInfo("Kia Niro Electric 2021", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", harness=Harness.hyundai_c), - HyundaiCarInfo("Kia Niro Electric 2022", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", harness=Harness.hyundai_h), + HyundaiCarInfo("Kia Niro EV 2019", "All", "https://www.youtube.com/watch?v=lT7zcG6ZpGo", harness=Harness.hyundai_h), + HyundaiCarInfo("Kia Niro EV 2020", "All", "https://www.youtube.com/watch?v=lT7zcG6ZpGo", harness=Harness.hyundai_f), + HyundaiCarInfo("Kia Niro EV 2021", "All", "https://www.youtube.com/watch?v=lT7zcG6ZpGo", harness=Harness.hyundai_c), + HyundaiCarInfo("Kia Niro EV 2022", "All", "https://www.youtube.com/watch?v=lT7zcG6ZpGo", harness=Harness.hyundai_h), ], - CAR.KIA_NIRO_PHEV: HyundaiCarInfo("Kia Niro Plug-in Hybrid 2018-19", min_enable_speed=10. * CV.MPH_TO_MS, harness=Harness.hyundai_c), + CAR.KIA_NIRO_PHEV: HyundaiCarInfo("Kia Niro Plug-in Hybrid 2018-19", "All", min_enable_speed=10. * CV.MPH_TO_MS, harness=Harness.hyundai_c), CAR.KIA_NIRO_HEV_2021: [ HyundaiCarInfo("Kia Niro Hybrid 2021", harness=Harness.hyundai_f), # TODO: could be hyundai_d, verify HyundaiCarInfo("Kia Niro Hybrid 2022", harness=Harness.hyundai_h), ], - CAR.KIA_OPTIMA: [ - HyundaiCarInfo("Kia Optima 2017", min_steer_speed=32. * CV.MPH_TO_MS, harness=Harness.hyundai_b), - HyundaiCarInfo("Kia Optima 2019", harness=Harness.hyundai_g), + CAR.KIA_OPTIMA: HyundaiCarInfo("Kia Optima 2017", "Advanced Smart Cruise Control", harness=Harness.hyundai_b), # TODO: may support 2016, 2018 + CAR.KIA_OPTIMA_2019: HyundaiCarInfo("Kia Optima 2019-20", harness=Harness.hyundai_g), + CAR.KIA_OPTIMA_H: [ + HyundaiCarInfo("Kia Optima Hybrid 2017", "Advanced Smart Cruise Control"), # TODO: may support adjacent years + HyundaiCarInfo("Kia Optima Hybrid 2019"), ], - CAR.KIA_OPTIMA_H: HyundaiCarInfo("Kia Optima Hybrid 2017, 2019"), # TODO: info may be incorrect - CAR.KIA_SELTOS: HyundaiCarInfo("Kia Seltos 2021", "Smart Cruise Control (SCC)", harness=Harness.hyundai_a), + CAR.KIA_SELTOS: HyundaiCarInfo("Kia Seltos 2021", harness=Harness.hyundai_a), CAR.KIA_SORENTO: [ - HyundaiCarInfo("Kia Sorento 2018", video_link="https://www.youtube.com/watch?v=Fkh3s6WHJz8", harness=Harness.hyundai_c), + HyundaiCarInfo("Kia Sorento 2018", "Advanced Smart Cruise Control", "https://www.youtube.com/watch?v=Fkh3s6WHJz8", harness=Harness.hyundai_c), HyundaiCarInfo("Kia Sorento 2019", video_link="https://www.youtube.com/watch?v=Fkh3s6WHJz8", harness=Harness.hyundai_e), ], CAR.KIA_STINGER: HyundaiCarInfo("Kia Stinger 2018-20", video_link="https://www.youtube.com/watch?v=MJ94qoofYw0", harness=Harness.hyundai_c), @@ -225,9 +227,6 @@ FINGERPRINTS = { CAR.SONATA_LF: [ {66: 8, 67: 8, 68: 8, 127: 8, 273: 8, 274: 8, 275: 8, 339: 8, 356: 4, 399: 8, 447: 8, 512: 6, 544: 8, 593: 8, 608: 8, 688: 5, 790: 8, 809: 8, 832: 8, 884: 8, 897: 8, 899: 8, 902: 8, 903: 6, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1151: 6, 1168: 7, 1170: 8, 1253: 8, 1254: 8, 1255: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1314: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1342: 6, 1345: 8, 1348: 8, 1349: 8, 1351: 8, 1353: 8, 1363: 8, 1365: 8, 1366: 8, 1367: 8, 1369: 8, 1397: 8, 1407: 8, 1415: 8, 1419: 8, 1425: 2, 1427: 6, 1440: 8, 1456: 4, 1470: 8, 1472: 8, 1486: 8, 1487: 8, 1491: 8, 1530: 8, 1532: 5, 2000: 8, 2001: 8, 2004: 8, 2005: 8, 2008: 8, 2009: 8, 2012: 8, 2013: 8, 2014: 8, 2016: 8, 2017: 8, 2024: 8, 2025: 8}, ], - CAR.KIA_OPTIMA: [{ - 64: 8, 66: 8, 67: 8, 68: 8, 127: 8, 128: 8, 129: 8, 273: 8, 274: 8, 275: 8, 339: 8, 354: 3, 356: 4, 399: 8, 447: 8, 512: 6, 544: 8, 558: 8, 593: 8, 608: 8, 640: 8, 688: 5, 790: 8, 809: 8, 832: 8, 884: 8, 897: 8, 899: 8, 902: 8, 903: 6, 909: 8, 912: 7, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1151: 6, 1168: 7, 1170: 8, 1186: 2, 1191: 2, 1253: 8, 1254: 8, 1255: 8, 1265: 4, 1268: 8, 1280: 1, 1282: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1342: 6, 1345: 8, 1348: 8, 1349: 8, 1351: 8, 1353: 8, 1356: 8, 1363: 8, 1365: 8, 1366: 8, 1367: 8, 1369: 8, 1407: 8, 1414: 3, 1415: 8, 1419: 8, 1425: 2, 1427: 6, 1440: 8, 1456: 4, 1470: 8, 1472: 8, 1486: 8, 1487: 8, 1491: 8, 1492: 8, 1530: 8, 1532: 5, 1792: 8, 1872: 8, 1937: 8, 1953: 8, 1968: 8, 1988: 8, 1996: 8, 2000: 8, 2001: 8, 2004: 8, 2008: 8, 2009: 8, 2012: 8, 2015: 8, 2016: 8, 2017: 8, 2024: 8, 2025: 8, 1371: 8, 1397: 8, 1961: 8 - }], CAR.KIA_SORENTO: [{ 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1384: 8, 1407: 8, 1411: 8, 1419: 8, 1425: 2, 1427: 6, 1444: 8, 1456: 4, 1470: 8, 1489: 1 }], @@ -272,6 +271,26 @@ FINGERPRINTS = { }], } +HYUNDAI_VERSION_REQUEST_LONG = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(0xf100) # Long description +HYUNDAI_VERSION_REQUEST_MULTI = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_SPARE_PART_NUMBER) + \ + p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_SOFTWARE_IDENTIFICATION) + \ + p16(0xf100) +HYUNDAI_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + +FW_QUERY_CONFIG = FwQueryConfig( + requests=[ + Request( + [HYUNDAI_VERSION_REQUEST_LONG], + [HYUNDAI_VERSION_RESPONSE], + ), + Request( + [HYUNDAI_VERSION_REQUEST_MULTI], + [HYUNDAI_VERSION_RESPONSE], + ), + ], +) FW_VERSIONS = { CAR.IONIQ: { @@ -1118,26 +1137,41 @@ FW_VERSIONS = { ], }, CAR.KIA_OPTIMA: { + (Ecu.fwdRadar, 0x7d0, None): [ + b'\xf1\x00JF__ SCC F-CUP 1.00 1.00 96400-D4100 ', + ], + (Ecu.abs, 0x7d1, None): [ + b'\xf1\x00JF ESC \x0f 16 \x16\x06\x17 58920-D5080', + ], + (Ecu.fwdCamera, 0x7c4, None): [ + b'\xf1\x00JFWGN LDWS AT USA LHD 1.00 1.02 95895-D4100 G21', + ], + (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x87\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf1\x816T6J0051\x00\x00\xf1\x006T6J0_C2\x00\x006T6J0051\x00\x00TJF0T20NSB\x00\x00\x00\x00', + ], + }, + CAR.KIA_OPTIMA_2019: { (Ecu.fwdRadar, 0x7d0, None): [ b'\xf1\x00JF__ SCC F-CUP 1.00 1.00 96400-D4110 ', ], (Ecu.abs, 0x7d1, None): [ b'\xf1\x00JF ESC \x0b 11 \x18\x030 58920-D5180', - ], - (Ecu.engine, 0x7e0, None): [ - b'\xf1\x89F1JF600AISEIU702\xf1\x82F1JF600AISEIU702', - ], - (Ecu.eps, 0x7d4, None): [ - b'\xf1\x00TM MDPS C 1.00 1.00 56340-S2000 8409', + b"\xf1\x00JF ESC \t 11 \x18\x03' 58920-D5260", ], (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00JFA LKAS AT USA LHD 1.00 1.00 95895-D5001 h32', - b'\xf1\x00JFA LKAS AT USA LHD 1.00 1.02 95895-D5000 h31', + b'\xf1\x00JFA LKAS AT USA LHD 1.00 1.00 95895-D5100 h32', ], (Ecu.transmission, 0x7e1, None): [ + b'\xf1\x006U2V0_C2\x00\x006U2V8051\x00\x00DJF0T16NL0\t\xd2GW', + b'\xf1\x006U2V0_C2\x00\x006U2VA051\x00\x00DJF0T16NL1\xca3\xeb.', + b'\xf1\x006U2V0_C2\x00\x006U2VC051\x00\x00DJF0T16NL2\x9eA\x80\x01', + b'\xf1\x006U2V0_C2\x00\x006U2VA051\x00\x00DJF0T16NL1\x00\x00\x00\x00', b'\xf1\x816U2V8051\x00\x00\xf1\x006U2V0_C2\x00\x006U2V8051\x00\x00DJF0T16NL0\t\xd2GW', b'\xf1\x816U2VA051\x00\x00\xf1\x006U2V0_C2\x00\x006U2VA051\x00\x00DJF0T16NL1\xca3\xeb.', + b'\xf1\x816U2VC051\x00\x00\xf1\x006U2V0_C2\x00\x006U2VC051\x00\x00DJF0T16NL2\x9eA\x80\x01', b'\xf1\x816U2VA051\x00\x00\xf1\x006U2V0_C2\x00\x006U2VA051\x00\x00DJF0T16NL1\x00\x00\x00\x00', + b'\xf1\x87\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf1\x816T6B8051\x00\x00\xf1\x006T6H0_C2\x00\x006T6B8051\x00\x00TJFSG24NH27\xa7\xc2\xb4', ], }, CAR.ELANTRA_2021: { @@ -1175,7 +1209,7 @@ FW_VERSIONS = { ], (Ecu.engine, 0x7e0, None): [ b'\xf1\x82CNCWD0AMFCXCSFFA', - b'\xf1\x82CNCWD0AMFCXCSFFB', + b'\xf1\x81HM6M2_0a0_FF0', b'\xf1\x82CNCVD0AMFCXCSFFB', b'\xf1\x870\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf1\x81HM6M2_0a0_G80', ], @@ -1273,6 +1307,7 @@ FW_VERSIONS = { }, CAR.KIA_EV6: { (Ecu.abs, 0x7d1, None): [ + b'\xf1\x00CV IEB \x03 101!\x10\x18 58520-CV100', b'\xf1\x8758520CV100\xf1\x00CV IEB \x02 101!\x10\x18 58520-CV100', ], (Ecu.eps, 0x7d4, None): [ @@ -1284,6 +1319,7 @@ FW_VERSIONS = { ], (Ecu.fwdCamera, 0x7c4, None): [ b'\xf1\x00CV1 MFC AT USA LHD 1.00 1.05 99210-CV000 211027', + b'\xf1\x00CV1 MFC AT EUR LHD 1.00 1.05 99210-CV000 211027', ], }, CAR.IONIQ_5: { @@ -1331,7 +1367,7 @@ CHECKSUM = { FEATURES = { # which message has the gear "use_cluster_gears": {CAR.ELANTRA, CAR.ELANTRA_GT_I30, CAR.KONA}, - "use_tcu_gears": {CAR.KIA_OPTIMA, CAR.SONATA_LF, CAR.VELOSTER, CAR.TUCSON}, + "use_tcu_gears": {CAR.KIA_OPTIMA, CAR.KIA_OPTIMA_2019, CAR.SONATA_LF, CAR.VELOSTER, CAR.TUCSON}, "use_elect_gears": {CAR.KIA_NIRO_EV, CAR.KIA_NIRO_PHEV, CAR.KIA_NIRO_HEV_2021, CAR.KIA_OPTIMA_H, CAR.IONIQ_EV_LTD, CAR.KONA_EV, CAR.IONIQ, CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV, CAR.ELANTRA_HEV_2021, CAR.SONATA_HYBRID, CAR.KONA_HEV, CAR.IONIQ_HEV_2022, CAR.SANTA_FE_HEV_2022, CAR.SANTA_FE_PHEV_2022, CAR.IONIQ_PHEV_2019, CAR.KONA_EV_2022}, # these cars use the FCA11 message for the AEB and FCW signals, all others use SCC12 @@ -1347,7 +1383,7 @@ HYBRID_CAR = {CAR.IONIQ_PHEV, CAR.ELANTRA_HEV_2021, CAR.KIA_NIRO_PHEV, CAR.KIA_N EV_CAR = {CAR.IONIQ_EV_2020, CAR.IONIQ_EV_LTD, CAR.KONA_EV, CAR.KIA_NIRO_EV, CAR.KONA_EV_2022} # 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_2020, CAR.IONIQ_EV_LTD, CAR.IONIQ_PHEV, CAR.IONIQ, CAR.KONA_EV, CAR.KIA_SORENTO, CAR.SONATA_LF, CAR.KIA_OPTIMA, CAR.VELOSTER, CAR.KIA_STINGER, CAR.GENESIS_G70, CAR.GENESIS_G80, CAR.KIA_CEED, CAR.ELANTRA, CAR.IONIQ_HEV_2022} +LEGACY_SAFETY_MODE_CAR = {CAR.HYUNDAI_GENESIS, CAR.IONIQ_EV_2020, CAR.IONIQ_EV_LTD, CAR.IONIQ_PHEV, CAR.IONIQ, CAR.KONA_EV, CAR.KIA_SORENTO, CAR.SONATA_LF, CAR.KIA_OPTIMA, CAR.KIA_OPTIMA_2019, CAR.VELOSTER, CAR.KIA_STINGER, CAR.GENESIS_G70, CAR.GENESIS_G80, CAR.KIA_CEED, CAR.ELANTRA, CAR.IONIQ_HEV_2022} # 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 @@ -1357,22 +1393,23 @@ DBC = { CAR.ELANTRA_HEV_2021: dbc_dict('hyundai_kia_generic', None), CAR.ELANTRA_GT_I30: 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'), + 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'), + 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_NIRO_EV: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar'), - CAR.KIA_NIRO_PHEV: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar'), + 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: dbc_dict('hyundai_kia_generic', None), + CAR.KIA_OPTIMA_2019: dbc_dict('hyundai_kia_generic', None), CAR.KIA_OPTIMA_H: 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 @@ -1381,18 +1418,18 @@ DBC = { 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'), + 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'), + 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'), + 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'), + CAR.SONATA_HYBRID: dbc_dict('hyundai_kia_generic', 'hyundai_kia_mando_front_radar_generated'), CAR.TUCSON_HYBRID_4TH_GEN: dbc_dict('hyundai_canfd', None), CAR.IONIQ_5: dbc_dict('hyundai_canfd', None), } diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index c9919a0cb..2da7e819c 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -2,25 +2,28 @@ import yaml import os import time from abc import abstractmethod, ABC -from typing import Any, Dict, Optional, Tuple, List +from typing import Any, Dict, Optional, Tuple, List, Callable from cereal import car from common.basedir import BASEDIR from common.conversions import Conversions as CV from common.kalman.simple_kalman import KF1D +from common.numpy_fast import interp from common.realtime import DT_CTRL -from selfdrive.car import create_button_enable_events, gen_empty_fingerprint -from selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX +from selfdrive.car import apply_hysteresis, create_button_enable_events, gen_empty_fingerprint +from selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX, apply_deadzone from selfdrive.controls.lib.events import Events from selfdrive.controls.lib.vehicle_model import VehicleModel from common.params import Params GearShifter = car.CarState.GearShifter EventName = car.CarEvent.EventName +TorqueFromLateralAccelCallbackType = Callable[[float, car.CarParams.LateralTorqueTuning, float, float, bool], float] MAX_CTRL_SPEED = (V_CRUISE_MAX + 4) * CV.KPH_TO_MS ACCEL_MAX = 2.0 ACCEL_MIN = -3.5 +FRICTION_THRESHOLD = 0.2 TORQUE_PARAMS_PATH = os.path.join(BASEDIR, 'selfdrive/car/torque_data/params.yaml') TORQUE_OVERRIDE_PATH = os.path.join(BASEDIR, 'selfdrive/car/torque_data/override.yaml') @@ -106,6 +109,20 @@ class CarInterfaceBase(ABC): def get_steer_feedforward_function(self): return self.get_steer_feedforward_default + @staticmethod + def torque_from_lateral_accel_linear(lateral_accel_value, torque_params, lateral_accel_error, lateral_accel_deadzone, friction_compensation): + # The default is a linear relationship between torque and lateral acceleration (accounting for road roll and steering friction) + friction_interp = interp( + apply_deadzone(lateral_accel_error, lateral_accel_deadzone), + [-FRICTION_THRESHOLD, FRICTION_THRESHOLD], + [-torque_params.friction, torque_params.friction] + ) + friction = friction_interp if friction_compensation else 0.0 + return (lateral_accel_value / torque_params.latAccelFactor) + friction + + def torque_from_lateral_accel(self) -> TorqueFromLateralAccelCallbackType: + return self.torque_from_lateral_accel_linear + # returns a set of default params to avoid repetition in car specific params @staticmethod def get_std_params(candidate, fingerprint): @@ -145,17 +162,16 @@ class CarInterfaceBase(ABC): @staticmethod def configure_lqr_tune(tune): - if Params().get_bool("dp_lateral_lqr"): - tune.init('lqr') - tune.lqr.scale = 1500.0 - tune.lqr.ki = 0.05 + tune.init('lqr') + tune.lqr.scale = 1500.0 + tune.lqr.ki = 0.05 - tune.lqr.a = [0., 1., -0.22619643, 1.21822268] - tune.lqr.b = [-1.92006585e-04, 3.95603032e-05] - tune.lqr.c = [1., 0.] - tune.lqr.k = [-110.73572306, 451.22718255] - tune.lqr.l = [0.3233671, 0.3185757] - tune.lqr.dcGain = 0.002237852961363602 + tune.lqr.a = [0., 1., -0.22619643, 1.21822268] + tune.lqr.b = [-1.92006585e-04, 3.95603032e-05] + tune.lqr.c = [1., 0.] + tune.lqr.k = [-110.73572306, 451.22718255] + tune.lqr.l = [0.3233671, 0.3185757] + tune.lqr.dcGain = 0.002237852961363602 @staticmethod def configure_torque_tune(candidate, tune, steering_angle_deadzone_deg=0.0, use_steering_angle=True): @@ -163,12 +179,22 @@ class CarInterfaceBase(ABC): tune.init('torque') tune.torque.useSteeringAngle = use_steering_angle - tune.torque.kp = 1.0 / params['LAT_ACCEL_FACTOR'] - tune.torque.kf = 1.0 / params['LAT_ACCEL_FACTOR'] - tune.torque.ki = 0.1 / params['LAT_ACCEL_FACTOR'] + tune.torque.kp = 1.0 + tune.torque.kf = 1.0 + tune.torque.ki = 0.1 tune.torque.friction = params['FRICTION'] + tune.torque.latAccelFactor = params['LAT_ACCEL_FACTOR'] + tune.torque.latAccelOffset = 0.0 tune.torque.steeringAngleDeadzoneDeg = steering_angle_deadzone_deg + @staticmethod + def configure_dp_tune(candidate, tune, steering_angle_deadzone_deg=0.0, use_steering_angle=True): + params = Params() + if params.get_bool('dp_lateral_lqr'): + CarInterfaceBase.configure_lqr_tune(tune) + elif params.get_bool('dp_lateral_torque'): + CarInterfaceBase.configure_torque_tune(candidate, tune, steering_angle_deadzone_deg, use_steering_angle) + @abstractmethod def _update(self, c: car.CarControl) -> car.CarState: pass @@ -191,6 +217,12 @@ class CarInterfaceBase(ABC): else: self.v_ego_cluster_seen = True + # Many cars apply hysteresis to the ego dash speed + if self.CS is not None: + ret.vEgoCluster = apply_hysteresis(ret.vEgoCluster, self.CS.out.vEgoCluster, self.CS.cluster_speed_hyst_gap) + if abs(ret.vEgo) < self.CS.cluster_min_speed: + ret.vEgoCluster = 0.0 + if ret.cruiseState.speedCluster == 0: ret.cruiseState.speedCluster = ret.cruiseState.speed @@ -235,6 +267,8 @@ class CarInterfaceBase(ABC): events.add(EventName.parkBrake) if self.dragonconf.dpAtl != 1 and cs_out.accFaulted: events.add(EventName.accFaulted) + if cs_out.steeringPressed: + events.add(EventName.steerOverride) # Handle button presses events.events.extend(create_button_enable_events(cs_out.buttonEvents, pcm_cruise=self.CP.pcmCruise)) @@ -312,6 +346,8 @@ class CarStateBase(ABC): self.right_blinker_cnt = 0 self.left_blinker_prev = False self.right_blinker_prev = False + self.cluster_speed_hyst_gap = 0.0 + self.cluster_min_speed = 0.0 # min speed before dropping to 0 # Q = np.matrix([[0.0, 0.0], [0.0, 100.0]]) # R = 0.3 diff --git a/selfdrive/car/isotp_parallel_query.py b/selfdrive/car/isotp_parallel_query.py index 65122ab89..94c8d052b 100644 --- a/selfdrive/car/isotp_parallel_query.py +++ b/selfdrive/car/isotp_parallel_query.py @@ -1,7 +1,6 @@ import time from collections import defaultdict from functools import partial -from typing import Optional import cereal.messaging as messaging from system.swaglog import cloudlog @@ -10,24 +9,21 @@ from panda.python.uds import CanClient, IsoTpMessage, FUNCTIONAL_ADDRS, get_rx_a class IsoTpParallelQuery: - def __init__(self, sendcan, logcan, bus, addrs, request, response, response_offset=0x8, functional_addr=False, debug=False, response_pending_timeout=10): + def __init__(self, sendcan, logcan, bus, addrs, request, response, response_offset=0x8, functional_addrs=None, debug=False, response_pending_timeout=10): self.sendcan = sendcan self.logcan = logcan self.bus = bus self.request = request self.response = response + self.functional_addrs = functional_addrs or [] self.debug = debug - self.functional_addr = functional_addr self.response_pending_timeout = response_pending_timeout - self.real_addrs = [] - for a in addrs: - if isinstance(a, tuple): - self.real_addrs.append(a) - else: - self.real_addrs.append((a, None)) + real_addrs = [a if isinstance(a, tuple) else (a, None) for a in addrs] + for tx_addr, _ in real_addrs: + assert tx_addr not in FUNCTIONAL_ADDRS, f"Functional address should be defined in functional_addrs: {hex(tx_addr)}" - self.msg_addrs = {tx_addr: get_rx_addr_for_tx_addr(tx_addr[0], rx_offset=response_offset) for tx_addr in self.real_addrs} + self.msg_addrs = {tx_addr: get_rx_addr_for_tx_addr(tx_addr[0], rx_offset=response_offset) for tx_addr in real_addrs} self.msg_buffer = defaultdict(list) def rx(self): @@ -36,13 +32,8 @@ class IsoTpParallelQuery: for packet in can_packets: for msg in packet.can: - if msg.src == self.bus: - if self.functional_addr: - if (0x7E8 <= msg.address <= 0x7EF) or (0x18DAF100 <= msg.address <= 0x18DAF1FF): - fn_addr = next(a for a in FUNCTIONAL_ADDRS if msg.address - a <= 32) - self.msg_buffer[fn_addr].append((msg.address, msg.busTime, msg.dat, msg.src)) - elif msg.address in self.msg_addrs.values(): - self.msg_buffer[msg.address].append((msg.address, msg.busTime, msg.dat, msg.src)) + if msg.src == self.bus and msg.address in self.msg_addrs.values(): + self.msg_buffer[msg.address].append((msg.address, msg.busTime, msg.dat, msg.src)) def _can_tx(self, tx_addr, dat, bus): """Helper function to send single message""" @@ -72,6 +63,13 @@ class IsoTpParallelQuery: messaging.drain_sock(self.logcan) self.msg_buffer = defaultdict(list) + def _create_isotp_msg(self, tx_addr, sub_addr, rx_addr): + can_client = CanClient(self._can_tx, partial(self._can_rx, rx_addr, sub_addr=sub_addr), tx_addr, rx_addr, + self.bus, sub_addr=sub_addr, debug=self.debug) + + max_len = 8 if sub_addr is None else 7 + return IsoTpMessage(can_client, timeout=0, max_len=max_len, debug=self.debug) + def get_data(self, timeout, total_timeout=60.): self._drain_rx() @@ -80,22 +78,19 @@ class IsoTpParallelQuery: request_counter = {} request_done = {} for tx_addr, rx_addr in self.msg_addrs.items(): - # rx_addr not set when using functional tx addr - id_addr = rx_addr or tx_addr[0] - sub_addr = tx_addr[1] - - can_client = CanClient(self._can_tx, partial(self._can_rx, id_addr, sub_addr=sub_addr), tx_addr[0], rx_addr, - self.bus, sub_addr=sub_addr, debug=self.debug) - - max_len = 8 if sub_addr is None else 7 - - msg = IsoTpMessage(can_client, timeout=0, max_len=max_len, debug=self.debug) - msg.send(self.request[0]) - - msgs[tx_addr] = msg + msgs[tx_addr] = self._create_isotp_msg(*tx_addr, rx_addr) request_counter[tx_addr] = 0 request_done[tx_addr] = False + # Send first request to functional addrs, subsequent responses are handled on physical addrs + if len(self.functional_addrs): + for addr in self.functional_addrs: + self._create_isotp_msg(addr, None, -1).send(self.request[0]) + + # If querying functional addrs, set up physical IsoTpMessages to send consecutive frames + for msg in msgs.values(): + msg.send(self.request[0], setup_only=len(self.functional_addrs) > 0) + results = {} start_time = time.monotonic() response_timeouts = {tx_addr: start_time + timeout for tx_addr in self.msg_addrs} @@ -107,12 +102,15 @@ class IsoTpParallelQuery: for tx_addr, msg in msgs.items(): try: - dat: Optional[bytes] = msg.recv() + dat, updated = msg.recv() except Exception: - cloudlog.exception("Error processing UDS response") + cloudlog.exception(f"Error processing UDS response: {tx_addr}") request_done[tx_addr] = True continue + if updated: + response_timeouts[tx_addr] = time.monotonic() + timeout + if not dat: continue @@ -121,12 +119,11 @@ class IsoTpParallelQuery: response_valid = dat[:len(expected_response)] == expected_response if response_valid: - response_timeouts[tx_addr] = time.monotonic() + timeout if counter + 1 < len(self.request): msg.send(self.request[counter + 1]) request_counter[tx_addr] += 1 else: - results[(tx_addr, msg._can_client.rx_addr)] = dat[len(expected_response):] + results[tx_addr] = dat[len(expected_response):] request_done[tx_addr] = True else: error_code = dat[2] if len(dat) > 2 else -1 diff --git a/selfdrive/car/mazda/interface.py b/selfdrive/car/mazda/interface.py index 669d224e7..f5d420826 100755 --- a/selfdrive/car/mazda/interface.py +++ b/selfdrive/car/mazda/interface.py @@ -10,10 +10,6 @@ EventName = car.CarEvent.EventName class CarInterface(CarInterfaceBase): - @staticmethod - def compute_gb(accel, speed): - return float(accel) / 4.0 - @staticmethod def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, experimental_long=False): ret = CarInterfaceBase.get_std_params(candidate, fingerprint) @@ -50,6 +46,8 @@ class CarInterface(CarInterfaceBase): if candidate not in (CAR.CX5_2022, ): ret.minSteerSpeed = LKAS_LIMITS.DISABLE_SPEED * CV.KPH_TO_MS + CarInterfaceBase.configure_dp_tune(candidate, ret.lateralTuning) + ret.centerToFront = ret.wheelbase * 0.41 # TODO: get actual value, for now starting with reasonable value for @@ -61,7 +59,6 @@ class CarInterface(CarInterfaceBase): ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, tire_stiffness_factor=tire_stiffness_factor) - CarInterfaceBase.configure_lqr_tune(ret.lateralTuning) return ret # returns a car.CarState diff --git a/selfdrive/car/mazda/values.py b/selfdrive/car/mazda/values.py index 95f140422..9befad4d0 100644 --- a/selfdrive/car/mazda/values.py +++ b/selfdrive/car/mazda/values.py @@ -2,9 +2,11 @@ from dataclasses import dataclass from enum import Enum from typing import Dict, List, Union +from cereal import car from selfdrive.car import dbc_dict from selfdrive.car.docs_definitions import CarInfo, Harness -from cereal import car +from selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries + Ecu = car.CarParams.Ecu @@ -50,6 +52,7 @@ class LKAS_LIMITS: DISABLE_SPEED = 45 # kph ENABLE_SPEED = 52 # kph + class Buttons: NONE = 0 SET_PLUS = 1 @@ -58,8 +61,17 @@ class Buttons: CANCEL = 4 +FW_QUERY_CONFIG = FwQueryConfig( + requests=[ + Request( + [StdQueries.MANUFACTURER_SOFTWARE_VERSION_REQUEST], + [StdQueries.MANUFACTURER_SOFTWARE_VERSION_RESPONSE], + ), + ], +) + FW_VERSIONS = { - CAR.CX5_2022 : { + CAR.CX5_2022: { (Ecu.eps, 0x730, None): [ b'KSD5-3210X-C-00\x00\x00\x00\x00\x00\x00\x00\x00\x00', ], diff --git a/selfdrive/car/mock/interface.py b/selfdrive/car/mock/interface.py index 2c7f4611e..36062da1d 100755 --- a/selfdrive/car/mock/interface.py +++ b/selfdrive/car/mock/interface.py @@ -20,7 +20,7 @@ class CarInterface(CarInterfaceBase): cloudlog.debug("Using Mock Car Interface") - self.sensor = messaging.sub_sock('sensorEvents') + self.gyro = messaging.sub_sock('gyroscope') self.gps = messaging.sub_sock('gpsLocationExternal') self.speed = 0. @@ -28,10 +28,6 @@ class CarInterface(CarInterfaceBase): self.yaw_rate = 0. self.yaw_rate_meas = 0. - @staticmethod - def compute_gb(accel, speed): - return accel - @staticmethod def get_params(candidate, fingerprint=gen_empty_fingerprint(), car_fw=None, experimental_long=False): ret = CarInterfaceBase.get_std_params(candidate, fingerprint) @@ -50,11 +46,9 @@ class CarInterface(CarInterfaceBase): # returns a car.CarState def _update(self, c): # get basic data from phone and gps since CAN isn't connected - sensors = messaging.recv_sock(self.sensor) - if sensors is not None: - for sensor in sensors.sensorEvents: - if sensor.type == 4: # gyro - self.yaw_rate_meas = -sensor.gyro.v[0] + gyro_sensor = messaging.recv_sock(self.gyro) + if gyro_sensor is not None: + self.yaw_rate_meas = -gyro_sensor.gyroscope.gyroUncalibrated.v[0] gps = messaging.recv_sock(self.gps) if gps is not None: diff --git a/selfdrive/car/nissan/interface.py b/selfdrive/car/nissan/interface.py index a9c549c02..e289b8a70 100644 --- a/selfdrive/car/nissan/interface.py +++ b/selfdrive/car/nissan/interface.py @@ -35,6 +35,8 @@ class CarInterface(CarInterfaceBase): ret.wheelbase = 2.824 ret.centerToFront = ret.wheelbase * 0.44 + CarInterfaceBase.configure_dp_tune(candidate, ret.lateralTuning) + ret.steerControlType = car.CarParams.SteerControlType.angle ret.radarOffCan = True diff --git a/selfdrive/car/nissan/values.py b/selfdrive/car/nissan/values.py index 440c68249..09bd7ca83 100644 --- a/selfdrive/car/nissan/values.py +++ b/selfdrive/car/nissan/values.py @@ -2,9 +2,12 @@ from dataclasses import dataclass from typing import Dict, List, Optional, Union from enum import Enum +from cereal import car +from panda.python import uds from selfdrive.car import dbc_dict from selfdrive.car.docs_definitions import CarInfo, Harness -from cereal import car +from selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries + Ecu = car.CarParams.Ecu @@ -75,6 +78,33 @@ FINGERPRINTS = { ] } +NISSAN_DIAGNOSTIC_REQUEST_KWP = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL, 0xc0]) +NISSAN_DIAGNOSTIC_RESPONSE_KWP = bytes([uds.SERVICE_TYPE.DIAGNOSTIC_SESSION_CONTROL + 0x40, 0xc0]) + +NISSAN_VERSION_REQUEST_KWP = b'\x21\x83' +NISSAN_VERSION_RESPONSE_KWP = b'\x61\x83' + +NISSAN_RX_OFFSET = 0x20 + +FW_QUERY_CONFIG = FwQueryConfig( + requests=[ + Request( + [NISSAN_DIAGNOSTIC_REQUEST_KWP, NISSAN_VERSION_REQUEST_KWP], + [NISSAN_DIAGNOSTIC_RESPONSE_KWP, NISSAN_VERSION_RESPONSE_KWP], + ), + Request( + [NISSAN_DIAGNOSTIC_REQUEST_KWP, NISSAN_VERSION_REQUEST_KWP], + [NISSAN_DIAGNOSTIC_RESPONSE_KWP, NISSAN_VERSION_RESPONSE_KWP], + rx_offset=NISSAN_RX_OFFSET, + ), + Request( + [StdQueries.MANUFACTURER_SOFTWARE_VERSION_REQUEST], + [StdQueries.MANUFACTURER_SOFTWARE_VERSION_RESPONSE], + rx_offset=NISSAN_RX_OFFSET, + ), + ], +) + FW_VERSIONS = { CAR.ALTIMA: { (Ecu.fwdCamera, 0x707, None): [ diff --git a/selfdrive/car/subaru/carstate.py b/selfdrive/car/subaru/carstate.py index c800208e2..5fe44b99c 100644 --- a/selfdrive/car/subaru/carstate.py +++ b/selfdrive/car/subaru/carstate.py @@ -32,9 +32,8 @@ class CarState(CarStateBase): cp_wheels.vl["Wheel_Speeds"]["RR"], ) ret.vEgoRaw = (ret.wheelSpeeds.fl + ret.wheelSpeeds.fr + ret.wheelSpeeds.rl + ret.wheelSpeeds.rr) / 4. - # Kalman filter, even though Subaru raw wheel speed is heaviliy filtered by default ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) - ret.standstill = ret.vEgoRaw < 0.01 + ret.standstill = ret.vEgoRaw == 0 # continuous blinker signals for assisted lane change ret.leftBlinker, ret.rightBlinker = self.update_blinker_from_lamp(50, cp.vl["Dashlights"]["LEFT_BLINKER"], @@ -50,7 +49,7 @@ class CarState(CarStateBase): ret.steeringAngleDeg = cp.vl["Steering_Torque"]["Steering_Angle"] 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 ret.steeringPressed = abs(ret.steeringTorque) > steer_threshold @@ -314,4 +313,4 @@ class CarState(CarStateBase): checks += CarState.get_global_es_distance_signals()[1] return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 1) - return None \ No newline at end of file + return None diff --git a/selfdrive/car/subaru/interface.py b/selfdrive/car/subaru/interface.py index 8e8b08842..a7fbb209c 100644 --- a/selfdrive/car/subaru/interface.py +++ b/selfdrive/car/subaru/interface.py @@ -103,6 +103,8 @@ class CarInterface(CarInterfaceBase): else: raise ValueError(f"unknown car: {candidate}") + CarInterfaceBase.configure_dp_tune(candidate, ret.lateralTuning) + # TODO: get actual value, for now starting with reasonable value for # civic and scaling by mass and wheelbase ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) @@ -111,7 +113,6 @@ class CarInterface(CarInterfaceBase): # mass and CG position, so all cars will have approximately similar dyn behaviors ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront) - CarInterfaceBase.configure_lqr_tune(ret.lateralTuning) return ret # returns a car.CarState diff --git a/selfdrive/car/subaru/values.py b/selfdrive/car/subaru/values.py index 53dd4a763..da5ff1785 100644 --- a/selfdrive/car/subaru/values.py +++ b/selfdrive/car/subaru/values.py @@ -2,9 +2,11 @@ from dataclasses import dataclass from enum import Enum from typing import Dict, List, Union +from cereal import car +from panda.python import uds from selfdrive.car import dbc_dict from selfdrive.car.docs_definitions import CarInfo, Harness -from cereal import car +from selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries, p16 Ecu = car.CarParams.Ecu @@ -71,6 +73,19 @@ CAR_INFO: Dict[str, Union[SubaruCarInfo, List[SubaruCarInfo]]] = { CAR.OUTBACK_PREGLOBAL_2018: SubaruCarInfo("Subaru Outback 2018-19"), } +SUBARU_VERSION_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_DATA_IDENTIFICATION) +SUBARU_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_DATA_IDENTIFICATION) + +FW_QUERY_CONFIG = FwQueryConfig( + requests=[ + Request( + [StdQueries.TESTER_PRESENT_REQUEST, SUBARU_VERSION_REQUEST], + [StdQueries.TESTER_PRESENT_RESPONSE, SUBARU_VERSION_RESPONSE], + ), + ], +) FW_VERSIONS = { CAR.ASCENT: { @@ -89,6 +104,7 @@ FW_VERSIONS = { b'\000\000e~\037@ \'', b'\x00\x00e@\x1f@ $', b'\x00\x00d\xb9\x00\x00\x00\x00', + b'\x00\x00e@\x00\x00\x00\x00', ], (Ecu.engine, 0x7e0, None): [ b'\xbb,\xa0t\a', @@ -96,33 +112,38 @@ FW_VERSIONS = { b'\xf1\x82\xbb,\xa0t\a', b'\xf1\x82\xd9,\xa0@\a', b'\xf1\x82\xd1,\xa0q\x07', + b'\xd1,\xa0q\x07', ], (Ecu.transmission, 0x7e1, None): [ b'\x00\xfe\xf7\x00\x00', b'\001\xfe\xf9\000\000', b'\x01\xfe\xf7\x00\x00', + b'\x01\xfe\xfa\x00\x00', ], }, CAR.LEGACY: { (Ecu.abs, 0x7b0, None): [ b'\xa1\\ x04\x01', - b'\xa1 \x03\x03' + b'\xa1 \x03\x03', + b'\xa1 \x02\x01', ], (Ecu.eps, 0x746, None): [ b'\x9b\xc0\x11\x00', - b'\x9b\xc0\x11\x02' + b'\x9b\xc0\x11\x02', ], (Ecu.fwdCamera, 0x787, None): [ b'\x00\x00e\x80\x00\x1f@ \x19\x00', - b'\x00\x00e\x9a\x00\x00\x00\x00\x00\x00' + b'\x00\x00e\x9a\x00\x00\x00\x00\x00\x00', ], (Ecu.engine, 0x7e0, None): [ b'\xde\"a0\x07', - b'\xe2"aq\x07' + b'\xe2"aq\x07', + b'\xde,\xa0@\x07', ], (Ecu.transmission, 0x7e1, None): [ b'\xa5\xf6\x05@\x00', - b'\xa7\xf6\x04@\x00' + b'\xa7\xf6\x04@\x00', + b'\xa5\xfe\xc7@\x00', ], }, CAR.IMPREZA: { diff --git a/selfdrive/car/tesla/values.py b/selfdrive/car/tesla/values.py index 296169587..e28666c62 100644 --- a/selfdrive/car/tesla/values.py +++ b/selfdrive/car/tesla/values.py @@ -1,9 +1,12 @@ from collections import namedtuple from typing import Dict, List, Union +from cereal import car from selfdrive.car import dbc_dict from selfdrive.car.docs_definitions import CarInfo -from cereal import car +from selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries + +Ecu = car.CarParams.Ecu Button = namedtuple('Button', ['event_type', 'can_addr', 'can_msg', 'values']) AngleRateLimit = namedtuple('AngleRateLimit', ['speed_points', 'max_angle_diff_points']) @@ -20,11 +23,6 @@ CAR_INFO: Dict[str, Union[CarInfo, List[CarInfo]]] = { } FINGERPRINTS = { - CAR.AP2_MODELS: [ - { - 1: 8, 3: 8, 14: 8, 21: 4, 69: 8, 109: 4, 257: 3, 264: 8, 277: 6, 280: 6, 293: 4, 296: 4, 309: 5, 325: 8, 328: 5, 336: 8, 341: 8, 360: 7, 373: 8, 389: 8, 415: 8, 513: 5, 516: 8, 518: 8, 520: 4, 522: 8, 524: 8, 526: 8, 532: 3, 536: 8, 537: 3, 538: 8, 542: 8, 551: 5, 552: 2, 556: 8, 558: 8, 568: 8, 569: 8, 574: 8, 576: 3, 577: 8, 582: 5, 583: 8, 584: 4, 585: 8, 590: 8, 601: 8, 606: 8, 608: 1, 622: 8, 627: 6, 638: 8, 641: 8, 643: 8, 692: 8, 693: 8, 695: 8, 696: 8, 697: 8, 699: 8, 700: 8, 701: 8, 702: 8, 703: 8, 704: 8, 708: 8, 709: 8, 710: 8, 711: 8, 712: 8, 728: 8, 744: 8, 760: 8, 772: 8, 775: 8, 776: 8, 777: 8, 778: 8, 782: 8, 788: 8, 791: 8, 792: 8, 796: 2, 797: 8, 798: 6, 799: 8, 804: 8, 805: 8, 807: 8, 808: 1, 811: 8, 812: 8, 813: 8, 814: 5, 815: 8, 820: 8, 823: 8, 824: 8, 829: 8, 830: 5, 836: 8, 840: 8, 845: 8, 846: 5, 848: 8, 852: 8, 853: 8, 856: 4, 857: 6, 861: 8, 862: 5, 872: 8, 876: 8, 877: 8, 879: 8, 880: 8, 882: 8, 884: 8, 888: 8, 893: 8, 894: 8, 901: 6, 904: 3, 905: 8, 906: 8, 908: 2, 909: 8, 910: 8, 912: 8, 920: 8, 921: 8, 925: 4, 926: 6, 936: 8, 941: 8, 949: 8, 952: 8, 953: 6, 968: 8, 969: 6, 970: 8, 971: 8, 977: 8, 984: 8, 987: 8, 990: 8, 1000: 8, 1001: 8, 1006: 8, 1007: 8, 1008: 8, 1010: 6, 1014: 1, 1015: 8, 1016: 8, 1017: 8, 1018: 8, 1020: 8, 1026: 8, 1028: 8, 1029: 8, 1030: 8, 1032: 1, 1033: 1, 1034: 8, 1048: 1, 1049: 8, 1061: 8, 1064: 8, 1065: 8, 1070: 8, 1080: 8, 1081: 8, 1097: 8, 1113: 8, 1129: 8, 1145: 8, 1160: 4, 1177: 8, 1281: 8, 1328: 8, 1329: 8, 1332: 8, 1335: 8, 1337: 8, 1353: 8, 1368: 8, 1412: 8, 1436: 8, 1476: 8, 1481: 8, 1497: 8, 1513: 8, 1519: 8, 1601: 8, 1605: 8, 1617: 8, 1621: 8, 1625: 8, 1665: 8, 1800: 4, 1804: 8, 1812: 8, 1815: 8, 1816: 8, 1824: 8, 1828: 8, 1831: 8, 1832: 8, 1840: 8, 1848: 8, 1864: 8, 1880: 8, 1892: 8, 1896: 8, 1912: 8, 1960: 8, 1992: 8, 2008: 3, 2015: 8, 2043: 5, 2045: 4 - }, - ], CAR.AP1_MODELS: [ { 1: 8, 3: 8, 14: 8, 21: 4, 69: 8, 109: 4, 257: 3, 264: 8, 267: 5, 277: 6, 280: 6, 283: 5, 293: 4, 296: 4, 309: 5, 325: 8, 328: 5, 336: 8, 341: 8, 360: 7, 373: 8, 389: 8, 415: 8, 513: 5, 516: 8, 520: 4, 522: 8, 524: 8, 526: 8, 532: 3, 536: 8, 537: 3, 542: 8, 551: 5, 552: 2, 556: 8, 558: 8, 568: 8, 569: 8, 574: 8, 577: 8, 582: 5, 584: 4, 585: 8, 590: 8, 606: 8, 622: 8, 627: 6, 638: 8, 641: 8, 643: 8, 660: 5, 693: 8, 696: 8, 697: 8, 712: 8, 728: 8, 744: 8, 760: 8, 772: 8, 775: 8, 776: 8, 777: 8, 778: 8, 782: 8, 788: 8, 791: 8, 792: 8, 796: 2, 797: 8, 798: 6, 799: 8, 804: 8, 805: 8, 807: 8, 808: 1, 809: 8, 812: 8, 813: 8, 814: 5, 815: 8, 820: 8, 823: 8, 824: 8, 829: 8, 830: 5, 836: 8, 840: 8, 841: 8, 845: 8, 846: 5, 852: 8, 856: 4, 857: 6, 861: 8, 862: 5, 872: 8, 873: 8, 877: 8, 878: 8, 879: 8, 880: 8, 884: 8, 888: 8, 889: 8, 893: 8, 896: 8, 901: 6, 904: 3, 905: 8, 908: 2, 909: 8, 920: 8, 921: 8, 925: 4, 936: 8, 937: 8, 941: 8, 949: 8, 952: 8, 953: 6, 957: 8, 968: 8, 973: 8, 984: 8, 987: 8, 989: 8, 990: 8, 1000: 8, 1001: 8, 1006: 8, 1016: 8, 1026: 8, 1028: 8, 1029: 8, 1030: 8, 1032: 1, 1033: 1, 1034: 8, 1048: 1, 1064: 8, 1070: 8, 1080: 8, 1160: 4, 1281: 8, 1329: 8, 1332: 8, 1335: 8, 1337: 8, 1368: 8, 1412: 8, 1436: 8, 1465: 8, 1476: 8, 1497: 8, 1524: 8, 1527: 8, 1601: 8, 1605: 8, 1611: 8, 1614: 8, 1617: 8, 1621: 8, 1627: 8, 1630: 8, 1800: 4, 1804: 8, 1812: 8, 1815: 8, 1816: 8, 1828: 8, 1831: 8, 1832: 8, 1840: 8, 1848: 8, 1864: 8, 1880: 8, 1892: 8, 1896: 8, 1912: 8, 1960: 8, 1992: 8, 2008: 3, 2043: 5, 2045: 4 @@ -37,6 +35,42 @@ DBC = { CAR.AP1_MODELS: dbc_dict('tesla_powertrain', 'tesla_radar', chassis_dbc='tesla_can'), } +FW_QUERY_CONFIG = FwQueryConfig( + requests=[ + Request( + [StdQueries.TESTER_PRESENT_REQUEST, StdQueries.UDS_VERSION_REQUEST], + [StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.UDS_VERSION_RESPONSE], + whitelist_ecus=[Ecu.eps], + rx_offset=0x08, + bus=0, + ), + Request( + [StdQueries.TESTER_PRESENT_REQUEST, StdQueries.UDS_VERSION_REQUEST], + [StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.UDS_VERSION_RESPONSE], + whitelist_ecus=[Ecu.adas, Ecu.electricBrakeBooster, Ecu.fwdRadar], + rx_offset=0x10, + bus=0, + ), + ] +) + +FW_VERSIONS = { + CAR.AP2_MODELS: { + (Ecu.adas, 0x649, None): [ + b'\x01\x00\x8b\x07\x01\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11', + ], + (Ecu.electricBrakeBooster, 0x64d, None): [ + b'1037123-00-A', + ], + (Ecu.fwdRadar, 0x671, None): [ + b'\x01\x00W\x00\x00\x00\x07\x00\x00\x00\x00\x08\x01\x00\x00\x00\x07\xff\xfe', + ], + (Ecu.eps, 0x730, None): [ + b'\x10#\x01', + ], + }, +} + class CANBUS: # Lateral harness chassis = 0 diff --git a/selfdrive/car/torque_data/override.yaml b/selfdrive/car/torque_data/override.yaml index fcc762c2b..b5d1a3119 100644 --- a/selfdrive/car/torque_data/override.yaml +++ b/selfdrive/car/torque_data/override.yaml @@ -21,12 +21,14 @@ FORD FOCUS 4TH GEN: [.nan, 1.5, .nan] COMMA BODY: [.nan, 1000, .nan] # Totally new cars -KIA EV6 2022: [3.5, 2.5, 0.0] +KIA EV6 2022: [3.5, 3.0, 0.0] RAM 1500 5TH GEN: [2.0, 2.0, 0.0] RAM HD 5TH GEN: [1.4, 1.4, 0.0] SUBARU OUTBACK 6TH GEN: [2.3, 2.3, 0.11] +CHEVROLET BOLT EV 2022: [2.0, 2.0, 0.05] CHEVROLET BOLT EUV 2022: [2.0, 2.0, 0.05] CHEVROLET SILVERADO 1500 2020: [1.9, 1.9, 0.112] +CHEVROLET EQUINOX 2019: [2.0, 2.0, 0.05] VOLKSWAGEN PASSAT NMS: [2.5, 2.5, 0.1] HYUNDAI TUCSON HYBRID 4TH GEN: [2.5, 2.5, 0.0] diff --git a/selfdrive/car/torque_data/substitute.yaml b/selfdrive/car/torque_data/substitute.yaml index de64a5544..92361d37f 100644 --- a/selfdrive/car/torque_data/substitute.yaml +++ b/selfdrive/car/torque_data/substitute.yaml @@ -17,7 +17,8 @@ LEXUS RC 2020: LEXUS NX 2020 TOYOTA AVALON HYBRID 2019: TOYOTA AVALON 2019 TOYOTA AVALON HYBRID 2022: TOYOTA AVALON 2022 -KIA OPTIMA SX 2019 & 2016: HYUNDAI SONATA 2020 +KIA OPTIMA 2016: HYUNDAI SONATA 2020 +KIA OPTIMA 2019: HYUNDAI SONATA 2020 KIA OPTIMA HYBRID 2017 & SPORTS 2019: HYUNDAI SONATA 2020 KIA FORTE E 2018 & GT 2021: HYUNDAI SONATA 2020 KIA CEED INTRO ED 2019: HYUNDAI SONATA 2020 diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index 4786a46d5..face226bb 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -103,7 +103,7 @@ class CarController: pcm_cancel_cmd = 1 # on entering standstill, send standstill request - if CS.out.standstill and not self.last_standstill and self.CP.carFingerprint not in NO_STOP_TIMER_CAR: + if CS.out.standstill and not self.last_standstill and (self.CP.carFingerprint not in NO_STOP_TIMER_CAR or self.CP.enableGasInterceptor): self.standstill_req = True if CS.pcm_acc_status != 8: # pcm entered standstill or it's disabled @@ -153,10 +153,10 @@ class CarController: if pcm_cancel_cmd and self.CP.carFingerprint in (CAR.LEXUS_IS, CAR.LEXUS_RC): can_sends.append(create_acc_cancel_command(self.packer)) elif self.CP.openpilotLongitudinalControl: - can_sends.append(create_accel_command(self.packer, pcm_accel_cmd, pcm_cancel_cmd, self.standstill_req, lead, CS.acc_type, CS.distance_btn)) + can_sends.append(create_accel_command(self.packer, pcm_accel_cmd, pcm_cancel_cmd, self.standstill_req, lead, CS.acc_type, CS.distance)) self.accel = pcm_accel_cmd else: - can_sends.append(create_accel_command(self.packer, 0, pcm_cancel_cmd, False, lead, CS.acc_type, CS.distance_btn)) + can_sends.append(create_accel_command(self.packer, 0, pcm_cancel_cmd, False, lead, CS.acc_type, CS.distance)) if self.frame % 2 == 0 and self.CP.enableGasInterceptor and self.CP.openpilotLongitudinalControl: # send exactly zero if gas cmd is zero. Interceptor will send the max between read value and gas cmd. diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index f6d6ae8f6..e948d6d3f 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -49,8 +49,10 @@ class CarState(CarStateBase): self.dp_accel_profile_prev = None self.dp_accel_profile_init = False self.dp_toyota_ap_btn_link = Params().get_bool('dp_toyota_ap_btn_link') - # KRKeegan - Add support for toyota distance button - self.distance_btn = 0 + self.read_distance_lines = 0 + self.read_distance_lines_init = False + self.distance = 0 + self.dp_toyota_fp_btn_link = Params().get_bool('dp_toyota_fp_btn_link') def update(self, cp, cp_cam): ret = car.CarState.new_message() @@ -106,7 +108,7 @@ class CarState(CarStateBase): #dp: Thank you Arne (acceleration) if self.dp_toyota_ap_btn_link: - sport_on_sig = 'SPORT_ON_2' if CAR.RAV4_TSS2 else 'SPORT_ON' + sport_on_sig = 'SPORT_ON_2' if self.CP.carFingerprint == CAR.RAV4_TSS2 else 'SPORT_ON' # check signal once if not self.dp_sig_check: self.dp_sig_check = True @@ -140,6 +142,21 @@ class CarState(CarStateBase): self.dp_accel_profile_init = True self.dp_accel_profile_prev = self.dp_accel_profile + # distance button + + #dp: Thank you Arne (distance button) + if self.dp_toyota_fp_btn_link: + if not self.read_distance_lines_init or self.read_distance_lines != cp.vl["PCM_CRUISE_SM"]['DISTANCE_LINES']: + self.read_distance_lines_init = True + self.read_distance_lines = cp.vl["PCM_CRUISE_SM"]['DISTANCE_LINES'] + put_nonblocking('dp_following_profile', str(int(max(self.read_distance_lines - 1, 0)))) # Skipping one profile toyota mid is weird. + put_nonblocking('dp_last_modified',str(floor(time.time()))) + + if self.CP.carFingerprint in (TSS2_CAR - RADAR_ACC_CAR): + self.distance = cp_cam.vl["ACC_CONTROL"]['DISTANCE'] + elif self.CP.carFingerprint in [CAR.RAV4H, CAR.HIGHLANDER]: + self.distance = cp.vl["SDSU"]['FD_BUTTON'] + #dp ret.engineRPM = cp.vl["ENGINE_RPM"]['RPM'] @@ -176,11 +193,6 @@ class CarState(CarStateBase): self.acc_type = cp_acc.vl["ACC_CONTROL"]["ACC_TYPE"] ret.stockFcw = bool(cp_acc.vl["ACC_HUD"]["FCW"]) - # KRKeegan - Add support for toyota distance button - if self.CP.carFingerprint in (TSS2_CAR - RADAR_ACC_CAR): - self.distance_btn = 1 if cp_cam.vl["ACC_CONTROL"]["DISTANCE"] == 1 else 0 - ret.distanceLines = cp.vl["PCM_CRUISE_SM"]["DISTANCE_LINES"] - # some TSS2 cars have low speed lockout permanently set, so ignore on those cars # these cars are identified by an ACC_TYPE value of 2. # TODO: it is possible to avoid the lockout and gain stop and go if you @@ -331,6 +343,7 @@ class CarState(CarStateBase): ("ECON_ON", "GEAR_PACKET"), ("RPM", "ENGINE_RPM"), ("BRAKE_LIGHTS_ACC", "ESP_CONTROL"), + ("DISTANCE_LINES", "PCM_CRUISE_SM"), ] checks = [ @@ -357,7 +370,9 @@ class CarState(CarStateBase): else: signals.append(("GAS_PEDAL", "GAS_PEDAL")) checks.append(("GAS_PEDAL", 33)) - + #arne + if CP.carFingerprint in [CAR.RAV4H, CAR.HIGHLANDER]: + signals.append(("FD_BUTTON", "SDSU", 0)) #dp acceleration if CP.carFingerprint == CAR.RAV4_TSS2: signals.append(("SPORT_ON_2", "GEAR_PACKET")) @@ -403,11 +418,6 @@ class CarState(CarStateBase): ("ACC_HUD", 1), ] - # KRKeegan - Add support for toyota distance button - if CP.carFingerprint in TSS2_CAR: - signals.append(("DISTANCE_LINES", "PCM_CRUISE_SM")) - checks.append(("PCM_CRUISE_SM", 0)) - if CP.carFingerprint not in (TSS2_CAR - RADAR_ACC_CAR) and not CP.enableDsu: signals += [ ("FORCE", "PRE_COLLISION"), @@ -421,7 +431,7 @@ class CarState(CarStateBase): @staticmethod def get_cam_can_parser(CP): - # Include traffic singal signals. + # Include traffic signal, single signals = [ ("TSGN1", "RSA1", 0), ("SPDVAL1", "RSA1", 0), @@ -447,14 +457,15 @@ class CarState(CarStateBase): ("FORCE", "PRE_COLLISION"), ("ACC_TYPE", "ACC_CONTROL"), ("FCW", "ACC_HUD"), + #dp + ("DISTANCE_LINES", "PCM_CRUISE_SM"), + ("DISTANCE", "ACC_CONTROL"), ] checks += [ ("PRE_COLLISION", 33), ("ACC_CONTROL", 33), ("ACC_HUD", 1), + ("PCM_CRUISE_SM", 0), ] - # KRKeegan - Add support for toyota distance button - signals.append(("DISTANCE", "ACC_CONTROL", 0)) - return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 2) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 02da45e94..2c68d49bf 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -51,10 +51,14 @@ class CarInterface(CarInterfaceBase): tire_stiffness_factor = 0.6371 # hand-tune ret.mass = 3045. * CV.LB_TO_KG + STD_CARGO_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': - steering_angle_deadzone_deg = 1.0 - CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning, steering_angle_deadzone_deg) + if Params().get_bool("dp_toyota_prius_bad_angle_tune"): + steering_angle_deadzone_deg = 1.0 + CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning, steering_angle_deadzone_deg) + else: + for fw in car_fw: + if fw.ecu == "eps" and not fw.fwVersion == b'8965B47060\x00\x00\x00\x00\x00\x00': + steering_angle_deadzone_deg = 1.0 + CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning, steering_angle_deadzone_deg) elif candidate == CAR.PRIUS_V: stop_and_go = True @@ -131,10 +135,13 @@ class CarInterface(CarInterfaceBase): # 2019+ RAV4 TSS2 uses two different steering racks and specific tuning seems to be necessary. # See https://github.com/commaai/openpilot/pull/21429#issuecomment-873652891 - for fw in car_fw: - if fw.ecu == "eps" and (fw.fwVersion.startswith(b'\x02') or fw.fwVersion in [b'8965B42181\x00\x00\x00\x00\x00\x00']): - set_lat_tune(ret.lateralTuning, LatTunes.PID_I) - break + if Params().get_bool("dp_toyota_rav4_tss2_tune"): + set_lat_tune(ret.lateralTuning, LatTunes.PID_I) + else: + for fw in car_fw: + if fw.ecu == "eps" and (fw.fwVersion.startswith(b'\x02') or fw.fwVersion in [b'8965B42181\x00\x00\x00\x00\x00\x00']): + set_lat_tune(ret.lateralTuning, LatTunes.PID_I) + break elif candidate in (CAR.COROLLA_TSS2, CAR.COROLLAH_TSS2): stop_and_go = True @@ -189,8 +196,8 @@ class CarInterface(CarInterfaceBase): tire_stiffness_factor = 0.6371 # hand-tune ret.mass = 3115. * CV.LB_TO_KG + STD_CARGO_KG # set_lat_tune(ret.lateralTuning, LatTunes.PID_N) - set_lat_tune(ret.lateralTuning, LatTunes.INDI_PRIUS_TSS2) - ret.steerActuatorDelay = 0.3 + #set_lat_tune(ret.lateralTuning, LatTunes.INDI_PRIUS_TSS2) + #ret.steerActuatorDelay = 0.3 elif candidate == CAR.MIRAI: stop_and_go = True @@ -208,6 +215,8 @@ class CarInterface(CarInterfaceBase): ret.mass = 4305. * CV.LB_TO_KG + STD_CARGO_KG set_lat_tune(ret.lateralTuning, LatTunes.PID_J) + CarInterfaceBase.configure_dp_tune(candidate, ret.lateralTuning, steering_angle_deadzone_deg) + ret.centerToFront = ret.wheelbase * 0.44 # TODO: get actual value, for now starting with reasonable value for @@ -250,20 +259,18 @@ class CarInterface(CarInterfaceBase): # to a negative value, so it won't matter. ret.minEnableSpeed = -1. if (stop_and_go or ret.enableGasInterceptor) else MIN_ACC_SPEED - if ret.enableGasInterceptor: - set_long_tune(ret.longitudinalTuning, LongTunes.PEDAL) - elif candidate in TSS2_CAR: + if candidate in TSS2_CAR or ret.enableGasInterceptor: set_long_tune(ret.longitudinalTuning, LongTunes.TSS2) - ret.vEgoStopping = 0.2 # car is near 0.1 to 0.2 when car starts requesting stopping accel - ret.vEgoStarting = 0.2 # needs to be > or == vEgoStopping - ret.stopAccel = -2.0 # Toyota requests -0.4 when stopped - ret.stoppingDecelRate = 0.3 # reach stopping target smoothly - seems to take 0.5 seconds to go from 0 to -0.4 - ret.longitudinalActuatorDelayLowerBound = 0.3 - ret.longitudinalActuatorDelayUpperBound = 0.3 + if candidate in TSS2_CAR: + ret.vEgoStopping = 0.2 # car is near 0.1 to 0.2 when car starts requesting stopping accel + ret.vEgoStarting = 0.2 # needs to be > or == vEgoStopping + ret.stopAccel = -2.0 # Toyota requests -0.4 when stopped + ret.stoppingDecelRate = 0.3 # reach stopping target smoothly - seems to take 0.5 seconds to go from 0 to -0.4 + ret.longitudinalActuatorDelayLowerBound = 0.3 + ret.longitudinalActuatorDelayUpperBound = 0.3 else: set_long_tune(ret.longitudinalTuning, LongTunes.TSS) - CarInterfaceBase.configure_lqr_tune(ret.lateralTuning) return ret # returns a car.CarState diff --git a/selfdrive/car/toyota/tunes.py b/selfdrive/car/toyota/tunes.py index 8e0c6d9a9..0749994fc 100644 --- a/selfdrive/car/toyota/tunes.py +++ b/selfdrive/car/toyota/tunes.py @@ -2,9 +2,8 @@ from enum import Enum class LongTunes(Enum): - PEDAL = 0 - TSS2 = 1 - TSS = 2 + TSS2 = 0 + TSS = 1 class LatTunes(Enum): INDI_PRIUS = 0 @@ -30,13 +29,16 @@ class LatTunes(Enum): ###### LONG ###### def set_long_tune(tune, name): # Improved longitudinal tune - if name == LongTunes.TSS2 or name == LongTunes.PEDAL: + if name == LongTunes.TSS2: tune.deadzoneBP = [0., 8.05] tune.deadzoneV = [.0, .14] tune.kpBP = [0., 5., 20., 30.] tune.kpV = [1.3, 1.0, 0.7, 0.1] - tune.kiBP = [0., 0.07, 8, 13., 18., 20., 24., 25., 27., 33.] - tune.kiV = [.01, .1, .15, .21, .175, .18, .2, .01, .001, .0001] + #really smooth (make it toggleable) + #tune.kiBP = [0., 0.07, 5, 8, 11., 18., 20., 24., 33.] + #tune.kiV = [.001, .01, .1, .18, .21, .22, .23, .22, .001] + tune.kiBP = [0., 11., 17., 20., 24., 30., 33., 40.] + tune.kiV = [.001, .21, .22, .23, .22, .1, .001, .0001] # Default longitudinal tune elif name == LongTunes.TSS: tune.deadzoneBP = [0., 9.] diff --git a/selfdrive/car/toyota/values.py b/selfdrive/car/toyota/values.py index f2602816f..3a166b197 100644 --- a/selfdrive/car/toyota/values.py +++ b/selfdrive/car/toyota/values.py @@ -7,6 +7,7 @@ from cereal import car from common.conversions import Conversions as CV from selfdrive.car import dbc_dict from selfdrive.car.docs_definitions import CarFootnote, CarInfo, Column, Harness +from selfdrive.car.fw_query_definitions import FwQueryConfig, Request, StdQueries Ecu = car.CarParams.Ecu MIN_ACC_SPEED = 19. * CV.MPH_TO_MS @@ -136,7 +137,7 @@ CAR_INFO: Dict[str, Union[ToyotaCarInfo, List[ToyotaCarInfo]]] = { CAR.HIGHLANDERH: ToyotaCarInfo("Toyota Highlander Hybrid 2017-19", footnotes=[Footnote.DSU]), CAR.HIGHLANDERH_TSS2: ToyotaCarInfo("Toyota Highlander Hybrid 2020-22"), CAR.PRIUS: [ - ToyotaCarInfo("Toyota Prius 2016", "Toyota Safety Sense P", video_link="https://www.youtube.com/watch?v=8zopPJI8XQ0", footnotes=[Footnote.DSU]), + ToyotaCarInfo("Toyota Prius 2016", "Toyota Safety Sense P", "https://www.youtube.com/watch?v=8zopPJI8XQ0", [Footnote.DSU]), ToyotaCarInfo("Toyota Prius 2017-20", video_link="https://www.youtube.com/watch?v=8zopPJI8XQ0", footnotes=[Footnote.DSU]), ToyotaCarInfo("Toyota Prius Prime 2017-20", video_link="https://www.youtube.com/watch?v=8zopPJI8XQ0", footnotes=[Footnote.DSU]), ], @@ -150,7 +151,7 @@ CAR_INFO: Dict[str, Union[ToyotaCarInfo, List[ToyotaCarInfo]]] = { ToyotaCarInfo("Toyota RAV4 2017-18", footnotes=[Footnote.DSU]) ], CAR.RAV4H: [ - ToyotaCarInfo("Toyota RAV4 Hybrid 2016", "Toyota Safety Sense P", video_link="https://youtu.be/LhT5VzJVfNI?t=26", footnotes=[Footnote.DSU]), + ToyotaCarInfo("Toyota RAV4 Hybrid 2016", "Toyota Safety Sense P", "https://youtu.be/LhT5VzJVfNI?t=26", [Footnote.DSU]), ToyotaCarInfo("Toyota RAV4 Hybrid 2017-18", video_link="https://youtu.be/LhT5VzJVfNI?t=26", footnotes=[Footnote.DSU]) ], CAR.RAV4_TSS2: ToyotaCarInfo("Toyota RAV4 2019-21", video_link="https://www.youtube.com/watch?v=wJxjDd42gGA"), @@ -199,6 +200,35 @@ STATIC_DSU_MSGS = [ (0x4CB, (CAR.PRIUS, CAR.RAV4H, CAR.LEXUS_RXH, CAR.LEXUS_NXH, CAR.LEXUS_NX, CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDERH, CAR.HIGHLANDER, CAR.AVALON, CAR.SIENNA, CAR.LEXUS_CTH, CAR.LEXUS_ESH, CAR.LEXUS_RX, CAR.PRIUS_V), 0, 100, b'\x0c\x00\x00\x00\x00\x00\x00\x00'), ] +TOYOTA_VERSION_REQUEST = b'\x1a\x88\x01' +TOYOTA_VERSION_RESPONSE = b'\x5a\x88\x01' + +FW_QUERY_CONFIG = FwQueryConfig( + requests=[ + Request( + [StdQueries.SHORT_TESTER_PRESENT_REQUEST, TOYOTA_VERSION_REQUEST], + [StdQueries.SHORT_TESTER_PRESENT_RESPONSE, TOYOTA_VERSION_RESPONSE], + bus=0, + ), + Request( + [StdQueries.SHORT_TESTER_PRESENT_REQUEST, StdQueries.OBD_VERSION_REQUEST], + [StdQueries.SHORT_TESTER_PRESENT_RESPONSE, StdQueries.OBD_VERSION_RESPONSE], + bus=0, + ), + Request( + [StdQueries.TESTER_PRESENT_REQUEST, StdQueries.DEFAULT_DIAGNOSTIC_REQUEST, StdQueries.EXTENDED_DIAGNOSTIC_REQUEST, StdQueries.UDS_VERSION_REQUEST], + [StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.DEFAULT_DIAGNOSTIC_RESPONSE, StdQueries.EXTENDED_DIAGNOSTIC_RESPONSE, StdQueries.UDS_VERSION_RESPONSE], + bus=0, + ), + ], + non_essential_ecus={ + # FIXME: On some models, abs can sometimes be missing + Ecu.abs: [CAR.RAV4, CAR.COROLLA, CAR.HIGHLANDER, CAR.SIENNA, CAR.LEXUS_IS], + # On some models, the engine can show on two different addresses + Ecu.engine: [CAR.CAMRY, CAR.COROLLA_TSS2, CAR.CHR, CAR.LEXUS_IS], + } +) + FW_VERSIONS = { CAR.CHR_TSS2: {(Ecu.eps, 0xfff, None): [b'\x00']}, CAR.AVALON: { @@ -513,13 +543,16 @@ FW_VERSIONS = { CAR.CAMRYH_TSS2: { (Ecu.eps, 0x7a1, None): [ b'8965B33630\x00\x00\x00\x00\x00\x00', + b'8965B33650\x00\x00\x00\x00\x00\x00', ], (Ecu.abs, 0x7b0, None): [ b'F152633D00\x00\x00\x00\x00\x00\x00', + b'F152633D60\x00\x00\x00\x00\x00\x00', ], (Ecu.engine, 0x700, None): [ b'\x018966306Q6000\x00\x00\x00\x00', b'\x018966306Q7000\x00\x00\x00\x00', + b'\x01896633T20000\x00\x00\x00\x00', ], (Ecu.fwdRadar, 0x750, 15): [ b'\x018821F6201200\x00\x00\x00\x00', @@ -786,6 +819,7 @@ FW_VERSIONS = { b'\x01896637626000\x00\x00\x00\x00', b'\x01896637648000\x00\x00\x00\x00', b'\x01896637643000\x00\x00\x00\x00', + b'\x02896630A07000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', b'\x02896630A21000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', b'\x02896630ZJ5000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', b'\x02896630ZN8000\x00\x00\x00\x008966A4703000\x00\x00\x00\x00', diff --git a/selfdrive/car/vin.py b/selfdrive/car/vin.py index ae3aa675c..50c2abde4 100755 --- a/selfdrive/car/vin.py +++ b/selfdrive/car/vin.py @@ -1,19 +1,12 @@ #!/usr/bin/env python3 import re -import struct -import traceback import cereal.messaging as messaging -import panda.python.uds as uds +from panda.python.uds import get_rx_addr_for_tx_addr, FUNCTIONAL_ADDRS from selfdrive.car.isotp_parallel_query import IsoTpParallelQuery +from selfdrive.car.fw_query_definitions import StdQueries from system.swaglog import cloudlog -OBD_VIN_REQUEST = b'\x09\x02' -OBD_VIN_RESPONSE = b'\x49\x02\x01' - -UDS_VIN_REQUEST = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + struct.pack("!H", uds.DATA_IDENTIFIER_TYPE.VIN) -UDS_VIN_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + struct.pack("!H", uds.DATA_IDENTIFIER_TYPE.VIN) - VIN_UNKNOWN = "0" * 17 VIN_RE = "[A-HJ-NPR-Z0-9]{17}" @@ -23,29 +16,44 @@ def is_valid_vin(vin: str): def get_vin(logcan, sendcan, bus, timeout=0.1, retry=5, debug=False): - addrs = [0x7e0, 0x7e2, 0x18da10f1, 0x18da0ef1] # engine, VMCU, 29-bit engine, PGM-FI + addrs = list(range(0x7e0, 0x7e8)) + list(range(0x18DA00F1, 0x18DB00F1, 0x100)) # addrs to process/wait for + valid_vin_addrs = [0x7e0, 0x7e2, 0x18da10f1, 0x18da0ef1] # engine, VMCU, 29-bit engine, PGM-FI for i in range(retry): - for request, response in ((UDS_VIN_REQUEST, UDS_VIN_RESPONSE), (OBD_VIN_REQUEST, OBD_VIN_RESPONSE)): + for request, response in ((StdQueries.UDS_VIN_REQUEST, StdQueries.UDS_VIN_RESPONSE), (StdQueries.OBD_VIN_REQUEST, StdQueries.OBD_VIN_RESPONSE)): try: - query = IsoTpParallelQuery(sendcan, logcan, bus, addrs, [request, ], [response, ], debug=debug) - for (addr, rx_addr), vin in query.get_data(timeout).items(): + query = IsoTpParallelQuery(sendcan, logcan, bus, addrs, [request, ], [response, ], functional_addrs=FUNCTIONAL_ADDRS, debug=debug) + results = query.get_data(timeout) - # Honda Bosch response starts with a length, trim to correct length - if vin.startswith(b'\x11'): - vin = vin[1:18] + for addr in valid_vin_addrs: + vin = results.get((addr, None)) + if vin is not None: + # Honda Bosch response starts with a length, trim to correct length + if vin.startswith(b'\x11'): + vin = vin[1:18] - return addr[0], rx_addr, vin.decode() - print(f"vin query retry ({i+1}) ...") + return get_rx_addr_for_tx_addr(addr), vin.decode() + + cloudlog.error(f"vin query retry ({i+1}) ...") except Exception: - cloudlog.warning(f"VIN query exception: {traceback.format_exc()}") + cloudlog.exception("VIN query exception") - return 0, 0, VIN_UNKNOWN + return 0, VIN_UNKNOWN if __name__ == "__main__": + import argparse import time + + parser = argparse.ArgumentParser(description='Get VIN of the car') + parser.add_argument('--debug', action='store_true') + parser.add_argument('--bus', type=int, default=1) + parser.add_argument('--timeout', type=float, default=0.1) + parser.add_argument('--retry', type=int, default=5) + args = parser.parse_args() + sendcan = messaging.pub_sock('sendcan') logcan = messaging.sub_sock('can') time.sleep(1) - addr, vin_rx_addr, vin = get_vin(logcan, sendcan, 1, debug=False) - print(f'TX: {hex(addr)}, RX: {hex(vin_rx_addr)}, VIN: {vin}') + + vin_rx_addr, vin = get_vin(logcan, sendcan, args.bus, args.timeout, args.retry, debug=args.debug) + print(f'RX: {hex(vin_rx_addr)}, VIN: {vin}') diff --git a/selfdrive/car/volkswagen/carcontroller.py b/selfdrive/car/volkswagen/carcontroller.py index f14c11989..816933f2f 100644 --- a/selfdrive/car/volkswagen/carcontroller.py +++ b/selfdrive/car/volkswagen/carcontroller.py @@ -7,6 +7,7 @@ from selfdrive.car.volkswagen import mqbcan, pqcan from selfdrive.car.volkswagen.values import CANBUS, PQ_CARS, CarControllerParams VisualAlert = car.CarControl.HUDControl.VisualAlert +LongCtrlState = car.CarControl.Actuators.LongControlState class CarController: @@ -17,6 +18,7 @@ class CarController: self.packer_pt = CANPacker(dbc_name) self.apply_steer_last = 0 + self.gra_acc_counter_last = None self.frame = 0 self.hcaSameTorqueCount = 0 self.hcaEnabledFrameCount = 0 @@ -24,7 +26,6 @@ class CarController: def update(self, CC, CS, ext_bus): actuators = CC.actuators hud_control = CC.hudControl - can_sends = [] # **** Steering Controls ************************************************ # @@ -70,9 +71,12 @@ class CarController: # **** Acceleration Controls ******************************************** # if self.frame % self.CCP.ACC_CONTROL_STEP == 0 and self.CP.openpilotLongitudinalControl: - tsk_status = self.CCS.tsk_status_value(CS.out.cruiseState.available, CS.out.accFaulted, CC.longActive) + acc_control = self.CCS.acc_control_value(CS.out.cruiseState.available, CS.out.accFaulted, CC.longActive) accel = clip(actuators.accel, self.CCP.ACCEL_MIN, self.CCP.ACCEL_MAX) if CC.longActive else 0 - can_sends.extend(self.CCS.create_acc_accel_control(self.packer_pt, CANBUS.pt, tsk_status, accel)) + stopping = actuators.longControlState == LongCtrlState.stopping + starting = actuators.longControlState == LongCtrlState.starting + can_sends.extend(self.CCS.create_acc_accel_control(self.packer_pt, CANBUS.pt, CS.acc_type, CC.longActive, accel, + acc_control, stopping, starting, CS.out.cruiseState.standstill)) # **** HUD Controls ***************************************************** # @@ -91,15 +95,15 @@ class CarController: # **** Stock ACC Button Controls **************************************** # - if self.CP.pcmCruise and self.frame % self.CCP.GRA_ACC_STEP == 0: - idx = (CS.gra_stock_values["COUNTER"] + 1) % 16 - if CC.cruiseControl.cancel: - can_sends.append(self.CCS.create_acc_buttons_control(self.packer_pt, ext_bus, CS.gra_stock_values, idx, cancel=True)) - elif CC.cruiseControl.resume: - can_sends.append(self.CCS.create_acc_buttons_control(self.packer_pt, ext_bus, CS.gra_stock_values, idx, resume=True)) + gra_send_ready = self.CP.pcmCruise and CS.gra_stock_values["COUNTER"] != self.gra_acc_counter_last + if gra_send_ready and (CC.cruiseControl.cancel or CC.cruiseControl.resume): + counter = (CS.gra_stock_values["COUNTER"] + 1) % 16 + can_sends.append(self.CCS.create_acc_buttons_control(self.packer_pt, ext_bus, CS.gra_stock_values, counter, + cancel=CC.cruiseControl.cancel, resume=CC.cruiseControl.resume)) new_actuators = actuators.copy() new_actuators.steer = self.apply_steer_last / self.CCP.STEER_MAX + self.gra_acc_counter_last = CS.gra_stock_values["COUNTER"] self.frame += 1 return new_actuators, can_sends diff --git a/selfdrive/car/volkswagen/carstate.py b/selfdrive/car/volkswagen/carstate.py index ebe48c633..2eaa4a0bf 100644 --- a/selfdrive/car/volkswagen/carstate.py +++ b/selfdrive/car/volkswagen/carstate.py @@ -171,7 +171,7 @@ class CarState(CarStateBase): ret.gas = pt_cp.vl["Motor_3"]["Fahrpedal_Rohsignal"] / 100.0 ret.gasPressed = ret.gas > 0 ret.brake = pt_cp.vl["Bremse_5"]["Bremsdruck"] / 250.0 # FIXME: this is pressure in Bar, not sure what OP expects - ret.brakePressed = bool(pt_cp.vl["Motor_2"]["Bremstestschalter"]) + ret.brakePressed = bool(pt_cp.vl["Motor_2"]["Bremslichtschalter"]) ret.parkingBrake = bool(pt_cp.vl["Kombi_1"]["Bremsinfo"]) # Update gear and/or clutch position data. @@ -216,6 +216,7 @@ class CarState(CarStateBase): ret.stockAeb = False # Update ACC radar status. + self.acc_type = 0 # TODO: this is ACC "basic" with nonzero min speed, support FtS (1) later ret.cruiseState.available = bool(pt_cp.vl["Motor_5"]["GRA_Hauptschalter"]) ret.cruiseState.enabled = bool(pt_cp.vl["Motor_2"]["GRA_Status"]) if self.CP.pcmCruise: diff --git a/selfdrive/car/volkswagen/interface.py b/selfdrive/car/volkswagen/interface.py index 7787eaed6..93c336d3d 100644 --- a/selfdrive/car/volkswagen/interface.py +++ b/selfdrive/car/volkswagen/interface.py @@ -38,6 +38,7 @@ class CarInterface(CarInterfaceBase): if any(msg in fingerprint[1] for msg in (0x1A0, 0xC2)): # Bremse_1, Lenkwinkel_1 ret.networkLocation = NetworkLocation.gateway + ret.experimentalLongitudinalAvailable = True else: ret.networkLocation = NetworkLocation.fwdCamera @@ -49,13 +50,6 @@ class CarInterface(CarInterfaceBase): # Panda ALLOW_DEBUG firmware required. ret.dashcamOnly = True - if experimental_long and ret.networkLocation == NetworkLocation.gateway: - # Proof-of-concept, prep for E2E only. No radar points available. Follow-to-stop not yet supported, but should - # be simple to add when a suitable test car becomes available. Panda ALLOW_DEBUG firmware required. - ret.experimentalLongitudinalAvailable = True - ret.openpilotLongitudinalControl = True - ret.safetyConfigs[0].safetyParam |= Panda.FLAG_VOLKSWAGEN_LONG_CONTROL - else: # Set global MQB parameters ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.volkswagen)] @@ -87,6 +81,13 @@ class CarInterface(CarInterfaceBase): # Global longitudinal tuning defaults, can be overridden per-vehicle + if experimental_long and candidate in PQ_CARS: + # Proof-of-concept, prep for E2E only. No radar points available. Panda ALLOW_DEBUG firmware required. + ret.openpilotLongitudinalControl = True + ret.safetyConfigs[0].safetyParam |= Panda.FLAG_VOLKSWAGEN_LONG_CONTROL + if ret.transmissionType == TransmissionType.manual: + ret.minEnableSpeed = 4.5 + ret.pcmCruise = not ret.openpilotLongitudinalControl ret.longitudinalActuatorDelayUpperBound = 0.5 # s ret.longitudinalTuning.kpV = [0.1] @@ -198,12 +199,13 @@ class CarInterface(CarInterfaceBase): else: raise ValueError(f"unsupported car {candidate}") + CarInterfaceBase.configure_dp_tune(candidate, ret.lateralTuning) + ret.autoResumeSng = ret.minEnableSpeed == -1 ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) ret.centerToFront = ret.wheelbase * 0.45 ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, tire_stiffness_factor=tire_stiffness_factor) - CarInterfaceBase.configure_lqr_tune(ret.lateralTuning) return ret # returns a car.CarState diff --git a/selfdrive/car/volkswagen/mqbcan.py b/selfdrive/car/volkswagen/mqbcan.py index 1a4ca339a..3819f4f76 100644 --- a/selfdrive/car/volkswagen/mqbcan.py +++ b/selfdrive/car/volkswagen/mqbcan.py @@ -26,11 +26,11 @@ def create_lka_hud_control(packer, bus, ldw_stock_values, enabled, steering_pres return packer.make_can_msg("LDW_02", bus, values) -def create_acc_buttons_control(packer, bus, gra_stock_values, idx, cancel=False, resume=False): +def create_acc_buttons_control(packer, bus, gra_stock_values, counter, cancel=False, resume=False): values = gra_stock_values.copy() values.update({ - "COUNTER": idx, + "COUNTER": counter, "GRA_Abbrechen": cancel, "GRA_Tip_Wiederaufnahme": resume, }) diff --git a/selfdrive/car/volkswagen/pqcan.py b/selfdrive/car/volkswagen/pqcan.py index 1e7ed2134..30f3fcf62 100644 --- a/selfdrive/car/volkswagen/pqcan.py +++ b/selfdrive/car/volkswagen/pqcan.py @@ -23,11 +23,11 @@ def create_lka_hud_control(packer, bus, ldw_stock_values, enabled, steering_pres return packer.make_can_msg("LDW_Status", bus, values) -def create_acc_buttons_control(packer, bus, gra_stock_values, idx, cancel=False, resume=False): +def create_acc_buttons_control(packer, bus, gra_stock_values, counter, cancel=False, resume=False): values = gra_stock_values.copy() values.update({ - "COUNTER": idx, + "COUNTER": counter, "GRA_Abbrechen": cancel, "GRA_Recall": resume, }) @@ -35,15 +35,15 @@ def create_acc_buttons_control(packer, bus, gra_stock_values, idx, cancel=False, return packer.make_can_msg("GRA_Neu", bus, values) -def tsk_status_value(main_switch_on, acc_faulted, long_active): +def acc_control_value(main_switch_on, acc_faulted, long_active): if long_active: - tsk_status = 1 + acc_control = 1 elif main_switch_on: - tsk_status = 2 + acc_control = 2 else: - tsk_status = 0 + acc_control = 0 - return tsk_status + return acc_control def acc_hud_status_value(main_switch_on, acc_faulted, long_active): @@ -59,26 +59,32 @@ def acc_hud_status_value(main_switch_on, acc_faulted, long_active): return hud_status -def create_acc_accel_control(packer, bus, adr_status, accel): +def create_acc_accel_control(packer, bus, acc_type, enabled, accel, acc_control, stopping, starting, standstill): + commands = [] + values = { - "ACS_Sta_ADR": adr_status, - "ACS_StSt_Info": adr_status != 1, - "ACS_Typ_ACC": 0, # TODO: this is ACC "basic", find a way to detect FtS support (1) - "ACS_Sollbeschl": accel if adr_status == 1 else 3.01, - "ACS_zul_Regelabw": 0.2 if adr_status == 1 else 1.27, - "ACS_max_AendGrad": 3.0 if adr_status == 1 else 5.08, + "ACS_Sta_ADR": acc_control, + "ACS_StSt_Info": acc_control != 1, + "ACS_Typ_ACC": acc_type, + "ACS_Sollbeschl": accel if acc_control == 1 else 3.01, + "ACS_zul_Regelabw": 0.2 if acc_control == 1 else 1.27, + "ACS_max_AendGrad": 3.0 if acc_control == 1 else 5.08, } - return packer.make_can_msg("ACC_System", bus, values) + commands.append(packer.make_can_msg("ACC_System", bus, values)) + + return commands -def create_acc_hud_control(packer, bus, acc_status, set_speed, lead_visible): +def create_acc_hud_control(packer, bus, acc_hud_status, set_speed, lead_visible): values = { - "ACA_StaACC": acc_status, + "ACA_StaACC": acc_hud_status, "ACA_Zeitluecke": 2, "ACA_V_Wunsch": set_speed, "ACA_gemZeitl": 8 if lead_visible else 0, + # TODO: ACA_ID_StaACC, ACA_AnzDisplay, ACA_kmh_mph, ACA_PrioDisp, ACA_Aend_Zeitluecke + # display/display-prio handling probably needed to stop confusing the instrument cluster + # kmh_mph handling probably needed to resolve rounding errors in displayed setpoint } - # TODO: ACA_ID_StaACC, ACA_AnzDisplay, ACA_kmh_mph, ACA_PrioDisp, ACA_Aend_Zeitluecke return packer.make_can_msg("ACC_GRA_Anziege", bus, values) diff --git a/selfdrive/car/volkswagen/values.py b/selfdrive/car/volkswagen/values.py index 62d6dcdda..bdd1b5089 100755 --- a/selfdrive/car/volkswagen/values.py +++ b/selfdrive/car/volkswagen/values.py @@ -4,9 +4,11 @@ from enum import Enum from typing import Dict, List, Union from cereal import car +from panda.python import uds from opendbc.can.can_define import CANDefine from selfdrive.car import dbc_dict from selfdrive.car.docs_definitions import CarFootnote, CarInfo, Column, Harness +from selfdrive.car.fw_query_definitions import FwQueryConfig, Request, p16 Ecu = car.CarParams.Ecu NetworkLocation = car.CarParams.NetworkLocation @@ -17,9 +19,7 @@ Button = namedtuple('Button', ['event_type', 'can_addr', 'can_msg', 'values']) class CarControllerParams: HCA_STEP = 2 # HCA_01/HCA_1 message frequency 50Hz - GRA_ACC_STEP = 3 # GRA_ACC_01/GRA_Neu message frequency 33Hz ACC_CONTROL_STEP = 2 # ACC_06/ACC_07/ACC_System frequency 50Hz - ACC_HUD_STEP = 4 # ACC_GRA_Anziege frequency 25Hz ACCEL_MAX = 2.0 # 2.0 m/s max acceleration ACCEL_MIN = -3.5 # 3.5 m/s max deceleration @@ -36,6 +36,7 @@ class CarControllerParams: if CP.carFingerprint in PQ_CARS: self.LDW_STEP = 5 # LDW_1 message frequency 20Hz + self.ACC_HUD_STEP = 4 # ACC_GRA_Anziege frequency 25Hz self.STEER_DRIVER_ALLOWANCE = 80 # Driver intervention threshold 0.8 Nm self.STEER_DELTA_UP = 6 # Max HCA reached in 1.00s (STEER_MAX / (50Hz * 1.00)) self.STEER_DELTA_DOWN = 10 # Min HCA reached in 0.60s (STEER_MAX / (50Hz * 0.60)) @@ -64,6 +65,7 @@ class CarControllerParams: else: self.LDW_STEP = 10 # LDW_02 message frequency 10Hz + self.ACC_HUD_STEP = 6 # ACC_02 message frequency 16Hz self.STEER_DRIVER_ALLOWANCE = 80 # Driver intervention threshold 0.8 Nm self.STEER_DELTA_UP = 4 # Max HCA reached in 1.50s (STEER_MAX / (50Hz * 1.50)) self.STEER_DELTA_DOWN = 10 # Min HCA reached in 0.60s (STEER_MAX / (50Hz * 0.60)) @@ -162,7 +164,7 @@ class Footnote(Enum): @dataclass class VWCarInfo(CarInfo): - package: str = "Driver Assistance" + package: str = "Adaptive Cruise Control (ACC) & Lane Assist" harness: Enum = Harness.vw @@ -214,13 +216,13 @@ CAR_INFO: Dict[str, Union[VWCarInfo, List[VWCarInfo]]] = { ], CAR.TROC_MK1: VWCarInfo("Volkswagen T-Roc 2021", footnotes=[Footnote.VW_HARNESS], harness=Harness.j533), CAR.AUDI_A3_MK3: [ - VWCarInfo("Audi A3 2014-19", "ACC + Lane Assist"), - VWCarInfo("Audi A3 Sportback e-tron 2017-18", "ACC + Lane Assist"), - VWCarInfo("Audi RS3 2018", "ACC + Lane Assist"), - VWCarInfo("Audi S3 2015-17", "ACC + Lane Assist"), + 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", "ACC + Lane Assist"), - CAR.AUDI_Q3_MK2: VWCarInfo("Audi Q3 2020-21", "ACC + Lane Assist"), + CAR.AUDI_Q2_MK1: VWCarInfo("Audi Q2 2018"), + CAR.AUDI_Q3_MK2: VWCarInfo("Audi Q3 2020-21"), CAR.SEAT_ATECA_MK1: VWCarInfo("SEAT Ateca 2018"), CAR.SEAT_LEON_MK3: VWCarInfo("SEAT Leon 2014-20"), CAR.SKODA_KAMIQ_MK1: VWCarInfo("Škoda Kamiq 2021", footnotes=[Footnote.KAMIQ]), @@ -243,6 +245,30 @@ CAR_INFO: Dict[str, Union[VWCarInfo, List[VWCarInfo]]] = { # ECU SW part numbers are invalid for vehicle ID and compatibility checks. Try to have # them repaired by the tuner before including them in openpilot. +VOLKSWAGEN_VERSION_REQUEST_MULTI = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER]) + \ + p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_SPARE_PART_NUMBER) + \ + p16(uds.DATA_IDENTIFIER_TYPE.VEHICLE_MANUFACTURER_ECU_SOFTWARE_VERSION_NUMBER) + \ + p16(uds.DATA_IDENTIFIER_TYPE.APPLICATION_DATA_IDENTIFICATION) +VOLKSWAGEN_VERSION_RESPONSE = bytes([uds.SERVICE_TYPE.READ_DATA_BY_IDENTIFIER + 0x40]) + +VOLKSWAGEN_RX_OFFSET = 0x6a + +FW_QUERY_CONFIG = FwQueryConfig( + requests=[ + Request( + [VOLKSWAGEN_VERSION_REQUEST_MULTI], + [VOLKSWAGEN_VERSION_RESPONSE], + whitelist_ecus=[Ecu.srs, Ecu.eps, Ecu.fwdRadar], + rx_offset=VOLKSWAGEN_RX_OFFSET, + ), + Request( + [VOLKSWAGEN_VERSION_REQUEST_MULTI], + [VOLKSWAGEN_VERSION_RESPONSE], + whitelist_ecus=[Ecu.engine, Ecu.transmission], + ), + ], +) + FW_VERSIONS = { CAR.ARTEON_MK1: { (Ecu.engine, 0x7e0, None): [ @@ -274,6 +300,7 @@ FW_VERSIONS = { (Ecu.engine, 0x7e0, None): [ b'\xf1\x8703H906026AA\xf1\x899970', b'\xf1\x8703H906026AJ\xf1\x890638', + b'\xf1\x8703H906026AJ\xf1\x891017', b'\xf1\x8703H906026AT\xf1\x891922', b'\xf1\x8703H906026BC\xf1\x892664', b'\xf1\x8703H906026F \xf1\x896696', @@ -748,6 +775,7 @@ FW_VERSIONS = { b'\xf1\x875G0906259L \xf1\x890002', b'\xf1\x875G0906259Q \xf1\x890002', b'\xf1\x878V0906259F \xf1\x890002', + b'\xf1\x878V0906259J \xf1\x890002', b'\xf1\x878V0906259K \xf1\x890001', b'\xf1\x878V0906264B \xf1\x890003', b'\xf1\x878V0907115B \xf1\x890007', @@ -766,6 +794,7 @@ FW_VERSIONS = { b'\xf1\x870DD300046F \xf1\x891602', b'\xf1\x870DD300046G \xf1\x891601', b'\xf1\x870DL300012E \xf1\x892012', + b'\xf1\x870GC300011 \xf1\x890403', b'\xf1\x870GC300013M \xf1\x892402', b'\xf1\x870GC300042J \xf1\x891402', ], @@ -773,6 +802,7 @@ FW_VERSIONS = { b'\xf1\x875Q0959655AB\xf1\x890388\xf1\x82\0211111001111111206110412111321139114', b'\xf1\x875Q0959655AM\xf1\x890315\xf1\x82\x1311111111111111311411011231129321212100', b'\xf1\x875Q0959655AM\xf1\x890318\xf1\x82\x1311111111111112311411011531159321212100', + b'\xf1\x875Q0959655AR\xf1\x890315\xf1\x82\x1311110011131115311211012331239321212100', b'\xf1\x875Q0959655BJ\xf1\x890339\xf1\x82\x1311110011131100311111011731179321342100', b'\xf1\x875Q0959655J \xf1\x890825\xf1\x82\x13111112111111--241115141112221291163221', b'\xf1\x875Q0959655J \xf1\x890825\xf1\x82\023111112111111--171115141112221291163221', @@ -783,6 +813,7 @@ FW_VERSIONS = { ], (Ecu.eps, 0x712, None): [ b'\xf1\x873Q0909144H \xf1\x895061\xf1\x82\00566G0HA14A1', + b'\xf1\x873Q0909144K \xf1\x895072\xf1\x82\x0571G01A16A1', b'\xf1\x873Q0909144K \xf1\x895072\xf1\x82\x0571G0HA16A1', b'\xf1\x873Q0909144L \xf1\x895081\xf1\x82\x0571G0JA14A1', b'\xf1\x875Q0909144AB\xf1\x891082\xf1\x82\00521G0G809A1', diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 501951176..e40e7dbd0 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -110,7 +110,7 @@ class Controls: ignore += ['driverCameraState', 'driverMonitoringState'] self.sm = messaging.SubMaster(['deviceState', 'pandaStates', 'peripheralState', 'modelV2', 'liveCalibration', 'driverMonitoringState', 'longitudinalPlan', 'lateralPlan', 'liveLocationKalman', - 'managerState', 'liveParameters', 'radarState', 'dragonConf'] + self.camera_packets + joystick_packet, + 'managerState', 'liveParameters', 'radarState', 'liveTorqueParameters', 'dragonConf'] + self.camera_packets + joystick_packet, ignore_alive=ignore, ignore_avg_freq=['radarState', 'longitudinalPlan', 'dragonConf']) # dp @@ -156,6 +156,11 @@ class Controls: put_nonblocking("CarParamsCache", cp_bytes) put_nonblocking("CarParamsPersistent", cp_bytes) + # cleanup old params + if not self.CP.experimentalLongitudinalAvailable: + params.remove("EndToEndLong") + params.remove("ExperimentalLongitudinalEnabled") + self.CC = car.CarControl.new_message() self.CS_prev = car.CarState.new_message() self.AM = AlertManager() @@ -165,7 +170,9 @@ class Controls: self.VM = VehicleModel(self.CP) self.LaC: LatControl - if params.get_bool("dp_lateral_lqr"): + if params.get_bool("dp_lateral_torque") and self.CP.lateralTuning.which() == 'torque': + self.LaC = LatControlTorque(self.CP, self.CI) + elif params.get_bool("dp_lateral_lqr") and self.CP.lateralTuning.which() == 'lqr': self.LaC = LatControlLQR(self.CP, self.CI) elif self.CP.steerControlType == car.CarParams.SteerControlType.angle: self.LaC = LatControlAngle(self.CP, self.CI) @@ -230,7 +237,7 @@ class Controls: controls_state = log.ControlsState.from_bytes(controls_state) self.v_cruise_kph = controls_state.vCruise - if self.sm['pandaStates'][0].controlsAllowed: + if any(ps.controlsAllowed for ps in self.sm['pandaStates']): self.state = State.enabled def update_events(self, CS): @@ -248,6 +255,10 @@ class Controls: self.events.add(EventName.controlsInitializing) return + # no more events while in dashcam mode + if self.read_only: + return + # Block resume if cruise never previously enabled resume_pressed = any(be.type in (ButtonType.accelCruise, ButtonType.resumeCruise) for be in CS.buttonEvents) if not self.CP.pcmCruise and self.v_cruise_kph == V_CRUISE_INITIAL and resume_pressed: @@ -325,7 +336,7 @@ class Controls: else: safety_mismatch = pandaState.safetyModel not in IGNORED_SAFETY_MODES - if safety_mismatch or self.mismatch_counter >= 200: + if safety_mismatch or pandaState.safetyRxChecksInvalid or self.mismatch_counter >= 200: self.events.add(EventName.controlsMismatch) if log.PandaState.FaultType.relayMalfunction in pandaState.faults: @@ -526,9 +537,9 @@ class Controls: self.soft_disable_timer = int(SOFT_DISABLE_TIME / DT_CTRL) self.current_alert_types.append(ET.SOFT_DISABLE) - elif self.events.any(ET.OVERRIDE): + elif self.events.any(ET.OVERRIDE_LATERAL) or self.events.any(ET.OVERRIDE_LONGITUDINAL): self.state = State.overriding - self.current_alert_types.append(ET.OVERRIDE) + self.current_alert_types += [ET.OVERRIDE_LATERAL, ET.OVERRIDE_LONGITUDINAL] # SOFT DISABLING elif self.state == State.softDisabling: @@ -558,10 +569,10 @@ class Controls: self.state = State.softDisabling self.soft_disable_timer = int(SOFT_DISABLE_TIME / DT_CTRL) self.current_alert_types.append(ET.SOFT_DISABLE) - elif not self.events.any(ET.OVERRIDE): + elif not (self.events.any(ET.OVERRIDE_LATERAL) or self.events.any(ET.OVERRIDE_LONGITUDINAL)): self.state = State.enabled else: - self.current_alert_types.append(ET.OVERRIDE) + self.current_alert_types += [ET.OVERRIDE_LATERAL, ET.OVERRIDE_LONGITUDINAL] # DISABLED elif self.state == State.disabled: @@ -572,7 +583,7 @@ class Controls: else: if self.events.any(ET.PRE_ENABLE): self.state = State.preEnabled - elif self.events.any(ET.OVERRIDE): + elif self.events.any(ET.OVERRIDE_LATERAL) or self.events.any(ET.OVERRIDE_LONGITUDINAL): self.state = State.overriding else: self.state = State.enabled @@ -596,6 +607,12 @@ class Controls: sr = max(params.steerRatio, 0.1) self.VM.update_params(x, sr) + # Update Torque Params + if self.CP.lateralTuning.which() == 'torque': + torque_params = self.sm['liveTorqueParameters'] + if self.sm.all_checks(['liveTorqueParameters']) and torque_params.useParams: + self.LaC.update_live_torque_params(torque_params.latAccelFactorFiltered, torque_params.latAccelOffsetFiltered, torque_params.frictionCoefficientFiltered) + lat_plan = self.sm['lateralPlan'] long_plan = self.sm['longitudinalPlan'] @@ -603,8 +620,8 @@ class Controls: CC.enabled = self.enabled # Check which actuators can be enabled CC.latActive = self.active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and \ - CS.vEgo > self.CP.minSteerSpeed and not CS.standstill - CC.longActive = self.active and not self.events.any(ET.OVERRIDE) and self.CP.openpilotLongitudinalControl + CS.vEgo > self.CP.minSteerSpeed and not CS.standstill + CC.longActive = self.active and not self.events.any(ET.OVERRIDE_LONGITUDINAL) and self.CP.openpilotLongitudinalControl if self.sm['dragonConf'].dpAtl == 2 and not CS.cruiseActualEnabled: CC.longActive = False @@ -733,7 +750,7 @@ class Controls: recent_blinker = (self.sm.frame - self.last_blinker_frame) * DT_CTRL < 5.0 # 5s blinker cooldown ldw_allowed = self.is_ldw_enabled and CS.vEgo > LDW_MIN_SPEED and not recent_blinker \ - and not CC.latActive and self.sm['liveCalibration'].calStatus == Calibration.CALIBRATED + and not CC.latActive and self.sm['liveCalibration'].calStatus == Calibration.CALIBRATED model_v2 = self.sm['modelV2'] desire_prediction = model_v2.meta.desirePrediction diff --git a/selfdrive/controls/lib/drive_helpers.py b/selfdrive/controls/lib/drive_helpers.py index 9d5d44cea..2cf7b09f9 100644 --- a/selfdrive/controls/lib/drive_helpers.py +++ b/selfdrive/controls/lib/drive_helpers.py @@ -133,10 +133,10 @@ def get_lag_adjusted_curvature(CP, v_ego, psis, curvatures, curvature_rates): desired_curvature_rate = curvature_rates[0] max_curvature_rate = MAX_LATERAL_JERK / (v_ego**2) # inexact calculation, check https://github.com/commaai/openpilot/pull/24755 safe_desired_curvature_rate = clip(desired_curvature_rate, - -max_curvature_rate, - max_curvature_rate) + -max_curvature_rate, + max_curvature_rate) safe_desired_curvature = clip(desired_curvature, - current_curvature_desired - max_curvature_rate * DT_MDL, - current_curvature_desired + max_curvature_rate * DT_MDL) + current_curvature_desired - max_curvature_rate * DT_MDL, + current_curvature_desired + max_curvature_rate * DT_MDL) return safe_desired_curvature, safe_desired_curvature_rate diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 6a645fc82..89e3b315e 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -36,7 +36,8 @@ class Priority(IntEnum): class ET: ENABLE = 'enable' PRE_ENABLE = 'preEnable' - OVERRIDE = 'override' + OVERRIDE_LATERAL = 'overrideLateral' + OVERRIDE_LONGITUDINAL = 'overrideLongitudinal' NO_ENTRY = 'noEntry' WARNING = 'warning' USER_DISABLE = 'userDisable' @@ -649,7 +650,15 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = { }, EventName.gasPressedOverride: { - ET.OVERRIDE: Alert( + ET.OVERRIDE_LONGITUDINAL: Alert( + "", + "", + AlertStatus.normal, AlertSize.none, + Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .1), + }, + + EventName.steerOverride: { + ET.OVERRIDE_LATERAL: Alert( "", "", AlertStatus.normal, AlertSize.none, @@ -968,7 +977,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = { # dp - use for atl alert EventName.communityFeatureDisallowedDEPRECATED: { - ET.OVERRIDE: Alert( + ET.OVERRIDE_LATERAL: Alert( "", "", AlertStatus.normal, AlertSize.none, diff --git a/selfdrive/controls/lib/latcontrol_torque.py b/selfdrive/controls/lib/latcontrol_torque.py index c4604d90e..fa1bb480f 100644 --- a/selfdrive/controls/lib/latcontrol_torque.py +++ b/selfdrive/controls/lib/latcontrol_torque.py @@ -4,7 +4,6 @@ from cereal import log from common.numpy_fast import interp from selfdrive.controls.lib.latcontrol import LatControl, MIN_STEER_SPEED from selfdrive.controls.lib.pid import PIDController -from selfdrive.controls.lib.drive_helpers import apply_deadzone from selfdrive.controls.lib.vehicle_model import ACCELERATION_DUE_TO_GRAVITY # At higher speeds (25+mph) we can assume: @@ -19,19 +18,20 @@ from selfdrive.controls.lib.vehicle_model import ACCELERATION_DUE_TO_GRAVITY # move it at all, this is compensated for too. -FRICTION_THRESHOLD = 0.2 - - class LatControlTorque(LatControl): def __init__(self, CP, CI): super().__init__(CP, CI) - self.pid = PIDController(CP.lateralTuning.torque.kp, CP.lateralTuning.torque.ki, - k_f=CP.lateralTuning.torque.kf, pos_limit=self.steer_max, neg_limit=-self.steer_max) - self.get_steer_feedforward = CI.get_steer_feedforward_function() - self.use_steering_angle = CP.lateralTuning.torque.useSteeringAngle - self.friction = CP.lateralTuning.torque.friction - self.kf = CP.lateralTuning.torque.kf - self.steering_angle_deadzone_deg = CP.lateralTuning.torque.steeringAngleDeadzoneDeg + self.torque_params = CP.lateralTuning.torque + self.pid = PIDController(self.torque_params.kp, self.torque_params.ki, + k_f=self.torque_params.kf, pos_limit=self.steer_max, neg_limit=-self.steer_max) + self.torque_from_lateral_accel = CI.torque_from_lateral_accel() + self.use_steering_angle = self.torque_params.useSteeringAngle + self.steering_angle_deadzone_deg = self.torque_params.steeringAngleDeadzoneDeg + + def update_live_torque_params(self, latAccelFactor, latAccelOffset, friction): + self.torque_params.latAccelFactor = latAccelFactor + self.torque_params.latAccelOffset = latAccelOffset + self.torque_params.friction = friction def update(self, active, CS, VM, params, last_actuators, steer_limited, desired_curvature, desired_curvature_rate, llk): pid_log = log.ControlsState.LateralTorqueState.new_message() @@ -51,23 +51,20 @@ class LatControlTorque(LatControl): desired_lateral_accel = desired_curvature * CS.vEgo ** 2 # desired rate is the desired rate of change in the setpoint, not the absolute desired curvature - #desired_lateral_jerk = desired_curvature_rate * CS.vEgo ** 2 + # desired_lateral_jerk = desired_curvature_rate * CS.vEgo ** 2 actual_lateral_accel = actual_curvature * CS.vEgo ** 2 lateral_accel_deadzone = curvature_deadzone * CS.vEgo ** 2 - low_speed_factor = interp(CS.vEgo, [0, 10, 20], [500, 500, 200]) setpoint = desired_lateral_accel + low_speed_factor * desired_curvature measurement = actual_lateral_accel + low_speed_factor * actual_curvature error = setpoint - measurement - pid_log.error = error + gravity_adjusted_lateral_accel = desired_lateral_accel - params.roll * ACCELERATION_DUE_TO_GRAVITY + pid_log.error = self.torque_from_lateral_accel(error, self.torque_params, error, lateral_accel_deadzone, friction_compensation=False) + ff = self.torque_from_lateral_accel(gravity_adjusted_lateral_accel, self.torque_params, error, lateral_accel_deadzone, friction_compensation=True) - ff = desired_lateral_accel - params.roll * ACCELERATION_DUE_TO_GRAVITY - # convert friction into lateral accel units for feedforward - friction_compensation = interp(apply_deadzone(error, lateral_accel_deadzone), [-FRICTION_THRESHOLD, FRICTION_THRESHOLD], [-self.friction, self.friction]) - ff += friction_compensation / self.kf freeze_integrator = steer_limited or CS.steeringPressed or CS.vEgo < 5 - output_torque = self.pid.update(error, + output_torque = self.pid.update(pid_log.error, feedforward=ff, speed=CS.vEgo, freeze_integrator=freeze_integrator) @@ -78,9 +75,9 @@ class LatControlTorque(LatControl): pid_log.d = self.pid.d pid_log.f = self.pid.f pid_log.output = -output_torque - pid_log.saturated = self._check_saturation(self.steer_max - abs(output_torque) < 1e-3, CS, steer_limited) pid_log.actualLateralAccel = actual_lateral_accel pid_log.desiredLateralAccel = desired_lateral_accel + pid_log.saturated = self._check_saturation(self.steer_max - abs(output_torque) < 1e-3, CS, steer_limited) # TODO left is positive in this convention return -output_torque, 0.0, pid_log diff --git a/selfdrive/controls/lib/lateral_planner.py b/selfdrive/controls/lib/lateral_planner.py index 09f0833e7..0a4ffd19f 100644 --- a/selfdrive/controls/lib/lateral_planner.py +++ b/selfdrive/controls/lib/lateral_planner.py @@ -27,8 +27,7 @@ class LateralPlanner: self.plan_curv_rate = np.zeros((TRAJECTORY_SIZE,)) self.t_idxs = np.arange(TRAJECTORY_SIZE) self.y_pts = np.zeros(TRAJECTORY_SIZE) - #dp: mf vision controller - #self.d_path_w_lines_xyz = np.zeros((TRAJECTORY_SIZE, 3)) + self.d_path_w_lines_xyz = np.zeros((TRAJECTORY_SIZE, 3)) self.lat_mpc = LateralMpc() self.reset_mpc(np.zeros(4)) @@ -119,8 +118,7 @@ class LateralPlanner: lateralPlan.laneChangeState = self.DH.lane_change_state lateralPlan.laneChangeDirection = self.DH.lane_change_direction - #dp: mf vts - #plan_send.lateralPlan.dPathWLinesX = [float(x) for x in self.d_path_w_lines_xyz[:, 0]] - #plan_send.lateralPlan.dPathWLinesY = [float(y) for y in self.d_path_w_lines_xyz[:, 1]] + plan_send.lateralPlan.dPathWLinesX = [float(x) for x in self.d_path_w_lines_xyz[:, 0]] + plan_send.lateralPlan.dPathWLinesY = [float(y) for y in self.d_path_w_lines_xyz[:, 1]] pm.send('lateralPlan', plan_send) diff --git a/selfdrive/controls/lib/longcontrol.py b/selfdrive/controls/lib/longcontrol.py index 082e7725d..db5bf4d3e 100644 --- a/selfdrive/controls/lib/longcontrol.py +++ b/selfdrive/controls/lib/longcontrol.py @@ -7,9 +7,6 @@ from selfdrive.modeld.constants import T_IDXS LongCtrlState = car.CarControl.Actuators.LongControlState -# As per ISO 15622:2018 for all speeds -ACCEL_MIN_ISO = -3.5 # m/s^2 -ACCEL_MAX_ISO = 2.0 # m/s^2 def long_control_state_trans(CP, active, long_control_state, v_ego, v_target, v_target_1sec, brake_pressed, cruise_standstill): @@ -50,10 +47,6 @@ def long_control_state_trans(CP, active, long_control_state, v_ego, v_target, elif started_condition: long_control_state = LongCtrlState.pid - - - - return long_control_state @@ -92,6 +85,7 @@ class LongControl: v_target_1sec = interp(self.CP.longitudinalActuatorDelayUpperBound + t_since_plan + 1.0, T_IDXS[:CONTROL_N], speeds) else: v_target = 0.0 + v_target_now = 0.0 v_target_1sec = 0.0 a_target = 0.0 @@ -132,7 +126,6 @@ class LongControl: feedforward=a_target, freeze_integrator=freeze_integrator) - self.last_output_accel = clip(output_accel, accel_limits[0], accel_limits[1]) return self.last_output_accel diff --git a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py index 3415dd6b0..70f1f51b6 100644 --- a/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py +++ b/selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py @@ -340,31 +340,14 @@ class LongitudinalMpc: self.cruise_min_a = min_a self.cruise_max_a = max_a - def update_TF(self, carstate): - if carstate.distanceLines == 1: # Traffic - # At slow speeds more time, decrease time up to 60mph - # in mph ~= 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 - x_vel = [0.0, 1, 2.78, 5.56, 8.33, 11.11, 13.89, 16.67, 19.44, 22.22, 25.0, 27.78, 30.56, 33.33, 36.11, 38.89, 41.67] - y_dist = [1.1, 1.15, 1.25, 1.3, 1.3368, 1.3368, 1.3, 1.24, 1.16, 1.2, 1.21, 1.22, 1.23, 1.24, 1.25, 1.26, 1.27] - self.desired_TF = np.interp(carstate.vEgo, x_vel, y_dist) - elif carstate.distanceLines == 2: # Relaxed - x_vel = [0.0, 1, 2.78, 5.56, 8.33, 11.11, 13.89, 16.67, 19.44, 22.22, 27.78, 30.56, 33.33, 36.11, 38.89, 41.67] - y_dist = [1.3, 1.38, 1.45, 1.5045, 1.535, 1.59, 1.642, 1.683, 1.726, 1.76, 1.83, 1.9, 1.99, 2.1, 2.23, 2.4] - self.desired_TF = np.interp(carstate.vEgo, x_vel, y_dist) - else: - #x_vel = [0.0, 1, 2.78, 5.56, 8.33, 11.11, 13.89, 16.67, 19.44, 22.22, 27.78, 30.56, 33.33, 36.11, 38.89, 41.67] - #y_dist = [1.3, 1.38, 1.45, 1.5045, 1.535, 1.59, 1.642, 1.683, 1.726, 1.76, 1.83, 1.9, 1.99, 2.1, 2.23, 2.4] - #self.desired_TF = np.interp(carstate.vEgo, x_vel, y_dist) - self.desired_TF = T_FOLLOW - - def update(self, carstate, radarstate, v_cruise, x, v, a, j, prev_accel_constraint): + def update(self, carstate, radarstate, v_cruise, x, v, a, j, prev_accel_constraint, desired_tf=T_FOLLOW): v_ego = self.x0[1] self.status = radarstate.leadOne.status or radarstate.leadTwo.status lead_xv_0 = self.process_lead(radarstate.leadOne) lead_xv_1 = self.process_lead(radarstate.leadTwo) - self.update_TF(carstate) + self.desired_TF = desired_tf self.set_weights(prev_accel_constraint=prev_accel_constraint, v_lead0=lead_xv_0[0,1], v_lead1=lead_xv_1[0,1]) # To estimate a safe distance from a moving lead, we calculate how much stopping @@ -375,7 +358,7 @@ class LongitudinalMpc: # Update in ACC mode or ACC/e2e blend if self.mode == 'acc': - self.params[:,0] = MIN_ACCEL if self.status else self.cruise_min_a + self.params[:,0] = MIN_ACCEL self.params[:,1] = self.cruise_max_a self.params[:,5] = LEAD_DANGER_FACTOR @@ -396,11 +379,12 @@ class LongitudinalMpc: elif self.mode == 'blended': self.params[:,0] = MIN_ACCEL self.params[:,1] = MAX_ACCEL + self.params[:,5] = 1.0 x_obstacles = np.column_stack([lead_0_obstacle, lead_1_obstacle]) - cruise_target = T_IDXS * v_cruise + x[0] + cruise_target = T_IDXS * np.clip(v_cruise, v_ego - 2.0, 1e3) + x[0] xforward = ((v[1:] + v[:-1]) / 2) * (T_IDXS[1:] - T_IDXS[:-1]) x = np.cumsum(np.insert(xforward, 0, x[0])) @@ -441,7 +425,6 @@ class LongitudinalMpc: self.source = 'lead1' - def update_with_xva(self, x, v, a): self.params[:,0] = -10. self.params[:,1] = 10. diff --git a/selfdrive/controls/lib/longitudinal_planner.py b/selfdrive/controls/lib/longitudinal_planner.py index 16f9e7292..2c680a8bf 100755 --- a/selfdrive/controls/lib/longitudinal_planner.py +++ b/selfdrive/controls/lib/longitudinal_planner.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import math import numpy as np -from common.numpy_fast import interp +from common.numpy_fast import clip, interp import cereal.messaging as messaging from common.conversions import Conversions as CV @@ -10,11 +10,11 @@ from common.params import Params from common.realtime import DT_MDL from selfdrive.modeld.constants import T_IDXS from selfdrive.controls.lib.longcontrol import LongCtrlState -from selfdrive.controls.lib.longitudinal_mpc_lib.long_mpc import LongitudinalMpc +from selfdrive.controls.lib.longitudinal_mpc_lib.long_mpc import LongitudinalMpc, T_FOLLOW from selfdrive.controls.lib.longitudinal_mpc_lib.long_mpc import T_IDXS as T_IDXS_MPC from selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX, CONTROL_N from system.swaglog import cloudlog -#from selfdrive.controls.lib.vision_turn_controller import VisionTurnController +from selfdrive.controls.lib.vision_turn_controller import VisionTurnController from selfdrive.controls.lib.speed_limit_controller import SpeedLimitController, SpeedLimitResolver from selfdrive.controls.lib.turn_speed_controller import TurnSpeedController from selfdrive.controls.lib.events import Events @@ -22,8 +22,8 @@ from selfdrive.controls.lib.events import Events LON_MPC_STEP = 0.2 # first step is 0.2s AWARENESS_DECEL = -0.2 # car smoothly decel at .2m/s^2 when user is distracted A_CRUISE_MIN = -1.2 -A_CRUISE_MAX_VALS = [1.2, 1.2, 0.8, 0.6] -A_CRUISE_MAX_BP = [0., 15., 25., 40.] +A_CRUISE_MAX_VALS = [1.6, 1.2, 0.8, 0.6] +A_CRUISE_MAX_BP = [0., 10.0, 25., 40.] # Lookup table for turns _A_TOTAL_MAX_V = [1.7, 3.2] @@ -41,16 +41,21 @@ DP_ACCEL_NORMAL = 1 DP_ACCEL_SPORT = 2 # accel profile by @arne182 modified by cgw -_DP_CRUISE_MIN_V = [-0.05, -0.1, -0.3, -0.4, -0.4, -0.23, -0.1] +_DP_CRUISE_MIN_V = [-0.1, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0] _DP_CRUISE_MIN_V_ECO = [-0.1, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0] -_DP_CRUISE_MIN_V_SPORT = [-0.1, -0.2, -0.4, -0.5, -0.5, -0.25, -0.1] -_DP_CRUISE_MIN_BP = [0.0, 3.0, 5.0, 20.0, 33.3, 40.0, 55.0] +_DP_CRUISE_MIN_V_SPORT = [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0] +_DP_CRUISE_MIN_BP = [0., 0.07, 6., 8., 11., 15., 20., 25., 30., 55.] _DP_CRUISE_MAX_V = [3.5, 1.7, 1.31, 0.95, 0.77, 0.67, 0.55, 0.47, 0.31, 0.13] _DP_CRUISE_MAX_V_ECO = [2.7, 1.4, 1.2, 0.7, 0.48, 0.35, 0.25, 0.15, 0.12, 0.06] _DP_CRUISE_MAX_V_SPORT = [3.5, 3.5, 2.5, 1.5, 2.0, 2.0, 2.0, 1.5, 1.0, 0.5] _DP_CRUISE_MAX_BP = [0., 3, 6., 8., 11., 15., 20., 25., 30., 55.] +# count n times before we decide a lead is there or not +_DP_E2E_LEAD_COUNT = 50 +# lead distance +_DP_E2E_LEAD_DIST = 60 + def dp_calc_cruise_accel_limits(v_ego, dp_profile): if dp_profile == DP_ACCEL_ECO: a_cruise_min = interp(v_ego, _DP_CRUISE_MIN_BP, _DP_CRUISE_MIN_V_ECO) @@ -84,6 +89,12 @@ def limit_accel_in_turns(v_ego, angle_steers, a_target, CP): class LongitudinalPlanner: def __init__(self, CP, init_v=0.0, init_a=0.0): + # dp - conditional e2e + self.dp_e2e_has_lead = False + self.dp_e2e_lead_last = False + self.dp_e2e_lead_count = 0 + self.dp_e2e_mode_last = 'acc' + self.CP = CP self.params = Params() self.param_read_counter = 0 @@ -105,8 +116,10 @@ class LongitudinalPlanner: # dp self.dp_accel_profile_ctrl = False self.dp_accel_profile = DP_ACCEL_ECO + self.dp_following_profile_ctrl = False + self.dp_following_profile = 0 self.cruise_source = 'cruise' - #self.vision_turn_controller = VisionTurnController(CP) + self.vision_turn_controller = VisionTurnController(CP) self.speed_limit_controller = SpeedLimitController() self.events = Events() self.turn_speed_controller = TurnSpeedController() @@ -115,6 +128,45 @@ class LongitudinalPlanner: e2e = self.params.get_bool('EndToEndLong') and self.CP.openpilotLongitudinalControl self.mpc.mode = 'blended' if e2e else 'acc' + # dp - conditional e2e + def conditional_e2e(self, standstill, within_speed_condition, e2e_lead, lead_rel_speed): + reset_state = False + + # lead counter + # to avoid lead comes and go too quickly causing mode switching too fast + # we count _DP_E2E_LEAD_COUNT before we update lead existence. + if e2e_lead != self.dp_e2e_lead_last: + self.dp_e2e_lead_count = 0 + else: + self.dp_e2e_lead_count += 1 + + # when lead status count > _DP_E2E_LEAD_COUNT, we update actual lead status + if self.dp_e2e_lead_count >= _DP_E2E_LEAD_COUNT: + self.dp_e2e_has_lead = e2e_lead + + dp_e2e_mode = 'acc' + # standstill uses e2e, to prevent lead suddenly move away. + if standstill: + dp_e2e_mode = 'blended' + else: + # lead is driving below 30 km/h + if self.dp_e2e_has_lead: + if lead_rel_speed <= 8.3: + dp_e2e_mode = 'blended' + else: + # within speed condition and does not have a lead, use e2e + if within_speed_condition: + dp_e2e_mode = 'blended' + + self.mpc.mode = dp_e2e_mode + if dp_e2e_mode != self.dp_e2e_mode_last: + reset_state = True + + self.dp_e2e_lead_last = e2e_lead + self.dp_e2e_mode_last = dp_e2e_mode + + return reset_state + def parse_model(self, model_msg): if (len(model_msg.position.x) == 33 and len(model_msg.velocity.x) == 33 and @@ -133,14 +185,45 @@ class LongitudinalPlanner: j = np.zeros(len(T_IDXS_MPC)) return x, v, a, j - def update(self, sm): - if self.param_read_counter % 50 == 0: - self.read_param() - self.param_read_counter += 1 + def get_df(self, v_ego): + desired_tf = T_FOLLOW + if self.dp_following_profile_ctrl and self.mpc.mode == 'acc': + if self.dp_following_profile == 0: + # At slow speeds more time, decrease time up to 60mph + # in kph ~= 0 20 40 50 70 80 90 150 + x_vel = [0, 5.56, 11.11, 13.89, 19.4, 22.2, 25.0, 41.67] + y_dist = [1.06, 1.2, 1.34, 1.34, 1.2, 1.25, 1.25, 1.33] + desired_tf = np.interp(v_ego, x_vel, y_dist) + elif self.dp_following_profile == 1: + # in kph ~= 0 20 40 50 70 90 150 + x_vel = [0, 5.56, 1.11, 13.89, 19.4, 25.0, 41.67] + y_dist = [1.3, 1.4, 1.45, 1.5, 1.5, 1.6, 1.8] + desired_tf = np.interp(v_ego, x_vel, y_dist) + elif self.dp_following_profile == 2: + # in kph ~= 0 20 40 50 90 150 + x_vel = [0, 5.56, 11.11, 13.89, 25.0, 41.67] + y_dist = [1.4, 1.55, 1.75, 1.95, 2.2, 2.4] + desired_tf = np.interp(v_ego, x_vel, y_dist) + return desired_tf + def update(self, sm): # dp self.dp_accel_profile_ctrl = sm['dragonConf'].dpAccelProfileCtrl self.dp_accel_profile = sm['dragonConf'].dpAccelProfile + self.dp_following_profile_ctrl = sm['dragonConf'].dpFollowingProfileCtrl + self.dp_following_profile = sm['dragonConf'].dpFollowingProfile + dp_reset_state = False + + if sm['dragonConf'].dpE2EConditional: + e2e_lead = sm['radarState'].leadOne.status and sm['radarState'].leadOne.dRel <= _DP_E2E_LEAD_DIST + within_speed_condition = sm['controlsState'].vCruise <= sm['dragonConf'].dpE2EConditionalAtSpeed + lead_rel_speed = sm['radarState'].leadOne.vRel + sm['carState'].vEgo + if self.conditional_e2e(sm['carState'].standstill, within_speed_condition, e2e_lead, lead_rel_speed): + dp_reset_state = True + else: + if self.param_read_counter % 50 == 0: + self.read_param() + self.param_read_counter += 1 v_ego = sm['carState'].vEgo v_cruise_kph = sm['controlsState'].vCruise @@ -156,9 +239,16 @@ class LongitudinalPlanner: # No change cost when user is controlling the speed, or when standstill prev_accel_constraint = not (reset_state or sm['carState'].standstill) - if reset_state: + if not self.dp_accel_profile_ctrl: + accel_limits = [A_CRUISE_MIN, get_max_accel(v_ego)] + else: + accel_limits = dp_calc_cruise_accel_limits(v_ego, self.dp_accel_profile) + accel_limits_turns = limit_accel_in_turns(v_ego, sm['carState'].steeringAngleDeg, accel_limits, self.CP) + + if reset_state or dp_reset_state: self.v_desired_filter.x = v_ego - self.a_desired = 0.0 + # Clip aEgo to cruise limits to prevent large accelerations when becoming active + self.a_desired = clip(sm['carState'].aEgo, accel_limits[0], accel_limits[1]) # Prevent divergence, smooth in current v_ego self.v_desired_filter.x = max(0.0, self.v_desired_filter.update(v_ego)) @@ -167,11 +257,6 @@ class LongitudinalPlanner: self.cruise_source, a_min_sol, v_cruise_sol = self.cruise_solutions(not reset_state, self.v_desired_filter.x, self.a_desired, v_cruise, sm) - if not self.dp_accel_profile_ctrl: - accel_limits = [A_CRUISE_MIN, get_max_accel(v_ego)] - else: - accel_limits = dp_calc_cruise_accel_limits(v_ego, self.dp_accel_profile) - accel_limits_turns = limit_accel_in_turns(v_ego, sm['carState'].steeringAngleDeg, accel_limits, self.CP) if force_slow_decel: # if required so, force a smooth deceleration accel_limits_turns[1] = min(accel_limits_turns[1], AWARENESS_DECEL) @@ -184,7 +269,7 @@ class LongitudinalPlanner: self.mpc.set_accel_limits(accel_limits_turns[0], accel_limits_turns[1]) self.mpc.set_cur_state(self.v_desired_filter.x, self.a_desired) x, v, a, j = self.parse_model(sm['modelV2']) - self.mpc.update(sm['carState'], sm['radarState'], v_cruise_sol, x, v, a, j, prev_accel_constraint) + self.mpc.update(sm['carState'], sm['radarState'], v_cruise_sol, x, v, a, j, prev_accel_constraint, self.get_df(v_ego)) self.v_desired_trajectory = np.interp(T_IDXS[:CONTROL_N], T_IDXS_MPC, self.mpc.v_solution) self.a_desired_trajectory = np.interp(T_IDXS[:CONTROL_N], T_IDXS_MPC, self.mpc.a_solution) @@ -220,9 +305,8 @@ class LongitudinalPlanner: longitudinalPlan.solverExecutionTime = self.mpc.solve_time - #dp: mf modules - #longitudinalPlan.visionTurnControllerState = self.vision_turn_controller.state - #longitudinalPlan.visionTurnSpeed = float(self.vision_turn_controller.v_turn) + longitudinalPlan.visionTurnControllerState = self.vision_turn_controller.state + longitudinalPlan.visionTurnSpeed = float(self.vision_turn_controller.v_turn) longitudinalPlan.speedLimitControlState = self.speed_limit_controller.state longitudinalPlan.speedLimit = float(self.speed_limit_controller.speed_limit) @@ -236,11 +320,13 @@ class LongitudinalPlanner: longitudinalPlan.distToTurn = float(self.turn_speed_controller.distance) longitudinalPlan.turnSign = int(self.turn_speed_controller.turn_sign) + longitudinalPlan.dpE2EIsBlended = self.mpc.mode == 'blended' + pm.send('longitudinalPlan', plan_send) def cruise_solutions(self, enabled, v_ego, a_ego, v_cruise, sm): # Update controllers - #self.vision_turn_controller.update(enabled, v_ego, a_ego, v_cruise, sm) + self.vision_turn_controller.update(enabled, v_ego, a_ego, v_cruise, sm) self.events = Events() self.speed_limit_controller.update(enabled, v_ego, a_ego, sm, v_cruise, self.events) self.turn_speed_controller.update(enabled, v_ego, a_ego, sm) @@ -249,9 +335,9 @@ class LongitudinalPlanner: a_solutions = {'cruise': float("inf")} v_solutions = {'cruise': v_cruise} - #if self.vision_turn_controller.is_active: - # a_solutions['turn'] = self.vision_turn_controller.a_target - # v_solutions['turn'] = self.vision_turn_controller.v_turn + if self.vision_turn_controller.is_active: + a_solutions['turn'] = self.vision_turn_controller.a_target + v_solutions['turn'] = self.vision_turn_controller.v_turn if self.speed_limit_controller.is_active: a_solutions['limit'] = self.speed_limit_controller.a_target diff --git a/selfdrive/controls/lib/radar_helpers.py b/selfdrive/controls/lib/radar_helpers.py index 0e2b96668..bf788190c 100644 --- a/selfdrive/controls/lib/radar_helpers.py +++ b/selfdrive/controls/lib/radar_helpers.py @@ -2,8 +2,7 @@ from common.numpy_fast import mean from common.kalman.simple_kalman import KF1D -# the longer lead decels, the more likely it will keep decelerating -# TODO is this a good default? +# Default lead acceleration decay set to 50% at 1s _LEAD_ACCEL_TAU = 1.5 # radar tracks diff --git a/selfdrive/controls/lib/vision_turn_controller.py b/selfdrive/controls/lib/vision_turn_controller.py index 291850c05..12048cf4b 100644 --- a/selfdrive/controls/lib/vision_turn_controller.py +++ b/selfdrive/controls/lib/vision_turn_controller.py @@ -5,7 +5,7 @@ from common.numpy_fast import interp from common.params import Params from common.realtime import sec_since_boot from common.conversions import Conversions as CV -from selfdrive.controls.lib.lane_planner import TRAJECTORY_SIZE +from selfdrive.controls.lib.lateral_planner import TRAJECTORY_SIZE from selfdrive.controls.lib.drive_helpers import V_CRUISE_MAX diff --git a/selfdrive/debug/check_freq.py b/selfdrive/debug/check_freq.py index b6f3c91bd..6436abb4f 100755 --- a/selfdrive/debug/check_freq.py +++ b/selfdrive/debug/check_freq.py @@ -2,7 +2,7 @@ import argparse import numpy as np from collections import defaultdict, deque -from typing import DefaultDict, Deque +from typing import DefaultDict, Deque, MutableSequence from common.realtime import sec_since_boot import cereal.messaging as messaging @@ -19,7 +19,7 @@ if __name__ == "__main__": socket_names = args.socket sockets = {} - rcv_times: DefaultDict[str, Deque[float]] = 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 = sec_since_boot() diff --git a/selfdrive/debug/vw_mqb_config.py b/selfdrive/debug/vw_mqb_config.py index c55a05815..c1068bf06 100755 --- a/selfdrive/debug/vw_mqb_config.py +++ b/selfdrive/debug/vw_mqb_config.py @@ -67,20 +67,30 @@ if __name__ == "__main__": print("Timeout fetching data from EPS") quit() - coding_variant, current_coding_array = None, None + coding_variant, current_coding_array, coding_byte, coding_bit = None, None, 0, 0 + coding_length = len(current_coding) + # EV_SteerAssisMQB covers the majority of MQB racks (EPS_MQB_ZFLS) - # APA racks (MQB_PP_APA) have a different coding layout, which should - # be easy to support once we identify the specific config bit if odx_file == "EV_SteerAssisMQB\x00": coding_variant = "ZF" - current_coding_array = struct.unpack("!4B", current_coding) - hca_enabled = (current_coding_array[0] & (1 << 4) != 0) - hca_text = ("DISABLED", "ENABLED")[hca_enabled] - print(f" Lane Assist: {hca_text}") + coding_byte = 0 + coding_bit = 4 + + # APA racks (MQB_PP_APA) have a different coding layout + elif odx_file == "EV_SteerAssisVWBSMQBA\x00\x00\x00\x00": + coding_variant = "APA" + coding_byte = 3 + coding_bit = 0 + else: print("Configuration changes not yet supported on this EPS!") quit() + current_coding_array = struct.unpack(f"!{coding_length}B", current_coding) + hca_enabled = (current_coding_array[coding_byte] & (1 << coding_bit) != 0) + hca_text = ("DISABLED", "ENABLED")[hca_enabled] + print(f" Lane Assist: {hca_text}") + try: params = uds_client.read_data_by_identifier(DATA_IDENTIFIER_TYPE.APPLICATION_DATA_IDENTIFICATION).decode("utf-8") param_version_system_params = params[1:3] @@ -101,14 +111,14 @@ if __name__ == "__main__": if args.action in ["enable", "disable"]: print("\nAttempting configuration update") - assert(coding_variant == "ZF") # revisit when we have the APA rack coding bit + assert(coding_variant in ("ZF", "APA")) # ZF EPS config coding length can be anywhere from 1 to 4 bytes, but the # bit we care about is always in the same place in the first byte if args.action == "enable": - new_byte_0 = current_coding_array[0] | (1 << 4) + new_byte = current_coding_array[coding_byte] | (1 << coding_bit) else: - new_byte_0 = current_coding_array[0] & ~(1 << 4) - new_coding = new_byte_0.to_bytes(1, "little") + current_coding[1:] + new_byte = current_coding_array[coding_byte] & ~(1 << coding_bit) + new_coding = current_coding[0:coding_byte] + new_byte.to_bytes(1, "little") + current_coding[coding_byte+1:] try: seed = uds_client.security_access(ACCESS_TYPE_LEVEL_1.REQUEST_SEED) # type: ignore diff --git a/selfdrive/locationd/locationd b/selfdrive/locationd/locationd index 85b03f781..6be93d4a2 100755 Binary files a/selfdrive/locationd/locationd and b/selfdrive/locationd/locationd differ diff --git a/selfdrive/locationd/locationd.h b/selfdrive/locationd/locationd.h index 7c0cb6b7f..b5f8e5f1a 100755 --- a/selfdrive/locationd/locationd.h +++ b/selfdrive/locationd/locationd.h @@ -46,6 +46,7 @@ public: void handle_msg_bytes(const char *data, const size_t size); void handle_msg(const cereal::Event::Reader& log); void handle_sensors(double current_time, const capnp::List::Reader& log); + //void handle_sensor(double current_time, const cereal::SensorEventData::Reader& log); void handle_gps(double current_time, const cereal::GpsLocationData::Reader& log); void handle_car_state(double current_time, const cereal::CarState::Reader& log); void handle_cam_odo(double current_time, const cereal::CameraOdometry::Reader& log); diff --git a/selfdrive/locationd/models/generated/car.cpp b/selfdrive/locationd/models/generated/car.cpp index 1fc6c058d..3af210ec9 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_6920520309618378367) { - out_6920520309618378367[0] = delta_x[0] + nom_x[0]; - out_6920520309618378367[1] = delta_x[1] + nom_x[1]; - out_6920520309618378367[2] = delta_x[2] + nom_x[2]; - out_6920520309618378367[3] = delta_x[3] + nom_x[3]; - out_6920520309618378367[4] = delta_x[4] + nom_x[4]; - out_6920520309618378367[5] = delta_x[5] + nom_x[5]; - out_6920520309618378367[6] = delta_x[6] + nom_x[6]; - out_6920520309618378367[7] = delta_x[7] + nom_x[7]; - out_6920520309618378367[8] = delta_x[8] + nom_x[8]; +void err_fun(double *nom_x, double *delta_x, double *out_5662953649758416364) { + out_5662953649758416364[0] = delta_x[0] + nom_x[0]; + out_5662953649758416364[1] = delta_x[1] + nom_x[1]; + out_5662953649758416364[2] = delta_x[2] + nom_x[2]; + out_5662953649758416364[3] = delta_x[3] + nom_x[3]; + out_5662953649758416364[4] = delta_x[4] + nom_x[4]; + out_5662953649758416364[5] = delta_x[5] + nom_x[5]; + out_5662953649758416364[6] = delta_x[6] + nom_x[6]; + out_5662953649758416364[7] = delta_x[7] + nom_x[7]; + out_5662953649758416364[8] = delta_x[8] + nom_x[8]; } -void inv_err_fun(double *nom_x, double *true_x, double *out_5302696854806540781) { - out_5302696854806540781[0] = -nom_x[0] + true_x[0]; - out_5302696854806540781[1] = -nom_x[1] + true_x[1]; - out_5302696854806540781[2] = -nom_x[2] + true_x[2]; - out_5302696854806540781[3] = -nom_x[3] + true_x[3]; - out_5302696854806540781[4] = -nom_x[4] + true_x[4]; - out_5302696854806540781[5] = -nom_x[5] + true_x[5]; - out_5302696854806540781[6] = -nom_x[6] + true_x[6]; - out_5302696854806540781[7] = -nom_x[7] + true_x[7]; - out_5302696854806540781[8] = -nom_x[8] + true_x[8]; +void inv_err_fun(double *nom_x, double *true_x, double *out_2896900801310648034) { + out_2896900801310648034[0] = -nom_x[0] + true_x[0]; + out_2896900801310648034[1] = -nom_x[1] + true_x[1]; + out_2896900801310648034[2] = -nom_x[2] + true_x[2]; + out_2896900801310648034[3] = -nom_x[3] + true_x[3]; + out_2896900801310648034[4] = -nom_x[4] + true_x[4]; + out_2896900801310648034[5] = -nom_x[5] + true_x[5]; + out_2896900801310648034[6] = -nom_x[6] + true_x[6]; + out_2896900801310648034[7] = -nom_x[7] + true_x[7]; + out_2896900801310648034[8] = -nom_x[8] + true_x[8]; } -void H_mod_fun(double *state, double *out_4449921069090285960) { - out_4449921069090285960[0] = 1.0; - out_4449921069090285960[1] = 0; - out_4449921069090285960[2] = 0; - out_4449921069090285960[3] = 0; - out_4449921069090285960[4] = 0; - out_4449921069090285960[5] = 0; - out_4449921069090285960[6] = 0; - out_4449921069090285960[7] = 0; - out_4449921069090285960[8] = 0; - out_4449921069090285960[9] = 0; - out_4449921069090285960[10] = 1.0; - out_4449921069090285960[11] = 0; - out_4449921069090285960[12] = 0; - out_4449921069090285960[13] = 0; - out_4449921069090285960[14] = 0; - out_4449921069090285960[15] = 0; - out_4449921069090285960[16] = 0; - out_4449921069090285960[17] = 0; - out_4449921069090285960[18] = 0; - out_4449921069090285960[19] = 0; - out_4449921069090285960[20] = 1.0; - out_4449921069090285960[21] = 0; - out_4449921069090285960[22] = 0; - out_4449921069090285960[23] = 0; - out_4449921069090285960[24] = 0; - out_4449921069090285960[25] = 0; - out_4449921069090285960[26] = 0; - out_4449921069090285960[27] = 0; - out_4449921069090285960[28] = 0; - out_4449921069090285960[29] = 0; - out_4449921069090285960[30] = 1.0; - out_4449921069090285960[31] = 0; - out_4449921069090285960[32] = 0; - out_4449921069090285960[33] = 0; - out_4449921069090285960[34] = 0; - out_4449921069090285960[35] = 0; - out_4449921069090285960[36] = 0; - out_4449921069090285960[37] = 0; - out_4449921069090285960[38] = 0; - out_4449921069090285960[39] = 0; - out_4449921069090285960[40] = 1.0; - out_4449921069090285960[41] = 0; - out_4449921069090285960[42] = 0; - out_4449921069090285960[43] = 0; - out_4449921069090285960[44] = 0; - out_4449921069090285960[45] = 0; - out_4449921069090285960[46] = 0; - out_4449921069090285960[47] = 0; - out_4449921069090285960[48] = 0; - out_4449921069090285960[49] = 0; - out_4449921069090285960[50] = 1.0; - out_4449921069090285960[51] = 0; - out_4449921069090285960[52] = 0; - out_4449921069090285960[53] = 0; - out_4449921069090285960[54] = 0; - out_4449921069090285960[55] = 0; - out_4449921069090285960[56] = 0; - out_4449921069090285960[57] = 0; - out_4449921069090285960[58] = 0; - out_4449921069090285960[59] = 0; - out_4449921069090285960[60] = 1.0; - out_4449921069090285960[61] = 0; - out_4449921069090285960[62] = 0; - out_4449921069090285960[63] = 0; - out_4449921069090285960[64] = 0; - out_4449921069090285960[65] = 0; - out_4449921069090285960[66] = 0; - out_4449921069090285960[67] = 0; - out_4449921069090285960[68] = 0; - out_4449921069090285960[69] = 0; - out_4449921069090285960[70] = 1.0; - out_4449921069090285960[71] = 0; - out_4449921069090285960[72] = 0; - out_4449921069090285960[73] = 0; - out_4449921069090285960[74] = 0; - out_4449921069090285960[75] = 0; - out_4449921069090285960[76] = 0; - out_4449921069090285960[77] = 0; - out_4449921069090285960[78] = 0; - out_4449921069090285960[79] = 0; - out_4449921069090285960[80] = 1.0; +void H_mod_fun(double *state, double *out_6763768597135270784) { + out_6763768597135270784[0] = 1.0; + out_6763768597135270784[1] = 0; + out_6763768597135270784[2] = 0; + out_6763768597135270784[3] = 0; + out_6763768597135270784[4] = 0; + out_6763768597135270784[5] = 0; + out_6763768597135270784[6] = 0; + out_6763768597135270784[7] = 0; + out_6763768597135270784[8] = 0; + out_6763768597135270784[9] = 0; + out_6763768597135270784[10] = 1.0; + out_6763768597135270784[11] = 0; + out_6763768597135270784[12] = 0; + out_6763768597135270784[13] = 0; + out_6763768597135270784[14] = 0; + out_6763768597135270784[15] = 0; + out_6763768597135270784[16] = 0; + out_6763768597135270784[17] = 0; + out_6763768597135270784[18] = 0; + out_6763768597135270784[19] = 0; + out_6763768597135270784[20] = 1.0; + out_6763768597135270784[21] = 0; + out_6763768597135270784[22] = 0; + out_6763768597135270784[23] = 0; + out_6763768597135270784[24] = 0; + out_6763768597135270784[25] = 0; + out_6763768597135270784[26] = 0; + out_6763768597135270784[27] = 0; + out_6763768597135270784[28] = 0; + out_6763768597135270784[29] = 0; + out_6763768597135270784[30] = 1.0; + out_6763768597135270784[31] = 0; + out_6763768597135270784[32] = 0; + out_6763768597135270784[33] = 0; + out_6763768597135270784[34] = 0; + out_6763768597135270784[35] = 0; + out_6763768597135270784[36] = 0; + out_6763768597135270784[37] = 0; + out_6763768597135270784[38] = 0; + out_6763768597135270784[39] = 0; + out_6763768597135270784[40] = 1.0; + out_6763768597135270784[41] = 0; + out_6763768597135270784[42] = 0; + out_6763768597135270784[43] = 0; + out_6763768597135270784[44] = 0; + out_6763768597135270784[45] = 0; + out_6763768597135270784[46] = 0; + out_6763768597135270784[47] = 0; + out_6763768597135270784[48] = 0; + out_6763768597135270784[49] = 0; + out_6763768597135270784[50] = 1.0; + out_6763768597135270784[51] = 0; + out_6763768597135270784[52] = 0; + out_6763768597135270784[53] = 0; + out_6763768597135270784[54] = 0; + out_6763768597135270784[55] = 0; + out_6763768597135270784[56] = 0; + out_6763768597135270784[57] = 0; + out_6763768597135270784[58] = 0; + out_6763768597135270784[59] = 0; + out_6763768597135270784[60] = 1.0; + out_6763768597135270784[61] = 0; + out_6763768597135270784[62] = 0; + out_6763768597135270784[63] = 0; + out_6763768597135270784[64] = 0; + out_6763768597135270784[65] = 0; + out_6763768597135270784[66] = 0; + out_6763768597135270784[67] = 0; + out_6763768597135270784[68] = 0; + out_6763768597135270784[69] = 0; + out_6763768597135270784[70] = 1.0; + out_6763768597135270784[71] = 0; + out_6763768597135270784[72] = 0; + out_6763768597135270784[73] = 0; + out_6763768597135270784[74] = 0; + out_6763768597135270784[75] = 0; + out_6763768597135270784[76] = 0; + out_6763768597135270784[77] = 0; + out_6763768597135270784[78] = 0; + out_6763768597135270784[79] = 0; + out_6763768597135270784[80] = 1.0; } -void f_fun(double *state, double dt, double *out_7814524287760230042) { - out_7814524287760230042[0] = state[0]; - out_7814524287760230042[1] = state[1]; - out_7814524287760230042[2] = state[2]; - out_7814524287760230042[3] = state[3]; - out_7814524287760230042[4] = state[4]; - out_7814524287760230042[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_7814524287760230042[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_7814524287760230042[7] = state[7]; - out_7814524287760230042[8] = state[8]; +void f_fun(double *state, double dt, double *out_7014559889233024887) { + out_7014559889233024887[0] = state[0]; + out_7014559889233024887[1] = state[1]; + out_7014559889233024887[2] = state[2]; + out_7014559889233024887[3] = state[3]; + out_7014559889233024887[4] = state[4]; + out_7014559889233024887[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_7014559889233024887[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_7014559889233024887[7] = state[7]; + out_7014559889233024887[8] = state[8]; } -void F_fun(double *state, double dt, double *out_411706590768419199) { - out_411706590768419199[0] = 1; - out_411706590768419199[1] = 0; - out_411706590768419199[2] = 0; - out_411706590768419199[3] = 0; - out_411706590768419199[4] = 0; - out_411706590768419199[5] = 0; - out_411706590768419199[6] = 0; - out_411706590768419199[7] = 0; - out_411706590768419199[8] = 0; - out_411706590768419199[9] = 0; - out_411706590768419199[10] = 1; - out_411706590768419199[11] = 0; - out_411706590768419199[12] = 0; - out_411706590768419199[13] = 0; - out_411706590768419199[14] = 0; - out_411706590768419199[15] = 0; - out_411706590768419199[16] = 0; - out_411706590768419199[17] = 0; - out_411706590768419199[18] = 0; - out_411706590768419199[19] = 0; - out_411706590768419199[20] = 1; - out_411706590768419199[21] = 0; - out_411706590768419199[22] = 0; - out_411706590768419199[23] = 0; - out_411706590768419199[24] = 0; - out_411706590768419199[25] = 0; - out_411706590768419199[26] = 0; - out_411706590768419199[27] = 0; - out_411706590768419199[28] = 0; - out_411706590768419199[29] = 0; - out_411706590768419199[30] = 1; - out_411706590768419199[31] = 0; - out_411706590768419199[32] = 0; - out_411706590768419199[33] = 0; - out_411706590768419199[34] = 0; - out_411706590768419199[35] = 0; - out_411706590768419199[36] = 0; - out_411706590768419199[37] = 0; - out_411706590768419199[38] = 0; - out_411706590768419199[39] = 0; - out_411706590768419199[40] = 1; - out_411706590768419199[41] = 0; - out_411706590768419199[42] = 0; - out_411706590768419199[43] = 0; - out_411706590768419199[44] = 0; - out_411706590768419199[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_411706590768419199[46] = -dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*pow(state[1], 2)); - out_411706590768419199[47] = -dt*stiffness_front*state[0]/(mass*state[1]); - out_411706590768419199[48] = -dt*stiffness_front*state[0]/(mass*state[1]); - out_411706590768419199[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_411706590768419199[50] = dt*(-stiffness_front*state[0] - stiffness_rear*state[0])/(mass*state[4]) + 1; - out_411706590768419199[51] = dt*(-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4])); - out_411706590768419199[52] = dt*stiffness_front*state[0]/(mass*state[1]); - out_411706590768419199[53] = -9.8000000000000007*dt; - out_411706590768419199[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_411706590768419199[55] = -center_to_front*dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*pow(state[1], 2)); - out_411706590768419199[56] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); - out_411706590768419199[57] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); - out_411706590768419199[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_411706590768419199[59] = dt*(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(rotational_inertia*state[4]); - out_411706590768419199[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_411706590768419199[61] = center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); - out_411706590768419199[62] = 0; - out_411706590768419199[63] = 0; - out_411706590768419199[64] = 0; - out_411706590768419199[65] = 0; - out_411706590768419199[66] = 0; - out_411706590768419199[67] = 0; - out_411706590768419199[68] = 0; - out_411706590768419199[69] = 0; - out_411706590768419199[70] = 1; - out_411706590768419199[71] = 0; - out_411706590768419199[72] = 0; - out_411706590768419199[73] = 0; - out_411706590768419199[74] = 0; - out_411706590768419199[75] = 0; - out_411706590768419199[76] = 0; - out_411706590768419199[77] = 0; - out_411706590768419199[78] = 0; - out_411706590768419199[79] = 0; - out_411706590768419199[80] = 1; +void F_fun(double *state, double dt, double *out_2749676980229268459) { + out_2749676980229268459[0] = 1; + out_2749676980229268459[1] = 0; + out_2749676980229268459[2] = 0; + out_2749676980229268459[3] = 0; + out_2749676980229268459[4] = 0; + out_2749676980229268459[5] = 0; + out_2749676980229268459[6] = 0; + out_2749676980229268459[7] = 0; + out_2749676980229268459[8] = 0; + out_2749676980229268459[9] = 0; + out_2749676980229268459[10] = 1; + out_2749676980229268459[11] = 0; + out_2749676980229268459[12] = 0; + out_2749676980229268459[13] = 0; + out_2749676980229268459[14] = 0; + out_2749676980229268459[15] = 0; + out_2749676980229268459[16] = 0; + out_2749676980229268459[17] = 0; + out_2749676980229268459[18] = 0; + out_2749676980229268459[19] = 0; + out_2749676980229268459[20] = 1; + out_2749676980229268459[21] = 0; + out_2749676980229268459[22] = 0; + out_2749676980229268459[23] = 0; + out_2749676980229268459[24] = 0; + out_2749676980229268459[25] = 0; + out_2749676980229268459[26] = 0; + out_2749676980229268459[27] = 0; + out_2749676980229268459[28] = 0; + out_2749676980229268459[29] = 0; + out_2749676980229268459[30] = 1; + out_2749676980229268459[31] = 0; + out_2749676980229268459[32] = 0; + out_2749676980229268459[33] = 0; + out_2749676980229268459[34] = 0; + out_2749676980229268459[35] = 0; + out_2749676980229268459[36] = 0; + out_2749676980229268459[37] = 0; + out_2749676980229268459[38] = 0; + out_2749676980229268459[39] = 0; + out_2749676980229268459[40] = 1; + out_2749676980229268459[41] = 0; + out_2749676980229268459[42] = 0; + out_2749676980229268459[43] = 0; + out_2749676980229268459[44] = 0; + out_2749676980229268459[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_2749676980229268459[46] = -dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*pow(state[1], 2)); + out_2749676980229268459[47] = -dt*stiffness_front*state[0]/(mass*state[1]); + out_2749676980229268459[48] = -dt*stiffness_front*state[0]/(mass*state[1]); + out_2749676980229268459[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_2749676980229268459[50] = dt*(-stiffness_front*state[0] - stiffness_rear*state[0])/(mass*state[4]) + 1; + out_2749676980229268459[51] = dt*(-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4])); + out_2749676980229268459[52] = dt*stiffness_front*state[0]/(mass*state[1]); + out_2749676980229268459[53] = -9.8000000000000007*dt; + out_2749676980229268459[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_2749676980229268459[55] = -center_to_front*dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*pow(state[1], 2)); + out_2749676980229268459[56] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); + out_2749676980229268459[57] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); + out_2749676980229268459[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_2749676980229268459[59] = dt*(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(rotational_inertia*state[4]); + out_2749676980229268459[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_2749676980229268459[61] = center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]); + out_2749676980229268459[62] = 0; + out_2749676980229268459[63] = 0; + out_2749676980229268459[64] = 0; + out_2749676980229268459[65] = 0; + out_2749676980229268459[66] = 0; + out_2749676980229268459[67] = 0; + out_2749676980229268459[68] = 0; + out_2749676980229268459[69] = 0; + out_2749676980229268459[70] = 1; + out_2749676980229268459[71] = 0; + out_2749676980229268459[72] = 0; + out_2749676980229268459[73] = 0; + out_2749676980229268459[74] = 0; + out_2749676980229268459[75] = 0; + out_2749676980229268459[76] = 0; + out_2749676980229268459[77] = 0; + out_2749676980229268459[78] = 0; + out_2749676980229268459[79] = 0; + out_2749676980229268459[80] = 1; } -void h_25(double *state, double *unused, double *out_624214668376866341) { - out_624214668376866341[0] = state[6]; +void h_25(double *state, double *unused, double *out_722690739429382572) { + out_722690739429382572[0] = state[6]; } -void H_25(double *state, double *unused, double *out_4996036056466787679) { - out_4996036056466787679[0] = 0; - out_4996036056466787679[1] = 0; - out_4996036056466787679[2] = 0; - out_4996036056466787679[3] = 0; - out_4996036056466787679[4] = 0; - out_4996036056466787679[5] = 0; - out_4996036056466787679[6] = 1; - out_4996036056466787679[7] = 0; - out_4996036056466787679[8] = 0; +void H_25(double *state, double *unused, double *out_209301010503276110) { + out_209301010503276110[0] = 0; + out_209301010503276110[1] = 0; + out_209301010503276110[2] = 0; + out_209301010503276110[3] = 0; + out_209301010503276110[4] = 0; + out_209301010503276110[5] = 0; + out_209301010503276110[6] = 1; + out_209301010503276110[7] = 0; + out_209301010503276110[8] = 0; } -void h_24(double *state, double *unused, double *out_7726624714175041949) { - out_7726624714175041949[0] = state[4]; - out_7726624714175041949[1] = state[5]; +void h_24(double *state, double *unused, double *out_1099225576319256647) { + out_1099225576319256647[0] = state[4]; + out_1099225576319256647[1] = state[5]; } -void H_24(double *state, double *unused, double *out_8630386512586775674) { - out_8630386512586775674[0] = 0; - out_8630386512586775674[1] = 0; - out_8630386512586775674[2] = 0; - out_8630386512586775674[3] = 0; - out_8630386512586775674[4] = 1; - out_8630386512586775674[5] = 0; - out_8630386512586775674[6] = 0; - out_8630386512586775674[7] = 0; - out_8630386512586775674[8] = 0; - out_8630386512586775674[9] = 0; - out_8630386512586775674[10] = 0; - out_8630386512586775674[11] = 0; - out_8630386512586775674[12] = 0; - out_8630386512586775674[13] = 0; - out_8630386512586775674[14] = 1; - out_8630386512586775674[15] = 0; - out_8630386512586775674[16] = 0; - out_8630386512586775674[17] = 0; +void H_24(double *state, double *unused, double *out_1967913413103873863) { + out_1967913413103873863[0] = 0; + out_1967913413103873863[1] = 0; + out_1967913413103873863[2] = 0; + out_1967913413103873863[3] = 0; + out_1967913413103873863[4] = 1; + out_1967913413103873863[5] = 0; + out_1967913413103873863[6] = 0; + out_1967913413103873863[7] = 0; + out_1967913413103873863[8] = 0; + out_1967913413103873863[9] = 0; + out_1967913413103873863[10] = 0; + out_1967913413103873863[11] = 0; + out_1967913413103873863[12] = 0; + out_1967913413103873863[13] = 0; + out_1967913413103873863[14] = 1; + out_1967913413103873863[15] = 0; + out_1967913413103873863[16] = 0; + out_1967913413103873863[17] = 0; } -void h_30(double *state, double *unused, double *out_2951458280903618951) { - out_2951458280903618951[0] = state[4]; +void h_30(double *state, double *unused, double *out_6048144486920968364) { + out_6048144486920968364[0] = state[4]; } -void H_30(double *state, double *unused, double *out_5125375003610027749) { - out_5125375003610027749[0] = 0; - out_5125375003610027749[1] = 0; - out_5125375003610027749[2] = 0; - out_5125375003610027749[3] = 0; - out_5125375003610027749[4] = 1; - out_5125375003610027749[5] = 0; - out_5125375003610027749[6] = 0; - out_5125375003610027749[7] = 0; - out_5125375003610027749[8] = 0; +void H_30(double *state, double *unused, double *out_2309031948003972517) { + out_2309031948003972517[0] = 0; + out_2309031948003972517[1] = 0; + out_2309031948003972517[2] = 0; + out_2309031948003972517[3] = 0; + out_2309031948003972517[4] = 1; + out_2309031948003972517[5] = 0; + out_2309031948003972517[6] = 0; + out_2309031948003972517[7] = 0; + out_2309031948003972517[8] = 0; } -void h_26(double *state, double *unused, double *out_464815008745451065) { - out_464815008745451065[0] = state[7]; +void h_26(double *state, double *unused, double *out_7396926319127737607) { + out_7396926319127737607[0] = state[7]; } -void H_26(double *state, double *unused, double *out_8737539375340843903) { - out_8737539375340843903[0] = 0; - out_8737539375340843903[1] = 0; - out_8737539375340843903[2] = 0; - out_8737539375340843903[3] = 0; - out_8737539375340843903[4] = 0; - out_8737539375340843903[5] = 0; - out_8737539375340843903[6] = 0; - out_8737539375340843903[7] = 1; - out_8737539375340843903[8] = 0; +void H_26(double *state, double *unused, double *out_3950804329377332334) { + out_3950804329377332334[0] = 0; + out_3950804329377332334[1] = 0; + out_3950804329377332334[2] = 0; + out_3950804329377332334[3] = 0; + out_3950804329377332334[4] = 0; + out_3950804329377332334[5] = 0; + out_3950804329377332334[6] = 0; + out_3950804329377332334[7] = 1; + out_3950804329377332334[8] = 0; } -void h_27(double *state, double *unused, double *out_2651633144370590248) { - out_2651633144370590248[0] = state[3]; +void h_27(double *state, double *unused, double *out_5724364007090228217) { + out_5724364007090228217[0] = state[3]; } -void H_27(double *state, double *unused, double *out_7300138315410452660) { - out_7300138315410452660[0] = 0; - out_7300138315410452660[1] = 0; - out_7300138315410452660[2] = 0; - out_7300138315410452660[3] = 1; - out_7300138315410452660[4] = 0; - out_7300138315410452660[5] = 0; - out_7300138315410452660[6] = 0; - out_7300138315410452660[7] = 0; - out_7300138315410452660[8] = 0; +void H_27(double *state, double *unused, double *out_134268636203547606) { + out_134268636203547606[0] = 0; + out_134268636203547606[1] = 0; + out_134268636203547606[2] = 0; + out_134268636203547606[3] = 1; + out_134268636203547606[4] = 0; + out_134268636203547606[5] = 0; + out_134268636203547606[6] = 0; + out_134268636203547606[7] = 0; + out_134268636203547606[8] = 0; } -void h_29(double *state, double *unused, double *out_2926827206655096137) { - out_2926827206655096137[0] = state[1]; +void h_29(double *state, double *unused, double *out_4273732614461345050) { + out_4273732614461345050[0] = state[1]; } -void H_29(double *state, double *unused, double *out_4615143659295635565) { - out_4615143659295635565[0] = 0; - out_4615143659295635565[1] = 1; - out_4615143659295635565[2] = 0; - out_4615143659295635565[3] = 0; - out_4615143659295635565[4] = 0; - out_4615143659295635565[5] = 0; - out_4615143659295635565[6] = 0; - out_4615143659295635565[7] = 0; - out_4615143659295635565[8] = 0; +void H_29(double *state, double *unused, double *out_2819263292318364701) { + out_2819263292318364701[0] = 0; + out_2819263292318364701[1] = 1; + out_2819263292318364701[2] = 0; + out_2819263292318364701[3] = 0; + out_2819263292318364701[4] = 0; + out_2819263292318364701[5] = 0; + out_2819263292318364701[6] = 0; + out_2819263292318364701[7] = 0; + out_2819263292318364701[8] = 0; } -void h_28(double *state, double *unused, double *out_2833450886970242207) { - out_2833450886970242207[0] = state[0]; +void h_28(double *state, double *unused, double *out_4780854154188565782) { + out_4780854154188565782[0] = state[0]; } -void H_28(double *state, double *unused, double *out_8749201397344385477) { - out_8749201397344385477[0] = 1; - out_8749201397344385477[1] = 0; - out_8749201397344385477[2] = 0; - out_8749201397344385477[3] = 0; - out_8749201397344385477[4] = 0; - out_8749201397344385477[5] = 0; - out_8749201397344385477[6] = 0; - out_8749201397344385477[7] = 0; - out_8749201397344385477[8] = 0; +void H_28(double *state, double *unused, double *out_2263135724751165873) { + out_2263135724751165873[0] = 1; + out_2263135724751165873[1] = 0; + out_2263135724751165873[2] = 0; + out_2263135724751165873[3] = 0; + out_2263135724751165873[4] = 0; + out_2263135724751165873[5] = 0; + out_2263135724751165873[6] = 0; + out_2263135724751165873[7] = 0; + out_2263135724751165873[8] = 0; } -void h_31(double *state, double *unused, double *out_899408730661372230) { - out_899408730661372230[0] = state[8]; +void h_31(double *state, double *unused, double *out_8485955996250055013) { + out_8485955996250055013[0] = state[8]; } -void H_31(double *state, double *unused, double *out_4965390094589827251) { - out_4965390094589827251[0] = 0; - out_4965390094589827251[1] = 0; - out_4965390094589827251[2] = 0; - out_4965390094589827251[3] = 0; - out_4965390094589827251[4] = 0; - out_4965390094589827251[5] = 0; - out_4965390094589827251[6] = 0; - out_4965390094589827251[7] = 0; - out_4965390094589827251[8] = 1; +void H_31(double *state, double *unused, double *out_4577012431610683810) { + out_4577012431610683810[0] = 0; + out_4577012431610683810[1] = 0; + out_4577012431610683810[2] = 0; + out_4577012431610683810[3] = 0; + out_4577012431610683810[4] = 0; + out_4577012431610683810[5] = 0; + out_4577012431610683810[6] = 0; + out_4577012431610683810[7] = 0; + out_4577012431610683810[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_6920520309618378367) { - err_fun(nom_x, delta_x, out_6920520309618378367); +void car_err_fun(double *nom_x, double *delta_x, double *out_5662953649758416364) { + err_fun(nom_x, delta_x, out_5662953649758416364); } -void car_inv_err_fun(double *nom_x, double *true_x, double *out_5302696854806540781) { - inv_err_fun(nom_x, true_x, out_5302696854806540781); +void car_inv_err_fun(double *nom_x, double *true_x, double *out_2896900801310648034) { + inv_err_fun(nom_x, true_x, out_2896900801310648034); } -void car_H_mod_fun(double *state, double *out_4449921069090285960) { - H_mod_fun(state, out_4449921069090285960); +void car_H_mod_fun(double *state, double *out_6763768597135270784) { + H_mod_fun(state, out_6763768597135270784); } -void car_f_fun(double *state, double dt, double *out_7814524287760230042) { - f_fun(state, dt, out_7814524287760230042); +void car_f_fun(double *state, double dt, double *out_7014559889233024887) { + f_fun(state, dt, out_7014559889233024887); } -void car_F_fun(double *state, double dt, double *out_411706590768419199) { - F_fun(state, dt, out_411706590768419199); +void car_F_fun(double *state, double dt, double *out_2749676980229268459) { + F_fun(state, dt, out_2749676980229268459); } -void car_h_25(double *state, double *unused, double *out_624214668376866341) { - h_25(state, unused, out_624214668376866341); +void car_h_25(double *state, double *unused, double *out_722690739429382572) { + h_25(state, unused, out_722690739429382572); } -void car_H_25(double *state, double *unused, double *out_4996036056466787679) { - H_25(state, unused, out_4996036056466787679); +void car_H_25(double *state, double *unused, double *out_209301010503276110) { + H_25(state, unused, out_209301010503276110); } -void car_h_24(double *state, double *unused, double *out_7726624714175041949) { - h_24(state, unused, out_7726624714175041949); +void car_h_24(double *state, double *unused, double *out_1099225576319256647) { + h_24(state, unused, out_1099225576319256647); } -void car_H_24(double *state, double *unused, double *out_8630386512586775674) { - H_24(state, unused, out_8630386512586775674); +void car_H_24(double *state, double *unused, double *out_1967913413103873863) { + H_24(state, unused, out_1967913413103873863); } -void car_h_30(double *state, double *unused, double *out_2951458280903618951) { - h_30(state, unused, out_2951458280903618951); +void car_h_30(double *state, double *unused, double *out_6048144486920968364) { + h_30(state, unused, out_6048144486920968364); } -void car_H_30(double *state, double *unused, double *out_5125375003610027749) { - H_30(state, unused, out_5125375003610027749); +void car_H_30(double *state, double *unused, double *out_2309031948003972517) { + H_30(state, unused, out_2309031948003972517); } -void car_h_26(double *state, double *unused, double *out_464815008745451065) { - h_26(state, unused, out_464815008745451065); +void car_h_26(double *state, double *unused, double *out_7396926319127737607) { + h_26(state, unused, out_7396926319127737607); } -void car_H_26(double *state, double *unused, double *out_8737539375340843903) { - H_26(state, unused, out_8737539375340843903); +void car_H_26(double *state, double *unused, double *out_3950804329377332334) { + H_26(state, unused, out_3950804329377332334); } -void car_h_27(double *state, double *unused, double *out_2651633144370590248) { - h_27(state, unused, out_2651633144370590248); +void car_h_27(double *state, double *unused, double *out_5724364007090228217) { + h_27(state, unused, out_5724364007090228217); } -void car_H_27(double *state, double *unused, double *out_7300138315410452660) { - H_27(state, unused, out_7300138315410452660); +void car_H_27(double *state, double *unused, double *out_134268636203547606) { + H_27(state, unused, out_134268636203547606); } -void car_h_29(double *state, double *unused, double *out_2926827206655096137) { - h_29(state, unused, out_2926827206655096137); +void car_h_29(double *state, double *unused, double *out_4273732614461345050) { + h_29(state, unused, out_4273732614461345050); } -void car_H_29(double *state, double *unused, double *out_4615143659295635565) { - H_29(state, unused, out_4615143659295635565); +void car_H_29(double *state, double *unused, double *out_2819263292318364701) { + H_29(state, unused, out_2819263292318364701); } -void car_h_28(double *state, double *unused, double *out_2833450886970242207) { - h_28(state, unused, out_2833450886970242207); +void car_h_28(double *state, double *unused, double *out_4780854154188565782) { + h_28(state, unused, out_4780854154188565782); } -void car_H_28(double *state, double *unused, double *out_8749201397344385477) { - H_28(state, unused, out_8749201397344385477); +void car_H_28(double *state, double *unused, double *out_2263135724751165873) { + H_28(state, unused, out_2263135724751165873); } -void car_h_31(double *state, double *unused, double *out_899408730661372230) { - h_31(state, unused, out_899408730661372230); +void car_h_31(double *state, double *unused, double *out_8485955996250055013) { + h_31(state, unused, out_8485955996250055013); } -void car_H_31(double *state, double *unused, double *out_4965390094589827251) { - H_31(state, unused, out_4965390094589827251); +void car_H_31(double *state, double *unused, double *out_4577012431610683810) { + H_31(state, unused, out_4577012431610683810); } 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 9eb39d06c..d543d4197 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_6920520309618378367); -void car_inv_err_fun(double *nom_x, double *true_x, double *out_5302696854806540781); -void car_H_mod_fun(double *state, double *out_4449921069090285960); -void car_f_fun(double *state, double dt, double *out_7814524287760230042); -void car_F_fun(double *state, double dt, double *out_411706590768419199); -void car_h_25(double *state, double *unused, double *out_624214668376866341); -void car_H_25(double *state, double *unused, double *out_4996036056466787679); -void car_h_24(double *state, double *unused, double *out_7726624714175041949); -void car_H_24(double *state, double *unused, double *out_8630386512586775674); -void car_h_30(double *state, double *unused, double *out_2951458280903618951); -void car_H_30(double *state, double *unused, double *out_5125375003610027749); -void car_h_26(double *state, double *unused, double *out_464815008745451065); -void car_H_26(double *state, double *unused, double *out_8737539375340843903); -void car_h_27(double *state, double *unused, double *out_2651633144370590248); -void car_H_27(double *state, double *unused, double *out_7300138315410452660); -void car_h_29(double *state, double *unused, double *out_2926827206655096137); -void car_H_29(double *state, double *unused, double *out_4615143659295635565); -void car_h_28(double *state, double *unused, double *out_2833450886970242207); -void car_H_28(double *state, double *unused, double *out_8749201397344385477); -void car_h_31(double *state, double *unused, double *out_899408730661372230); -void car_H_31(double *state, double *unused, double *out_4965390094589827251); +void car_err_fun(double *nom_x, double *delta_x, double *out_5662953649758416364); +void car_inv_err_fun(double *nom_x, double *true_x, double *out_2896900801310648034); +void car_H_mod_fun(double *state, double *out_6763768597135270784); +void car_f_fun(double *state, double dt, double *out_7014559889233024887); +void car_F_fun(double *state, double dt, double *out_2749676980229268459); +void car_h_25(double *state, double *unused, double *out_722690739429382572); +void car_H_25(double *state, double *unused, double *out_209301010503276110); +void car_h_24(double *state, double *unused, double *out_1099225576319256647); +void car_H_24(double *state, double *unused, double *out_1967913413103873863); +void car_h_30(double *state, double *unused, double *out_6048144486920968364); +void car_H_30(double *state, double *unused, double *out_2309031948003972517); +void car_h_26(double *state, double *unused, double *out_7396926319127737607); +void car_H_26(double *state, double *unused, double *out_3950804329377332334); +void car_h_27(double *state, double *unused, double *out_5724364007090228217); +void car_H_27(double *state, double *unused, double *out_134268636203547606); +void car_h_29(double *state, double *unused, double *out_4273732614461345050); +void car_H_29(double *state, double *unused, double *out_2819263292318364701); +void car_h_28(double *state, double *unused, double *out_4780854154188565782); +void car_H_28(double *state, double *unused, double *out_2263135724751165873); +void car_h_31(double *state, double *unused, double *out_8485955996250055013); +void car_H_31(double *state, double *unused, double *out_4577012431610683810); 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/gnss.cpp b/selfdrive/locationd/models/generated/gnss.cpp index 1183c753c..c6a0d4a46 100644 --- a/selfdrive/locationd/models/generated/gnss.cpp +++ b/selfdrive/locationd/models/generated/gnss.cpp @@ -17,354 +17,354 @@ const static double MAHA_THRESH_21 = 3.8414588206941227; * * * This file is part of 'ekf' * ******************************************************************************/ -void err_fun(double *nom_x, double *delta_x, double *out_2097260997154060327) { - out_2097260997154060327[0] = delta_x[0] + nom_x[0]; - out_2097260997154060327[1] = delta_x[1] + nom_x[1]; - out_2097260997154060327[2] = delta_x[2] + nom_x[2]; - out_2097260997154060327[3] = delta_x[3] + nom_x[3]; - out_2097260997154060327[4] = delta_x[4] + nom_x[4]; - out_2097260997154060327[5] = delta_x[5] + nom_x[5]; - out_2097260997154060327[6] = delta_x[6] + nom_x[6]; - out_2097260997154060327[7] = delta_x[7] + nom_x[7]; - out_2097260997154060327[8] = delta_x[8] + nom_x[8]; - out_2097260997154060327[9] = delta_x[9] + nom_x[9]; - out_2097260997154060327[10] = delta_x[10] + nom_x[10]; +void err_fun(double *nom_x, double *delta_x, double *out_2641878617010244620) { + out_2641878617010244620[0] = delta_x[0] + nom_x[0]; + out_2641878617010244620[1] = delta_x[1] + nom_x[1]; + out_2641878617010244620[2] = delta_x[2] + nom_x[2]; + out_2641878617010244620[3] = delta_x[3] + nom_x[3]; + out_2641878617010244620[4] = delta_x[4] + nom_x[4]; + out_2641878617010244620[5] = delta_x[5] + nom_x[5]; + out_2641878617010244620[6] = delta_x[6] + nom_x[6]; + out_2641878617010244620[7] = delta_x[7] + nom_x[7]; + out_2641878617010244620[8] = delta_x[8] + nom_x[8]; + out_2641878617010244620[9] = delta_x[9] + nom_x[9]; + out_2641878617010244620[10] = delta_x[10] + nom_x[10]; } -void inv_err_fun(double *nom_x, double *true_x, double *out_407819598143463209) { - out_407819598143463209[0] = -nom_x[0] + true_x[0]; - out_407819598143463209[1] = -nom_x[1] + true_x[1]; - out_407819598143463209[2] = -nom_x[2] + true_x[2]; - out_407819598143463209[3] = -nom_x[3] + true_x[3]; - out_407819598143463209[4] = -nom_x[4] + true_x[4]; - out_407819598143463209[5] = -nom_x[5] + true_x[5]; - out_407819598143463209[6] = -nom_x[6] + true_x[6]; - out_407819598143463209[7] = -nom_x[7] + true_x[7]; - out_407819598143463209[8] = -nom_x[8] + true_x[8]; - out_407819598143463209[9] = -nom_x[9] + true_x[9]; - out_407819598143463209[10] = -nom_x[10] + true_x[10]; +void inv_err_fun(double *nom_x, double *true_x, double *out_6377401004299455720) { + out_6377401004299455720[0] = -nom_x[0] + true_x[0]; + out_6377401004299455720[1] = -nom_x[1] + true_x[1]; + out_6377401004299455720[2] = -nom_x[2] + true_x[2]; + out_6377401004299455720[3] = -nom_x[3] + true_x[3]; + out_6377401004299455720[4] = -nom_x[4] + true_x[4]; + out_6377401004299455720[5] = -nom_x[5] + true_x[5]; + out_6377401004299455720[6] = -nom_x[6] + true_x[6]; + out_6377401004299455720[7] = -nom_x[7] + true_x[7]; + out_6377401004299455720[8] = -nom_x[8] + true_x[8]; + out_6377401004299455720[9] = -nom_x[9] + true_x[9]; + out_6377401004299455720[10] = -nom_x[10] + true_x[10]; } -void H_mod_fun(double *state, double *out_4427837971737845911) { - out_4427837971737845911[0] = 1.0; - out_4427837971737845911[1] = 0; - out_4427837971737845911[2] = 0; - out_4427837971737845911[3] = 0; - out_4427837971737845911[4] = 0; - out_4427837971737845911[5] = 0; - out_4427837971737845911[6] = 0; - out_4427837971737845911[7] = 0; - out_4427837971737845911[8] = 0; - out_4427837971737845911[9] = 0; - out_4427837971737845911[10] = 0; - out_4427837971737845911[11] = 0; - out_4427837971737845911[12] = 1.0; - out_4427837971737845911[13] = 0; - out_4427837971737845911[14] = 0; - out_4427837971737845911[15] = 0; - out_4427837971737845911[16] = 0; - out_4427837971737845911[17] = 0; - out_4427837971737845911[18] = 0; - out_4427837971737845911[19] = 0; - out_4427837971737845911[20] = 0; - out_4427837971737845911[21] = 0; - out_4427837971737845911[22] = 0; - out_4427837971737845911[23] = 0; - out_4427837971737845911[24] = 1.0; - out_4427837971737845911[25] = 0; - out_4427837971737845911[26] = 0; - out_4427837971737845911[27] = 0; - out_4427837971737845911[28] = 0; - out_4427837971737845911[29] = 0; - out_4427837971737845911[30] = 0; - out_4427837971737845911[31] = 0; - out_4427837971737845911[32] = 0; - out_4427837971737845911[33] = 0; - out_4427837971737845911[34] = 0; - out_4427837971737845911[35] = 0; - out_4427837971737845911[36] = 1.0; - out_4427837971737845911[37] = 0; - out_4427837971737845911[38] = 0; - out_4427837971737845911[39] = 0; - out_4427837971737845911[40] = 0; - out_4427837971737845911[41] = 0; - out_4427837971737845911[42] = 0; - out_4427837971737845911[43] = 0; - out_4427837971737845911[44] = 0; - out_4427837971737845911[45] = 0; - out_4427837971737845911[46] = 0; - out_4427837971737845911[47] = 0; - out_4427837971737845911[48] = 1.0; - out_4427837971737845911[49] = 0; - out_4427837971737845911[50] = 0; - out_4427837971737845911[51] = 0; - out_4427837971737845911[52] = 0; - out_4427837971737845911[53] = 0; - out_4427837971737845911[54] = 0; - out_4427837971737845911[55] = 0; - out_4427837971737845911[56] = 0; - out_4427837971737845911[57] = 0; - out_4427837971737845911[58] = 0; - out_4427837971737845911[59] = 0; - out_4427837971737845911[60] = 1.0; - out_4427837971737845911[61] = 0; - out_4427837971737845911[62] = 0; - out_4427837971737845911[63] = 0; - out_4427837971737845911[64] = 0; - out_4427837971737845911[65] = 0; - out_4427837971737845911[66] = 0; - out_4427837971737845911[67] = 0; - out_4427837971737845911[68] = 0; - out_4427837971737845911[69] = 0; - out_4427837971737845911[70] = 0; - out_4427837971737845911[71] = 0; - out_4427837971737845911[72] = 1.0; - out_4427837971737845911[73] = 0; - out_4427837971737845911[74] = 0; - out_4427837971737845911[75] = 0; - out_4427837971737845911[76] = 0; - out_4427837971737845911[77] = 0; - out_4427837971737845911[78] = 0; - out_4427837971737845911[79] = 0; - out_4427837971737845911[80] = 0; - out_4427837971737845911[81] = 0; - out_4427837971737845911[82] = 0; - out_4427837971737845911[83] = 0; - out_4427837971737845911[84] = 1.0; - out_4427837971737845911[85] = 0; - out_4427837971737845911[86] = 0; - out_4427837971737845911[87] = 0; - out_4427837971737845911[88] = 0; - out_4427837971737845911[89] = 0; - out_4427837971737845911[90] = 0; - out_4427837971737845911[91] = 0; - out_4427837971737845911[92] = 0; - out_4427837971737845911[93] = 0; - out_4427837971737845911[94] = 0; - out_4427837971737845911[95] = 0; - out_4427837971737845911[96] = 1.0; - out_4427837971737845911[97] = 0; - out_4427837971737845911[98] = 0; - out_4427837971737845911[99] = 0; - out_4427837971737845911[100] = 0; - out_4427837971737845911[101] = 0; - out_4427837971737845911[102] = 0; - out_4427837971737845911[103] = 0; - out_4427837971737845911[104] = 0; - out_4427837971737845911[105] = 0; - out_4427837971737845911[106] = 0; - out_4427837971737845911[107] = 0; - out_4427837971737845911[108] = 1.0; - out_4427837971737845911[109] = 0; - out_4427837971737845911[110] = 0; - out_4427837971737845911[111] = 0; - out_4427837971737845911[112] = 0; - out_4427837971737845911[113] = 0; - out_4427837971737845911[114] = 0; - out_4427837971737845911[115] = 0; - out_4427837971737845911[116] = 0; - out_4427837971737845911[117] = 0; - out_4427837971737845911[118] = 0; - out_4427837971737845911[119] = 0; - out_4427837971737845911[120] = 1.0; +void H_mod_fun(double *state, double *out_350167543532614649) { + out_350167543532614649[0] = 1.0; + out_350167543532614649[1] = 0; + out_350167543532614649[2] = 0; + out_350167543532614649[3] = 0; + out_350167543532614649[4] = 0; + out_350167543532614649[5] = 0; + out_350167543532614649[6] = 0; + out_350167543532614649[7] = 0; + out_350167543532614649[8] = 0; + out_350167543532614649[9] = 0; + out_350167543532614649[10] = 0; + out_350167543532614649[11] = 0; + out_350167543532614649[12] = 1.0; + out_350167543532614649[13] = 0; + out_350167543532614649[14] = 0; + out_350167543532614649[15] = 0; + out_350167543532614649[16] = 0; + out_350167543532614649[17] = 0; + out_350167543532614649[18] = 0; + out_350167543532614649[19] = 0; + out_350167543532614649[20] = 0; + out_350167543532614649[21] = 0; + out_350167543532614649[22] = 0; + out_350167543532614649[23] = 0; + out_350167543532614649[24] = 1.0; + out_350167543532614649[25] = 0; + out_350167543532614649[26] = 0; + out_350167543532614649[27] = 0; + out_350167543532614649[28] = 0; + out_350167543532614649[29] = 0; + out_350167543532614649[30] = 0; + out_350167543532614649[31] = 0; + out_350167543532614649[32] = 0; + out_350167543532614649[33] = 0; + out_350167543532614649[34] = 0; + out_350167543532614649[35] = 0; + out_350167543532614649[36] = 1.0; + out_350167543532614649[37] = 0; + out_350167543532614649[38] = 0; + out_350167543532614649[39] = 0; + out_350167543532614649[40] = 0; + out_350167543532614649[41] = 0; + out_350167543532614649[42] = 0; + out_350167543532614649[43] = 0; + out_350167543532614649[44] = 0; + out_350167543532614649[45] = 0; + out_350167543532614649[46] = 0; + out_350167543532614649[47] = 0; + out_350167543532614649[48] = 1.0; + out_350167543532614649[49] = 0; + out_350167543532614649[50] = 0; + out_350167543532614649[51] = 0; + out_350167543532614649[52] = 0; + out_350167543532614649[53] = 0; + out_350167543532614649[54] = 0; + out_350167543532614649[55] = 0; + out_350167543532614649[56] = 0; + out_350167543532614649[57] = 0; + out_350167543532614649[58] = 0; + out_350167543532614649[59] = 0; + out_350167543532614649[60] = 1.0; + out_350167543532614649[61] = 0; + out_350167543532614649[62] = 0; + out_350167543532614649[63] = 0; + out_350167543532614649[64] = 0; + out_350167543532614649[65] = 0; + out_350167543532614649[66] = 0; + out_350167543532614649[67] = 0; + out_350167543532614649[68] = 0; + out_350167543532614649[69] = 0; + out_350167543532614649[70] = 0; + out_350167543532614649[71] = 0; + out_350167543532614649[72] = 1.0; + out_350167543532614649[73] = 0; + out_350167543532614649[74] = 0; + out_350167543532614649[75] = 0; + out_350167543532614649[76] = 0; + out_350167543532614649[77] = 0; + out_350167543532614649[78] = 0; + out_350167543532614649[79] = 0; + out_350167543532614649[80] = 0; + out_350167543532614649[81] = 0; + out_350167543532614649[82] = 0; + out_350167543532614649[83] = 0; + out_350167543532614649[84] = 1.0; + out_350167543532614649[85] = 0; + out_350167543532614649[86] = 0; + out_350167543532614649[87] = 0; + out_350167543532614649[88] = 0; + out_350167543532614649[89] = 0; + out_350167543532614649[90] = 0; + out_350167543532614649[91] = 0; + out_350167543532614649[92] = 0; + out_350167543532614649[93] = 0; + out_350167543532614649[94] = 0; + out_350167543532614649[95] = 0; + out_350167543532614649[96] = 1.0; + out_350167543532614649[97] = 0; + out_350167543532614649[98] = 0; + out_350167543532614649[99] = 0; + out_350167543532614649[100] = 0; + out_350167543532614649[101] = 0; + out_350167543532614649[102] = 0; + out_350167543532614649[103] = 0; + out_350167543532614649[104] = 0; + out_350167543532614649[105] = 0; + out_350167543532614649[106] = 0; + out_350167543532614649[107] = 0; + out_350167543532614649[108] = 1.0; + out_350167543532614649[109] = 0; + out_350167543532614649[110] = 0; + out_350167543532614649[111] = 0; + out_350167543532614649[112] = 0; + out_350167543532614649[113] = 0; + out_350167543532614649[114] = 0; + out_350167543532614649[115] = 0; + out_350167543532614649[116] = 0; + out_350167543532614649[117] = 0; + out_350167543532614649[118] = 0; + out_350167543532614649[119] = 0; + out_350167543532614649[120] = 1.0; } -void f_fun(double *state, double dt, double *out_2405095626721301493) { - out_2405095626721301493[0] = dt*state[3] + state[0]; - out_2405095626721301493[1] = dt*state[4] + state[1]; - out_2405095626721301493[2] = dt*state[5] + state[2]; - out_2405095626721301493[3] = state[3]; - out_2405095626721301493[4] = state[4]; - out_2405095626721301493[5] = state[5]; - out_2405095626721301493[6] = dt*state[7] + state[6]; - out_2405095626721301493[7] = dt*state[8] + state[7]; - out_2405095626721301493[8] = state[8]; - out_2405095626721301493[9] = state[9]; - out_2405095626721301493[10] = state[10]; +void f_fun(double *state, double dt, double *out_6672020356614883149) { + out_6672020356614883149[0] = dt*state[3] + state[0]; + out_6672020356614883149[1] = dt*state[4] + state[1]; + out_6672020356614883149[2] = dt*state[5] + state[2]; + out_6672020356614883149[3] = state[3]; + out_6672020356614883149[4] = state[4]; + out_6672020356614883149[5] = state[5]; + out_6672020356614883149[6] = dt*state[7] + state[6]; + out_6672020356614883149[7] = dt*state[8] + state[7]; + out_6672020356614883149[8] = state[8]; + out_6672020356614883149[9] = state[9]; + out_6672020356614883149[10] = state[10]; } -void F_fun(double *state, double dt, double *out_1835212025890269909) { - out_1835212025890269909[0] = 1; - out_1835212025890269909[1] = 0; - out_1835212025890269909[2] = 0; - out_1835212025890269909[3] = dt; - out_1835212025890269909[4] = 0; - out_1835212025890269909[5] = 0; - out_1835212025890269909[6] = 0; - out_1835212025890269909[7] = 0; - out_1835212025890269909[8] = 0; - out_1835212025890269909[9] = 0; - out_1835212025890269909[10] = 0; - out_1835212025890269909[11] = 0; - out_1835212025890269909[12] = 1; - out_1835212025890269909[13] = 0; - out_1835212025890269909[14] = 0; - out_1835212025890269909[15] = dt; - out_1835212025890269909[16] = 0; - out_1835212025890269909[17] = 0; - out_1835212025890269909[18] = 0; - out_1835212025890269909[19] = 0; - out_1835212025890269909[20] = 0; - out_1835212025890269909[21] = 0; - out_1835212025890269909[22] = 0; - out_1835212025890269909[23] = 0; - out_1835212025890269909[24] = 1; - out_1835212025890269909[25] = 0; - out_1835212025890269909[26] = 0; - out_1835212025890269909[27] = dt; - out_1835212025890269909[28] = 0; - out_1835212025890269909[29] = 0; - out_1835212025890269909[30] = 0; - out_1835212025890269909[31] = 0; - out_1835212025890269909[32] = 0; - out_1835212025890269909[33] = 0; - out_1835212025890269909[34] = 0; - out_1835212025890269909[35] = 0; - out_1835212025890269909[36] = 1; - out_1835212025890269909[37] = 0; - out_1835212025890269909[38] = 0; - out_1835212025890269909[39] = 0; - out_1835212025890269909[40] = 0; - out_1835212025890269909[41] = 0; - out_1835212025890269909[42] = 0; - out_1835212025890269909[43] = 0; - out_1835212025890269909[44] = 0; - out_1835212025890269909[45] = 0; - out_1835212025890269909[46] = 0; - out_1835212025890269909[47] = 0; - out_1835212025890269909[48] = 1; - out_1835212025890269909[49] = 0; - out_1835212025890269909[50] = 0; - out_1835212025890269909[51] = 0; - out_1835212025890269909[52] = 0; - out_1835212025890269909[53] = 0; - out_1835212025890269909[54] = 0; - out_1835212025890269909[55] = 0; - out_1835212025890269909[56] = 0; - out_1835212025890269909[57] = 0; - out_1835212025890269909[58] = 0; - out_1835212025890269909[59] = 0; - out_1835212025890269909[60] = 1; - out_1835212025890269909[61] = 0; - out_1835212025890269909[62] = 0; - out_1835212025890269909[63] = 0; - out_1835212025890269909[64] = 0; - out_1835212025890269909[65] = 0; - out_1835212025890269909[66] = 0; - out_1835212025890269909[67] = 0; - out_1835212025890269909[68] = 0; - out_1835212025890269909[69] = 0; - out_1835212025890269909[70] = 0; - out_1835212025890269909[71] = 0; - out_1835212025890269909[72] = 1; - out_1835212025890269909[73] = dt; - out_1835212025890269909[74] = 0; - out_1835212025890269909[75] = 0; - out_1835212025890269909[76] = 0; - out_1835212025890269909[77] = 0; - out_1835212025890269909[78] = 0; - out_1835212025890269909[79] = 0; - out_1835212025890269909[80] = 0; - out_1835212025890269909[81] = 0; - out_1835212025890269909[82] = 0; - out_1835212025890269909[83] = 0; - out_1835212025890269909[84] = 1; - out_1835212025890269909[85] = dt; - out_1835212025890269909[86] = 0; - out_1835212025890269909[87] = 0; - out_1835212025890269909[88] = 0; - out_1835212025890269909[89] = 0; - out_1835212025890269909[90] = 0; - out_1835212025890269909[91] = 0; - out_1835212025890269909[92] = 0; - out_1835212025890269909[93] = 0; - out_1835212025890269909[94] = 0; - out_1835212025890269909[95] = 0; - out_1835212025890269909[96] = 1; - out_1835212025890269909[97] = 0; - out_1835212025890269909[98] = 0; - out_1835212025890269909[99] = 0; - out_1835212025890269909[100] = 0; - out_1835212025890269909[101] = 0; - out_1835212025890269909[102] = 0; - out_1835212025890269909[103] = 0; - out_1835212025890269909[104] = 0; - out_1835212025890269909[105] = 0; - out_1835212025890269909[106] = 0; - out_1835212025890269909[107] = 0; - out_1835212025890269909[108] = 1; - out_1835212025890269909[109] = 0; - out_1835212025890269909[110] = 0; - out_1835212025890269909[111] = 0; - out_1835212025890269909[112] = 0; - out_1835212025890269909[113] = 0; - out_1835212025890269909[114] = 0; - out_1835212025890269909[115] = 0; - out_1835212025890269909[116] = 0; - out_1835212025890269909[117] = 0; - out_1835212025890269909[118] = 0; - out_1835212025890269909[119] = 0; - out_1835212025890269909[120] = 1; +void F_fun(double *state, double dt, double *out_1674482844242533979) { + out_1674482844242533979[0] = 1; + out_1674482844242533979[1] = 0; + out_1674482844242533979[2] = 0; + out_1674482844242533979[3] = dt; + out_1674482844242533979[4] = 0; + out_1674482844242533979[5] = 0; + out_1674482844242533979[6] = 0; + out_1674482844242533979[7] = 0; + out_1674482844242533979[8] = 0; + out_1674482844242533979[9] = 0; + out_1674482844242533979[10] = 0; + out_1674482844242533979[11] = 0; + out_1674482844242533979[12] = 1; + out_1674482844242533979[13] = 0; + out_1674482844242533979[14] = 0; + out_1674482844242533979[15] = dt; + out_1674482844242533979[16] = 0; + out_1674482844242533979[17] = 0; + out_1674482844242533979[18] = 0; + out_1674482844242533979[19] = 0; + out_1674482844242533979[20] = 0; + out_1674482844242533979[21] = 0; + out_1674482844242533979[22] = 0; + out_1674482844242533979[23] = 0; + out_1674482844242533979[24] = 1; + out_1674482844242533979[25] = 0; + out_1674482844242533979[26] = 0; + out_1674482844242533979[27] = dt; + out_1674482844242533979[28] = 0; + out_1674482844242533979[29] = 0; + out_1674482844242533979[30] = 0; + out_1674482844242533979[31] = 0; + out_1674482844242533979[32] = 0; + out_1674482844242533979[33] = 0; + out_1674482844242533979[34] = 0; + out_1674482844242533979[35] = 0; + out_1674482844242533979[36] = 1; + out_1674482844242533979[37] = 0; + out_1674482844242533979[38] = 0; + out_1674482844242533979[39] = 0; + out_1674482844242533979[40] = 0; + out_1674482844242533979[41] = 0; + out_1674482844242533979[42] = 0; + out_1674482844242533979[43] = 0; + out_1674482844242533979[44] = 0; + out_1674482844242533979[45] = 0; + out_1674482844242533979[46] = 0; + out_1674482844242533979[47] = 0; + out_1674482844242533979[48] = 1; + out_1674482844242533979[49] = 0; + out_1674482844242533979[50] = 0; + out_1674482844242533979[51] = 0; + out_1674482844242533979[52] = 0; + out_1674482844242533979[53] = 0; + out_1674482844242533979[54] = 0; + out_1674482844242533979[55] = 0; + out_1674482844242533979[56] = 0; + out_1674482844242533979[57] = 0; + out_1674482844242533979[58] = 0; + out_1674482844242533979[59] = 0; + out_1674482844242533979[60] = 1; + out_1674482844242533979[61] = 0; + out_1674482844242533979[62] = 0; + out_1674482844242533979[63] = 0; + out_1674482844242533979[64] = 0; + out_1674482844242533979[65] = 0; + out_1674482844242533979[66] = 0; + out_1674482844242533979[67] = 0; + out_1674482844242533979[68] = 0; + out_1674482844242533979[69] = 0; + out_1674482844242533979[70] = 0; + out_1674482844242533979[71] = 0; + out_1674482844242533979[72] = 1; + out_1674482844242533979[73] = dt; + out_1674482844242533979[74] = 0; + out_1674482844242533979[75] = 0; + out_1674482844242533979[76] = 0; + out_1674482844242533979[77] = 0; + out_1674482844242533979[78] = 0; + out_1674482844242533979[79] = 0; + out_1674482844242533979[80] = 0; + out_1674482844242533979[81] = 0; + out_1674482844242533979[82] = 0; + out_1674482844242533979[83] = 0; + out_1674482844242533979[84] = 1; + out_1674482844242533979[85] = dt; + out_1674482844242533979[86] = 0; + out_1674482844242533979[87] = 0; + out_1674482844242533979[88] = 0; + out_1674482844242533979[89] = 0; + out_1674482844242533979[90] = 0; + out_1674482844242533979[91] = 0; + out_1674482844242533979[92] = 0; + out_1674482844242533979[93] = 0; + out_1674482844242533979[94] = 0; + out_1674482844242533979[95] = 0; + out_1674482844242533979[96] = 1; + out_1674482844242533979[97] = 0; + out_1674482844242533979[98] = 0; + out_1674482844242533979[99] = 0; + out_1674482844242533979[100] = 0; + out_1674482844242533979[101] = 0; + out_1674482844242533979[102] = 0; + out_1674482844242533979[103] = 0; + out_1674482844242533979[104] = 0; + out_1674482844242533979[105] = 0; + out_1674482844242533979[106] = 0; + out_1674482844242533979[107] = 0; + out_1674482844242533979[108] = 1; + out_1674482844242533979[109] = 0; + out_1674482844242533979[110] = 0; + out_1674482844242533979[111] = 0; + out_1674482844242533979[112] = 0; + out_1674482844242533979[113] = 0; + out_1674482844242533979[114] = 0; + out_1674482844242533979[115] = 0; + out_1674482844242533979[116] = 0; + out_1674482844242533979[117] = 0; + out_1674482844242533979[118] = 0; + out_1674482844242533979[119] = 0; + out_1674482844242533979[120] = 1; } -void h_6(double *state, double *sat_pos, double *out_1528125412600993628) { - out_1528125412600993628[0] = sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)) + state[6]; +void h_6(double *state, double *sat_pos, double *out_5972909262720134315) { + out_5972909262720134315[0] = sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)) + state[6]; } -void H_6(double *state, double *sat_pos, double *out_104140276440086105) { - out_104140276440086105[0] = (-sat_pos[0] + state[0])/sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)); - out_104140276440086105[1] = (-sat_pos[1] + state[1])/sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)); - out_104140276440086105[2] = (-sat_pos[2] + state[2])/sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)); - out_104140276440086105[3] = 0; - out_104140276440086105[4] = 0; - out_104140276440086105[5] = 0; - out_104140276440086105[6] = 1; - out_104140276440086105[7] = 0; - out_104140276440086105[8] = 0; - out_104140276440086105[9] = 0; - out_104140276440086105[10] = 0; +void H_6(double *state, double *sat_pos, double *out_3653461233205109228) { + out_3653461233205109228[0] = (-sat_pos[0] + state[0])/sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)); + out_3653461233205109228[1] = (-sat_pos[1] + state[1])/sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)); + out_3653461233205109228[2] = (-sat_pos[2] + state[2])/sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)); + out_3653461233205109228[3] = 0; + out_3653461233205109228[4] = 0; + out_3653461233205109228[5] = 0; + out_3653461233205109228[6] = 1; + out_3653461233205109228[7] = 0; + out_3653461233205109228[8] = 0; + out_3653461233205109228[9] = 0; + out_3653461233205109228[10] = 0; } -void h_20(double *state, double *sat_pos, double *out_601402367496244624) { - out_601402367496244624[0] = sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)) + sat_pos[3]*state[10] + state[6] + state[9]; +void h_20(double *state, double *sat_pos, double *out_4250972716649874804) { + out_4250972716649874804[0] = sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)) + sat_pos[3]*state[10] + state[6] + state[9]; } -void H_20(double *state, double *sat_pos, double *out_4705666395271220693) { - out_4705666395271220693[0] = (-sat_pos[0] + state[0])/sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)); - out_4705666395271220693[1] = (-sat_pos[1] + state[1])/sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)); - out_4705666395271220693[2] = (-sat_pos[2] + state[2])/sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)); - out_4705666395271220693[3] = 0; - out_4705666395271220693[4] = 0; - out_4705666395271220693[5] = 0; - out_4705666395271220693[6] = 1; - out_4705666395271220693[7] = 0; - out_4705666395271220693[8] = 0; - out_4705666395271220693[9] = 1; - out_4705666395271220693[10] = sat_pos[3]; +void H_20(double *state, double *sat_pos, double *out_7645549737271804400) { + out_7645549737271804400[0] = (-sat_pos[0] + state[0])/sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)); + out_7645549737271804400[1] = (-sat_pos[1] + state[1])/sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)); + out_7645549737271804400[2] = (-sat_pos[2] + state[2])/sqrt(pow(-sat_pos[0] + state[0], 2) + pow(-sat_pos[1] + state[1], 2) + pow(-sat_pos[2] + state[2], 2)); + out_7645549737271804400[3] = 0; + out_7645549737271804400[4] = 0; + out_7645549737271804400[5] = 0; + out_7645549737271804400[6] = 1; + out_7645549737271804400[7] = 0; + out_7645549737271804400[8] = 0; + out_7645549737271804400[9] = 1; + out_7645549737271804400[10] = sat_pos[3]; } -void h_7(double *state, double *sat_pos_vel, double *out_2964007189672083137) { - out_2964007189672083137[0] = (sat_pos_vel[0] - state[0])*(sat_pos_vel[3] - state[3])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)) + (sat_pos_vel[1] - state[1])*(sat_pos_vel[4] - state[4])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)) + (sat_pos_vel[2] - state[2])*(sat_pos_vel[5] - state[5])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)) + state[7]; +void h_7(double *state, double *sat_pos_vel, double *out_8613498608425957392) { + out_8613498608425957392[0] = (sat_pos_vel[0] - state[0])*(sat_pos_vel[3] - state[3])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)) + (sat_pos_vel[1] - state[1])*(sat_pos_vel[4] - state[4])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)) + (sat_pos_vel[2] - state[2])*(sat_pos_vel[5] - state[5])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)) + state[7]; } -void H_7(double *state, double *sat_pos_vel, double *out_45965290841563331) { - out_45965290841563331[0] = pow(sat_pos_vel[0] - state[0], 2)*(sat_pos_vel[3] - state[3])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[0] - state[0])*(sat_pos_vel[1] - state[1])*(sat_pos_vel[4] - state[4])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[0] - state[0])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[5] - state[5])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) - (sat_pos_vel[3] - state[3])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); - out_45965290841563331[1] = (sat_pos_vel[0] - state[0])*(sat_pos_vel[1] - state[1])*(sat_pos_vel[3] - state[3])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + pow(sat_pos_vel[1] - state[1], 2)*(sat_pos_vel[4] - state[4])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[1] - state[1])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[5] - state[5])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) - (sat_pos_vel[4] - state[4])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); - out_45965290841563331[2] = (sat_pos_vel[0] - state[0])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[3] - state[3])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[1] - state[1])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[4] - state[4])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + pow(sat_pos_vel[2] - state[2], 2)*(sat_pos_vel[5] - state[5])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) - (sat_pos_vel[5] - state[5])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); - out_45965290841563331[3] = -(sat_pos_vel[0] - state[0])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); - out_45965290841563331[4] = -(sat_pos_vel[1] - state[1])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); - out_45965290841563331[5] = -(sat_pos_vel[2] - state[2])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); - out_45965290841563331[6] = 0; - out_45965290841563331[7] = 1; - out_45965290841563331[8] = 0; - out_45965290841563331[9] = 0; - out_45965290841563331[10] = 0; +void H_7(double *state, double *sat_pos_vel, double *out_217272578096397715) { + out_217272578096397715[0] = pow(sat_pos_vel[0] - state[0], 2)*(sat_pos_vel[3] - state[3])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[0] - state[0])*(sat_pos_vel[1] - state[1])*(sat_pos_vel[4] - state[4])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[0] - state[0])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[5] - state[5])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) - (sat_pos_vel[3] - state[3])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); + out_217272578096397715[1] = (sat_pos_vel[0] - state[0])*(sat_pos_vel[1] - state[1])*(sat_pos_vel[3] - state[3])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + pow(sat_pos_vel[1] - state[1], 2)*(sat_pos_vel[4] - state[4])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[1] - state[1])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[5] - state[5])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) - (sat_pos_vel[4] - state[4])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); + out_217272578096397715[2] = (sat_pos_vel[0] - state[0])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[3] - state[3])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[1] - state[1])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[4] - state[4])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + pow(sat_pos_vel[2] - state[2], 2)*(sat_pos_vel[5] - state[5])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) - (sat_pos_vel[5] - state[5])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); + out_217272578096397715[3] = -(sat_pos_vel[0] - state[0])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); + out_217272578096397715[4] = -(sat_pos_vel[1] - state[1])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); + out_217272578096397715[5] = -(sat_pos_vel[2] - state[2])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); + out_217272578096397715[6] = 0; + out_217272578096397715[7] = 1; + out_217272578096397715[8] = 0; + out_217272578096397715[9] = 0; + out_217272578096397715[10] = 0; } -void h_21(double *state, double *sat_pos_vel, double *out_2964007189672083137) { - out_2964007189672083137[0] = (sat_pos_vel[0] - state[0])*(sat_pos_vel[3] - state[3])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)) + (sat_pos_vel[1] - state[1])*(sat_pos_vel[4] - state[4])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)) + (sat_pos_vel[2] - state[2])*(sat_pos_vel[5] - state[5])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)) + state[7]; +void h_21(double *state, double *sat_pos_vel, double *out_8613498608425957392) { + out_8613498608425957392[0] = (sat_pos_vel[0] - state[0])*(sat_pos_vel[3] - state[3])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)) + (sat_pos_vel[1] - state[1])*(sat_pos_vel[4] - state[4])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)) + (sat_pos_vel[2] - state[2])*(sat_pos_vel[5] - state[5])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)) + state[7]; } -void H_21(double *state, double *sat_pos_vel, double *out_45965290841563331) { - out_45965290841563331[0] = pow(sat_pos_vel[0] - state[0], 2)*(sat_pos_vel[3] - state[3])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[0] - state[0])*(sat_pos_vel[1] - state[1])*(sat_pos_vel[4] - state[4])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[0] - state[0])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[5] - state[5])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) - (sat_pos_vel[3] - state[3])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); - out_45965290841563331[1] = (sat_pos_vel[0] - state[0])*(sat_pos_vel[1] - state[1])*(sat_pos_vel[3] - state[3])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + pow(sat_pos_vel[1] - state[1], 2)*(sat_pos_vel[4] - state[4])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[1] - state[1])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[5] - state[5])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) - (sat_pos_vel[4] - state[4])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); - out_45965290841563331[2] = (sat_pos_vel[0] - state[0])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[3] - state[3])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[1] - state[1])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[4] - state[4])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + pow(sat_pos_vel[2] - state[2], 2)*(sat_pos_vel[5] - state[5])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) - (sat_pos_vel[5] - state[5])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); - out_45965290841563331[3] = -(sat_pos_vel[0] - state[0])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); - out_45965290841563331[4] = -(sat_pos_vel[1] - state[1])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); - out_45965290841563331[5] = -(sat_pos_vel[2] - state[2])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); - out_45965290841563331[6] = 0; - out_45965290841563331[7] = 1; - out_45965290841563331[8] = 0; - out_45965290841563331[9] = 0; - out_45965290841563331[10] = 0; +void H_21(double *state, double *sat_pos_vel, double *out_217272578096397715) { + out_217272578096397715[0] = pow(sat_pos_vel[0] - state[0], 2)*(sat_pos_vel[3] - state[3])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[0] - state[0])*(sat_pos_vel[1] - state[1])*(sat_pos_vel[4] - state[4])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[0] - state[0])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[5] - state[5])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) - (sat_pos_vel[3] - state[3])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); + out_217272578096397715[1] = (sat_pos_vel[0] - state[0])*(sat_pos_vel[1] - state[1])*(sat_pos_vel[3] - state[3])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + pow(sat_pos_vel[1] - state[1], 2)*(sat_pos_vel[4] - state[4])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[1] - state[1])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[5] - state[5])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) - (sat_pos_vel[4] - state[4])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); + out_217272578096397715[2] = (sat_pos_vel[0] - state[0])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[3] - state[3])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + (sat_pos_vel[1] - state[1])*(sat_pos_vel[2] - state[2])*(sat_pos_vel[4] - state[4])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) + pow(sat_pos_vel[2] - state[2], 2)*(sat_pos_vel[5] - state[5])/pow(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2), 3.0/2.0) - (sat_pos_vel[5] - state[5])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); + out_217272578096397715[3] = -(sat_pos_vel[0] - state[0])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); + out_217272578096397715[4] = -(sat_pos_vel[1] - state[1])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); + out_217272578096397715[5] = -(sat_pos_vel[2] - state[2])/sqrt(pow(sat_pos_vel[0] - state[0], 2) + pow(sat_pos_vel[1] - state[1], 2) + pow(sat_pos_vel[2] - state[2], 2)); + out_217272578096397715[6] = 0; + out_217272578096397715[7] = 1; + out_217272578096397715[8] = 0; + out_217272578096397715[9] = 0; + out_217272578096397715[10] = 0; } #include #include @@ -506,44 +506,44 @@ void gnss_update_7(double *in_x, double *in_P, double *in_z, double *in_R, doubl void gnss_update_21(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) { update<1, 3, 0>(in_x, in_P, h_21, H_21, NULL, in_z, in_R, in_ea, MAHA_THRESH_21); } -void gnss_err_fun(double *nom_x, double *delta_x, double *out_2097260997154060327) { - err_fun(nom_x, delta_x, out_2097260997154060327); +void gnss_err_fun(double *nom_x, double *delta_x, double *out_2641878617010244620) { + err_fun(nom_x, delta_x, out_2641878617010244620); } -void gnss_inv_err_fun(double *nom_x, double *true_x, double *out_407819598143463209) { - inv_err_fun(nom_x, true_x, out_407819598143463209); +void gnss_inv_err_fun(double *nom_x, double *true_x, double *out_6377401004299455720) { + inv_err_fun(nom_x, true_x, out_6377401004299455720); } -void gnss_H_mod_fun(double *state, double *out_4427837971737845911) { - H_mod_fun(state, out_4427837971737845911); +void gnss_H_mod_fun(double *state, double *out_350167543532614649) { + H_mod_fun(state, out_350167543532614649); } -void gnss_f_fun(double *state, double dt, double *out_2405095626721301493) { - f_fun(state, dt, out_2405095626721301493); +void gnss_f_fun(double *state, double dt, double *out_6672020356614883149) { + f_fun(state, dt, out_6672020356614883149); } -void gnss_F_fun(double *state, double dt, double *out_1835212025890269909) { - F_fun(state, dt, out_1835212025890269909); +void gnss_F_fun(double *state, double dt, double *out_1674482844242533979) { + F_fun(state, dt, out_1674482844242533979); } -void gnss_h_6(double *state, double *sat_pos, double *out_1528125412600993628) { - h_6(state, sat_pos, out_1528125412600993628); +void gnss_h_6(double *state, double *sat_pos, double *out_5972909262720134315) { + h_6(state, sat_pos, out_5972909262720134315); } -void gnss_H_6(double *state, double *sat_pos, double *out_104140276440086105) { - H_6(state, sat_pos, out_104140276440086105); +void gnss_H_6(double *state, double *sat_pos, double *out_3653461233205109228) { + H_6(state, sat_pos, out_3653461233205109228); } -void gnss_h_20(double *state, double *sat_pos, double *out_601402367496244624) { - h_20(state, sat_pos, out_601402367496244624); +void gnss_h_20(double *state, double *sat_pos, double *out_4250972716649874804) { + h_20(state, sat_pos, out_4250972716649874804); } -void gnss_H_20(double *state, double *sat_pos, double *out_4705666395271220693) { - H_20(state, sat_pos, out_4705666395271220693); +void gnss_H_20(double *state, double *sat_pos, double *out_7645549737271804400) { + H_20(state, sat_pos, out_7645549737271804400); } -void gnss_h_7(double *state, double *sat_pos_vel, double *out_2964007189672083137) { - h_7(state, sat_pos_vel, out_2964007189672083137); +void gnss_h_7(double *state, double *sat_pos_vel, double *out_8613498608425957392) { + h_7(state, sat_pos_vel, out_8613498608425957392); } -void gnss_H_7(double *state, double *sat_pos_vel, double *out_45965290841563331) { - H_7(state, sat_pos_vel, out_45965290841563331); +void gnss_H_7(double *state, double *sat_pos_vel, double *out_217272578096397715) { + H_7(state, sat_pos_vel, out_217272578096397715); } -void gnss_h_21(double *state, double *sat_pos_vel, double *out_2964007189672083137) { - h_21(state, sat_pos_vel, out_2964007189672083137); +void gnss_h_21(double *state, double *sat_pos_vel, double *out_8613498608425957392) { + h_21(state, sat_pos_vel, out_8613498608425957392); } -void gnss_H_21(double *state, double *sat_pos_vel, double *out_45965290841563331) { - H_21(state, sat_pos_vel, out_45965290841563331); +void gnss_H_21(double *state, double *sat_pos_vel, double *out_217272578096397715) { + H_21(state, sat_pos_vel, out_217272578096397715); } void gnss_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/gnss.h b/selfdrive/locationd/models/generated/gnss.h index 913357800..1da40405a 100644 --- a/selfdrive/locationd/models/generated/gnss.h +++ b/selfdrive/locationd/models/generated/gnss.h @@ -5,18 +5,18 @@ void gnss_update_6(double *in_x, double *in_P, double *in_z, double *in_R, doubl void gnss_update_20(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); void gnss_update_7(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); void gnss_update_21(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea); -void gnss_err_fun(double *nom_x, double *delta_x, double *out_2097260997154060327); -void gnss_inv_err_fun(double *nom_x, double *true_x, double *out_407819598143463209); -void gnss_H_mod_fun(double *state, double *out_4427837971737845911); -void gnss_f_fun(double *state, double dt, double *out_2405095626721301493); -void gnss_F_fun(double *state, double dt, double *out_1835212025890269909); -void gnss_h_6(double *state, double *sat_pos, double *out_1528125412600993628); -void gnss_H_6(double *state, double *sat_pos, double *out_104140276440086105); -void gnss_h_20(double *state, double *sat_pos, double *out_601402367496244624); -void gnss_H_20(double *state, double *sat_pos, double *out_4705666395271220693); -void gnss_h_7(double *state, double *sat_pos_vel, double *out_2964007189672083137); -void gnss_H_7(double *state, double *sat_pos_vel, double *out_45965290841563331); -void gnss_h_21(double *state, double *sat_pos_vel, double *out_2964007189672083137); -void gnss_H_21(double *state, double *sat_pos_vel, double *out_45965290841563331); +void gnss_err_fun(double *nom_x, double *delta_x, double *out_2641878617010244620); +void gnss_inv_err_fun(double *nom_x, double *true_x, double *out_6377401004299455720); +void gnss_H_mod_fun(double *state, double *out_350167543532614649); +void gnss_f_fun(double *state, double dt, double *out_6672020356614883149); +void gnss_F_fun(double *state, double dt, double *out_1674482844242533979); +void gnss_h_6(double *state, double *sat_pos, double *out_5972909262720134315); +void gnss_H_6(double *state, double *sat_pos, double *out_3653461233205109228); +void gnss_h_20(double *state, double *sat_pos, double *out_4250972716649874804); +void gnss_H_20(double *state, double *sat_pos, double *out_7645549737271804400); +void gnss_h_7(double *state, double *sat_pos_vel, double *out_8613498608425957392); +void gnss_H_7(double *state, double *sat_pos_vel, double *out_217272578096397715); +void gnss_h_21(double *state, double *sat_pos_vel, double *out_8613498608425957392); +void gnss_H_21(double *state, double *sat_pos_vel, double *out_217272578096397715); void gnss_predict(double *in_x, double *in_P, double *in_Q, double dt); } \ No newline at end of file diff --git a/selfdrive/locationd/models/generated/libkf.so b/selfdrive/locationd/models/generated/libkf.so index 9ee8cc4ef..fba9b5c50 100755 Binary files a/selfdrive/locationd/models/generated/libkf.so and b/selfdrive/locationd/models/generated/libkf.so differ diff --git a/selfdrive/locationd/models/generated/live.cpp b/selfdrive/locationd/models/generated/live.cpp index 3a159db02..7ef9f9be8 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_7275051445048872074) { - out_7275051445048872074[0] = 0; - out_7275051445048872074[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_7275051445048872074[2] = -sin(in_vec[2])*cos(in_vec[1])*in_vec[3] + cos(in_vec[1])*cos(in_vec[2])*in_vec[4]; - out_7275051445048872074[3] = cos(in_vec[1])*cos(in_vec[2]); - out_7275051445048872074[4] = sin(in_vec[2])*cos(in_vec[1]); - out_7275051445048872074[5] = -sin(in_vec[1]); - out_7275051445048872074[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_7275051445048872074[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_7275051445048872074[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_7275051445048872074[9] = sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) - sin(in_vec[2])*cos(in_vec[0]); - out_7275051445048872074[10] = sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) + cos(in_vec[0])*cos(in_vec[2]); - out_7275051445048872074[11] = sin(in_vec[0])*cos(in_vec[1]); - out_7275051445048872074[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_7275051445048872074[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_7275051445048872074[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_7275051445048872074[15] = sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]); - out_7275051445048872074[16] = -sin(in_vec[0])*cos(in_vec[2]) + sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]); - out_7275051445048872074[17] = cos(in_vec[0])*cos(in_vec[1]); +void H(double *in_vec, double *out_4820339293882119518) { + out_4820339293882119518[0] = 0; + out_4820339293882119518[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_4820339293882119518[2] = -sin(in_vec[2])*cos(in_vec[1])*in_vec[3] + cos(in_vec[1])*cos(in_vec[2])*in_vec[4]; + out_4820339293882119518[3] = cos(in_vec[1])*cos(in_vec[2]); + out_4820339293882119518[4] = sin(in_vec[2])*cos(in_vec[1]); + out_4820339293882119518[5] = -sin(in_vec[1]); + out_4820339293882119518[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_4820339293882119518[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_4820339293882119518[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_4820339293882119518[9] = sin(in_vec[0])*sin(in_vec[1])*cos(in_vec[2]) - sin(in_vec[2])*cos(in_vec[0]); + out_4820339293882119518[10] = sin(in_vec[0])*sin(in_vec[1])*sin(in_vec[2]) + cos(in_vec[0])*cos(in_vec[2]); + out_4820339293882119518[11] = sin(in_vec[0])*cos(in_vec[1]); + out_4820339293882119518[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_4820339293882119518[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_4820339293882119518[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_4820339293882119518[15] = sin(in_vec[0])*sin(in_vec[2]) + sin(in_vec[1])*cos(in_vec[0])*cos(in_vec[2]); + out_4820339293882119518[16] = -sin(in_vec[0])*cos(in_vec[2]) + sin(in_vec[1])*sin(in_vec[2])*cos(in_vec[0]); + out_4820339293882119518[17] = cos(in_vec[0])*cos(in_vec[1]); } -void err_fun(double *nom_x, double *delta_x, double *out_900214999320880639) { - out_900214999320880639[0] = delta_x[0] + nom_x[0]; - out_900214999320880639[1] = delta_x[1] + nom_x[1]; - out_900214999320880639[2] = delta_x[2] + nom_x[2]; - out_900214999320880639[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_900214999320880639[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_900214999320880639[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_900214999320880639[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_900214999320880639[7] = delta_x[6] + nom_x[7]; - out_900214999320880639[8] = delta_x[7] + nom_x[8]; - out_900214999320880639[9] = delta_x[8] + nom_x[9]; - out_900214999320880639[10] = delta_x[9] + nom_x[10]; - out_900214999320880639[11] = delta_x[10] + nom_x[11]; - out_900214999320880639[12] = delta_x[11] + nom_x[12]; - out_900214999320880639[13] = delta_x[12] + nom_x[13]; - out_900214999320880639[14] = delta_x[13] + nom_x[14]; - out_900214999320880639[15] = delta_x[14] + nom_x[15]; - out_900214999320880639[16] = delta_x[15] + nom_x[16]; - out_900214999320880639[17] = delta_x[16] + nom_x[17]; - out_900214999320880639[18] = delta_x[17] + nom_x[18]; - out_900214999320880639[19] = delta_x[18] + nom_x[19]; - out_900214999320880639[20] = delta_x[19] + nom_x[20]; - out_900214999320880639[21] = delta_x[20] + nom_x[21]; +void err_fun(double *nom_x, double *delta_x, double *out_3392766111887124100) { + out_3392766111887124100[0] = delta_x[0] + nom_x[0]; + out_3392766111887124100[1] = delta_x[1] + nom_x[1]; + out_3392766111887124100[2] = delta_x[2] + nom_x[2]; + out_3392766111887124100[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_3392766111887124100[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_3392766111887124100[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_3392766111887124100[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_3392766111887124100[7] = delta_x[6] + nom_x[7]; + out_3392766111887124100[8] = delta_x[7] + nom_x[8]; + out_3392766111887124100[9] = delta_x[8] + nom_x[9]; + out_3392766111887124100[10] = delta_x[9] + nom_x[10]; + out_3392766111887124100[11] = delta_x[10] + nom_x[11]; + out_3392766111887124100[12] = delta_x[11] + nom_x[12]; + out_3392766111887124100[13] = delta_x[12] + nom_x[13]; + out_3392766111887124100[14] = delta_x[13] + nom_x[14]; + out_3392766111887124100[15] = delta_x[14] + nom_x[15]; + out_3392766111887124100[16] = delta_x[15] + nom_x[16]; + out_3392766111887124100[17] = delta_x[16] + nom_x[17]; + out_3392766111887124100[18] = delta_x[17] + nom_x[18]; + out_3392766111887124100[19] = delta_x[18] + nom_x[19]; + out_3392766111887124100[20] = delta_x[19] + nom_x[20]; + out_3392766111887124100[21] = delta_x[20] + nom_x[21]; } -void inv_err_fun(double *nom_x, double *true_x, double *out_6228497090895348531) { - out_6228497090895348531[0] = -nom_x[0] + true_x[0]; - out_6228497090895348531[1] = -nom_x[1] + true_x[1]; - out_6228497090895348531[2] = -nom_x[2] + true_x[2]; - out_6228497090895348531[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_6228497090895348531[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_6228497090895348531[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_6228497090895348531[6] = -nom_x[7] + true_x[7]; - out_6228497090895348531[7] = -nom_x[8] + true_x[8]; - out_6228497090895348531[8] = -nom_x[9] + true_x[9]; - out_6228497090895348531[9] = -nom_x[10] + true_x[10]; - out_6228497090895348531[10] = -nom_x[11] + true_x[11]; - out_6228497090895348531[11] = -nom_x[12] + true_x[12]; - out_6228497090895348531[12] = -nom_x[13] + true_x[13]; - out_6228497090895348531[13] = -nom_x[14] + true_x[14]; - out_6228497090895348531[14] = -nom_x[15] + true_x[15]; - out_6228497090895348531[15] = -nom_x[16] + true_x[16]; - out_6228497090895348531[16] = -nom_x[17] + true_x[17]; - out_6228497090895348531[17] = -nom_x[18] + true_x[18]; - out_6228497090895348531[18] = -nom_x[19] + true_x[19]; - out_6228497090895348531[19] = -nom_x[20] + true_x[20]; - out_6228497090895348531[20] = -nom_x[21] + true_x[21]; +void inv_err_fun(double *nom_x, double *true_x, double *out_2216925330683638231) { + out_2216925330683638231[0] = -nom_x[0] + true_x[0]; + out_2216925330683638231[1] = -nom_x[1] + true_x[1]; + out_2216925330683638231[2] = -nom_x[2] + true_x[2]; + out_2216925330683638231[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_2216925330683638231[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_2216925330683638231[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_2216925330683638231[6] = -nom_x[7] + true_x[7]; + out_2216925330683638231[7] = -nom_x[8] + true_x[8]; + out_2216925330683638231[8] = -nom_x[9] + true_x[9]; + out_2216925330683638231[9] = -nom_x[10] + true_x[10]; + out_2216925330683638231[10] = -nom_x[11] + true_x[11]; + out_2216925330683638231[11] = -nom_x[12] + true_x[12]; + out_2216925330683638231[12] = -nom_x[13] + true_x[13]; + out_2216925330683638231[13] = -nom_x[14] + true_x[14]; + out_2216925330683638231[14] = -nom_x[15] + true_x[15]; + out_2216925330683638231[15] = -nom_x[16] + true_x[16]; + out_2216925330683638231[16] = -nom_x[17] + true_x[17]; + out_2216925330683638231[17] = -nom_x[18] + true_x[18]; + out_2216925330683638231[18] = -nom_x[19] + true_x[19]; + out_2216925330683638231[19] = -nom_x[20] + true_x[20]; + out_2216925330683638231[20] = -nom_x[21] + true_x[21]; } -void H_mod_fun(double *state, double *out_6900568612264374751) { - out_6900568612264374751[0] = 1.0; - out_6900568612264374751[1] = 0; - out_6900568612264374751[2] = 0; - out_6900568612264374751[3] = 0; - out_6900568612264374751[4] = 0; - out_6900568612264374751[5] = 0; - out_6900568612264374751[6] = 0; - out_6900568612264374751[7] = 0; - out_6900568612264374751[8] = 0; - out_6900568612264374751[9] = 0; - out_6900568612264374751[10] = 0; - out_6900568612264374751[11] = 0; - out_6900568612264374751[12] = 0; - out_6900568612264374751[13] = 0; - out_6900568612264374751[14] = 0; - out_6900568612264374751[15] = 0; - out_6900568612264374751[16] = 0; - out_6900568612264374751[17] = 0; - out_6900568612264374751[18] = 0; - out_6900568612264374751[19] = 0; - out_6900568612264374751[20] = 0; - out_6900568612264374751[21] = 0; - out_6900568612264374751[22] = 1.0; - out_6900568612264374751[23] = 0; - out_6900568612264374751[24] = 0; - out_6900568612264374751[25] = 0; - out_6900568612264374751[26] = 0; - out_6900568612264374751[27] = 0; - out_6900568612264374751[28] = 0; - out_6900568612264374751[29] = 0; - out_6900568612264374751[30] = 0; - out_6900568612264374751[31] = 0; - out_6900568612264374751[32] = 0; - out_6900568612264374751[33] = 0; - out_6900568612264374751[34] = 0; - out_6900568612264374751[35] = 0; - out_6900568612264374751[36] = 0; - out_6900568612264374751[37] = 0; - out_6900568612264374751[38] = 0; - out_6900568612264374751[39] = 0; - out_6900568612264374751[40] = 0; - out_6900568612264374751[41] = 0; - out_6900568612264374751[42] = 0; - out_6900568612264374751[43] = 0; - out_6900568612264374751[44] = 1.0; - out_6900568612264374751[45] = 0; - out_6900568612264374751[46] = 0; - out_6900568612264374751[47] = 0; - out_6900568612264374751[48] = 0; - out_6900568612264374751[49] = 0; - out_6900568612264374751[50] = 0; - out_6900568612264374751[51] = 0; - out_6900568612264374751[52] = 0; - out_6900568612264374751[53] = 0; - out_6900568612264374751[54] = 0; - out_6900568612264374751[55] = 0; - out_6900568612264374751[56] = 0; - out_6900568612264374751[57] = 0; - out_6900568612264374751[58] = 0; - out_6900568612264374751[59] = 0; - out_6900568612264374751[60] = 0; - out_6900568612264374751[61] = 0; - out_6900568612264374751[62] = 0; - out_6900568612264374751[63] = 0; - out_6900568612264374751[64] = 0; - out_6900568612264374751[65] = 0; - out_6900568612264374751[66] = -0.5*state[4]; - out_6900568612264374751[67] = -0.5*state[5]; - out_6900568612264374751[68] = -0.5*state[6]; - out_6900568612264374751[69] = 0; - out_6900568612264374751[70] = 0; - out_6900568612264374751[71] = 0; - out_6900568612264374751[72] = 0; - out_6900568612264374751[73] = 0; - out_6900568612264374751[74] = 0; - out_6900568612264374751[75] = 0; - out_6900568612264374751[76] = 0; - out_6900568612264374751[77] = 0; - out_6900568612264374751[78] = 0; - out_6900568612264374751[79] = 0; - out_6900568612264374751[80] = 0; - out_6900568612264374751[81] = 0; - out_6900568612264374751[82] = 0; - out_6900568612264374751[83] = 0; - out_6900568612264374751[84] = 0; - out_6900568612264374751[85] = 0; - out_6900568612264374751[86] = 0; - out_6900568612264374751[87] = 0.5*state[3]; - out_6900568612264374751[88] = 0.5*state[6]; - out_6900568612264374751[89] = -0.5*state[5]; - out_6900568612264374751[90] = 0; - out_6900568612264374751[91] = 0; - out_6900568612264374751[92] = 0; - out_6900568612264374751[93] = 0; - out_6900568612264374751[94] = 0; - out_6900568612264374751[95] = 0; - out_6900568612264374751[96] = 0; - out_6900568612264374751[97] = 0; - out_6900568612264374751[98] = 0; - out_6900568612264374751[99] = 0; - out_6900568612264374751[100] = 0; - out_6900568612264374751[101] = 0; - out_6900568612264374751[102] = 0; - out_6900568612264374751[103] = 0; - out_6900568612264374751[104] = 0; - out_6900568612264374751[105] = 0; - out_6900568612264374751[106] = 0; - out_6900568612264374751[107] = 0; - out_6900568612264374751[108] = -0.5*state[6]; - out_6900568612264374751[109] = 0.5*state[3]; - out_6900568612264374751[110] = 0.5*state[4]; - out_6900568612264374751[111] = 0; - out_6900568612264374751[112] = 0; - out_6900568612264374751[113] = 0; - out_6900568612264374751[114] = 0; - out_6900568612264374751[115] = 0; - out_6900568612264374751[116] = 0; - out_6900568612264374751[117] = 0; - out_6900568612264374751[118] = 0; - out_6900568612264374751[119] = 0; - out_6900568612264374751[120] = 0; - out_6900568612264374751[121] = 0; - out_6900568612264374751[122] = 0; - out_6900568612264374751[123] = 0; - out_6900568612264374751[124] = 0; - out_6900568612264374751[125] = 0; - out_6900568612264374751[126] = 0; - out_6900568612264374751[127] = 0; - out_6900568612264374751[128] = 0; - out_6900568612264374751[129] = 0.5*state[5]; - out_6900568612264374751[130] = -0.5*state[4]; - out_6900568612264374751[131] = 0.5*state[3]; - out_6900568612264374751[132] = 0; - out_6900568612264374751[133] = 0; - out_6900568612264374751[134] = 0; - out_6900568612264374751[135] = 0; - out_6900568612264374751[136] = 0; - out_6900568612264374751[137] = 0; - out_6900568612264374751[138] = 0; - out_6900568612264374751[139] = 0; - out_6900568612264374751[140] = 0; - out_6900568612264374751[141] = 0; - out_6900568612264374751[142] = 0; - out_6900568612264374751[143] = 0; - out_6900568612264374751[144] = 0; - out_6900568612264374751[145] = 0; - out_6900568612264374751[146] = 0; - out_6900568612264374751[147] = 0; - out_6900568612264374751[148] = 0; - out_6900568612264374751[149] = 0; - out_6900568612264374751[150] = 0; - out_6900568612264374751[151] = 0; - out_6900568612264374751[152] = 0; - out_6900568612264374751[153] = 1.0; - out_6900568612264374751[154] = 0; - out_6900568612264374751[155] = 0; - out_6900568612264374751[156] = 0; - out_6900568612264374751[157] = 0; - out_6900568612264374751[158] = 0; - out_6900568612264374751[159] = 0; - out_6900568612264374751[160] = 0; - out_6900568612264374751[161] = 0; - out_6900568612264374751[162] = 0; - out_6900568612264374751[163] = 0; - out_6900568612264374751[164] = 0; - out_6900568612264374751[165] = 0; - out_6900568612264374751[166] = 0; - out_6900568612264374751[167] = 0; - out_6900568612264374751[168] = 0; - out_6900568612264374751[169] = 0; - out_6900568612264374751[170] = 0; - out_6900568612264374751[171] = 0; - out_6900568612264374751[172] = 0; - out_6900568612264374751[173] = 0; - out_6900568612264374751[174] = 0; - out_6900568612264374751[175] = 1.0; - out_6900568612264374751[176] = 0; - out_6900568612264374751[177] = 0; - out_6900568612264374751[178] = 0; - out_6900568612264374751[179] = 0; - out_6900568612264374751[180] = 0; - out_6900568612264374751[181] = 0; - out_6900568612264374751[182] = 0; - out_6900568612264374751[183] = 0; - out_6900568612264374751[184] = 0; - out_6900568612264374751[185] = 0; - out_6900568612264374751[186] = 0; - out_6900568612264374751[187] = 0; - out_6900568612264374751[188] = 0; - out_6900568612264374751[189] = 0; - out_6900568612264374751[190] = 0; - out_6900568612264374751[191] = 0; - out_6900568612264374751[192] = 0; - out_6900568612264374751[193] = 0; - out_6900568612264374751[194] = 0; - out_6900568612264374751[195] = 0; - out_6900568612264374751[196] = 0; - out_6900568612264374751[197] = 1.0; - out_6900568612264374751[198] = 0; - out_6900568612264374751[199] = 0; - out_6900568612264374751[200] = 0; - out_6900568612264374751[201] = 0; - out_6900568612264374751[202] = 0; - out_6900568612264374751[203] = 0; - out_6900568612264374751[204] = 0; - out_6900568612264374751[205] = 0; - out_6900568612264374751[206] = 0; - out_6900568612264374751[207] = 0; - out_6900568612264374751[208] = 0; - out_6900568612264374751[209] = 0; - out_6900568612264374751[210] = 0; - out_6900568612264374751[211] = 0; - out_6900568612264374751[212] = 0; - out_6900568612264374751[213] = 0; - out_6900568612264374751[214] = 0; - out_6900568612264374751[215] = 0; - out_6900568612264374751[216] = 0; - out_6900568612264374751[217] = 0; - out_6900568612264374751[218] = 0; - out_6900568612264374751[219] = 1.0; - out_6900568612264374751[220] = 0; - out_6900568612264374751[221] = 0; - out_6900568612264374751[222] = 0; - out_6900568612264374751[223] = 0; - out_6900568612264374751[224] = 0; - out_6900568612264374751[225] = 0; - out_6900568612264374751[226] = 0; - out_6900568612264374751[227] = 0; - out_6900568612264374751[228] = 0; - out_6900568612264374751[229] = 0; - out_6900568612264374751[230] = 0; - out_6900568612264374751[231] = 0; - out_6900568612264374751[232] = 0; - out_6900568612264374751[233] = 0; - out_6900568612264374751[234] = 0; - out_6900568612264374751[235] = 0; - out_6900568612264374751[236] = 0; - out_6900568612264374751[237] = 0; - out_6900568612264374751[238] = 0; - out_6900568612264374751[239] = 0; - out_6900568612264374751[240] = 0; - out_6900568612264374751[241] = 1.0; - out_6900568612264374751[242] = 0; - out_6900568612264374751[243] = 0; - out_6900568612264374751[244] = 0; - out_6900568612264374751[245] = 0; - out_6900568612264374751[246] = 0; - out_6900568612264374751[247] = 0; - out_6900568612264374751[248] = 0; - out_6900568612264374751[249] = 0; - out_6900568612264374751[250] = 0; - out_6900568612264374751[251] = 0; - out_6900568612264374751[252] = 0; - out_6900568612264374751[253] = 0; - out_6900568612264374751[254] = 0; - out_6900568612264374751[255] = 0; - out_6900568612264374751[256] = 0; - out_6900568612264374751[257] = 0; - out_6900568612264374751[258] = 0; - out_6900568612264374751[259] = 0; - out_6900568612264374751[260] = 0; - out_6900568612264374751[261] = 0; - out_6900568612264374751[262] = 0; - out_6900568612264374751[263] = 1.0; - out_6900568612264374751[264] = 0; - out_6900568612264374751[265] = 0; - out_6900568612264374751[266] = 0; - out_6900568612264374751[267] = 0; - out_6900568612264374751[268] = 0; - out_6900568612264374751[269] = 0; - out_6900568612264374751[270] = 0; - out_6900568612264374751[271] = 0; - out_6900568612264374751[272] = 0; - out_6900568612264374751[273] = 0; - out_6900568612264374751[274] = 0; - out_6900568612264374751[275] = 0; - out_6900568612264374751[276] = 0; - out_6900568612264374751[277] = 0; - out_6900568612264374751[278] = 0; - out_6900568612264374751[279] = 0; - out_6900568612264374751[280] = 0; - out_6900568612264374751[281] = 0; - out_6900568612264374751[282] = 0; - out_6900568612264374751[283] = 0; - out_6900568612264374751[284] = 0; - out_6900568612264374751[285] = 1.0; - out_6900568612264374751[286] = 0; - out_6900568612264374751[287] = 0; - out_6900568612264374751[288] = 0; - out_6900568612264374751[289] = 0; - out_6900568612264374751[290] = 0; - out_6900568612264374751[291] = 0; - out_6900568612264374751[292] = 0; - out_6900568612264374751[293] = 0; - out_6900568612264374751[294] = 0; - out_6900568612264374751[295] = 0; - out_6900568612264374751[296] = 0; - out_6900568612264374751[297] = 0; - out_6900568612264374751[298] = 0; - out_6900568612264374751[299] = 0; - out_6900568612264374751[300] = 0; - out_6900568612264374751[301] = 0; - out_6900568612264374751[302] = 0; - out_6900568612264374751[303] = 0; - out_6900568612264374751[304] = 0; - out_6900568612264374751[305] = 0; - out_6900568612264374751[306] = 0; - out_6900568612264374751[307] = 1.0; - out_6900568612264374751[308] = 0; - out_6900568612264374751[309] = 0; - out_6900568612264374751[310] = 0; - out_6900568612264374751[311] = 0; - out_6900568612264374751[312] = 0; - out_6900568612264374751[313] = 0; - out_6900568612264374751[314] = 0; - out_6900568612264374751[315] = 0; - out_6900568612264374751[316] = 0; - out_6900568612264374751[317] = 0; - out_6900568612264374751[318] = 0; - out_6900568612264374751[319] = 0; - out_6900568612264374751[320] = 0; - out_6900568612264374751[321] = 0; - out_6900568612264374751[322] = 0; - out_6900568612264374751[323] = 0; - out_6900568612264374751[324] = 0; - out_6900568612264374751[325] = 0; - out_6900568612264374751[326] = 0; - out_6900568612264374751[327] = 0; - out_6900568612264374751[328] = 0; - out_6900568612264374751[329] = 1.0; - out_6900568612264374751[330] = 0; - out_6900568612264374751[331] = 0; - out_6900568612264374751[332] = 0; - out_6900568612264374751[333] = 0; - out_6900568612264374751[334] = 0; - out_6900568612264374751[335] = 0; - out_6900568612264374751[336] = 0; - out_6900568612264374751[337] = 0; - out_6900568612264374751[338] = 0; - out_6900568612264374751[339] = 0; - out_6900568612264374751[340] = 0; - out_6900568612264374751[341] = 0; - out_6900568612264374751[342] = 0; - out_6900568612264374751[343] = 0; - out_6900568612264374751[344] = 0; - out_6900568612264374751[345] = 0; - out_6900568612264374751[346] = 0; - out_6900568612264374751[347] = 0; - out_6900568612264374751[348] = 0; - out_6900568612264374751[349] = 0; - out_6900568612264374751[350] = 0; - out_6900568612264374751[351] = 1.0; - out_6900568612264374751[352] = 0; - out_6900568612264374751[353] = 0; - out_6900568612264374751[354] = 0; - out_6900568612264374751[355] = 0; - out_6900568612264374751[356] = 0; - out_6900568612264374751[357] = 0; - out_6900568612264374751[358] = 0; - out_6900568612264374751[359] = 0; - out_6900568612264374751[360] = 0; - out_6900568612264374751[361] = 0; - out_6900568612264374751[362] = 0; - out_6900568612264374751[363] = 0; - out_6900568612264374751[364] = 0; - out_6900568612264374751[365] = 0; - out_6900568612264374751[366] = 0; - out_6900568612264374751[367] = 0; - out_6900568612264374751[368] = 0; - out_6900568612264374751[369] = 0; - out_6900568612264374751[370] = 0; - out_6900568612264374751[371] = 0; - out_6900568612264374751[372] = 0; - out_6900568612264374751[373] = 1.0; - out_6900568612264374751[374] = 0; - out_6900568612264374751[375] = 0; - out_6900568612264374751[376] = 0; - out_6900568612264374751[377] = 0; - out_6900568612264374751[378] = 0; - out_6900568612264374751[379] = 0; - out_6900568612264374751[380] = 0; - out_6900568612264374751[381] = 0; - out_6900568612264374751[382] = 0; - out_6900568612264374751[383] = 0; - out_6900568612264374751[384] = 0; - out_6900568612264374751[385] = 0; - out_6900568612264374751[386] = 0; - out_6900568612264374751[387] = 0; - out_6900568612264374751[388] = 0; - out_6900568612264374751[389] = 0; - out_6900568612264374751[390] = 0; - out_6900568612264374751[391] = 0; - out_6900568612264374751[392] = 0; - out_6900568612264374751[393] = 0; - out_6900568612264374751[394] = 0; - out_6900568612264374751[395] = 1.0; - out_6900568612264374751[396] = 0; - out_6900568612264374751[397] = 0; - out_6900568612264374751[398] = 0; - out_6900568612264374751[399] = 0; - out_6900568612264374751[400] = 0; - out_6900568612264374751[401] = 0; - out_6900568612264374751[402] = 0; - out_6900568612264374751[403] = 0; - out_6900568612264374751[404] = 0; - out_6900568612264374751[405] = 0; - out_6900568612264374751[406] = 0; - out_6900568612264374751[407] = 0; - out_6900568612264374751[408] = 0; - out_6900568612264374751[409] = 0; - out_6900568612264374751[410] = 0; - out_6900568612264374751[411] = 0; - out_6900568612264374751[412] = 0; - out_6900568612264374751[413] = 0; - out_6900568612264374751[414] = 0; - out_6900568612264374751[415] = 0; - out_6900568612264374751[416] = 0; - out_6900568612264374751[417] = 1.0; - out_6900568612264374751[418] = 0; - out_6900568612264374751[419] = 0; - out_6900568612264374751[420] = 0; - out_6900568612264374751[421] = 0; - out_6900568612264374751[422] = 0; - out_6900568612264374751[423] = 0; - out_6900568612264374751[424] = 0; - out_6900568612264374751[425] = 0; - out_6900568612264374751[426] = 0; - out_6900568612264374751[427] = 0; - out_6900568612264374751[428] = 0; - out_6900568612264374751[429] = 0; - out_6900568612264374751[430] = 0; - out_6900568612264374751[431] = 0; - out_6900568612264374751[432] = 0; - out_6900568612264374751[433] = 0; - out_6900568612264374751[434] = 0; - out_6900568612264374751[435] = 0; - out_6900568612264374751[436] = 0; - out_6900568612264374751[437] = 0; - out_6900568612264374751[438] = 0; - out_6900568612264374751[439] = 1.0; - out_6900568612264374751[440] = 0; - out_6900568612264374751[441] = 0; - out_6900568612264374751[442] = 0; - out_6900568612264374751[443] = 0; - out_6900568612264374751[444] = 0; - out_6900568612264374751[445] = 0; - out_6900568612264374751[446] = 0; - out_6900568612264374751[447] = 0; - out_6900568612264374751[448] = 0; - out_6900568612264374751[449] = 0; - out_6900568612264374751[450] = 0; - out_6900568612264374751[451] = 0; - out_6900568612264374751[452] = 0; - out_6900568612264374751[453] = 0; - out_6900568612264374751[454] = 0; - out_6900568612264374751[455] = 0; - out_6900568612264374751[456] = 0; - out_6900568612264374751[457] = 0; - out_6900568612264374751[458] = 0; - out_6900568612264374751[459] = 0; - out_6900568612264374751[460] = 0; - out_6900568612264374751[461] = 1.0; +void H_mod_fun(double *state, double *out_679232602159257814) { + out_679232602159257814[0] = 1.0; + out_679232602159257814[1] = 0; + out_679232602159257814[2] = 0; + out_679232602159257814[3] = 0; + out_679232602159257814[4] = 0; + out_679232602159257814[5] = 0; + out_679232602159257814[6] = 0; + out_679232602159257814[7] = 0; + out_679232602159257814[8] = 0; + out_679232602159257814[9] = 0; + out_679232602159257814[10] = 0; + out_679232602159257814[11] = 0; + out_679232602159257814[12] = 0; + out_679232602159257814[13] = 0; + out_679232602159257814[14] = 0; + out_679232602159257814[15] = 0; + out_679232602159257814[16] = 0; + out_679232602159257814[17] = 0; + out_679232602159257814[18] = 0; + out_679232602159257814[19] = 0; + out_679232602159257814[20] = 0; + out_679232602159257814[21] = 0; + out_679232602159257814[22] = 1.0; + out_679232602159257814[23] = 0; + out_679232602159257814[24] = 0; + out_679232602159257814[25] = 0; + out_679232602159257814[26] = 0; + out_679232602159257814[27] = 0; + out_679232602159257814[28] = 0; + out_679232602159257814[29] = 0; + out_679232602159257814[30] = 0; + out_679232602159257814[31] = 0; + out_679232602159257814[32] = 0; + out_679232602159257814[33] = 0; + out_679232602159257814[34] = 0; + out_679232602159257814[35] = 0; + out_679232602159257814[36] = 0; + out_679232602159257814[37] = 0; + out_679232602159257814[38] = 0; + out_679232602159257814[39] = 0; + out_679232602159257814[40] = 0; + out_679232602159257814[41] = 0; + out_679232602159257814[42] = 0; + out_679232602159257814[43] = 0; + out_679232602159257814[44] = 1.0; + out_679232602159257814[45] = 0; + out_679232602159257814[46] = 0; + out_679232602159257814[47] = 0; + out_679232602159257814[48] = 0; + out_679232602159257814[49] = 0; + out_679232602159257814[50] = 0; + out_679232602159257814[51] = 0; + out_679232602159257814[52] = 0; + out_679232602159257814[53] = 0; + out_679232602159257814[54] = 0; + out_679232602159257814[55] = 0; + out_679232602159257814[56] = 0; + out_679232602159257814[57] = 0; + out_679232602159257814[58] = 0; + out_679232602159257814[59] = 0; + out_679232602159257814[60] = 0; + out_679232602159257814[61] = 0; + out_679232602159257814[62] = 0; + out_679232602159257814[63] = 0; + out_679232602159257814[64] = 0; + out_679232602159257814[65] = 0; + out_679232602159257814[66] = -0.5*state[4]; + out_679232602159257814[67] = -0.5*state[5]; + out_679232602159257814[68] = -0.5*state[6]; + out_679232602159257814[69] = 0; + out_679232602159257814[70] = 0; + out_679232602159257814[71] = 0; + out_679232602159257814[72] = 0; + out_679232602159257814[73] = 0; + out_679232602159257814[74] = 0; + out_679232602159257814[75] = 0; + out_679232602159257814[76] = 0; + out_679232602159257814[77] = 0; + out_679232602159257814[78] = 0; + out_679232602159257814[79] = 0; + out_679232602159257814[80] = 0; + out_679232602159257814[81] = 0; + out_679232602159257814[82] = 0; + out_679232602159257814[83] = 0; + out_679232602159257814[84] = 0; + out_679232602159257814[85] = 0; + out_679232602159257814[86] = 0; + out_679232602159257814[87] = 0.5*state[3]; + out_679232602159257814[88] = 0.5*state[6]; + out_679232602159257814[89] = -0.5*state[5]; + out_679232602159257814[90] = 0; + out_679232602159257814[91] = 0; + out_679232602159257814[92] = 0; + out_679232602159257814[93] = 0; + out_679232602159257814[94] = 0; + out_679232602159257814[95] = 0; + out_679232602159257814[96] = 0; + out_679232602159257814[97] = 0; + out_679232602159257814[98] = 0; + out_679232602159257814[99] = 0; + out_679232602159257814[100] = 0; + out_679232602159257814[101] = 0; + out_679232602159257814[102] = 0; + out_679232602159257814[103] = 0; + out_679232602159257814[104] = 0; + out_679232602159257814[105] = 0; + out_679232602159257814[106] = 0; + out_679232602159257814[107] = 0; + out_679232602159257814[108] = -0.5*state[6]; + out_679232602159257814[109] = 0.5*state[3]; + out_679232602159257814[110] = 0.5*state[4]; + out_679232602159257814[111] = 0; + out_679232602159257814[112] = 0; + out_679232602159257814[113] = 0; + out_679232602159257814[114] = 0; + out_679232602159257814[115] = 0; + out_679232602159257814[116] = 0; + out_679232602159257814[117] = 0; + out_679232602159257814[118] = 0; + out_679232602159257814[119] = 0; + out_679232602159257814[120] = 0; + out_679232602159257814[121] = 0; + out_679232602159257814[122] = 0; + out_679232602159257814[123] = 0; + out_679232602159257814[124] = 0; + out_679232602159257814[125] = 0; + out_679232602159257814[126] = 0; + out_679232602159257814[127] = 0; + out_679232602159257814[128] = 0; + out_679232602159257814[129] = 0.5*state[5]; + out_679232602159257814[130] = -0.5*state[4]; + out_679232602159257814[131] = 0.5*state[3]; + out_679232602159257814[132] = 0; + out_679232602159257814[133] = 0; + out_679232602159257814[134] = 0; + out_679232602159257814[135] = 0; + out_679232602159257814[136] = 0; + out_679232602159257814[137] = 0; + out_679232602159257814[138] = 0; + out_679232602159257814[139] = 0; + out_679232602159257814[140] = 0; + out_679232602159257814[141] = 0; + out_679232602159257814[142] = 0; + out_679232602159257814[143] = 0; + out_679232602159257814[144] = 0; + out_679232602159257814[145] = 0; + out_679232602159257814[146] = 0; + out_679232602159257814[147] = 0; + out_679232602159257814[148] = 0; + out_679232602159257814[149] = 0; + out_679232602159257814[150] = 0; + out_679232602159257814[151] = 0; + out_679232602159257814[152] = 0; + out_679232602159257814[153] = 1.0; + out_679232602159257814[154] = 0; + out_679232602159257814[155] = 0; + out_679232602159257814[156] = 0; + out_679232602159257814[157] = 0; + out_679232602159257814[158] = 0; + out_679232602159257814[159] = 0; + out_679232602159257814[160] = 0; + out_679232602159257814[161] = 0; + out_679232602159257814[162] = 0; + out_679232602159257814[163] = 0; + out_679232602159257814[164] = 0; + out_679232602159257814[165] = 0; + out_679232602159257814[166] = 0; + out_679232602159257814[167] = 0; + out_679232602159257814[168] = 0; + out_679232602159257814[169] = 0; + out_679232602159257814[170] = 0; + out_679232602159257814[171] = 0; + out_679232602159257814[172] = 0; + out_679232602159257814[173] = 0; + out_679232602159257814[174] = 0; + out_679232602159257814[175] = 1.0; + out_679232602159257814[176] = 0; + out_679232602159257814[177] = 0; + out_679232602159257814[178] = 0; + out_679232602159257814[179] = 0; + out_679232602159257814[180] = 0; + out_679232602159257814[181] = 0; + out_679232602159257814[182] = 0; + out_679232602159257814[183] = 0; + out_679232602159257814[184] = 0; + out_679232602159257814[185] = 0; + out_679232602159257814[186] = 0; + out_679232602159257814[187] = 0; + out_679232602159257814[188] = 0; + out_679232602159257814[189] = 0; + out_679232602159257814[190] = 0; + out_679232602159257814[191] = 0; + out_679232602159257814[192] = 0; + out_679232602159257814[193] = 0; + out_679232602159257814[194] = 0; + out_679232602159257814[195] = 0; + out_679232602159257814[196] = 0; + out_679232602159257814[197] = 1.0; + out_679232602159257814[198] = 0; + out_679232602159257814[199] = 0; + out_679232602159257814[200] = 0; + out_679232602159257814[201] = 0; + out_679232602159257814[202] = 0; + out_679232602159257814[203] = 0; + out_679232602159257814[204] = 0; + out_679232602159257814[205] = 0; + out_679232602159257814[206] = 0; + out_679232602159257814[207] = 0; + out_679232602159257814[208] = 0; + out_679232602159257814[209] = 0; + out_679232602159257814[210] = 0; + out_679232602159257814[211] = 0; + out_679232602159257814[212] = 0; + out_679232602159257814[213] = 0; + out_679232602159257814[214] = 0; + out_679232602159257814[215] = 0; + out_679232602159257814[216] = 0; + out_679232602159257814[217] = 0; + out_679232602159257814[218] = 0; + out_679232602159257814[219] = 1.0; + out_679232602159257814[220] = 0; + out_679232602159257814[221] = 0; + out_679232602159257814[222] = 0; + out_679232602159257814[223] = 0; + out_679232602159257814[224] = 0; + out_679232602159257814[225] = 0; + out_679232602159257814[226] = 0; + out_679232602159257814[227] = 0; + out_679232602159257814[228] = 0; + out_679232602159257814[229] = 0; + out_679232602159257814[230] = 0; + out_679232602159257814[231] = 0; + out_679232602159257814[232] = 0; + out_679232602159257814[233] = 0; + out_679232602159257814[234] = 0; + out_679232602159257814[235] = 0; + out_679232602159257814[236] = 0; + out_679232602159257814[237] = 0; + out_679232602159257814[238] = 0; + out_679232602159257814[239] = 0; + out_679232602159257814[240] = 0; + out_679232602159257814[241] = 1.0; + out_679232602159257814[242] = 0; + out_679232602159257814[243] = 0; + out_679232602159257814[244] = 0; + out_679232602159257814[245] = 0; + out_679232602159257814[246] = 0; + out_679232602159257814[247] = 0; + out_679232602159257814[248] = 0; + out_679232602159257814[249] = 0; + out_679232602159257814[250] = 0; + out_679232602159257814[251] = 0; + out_679232602159257814[252] = 0; + out_679232602159257814[253] = 0; + out_679232602159257814[254] = 0; + out_679232602159257814[255] = 0; + out_679232602159257814[256] = 0; + out_679232602159257814[257] = 0; + out_679232602159257814[258] = 0; + out_679232602159257814[259] = 0; + out_679232602159257814[260] = 0; + out_679232602159257814[261] = 0; + out_679232602159257814[262] = 0; + out_679232602159257814[263] = 1.0; + out_679232602159257814[264] = 0; + out_679232602159257814[265] = 0; + out_679232602159257814[266] = 0; + out_679232602159257814[267] = 0; + out_679232602159257814[268] = 0; + out_679232602159257814[269] = 0; + out_679232602159257814[270] = 0; + out_679232602159257814[271] = 0; + out_679232602159257814[272] = 0; + out_679232602159257814[273] = 0; + out_679232602159257814[274] = 0; + out_679232602159257814[275] = 0; + out_679232602159257814[276] = 0; + out_679232602159257814[277] = 0; + out_679232602159257814[278] = 0; + out_679232602159257814[279] = 0; + out_679232602159257814[280] = 0; + out_679232602159257814[281] = 0; + out_679232602159257814[282] = 0; + out_679232602159257814[283] = 0; + out_679232602159257814[284] = 0; + out_679232602159257814[285] = 1.0; + out_679232602159257814[286] = 0; + out_679232602159257814[287] = 0; + out_679232602159257814[288] = 0; + out_679232602159257814[289] = 0; + out_679232602159257814[290] = 0; + out_679232602159257814[291] = 0; + out_679232602159257814[292] = 0; + out_679232602159257814[293] = 0; + out_679232602159257814[294] = 0; + out_679232602159257814[295] = 0; + out_679232602159257814[296] = 0; + out_679232602159257814[297] = 0; + out_679232602159257814[298] = 0; + out_679232602159257814[299] = 0; + out_679232602159257814[300] = 0; + out_679232602159257814[301] = 0; + out_679232602159257814[302] = 0; + out_679232602159257814[303] = 0; + out_679232602159257814[304] = 0; + out_679232602159257814[305] = 0; + out_679232602159257814[306] = 0; + out_679232602159257814[307] = 1.0; + out_679232602159257814[308] = 0; + out_679232602159257814[309] = 0; + out_679232602159257814[310] = 0; + out_679232602159257814[311] = 0; + out_679232602159257814[312] = 0; + out_679232602159257814[313] = 0; + out_679232602159257814[314] = 0; + out_679232602159257814[315] = 0; + out_679232602159257814[316] = 0; + out_679232602159257814[317] = 0; + out_679232602159257814[318] = 0; + out_679232602159257814[319] = 0; + out_679232602159257814[320] = 0; + out_679232602159257814[321] = 0; + out_679232602159257814[322] = 0; + out_679232602159257814[323] = 0; + out_679232602159257814[324] = 0; + out_679232602159257814[325] = 0; + out_679232602159257814[326] = 0; + out_679232602159257814[327] = 0; + out_679232602159257814[328] = 0; + out_679232602159257814[329] = 1.0; + out_679232602159257814[330] = 0; + out_679232602159257814[331] = 0; + out_679232602159257814[332] = 0; + out_679232602159257814[333] = 0; + out_679232602159257814[334] = 0; + out_679232602159257814[335] = 0; + out_679232602159257814[336] = 0; + out_679232602159257814[337] = 0; + out_679232602159257814[338] = 0; + out_679232602159257814[339] = 0; + out_679232602159257814[340] = 0; + out_679232602159257814[341] = 0; + out_679232602159257814[342] = 0; + out_679232602159257814[343] = 0; + out_679232602159257814[344] = 0; + out_679232602159257814[345] = 0; + out_679232602159257814[346] = 0; + out_679232602159257814[347] = 0; + out_679232602159257814[348] = 0; + out_679232602159257814[349] = 0; + out_679232602159257814[350] = 0; + out_679232602159257814[351] = 1.0; + out_679232602159257814[352] = 0; + out_679232602159257814[353] = 0; + out_679232602159257814[354] = 0; + out_679232602159257814[355] = 0; + out_679232602159257814[356] = 0; + out_679232602159257814[357] = 0; + out_679232602159257814[358] = 0; + out_679232602159257814[359] = 0; + out_679232602159257814[360] = 0; + out_679232602159257814[361] = 0; + out_679232602159257814[362] = 0; + out_679232602159257814[363] = 0; + out_679232602159257814[364] = 0; + out_679232602159257814[365] = 0; + out_679232602159257814[366] = 0; + out_679232602159257814[367] = 0; + out_679232602159257814[368] = 0; + out_679232602159257814[369] = 0; + out_679232602159257814[370] = 0; + out_679232602159257814[371] = 0; + out_679232602159257814[372] = 0; + out_679232602159257814[373] = 1.0; + out_679232602159257814[374] = 0; + out_679232602159257814[375] = 0; + out_679232602159257814[376] = 0; + out_679232602159257814[377] = 0; + out_679232602159257814[378] = 0; + out_679232602159257814[379] = 0; + out_679232602159257814[380] = 0; + out_679232602159257814[381] = 0; + out_679232602159257814[382] = 0; + out_679232602159257814[383] = 0; + out_679232602159257814[384] = 0; + out_679232602159257814[385] = 0; + out_679232602159257814[386] = 0; + out_679232602159257814[387] = 0; + out_679232602159257814[388] = 0; + out_679232602159257814[389] = 0; + out_679232602159257814[390] = 0; + out_679232602159257814[391] = 0; + out_679232602159257814[392] = 0; + out_679232602159257814[393] = 0; + out_679232602159257814[394] = 0; + out_679232602159257814[395] = 1.0; + out_679232602159257814[396] = 0; + out_679232602159257814[397] = 0; + out_679232602159257814[398] = 0; + out_679232602159257814[399] = 0; + out_679232602159257814[400] = 0; + out_679232602159257814[401] = 0; + out_679232602159257814[402] = 0; + out_679232602159257814[403] = 0; + out_679232602159257814[404] = 0; + out_679232602159257814[405] = 0; + out_679232602159257814[406] = 0; + out_679232602159257814[407] = 0; + out_679232602159257814[408] = 0; + out_679232602159257814[409] = 0; + out_679232602159257814[410] = 0; + out_679232602159257814[411] = 0; + out_679232602159257814[412] = 0; + out_679232602159257814[413] = 0; + out_679232602159257814[414] = 0; + out_679232602159257814[415] = 0; + out_679232602159257814[416] = 0; + out_679232602159257814[417] = 1.0; + out_679232602159257814[418] = 0; + out_679232602159257814[419] = 0; + out_679232602159257814[420] = 0; + out_679232602159257814[421] = 0; + out_679232602159257814[422] = 0; + out_679232602159257814[423] = 0; + out_679232602159257814[424] = 0; + out_679232602159257814[425] = 0; + out_679232602159257814[426] = 0; + out_679232602159257814[427] = 0; + out_679232602159257814[428] = 0; + out_679232602159257814[429] = 0; + out_679232602159257814[430] = 0; + out_679232602159257814[431] = 0; + out_679232602159257814[432] = 0; + out_679232602159257814[433] = 0; + out_679232602159257814[434] = 0; + out_679232602159257814[435] = 0; + out_679232602159257814[436] = 0; + out_679232602159257814[437] = 0; + out_679232602159257814[438] = 0; + out_679232602159257814[439] = 1.0; + out_679232602159257814[440] = 0; + out_679232602159257814[441] = 0; + out_679232602159257814[442] = 0; + out_679232602159257814[443] = 0; + out_679232602159257814[444] = 0; + out_679232602159257814[445] = 0; + out_679232602159257814[446] = 0; + out_679232602159257814[447] = 0; + out_679232602159257814[448] = 0; + out_679232602159257814[449] = 0; + out_679232602159257814[450] = 0; + out_679232602159257814[451] = 0; + out_679232602159257814[452] = 0; + out_679232602159257814[453] = 0; + out_679232602159257814[454] = 0; + out_679232602159257814[455] = 0; + out_679232602159257814[456] = 0; + out_679232602159257814[457] = 0; + out_679232602159257814[458] = 0; + out_679232602159257814[459] = 0; + out_679232602159257814[460] = 0; + out_679232602159257814[461] = 1.0; } -void f_fun(double *state, double dt, double *out_444317293709373841) { - out_444317293709373841[0] = dt*state[7] + state[0]; - out_444317293709373841[1] = dt*state[8] + state[1]; - out_444317293709373841[2] = dt*state[9] + state[2]; - out_444317293709373841[3] = dt*(-0.5*state[4]*state[10] - 0.5*state[5]*state[11] - 0.5*state[6]*state[12]) + state[3]; - out_444317293709373841[4] = dt*(0.5*state[3]*state[10] + 0.5*state[5]*state[12] - 0.5*state[6]*state[11]) + state[4]; - out_444317293709373841[5] = dt*(0.5*state[3]*state[11] - 0.5*state[4]*state[12] + 0.5*state[6]*state[10]) + state[5]; - out_444317293709373841[6] = dt*(0.5*state[3]*state[12] + 0.5*state[4]*state[11] - 0.5*state[5]*state[10]) + state[6]; - out_444317293709373841[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_444317293709373841[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_444317293709373841[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_444317293709373841[10] = state[10]; - out_444317293709373841[11] = state[11]; - out_444317293709373841[12] = state[12]; - out_444317293709373841[13] = state[13]; - out_444317293709373841[14] = state[14]; - out_444317293709373841[15] = state[15]; - out_444317293709373841[16] = state[16]; - out_444317293709373841[17] = state[17]; - out_444317293709373841[18] = state[18]; - out_444317293709373841[19] = state[19]; - out_444317293709373841[20] = state[20]; - out_444317293709373841[21] = state[21]; +void f_fun(double *state, double dt, double *out_6123814017633530199) { + out_6123814017633530199[0] = dt*state[7] + state[0]; + out_6123814017633530199[1] = dt*state[8] + state[1]; + out_6123814017633530199[2] = dt*state[9] + state[2]; + out_6123814017633530199[3] = dt*(-0.5*state[4]*state[10] - 0.5*state[5]*state[11] - 0.5*state[6]*state[12]) + state[3]; + out_6123814017633530199[4] = dt*(0.5*state[3]*state[10] + 0.5*state[5]*state[12] - 0.5*state[6]*state[11]) + state[4]; + out_6123814017633530199[5] = dt*(0.5*state[3]*state[11] - 0.5*state[4]*state[12] + 0.5*state[6]*state[10]) + state[5]; + out_6123814017633530199[6] = dt*(0.5*state[3]*state[12] + 0.5*state[4]*state[11] - 0.5*state[5]*state[10]) + state[6]; + out_6123814017633530199[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_6123814017633530199[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_6123814017633530199[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_6123814017633530199[10] = state[10]; + out_6123814017633530199[11] = state[11]; + out_6123814017633530199[12] = state[12]; + out_6123814017633530199[13] = state[13]; + out_6123814017633530199[14] = state[14]; + out_6123814017633530199[15] = state[15]; + out_6123814017633530199[16] = state[16]; + out_6123814017633530199[17] = state[17]; + out_6123814017633530199[18] = state[18]; + out_6123814017633530199[19] = state[19]; + out_6123814017633530199[20] = state[20]; + out_6123814017633530199[21] = state[21]; } -void F_fun(double *state, double dt, double *out_833440091851189730) { - out_833440091851189730[0] = 1; - out_833440091851189730[1] = 0; - out_833440091851189730[2] = 0; - out_833440091851189730[3] = 0; - out_833440091851189730[4] = 0; - out_833440091851189730[5] = 0; - out_833440091851189730[6] = dt; - out_833440091851189730[7] = 0; - out_833440091851189730[8] = 0; - out_833440091851189730[9] = 0; - out_833440091851189730[10] = 0; - out_833440091851189730[11] = 0; - out_833440091851189730[12] = 0; - out_833440091851189730[13] = 0; - out_833440091851189730[14] = 0; - out_833440091851189730[15] = 0; - out_833440091851189730[16] = 0; - out_833440091851189730[17] = 0; - out_833440091851189730[18] = 0; - out_833440091851189730[19] = 0; - out_833440091851189730[20] = 0; - out_833440091851189730[21] = 0; - out_833440091851189730[22] = 1; - out_833440091851189730[23] = 0; - out_833440091851189730[24] = 0; - out_833440091851189730[25] = 0; - out_833440091851189730[26] = 0; - out_833440091851189730[27] = 0; - out_833440091851189730[28] = dt; - out_833440091851189730[29] = 0; - out_833440091851189730[30] = 0; - out_833440091851189730[31] = 0; - out_833440091851189730[32] = 0; - out_833440091851189730[33] = 0; - out_833440091851189730[34] = 0; - out_833440091851189730[35] = 0; - out_833440091851189730[36] = 0; - out_833440091851189730[37] = 0; - out_833440091851189730[38] = 0; - out_833440091851189730[39] = 0; - out_833440091851189730[40] = 0; - out_833440091851189730[41] = 0; - out_833440091851189730[42] = 0; - out_833440091851189730[43] = 0; - out_833440091851189730[44] = 1; - out_833440091851189730[45] = 0; - out_833440091851189730[46] = 0; - out_833440091851189730[47] = 0; - out_833440091851189730[48] = 0; - out_833440091851189730[49] = 0; - out_833440091851189730[50] = dt; - out_833440091851189730[51] = 0; - out_833440091851189730[52] = 0; - out_833440091851189730[53] = 0; - out_833440091851189730[54] = 0; - out_833440091851189730[55] = 0; - out_833440091851189730[56] = 0; - out_833440091851189730[57] = 0; - out_833440091851189730[58] = 0; - out_833440091851189730[59] = 0; - out_833440091851189730[60] = 0; - out_833440091851189730[61] = 0; - out_833440091851189730[62] = 0; - out_833440091851189730[63] = 0; - out_833440091851189730[64] = 0; - out_833440091851189730[65] = 0; - out_833440091851189730[66] = 1; - out_833440091851189730[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_833440091851189730[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_833440091851189730[69] = 0; - out_833440091851189730[70] = 0; - out_833440091851189730[71] = 0; - out_833440091851189730[72] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); - out_833440091851189730[73] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]); - out_833440091851189730[74] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]); - out_833440091851189730[75] = 0; - out_833440091851189730[76] = 0; - out_833440091851189730[77] = 0; - out_833440091851189730[78] = 0; - out_833440091851189730[79] = 0; - out_833440091851189730[80] = 0; - out_833440091851189730[81] = 0; - out_833440091851189730[82] = 0; - out_833440091851189730[83] = 0; - out_833440091851189730[84] = 0; - out_833440091851189730[85] = 0; - out_833440091851189730[86] = 0; - out_833440091851189730[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_833440091851189730[88] = 1; - out_833440091851189730[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_833440091851189730[90] = 0; - out_833440091851189730[91] = 0; - out_833440091851189730[92] = 0; - out_833440091851189730[93] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]); - out_833440091851189730[94] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); - out_833440091851189730[95] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]); - out_833440091851189730[96] = 0; - out_833440091851189730[97] = 0; - out_833440091851189730[98] = 0; - out_833440091851189730[99] = 0; - out_833440091851189730[100] = 0; - out_833440091851189730[101] = 0; - out_833440091851189730[102] = 0; - out_833440091851189730[103] = 0; - out_833440091851189730[104] = 0; - out_833440091851189730[105] = 0; - out_833440091851189730[106] = 0; - out_833440091851189730[107] = 0; - out_833440091851189730[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_833440091851189730[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_833440091851189730[110] = 1; - out_833440091851189730[111] = 0; - out_833440091851189730[112] = 0; - out_833440091851189730[113] = 0; - out_833440091851189730[114] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]); - out_833440091851189730[115] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]); - out_833440091851189730[116] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); - out_833440091851189730[117] = 0; - out_833440091851189730[118] = 0; - out_833440091851189730[119] = 0; - out_833440091851189730[120] = 0; - out_833440091851189730[121] = 0; - out_833440091851189730[122] = 0; - out_833440091851189730[123] = 0; - out_833440091851189730[124] = 0; - out_833440091851189730[125] = 0; - out_833440091851189730[126] = 0; - out_833440091851189730[127] = 0; - out_833440091851189730[128] = 0; - out_833440091851189730[129] = 0; - out_833440091851189730[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_833440091851189730[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_833440091851189730[132] = 1; - out_833440091851189730[133] = 0; - out_833440091851189730[134] = 0; - out_833440091851189730[135] = 0; - out_833440091851189730[136] = 0; - out_833440091851189730[137] = 0; - out_833440091851189730[138] = 0; - out_833440091851189730[139] = 0; - out_833440091851189730[140] = 0; - out_833440091851189730[141] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); - out_833440091851189730[142] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]); - out_833440091851189730[143] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]); - out_833440091851189730[144] = 0; - out_833440091851189730[145] = 0; - out_833440091851189730[146] = 0; - out_833440091851189730[147] = 0; - out_833440091851189730[148] = 0; - out_833440091851189730[149] = 0; - out_833440091851189730[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_833440091851189730[151] = 0; - out_833440091851189730[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_833440091851189730[153] = 0; - out_833440091851189730[154] = 1; - out_833440091851189730[155] = 0; - out_833440091851189730[156] = 0; - out_833440091851189730[157] = 0; - out_833440091851189730[158] = 0; - out_833440091851189730[159] = 0; - out_833440091851189730[160] = 0; - out_833440091851189730[161] = 0; - out_833440091851189730[162] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]); - out_833440091851189730[163] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); - out_833440091851189730[164] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]); - out_833440091851189730[165] = 0; - out_833440091851189730[166] = 0; - out_833440091851189730[167] = 0; - out_833440091851189730[168] = 0; - out_833440091851189730[169] = 0; - out_833440091851189730[170] = 0; - out_833440091851189730[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_833440091851189730[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_833440091851189730[173] = 0; - out_833440091851189730[174] = 0; - out_833440091851189730[175] = 0; - out_833440091851189730[176] = 1; - out_833440091851189730[177] = 0; - out_833440091851189730[178] = 0; - out_833440091851189730[179] = 0; - out_833440091851189730[180] = 0; - out_833440091851189730[181] = 0; - out_833440091851189730[182] = 0; - out_833440091851189730[183] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]); - out_833440091851189730[184] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]); - out_833440091851189730[185] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); - out_833440091851189730[186] = 0; - out_833440091851189730[187] = 0; - out_833440091851189730[188] = 0; - out_833440091851189730[189] = 0; - out_833440091851189730[190] = 0; - out_833440091851189730[191] = 0; - out_833440091851189730[192] = 0; - out_833440091851189730[193] = 0; - out_833440091851189730[194] = 0; - out_833440091851189730[195] = 0; - out_833440091851189730[196] = 0; - out_833440091851189730[197] = 0; - out_833440091851189730[198] = 1; - out_833440091851189730[199] = 0; - out_833440091851189730[200] = 0; - out_833440091851189730[201] = 0; - out_833440091851189730[202] = 0; - out_833440091851189730[203] = 0; - out_833440091851189730[204] = 0; - out_833440091851189730[205] = 0; - out_833440091851189730[206] = 0; - out_833440091851189730[207] = 0; - out_833440091851189730[208] = 0; - out_833440091851189730[209] = 0; - out_833440091851189730[210] = 0; - out_833440091851189730[211] = 0; - out_833440091851189730[212] = 0; - out_833440091851189730[213] = 0; - out_833440091851189730[214] = 0; - out_833440091851189730[215] = 0; - out_833440091851189730[216] = 0; - out_833440091851189730[217] = 0; - out_833440091851189730[218] = 0; - out_833440091851189730[219] = 0; - out_833440091851189730[220] = 1; - out_833440091851189730[221] = 0; - out_833440091851189730[222] = 0; - out_833440091851189730[223] = 0; - out_833440091851189730[224] = 0; - out_833440091851189730[225] = 0; - out_833440091851189730[226] = 0; - out_833440091851189730[227] = 0; - out_833440091851189730[228] = 0; - out_833440091851189730[229] = 0; - out_833440091851189730[230] = 0; - out_833440091851189730[231] = 0; - out_833440091851189730[232] = 0; - out_833440091851189730[233] = 0; - out_833440091851189730[234] = 0; - out_833440091851189730[235] = 0; - out_833440091851189730[236] = 0; - out_833440091851189730[237] = 0; - out_833440091851189730[238] = 0; - out_833440091851189730[239] = 0; - out_833440091851189730[240] = 0; - out_833440091851189730[241] = 0; - out_833440091851189730[242] = 1; - out_833440091851189730[243] = 0; - out_833440091851189730[244] = 0; - out_833440091851189730[245] = 0; - out_833440091851189730[246] = 0; - out_833440091851189730[247] = 0; - out_833440091851189730[248] = 0; - out_833440091851189730[249] = 0; - out_833440091851189730[250] = 0; - out_833440091851189730[251] = 0; - out_833440091851189730[252] = 0; - out_833440091851189730[253] = 0; - out_833440091851189730[254] = 0; - out_833440091851189730[255] = 0; - out_833440091851189730[256] = 0; - out_833440091851189730[257] = 0; - out_833440091851189730[258] = 0; - out_833440091851189730[259] = 0; - out_833440091851189730[260] = 0; - out_833440091851189730[261] = 0; - out_833440091851189730[262] = 0; - out_833440091851189730[263] = 0; - out_833440091851189730[264] = 1; - out_833440091851189730[265] = 0; - out_833440091851189730[266] = 0; - out_833440091851189730[267] = 0; - out_833440091851189730[268] = 0; - out_833440091851189730[269] = 0; - out_833440091851189730[270] = 0; - out_833440091851189730[271] = 0; - out_833440091851189730[272] = 0; - out_833440091851189730[273] = 0; - out_833440091851189730[274] = 0; - out_833440091851189730[275] = 0; - out_833440091851189730[276] = 0; - out_833440091851189730[277] = 0; - out_833440091851189730[278] = 0; - out_833440091851189730[279] = 0; - out_833440091851189730[280] = 0; - out_833440091851189730[281] = 0; - out_833440091851189730[282] = 0; - out_833440091851189730[283] = 0; - out_833440091851189730[284] = 0; - out_833440091851189730[285] = 0; - out_833440091851189730[286] = 1; - out_833440091851189730[287] = 0; - out_833440091851189730[288] = 0; - out_833440091851189730[289] = 0; - out_833440091851189730[290] = 0; - out_833440091851189730[291] = 0; - out_833440091851189730[292] = 0; - out_833440091851189730[293] = 0; - out_833440091851189730[294] = 0; - out_833440091851189730[295] = 0; - out_833440091851189730[296] = 0; - out_833440091851189730[297] = 0; - out_833440091851189730[298] = 0; - out_833440091851189730[299] = 0; - out_833440091851189730[300] = 0; - out_833440091851189730[301] = 0; - out_833440091851189730[302] = 0; - out_833440091851189730[303] = 0; - out_833440091851189730[304] = 0; - out_833440091851189730[305] = 0; - out_833440091851189730[306] = 0; - out_833440091851189730[307] = 0; - out_833440091851189730[308] = 1; - out_833440091851189730[309] = 0; - out_833440091851189730[310] = 0; - out_833440091851189730[311] = 0; - out_833440091851189730[312] = 0; - out_833440091851189730[313] = 0; - out_833440091851189730[314] = 0; - out_833440091851189730[315] = 0; - out_833440091851189730[316] = 0; - out_833440091851189730[317] = 0; - out_833440091851189730[318] = 0; - out_833440091851189730[319] = 0; - out_833440091851189730[320] = 0; - out_833440091851189730[321] = 0; - out_833440091851189730[322] = 0; - out_833440091851189730[323] = 0; - out_833440091851189730[324] = 0; - out_833440091851189730[325] = 0; - out_833440091851189730[326] = 0; - out_833440091851189730[327] = 0; - out_833440091851189730[328] = 0; - out_833440091851189730[329] = 0; - out_833440091851189730[330] = 1; - out_833440091851189730[331] = 0; - out_833440091851189730[332] = 0; - out_833440091851189730[333] = 0; - out_833440091851189730[334] = 0; - out_833440091851189730[335] = 0; - out_833440091851189730[336] = 0; - out_833440091851189730[337] = 0; - out_833440091851189730[338] = 0; - out_833440091851189730[339] = 0; - out_833440091851189730[340] = 0; - out_833440091851189730[341] = 0; - out_833440091851189730[342] = 0; - out_833440091851189730[343] = 0; - out_833440091851189730[344] = 0; - out_833440091851189730[345] = 0; - out_833440091851189730[346] = 0; - out_833440091851189730[347] = 0; - out_833440091851189730[348] = 0; - out_833440091851189730[349] = 0; - out_833440091851189730[350] = 0; - out_833440091851189730[351] = 0; - out_833440091851189730[352] = 1; - out_833440091851189730[353] = 0; - out_833440091851189730[354] = 0; - out_833440091851189730[355] = 0; - out_833440091851189730[356] = 0; - out_833440091851189730[357] = 0; - out_833440091851189730[358] = 0; - out_833440091851189730[359] = 0; - out_833440091851189730[360] = 0; - out_833440091851189730[361] = 0; - out_833440091851189730[362] = 0; - out_833440091851189730[363] = 0; - out_833440091851189730[364] = 0; - out_833440091851189730[365] = 0; - out_833440091851189730[366] = 0; - out_833440091851189730[367] = 0; - out_833440091851189730[368] = 0; - out_833440091851189730[369] = 0; - out_833440091851189730[370] = 0; - out_833440091851189730[371] = 0; - out_833440091851189730[372] = 0; - out_833440091851189730[373] = 0; - out_833440091851189730[374] = 1; - out_833440091851189730[375] = 0; - out_833440091851189730[376] = 0; - out_833440091851189730[377] = 0; - out_833440091851189730[378] = 0; - out_833440091851189730[379] = 0; - out_833440091851189730[380] = 0; - out_833440091851189730[381] = 0; - out_833440091851189730[382] = 0; - out_833440091851189730[383] = 0; - out_833440091851189730[384] = 0; - out_833440091851189730[385] = 0; - out_833440091851189730[386] = 0; - out_833440091851189730[387] = 0; - out_833440091851189730[388] = 0; - out_833440091851189730[389] = 0; - out_833440091851189730[390] = 0; - out_833440091851189730[391] = 0; - out_833440091851189730[392] = 0; - out_833440091851189730[393] = 0; - out_833440091851189730[394] = 0; - out_833440091851189730[395] = 0; - out_833440091851189730[396] = 1; - out_833440091851189730[397] = 0; - out_833440091851189730[398] = 0; - out_833440091851189730[399] = 0; - out_833440091851189730[400] = 0; - out_833440091851189730[401] = 0; - out_833440091851189730[402] = 0; - out_833440091851189730[403] = 0; - out_833440091851189730[404] = 0; - out_833440091851189730[405] = 0; - out_833440091851189730[406] = 0; - out_833440091851189730[407] = 0; - out_833440091851189730[408] = 0; - out_833440091851189730[409] = 0; - out_833440091851189730[410] = 0; - out_833440091851189730[411] = 0; - out_833440091851189730[412] = 0; - out_833440091851189730[413] = 0; - out_833440091851189730[414] = 0; - out_833440091851189730[415] = 0; - out_833440091851189730[416] = 0; - out_833440091851189730[417] = 0; - out_833440091851189730[418] = 1; - out_833440091851189730[419] = 0; - out_833440091851189730[420] = 0; - out_833440091851189730[421] = 0; - out_833440091851189730[422] = 0; - out_833440091851189730[423] = 0; - out_833440091851189730[424] = 0; - out_833440091851189730[425] = 0; - out_833440091851189730[426] = 0; - out_833440091851189730[427] = 0; - out_833440091851189730[428] = 0; - out_833440091851189730[429] = 0; - out_833440091851189730[430] = 0; - out_833440091851189730[431] = 0; - out_833440091851189730[432] = 0; - out_833440091851189730[433] = 0; - out_833440091851189730[434] = 0; - out_833440091851189730[435] = 0; - out_833440091851189730[436] = 0; - out_833440091851189730[437] = 0; - out_833440091851189730[438] = 0; - out_833440091851189730[439] = 0; - out_833440091851189730[440] = 1; +void F_fun(double *state, double dt, double *out_9115853419523662321) { + out_9115853419523662321[0] = 1; + out_9115853419523662321[1] = 0; + out_9115853419523662321[2] = 0; + out_9115853419523662321[3] = 0; + out_9115853419523662321[4] = 0; + out_9115853419523662321[5] = 0; + out_9115853419523662321[6] = dt; + out_9115853419523662321[7] = 0; + out_9115853419523662321[8] = 0; + out_9115853419523662321[9] = 0; + out_9115853419523662321[10] = 0; + out_9115853419523662321[11] = 0; + out_9115853419523662321[12] = 0; + out_9115853419523662321[13] = 0; + out_9115853419523662321[14] = 0; + out_9115853419523662321[15] = 0; + out_9115853419523662321[16] = 0; + out_9115853419523662321[17] = 0; + out_9115853419523662321[18] = 0; + out_9115853419523662321[19] = 0; + out_9115853419523662321[20] = 0; + out_9115853419523662321[21] = 0; + out_9115853419523662321[22] = 1; + out_9115853419523662321[23] = 0; + out_9115853419523662321[24] = 0; + out_9115853419523662321[25] = 0; + out_9115853419523662321[26] = 0; + out_9115853419523662321[27] = 0; + out_9115853419523662321[28] = dt; + out_9115853419523662321[29] = 0; + out_9115853419523662321[30] = 0; + out_9115853419523662321[31] = 0; + out_9115853419523662321[32] = 0; + out_9115853419523662321[33] = 0; + out_9115853419523662321[34] = 0; + out_9115853419523662321[35] = 0; + out_9115853419523662321[36] = 0; + out_9115853419523662321[37] = 0; + out_9115853419523662321[38] = 0; + out_9115853419523662321[39] = 0; + out_9115853419523662321[40] = 0; + out_9115853419523662321[41] = 0; + out_9115853419523662321[42] = 0; + out_9115853419523662321[43] = 0; + out_9115853419523662321[44] = 1; + out_9115853419523662321[45] = 0; + out_9115853419523662321[46] = 0; + out_9115853419523662321[47] = 0; + out_9115853419523662321[48] = 0; + out_9115853419523662321[49] = 0; + out_9115853419523662321[50] = dt; + out_9115853419523662321[51] = 0; + out_9115853419523662321[52] = 0; + out_9115853419523662321[53] = 0; + out_9115853419523662321[54] = 0; + out_9115853419523662321[55] = 0; + out_9115853419523662321[56] = 0; + out_9115853419523662321[57] = 0; + out_9115853419523662321[58] = 0; + out_9115853419523662321[59] = 0; + out_9115853419523662321[60] = 0; + out_9115853419523662321[61] = 0; + out_9115853419523662321[62] = 0; + out_9115853419523662321[63] = 0; + out_9115853419523662321[64] = 0; + out_9115853419523662321[65] = 0; + out_9115853419523662321[66] = 1; + out_9115853419523662321[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_9115853419523662321[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_9115853419523662321[69] = 0; + out_9115853419523662321[70] = 0; + out_9115853419523662321[71] = 0; + out_9115853419523662321[72] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); + out_9115853419523662321[73] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]); + out_9115853419523662321[74] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]); + out_9115853419523662321[75] = 0; + out_9115853419523662321[76] = 0; + out_9115853419523662321[77] = 0; + out_9115853419523662321[78] = 0; + out_9115853419523662321[79] = 0; + out_9115853419523662321[80] = 0; + out_9115853419523662321[81] = 0; + out_9115853419523662321[82] = 0; + out_9115853419523662321[83] = 0; + out_9115853419523662321[84] = 0; + out_9115853419523662321[85] = 0; + out_9115853419523662321[86] = 0; + out_9115853419523662321[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_9115853419523662321[88] = 1; + out_9115853419523662321[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_9115853419523662321[90] = 0; + out_9115853419523662321[91] = 0; + out_9115853419523662321[92] = 0; + out_9115853419523662321[93] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]); + out_9115853419523662321[94] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); + out_9115853419523662321[95] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]); + out_9115853419523662321[96] = 0; + out_9115853419523662321[97] = 0; + out_9115853419523662321[98] = 0; + out_9115853419523662321[99] = 0; + out_9115853419523662321[100] = 0; + out_9115853419523662321[101] = 0; + out_9115853419523662321[102] = 0; + out_9115853419523662321[103] = 0; + out_9115853419523662321[104] = 0; + out_9115853419523662321[105] = 0; + out_9115853419523662321[106] = 0; + out_9115853419523662321[107] = 0; + out_9115853419523662321[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_9115853419523662321[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_9115853419523662321[110] = 1; + out_9115853419523662321[111] = 0; + out_9115853419523662321[112] = 0; + out_9115853419523662321[113] = 0; + out_9115853419523662321[114] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]); + out_9115853419523662321[115] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]); + out_9115853419523662321[116] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); + out_9115853419523662321[117] = 0; + out_9115853419523662321[118] = 0; + out_9115853419523662321[119] = 0; + out_9115853419523662321[120] = 0; + out_9115853419523662321[121] = 0; + out_9115853419523662321[122] = 0; + out_9115853419523662321[123] = 0; + out_9115853419523662321[124] = 0; + out_9115853419523662321[125] = 0; + out_9115853419523662321[126] = 0; + out_9115853419523662321[127] = 0; + out_9115853419523662321[128] = 0; + out_9115853419523662321[129] = 0; + out_9115853419523662321[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_9115853419523662321[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_9115853419523662321[132] = 1; + out_9115853419523662321[133] = 0; + out_9115853419523662321[134] = 0; + out_9115853419523662321[135] = 0; + out_9115853419523662321[136] = 0; + out_9115853419523662321[137] = 0; + out_9115853419523662321[138] = 0; + out_9115853419523662321[139] = 0; + out_9115853419523662321[140] = 0; + out_9115853419523662321[141] = dt*(pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2)); + out_9115853419523662321[142] = dt*(-2*state[3]*state[6] + 2*state[4]*state[5]); + out_9115853419523662321[143] = dt*(2*state[3]*state[5] + 2*state[4]*state[6]); + out_9115853419523662321[144] = 0; + out_9115853419523662321[145] = 0; + out_9115853419523662321[146] = 0; + out_9115853419523662321[147] = 0; + out_9115853419523662321[148] = 0; + out_9115853419523662321[149] = 0; + out_9115853419523662321[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_9115853419523662321[151] = 0; + out_9115853419523662321[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_9115853419523662321[153] = 0; + out_9115853419523662321[154] = 1; + out_9115853419523662321[155] = 0; + out_9115853419523662321[156] = 0; + out_9115853419523662321[157] = 0; + out_9115853419523662321[158] = 0; + out_9115853419523662321[159] = 0; + out_9115853419523662321[160] = 0; + out_9115853419523662321[161] = 0; + out_9115853419523662321[162] = dt*(2*state[3]*state[6] + 2*state[4]*state[5]); + out_9115853419523662321[163] = dt*(pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2)); + out_9115853419523662321[164] = dt*(-2*state[3]*state[4] + 2*state[5]*state[6]); + out_9115853419523662321[165] = 0; + out_9115853419523662321[166] = 0; + out_9115853419523662321[167] = 0; + out_9115853419523662321[168] = 0; + out_9115853419523662321[169] = 0; + out_9115853419523662321[170] = 0; + out_9115853419523662321[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_9115853419523662321[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_9115853419523662321[173] = 0; + out_9115853419523662321[174] = 0; + out_9115853419523662321[175] = 0; + out_9115853419523662321[176] = 1; + out_9115853419523662321[177] = 0; + out_9115853419523662321[178] = 0; + out_9115853419523662321[179] = 0; + out_9115853419523662321[180] = 0; + out_9115853419523662321[181] = 0; + out_9115853419523662321[182] = 0; + out_9115853419523662321[183] = dt*(-2*state[3]*state[5] + 2*state[4]*state[6]); + out_9115853419523662321[184] = dt*(2*state[3]*state[4] + 2*state[5]*state[6]); + out_9115853419523662321[185] = dt*(pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2)); + out_9115853419523662321[186] = 0; + out_9115853419523662321[187] = 0; + out_9115853419523662321[188] = 0; + out_9115853419523662321[189] = 0; + out_9115853419523662321[190] = 0; + out_9115853419523662321[191] = 0; + out_9115853419523662321[192] = 0; + out_9115853419523662321[193] = 0; + out_9115853419523662321[194] = 0; + out_9115853419523662321[195] = 0; + out_9115853419523662321[196] = 0; + out_9115853419523662321[197] = 0; + out_9115853419523662321[198] = 1; + out_9115853419523662321[199] = 0; + out_9115853419523662321[200] = 0; + out_9115853419523662321[201] = 0; + out_9115853419523662321[202] = 0; + out_9115853419523662321[203] = 0; + out_9115853419523662321[204] = 0; + out_9115853419523662321[205] = 0; + out_9115853419523662321[206] = 0; + out_9115853419523662321[207] = 0; + out_9115853419523662321[208] = 0; + out_9115853419523662321[209] = 0; + out_9115853419523662321[210] = 0; + out_9115853419523662321[211] = 0; + out_9115853419523662321[212] = 0; + out_9115853419523662321[213] = 0; + out_9115853419523662321[214] = 0; + out_9115853419523662321[215] = 0; + out_9115853419523662321[216] = 0; + out_9115853419523662321[217] = 0; + out_9115853419523662321[218] = 0; + out_9115853419523662321[219] = 0; + out_9115853419523662321[220] = 1; + out_9115853419523662321[221] = 0; + out_9115853419523662321[222] = 0; + out_9115853419523662321[223] = 0; + out_9115853419523662321[224] = 0; + out_9115853419523662321[225] = 0; + out_9115853419523662321[226] = 0; + out_9115853419523662321[227] = 0; + out_9115853419523662321[228] = 0; + out_9115853419523662321[229] = 0; + out_9115853419523662321[230] = 0; + out_9115853419523662321[231] = 0; + out_9115853419523662321[232] = 0; + out_9115853419523662321[233] = 0; + out_9115853419523662321[234] = 0; + out_9115853419523662321[235] = 0; + out_9115853419523662321[236] = 0; + out_9115853419523662321[237] = 0; + out_9115853419523662321[238] = 0; + out_9115853419523662321[239] = 0; + out_9115853419523662321[240] = 0; + out_9115853419523662321[241] = 0; + out_9115853419523662321[242] = 1; + out_9115853419523662321[243] = 0; + out_9115853419523662321[244] = 0; + out_9115853419523662321[245] = 0; + out_9115853419523662321[246] = 0; + out_9115853419523662321[247] = 0; + out_9115853419523662321[248] = 0; + out_9115853419523662321[249] = 0; + out_9115853419523662321[250] = 0; + out_9115853419523662321[251] = 0; + out_9115853419523662321[252] = 0; + out_9115853419523662321[253] = 0; + out_9115853419523662321[254] = 0; + out_9115853419523662321[255] = 0; + out_9115853419523662321[256] = 0; + out_9115853419523662321[257] = 0; + out_9115853419523662321[258] = 0; + out_9115853419523662321[259] = 0; + out_9115853419523662321[260] = 0; + out_9115853419523662321[261] = 0; + out_9115853419523662321[262] = 0; + out_9115853419523662321[263] = 0; + out_9115853419523662321[264] = 1; + out_9115853419523662321[265] = 0; + out_9115853419523662321[266] = 0; + out_9115853419523662321[267] = 0; + out_9115853419523662321[268] = 0; + out_9115853419523662321[269] = 0; + out_9115853419523662321[270] = 0; + out_9115853419523662321[271] = 0; + out_9115853419523662321[272] = 0; + out_9115853419523662321[273] = 0; + out_9115853419523662321[274] = 0; + out_9115853419523662321[275] = 0; + out_9115853419523662321[276] = 0; + out_9115853419523662321[277] = 0; + out_9115853419523662321[278] = 0; + out_9115853419523662321[279] = 0; + out_9115853419523662321[280] = 0; + out_9115853419523662321[281] = 0; + out_9115853419523662321[282] = 0; + out_9115853419523662321[283] = 0; + out_9115853419523662321[284] = 0; + out_9115853419523662321[285] = 0; + out_9115853419523662321[286] = 1; + out_9115853419523662321[287] = 0; + out_9115853419523662321[288] = 0; + out_9115853419523662321[289] = 0; + out_9115853419523662321[290] = 0; + out_9115853419523662321[291] = 0; + out_9115853419523662321[292] = 0; + out_9115853419523662321[293] = 0; + out_9115853419523662321[294] = 0; + out_9115853419523662321[295] = 0; + out_9115853419523662321[296] = 0; + out_9115853419523662321[297] = 0; + out_9115853419523662321[298] = 0; + out_9115853419523662321[299] = 0; + out_9115853419523662321[300] = 0; + out_9115853419523662321[301] = 0; + out_9115853419523662321[302] = 0; + out_9115853419523662321[303] = 0; + out_9115853419523662321[304] = 0; + out_9115853419523662321[305] = 0; + out_9115853419523662321[306] = 0; + out_9115853419523662321[307] = 0; + out_9115853419523662321[308] = 1; + out_9115853419523662321[309] = 0; + out_9115853419523662321[310] = 0; + out_9115853419523662321[311] = 0; + out_9115853419523662321[312] = 0; + out_9115853419523662321[313] = 0; + out_9115853419523662321[314] = 0; + out_9115853419523662321[315] = 0; + out_9115853419523662321[316] = 0; + out_9115853419523662321[317] = 0; + out_9115853419523662321[318] = 0; + out_9115853419523662321[319] = 0; + out_9115853419523662321[320] = 0; + out_9115853419523662321[321] = 0; + out_9115853419523662321[322] = 0; + out_9115853419523662321[323] = 0; + out_9115853419523662321[324] = 0; + out_9115853419523662321[325] = 0; + out_9115853419523662321[326] = 0; + out_9115853419523662321[327] = 0; + out_9115853419523662321[328] = 0; + out_9115853419523662321[329] = 0; + out_9115853419523662321[330] = 1; + out_9115853419523662321[331] = 0; + out_9115853419523662321[332] = 0; + out_9115853419523662321[333] = 0; + out_9115853419523662321[334] = 0; + out_9115853419523662321[335] = 0; + out_9115853419523662321[336] = 0; + out_9115853419523662321[337] = 0; + out_9115853419523662321[338] = 0; + out_9115853419523662321[339] = 0; + out_9115853419523662321[340] = 0; + out_9115853419523662321[341] = 0; + out_9115853419523662321[342] = 0; + out_9115853419523662321[343] = 0; + out_9115853419523662321[344] = 0; + out_9115853419523662321[345] = 0; + out_9115853419523662321[346] = 0; + out_9115853419523662321[347] = 0; + out_9115853419523662321[348] = 0; + out_9115853419523662321[349] = 0; + out_9115853419523662321[350] = 0; + out_9115853419523662321[351] = 0; + out_9115853419523662321[352] = 1; + out_9115853419523662321[353] = 0; + out_9115853419523662321[354] = 0; + out_9115853419523662321[355] = 0; + out_9115853419523662321[356] = 0; + out_9115853419523662321[357] = 0; + out_9115853419523662321[358] = 0; + out_9115853419523662321[359] = 0; + out_9115853419523662321[360] = 0; + out_9115853419523662321[361] = 0; + out_9115853419523662321[362] = 0; + out_9115853419523662321[363] = 0; + out_9115853419523662321[364] = 0; + out_9115853419523662321[365] = 0; + out_9115853419523662321[366] = 0; + out_9115853419523662321[367] = 0; + out_9115853419523662321[368] = 0; + out_9115853419523662321[369] = 0; + out_9115853419523662321[370] = 0; + out_9115853419523662321[371] = 0; + out_9115853419523662321[372] = 0; + out_9115853419523662321[373] = 0; + out_9115853419523662321[374] = 1; + out_9115853419523662321[375] = 0; + out_9115853419523662321[376] = 0; + out_9115853419523662321[377] = 0; + out_9115853419523662321[378] = 0; + out_9115853419523662321[379] = 0; + out_9115853419523662321[380] = 0; + out_9115853419523662321[381] = 0; + out_9115853419523662321[382] = 0; + out_9115853419523662321[383] = 0; + out_9115853419523662321[384] = 0; + out_9115853419523662321[385] = 0; + out_9115853419523662321[386] = 0; + out_9115853419523662321[387] = 0; + out_9115853419523662321[388] = 0; + out_9115853419523662321[389] = 0; + out_9115853419523662321[390] = 0; + out_9115853419523662321[391] = 0; + out_9115853419523662321[392] = 0; + out_9115853419523662321[393] = 0; + out_9115853419523662321[394] = 0; + out_9115853419523662321[395] = 0; + out_9115853419523662321[396] = 1; + out_9115853419523662321[397] = 0; + out_9115853419523662321[398] = 0; + out_9115853419523662321[399] = 0; + out_9115853419523662321[400] = 0; + out_9115853419523662321[401] = 0; + out_9115853419523662321[402] = 0; + out_9115853419523662321[403] = 0; + out_9115853419523662321[404] = 0; + out_9115853419523662321[405] = 0; + out_9115853419523662321[406] = 0; + out_9115853419523662321[407] = 0; + out_9115853419523662321[408] = 0; + out_9115853419523662321[409] = 0; + out_9115853419523662321[410] = 0; + out_9115853419523662321[411] = 0; + out_9115853419523662321[412] = 0; + out_9115853419523662321[413] = 0; + out_9115853419523662321[414] = 0; + out_9115853419523662321[415] = 0; + out_9115853419523662321[416] = 0; + out_9115853419523662321[417] = 0; + out_9115853419523662321[418] = 1; + out_9115853419523662321[419] = 0; + out_9115853419523662321[420] = 0; + out_9115853419523662321[421] = 0; + out_9115853419523662321[422] = 0; + out_9115853419523662321[423] = 0; + out_9115853419523662321[424] = 0; + out_9115853419523662321[425] = 0; + out_9115853419523662321[426] = 0; + out_9115853419523662321[427] = 0; + out_9115853419523662321[428] = 0; + out_9115853419523662321[429] = 0; + out_9115853419523662321[430] = 0; + out_9115853419523662321[431] = 0; + out_9115853419523662321[432] = 0; + out_9115853419523662321[433] = 0; + out_9115853419523662321[434] = 0; + out_9115853419523662321[435] = 0; + out_9115853419523662321[436] = 0; + out_9115853419523662321[437] = 0; + out_9115853419523662321[438] = 0; + out_9115853419523662321[439] = 0; + out_9115853419523662321[440] = 1; } -void h_4(double *state, double *unused, double *out_5875214861579885541) { - out_5875214861579885541[0] = state[10] + state[13]; - out_5875214861579885541[1] = state[11] + state[14]; - out_5875214861579885541[2] = state[12] + state[15]; +void h_4(double *state, double *unused, double *out_6071256838368436397) { + out_6071256838368436397[0] = state[10] + state[13]; + out_6071256838368436397[1] = state[11] + state[14]; + out_6071256838368436397[2] = state[12] + state[15]; } -void H_4(double *state, double *unused, double *out_276857831883521901) { - out_276857831883521901[0] = 0; - out_276857831883521901[1] = 0; - out_276857831883521901[2] = 0; - out_276857831883521901[3] = 0; - out_276857831883521901[4] = 0; - out_276857831883521901[5] = 0; - out_276857831883521901[6] = 0; - out_276857831883521901[7] = 0; - out_276857831883521901[8] = 0; - out_276857831883521901[9] = 0; - out_276857831883521901[10] = 1; - out_276857831883521901[11] = 0; - out_276857831883521901[12] = 0; - out_276857831883521901[13] = 1; - out_276857831883521901[14] = 0; - out_276857831883521901[15] = 0; - out_276857831883521901[16] = 0; - out_276857831883521901[17] = 0; - out_276857831883521901[18] = 0; - out_276857831883521901[19] = 0; - out_276857831883521901[20] = 0; - out_276857831883521901[21] = 0; - out_276857831883521901[22] = 0; - out_276857831883521901[23] = 0; - out_276857831883521901[24] = 0; - out_276857831883521901[25] = 0; - out_276857831883521901[26] = 0; - out_276857831883521901[27] = 0; - out_276857831883521901[28] = 0; - out_276857831883521901[29] = 0; - out_276857831883521901[30] = 0; - out_276857831883521901[31] = 0; - out_276857831883521901[32] = 0; - out_276857831883521901[33] = 1; - out_276857831883521901[34] = 0; - out_276857831883521901[35] = 0; - out_276857831883521901[36] = 1; - out_276857831883521901[37] = 0; - out_276857831883521901[38] = 0; - out_276857831883521901[39] = 0; - out_276857831883521901[40] = 0; - out_276857831883521901[41] = 0; - out_276857831883521901[42] = 0; - out_276857831883521901[43] = 0; - out_276857831883521901[44] = 0; - out_276857831883521901[45] = 0; - out_276857831883521901[46] = 0; - out_276857831883521901[47] = 0; - out_276857831883521901[48] = 0; - out_276857831883521901[49] = 0; - out_276857831883521901[50] = 0; - out_276857831883521901[51] = 0; - out_276857831883521901[52] = 0; - out_276857831883521901[53] = 0; - out_276857831883521901[54] = 0; - out_276857831883521901[55] = 0; - out_276857831883521901[56] = 1; - out_276857831883521901[57] = 0; - out_276857831883521901[58] = 0; - out_276857831883521901[59] = 1; - out_276857831883521901[60] = 0; - out_276857831883521901[61] = 0; - out_276857831883521901[62] = 0; - out_276857831883521901[63] = 0; - out_276857831883521901[64] = 0; - out_276857831883521901[65] = 0; +void H_4(double *state, double *unused, double *out_1119314742193140760) { + out_1119314742193140760[0] = 0; + out_1119314742193140760[1] = 0; + out_1119314742193140760[2] = 0; + out_1119314742193140760[3] = 0; + out_1119314742193140760[4] = 0; + out_1119314742193140760[5] = 0; + out_1119314742193140760[6] = 0; + out_1119314742193140760[7] = 0; + out_1119314742193140760[8] = 0; + out_1119314742193140760[9] = 0; + out_1119314742193140760[10] = 1; + out_1119314742193140760[11] = 0; + out_1119314742193140760[12] = 0; + out_1119314742193140760[13] = 1; + out_1119314742193140760[14] = 0; + out_1119314742193140760[15] = 0; + out_1119314742193140760[16] = 0; + out_1119314742193140760[17] = 0; + out_1119314742193140760[18] = 0; + out_1119314742193140760[19] = 0; + out_1119314742193140760[20] = 0; + out_1119314742193140760[21] = 0; + out_1119314742193140760[22] = 0; + out_1119314742193140760[23] = 0; + out_1119314742193140760[24] = 0; + out_1119314742193140760[25] = 0; + out_1119314742193140760[26] = 0; + out_1119314742193140760[27] = 0; + out_1119314742193140760[28] = 0; + out_1119314742193140760[29] = 0; + out_1119314742193140760[30] = 0; + out_1119314742193140760[31] = 0; + out_1119314742193140760[32] = 0; + out_1119314742193140760[33] = 1; + out_1119314742193140760[34] = 0; + out_1119314742193140760[35] = 0; + out_1119314742193140760[36] = 1; + out_1119314742193140760[37] = 0; + out_1119314742193140760[38] = 0; + out_1119314742193140760[39] = 0; + out_1119314742193140760[40] = 0; + out_1119314742193140760[41] = 0; + out_1119314742193140760[42] = 0; + out_1119314742193140760[43] = 0; + out_1119314742193140760[44] = 0; + out_1119314742193140760[45] = 0; + out_1119314742193140760[46] = 0; + out_1119314742193140760[47] = 0; + out_1119314742193140760[48] = 0; + out_1119314742193140760[49] = 0; + out_1119314742193140760[50] = 0; + out_1119314742193140760[51] = 0; + out_1119314742193140760[52] = 0; + out_1119314742193140760[53] = 0; + out_1119314742193140760[54] = 0; + out_1119314742193140760[55] = 0; + out_1119314742193140760[56] = 1; + out_1119314742193140760[57] = 0; + out_1119314742193140760[58] = 0; + out_1119314742193140760[59] = 1; + out_1119314742193140760[60] = 0; + out_1119314742193140760[61] = 0; + out_1119314742193140760[62] = 0; + out_1119314742193140760[63] = 0; + out_1119314742193140760[64] = 0; + out_1119314742193140760[65] = 0; } -void h_9(double *state, double *unused, double *out_7431485379286447551) { - out_7431485379286447551[0] = state[10]; - out_7431485379286447551[1] = state[11]; - out_7431485379286447551[2] = state[12]; +void h_9(double *state, double *unused, double *out_7859104742158472266) { + out_7859104742158472266[0] = state[10]; + out_7859104742158472266[1] = state[11]; + out_7859104742158472266[2] = state[12]; } -void H_9(double *state, double *unused, double *out_7564076767147969371) { - out_7564076767147969371[0] = 0; - out_7564076767147969371[1] = 0; - out_7564076767147969371[2] = 0; - out_7564076767147969371[3] = 0; - out_7564076767147969371[4] = 0; - out_7564076767147969371[5] = 0; - out_7564076767147969371[6] = 0; - out_7564076767147969371[7] = 0; - out_7564076767147969371[8] = 0; - out_7564076767147969371[9] = 0; - out_7564076767147969371[10] = 1; - out_7564076767147969371[11] = 0; - out_7564076767147969371[12] = 0; - out_7564076767147969371[13] = 0; - out_7564076767147969371[14] = 0; - out_7564076767147969371[15] = 0; - out_7564076767147969371[16] = 0; - out_7564076767147969371[17] = 0; - out_7564076767147969371[18] = 0; - out_7564076767147969371[19] = 0; - out_7564076767147969371[20] = 0; - out_7564076767147969371[21] = 0; - out_7564076767147969371[22] = 0; - out_7564076767147969371[23] = 0; - out_7564076767147969371[24] = 0; - out_7564076767147969371[25] = 0; - out_7564076767147969371[26] = 0; - out_7564076767147969371[27] = 0; - out_7564076767147969371[28] = 0; - out_7564076767147969371[29] = 0; - out_7564076767147969371[30] = 0; - out_7564076767147969371[31] = 0; - out_7564076767147969371[32] = 0; - out_7564076767147969371[33] = 1; - out_7564076767147969371[34] = 0; - out_7564076767147969371[35] = 0; - out_7564076767147969371[36] = 0; - out_7564076767147969371[37] = 0; - out_7564076767147969371[38] = 0; - out_7564076767147969371[39] = 0; - out_7564076767147969371[40] = 0; - out_7564076767147969371[41] = 0; - out_7564076767147969371[42] = 0; - out_7564076767147969371[43] = 0; - out_7564076767147969371[44] = 0; - out_7564076767147969371[45] = 0; - out_7564076767147969371[46] = 0; - out_7564076767147969371[47] = 0; - out_7564076767147969371[48] = 0; - out_7564076767147969371[49] = 0; - out_7564076767147969371[50] = 0; - out_7564076767147969371[51] = 0; - out_7564076767147969371[52] = 0; - out_7564076767147969371[53] = 0; - out_7564076767147969371[54] = 0; - out_7564076767147969371[55] = 0; - out_7564076767147969371[56] = 1; - out_7564076767147969371[57] = 0; - out_7564076767147969371[58] = 0; - out_7564076767147969371[59] = 0; - out_7564076767147969371[60] = 0; - out_7564076767147969371[61] = 0; - out_7564076767147969371[62] = 0; - out_7564076767147969371[63] = 0; - out_7564076767147969371[64] = 0; - out_7564076767147969371[65] = 0; +void H_9(double *state, double *unused, double *out_8406533677457588230) { + out_8406533677457588230[0] = 0; + out_8406533677457588230[1] = 0; + out_8406533677457588230[2] = 0; + out_8406533677457588230[3] = 0; + out_8406533677457588230[4] = 0; + out_8406533677457588230[5] = 0; + out_8406533677457588230[6] = 0; + out_8406533677457588230[7] = 0; + out_8406533677457588230[8] = 0; + out_8406533677457588230[9] = 0; + out_8406533677457588230[10] = 1; + out_8406533677457588230[11] = 0; + out_8406533677457588230[12] = 0; + out_8406533677457588230[13] = 0; + out_8406533677457588230[14] = 0; + out_8406533677457588230[15] = 0; + out_8406533677457588230[16] = 0; + out_8406533677457588230[17] = 0; + out_8406533677457588230[18] = 0; + out_8406533677457588230[19] = 0; + out_8406533677457588230[20] = 0; + out_8406533677457588230[21] = 0; + out_8406533677457588230[22] = 0; + out_8406533677457588230[23] = 0; + out_8406533677457588230[24] = 0; + out_8406533677457588230[25] = 0; + out_8406533677457588230[26] = 0; + out_8406533677457588230[27] = 0; + out_8406533677457588230[28] = 0; + out_8406533677457588230[29] = 0; + out_8406533677457588230[30] = 0; + out_8406533677457588230[31] = 0; + out_8406533677457588230[32] = 0; + out_8406533677457588230[33] = 1; + out_8406533677457588230[34] = 0; + out_8406533677457588230[35] = 0; + out_8406533677457588230[36] = 0; + out_8406533677457588230[37] = 0; + out_8406533677457588230[38] = 0; + out_8406533677457588230[39] = 0; + out_8406533677457588230[40] = 0; + out_8406533677457588230[41] = 0; + out_8406533677457588230[42] = 0; + out_8406533677457588230[43] = 0; + out_8406533677457588230[44] = 0; + out_8406533677457588230[45] = 0; + out_8406533677457588230[46] = 0; + out_8406533677457588230[47] = 0; + out_8406533677457588230[48] = 0; + out_8406533677457588230[49] = 0; + out_8406533677457588230[50] = 0; + out_8406533677457588230[51] = 0; + out_8406533677457588230[52] = 0; + out_8406533677457588230[53] = 0; + out_8406533677457588230[54] = 0; + out_8406533677457588230[55] = 0; + out_8406533677457588230[56] = 1; + out_8406533677457588230[57] = 0; + out_8406533677457588230[58] = 0; + out_8406533677457588230[59] = 0; + out_8406533677457588230[60] = 0; + out_8406533677457588230[61] = 0; + out_8406533677457588230[62] = 0; + out_8406533677457588230[63] = 0; + out_8406533677457588230[64] = 0; + out_8406533677457588230[65] = 0; } -void h_10(double *state, double *unused, double *out_8274293454775594883) { - out_8274293454775594883[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_8274293454775594883[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_8274293454775594883[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_4473856785133789330) { + out_4473856785133789330[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_4473856785133789330[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_4473856785133789330[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_3646697484698039257) { - out_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[7] = 0; - out_3646697484698039257[8] = 0; - out_3646697484698039257[9] = 0; - out_3646697484698039257[10] = 0; - out_3646697484698039257[11] = 0; - out_3646697484698039257[12] = 0; - out_3646697484698039257[13] = 0; - out_3646697484698039257[14] = 0; - out_3646697484698039257[15] = 0; - out_3646697484698039257[16] = 1; - out_3646697484698039257[17] = 0; - out_3646697484698039257[18] = 0; - out_3646697484698039257[19] = 1; - out_3646697484698039257[20] = 0; - out_3646697484698039257[21] = 0; - out_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[29] = 0; - out_3646697484698039257[30] = 0; - out_3646697484698039257[31] = 0; - out_3646697484698039257[32] = 0; - out_3646697484698039257[33] = 0; - out_3646697484698039257[34] = 0; - out_3646697484698039257[35] = 0; - out_3646697484698039257[36] = 0; - out_3646697484698039257[37] = 0; - out_3646697484698039257[38] = 0; - out_3646697484698039257[39] = 1; - out_3646697484698039257[40] = 0; - out_3646697484698039257[41] = 0; - out_3646697484698039257[42] = 1; - out_3646697484698039257[43] = 0; - out_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[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_3646697484698039257[51] = 0; - out_3646697484698039257[52] = 0; - out_3646697484698039257[53] = 0; - out_3646697484698039257[54] = 0; - out_3646697484698039257[55] = 0; - out_3646697484698039257[56] = 0; - out_3646697484698039257[57] = 0; - out_3646697484698039257[58] = 0; - out_3646697484698039257[59] = 0; - out_3646697484698039257[60] = 0; - out_3646697484698039257[61] = 0; - out_3646697484698039257[62] = 1; - out_3646697484698039257[63] = 0; - out_3646697484698039257[64] = 0; - out_3646697484698039257[65] = 1; +void H_10(double *state, double *unused, double *out_5999678041645387439) { + out_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[7] = 0; + out_5999678041645387439[8] = 0; + out_5999678041645387439[9] = 0; + out_5999678041645387439[10] = 0; + out_5999678041645387439[11] = 0; + out_5999678041645387439[12] = 0; + out_5999678041645387439[13] = 0; + out_5999678041645387439[14] = 0; + out_5999678041645387439[15] = 0; + out_5999678041645387439[16] = 1; + out_5999678041645387439[17] = 0; + out_5999678041645387439[18] = 0; + out_5999678041645387439[19] = 1; + out_5999678041645387439[20] = 0; + out_5999678041645387439[21] = 0; + out_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[29] = 0; + out_5999678041645387439[30] = 0; + out_5999678041645387439[31] = 0; + out_5999678041645387439[32] = 0; + out_5999678041645387439[33] = 0; + out_5999678041645387439[34] = 0; + out_5999678041645387439[35] = 0; + out_5999678041645387439[36] = 0; + out_5999678041645387439[37] = 0; + out_5999678041645387439[38] = 0; + out_5999678041645387439[39] = 1; + out_5999678041645387439[40] = 0; + out_5999678041645387439[41] = 0; + out_5999678041645387439[42] = 1; + out_5999678041645387439[43] = 0; + out_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[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_5999678041645387439[51] = 0; + out_5999678041645387439[52] = 0; + out_5999678041645387439[53] = 0; + out_5999678041645387439[54] = 0; + out_5999678041645387439[55] = 0; + out_5999678041645387439[56] = 0; + out_5999678041645387439[57] = 0; + out_5999678041645387439[58] = 0; + out_5999678041645387439[59] = 0; + out_5999678041645387439[60] = 0; + out_5999678041645387439[61] = 0; + out_5999678041645387439[62] = 1; + out_5999678041645387439[63] = 0; + out_5999678041645387439[64] = 0; + out_5999678041645387439[65] = 1; } -void h_12(double *state, double *unused, double *out_7462563038781612366) { - out_7462563038781612366[0] = state[0]; - out_7462563038781612366[1] = state[1]; - out_7462563038781612366[2] = state[2]; +void h_12(double *state, double *unused, double *out_7662391294081069133) { + out_7662391294081069133[0] = state[0]; + out_7662391294081069133[1] = state[1]; + out_7662391294081069133[2] = state[2]; } -void H_12(double *state, double *unused, double *out_6104400545159211095) { - out_6104400545159211095[0] = 1; - out_6104400545159211095[1] = 0; - out_6104400545159211095[2] = 0; - out_6104400545159211095[3] = 0; - out_6104400545159211095[4] = 0; - out_6104400545159211095[5] = 0; - out_6104400545159211095[6] = 0; - out_6104400545159211095[7] = 0; - out_6104400545159211095[8] = 0; - out_6104400545159211095[9] = 0; - out_6104400545159211095[10] = 0; - out_6104400545159211095[11] = 0; - out_6104400545159211095[12] = 0; - out_6104400545159211095[13] = 0; - out_6104400545159211095[14] = 0; - out_6104400545159211095[15] = 0; - out_6104400545159211095[16] = 0; - out_6104400545159211095[17] = 0; - out_6104400545159211095[18] = 0; - out_6104400545159211095[19] = 0; - out_6104400545159211095[20] = 0; - out_6104400545159211095[21] = 0; - out_6104400545159211095[22] = 0; - out_6104400545159211095[23] = 1; - out_6104400545159211095[24] = 0; - out_6104400545159211095[25] = 0; - out_6104400545159211095[26] = 0; - out_6104400545159211095[27] = 0; - out_6104400545159211095[28] = 0; - out_6104400545159211095[29] = 0; - out_6104400545159211095[30] = 0; - out_6104400545159211095[31] = 0; - out_6104400545159211095[32] = 0; - out_6104400545159211095[33] = 0; - out_6104400545159211095[34] = 0; - out_6104400545159211095[35] = 0; - out_6104400545159211095[36] = 0; - out_6104400545159211095[37] = 0; - out_6104400545159211095[38] = 0; - out_6104400545159211095[39] = 0; - out_6104400545159211095[40] = 0; - out_6104400545159211095[41] = 0; - out_6104400545159211095[42] = 0; - out_6104400545159211095[43] = 0; - out_6104400545159211095[44] = 0; - out_6104400545159211095[45] = 0; - out_6104400545159211095[46] = 1; - out_6104400545159211095[47] = 0; - out_6104400545159211095[48] = 0; - out_6104400545159211095[49] = 0; - out_6104400545159211095[50] = 0; - out_6104400545159211095[51] = 0; - out_6104400545159211095[52] = 0; - out_6104400545159211095[53] = 0; - out_6104400545159211095[54] = 0; - out_6104400545159211095[55] = 0; - out_6104400545159211095[56] = 0; - out_6104400545159211095[57] = 0; - out_6104400545159211095[58] = 0; - out_6104400545159211095[59] = 0; - out_6104400545159211095[60] = 0; - out_6104400545159211095[61] = 0; - out_6104400545159211095[62] = 0; - out_6104400545159211095[63] = 0; - out_6104400545159211095[64] = 0; - out_6104400545159211095[65] = 0; +void H_12(double *state, double *unused, double *out_5261943634849592236) { + out_5261943634849592236[0] = 1; + out_5261943634849592236[1] = 0; + out_5261943634849592236[2] = 0; + out_5261943634849592236[3] = 0; + out_5261943634849592236[4] = 0; + out_5261943634849592236[5] = 0; + out_5261943634849592236[6] = 0; + out_5261943634849592236[7] = 0; + out_5261943634849592236[8] = 0; + out_5261943634849592236[9] = 0; + out_5261943634849592236[10] = 0; + out_5261943634849592236[11] = 0; + out_5261943634849592236[12] = 0; + out_5261943634849592236[13] = 0; + out_5261943634849592236[14] = 0; + out_5261943634849592236[15] = 0; + out_5261943634849592236[16] = 0; + out_5261943634849592236[17] = 0; + out_5261943634849592236[18] = 0; + out_5261943634849592236[19] = 0; + out_5261943634849592236[20] = 0; + out_5261943634849592236[21] = 0; + out_5261943634849592236[22] = 0; + out_5261943634849592236[23] = 1; + out_5261943634849592236[24] = 0; + out_5261943634849592236[25] = 0; + out_5261943634849592236[26] = 0; + out_5261943634849592236[27] = 0; + out_5261943634849592236[28] = 0; + out_5261943634849592236[29] = 0; + out_5261943634849592236[30] = 0; + out_5261943634849592236[31] = 0; + out_5261943634849592236[32] = 0; + out_5261943634849592236[33] = 0; + out_5261943634849592236[34] = 0; + out_5261943634849592236[35] = 0; + out_5261943634849592236[36] = 0; + out_5261943634849592236[37] = 0; + out_5261943634849592236[38] = 0; + out_5261943634849592236[39] = 0; + out_5261943634849592236[40] = 0; + out_5261943634849592236[41] = 0; + out_5261943634849592236[42] = 0; + out_5261943634849592236[43] = 0; + out_5261943634849592236[44] = 0; + out_5261943634849592236[45] = 0; + out_5261943634849592236[46] = 1; + out_5261943634849592236[47] = 0; + out_5261943634849592236[48] = 0; + out_5261943634849592236[49] = 0; + out_5261943634849592236[50] = 0; + out_5261943634849592236[51] = 0; + out_5261943634849592236[52] = 0; + out_5261943634849592236[53] = 0; + out_5261943634849592236[54] = 0; + out_5261943634849592236[55] = 0; + out_5261943634849592236[56] = 0; + out_5261943634849592236[57] = 0; + out_5261943634849592236[58] = 0; + out_5261943634849592236[59] = 0; + out_5261943634849592236[60] = 0; + out_5261943634849592236[61] = 0; + out_5261943634849592236[62] = 0; + out_5261943634849592236[63] = 0; + out_5261943634849592236[64] = 0; + out_5261943634849592236[65] = 0; } -void h_35(double *state, double *unused, double *out_3219025280718560296) { - out_3219025280718560296[0] = state[7]; - out_3219025280718560296[1] = state[8]; - out_3219025280718560296[2] = state[9]; +void h_35(double *state, double *unused, double *out_7101706285091203473) { + out_7101706285091203473[0] = state[7]; + out_7101706285091203473[1] = state[8]; + out_7101706285091203473[2] = state[9]; } -void H_35(double *state, double *unused, double *out_3358837512834197386) { - out_3358837512834197386[0] = 0; - out_3358837512834197386[1] = 0; - out_3358837512834197386[2] = 0; - out_3358837512834197386[3] = 0; - out_3358837512834197386[4] = 0; - out_3358837512834197386[5] = 0; - out_3358837512834197386[6] = 0; - out_3358837512834197386[7] = 1; - out_3358837512834197386[8] = 0; - out_3358837512834197386[9] = 0; - out_3358837512834197386[10] = 0; - out_3358837512834197386[11] = 0; - out_3358837512834197386[12] = 0; - out_3358837512834197386[13] = 0; - out_3358837512834197386[14] = 0; - out_3358837512834197386[15] = 0; - out_3358837512834197386[16] = 0; - out_3358837512834197386[17] = 0; - out_3358837512834197386[18] = 0; - out_3358837512834197386[19] = 0; - out_3358837512834197386[20] = 0; - out_3358837512834197386[21] = 0; - out_3358837512834197386[22] = 0; - out_3358837512834197386[23] = 0; - out_3358837512834197386[24] = 0; - out_3358837512834197386[25] = 0; - out_3358837512834197386[26] = 0; - out_3358837512834197386[27] = 0; - out_3358837512834197386[28] = 0; - out_3358837512834197386[29] = 0; - out_3358837512834197386[30] = 1; - out_3358837512834197386[31] = 0; - out_3358837512834197386[32] = 0; - out_3358837512834197386[33] = 0; - out_3358837512834197386[34] = 0; - out_3358837512834197386[35] = 0; - out_3358837512834197386[36] = 0; - out_3358837512834197386[37] = 0; - out_3358837512834197386[38] = 0; - out_3358837512834197386[39] = 0; - out_3358837512834197386[40] = 0; - out_3358837512834197386[41] = 0; - out_3358837512834197386[42] = 0; - out_3358837512834197386[43] = 0; - out_3358837512834197386[44] = 0; - out_3358837512834197386[45] = 0; - out_3358837512834197386[46] = 0; - out_3358837512834197386[47] = 0; - out_3358837512834197386[48] = 0; - out_3358837512834197386[49] = 0; - out_3358837512834197386[50] = 0; - out_3358837512834197386[51] = 0; - out_3358837512834197386[52] = 0; - out_3358837512834197386[53] = 1; - out_3358837512834197386[54] = 0; - out_3358837512834197386[55] = 0; - out_3358837512834197386[56] = 0; - out_3358837512834197386[57] = 0; - out_3358837512834197386[58] = 0; - out_3358837512834197386[59] = 0; - out_3358837512834197386[60] = 0; - out_3358837512834197386[61] = 0; - out_3358837512834197386[62] = 0; - out_3358837512834197386[63] = 0; - out_3358837512834197386[64] = 0; - out_3358837512834197386[65] = 0; +void H_35(double *state, double *unused, double *out_8884334182550116264) { + out_8884334182550116264[0] = 0; + out_8884334182550116264[1] = 0; + out_8884334182550116264[2] = 0; + out_8884334182550116264[3] = 0; + out_8884334182550116264[4] = 0; + out_8884334182550116264[5] = 0; + out_8884334182550116264[6] = 0; + out_8884334182550116264[7] = 1; + out_8884334182550116264[8] = 0; + out_8884334182550116264[9] = 0; + out_8884334182550116264[10] = 0; + out_8884334182550116264[11] = 0; + out_8884334182550116264[12] = 0; + out_8884334182550116264[13] = 0; + out_8884334182550116264[14] = 0; + out_8884334182550116264[15] = 0; + out_8884334182550116264[16] = 0; + out_8884334182550116264[17] = 0; + out_8884334182550116264[18] = 0; + out_8884334182550116264[19] = 0; + out_8884334182550116264[20] = 0; + out_8884334182550116264[21] = 0; + out_8884334182550116264[22] = 0; + out_8884334182550116264[23] = 0; + out_8884334182550116264[24] = 0; + out_8884334182550116264[25] = 0; + out_8884334182550116264[26] = 0; + out_8884334182550116264[27] = 0; + out_8884334182550116264[28] = 0; + out_8884334182550116264[29] = 0; + out_8884334182550116264[30] = 1; + out_8884334182550116264[31] = 0; + out_8884334182550116264[32] = 0; + out_8884334182550116264[33] = 0; + out_8884334182550116264[34] = 0; + out_8884334182550116264[35] = 0; + out_8884334182550116264[36] = 0; + out_8884334182550116264[37] = 0; + out_8884334182550116264[38] = 0; + out_8884334182550116264[39] = 0; + out_8884334182550116264[40] = 0; + out_8884334182550116264[41] = 0; + out_8884334182550116264[42] = 0; + out_8884334182550116264[43] = 0; + out_8884334182550116264[44] = 0; + out_8884334182550116264[45] = 0; + out_8884334182550116264[46] = 0; + out_8884334182550116264[47] = 0; + out_8884334182550116264[48] = 0; + out_8884334182550116264[49] = 0; + out_8884334182550116264[50] = 0; + out_8884334182550116264[51] = 0; + out_8884334182550116264[52] = 0; + out_8884334182550116264[53] = 1; + out_8884334182550116264[54] = 0; + out_8884334182550116264[55] = 0; + out_8884334182550116264[56] = 0; + out_8884334182550116264[57] = 0; + out_8884334182550116264[58] = 0; + out_8884334182550116264[59] = 0; + out_8884334182550116264[60] = 0; + out_8884334182550116264[61] = 0; + out_8884334182550116264[62] = 0; + out_8884334182550116264[63] = 0; + out_8884334182550116264[64] = 0; + out_8884334182550116264[65] = 0; } -void h_32(double *state, double *unused, double *out_5537109185631613612) { - out_5537109185631613612[0] = state[3]; - out_5537109185631613612[1] = state[4]; - out_5537109185631613612[2] = state[5]; - out_5537109185631613612[3] = state[6]; +void h_32(double *state, double *unused, double *out_6785252874119741308) { + out_6785252874119741308[0] = state[3]; + out_6785252874119741308[1] = state[4]; + out_6785252874119741308[2] = state[5]; + out_6785252874119741308[3] = state[6]; } -void H_32(double *state, double *unused, double *out_3774684674196869746) { - out_3774684674196869746[0] = 0; - out_3774684674196869746[1] = 0; - out_3774684674196869746[2] = 0; - out_3774684674196869746[3] = 1; - out_3774684674196869746[4] = 0; - out_3774684674196869746[5] = 0; - out_3774684674196869746[6] = 0; - out_3774684674196869746[7] = 0; - out_3774684674196869746[8] = 0; - out_3774684674196869746[9] = 0; - out_3774684674196869746[10] = 0; - out_3774684674196869746[11] = 0; - out_3774684674196869746[12] = 0; - out_3774684674196869746[13] = 0; - out_3774684674196869746[14] = 0; - out_3774684674196869746[15] = 0; - out_3774684674196869746[16] = 0; - out_3774684674196869746[17] = 0; - out_3774684674196869746[18] = 0; - out_3774684674196869746[19] = 0; - out_3774684674196869746[20] = 0; - out_3774684674196869746[21] = 0; - out_3774684674196869746[22] = 0; - out_3774684674196869746[23] = 0; - out_3774684674196869746[24] = 0; - out_3774684674196869746[25] = 0; - out_3774684674196869746[26] = 1; - out_3774684674196869746[27] = 0; - out_3774684674196869746[28] = 0; - out_3774684674196869746[29] = 0; - out_3774684674196869746[30] = 0; - out_3774684674196869746[31] = 0; - out_3774684674196869746[32] = 0; - out_3774684674196869746[33] = 0; - out_3774684674196869746[34] = 0; - out_3774684674196869746[35] = 0; - out_3774684674196869746[36] = 0; - out_3774684674196869746[37] = 0; - out_3774684674196869746[38] = 0; - out_3774684674196869746[39] = 0; - out_3774684674196869746[40] = 0; - out_3774684674196869746[41] = 0; - out_3774684674196869746[42] = 0; - out_3774684674196869746[43] = 0; - out_3774684674196869746[44] = 0; - out_3774684674196869746[45] = 0; - out_3774684674196869746[46] = 0; - out_3774684674196869746[47] = 0; - out_3774684674196869746[48] = 0; - out_3774684674196869746[49] = 1; - out_3774684674196869746[50] = 0; - out_3774684674196869746[51] = 0; - out_3774684674196869746[52] = 0; - out_3774684674196869746[53] = 0; - out_3774684674196869746[54] = 0; - out_3774684674196869746[55] = 0; - out_3774684674196869746[56] = 0; - out_3774684674196869746[57] = 0; - out_3774684674196869746[58] = 0; - out_3774684674196869746[59] = 0; - out_3774684674196869746[60] = 0; - out_3774684674196869746[61] = 0; - out_3774684674196869746[62] = 0; - out_3774684674196869746[63] = 0; - out_3774684674196869746[64] = 0; - out_3774684674196869746[65] = 0; - out_3774684674196869746[66] = 0; - out_3774684674196869746[67] = 0; - out_3774684674196869746[68] = 0; - out_3774684674196869746[69] = 0; - out_3774684674196869746[70] = 0; - out_3774684674196869746[71] = 0; - out_3774684674196869746[72] = 1; - out_3774684674196869746[73] = 0; - out_3774684674196869746[74] = 0; - out_3774684674196869746[75] = 0; - out_3774684674196869746[76] = 0; - out_3774684674196869746[77] = 0; - out_3774684674196869746[78] = 0; - out_3774684674196869746[79] = 0; - out_3774684674196869746[80] = 0; - out_3774684674196869746[81] = 0; - out_3774684674196869746[82] = 0; - out_3774684674196869746[83] = 0; - out_3774684674196869746[84] = 0; - out_3774684674196869746[85] = 0; - out_3774684674196869746[86] = 0; - out_3774684674196869746[87] = 0; +void H_32(double *state, double *unused, double *out_4617141584506488605) { + out_4617141584506488605[0] = 0; + out_4617141584506488605[1] = 0; + out_4617141584506488605[2] = 0; + out_4617141584506488605[3] = 1; + out_4617141584506488605[4] = 0; + out_4617141584506488605[5] = 0; + out_4617141584506488605[6] = 0; + out_4617141584506488605[7] = 0; + out_4617141584506488605[8] = 0; + out_4617141584506488605[9] = 0; + out_4617141584506488605[10] = 0; + out_4617141584506488605[11] = 0; + out_4617141584506488605[12] = 0; + out_4617141584506488605[13] = 0; + out_4617141584506488605[14] = 0; + out_4617141584506488605[15] = 0; + out_4617141584506488605[16] = 0; + out_4617141584506488605[17] = 0; + out_4617141584506488605[18] = 0; + out_4617141584506488605[19] = 0; + out_4617141584506488605[20] = 0; + out_4617141584506488605[21] = 0; + out_4617141584506488605[22] = 0; + out_4617141584506488605[23] = 0; + out_4617141584506488605[24] = 0; + out_4617141584506488605[25] = 0; + out_4617141584506488605[26] = 1; + out_4617141584506488605[27] = 0; + out_4617141584506488605[28] = 0; + out_4617141584506488605[29] = 0; + out_4617141584506488605[30] = 0; + out_4617141584506488605[31] = 0; + out_4617141584506488605[32] = 0; + out_4617141584506488605[33] = 0; + out_4617141584506488605[34] = 0; + out_4617141584506488605[35] = 0; + out_4617141584506488605[36] = 0; + out_4617141584506488605[37] = 0; + out_4617141584506488605[38] = 0; + out_4617141584506488605[39] = 0; + out_4617141584506488605[40] = 0; + out_4617141584506488605[41] = 0; + out_4617141584506488605[42] = 0; + out_4617141584506488605[43] = 0; + out_4617141584506488605[44] = 0; + out_4617141584506488605[45] = 0; + out_4617141584506488605[46] = 0; + out_4617141584506488605[47] = 0; + out_4617141584506488605[48] = 0; + out_4617141584506488605[49] = 1; + out_4617141584506488605[50] = 0; + out_4617141584506488605[51] = 0; + out_4617141584506488605[52] = 0; + out_4617141584506488605[53] = 0; + out_4617141584506488605[54] = 0; + out_4617141584506488605[55] = 0; + out_4617141584506488605[56] = 0; + out_4617141584506488605[57] = 0; + out_4617141584506488605[58] = 0; + out_4617141584506488605[59] = 0; + out_4617141584506488605[60] = 0; + out_4617141584506488605[61] = 0; + out_4617141584506488605[62] = 0; + out_4617141584506488605[63] = 0; + out_4617141584506488605[64] = 0; + out_4617141584506488605[65] = 0; + out_4617141584506488605[66] = 0; + out_4617141584506488605[67] = 0; + out_4617141584506488605[68] = 0; + out_4617141584506488605[69] = 0; + out_4617141584506488605[70] = 0; + out_4617141584506488605[71] = 0; + out_4617141584506488605[72] = 1; + out_4617141584506488605[73] = 0; + out_4617141584506488605[74] = 0; + out_4617141584506488605[75] = 0; + out_4617141584506488605[76] = 0; + out_4617141584506488605[77] = 0; + out_4617141584506488605[78] = 0; + out_4617141584506488605[79] = 0; + out_4617141584506488605[80] = 0; + out_4617141584506488605[81] = 0; + out_4617141584506488605[82] = 0; + out_4617141584506488605[83] = 0; + out_4617141584506488605[84] = 0; + out_4617141584506488605[85] = 0; + out_4617141584506488605[86] = 0; + out_4617141584506488605[87] = 0; } -void h_13(double *state, double *unused, double *out_1615263710325240669) { - out_1615263710325240669[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_1615263710325240669[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_1615263710325240669[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_8336853920327438524) { + out_8336853920327438524[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_8336853920327438524[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_8336853920327438524[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_1846820156559909960) { - out_1846820156559909960[0] = 0; - out_1846820156559909960[1] = 0; - out_1846820156559909960[2] = 0; - out_1846820156559909960[3] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8]; - out_1846820156559909960[4] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; - out_1846820156559909960[5] = -2*state[3]*state[9] + 2*state[4]*state[8] - 2*state[5]*state[7]; - out_1846820156559909960[6] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7]; - out_1846820156559909960[7] = pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2); - out_1846820156559909960[8] = 2*state[3]*state[6] + 2*state[4]*state[5]; - out_1846820156559909960[9] = -2*state[3]*state[5] + 2*state[4]*state[6]; - out_1846820156559909960[10] = 0; - out_1846820156559909960[11] = 0; - out_1846820156559909960[12] = 0; - out_1846820156559909960[13] = 0; - out_1846820156559909960[14] = 0; - out_1846820156559909960[15] = 0; - out_1846820156559909960[16] = 0; - out_1846820156559909960[17] = 0; - out_1846820156559909960[18] = 0; - out_1846820156559909960[19] = 0; - out_1846820156559909960[20] = 0; - out_1846820156559909960[21] = 0; - out_1846820156559909960[22] = 0; - out_1846820156559909960[23] = 0; - out_1846820156559909960[24] = 0; - out_1846820156559909960[25] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7]; - out_1846820156559909960[26] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7]; - out_1846820156559909960[27] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; - out_1846820156559909960[28] = -2*state[3]*state[7] + 2*state[5]*state[9] - 2*state[6]*state[8]; - out_1846820156559909960[29] = -2*state[3]*state[6] + 2*state[4]*state[5]; - out_1846820156559909960[30] = pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2); - out_1846820156559909960[31] = 2*state[3]*state[4] + 2*state[5]*state[6]; - out_1846820156559909960[32] = 0; - out_1846820156559909960[33] = 0; - out_1846820156559909960[34] = 0; - out_1846820156559909960[35] = 0; - out_1846820156559909960[36] = 0; - out_1846820156559909960[37] = 0; - out_1846820156559909960[38] = 0; - out_1846820156559909960[39] = 0; - out_1846820156559909960[40] = 0; - out_1846820156559909960[41] = 0; - out_1846820156559909960[42] = 0; - out_1846820156559909960[43] = 0; - out_1846820156559909960[44] = 0; - out_1846820156559909960[45] = 0; - out_1846820156559909960[46] = 0; - out_1846820156559909960[47] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7]; - out_1846820156559909960[48] = -2*state[3]*state[8] - 2*state[4]*state[9] + 2*state[6]*state[7]; - out_1846820156559909960[49] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8]; - out_1846820156559909960[50] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; - out_1846820156559909960[51] = 2*state[3]*state[5] + 2*state[4]*state[6]; - out_1846820156559909960[52] = -2*state[3]*state[4] + 2*state[5]*state[6]; - out_1846820156559909960[53] = pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2); - out_1846820156559909960[54] = 0; - out_1846820156559909960[55] = 0; - out_1846820156559909960[56] = 0; - out_1846820156559909960[57] = 0; - out_1846820156559909960[58] = 0; - out_1846820156559909960[59] = 0; - out_1846820156559909960[60] = 0; - out_1846820156559909960[61] = 0; - out_1846820156559909960[62] = 0; - out_1846820156559909960[63] = 0; - out_1846820156559909960[64] = 0; - out_1846820156559909960[65] = 0; +void H_13(double *state, double *unused, double *out_6724928250734846974) { + out_6724928250734846974[0] = 0; + out_6724928250734846974[1] = 0; + out_6724928250734846974[2] = 0; + out_6724928250734846974[3] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8]; + out_6724928250734846974[4] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; + out_6724928250734846974[5] = -2*state[3]*state[9] + 2*state[4]*state[8] - 2*state[5]*state[7]; + out_6724928250734846974[6] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7]; + out_6724928250734846974[7] = pow(state[3], 2) + pow(state[4], 2) - pow(state[5], 2) - pow(state[6], 2); + out_6724928250734846974[8] = 2*state[3]*state[6] + 2*state[4]*state[5]; + out_6724928250734846974[9] = -2*state[3]*state[5] + 2*state[4]*state[6]; + out_6724928250734846974[10] = 0; + out_6724928250734846974[11] = 0; + out_6724928250734846974[12] = 0; + out_6724928250734846974[13] = 0; + out_6724928250734846974[14] = 0; + out_6724928250734846974[15] = 0; + out_6724928250734846974[16] = 0; + out_6724928250734846974[17] = 0; + out_6724928250734846974[18] = 0; + out_6724928250734846974[19] = 0; + out_6724928250734846974[20] = 0; + out_6724928250734846974[21] = 0; + out_6724928250734846974[22] = 0; + out_6724928250734846974[23] = 0; + out_6724928250734846974[24] = 0; + out_6724928250734846974[25] = 2*state[3]*state[8] + 2*state[4]*state[9] - 2*state[6]*state[7]; + out_6724928250734846974[26] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7]; + out_6724928250734846974[27] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; + out_6724928250734846974[28] = -2*state[3]*state[7] + 2*state[5]*state[9] - 2*state[6]*state[8]; + out_6724928250734846974[29] = -2*state[3]*state[6] + 2*state[4]*state[5]; + out_6724928250734846974[30] = pow(state[3], 2) - pow(state[4], 2) + pow(state[5], 2) - pow(state[6], 2); + out_6724928250734846974[31] = 2*state[3]*state[4] + 2*state[5]*state[6]; + out_6724928250734846974[32] = 0; + out_6724928250734846974[33] = 0; + out_6724928250734846974[34] = 0; + out_6724928250734846974[35] = 0; + out_6724928250734846974[36] = 0; + out_6724928250734846974[37] = 0; + out_6724928250734846974[38] = 0; + out_6724928250734846974[39] = 0; + out_6724928250734846974[40] = 0; + out_6724928250734846974[41] = 0; + out_6724928250734846974[42] = 0; + out_6724928250734846974[43] = 0; + out_6724928250734846974[44] = 0; + out_6724928250734846974[45] = 0; + out_6724928250734846974[46] = 0; + out_6724928250734846974[47] = 2*state[3]*state[9] - 2*state[4]*state[8] + 2*state[5]*state[7]; + out_6724928250734846974[48] = -2*state[3]*state[8] - 2*state[4]*state[9] + 2*state[6]*state[7]; + out_6724928250734846974[49] = 2*state[3]*state[7] - 2*state[5]*state[9] + 2*state[6]*state[8]; + out_6724928250734846974[50] = 2*state[4]*state[7] + 2*state[5]*state[8] + 2*state[6]*state[9]; + out_6724928250734846974[51] = 2*state[3]*state[5] + 2*state[4]*state[6]; + out_6724928250734846974[52] = -2*state[3]*state[4] + 2*state[5]*state[6]; + out_6724928250734846974[53] = pow(state[3], 2) - pow(state[4], 2) - pow(state[5], 2) + pow(state[6], 2); + out_6724928250734846974[54] = 0; + out_6724928250734846974[55] = 0; + out_6724928250734846974[56] = 0; + out_6724928250734846974[57] = 0; + out_6724928250734846974[58] = 0; + out_6724928250734846974[59] = 0; + out_6724928250734846974[60] = 0; + out_6724928250734846974[61] = 0; + out_6724928250734846974[62] = 0; + out_6724928250734846974[63] = 0; + out_6724928250734846974[64] = 0; + out_6724928250734846974[65] = 0; } -void h_14(double *state, double *unused, double *out_7431485379286447551) { - out_7431485379286447551[0] = state[10]; - out_7431485379286447551[1] = state[11]; - out_7431485379286447551[2] = state[12]; +void h_14(double *state, double *unused, double *out_7859104742158472266) { + out_7859104742158472266[0] = state[10]; + out_7859104742158472266[1] = state[11]; + out_7859104742158472266[2] = state[12]; } -void H_14(double *state, double *unused, double *out_7564076767147969371) { - out_7564076767147969371[0] = 0; - out_7564076767147969371[1] = 0; - out_7564076767147969371[2] = 0; - out_7564076767147969371[3] = 0; - out_7564076767147969371[4] = 0; - out_7564076767147969371[5] = 0; - out_7564076767147969371[6] = 0; - out_7564076767147969371[7] = 0; - out_7564076767147969371[8] = 0; - out_7564076767147969371[9] = 0; - out_7564076767147969371[10] = 1; - out_7564076767147969371[11] = 0; - out_7564076767147969371[12] = 0; - out_7564076767147969371[13] = 0; - out_7564076767147969371[14] = 0; - out_7564076767147969371[15] = 0; - out_7564076767147969371[16] = 0; - out_7564076767147969371[17] = 0; - out_7564076767147969371[18] = 0; - out_7564076767147969371[19] = 0; - out_7564076767147969371[20] = 0; - out_7564076767147969371[21] = 0; - out_7564076767147969371[22] = 0; - out_7564076767147969371[23] = 0; - out_7564076767147969371[24] = 0; - out_7564076767147969371[25] = 0; - out_7564076767147969371[26] = 0; - out_7564076767147969371[27] = 0; - out_7564076767147969371[28] = 0; - out_7564076767147969371[29] = 0; - out_7564076767147969371[30] = 0; - out_7564076767147969371[31] = 0; - out_7564076767147969371[32] = 0; - out_7564076767147969371[33] = 1; - out_7564076767147969371[34] = 0; - out_7564076767147969371[35] = 0; - out_7564076767147969371[36] = 0; - out_7564076767147969371[37] = 0; - out_7564076767147969371[38] = 0; - out_7564076767147969371[39] = 0; - out_7564076767147969371[40] = 0; - out_7564076767147969371[41] = 0; - out_7564076767147969371[42] = 0; - out_7564076767147969371[43] = 0; - out_7564076767147969371[44] = 0; - out_7564076767147969371[45] = 0; - out_7564076767147969371[46] = 0; - out_7564076767147969371[47] = 0; - out_7564076767147969371[48] = 0; - out_7564076767147969371[49] = 0; - out_7564076767147969371[50] = 0; - out_7564076767147969371[51] = 0; - out_7564076767147969371[52] = 0; - out_7564076767147969371[53] = 0; - out_7564076767147969371[54] = 0; - out_7564076767147969371[55] = 0; - out_7564076767147969371[56] = 1; - out_7564076767147969371[57] = 0; - out_7564076767147969371[58] = 0; - out_7564076767147969371[59] = 0; - out_7564076767147969371[60] = 0; - out_7564076767147969371[61] = 0; - out_7564076767147969371[62] = 0; - out_7564076767147969371[63] = 0; - out_7564076767147969371[64] = 0; - out_7564076767147969371[65] = 0; +void H_14(double *state, double *unused, double *out_8406533677457588230) { + out_8406533677457588230[0] = 0; + out_8406533677457588230[1] = 0; + out_8406533677457588230[2] = 0; + out_8406533677457588230[3] = 0; + out_8406533677457588230[4] = 0; + out_8406533677457588230[5] = 0; + out_8406533677457588230[6] = 0; + out_8406533677457588230[7] = 0; + out_8406533677457588230[8] = 0; + out_8406533677457588230[9] = 0; + out_8406533677457588230[10] = 1; + out_8406533677457588230[11] = 0; + out_8406533677457588230[12] = 0; + out_8406533677457588230[13] = 0; + out_8406533677457588230[14] = 0; + out_8406533677457588230[15] = 0; + out_8406533677457588230[16] = 0; + out_8406533677457588230[17] = 0; + out_8406533677457588230[18] = 0; + out_8406533677457588230[19] = 0; + out_8406533677457588230[20] = 0; + out_8406533677457588230[21] = 0; + out_8406533677457588230[22] = 0; + out_8406533677457588230[23] = 0; + out_8406533677457588230[24] = 0; + out_8406533677457588230[25] = 0; + out_8406533677457588230[26] = 0; + out_8406533677457588230[27] = 0; + out_8406533677457588230[28] = 0; + out_8406533677457588230[29] = 0; + out_8406533677457588230[30] = 0; + out_8406533677457588230[31] = 0; + out_8406533677457588230[32] = 0; + out_8406533677457588230[33] = 1; + out_8406533677457588230[34] = 0; + out_8406533677457588230[35] = 0; + out_8406533677457588230[36] = 0; + out_8406533677457588230[37] = 0; + out_8406533677457588230[38] = 0; + out_8406533677457588230[39] = 0; + out_8406533677457588230[40] = 0; + out_8406533677457588230[41] = 0; + out_8406533677457588230[42] = 0; + out_8406533677457588230[43] = 0; + out_8406533677457588230[44] = 0; + out_8406533677457588230[45] = 0; + out_8406533677457588230[46] = 0; + out_8406533677457588230[47] = 0; + out_8406533677457588230[48] = 0; + out_8406533677457588230[49] = 0; + out_8406533677457588230[50] = 0; + out_8406533677457588230[51] = 0; + out_8406533677457588230[52] = 0; + out_8406533677457588230[53] = 0; + out_8406533677457588230[54] = 0; + out_8406533677457588230[55] = 0; + out_8406533677457588230[56] = 1; + out_8406533677457588230[57] = 0; + out_8406533677457588230[58] = 0; + out_8406533677457588230[59] = 0; + out_8406533677457588230[60] = 0; + out_8406533677457588230[61] = 0; + out_8406533677457588230[62] = 0; + out_8406533677457588230[63] = 0; + out_8406533677457588230[64] = 0; + out_8406533677457588230[65] = 0; } -void h_33(double *state, double *unused, double *out_4659271231748144567) { - out_4659271231748144567[0] = state[16]; - out_4659271231748144567[1] = state[17]; - out_4659271231748144567[2] = state[18]; +void h_33(double *state, double *unused, double *out_3304821984098832254) { + out_3304821984098832254[0] = state[16]; + out_3304821984098832254[1] = state[17]; + out_3304821984098832254[2] = state[18]; } -void H_33(double *state, double *unused, double *out_4606637891179707910) { - out_4606637891179707910[0] = 0; - out_4606637891179707910[1] = 0; - out_4606637891179707910[2] = 0; - out_4606637891179707910[3] = 0; - out_4606637891179707910[4] = 0; - out_4606637891179707910[5] = 0; - out_4606637891179707910[6] = 0; - out_4606637891179707910[7] = 0; - out_4606637891179707910[8] = 0; - out_4606637891179707910[9] = 0; - out_4606637891179707910[10] = 0; - out_4606637891179707910[11] = 0; - out_4606637891179707910[12] = 0; - out_4606637891179707910[13] = 0; - out_4606637891179707910[14] = 0; - out_4606637891179707910[15] = 0; - out_4606637891179707910[16] = 1; - out_4606637891179707910[17] = 0; - out_4606637891179707910[18] = 0; - out_4606637891179707910[19] = 0; - out_4606637891179707910[20] = 0; - out_4606637891179707910[21] = 0; - out_4606637891179707910[22] = 0; - out_4606637891179707910[23] = 0; - out_4606637891179707910[24] = 0; - out_4606637891179707910[25] = 0; - out_4606637891179707910[26] = 0; - out_4606637891179707910[27] = 0; - out_4606637891179707910[28] = 0; - out_4606637891179707910[29] = 0; - out_4606637891179707910[30] = 0; - out_4606637891179707910[31] = 0; - out_4606637891179707910[32] = 0; - out_4606637891179707910[33] = 0; - out_4606637891179707910[34] = 0; - out_4606637891179707910[35] = 0; - out_4606637891179707910[36] = 0; - out_4606637891179707910[37] = 0; - out_4606637891179707910[38] = 0; - out_4606637891179707910[39] = 1; - out_4606637891179707910[40] = 0; - out_4606637891179707910[41] = 0; - out_4606637891179707910[42] = 0; - out_4606637891179707910[43] = 0; - out_4606637891179707910[44] = 0; - out_4606637891179707910[45] = 0; - out_4606637891179707910[46] = 0; - out_4606637891179707910[47] = 0; - out_4606637891179707910[48] = 0; - out_4606637891179707910[49] = 0; - out_4606637891179707910[50] = 0; - out_4606637891179707910[51] = 0; - out_4606637891179707910[52] = 0; - out_4606637891179707910[53] = 0; - out_4606637891179707910[54] = 0; - out_4606637891179707910[55] = 0; - out_4606637891179707910[56] = 0; - out_4606637891179707910[57] = 0; - out_4606637891179707910[58] = 0; - out_4606637891179707910[59] = 0; - out_4606637891179707910[60] = 0; - out_4606637891179707910[61] = 0; - out_4606637891179707910[62] = 1; - out_4606637891179707910[63] = 0; - out_4606637891179707910[64] = 0; - out_4606637891179707910[65] = 0; +void H_33(double *state, double *unused, double *out_634176402114279077) { + out_634176402114279077[0] = 0; + out_634176402114279077[1] = 0; + out_634176402114279077[2] = 0; + out_634176402114279077[3] = 0; + out_634176402114279077[4] = 0; + out_634176402114279077[5] = 0; + out_634176402114279077[6] = 0; + out_634176402114279077[7] = 0; + out_634176402114279077[8] = 0; + out_634176402114279077[9] = 0; + out_634176402114279077[10] = 0; + out_634176402114279077[11] = 0; + out_634176402114279077[12] = 0; + out_634176402114279077[13] = 0; + out_634176402114279077[14] = 0; + out_634176402114279077[15] = 0; + out_634176402114279077[16] = 1; + out_634176402114279077[17] = 0; + out_634176402114279077[18] = 0; + out_634176402114279077[19] = 0; + out_634176402114279077[20] = 0; + out_634176402114279077[21] = 0; + out_634176402114279077[22] = 0; + out_634176402114279077[23] = 0; + out_634176402114279077[24] = 0; + out_634176402114279077[25] = 0; + out_634176402114279077[26] = 0; + out_634176402114279077[27] = 0; + out_634176402114279077[28] = 0; + out_634176402114279077[29] = 0; + out_634176402114279077[30] = 0; + out_634176402114279077[31] = 0; + out_634176402114279077[32] = 0; + out_634176402114279077[33] = 0; + out_634176402114279077[34] = 0; + out_634176402114279077[35] = 0; + out_634176402114279077[36] = 0; + out_634176402114279077[37] = 0; + out_634176402114279077[38] = 0; + out_634176402114279077[39] = 1; + out_634176402114279077[40] = 0; + out_634176402114279077[41] = 0; + out_634176402114279077[42] = 0; + out_634176402114279077[43] = 0; + out_634176402114279077[44] = 0; + out_634176402114279077[45] = 0; + out_634176402114279077[46] = 0; + out_634176402114279077[47] = 0; + out_634176402114279077[48] = 0; + out_634176402114279077[49] = 0; + out_634176402114279077[50] = 0; + out_634176402114279077[51] = 0; + out_634176402114279077[52] = 0; + out_634176402114279077[53] = 0; + out_634176402114279077[54] = 0; + out_634176402114279077[55] = 0; + out_634176402114279077[56] = 0; + out_634176402114279077[57] = 0; + out_634176402114279077[58] = 0; + out_634176402114279077[59] = 0; + out_634176402114279077[60] = 0; + out_634176402114279077[61] = 0; + out_634176402114279077[62] = 1; + out_634176402114279077[63] = 0; + out_634176402114279077[64] = 0; + out_634176402114279077[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_7275051445048872074) { - H(in_vec, out_7275051445048872074); +void live_H(double *in_vec, double *out_4820339293882119518) { + H(in_vec, out_4820339293882119518); } -void live_err_fun(double *nom_x, double *delta_x, double *out_900214999320880639) { - err_fun(nom_x, delta_x, out_900214999320880639); +void live_err_fun(double *nom_x, double *delta_x, double *out_3392766111887124100) { + err_fun(nom_x, delta_x, out_3392766111887124100); } -void live_inv_err_fun(double *nom_x, double *true_x, double *out_6228497090895348531) { - inv_err_fun(nom_x, true_x, out_6228497090895348531); +void live_inv_err_fun(double *nom_x, double *true_x, double *out_2216925330683638231) { + inv_err_fun(nom_x, true_x, out_2216925330683638231); } -void live_H_mod_fun(double *state, double *out_6900568612264374751) { - H_mod_fun(state, out_6900568612264374751); +void live_H_mod_fun(double *state, double *out_679232602159257814) { + H_mod_fun(state, out_679232602159257814); } -void live_f_fun(double *state, double dt, double *out_444317293709373841) { - f_fun(state, dt, out_444317293709373841); +void live_f_fun(double *state, double dt, double *out_6123814017633530199) { + f_fun(state, dt, out_6123814017633530199); } -void live_F_fun(double *state, double dt, double *out_833440091851189730) { - F_fun(state, dt, out_833440091851189730); +void live_F_fun(double *state, double dt, double *out_9115853419523662321) { + F_fun(state, dt, out_9115853419523662321); } -void live_h_4(double *state, double *unused, double *out_5875214861579885541) { - h_4(state, unused, out_5875214861579885541); +void live_h_4(double *state, double *unused, double *out_6071256838368436397) { + h_4(state, unused, out_6071256838368436397); } -void live_H_4(double *state, double *unused, double *out_276857831883521901) { - H_4(state, unused, out_276857831883521901); +void live_H_4(double *state, double *unused, double *out_1119314742193140760) { + H_4(state, unused, out_1119314742193140760); } -void live_h_9(double *state, double *unused, double *out_7431485379286447551) { - h_9(state, unused, out_7431485379286447551); +void live_h_9(double *state, double *unused, double *out_7859104742158472266) { + h_9(state, unused, out_7859104742158472266); } -void live_H_9(double *state, double *unused, double *out_7564076767147969371) { - H_9(state, unused, out_7564076767147969371); +void live_H_9(double *state, double *unused, double *out_8406533677457588230) { + H_9(state, unused, out_8406533677457588230); } -void live_h_10(double *state, double *unused, double *out_8274293454775594883) { - h_10(state, unused, out_8274293454775594883); +void live_h_10(double *state, double *unused, double *out_4473856785133789330) { + h_10(state, unused, out_4473856785133789330); } -void live_H_10(double *state, double *unused, double *out_3646697484698039257) { - H_10(state, unused, out_3646697484698039257); +void live_H_10(double *state, double *unused, double *out_5999678041645387439) { + H_10(state, unused, out_5999678041645387439); } -void live_h_12(double *state, double *unused, double *out_7462563038781612366) { - h_12(state, unused, out_7462563038781612366); +void live_h_12(double *state, double *unused, double *out_7662391294081069133) { + h_12(state, unused, out_7662391294081069133); } -void live_H_12(double *state, double *unused, double *out_6104400545159211095) { - H_12(state, unused, out_6104400545159211095); +void live_H_12(double *state, double *unused, double *out_5261943634849592236) { + H_12(state, unused, out_5261943634849592236); } -void live_h_35(double *state, double *unused, double *out_3219025280718560296) { - h_35(state, unused, out_3219025280718560296); +void live_h_35(double *state, double *unused, double *out_7101706285091203473) { + h_35(state, unused, out_7101706285091203473); } -void live_H_35(double *state, double *unused, double *out_3358837512834197386) { - H_35(state, unused, out_3358837512834197386); +void live_H_35(double *state, double *unused, double *out_8884334182550116264) { + H_35(state, unused, out_8884334182550116264); } -void live_h_32(double *state, double *unused, double *out_5537109185631613612) { - h_32(state, unused, out_5537109185631613612); +void live_h_32(double *state, double *unused, double *out_6785252874119741308) { + h_32(state, unused, out_6785252874119741308); } -void live_H_32(double *state, double *unused, double *out_3774684674196869746) { - H_32(state, unused, out_3774684674196869746); +void live_H_32(double *state, double *unused, double *out_4617141584506488605) { + H_32(state, unused, out_4617141584506488605); } -void live_h_13(double *state, double *unused, double *out_1615263710325240669) { - h_13(state, unused, out_1615263710325240669); +void live_h_13(double *state, double *unused, double *out_8336853920327438524) { + h_13(state, unused, out_8336853920327438524); } -void live_H_13(double *state, double *unused, double *out_1846820156559909960) { - H_13(state, unused, out_1846820156559909960); +void live_H_13(double *state, double *unused, double *out_6724928250734846974) { + H_13(state, unused, out_6724928250734846974); } -void live_h_14(double *state, double *unused, double *out_7431485379286447551) { - h_14(state, unused, out_7431485379286447551); +void live_h_14(double *state, double *unused, double *out_7859104742158472266) { + h_14(state, unused, out_7859104742158472266); } -void live_H_14(double *state, double *unused, double *out_7564076767147969371) { - H_14(state, unused, out_7564076767147969371); +void live_H_14(double *state, double *unused, double *out_8406533677457588230) { + H_14(state, unused, out_8406533677457588230); } -void live_h_33(double *state, double *unused, double *out_4659271231748144567) { - h_33(state, unused, out_4659271231748144567); +void live_h_33(double *state, double *unused, double *out_3304821984098832254) { + h_33(state, unused, out_3304821984098832254); } -void live_H_33(double *state, double *unused, double *out_4606637891179707910) { - H_33(state, unused, out_4606637891179707910); +void live_H_33(double *state, double *unused, double *out_634176402114279077) { + H_33(state, unused, out_634176402114279077); } 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 a3ce77a5a..43a79504b 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_7275051445048872074); -void live_err_fun(double *nom_x, double *delta_x, double *out_900214999320880639); -void live_inv_err_fun(double *nom_x, double *true_x, double *out_6228497090895348531); -void live_H_mod_fun(double *state, double *out_6900568612264374751); -void live_f_fun(double *state, double dt, double *out_444317293709373841); -void live_F_fun(double *state, double dt, double *out_833440091851189730); -void live_h_4(double *state, double *unused, double *out_5875214861579885541); -void live_H_4(double *state, double *unused, double *out_276857831883521901); -void live_h_9(double *state, double *unused, double *out_7431485379286447551); -void live_H_9(double *state, double *unused, double *out_7564076767147969371); -void live_h_10(double *state, double *unused, double *out_8274293454775594883); -void live_H_10(double *state, double *unused, double *out_3646697484698039257); -void live_h_12(double *state, double *unused, double *out_7462563038781612366); -void live_H_12(double *state, double *unused, double *out_6104400545159211095); -void live_h_35(double *state, double *unused, double *out_3219025280718560296); -void live_H_35(double *state, double *unused, double *out_3358837512834197386); -void live_h_32(double *state, double *unused, double *out_5537109185631613612); -void live_H_32(double *state, double *unused, double *out_3774684674196869746); -void live_h_13(double *state, double *unused, double *out_1615263710325240669); -void live_H_13(double *state, double *unused, double *out_1846820156559909960); -void live_h_14(double *state, double *unused, double *out_7431485379286447551); -void live_H_14(double *state, double *unused, double *out_7564076767147969371); -void live_h_33(double *state, double *unused, double *out_4659271231748144567); -void live_H_33(double *state, double *unused, double *out_4606637891179707910); +void live_H(double *in_vec, double *out_4820339293882119518); +void live_err_fun(double *nom_x, double *delta_x, double *out_3392766111887124100); +void live_inv_err_fun(double *nom_x, double *true_x, double *out_2216925330683638231); +void live_H_mod_fun(double *state, double *out_679232602159257814); +void live_f_fun(double *state, double dt, double *out_6123814017633530199); +void live_F_fun(double *state, double dt, double *out_9115853419523662321); +void live_h_4(double *state, double *unused, double *out_6071256838368436397); +void live_H_4(double *state, double *unused, double *out_1119314742193140760); +void live_h_9(double *state, double *unused, double *out_7859104742158472266); +void live_H_9(double *state, double *unused, double *out_8406533677457588230); +void live_h_10(double *state, double *unused, double *out_4473856785133789330); +void live_H_10(double *state, double *unused, double *out_5999678041645387439); +void live_h_12(double *state, double *unused, double *out_7662391294081069133); +void live_H_12(double *state, double *unused, double *out_5261943634849592236); +void live_h_35(double *state, double *unused, double *out_7101706285091203473); +void live_H_35(double *state, double *unused, double *out_8884334182550116264); +void live_h_32(double *state, double *unused, double *out_6785252874119741308); +void live_H_32(double *state, double *unused, double *out_4617141584506488605); +void live_h_13(double *state, double *unused, double *out_8336853920327438524); +void live_H_13(double *state, double *unused, double *out_6724928250734846974); +void live_h_14(double *state, double *unused, double *out_7859104742158472266); +void live_H_14(double *state, double *unused, double *out_8406533677457588230); +void live_h_33(double *state, double *unused, double *out_3304821984098832254); +void live_H_33(double *state, double *unused, double *out_634176402114279077); 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/torqued.py b/selfdrive/locationd/torqued.py new file mode 100755 index 000000000..e9c3c9166 --- /dev/null +++ b/selfdrive/locationd/torqued.py @@ -0,0 +1,290 @@ +#!/usr/bin/env python3 +import os +import sys +import signal +import numpy as np +from collections import deque, defaultdict + +import cereal.messaging as messaging +from cereal import car, log +from common.params import Params +from common.realtime import config_realtime_process, DT_MDL +from common.filter_simple import FirstOrderFilter +from system.swaglog import cloudlog +from selfdrive.controls.lib.vehicle_model import ACCELERATION_DUE_TO_GRAVITY + +HISTORY = 5 # secs +POINTS_PER_BUCKET = 1500 +MIN_POINTS_TOTAL = 4000 +FIT_POINTS_TOTAL = 2000 +MIN_VEL = 15 # m/s +FRICTION_FACTOR = 1.5 # ~85% of data coverage +FACTOR_SANITY = 0.3 +FRICTION_SANITY = 0.5 +STEER_MIN_THRESHOLD = 0.02 +MIN_FILTER_DECAY = 50 +MAX_FILTER_DECAY = 250 +LAT_ACC_THRESHOLD = 1 +STEER_BUCKET_BOUNDS = [(-0.5, -0.3), (-0.3, -0.2), (-0.2, -0.1), (-0.1, 0), (0, 0.1), (0.1, 0.2), (0.2, 0.3), (0.3, 0.5)] +MIN_BUCKET_POINTS = [100, 300, 500, 500, 500, 500, 300, 100] +MAX_RESETS = 5.0 +MAX_INVALID_THRESHOLD = 10 +MIN_ENGAGE_BUFFER = 2 # secs + +VERSION = 1 # bump this to invalidate old parameter caches +ALLOWED_CARS = ['toyota', 'hyundai'] + + +def slope2rot(slope): + sin = np.sqrt(slope**2 / (slope**2 + 1)) + cos = np.sqrt(1 / (slope**2 + 1)) + return np.array([[cos, -sin], [sin, cos]]) + + +class NPQueue: + def __init__(self, maxlen, rowsize): + self.maxlen = maxlen + self.arr = np.empty((0, rowsize)) + + def __len__(self): + return len(self.arr) + + def append(self, pt): + if len(self.arr) < self.maxlen: + self.arr = np.append(self.arr, [pt], axis=0) + else: + self.arr[:-1] = self.arr[1:] + self.arr[-1] = pt + + +class PointBuckets: + def __init__(self, x_bounds, min_points): + self.x_bounds = x_bounds + self.buckets = {bounds: NPQueue(maxlen=POINTS_PER_BUCKET, rowsize=3) for bounds in x_bounds} + self.buckets_min_points = {bounds: min_point for bounds, min_point in zip(x_bounds, min_points)} + + def bucket_lengths(self): + return [len(v) for v in self.buckets.values()] + + def __len__(self): + return sum(self.bucket_lengths()) + + def is_valid(self): + return all(len(v) >= min_pts for v, min_pts in zip(self.buckets.values(), self.buckets_min_points.values())) and (self.__len__() >= MIN_POINTS_TOTAL) + + def add_point(self, x, y): + for bound_min, bound_max in self.x_bounds: + if (x >= bound_min) and (x < bound_max): + self.buckets[(bound_min, bound_max)].append([x, 1.0, y]) + break + + def get_points(self, num_points=None): + 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): + for x, y in points: + self.add_point(x, y) + + +class TorqueEstimator: + def __init__(self, CP): + self.hist_len = int(HISTORY / DT_MDL) + self.lag = CP.steerActuatorDelay + .2 # from controlsd + + self.offline_friction = 0.0 + self.offline_latAccelFactor = 0.0 + self.resets = 0.0 + self.use_params = CP.carName in ALLOWED_CARS or Params().get_bool('dp_lateral_torque_live_tune') + + if CP.lateralTuning.which() == 'torque': + self.offline_friction = CP.lateralTuning.torque.friction + self.offline_latAccelFactor = CP.lateralTuning.torque.latAccelFactor + + self.reset() + + initial_params = { + 'latAccelFactor': self.offline_latAccelFactor, + 'latAccelOffset': 0.0, + 'frictionCoefficient': self.offline_friction, + 'points': [] + } + self.decay = MIN_FILTER_DECAY + self.min_lataccel_factor = (1.0 - FACTOR_SANITY) * self.offline_latAccelFactor + self.max_lataccel_factor = (1.0 + FACTOR_SANITY) * self.offline_latAccelFactor + self.min_friction = (1.0 - FRICTION_SANITY) * self.offline_friction + self.max_friction = (1.0 + FRICTION_SANITY) * self.offline_friction + + # try to restore cached params + params = Params() + params_cache = params.get("LiveTorqueCarParams") + torque_cache = params.get("LiveTorqueParameters") + if params_cache is not None and torque_cache is not None: + try: + cache_ltp = log.Event.from_bytes(torque_cache).liveTorqueParameters + cache_CP = car.CarParams.from_bytes(params_cache) + if self.get_restore_key(cache_CP, cache_ltp.version) == self.get_restore_key(CP, VERSION): + if cache_ltp.liveValid: + initial_params = { + 'latAccelFactor': cache_ltp.latAccelFactorFiltered, + 'latAccelOffset': cache_ltp.latAccelOffsetFiltered, + 'frictionCoefficient': cache_ltp.frictionCoefficientFiltered + } + initial_params['points'] = cache_ltp.points + self.decay = cache_ltp.decay + self.filtered_points.load_points(initial_params['points']) + cloudlog.info("restored torque params from cache") + except Exception: + cloudlog.exception("failed to restore cached torque params") + params.remove("LiveTorqueCarParams") + params.remove("LiveTorqueParameters") + + self.filtered_params = {} + for param in initial_params: + self.filtered_params[param] = FirstOrderFilter(initial_params[param], self.decay, DT_MDL) + + def get_restore_key(self, CP, version): + a, b = None, None + if CP.lateralTuning.which() == 'torque': + a = CP.lateralTuning.torque.friction + b = CP.lateralTuning.torque.latAccelFactor + return (CP.carFingerprint, CP.lateralTuning.which(), a, b, version) + + def reset(self): + self.resets += 1.0 + self.invalid_values_tracker = 0.0 + self.decay = MIN_FILTER_DECAY + self.raw_points = defaultdict(lambda: deque(maxlen=self.hist_len)) + self.filtered_points = PointBuckets(x_bounds=STEER_BUCKET_BOUNDS, min_points=MIN_BUCKET_POINTS) + + def estimate_params(self): + points = self.filtered_points.get_points(FIT_POINTS_TOTAL) + # total least square solution as both x and y are noisy observations + # this is empirically the slope of the hysteresis parallelogram as opposed to the line through the diagonals + try: + _, _, v = np.linalg.svd(points, full_matrices=False) + slope, offset = -v.T[0:2, 2] / v.T[2, 2] + _, spread = np.matmul(points[:, [0, 2]], slope2rot(slope)).T + friction_coeff = np.std(spread) * FRICTION_FACTOR + except np.linalg.LinAlgError as e: + cloudlog.exception(f"Error computing live torque params: {e}") + slope = offset = friction_coeff = np.nan + return slope, offset, friction_coeff + + def update_params(self, params): + self.decay = min(self.decay + DT_MDL, MAX_FILTER_DECAY) + for param, value in params.items(): + self.filtered_params[param].update(value) + self.filtered_params[param].update_alpha(self.decay) + + def is_sane(self, latAccelFactor, latAccelOffset, friction): + if any([val is None or np.isnan(val) for val in [latAccelFactor, latAccelOffset, friction]]): + return False + return (self.max_friction >= friction >= self.min_friction) and\ + (self.max_lataccel_factor >= latAccelFactor >= self.min_lataccel_factor) + + 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 == "carState": + self.raw_points["carState_t"].append(t + self.lag) + self.raw_points["vego"].append(msg.vEgo) + self.raw_points["steer_override"].append(msg.steeringPressed) + elif which == "liveLocationKalman": + if len(self.raw_points['steer_torque']) == self.hist_len: + yaw_rate = msg.angularVelocityCalibrated.value[2] + roll = msg.orientationNED.value[0] + active = np.interp(np.arange(t - MIN_ENGAGE_BUFFER, t, DT_MDL), self.raw_points['carControl_t'], self.raw_points['active']).astype(bool) + steer_override = np.interp(np.arange(t - MIN_ENGAGE_BUFFER, t, DT_MDL), self.raw_points['carState_t'], self.raw_points['steer_override']).astype(bool) + vego = np.interp(t, self.raw_points['carState_t'], self.raw_points['vego']) + steer = np.interp(t, self.raw_points['carControl_t'], self.raw_points['steer_torque']) + lateral_acc = (vego * yaw_rate) - (np.sin(roll) * ACCELERATION_DUE_TO_GRAVITY) + if all(active) and (not any(steer_override)) and (vego > MIN_VEL) and (abs(steer) > STEER_MIN_THRESHOLD) and (abs(lateral_acc) <= LAT_ACC_THRESHOLD): + self.filtered_points.add_point(float(steer), float(lateral_acc)) + + def get_msg(self, valid=True, with_points=False): + msg = messaging.new_message('liveTorqueParameters') + msg.valid = valid + liveTorqueParameters = msg.liveTorqueParameters + liveTorqueParameters.version = VERSION + liveTorqueParameters.useParams = self.use_params + + if self.filtered_points.is_valid(): + latAccelFactor, latAccelOffset, friction_coeff = self.estimate_params() + liveTorqueParameters.latAccelFactorRaw = float(latAccelFactor) + liveTorqueParameters.latAccelOffsetRaw = float(latAccelOffset) + liveTorqueParameters.frictionCoefficientRaw = float(friction_coeff) + + if self.is_sane(latAccelFactor, latAccelOffset, friction_coeff): + liveTorqueParameters.liveValid = True + self.update_params({'latAccelFactor': latAccelFactor, 'latAccelOffset': latAccelOffset, 'frictionCoefficient': friction_coeff}) + self.invalid_values_tracker = max(0.0, self.invalid_values_tracker - 0.5) + else: + cloudlog.exception("Live torque parameters are outside acceptable bounds.") + liveTorqueParameters.liveValid = False + self.invalid_values_tracker += 1.0 + # Reset when ~10 invalid over 5 secs + if self.invalid_values_tracker > MAX_INVALID_THRESHOLD: + # Do not reset the filter as it may cause a drastic jump, just reset points + self.reset() + else: + liveTorqueParameters.liveValid = False + + if with_points: + liveTorqueParameters.points = self.filtered_points.get_points()[:, [0, 2]].tolist() + + liveTorqueParameters.latAccelFactorFiltered = float(self.filtered_params['latAccelFactor'].x) + liveTorqueParameters.latAccelOffsetFiltered = float(self.filtered_params['latAccelOffset'].x) + liveTorqueParameters.frictionCoefficientFiltered = float(self.filtered_params['frictionCoefficient'].x) + liveTorqueParameters.totalBucketPoints = len(self.filtered_points) + liveTorqueParameters.decay = self.decay + liveTorqueParameters.maxResets = self.resets + return msg + + +def main(sm=None, pm=None): + config_realtime_process([0, 1, 2, 3], 5) + + if sm is None: + sm = messaging.SubMaster(['carControl', 'carState', 'liveLocationKalman'], poll=['liveLocationKalman']) + + if pm is None: + pm = messaging.PubMaster(['liveTorqueParameters']) + + params = Params() + CP = car.CarParams.from_bytes(params.get("CarParams", block=True)) + estimator = TorqueEstimator(CP) + + def cache_params(sig, frame): + signal.signal(sig, signal.SIG_DFL) + cloudlog.warning("caching torque params") + + params = Params() + params.put("LiveTorqueCarParams", CP.as_builder().to_bytes()) + + msg = estimator.get_msg(with_points=True) + params.put("LiveTorqueParameters", msg.to_bytes()) + + sys.exit(0) + if "REPLAY" not in os.environ: + signal.signal(signal.SIGINT, cache_params) + + while True: + sm.update() + if sm.all_checks(): + for which in sm.updated.keys(): + if sm.updated[which]: + t = sm.logMonoTime[which] * 1e-9 + estimator.handle_log(t, which, sm[which]) + + # 4Hz driven by liveLocationKalman + if sm.frame % 5 == 0: + pm.send('liveTorqueParameters', estimator.get_msg(valid=sm.all_checks())) + + +if __name__ == "__main__": + main() diff --git a/selfdrive/locationd/ubloxd b/selfdrive/locationd/ubloxd index 8f69fae05..33e8a98f3 100755 Binary files a/selfdrive/locationd/ubloxd and b/selfdrive/locationd/ubloxd differ diff --git a/selfdrive/loggerd/encoder/v4l_encoder.h b/selfdrive/loggerd/encoder/v4l_encoder.h index b7c378be8..c2a53dd6e 100644 --- a/selfdrive/loggerd/encoder/v4l_encoder.h +++ b/selfdrive/loggerd/encoder/v4l_encoder.h @@ -28,7 +28,6 @@ private: static void dequeue_handler(V4LEncoder *e); std::thread dequeue_handler_thread; - VisionBuf buf_in[BUF_IN_COUNT]; VisionBuf buf_out[BUF_OUT_COUNT]; SafeQueue free_buf_in; }; diff --git a/selfdrive/manager/build.py b/selfdrive/manager/build.py index f9393c8af..6b57f8579 100755 --- a/selfdrive/manager/build.py +++ b/selfdrive/manager/build.py @@ -43,7 +43,8 @@ def build(spinner: Spinner, dirty: bool = False) -> None: prefix = b'progress: ' if line.startswith(prefix): i = int(line[len(prefix):]) - spinner.update_progress(MAX_BUILD_PROGRESS * min(1., i / TOTAL_SCONS_NODES), 100.) + #spinner.update_progress(MAX_BUILD_PROGRESS * min(1., i / TOTAL_SCONS_NODES), 100.) + spinner.update(f"compiling {round(MAX_BUILD_PROGRESS * ( i / TOTAL_SCONS_NODES))}%") elif len(line): compile_output.append(line) print(line.decode('utf8', 'replace')) diff --git a/selfdrive/manager/custom_dep.py b/selfdrive/manager/custom_dep.py index 5a73fe068..2c8f8be34 100755 --- a/selfdrive/manager/custom_dep.py +++ b/selfdrive/manager/custom_dep.py @@ -18,6 +18,7 @@ OVERPY_SPEC = importlib.util.find_spec('overpy') MAX_BUILD_PROGRESS = 100 TMP_DIR = '/data/tmp' PYEXTRA_DIR = '/data/openpilot/pyextra' +DP_PYEXTRA_DIR = '/data/dp_pyextra' def wait_for_internet_connection(return_on_failure=False): @@ -37,7 +38,7 @@ def wait_for_internet_connection(return_on_failure=False): def install_dep(spinner): wait_for_internet_connection() - TOTAL_PIP_STEPS = 2986 + TOTAL_PIP_STEPS = 21 try: os.makedirs(TMP_DIR) @@ -65,7 +66,10 @@ def install_dep(spinner): break if output: steps += 1 - spinner.update_progress(MAX_BUILD_PROGRESS * min(1., steps / TOTAL_PIP_STEPS), 100.) + if steps == 21: + spinner.update(f"Downloaded {round(MAX_BUILD_PROGRESS * (steps / TOTAL_PIP_STEPS))}%") + else: + spinner.update(f"Downloading... {round(MAX_BUILD_PROGRESS * (steps / TOTAL_PIP_STEPS))}%") print(output.decode('utf8', 'replace')) shutil.rmtree(TMP_DIR) @@ -77,8 +81,18 @@ def install_dep(spinner): shutil.rmtree(directory) shutil.rmtree(f'{PYEXTRA_DIR}/bin') + dup = 'cp -rf /data/openpilot/pyextra /data/dp_pyextra' + process_dup = subprocess.Popen(dup, stdout=subprocess.PIPE, shell=True) + if __name__ == "__main__" and (OPSPLINE_SPEC is None or OVERPY_SPEC is None): spinner = Spinner() - spinner.update_progress(0, 100) - install_dep(spinner) + if os.path.exists(DP_PYEXTRA_DIR): + spinner.update("Loading dependencies") + command = 'rm -rf /data/openpilot/pyextra; cp -rf /data/dp_pyextra /data/openpilot/pyextra' + process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) + print("dp: Removed directory /data/openpilot/pyextra") + print("dp: Copied /data/dp_pyextra to /data/openpilot/pyextra") + else: + spinner.update("Waiting for internet") + install_dep(spinner) diff --git a/selfdrive/manager/manager.py b/selfdrive/manager/manager.py index aaf0987b4..24016d304 100755 --- a/selfdrive/manager/manager.py +++ b/selfdrive/manager/manager.py @@ -40,6 +40,7 @@ def manager_init() -> None: default_params: List[Tuple[str, Union[str, bytes]]] = [ ("CompletedTrainingVersion", "0"), ("DisengageOnAccelerator", "1"), + ("GsmMetered", "1"), ("HasAcceptedTerms", "0"), ("LanguageSetting", "main_en"), ("OpenpilotEnabledToggle", "1"), @@ -47,7 +48,7 @@ def manager_init() -> None: ("SpeedLimitControl", "0"), ("SpeedLimitPercOffset", "0"), ("TurnSpeedControl", "0"), - #("TurnVisionControl", "0"), + ("TurnVisionControl", "0"), ] if not PC: default_params.append(("LastUpdateTime", datetime.datetime.utcnow().isoformat().encode('utf8'))) diff --git a/selfdrive/manager/process_config.py b/selfdrive/manager/process_config.py index 2bba653db..68bf49599 100644 --- a/selfdrive/manager/process_config.py +++ b/selfdrive/manager/process_config.py @@ -40,6 +40,7 @@ procs = [ NativeProcess("locationd", "selfdrive/locationd", ["./locationd"]), NativeProcess("boardd", "selfdrive/boardd", ["./boardd"], enabled=False), PythonProcess("calibrationd", "selfdrive.locationd.calibrationd"), + PythonProcess("torqued", "selfdrive.locationd.torqued"), PythonProcess("controlsd", "selfdrive.controls.controlsd"), # PythonProcess("deleter", "selfdrive.loggerd.deleter", offroad=True), PythonProcess("dmonitoringd", "selfdrive.monitoring.dmonitoringd", enabled=dp_dm, callback=driverview), diff --git a/selfdrive/mapd/lib/NodesData.py b/selfdrive/mapd/lib/NodesData.py index b3ed630bd..39b8a216c 100644 --- a/selfdrive/mapd/lib/NodesData.py +++ b/selfdrive/mapd/lib/NodesData.py @@ -26,6 +26,24 @@ def nodes_raw_data_array_for_wr(wr, drop_last=False): sl = wr.speed_limit data = np.array([(n.id, n.lat, n.lon, sl) for n in wr.way.nodes], dtype=float) + for count, node in enumerate(wr.way.nodes): + if 'highway' in node.tags: + if node.tags['highway'] == 'mini_roundabout': + data[count][3] = 4.1667 + if 'direction' in node.tags and (node.tags['highway'] == 'stop' or node.tags['highway'] == 'give_way'): + if (wr.direction == DIRECTION.BACKWARD and node.tags['direction'] == 'backward') or (wr.direction == DIRECTION.FORWARD and node.tags['direction'] == 'forward'): + if node.tags['highway'] == 'give_way': + data[count][3] = 2.7777 + if node.tags['highway'] == 'stop': + data[count][3] = 0.1 + if 'traffic_calming' in node.tags: + if node.tags['traffic_calming'] == 'yes': + data[count][3] = 40/3.6 + if node.tags['traffic_calming'] == 'chicane' or node.tags['traffic_calming'] == 'choker': + data[count][3] = 20/3.6 + if node.tags['traffic_calming'] == 'bump' or node.tags['traffic_calming'] == 'hump': + data[count][3] = 2.24 + # reverse the order if way direction is backwards if wr.direction == DIRECTION.BACKWARD: data = np.flip(data, axis=0) diff --git a/selfdrive/mapd/lib/WayCollection.py b/selfdrive/mapd/lib/WayCollection.py index 56ad0b60d..2a4fa85b5 100644 --- a/selfdrive/mapd/lib/WayCollection.py +++ b/selfdrive/mapd/lib/WayCollection.py @@ -11,7 +11,7 @@ _ACCEPTABLE_BEARING_DELTA_IND = 0.7071067811865475 # sin(pi/4) | 45 degrees acc class WayCollection(): """A collection of WayRelations to use for maps data analysis. """ - def __init__(self, ways, query_center): + def __init__(self, areas, ways, query_center): """Creates a WayCollection with a set of OSM way objects. Args: @@ -19,7 +19,7 @@ class WayCollection(): query_center (Numpy Array): [lat, lon] numpy array in radians indicating the center of the data query. """ self.id = uuid.uuid4() - self.way_relations = [WayRelation(way) for way in ways] + self.way_relations = [WayRelation(areas, way) for way in ways] self.query_center = query_center self.wr_index = WayRelationIndex(self.way_relations) diff --git a/selfdrive/mapd/lib/WayRelation.py b/selfdrive/mapd/lib/WayRelation.py index 7c796eb40..f7d72f3b7 100644 --- a/selfdrive/mapd/lib/WayRelation.py +++ b/selfdrive/mapd/lib/WayRelation.py @@ -11,6 +11,8 @@ import json _WAY_BBOX_PADING = 80. / R # 80 mts of pading to bounding box. (expressed in radians) +with open(BASEDIR + "/selfdrive/mapd/lib/default_speeds_by_region.json", "rb") as f: + DEFAULT_SPEEDS_BY_REGION = json.loads(f.read()) with open(BASEDIR + "/selfdrive/mapd/lib/default_speeds.json", "rb") as f: _COUNTRY_LIMITS = json.loads(f.read()) @@ -39,7 +41,8 @@ _HIGHWAY_RANK = { 'tertiary_link': 41, 'unclassified': 50, 'residential': 60, - 'living_street': 61 + 'living_street': 61, + 'service': 62 } @@ -140,12 +143,54 @@ def conditional_speed_limit_for_osm_tag_limit_string(limit_string): # If we get here, no current date-time conditon is active. return 0. +def speed_limit_value_for_highway_type(areas, tags): + max_speed = None + try: + for area in areas: + if area.tags.get('admin_level', '') == "2": + if area.tags.get('ISO3166-1:alpha2', '') != '': + geocode_country = area.tags.get('ISO3166-1:alpha2', '') + elif area.tags.get('admin_level', '') == "4": + geocode_region = area.tags.get('name', '') + country_rules = DEFAULT_SPEEDS_BY_REGION.get(geocode_country, {}) + country_defaults = country_rules.get('Default', []) + for rule in country_defaults: + rule_valid = all( + tag_name in tags + and tags[tag_name] == value + for tag_name, value in rule['tags'].items() + ) + if rule_valid: + max_speed = rule['speed'] + break #stop searching country + + region_rules = country_rules.get(geocode_region, []) + for rule in region_rules: + rule_valid = all( + tag_name in tags + and tags[tag_name] == value + for tag_name, value in rule['tags'].items() + ) + if rule_valid: + max_speed = rule['speed'] + break #stop searching region + except KeyError as e: + print(e) + if max_speed is None: + return 0 + v = re.match(r'^\s*([0-9]{1,3})\s*?(mph)?\s*$', str(max_speed)) + if v is None: + return None + conv = CV.MPH_TO_MS if v[2] is not None and v[2] == "mph" else CV.KPH_TO_MS + return conv * float(v[1]) + class WayRelation(): """A class that represent the relationship of an OSM way and a given `location` and `bearing` of a driving vehicle. """ - def __init__(self, way, parent=None): + def __init__(self, areas, way, parent=None): self.way = way + self.areas = areas self.parent = parent self.parent_wr_id = parent.id if parent is not None else None # For WRs created as splits of other WRs self.reset_location_variables() @@ -341,6 +386,9 @@ class WayRelation(): limit = speed_limit_for_osm_tag_limit_string(limit_string) + if limit == 0.: + limit = speed_limit_value_for_highway_type(self.areas, self.way.tags) + self._speed_limit = limit return self._speed_limit @@ -419,4 +467,4 @@ class WayRelation(): ways = [create_way(way_ids[0], node_ids=self._nodes_ids[:idx + 1], from_way=self.way), create_way(way_ids[1], node_ids=self._nodes_ids[idx:], from_way=self.way)] - return [WayRelation(way, parent=self) for way in ways] + return [WayRelation(self.areas, way, parent=self) for way in ways] diff --git a/selfdrive/mapd/lib/default_speeds.json b/selfdrive/mapd/lib/default_speeds.json index a8db60880..0a7d28474 100644 --- a/selfdrive/mapd/lib/default_speeds.json +++ b/selfdrive/mapd/lib/default_speeds.json @@ -28,7 +28,8 @@ "DK:urban": "50", "DK:rural": "80", "DK:motorway": "130", - "DE:living_street": "7", + "DE:living_street": "10", + "DE:service": "10", "DE:residential": "30", "DE:urban": "50", "DE:rural": "100", diff --git a/selfdrive/mapd/lib/default_speeds_by_region.json b/selfdrive/mapd/lib/default_speeds_by_region.json new file mode 100644 index 000000000..fd3365b89 --- /dev/null +++ b/selfdrive/mapd/lib/default_speeds_by_region.json @@ -0,0 +1,624 @@ +{ + "AU": { + "Default": [ + { + "speed": "100", + "tags": { + "highway": "motorway" + } + }, + { + "speed": "80", + "tags": { + "highway": "trunk" + } + }, + { + "speed": "80", + "tags": { + "highway": "primary" + } + }, + { + "speed": "50", + "tags": { + "highway": "secondary" + } + }, + { + "speed": "50", + "tags": { + "highway": "tertiary" + } + }, + { + "speed": "80", + "tags": { + "highway": "unclassified" + } + }, + { + "speed": "50", + "tags": { + "highway": "residential" + } + }, + { + "speed": "40", + "tags": { + "highway": "service" + } + }, + { + "speed": "90", + "tags": { + "highway": "motorway_link" + } + }, + { + "speed": "80", + "tags": { + "highway": "trunk_link" + } + }, + { + "speed": "80", + "tags": { + "highway": "primary_link" + } + }, + { + "speed": "50", + "tags": { + "highway": "secondary_link" + } + }, + { + "speed": "50", + "tags": { + "highway": "tertiary_link" + } + }, + { + "speed": "30", + "tags": { + "highway": "living_street" + } + } + ] + }, + "EE": { + "Default": [ + { + "speed": "90", + "tags": { + "highway": "motorway" + } + }, + { + "speed": "90", + "tags": { + "highway": "trunk" + } + }, + { + "speed": "90", + "tags": { + "highway": "primary" + } + }, + { + "speed": "50", + "tags": { + "highway": "secondary" + } + }, + { + "speed": "50", + "tags": { + "highway": "tertiary" + } + }, + { + "speed": "90", + "tags": { + "highway": "unclassified" + } + }, + { + "speed": "40", + "tags": { + "highway": "residential" + } + }, + { + "speed": "40", + "tags": { + "highway": "service" + } + }, + { + "speed": "90", + "tags": { + "highway": "motorway_link" + } + }, + { + "speed": "70", + "tags": { + "highway": "trunk_link" + } + }, + { + "speed": "70", + "tags": { + "highway": "primary_link" + } + }, + { + "speed": "50", + "tags": { + "highway": "secondary_link" + } + }, + { + "speed": "50", + "tags": { + "highway": "tertiary_link" + } + }, + { + "speed": "20", + "tags": { + "highway": "living_street" + } + } + ] + }, + "CA": { + "Default": [ + { + "speed": "100", + "tags": { + "highway": "motorway" + } + }, + { + "speed": "80", + "tags": { + "highway": "trunk" + } + }, + { + "speed": "80", + "tags": { + "highway": "primary" + } + }, + { + "speed": "50", + "tags": { + "highway": "secondary" + } + }, + { + "speed": "50", + "tags": { + "highway": "tertiary" + } + }, + { + "speed": "80", + "tags": { + "highway": "unclassified" + } + }, + { + "speed": "40", + "tags": { + "highway": "residential" + } + }, + { + "speed": "40", + "tags": { + "highway": "service" + } + }, + { + "speed": "90", + "tags": { + "highway": "motorway_link" + } + }, + { + "speed": "80", + "tags": { + "highway": "trunk_link" + } + }, + { + "speed": "80", + "tags": { + "highway": "primary_link" + } + }, + { + "speed": "50", + "tags": { + "highway": "secondary_link" + } + }, + { + "speed": "50", + "tags": { + "highway": "tertiary_link" + } + }, + { + "speed": "20", + "tags": { + "highway": "living_street" + } + } + ] + }, + "DE": { + "Default": [ + { + "speed": "none", + "tags": { + "highway": "motorway" + } + }, + { + "speed": "10", + "tags": { + "highway": "living_street" + } + }, + { + "speed": "30", + "tags": { + "highway": "residential" + } + }, + { + "speed": "10", + "tags": { + "highway": "service" + } + }, + { + "speed": "100", + "tags": { + "zone:traffic": "DE:rural" + } + }, + { + "speed": "50", + "tags": { + "zone:traffic": "DE:urban" + } + }, + { + "speed": "30", + "tags": { + "zone:maxspeed": "DE:30" + } + }, + { + "speed": "50", + "tags": { + "zone:maxspeed": "DE:urban" + } + }, + { + "speed": "100", + "tags": { + "zone:maxspeed": "DE:rural" + } + }, + { + "speed": "none", + "tags": { + "zone:maxspeed": "DE:motorway" + } + }, + { + "speed": "30", + "tags": { + "bicycle_road": "yes" + } + } + ] + }, + "ZA": { + "Default": [ + { + "speed": "120", + "tags": { + "highway": "motorway" + } + }, + { + "speed": "120", + "tags": { + "highway": "motorway_link" + } + }, + { + "speed": "100", + "tags": { + "highway": "primary" + } + }, + { + "speed": "100", + "tags": { + "highway": "secondary" + } + }, + { + "speed": "60", + "tags": { + "highway": "residential" + } + } + ] + }, + "US": { + "South Dakota": [ + { + "speed": "80 mph", + "tags": { + "highway": "motorway" + } + }, + { + "speed": "70 mph", + "tags": { + "highway": "trunk" + } + }, + { + "speed": "65 mph", + "tags": { + "highway": "primary" + } + }, + { + "speed": "70 mph", + "tags": { + "highway": "trunk_link" + } + }, + { + "speed": "65 mph", + "tags": { + "highway": "primary_link" + } + } + ], + "Wisconsin": [ + { + "speed": "65 mph", + "tags": { + "highway": "trunk" + } + }, + { + "speed": "45 mph", + "tags": { + "highway": "tertiary" + } + }, + { + "speed": "35 mph", + "tags": { + "highway": "unclassified" + } + }, + { + "speed": "65 mph", + "tags": { + "highway": "trunk_link" + } + }, + { + "speed": "45 mph", + "tags": { + "highway": "tertiary_link" + } + } + ], + "Default": [ + { + "speed": "65 mph", + "tags": { + "highway": "motorway" + } + }, + { + "speed": "55 mph", + "tags": { + "highway": "trunk" + } + }, + { + "speed": "55 mph", + "tags": { + "highway": "primary" + } + }, + { + "speed": "45 mph", + "tags": { + "highway": "secondary" + } + }, + { + "speed": "35 mph", + "tags": { + "highway": "tertiary" + } + }, + { + "speed": "55 mph", + "tags": { + "highway": "unclassified" + } + }, + { + "speed": "25 mph", + "tags": { + "highway": "residential" + } + }, + { + "speed": "25 mph", + "tags": { + "highway": "service" + } + }, + { + "speed": "55 mph", + "tags": { + "highway": "motorway_link" + } + }, + { + "speed": "55 mph", + "tags": { + "highway": "trunk_link" + } + }, + { + "speed": "55 mph", + "tags": { + "highway": "primary_link" + } + }, + { + "speed": "45 mph", + "tags": { + "highway": "secondary_link" + } + }, + { + "speed": "35 mph", + "tags": { + "highway": "tertiary_link" + } + }, + { + "speed": "15 mph", + "tags": { + "highway": "living_street" + } + } + ], + "Michigan": [ + { + "speed": "70 mph", + "tags": { + "highway": "motorway" + } + } + ], + "Oregon": [ + { + "speed": "55 mph", + "tags": { + "highway": "motorway" + } + }, + { + "speed": "35 mph", + "tags": { + "highway": "secondary" + } + }, + { + "speed": "30 mph", + "tags": { + "highway": "tertiary" + } + }, + { + "speed": "15 mph", + "tags": { + "highway": "service" + } + }, + { + "speed": "35 mph", + "tags": { + "highway": "secondary_link" + } + }, + { + "speed": "30 mph", + "tags": { + "highway": "tertiary_link" + } + } + ], + "New York": [ + { + "speed": "65 mph", + "tags": { + "highway": "motorway" + } + }, + { + "speed": "45 mph", + "tags": { + "highway": "primary" + } + }, + { + "speed": "55 mph", + "tags": { + "highway": "secondary" + } + }, + { + "speed": "55 mph", + "tags": { + "highway": "tertiary" + } + }, + { + "speed": "30 mph", + "tags": { + "highway": "residential" + } + }, + { + "speed": "45 mph", + "tags": { + "highway": "primary_link" + } + }, + { + "speed": "55 mph", + "tags": { + "highway": "secondary_link" + } + }, + { + "speed": "55 mph", + "tags": { + "highway": "tertiary_link" + } + }, + { + "speed": "20 mph", + "tags": { + "highway": "living_street" + } + } + ] + } +} diff --git a/selfdrive/mapd/lib/osm.py b/selfdrive/mapd/lib/osm.py index 359580195..6963f5540 100644 --- a/selfdrive/mapd/lib/osm.py +++ b/selfdrive/mapd/lib/osm.py @@ -19,6 +19,7 @@ def create_way(way_id, node_ids, from_way): class OSM(): def __init__(self): self.api = overpy.Overpass() + self.areas = None # self.api = overpy.Overpass(url='http://3.65.170.21/api/interpreter') def fetch_road_ways_around_location(self, lat, lon, radius): @@ -26,23 +27,44 @@ class OSM(): bbox_angle = np.degrees(radius / R) # fetch all ways and nodes on this ways in bbox bbox_str = f'{str(lat - bbox_angle)},{str(lon - bbox_angle)},{str(lat + bbox_angle)},{str(lon + bbox_angle)}' + lat_lon = "(%f,%f)" % (lat, lon) q = """ way(""" + bbox_str + """) [highway] [highway!~"^(footway|path|corridor|bridleway|steps|cycleway|construction|bus_guideway|escape|service|track)$"]; (._;>;); - out; + out;""" + """is_in""" + lat_lon + """;area._[admin_level~"[24]"]; + convert area ::id = id(), admin_level = t['admin_level'], + name = t['name'], "ISO3166-1:alpha2" = t['ISO3166-1:alpha2'];out; """ try: if _LOCAL_OSM: print("Query OSM from Local Server") + q = """ + way(""" + bbox_str + """) + [highway] + [highway!~"^(footway|path|corridor|bridleway|steps|cycleway|construction|bus_guideway|escape|service|track)$"]; + (._;>;); + out;""" completion = subprocess.run(["/data/media/0/osm/v0.7.57/bin/osm3s_query", "--db-dir=/data/media/0/osm/db", f'--request={q}'], check=True, capture_output=True) + ways = self.api.parse_xml(completion.stdout).ways + if self.areas is None: + q = """is_in""" + lat_lon + """;area._[admin_level~"[24]"]; + convert area ::id = id(), admin_level = t['admin_level'], + name = t['name'], "ISO3166-1:alpha2" = t['ISO3166-1:alpha2'];out; + """ + try: + self.areas = self.api.query(q).areas + except Exception: + pass + areas = self.areas else: print("Query OSM from remote Server") - ways = self.api.query(q).ways + query = self.api.query(q) + areas, ways = query.areas, query.ways except Exception as e: print(f'Exception while querying OSM:\n{e}') - ways = [] + areas, ways = [],[] - return ways + return areas, ways diff --git a/selfdrive/mapd/mapd.py b/selfdrive/mapd/mapd.py index 8718744ca..da0750bfc 100644 --- a/selfdrive/mapd/mapd.py +++ b/selfdrive/mapd/mapd.py @@ -108,13 +108,13 @@ class MapD(): def query(osm, location_deg, location_rad, radius): _debug(f'Mapd: Start query for OSM map data at {location_deg}') lat, lon = location_deg - ways = osm.fetch_road_ways_around_location(lat, lon, radius) + areas, ways = osm.fetch_road_ways_around_location(lat, lon, radius) _debug(f'Mapd: Query to OSM finished with {len(ways)} ways') # Only issue an update if we received some ways. Otherwise it is most likely a conectivity issue. # Will retry on next loop. if len(ways) > 0: - new_way_collection = WayCollection(ways, location_rad) + new_way_collection = WayCollection(areas, ways, location_rad) # Use the lock to update the way_collection as it might be being used to update the route. _debug('Mapd: Locking to write results from osm.', log_to_cloud=False) diff --git a/selfdrive/modeld/_dmonitoringmodeld b/selfdrive/modeld/_dmonitoringmodeld index ee32b4e73..4ad5ea999 100755 Binary files a/selfdrive/modeld/_dmonitoringmodeld and b/selfdrive/modeld/_dmonitoringmodeld differ diff --git a/selfdrive/modeld/_modeld b/selfdrive/modeld/_modeld index 8048efa57..377bd12d5 100755 Binary files a/selfdrive/modeld/_modeld and b/selfdrive/modeld/_modeld differ diff --git a/selfdrive/modeld/models/supercombo.thneed b/selfdrive/modeld/models/supercombo.thneed index a392473fe..fb734f691 100644 Binary files a/selfdrive/modeld/models/supercombo.thneed and b/selfdrive/modeld/models/supercombo.thneed differ diff --git a/selfdrive/navd/navd.py b/selfdrive/navd/navd.py index adab23c23..a05957286 100755 --- a/selfdrive/navd/navd.py +++ b/selfdrive/navd/navd.py @@ -123,6 +123,10 @@ class RouteEngine: cloudlog.warning(f"Calculating route {self.last_position} -> {destination}") self.nav_destination = destination + lang = self.params.get('LanguageSetting', encoding='utf8') + if lang is not None: + lang = lang.replace('main_', '') + params = { 'access_token': self.mapbox_token, 'annotations': 'maxspeed', @@ -131,6 +135,7 @@ class RouteEngine: 'steps': 'true', 'banner_instructions': 'true', 'alternatives': 'false', + 'language': lang, } if self.last_bearing is not None: diff --git a/selfdrive/sensord/_sensord b/selfdrive/sensord/_sensord index e354dd950..b4da593a8 100755 Binary files a/selfdrive/sensord/_sensord and b/selfdrive/sensord/_sensord differ diff --git a/selfdrive/sensord/pigeond.py b/selfdrive/sensord/pigeond.py index e38e2d4c3..e1fa2f4ca 100755 --- a/selfdrive/sensord/pigeond.py +++ b/selfdrive/sensord/pigeond.py @@ -12,9 +12,9 @@ from typing import List, Optional from cereal import messaging from common.params import Params from system.swaglog import cloudlog -from selfdrive.hardware import TICI +from system.hardware import TICI from common.gpio import gpio_init, gpio_set -from selfdrive.hardware.tici.pins import GPIO +from system.hardware.tici.pins import GPIO UBLOX_TTY = "/dev/ttyHS0" diff --git a/selfdrive/sensord/sensors/bmx055_accel.h b/selfdrive/sensord/sensors/bmx055_accel.h index 86ec419cd..8ef660a99 100644 --- a/selfdrive/sensord/sensors/bmx055_accel.h +++ b/selfdrive/sensord/sensors/bmx055_accel.h @@ -10,6 +10,7 @@ #define BMX055_ACCEL_I2C_REG_X_LSB 0x02 #define BMX055_ACCEL_I2C_REG_TEMP 0x08 #define BMX055_ACCEL_I2C_REG_BW 0x10 +#define BMX055_ACCEL_I2C_REG_PMU 0x11 #define BMX055_ACCEL_I2C_REG_HBW 0x13 #define BMX055_ACCEL_I2C_REG_FIFO 0x3F @@ -18,6 +19,8 @@ #define BMX055_ACCEL_HBW_ENABLE 0b10000000 #define BMX055_ACCEL_HBW_DISABLE 0b00000000 +#define BMX055_ACCEL_DEEP_SUSPEND 0b00100000 +#define BMX055_ACCEL_NORMAL_MODE 0b00000000 #define BMX055_ACCEL_BW_7_81HZ 0b01000 #define BMX055_ACCEL_BW_15_63HZ 0b01001 @@ -33,5 +36,6 @@ class BMX055_Accel : public I2CSensor { public: BMX055_Accel(I2CBus *bus); int init(); - void get_event(cereal::SensorEventData::Builder &event); + bool get_event(MessageBuilder &msg, uint64_t ts = 0); + int shutdown(); }; diff --git a/selfdrive/sensord/sensors/bmx055_gyro.h b/selfdrive/sensord/sensors/bmx055_gyro.h index ed0c16ff0..80b93f128 100644 --- a/selfdrive/sensord/sensors/bmx055_gyro.h +++ b/selfdrive/sensord/sensors/bmx055_gyro.h @@ -10,6 +10,7 @@ #define BMX055_GYRO_I2C_REG_RATE_X_LSB 0x02 #define BMX055_GYRO_I2C_REG_RANGE 0x0F #define BMX055_GYRO_I2C_REG_BW 0x10 +#define BMX055_GYRO_I2C_REG_LPM1 0x11 #define BMX055_GYRO_I2C_REG_HBW 0x13 #define BMX055_GYRO_I2C_REG_FIFO 0x3F @@ -18,6 +19,8 @@ #define BMX055_GYRO_HBW_ENABLE 0b10000000 #define BMX055_GYRO_HBW_DISABLE 0b00000000 +#define BMX055_GYRO_DEEP_SUSPEND 0b00100000 +#define BMX055_GYRO_NORMAL_MODE 0b00000000 #define BMX055_GYRO_RANGE_2000 0b000 #define BMX055_GYRO_RANGE_1000 0b001 @@ -33,5 +36,6 @@ class BMX055_Gyro : public I2CSensor { public: BMX055_Gyro(I2CBus *bus); int init(); - void get_event(cereal::SensorEventData::Builder &event); + bool get_event(MessageBuilder &msg, uint64_t ts = 0); + int shutdown(); }; diff --git a/selfdrive/sensord/sensors/bmx055_magn.h b/selfdrive/sensord/sensors/bmx055_magn.h index d60fd5515..e4a79bc7e 100644 --- a/selfdrive/sensord/sensors/bmx055_magn.h +++ b/selfdrive/sensord/sensors/bmx055_magn.h @@ -59,5 +59,6 @@ class BMX055_Magn : public I2CSensor{ public: BMX055_Magn(I2CBus *bus); int init(); - void get_event(cereal::SensorEventData::Builder &event); + bool get_event(MessageBuilder &msg, uint64_t ts = 0); + int shutdown(); }; diff --git a/selfdrive/sensord/sensors/bmx055_temp.h b/selfdrive/sensord/sensors/bmx055_temp.h index 5ffaa8fb6..0b6802dea 100644 --- a/selfdrive/sensord/sensors/bmx055_temp.h +++ b/selfdrive/sensord/sensors/bmx055_temp.h @@ -8,5 +8,6 @@ class BMX055_Temp : public I2CSensor { public: BMX055_Temp(I2CBus *bus); int init(); - void get_event(cereal::SensorEventData::Builder &event); + bool get_event(MessageBuilder &msg, uint64_t ts = 0); + int shutdown() { return 0; } }; diff --git a/selfdrive/sensord/sensors/file_sensor.h b/selfdrive/sensord/sensors/file_sensor.h index c5b4643e1..39d695167 100644 --- a/selfdrive/sensord/sensors/file_sensor.h +++ b/selfdrive/sensord/sensors/file_sensor.h @@ -14,5 +14,6 @@ public: FileSensor(std::string filename); ~FileSensor(); int init(); - virtual void get_event(cereal::SensorEventData::Builder &event) = 0; + bool has_interrupt_enabled(); + virtual bool get_event(MessageBuilder &msg, uint64_t ts = 0) = 0; }; diff --git a/selfdrive/sensord/sensors/i2c_sensor.h b/selfdrive/sensord/sensors/i2c_sensor.h index 7832475a9..0de2a9873 100644 --- a/selfdrive/sensord/sensors/i2c_sensor.h +++ b/selfdrive/sensord/sensors/i2c_sensor.h @@ -1,9 +1,13 @@ #pragma once #include +#include #include "cereal/gen/cpp/log.capnp.h" + #include "common/i2c.h" +#include "common/gpio.h" + #include "selfdrive/sensord/sensors/constants.h" #include "selfdrive/sensord/sensors/sensor.h" @@ -15,12 +19,18 @@ int32_t read_20_bit(uint8_t b2, uint8_t b1, uint8_t b0); class I2CSensor : public Sensor { private: I2CBus *bus; + int gpio_nr; + bool shared_gpio; virtual uint8_t get_device_address() = 0; public: - I2CSensor(I2CBus *bus); + I2CSensor(I2CBus *bus, int gpio_nr = 0, bool shared_gpio = false); + ~I2CSensor(); int read_register(uint register_address, uint8_t *buffer, uint8_t len); int set_register(uint register_address, uint8_t data); + int init_gpio(); + bool has_interrupt_enabled(); virtual int init() = 0; - virtual void get_event(cereal::SensorEventData::Builder &event) = 0; + virtual bool get_event(MessageBuilder &msg, uint64_t ts = 0) = 0; + virtual int shutdown() = 0; }; diff --git a/selfdrive/sensord/sensors/light_sensor.h b/selfdrive/sensord/sensors/light_sensor.h index faf901d41..7ed1c1f70 100644 --- a/selfdrive/sensord/sensors/light_sensor.h +++ b/selfdrive/sensord/sensors/light_sensor.h @@ -3,6 +3,7 @@ class LightSensor : public FileSensor { public: - LightSensor(std::string filename) : FileSensor(filename){}; - void get_event(cereal::SensorEventData::Builder &event); + LightSensor(std::string filename); + bool get_event(MessageBuilder &msg, uint64_t ts = 0); + int shutdown() { return 0; } }; diff --git a/selfdrive/sensord/sensors/lsm6ds3_accel.h b/selfdrive/sensord/sensors/lsm6ds3_accel.h index 4a6b68744..84084fc91 100644 --- a/selfdrive/sensord/sensors/lsm6ds3_accel.h +++ b/selfdrive/sensord/sensors/lsm6ds3_accel.h @@ -6,21 +6,28 @@ #define LSM6DS3_ACCEL_I2C_ADDR 0x6A // Registers of the chip +#define LSM6DS3_ACCEL_I2C_REG_DRDY_CFG 0x0B #define LSM6DS3_ACCEL_I2C_REG_ID 0x0F +#define LSM6DS3_ACCEL_I2C_REG_INT1_CTRL 0x0D #define LSM6DS3_ACCEL_I2C_REG_CTRL1_XL 0x10 +#define LSM6DS3_ACCEL_I2C_REG_STAT_REG 0x1E #define LSM6DS3_ACCEL_I2C_REG_OUTX_L_XL 0x28 // Constants -#define LSM6DS3_ACCEL_CHIP_ID 0x69 -#define LSM6DS3TRC_ACCEL_CHIP_ID 0x6A -#define LSM6DS3_ACCEL_ODR_104HZ (0b0100 << 4) +#define LSM6DS3_ACCEL_CHIP_ID 0x69 +#define LSM6DS3TRC_ACCEL_CHIP_ID 0x6A +#define LSM6DS3_ACCEL_ODR_104HZ (0b0100 << 4) +#define LSM6DS3_ACCEL_INT1_DRDY_XL 0b1 +#define LSM6DS3_ACCEL_DRDY_XLDA 0b1 +#define LSM6DS3_ACCEL_DRDY_PULSE_MODE (1 << 7) class LSM6DS3_Accel : public I2CSensor { uint8_t get_device_address() {return LSM6DS3_ACCEL_I2C_ADDR;} cereal::SensorEventData::SensorSource source = cereal::SensorEventData::SensorSource::LSM6DS3; public: - LSM6DS3_Accel(I2CBus *bus); + LSM6DS3_Accel(I2CBus *bus, int gpio_nr = 0, bool shared_gpio = false); int init(); - void get_event(cereal::SensorEventData::Builder &event); + bool get_event(MessageBuilder &msg, uint64_t ts = 0); + int shutdown(); }; diff --git a/selfdrive/sensord/sensors/lsm6ds3_gyro.h b/selfdrive/sensord/sensors/lsm6ds3_gyro.h index d7e8f0025..6c61ffcef 100644 --- a/selfdrive/sensord/sensors/lsm6ds3_gyro.h +++ b/selfdrive/sensord/sensors/lsm6ds3_gyro.h @@ -6,21 +6,28 @@ #define LSM6DS3_GYRO_I2C_ADDR 0x6A // Registers of the chip +#define LSM6DS3_GYRO_I2C_REG_DRDY_CFG 0x0B #define LSM6DS3_GYRO_I2C_REG_ID 0x0F +#define LSM6DS3_GYRO_I2C_REG_INT1_CTRL 0x0D #define LSM6DS3_GYRO_I2C_REG_CTRL2_G 0x11 +#define LSM6DS3_GYRO_I2C_REG_STAT_REG 0x1E #define LSM6DS3_GYRO_I2C_REG_OUTX_L_G 0x22 // Constants -#define LSM6DS3_GYRO_CHIP_ID 0x69 -#define LSM6DS3TRC_GYRO_CHIP_ID 0x6A -#define LSM6DS3_GYRO_ODR_104HZ (0b0100 << 4) +#define LSM6DS3_GYRO_CHIP_ID 0x69 +#define LSM6DS3TRC_GYRO_CHIP_ID 0x6A +#define LSM6DS3_GYRO_ODR_104HZ (0b0100 << 4) +#define LSM6DS3_GYRO_INT1_DRDY_G 0b10 +#define LSM6DS3_GYRO_DRDY_GDA 0b10 +#define LSM6DS3_GYRO_DRDY_PULSE_MODE (1 << 7) class LSM6DS3_Gyro : public I2CSensor { uint8_t get_device_address() {return LSM6DS3_GYRO_I2C_ADDR;} cereal::SensorEventData::SensorSource source = cereal::SensorEventData::SensorSource::LSM6DS3; public: - LSM6DS3_Gyro(I2CBus *bus); + LSM6DS3_Gyro(I2CBus *bus, int gpio_nr = 0, bool shared_gpio = false); int init(); - void get_event(cereal::SensorEventData::Builder &event); + bool get_event(MessageBuilder &msg, uint64_t ts = 0); + int shutdown(); }; diff --git a/selfdrive/sensord/sensors/lsm6ds3_temp.h b/selfdrive/sensord/sensors/lsm6ds3_temp.h index 8188f4670..1d6bcc228 100644 --- a/selfdrive/sensord/sensors/lsm6ds3_temp.h +++ b/selfdrive/sensord/sensors/lsm6ds3_temp.h @@ -21,5 +21,6 @@ class LSM6DS3_Temp : public I2CSensor { public: LSM6DS3_Temp(I2CBus *bus); int init(); - void get_event(cereal::SensorEventData::Builder &event); + bool get_event(MessageBuilder &msg, uint64_t ts = 0); + int shutdown() { return 0; } }; diff --git a/selfdrive/sensord/sensors/mmc5603nj_magn.h b/selfdrive/sensord/sensors/mmc5603nj_magn.h index 58840bbf2..a364c7c37 100644 --- a/selfdrive/sensord/sensors/mmc5603nj_magn.h +++ b/selfdrive/sensord/sensors/mmc5603nj_magn.h @@ -25,5 +25,6 @@ class MMC5603NJ_Magn : public I2CSensor { public: MMC5603NJ_Magn(I2CBus *bus); int init(); - void get_event(cereal::SensorEventData::Builder &event); + bool get_event(MessageBuilder &msg, uint64_t ts = 0); + int shutdown(); }; diff --git a/selfdrive/sensord/sensors/sensor.h b/selfdrive/sensord/sensors/sensor.h index 3fb58ad2a..603aa3586 100644 --- a/selfdrive/sensord/sensors/sensor.h +++ b/selfdrive/sensord/sensors/sensor.h @@ -1,10 +1,18 @@ #pragma once -#include "cereal/gen/cpp/log.capnp.h" +#include "cereal/messaging/messaging.h" class Sensor { public: + int gpio_fd = -1; + uint64_t init_delay = 500e6; // default dealy 500ms virtual ~Sensor() {}; virtual int init() = 0; - virtual void get_event(cereal::SensorEventData::Builder &event) = 0; + virtual bool get_event(MessageBuilder &msg, uint64_t ts = 0) = 0; + virtual bool has_interrupt_enabled() = 0; + virtual int shutdown() = 0; + + virtual bool is_data_valid(uint64_t st, uint64_t ct) { + return (ct - st) > init_delay; + } }; diff --git a/selfdrive/sentry.py b/selfdrive/sentry.py index 6128f1eb5..d2f4aa0eb 100644 --- a/selfdrive/sentry.py +++ b/selfdrive/sentry.py @@ -68,7 +68,7 @@ def save_exception(exc_text): if not os.path.exists(CRASHES_DIR): os.makedirs(CRASHES_DIR) - log_file = '{}/{}'.format(CRASHES_DIR, datetime.now().strftime('%m-%d-%Y--%I:%M.%S-%p.log')) + log_file = '{}/{}'.format(CRASHES_DIR, datetime.now().strftime('%Y-%m-%d-%H-%M-%S.log')) with open(log_file, 'w') as f: f.write(exc_text) print('Logged current crash to {}'.format(log_file)) diff --git a/selfdrive/thermald/power_monitoring.py b/selfdrive/thermald/power_monitoring.py index 842251be4..d750d48d2 100644 --- a/selfdrive/thermald/power_monitoring.py +++ b/selfdrive/thermald/power_monitoring.py @@ -180,7 +180,7 @@ class PowerMonitoring: now = sec_since_boot() panda_charging = (peripheralState.usbPowerMode != log.PeripheralState.UsbPowerMode.client) - BATT_PERC_OFF = 3 if self.is_oneplus else 10 + # BATT_PERC_OFF = 3 if self.is_oneplus else 10 should_shutdown = False # Wait until we have shut down charging before powering down diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index b245461e4..5b954b6de 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -177,8 +177,8 @@ def thermald_thread(end_event, hw_queue): modem_temps=[], ) - current_filter = FirstOrderFilter(0., CURRENT_TAU, DT_TRML) - temp_filter = FirstOrderFilter(0., TEMP_TAU, DT_TRML) + all_temp_filter = FirstOrderFilter(0., TEMP_TAU, DT_TRML) + offroad_temp_filter = FirstOrderFilter(0., TEMP_TAU, DT_TRML) should_start_prev = False in_car = False is_uno = False @@ -250,26 +250,34 @@ def thermald_thread(end_event, hw_queue): msg.deviceState.screenBrightnessPercent = HARDWARE.get_screen_brightness() msg.deviceState.usbOnline = HARDWARE.get_usb_present() - current_filter.update(msg.deviceState.batteryCurrent / 1e6) + # current_filter.update(msg.deviceState.batteryCurrent / 1e6) - max_comp_temp = temp_filter.update( - max(max(msg.deviceState.cpuTempC), msg.deviceState.memoryTempC, max(msg.deviceState.gpuTempC)) - ) + # this one is only used for offroad + temp_sources = [ + msg.deviceState.memoryTempC, + max(msg.deviceState.cpuTempC), + max(msg.deviceState.gpuTempC), + ] + offroad_comp_temp = offroad_temp_filter.update(max(temp_sources)) + + # this drives the thermal status while onroad + temp_sources.append(max(msg.deviceState.pmicTempC)) + all_comp_temp = all_temp_filter.update(max(temp_sources)) if fan_controller is not None: - msg.deviceState.fanSpeedPercentDesired = fan_controller.update(max_comp_temp, onroad_conditions["ignition"]) + msg.deviceState.fanSpeedPercentDesired = fan_controller.update(all_comp_temp, onroad_conditions["ignition"]) is_offroad_for_5_min = (started_ts is None) and ((not started_seen) or (off_ts is None) or (sec_since_boot() - off_ts > 60 * 5)) - if is_offroad_for_5_min and max_comp_temp > OFFROAD_DANGER_TEMP: + if is_offroad_for_5_min and offroad_comp_temp > OFFROAD_DANGER_TEMP: # If device is offroad we want to cool down before going onroad # since going onroad increases load and can make temps go over 107 thermal_status = ThermalStatus.danger else: current_band = THERMAL_BANDS[thermal_status] band_idx = list(THERMAL_BANDS.keys()).index(thermal_status) - if current_band.min_temp is not None and max_comp_temp < current_band.min_temp: + if current_band.min_temp is not None and all_comp_temp < current_band.min_temp: thermal_status = list(THERMAL_BANDS.keys())[band_idx - 1] - elif current_band.max_temp is not None and max_comp_temp > current_band.max_temp: + elif current_band.max_temp is not None and all_comp_temp > current_band.max_temp: thermal_status = list(THERMAL_BANDS.keys())[band_idx + 1] # **** starting logic **** @@ -366,16 +374,13 @@ def thermald_thread(end_event, hw_queue): # Check if we need to auto shut down # we only enable it when it's been on-road once. if started_seen and dp_auto_shutdown and off_ts is not None and (sec_since_boot() - off_ts > dp_auto_shutdown_in): - msg.deviceState.chargingDisabled = True - # give a sec for panda to disable charging - time.sleep(1) params.put_bool("DoShutdown", True) if power_monitor.should_shutdown(peripheralState, onroad_conditions["ignition"], in_car, off_ts, started_seen): cloudlog.warning(f"shutting device down, offroad since {off_ts}") params.put_bool("DoShutdown", True) - msg.deviceState.chargingError = current_filter.x > 0. and msg.deviceState.batteryPercent < 90 # if current is positive, then battery is being discharged + # msg.deviceState.chargingError = current_filter.x > 0. and msg.deviceState.batteryPercent < 90 # if current is positive, then battery is being discharged msg.deviceState.started = started_ts is not None msg.deviceState.startedMonoTime = int(1e9*(started_ts or 0)) diff --git a/selfdrive/ui/.gitignore b/selfdrive/ui/.gitignore index e5b27adce..60eb4b43c 100644 --- a/selfdrive/ui/.gitignore +++ b/selfdrive/ui/.gitignore @@ -1,6 +1,8 @@ moc_* *.moc +translations/main_test_en.* + _mui watch3 installer/installers/* diff --git a/selfdrive/ui/_ui b/selfdrive/ui/_ui index 985fce2bb..54d9c964f 100755 Binary files a/selfdrive/ui/_ui and b/selfdrive/ui/_ui differ diff --git a/selfdrive/ui/qt/spinner b/selfdrive/ui/qt/spinner index 576d8e527..a2c1f70d4 100755 Binary files a/selfdrive/ui/qt/spinner and b/selfdrive/ui/qt/spinner differ diff --git a/selfdrive/ui/qt/text b/selfdrive/ui/qt/text index 34a25d382..8e3cee771 100755 Binary files a/selfdrive/ui/qt/text and b/selfdrive/ui/qt/text differ diff --git a/selfdrive/ui/soundd/_soundd b/selfdrive/ui/soundd/_soundd index 230b1bd3a..49921e662 100755 Binary files a/selfdrive/ui/soundd/_soundd and b/selfdrive/ui/soundd/_soundd differ diff --git a/selfdrive/ui/tests/test_translations.py b/selfdrive/ui/tests/test_translations.py new file mode 100755 index 000000000..11ecd30ae --- /dev/null +++ b/selfdrive/ui/tests/test_translations.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 +import json +import os +import re +import shutil +import unittest +import xml.etree.ElementTree as ET + +from selfdrive.ui.update_translations import TRANSLATIONS_DIR, LANGUAGES_FILE, update_translations + +TMP_TRANSLATIONS_DIR = os.path.join(TRANSLATIONS_DIR, "tmp") +LOCATION_TAG = "" not in cur_translations, + f"{file} ({name}) translation file has unfinished translations. Finish translations or mark them as completed in Qt Linguist") + + def test_vanished_translations(self): + for name, file in self.translation_files.items(): + with self.subTest(name=name, file=file): + cur_translations = self._read_translation_file(TRANSLATIONS_DIR, file) + self.assertTrue("" not in cur_translations, + f"{file} ({name}) translation file has obsolete translations. Run selfdrive/ui/update_translations.py --vanish to remove them") + + def test_plural_translations(self): + """ + Tests: + - that any numerus (plural) translations marked "finished" have all plural forms non-empty + - that the correct format specifier is used (%n) + """ + for name, file in self.translation_files.items(): + with self.subTest(name=name, file=file): + tr_xml = ET.parse(os.path.join(TRANSLATIONS_DIR, f"{file}.ts")) + + for context in tr_xml.getroot(): + for message in context.iterfind("message"): + if message.get("numerus") == "yes": + translation = message.find("translation") + numerusform = [t.text for t in translation.findall("numerusform")] + + # Do not assert finished translations + if translation.get("type") == "unfinished": + continue + + self.assertNotIn(None, numerusform, "Ensure all plural translation forms are completed.") + self.assertTrue(all([re.search("%[0-9]+", t) is None for t in numerusform]), + "Plural translations must use %n, not %1, %2, etc.: {}".format(numerusform)) + + def test_no_locations(self): + for name, file in self.translation_files.items(): + with self.subTest(name=name, file=file): + for line in self._read_translation_file(TRANSLATIONS_DIR, file).splitlines(): + self.assertFalse(line.strip().startswith(LOCATION_TAG), + f"Line contains location tag: {line.strip()}, remove all line numbers.") + + +if __name__ == "__main__": + unittest.main() diff --git a/selfdrive/ui/translations/main_en.ts b/selfdrive/ui/translations/main_en.ts index 42e30a59a..3f9692e5f 100644 --- a/selfdrive/ui/translations/main_en.ts +++ b/selfdrive/ui/translations/main_en.ts @@ -4,7 +4,6 @@ InputDialog - Need at least %n character(s)! Need at least %n character! @@ -15,7 +14,6 @@ QObject - %n minute(s) ago %n minute ago @@ -23,7 +21,6 @@ - %n hour(s) ago %n hour ago @@ -31,7 +28,6 @@ - %n day(s) ago %n day ago diff --git a/selfdrive/ui/translations/main_ja.ts b/selfdrive/ui/translations/main_ja.ts index d6bd9e74e..b39c83c09 100644 --- a/selfdrive/ui/translations/main_ja.ts +++ b/selfdrive/ui/translations/main_ja.ts @@ -4,17 +4,14 @@ AbstractAlert - Close 閉じる - Snooze Update 更新の一時停止 - Reboot and Update 再起動してアップデート @@ -22,67 +19,61 @@ AdvancedNetworking - Back 戻る - Enable Tethering テザリングを有効化 - Tethering Password テザリングパスワード - - EDIT 編集 - Enter new tethering password 新しいテザリングパスワードを入力 - IP Address IP アドレス - Enable Roaming ローミングを有効化 - APN Setting APN 設定 - Enter APN APN を入力 - leave blank for automatic configuration 空白のままにして、自動設定にします + + Cellular Metered + + + + Prevent large data uploads when on a metered connection + + ConfirmationDialog - - Ok OK - Cancel キャンセル @@ -90,17 +81,14 @@ DeclinePage - You must accept the Terms and Conditions in order to use openpilot. openpilot をご利用される前に、利用規約に同意する必要があります。 - Back 戻る - Decline, uninstall %1 拒否して %1 をアンインストール @@ -108,152 +96,122 @@ DevicePanel - Dongle ID ドングル番号 (Dongle ID) - N/A N/A - Serial シリアル番号 - Driver Camera 車内カメラ - PREVIEW 見る - Preview the driver facing camera to ensure that driver monitoring has good visibility. (vehicle must be off) 車内カメラをプレビューして、ドライバー監視システムの視界を確認ができます。(車両の電源を切る必要があります) - Reset Calibration キャリブレーションをリセット - RESET リセット - Are you sure you want to reset calibration? キャリブレーションをリセットしてもよろしいですか? - Review Training Guide 入門書を見る - REVIEW 見る - Review the rules, features, and limitations of openpilot openpilot の特徴を見る - Are you sure you want to review the training guide? 入門書を見てもよろしいですか? - Regulatory 認証情報 - VIEW 見る - Change Language 言語を変更 - CHANGE 変更 - Select a language 言語を選択 - Reboot 再起動 - Power Off 電源を切る - openpilot requires the device to be mounted within 4° left or right and within 5° up or 8° down. openpilot is continuously calibrating, resetting is rarely required. openpilot は、左または右の4°以内、上の5°または下の8°以内にデバイスを取付ける必要があります。キャリブレーションを引き続きます、リセットはほとんど必要ありません。 - Your device is pointed %1° %2 and %3° %4. このデバイスは%2の%1°、%4の%3°に向けます。 - down - up - left - right - Are you sure you want to reboot? 再起動してもよろしいですか? - Disengage to Reboot openpilot をキャンセルして再起動ができます - Are you sure you want to power off? シャットダウンしてもよろしいですか? - Disengage to Power Off openpilot をキャンセルしてシャットダウンができます @@ -261,32 +219,26 @@ DriveStats - Drives 運転履歴 - Hours 時間 - ALL TIME 累計 - PAST WEEK 先週 - KM km - Miles マイル @@ -294,7 +246,6 @@ DriverViewScene - camera starting カメラを起動しています @@ -302,12 +253,10 @@ InputDialog - Cancel キャンセル - Need at least %n character(s)! %n文字以上でお願いします! @@ -317,22 +266,18 @@ Installer - Installing... インストールしています... - Receiving objects: オブジェクトをダウンロードしています: - Resolving deltas: デルタを解決しています: - Updating files: ファイルを更新しています: @@ -340,27 +285,22 @@ MapETA - eta 予定到着時間 - min - hr 時間 - km キロメートル - mi マイル @@ -368,22 +308,18 @@ MapInstructions - km キロメートル - m メートル - mi マイル - ft フィート @@ -391,48 +327,40 @@ MapPanel - Current Destination 現在の目的地 - CLEAR 削除 - Recent Destinations 最近の目的地 - Try the Navigation Beta β版ナビゲーションを試す - Get turn-by-turn directions displayed and more with a comma prime subscription. Sign up now: https://connect.comma.ai より詳細な案内情報を得ることができます。 詳しくはこちら:https://connect.comma.ai - No home location set 自宅の住所はまだ 設定されていません - No work location set 職場の住所はまだ 設定されていません - no recent destinations 最近の目的地履歴がありません @@ -440,12 +368,10 @@ location set MapWindow - Map Loading マップを読み込んでいます - Waiting for GPS GPS信号を探しています @@ -453,12 +379,10 @@ location set MultiOptionDialog - Select 選択 - Cancel キャンセル @@ -466,23 +390,18 @@ location set Networking - Advanced 詳細 - Enter password パスワードを入力 - - for "%1" ネットワーク名:%1 - Wrong password パスワードが間違っています @@ -490,30 +409,22 @@ location set NvgWindow - km/h km/h - mph mph - - MAX 最高速度 - - SPEED 速度 - - LIMIT 制限速度 @@ -521,17 +432,14 @@ location set OffroadHome - UPDATE 更新 - ALERTS 警告 - ALERT 警告 @@ -539,22 +447,18 @@ location set PairingPopup - Pair your device to your comma account デバイスと comma アカウントを連携する - Go to https://connect.comma.ai on your phone モバイルデバイスで「connect.comma.ai」にアクセスして - Click "add new device" and scan the QR code on the right 「新しいデバイスを追加」を押すと、右側のQRコードをスキャンしてください - Bookmark connect.comma.ai to your home screen to use it like an app 「connect.comma.ai」をホーム画面に追加して、アプリのように使うことができます @@ -562,32 +466,26 @@ location set PrimeAdWidget - Upgrade Now 今すぐアップグレート - Become a comma prime member at connect.comma.ai connect.comma.ai でプライム会員に登録できます - PRIME FEATURES: 特典: - Remote access リモートアクセス - 1 year of storage 一年間の保存期間 - Developer perks 開発者向け特典 @@ -595,22 +493,18 @@ location set PrimeUserWidget - ✓ SUBSCRIBED ✓ 入会しました - comma prime comma prime - CONNECT.COMMA.AI CONNECT.COMMA.AI - COMMA POINTS COMMA POINTS @@ -618,41 +512,34 @@ location set QObject - Reboot 再起動 - Exit 閉じる - dashcam ドライブレコーダー - openpilot openpilot - %n minute(s) ago %n 分前 - %n hour(s) ago %n 時間前 - %n day(s) ago %n 日前 @@ -662,47 +549,38 @@ location set Reset - Reset failed. Reboot to try again. 初期化に失敗しました。再起動後に再試行してください。 - Are you sure you want to reset your device? 初期化してもよろしいですか? - Resetting device... デバイスが初期化されます... - System Reset システムを初期化 - System reset triggered. Press confirm to erase all content and settings. Press cancel to resume boot. システムの初期化をリクエストしました。「確認」ボタンを押すとデバイスが初期化されます。「キャンセル」ボタンを押すと起動を続行します。 - Cancel キャンセル - Reboot 再起動 - Confirm 確認 - Unable to mount data partition. Press confirm to reset your device. 「data」パーティションをマウントできません。「確認」ボタンを押すとデバイスが初期化されます。 @@ -710,7 +588,6 @@ location set RichTextDialog - Ok OK @@ -718,33 +595,26 @@ location set SettingsWindow - × × - Device デバイス - - Network ネットワーク - Toggles 切り替え - Software ソフトウェア - Navigation ナビゲーション @@ -752,105 +622,82 @@ location set Setup - WARNING: Low Voltage 警告:低電圧 - Power your device in a car with a harness or proceed at your own risk. 自己責任でハーネスから電源を供給してください。 - Power off 電源を切る - - - Continue 続ける - Getting Started はじめに - Before we get on the road, let’s finish installation and cover some details. その前に、インストールを完了し、いくつかの詳細を説明します。 - Connect to Wi-Fi Wi-Fi に接続 - - Back 戻る - Continue without Wi-Fi Wi-Fi に未接続で続行 - Waiting for internet インターネット接続を待機中 - Choose Software to Install インストールするソフトウェアを選びます - Dashcam ドライブレコーダー - Custom Software カスタムソフトウェア - Enter URL URL を入力 - for Custom Software カスタムソフトウェア - Downloading... ダウンロード中... - Download Failed ダウンロード失敗 - Ensure the entered URL is valid, and the device’s internet connection is good. 入力された URL を確認し、デバイスがインターネットに接続されていることを確認してください。 - Reboot device デバイスを再起動 - Start over 最初からやり直す @@ -858,17 +705,14 @@ location set SetupWidget - Finish Setup セットアップ完了 - Pair your device with comma connect (connect.comma.ai) and claim your comma prime offer. デバイスを comma connect (connect.comma.ai)でペアリングし comma prime 特典を申請してください。 - Pair device デバイスをペアリング @@ -876,106 +720,82 @@ location set Sidebar - - CONNECT 接続 - OFFLINE オフライン - - ONLINE オンライン - ERROR エラー - - - TEMP 温度 - HIGH 高温 - GOOD 最適 - OK OK - VEHICLE 車両 - NO NO - PANDA PANDA - GPS GPS - SEARCH 検索 - -- -- - Wi-Fi Wi-Fi - ETH ETH - 2G 2G - 3G 3G - LTE LTE - 5G 5G @@ -983,89 +803,50 @@ location set SoftwarePanel - - Git Branch - Git ブランチ + Updates are only downloaded while the car is off. + 車の電源がオフの間のみ、アップデートのダウンロードが行われます。 - - Git Commit - Git コミット + Current Version + 現在のバージョン - - OS Version - OS バージョン + Download + ダウンロード - - Version - バージョン + Install Update + アップデート - - Last Update Check - 最終更新確認 + INSTALL + インストール - - The last time openpilot successfully checked for an update. The updater only runs while the car is off. - openpilotが最後にアップデートの確認に成功してからの時間です。アップデート処理は、車の電源が切れているときのみ実行されます。 + Target Branch + 対象のブランチ - - Check for Update - 更新プログラムをチェック + SELECT + 選択 - - CHECKING - 確認中 + Select a branch + ブランチを選択 - - Switch Branch - ブランチの切り替え - - - - ENTER - 切替 - - - - - The new branch will be pulled the next time the updater runs. - updater を実行する時にブランチを切り替えます。 - - - - Enter branch name - ブランチ名を入力 - - - UNINSTALL アンインストール - Uninstall %1 %1をアンインストール - Are you sure you want to uninstall? アンインストールしてもよろしいですか? - - failed to fetch update - 更新のダウンロードにエラーが発生しました - - - - CHECK 確認 @@ -1073,48 +854,38 @@ location set SshControl - SSH Keys SSH 鍵 - Warning: This grants SSH access to all public keys in your GitHub settings. Never enter a GitHub username other than your own. A comma employee will NEVER ask you to add their GitHub username. 警告: これは、GitHub の設定にあるすべての公開鍵への SSH アクセスを許可するものです。自分以外の GitHub のユーザー名を入力しないでください。コンマのスタッフが GitHub のユーザー名を追加するようお願いすることはありません。 - - ADD 追加 - Enter your GitHub username GitHub のユーザー名を入力してください - LOADING ローディング - REMOVE 削除 - Username '%1' has no keys on GitHub ユーザー名 “%1” は GitHub に鍵がありません - Request timed out リクエストタイムアウト - Username '%1' doesn't exist on GitHub ユーザー名 '%1' は GitHub に存在しません @@ -1122,7 +893,6 @@ location set SshToggle - Enable SSH SSH を有効化 @@ -1130,22 +900,18 @@ location set TermsPage - Terms & Conditions 利用規約 - Decline 拒否 - Scroll to accept スクロールして同意 - Agree 同意 @@ -1153,92 +919,82 @@ location set TogglesPanel - Enable openpilot openpilot を有効化 - Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off. アダプティブクルーズコントロールとレーンキーピングドライバーアシスト(openpilotシステム)。この機能を使用するには、常に注意が必要です。この設定を変更すると、車の電源が切れたときに有効になります。 - Enable Lane Departure Warnings 車線逸脱警報機能を有効化 - Receive alerts to steer back into the lane when your vehicle drifts over a detected lane line without a turn signal activated while driving over 31 mph (50 km/h). - 時速31マイル(50km)を超えるスピードで走行中、方向指示器を作動させずに検出された車線ライン上に車両が触れた場合、車線に戻るアラートを受信します。 + 時速31マイル(50km)を超えるスピードで走行中、ウインカーを作動させずに検出された車線ライン上に車両が触れた場合、車線に戻るアラートを受信します。 - Use Metric System メートル法を有効化 - Display speed in km/h instead of mph. 速度は mph ではなく km/h で表示されます。 - Record and Upload Driver Camera 車内カメラの録画とアップロード - Upload data from the driver facing camera and help improve the driver monitoring algorithm. 車内カメラの映像をアップロードし、ドライバー監視システムのアルゴリズムの向上に役立てます。 - 🌮 End-to-end longitudinal (extremely alpha) 🌮 - + 🌮 エンドツーエンドのアクセル制御 (超アルファ版) 🌮 - Experimental openpilot longitudinal control - + 実験段階のopenpilotによるアクセル制御 - <b>WARNING: openpilot longitudinal control is experimental for this car and will disable AEB.</b> - + <b>警告: openpilotによるアクセル制御は実験段階であり、AEBを無効化します。</b> - Let the driving model control the gas and brakes. openpilot will drive as it thinks a human would. Super experimental. - + アクセルとブレーキの制御をopenpilotに任せます。openpilotが人間と同じように運転します。最初期の実験段階です。 + + + openpilot longitudinal control is not currently available for this car. + openpilotによるアクセル制御は、この車では現在利用できません。 + + + Enable experimental longitudinal control to enable this. + ここ機能を使う為には、「実験段階のopenpilotによるアクセル制御」を先に有効化してください。 - Disengage On Accelerator Pedal アクセル踏むと openpilot をキャンセル - When enabled, pressing the accelerator pedal will disengage openpilot. 有効な場合は、アクセルを踏むと openpilot をキャンセルします。 - Show ETA in 24h Format 24時間表示 - Use 24h format instead of am/pm AM/PM の代わりに24時間形式を使用します - Show Map on Left Side of UI ディスプレイの左側にマップを表示 - Show map on left side when in split screen view. 分割画面表示の場合、ディスプレイの左側にマップを表示します。 @@ -1246,42 +1002,34 @@ location set Updater - Update Required 更新が必要です - An operating system update is required. Connect your device to Wi-Fi for the fastest update experience. The download size is approximately 1GB. オペレーティングシステムのアップデートが必要です。Wi-Fi に接続することで、最速のアップデートを体験できます。ダウンロードサイズは約 1GB です。 - Connect to Wi-Fi Wi-Fi に接続 - Install インストール - Back 戻る - Loading... 読み込み中... - Reboot 再起動 - Update failed 更新失敗 @@ -1289,23 +1037,18 @@ location set WifiUI - - Scanning for networks... ネットワークをスキャン中... - CONNECTING... 接続中... - FORGET 削除 - Forget Wi-Fi Network "%1"? Wi-Fiネットワーク%1を削除してもよろしいですか? diff --git a/selfdrive/ui/translations/main_ko.ts b/selfdrive/ui/translations/main_ko.ts index 5d7df2162..86cd8f990 100644 --- a/selfdrive/ui/translations/main_ko.ts +++ b/selfdrive/ui/translations/main_ko.ts @@ -4,17 +4,14 @@ AbstractAlert - Close 닫기 - Snooze Update 업데이트 일시중지 - Reboot and Update 업데이트 및 재부팅 @@ -22,67 +19,61 @@ AdvancedNetworking - Back 뒤로 - Enable Tethering 테더링 사용 - Tethering Password 테더링 비밀번호 - - EDIT 편집 - Enter new tethering password 새 테더링 비밀번호를 입력하세요 - IP Address IP 주소 - Enable Roaming 로밍 사용 - APN Setting APN 설정 - Enter APN APN 입력 - leave blank for automatic configuration 자동설정하려면 공백으로 두세요 + + Cellular Metered + + + + Prevent large data uploads when on a metered connection + + ConfirmationDialog - - Ok 확인 - Cancel 취소 @@ -90,17 +81,14 @@ DeclinePage - You must accept the Terms and Conditions in order to use openpilot. openpilot을 사용하려면 이용약관에 동의해야 합니다. - Back 뒤로 - Decline, uninstall %1 거절, %1 제거 @@ -108,152 +96,122 @@ DevicePanel - Dongle ID Dongle ID - N/A N/A - Serial Serial - Driver Camera 운전자 카메라 - PREVIEW 미리보기 - Preview the driver facing camera to ensure that driver monitoring has good visibility. (vehicle must be off) 운전자 모니터링이 좋은 가시성을 갖도록 운전자를 향한 카메라를 미리 봅니다. (차량연결은 해제되어있어야 합니다) - Reset Calibration 캘리브레이션 - RESET 재설정 - Are you sure you want to reset calibration? 캘리브레이션을 재설정하시겠습니까? - Review Training Guide 트레이닝 가이드 - REVIEW 다시보기 - Review the rules, features, and limitations of openpilot openpilot의 규칙, 기능 및 제한 다시보기 - Are you sure you want to review the training guide? 트레이닝 가이드를 다시보시겠습니까? - Regulatory 규제 - VIEW 보기 - Change Language 언어 변경 - CHANGE 변경 - Select a language 언어를 선택하세요 - Reboot 재부팅 - Power Off 전원 종료 - openpilot requires the device to be mounted within 4° left or right and within 5° up or 8° down. openpilot is continuously calibrating, resetting is rarely required. openpilot은 좌우측은 4° 이내, 위쪽은 5° 아래쪽은 8° 이내로 장치를 설치해야 합니다. openpilot은 지속적으로 보정되므로 리셋은 거의 필요하지 않습니다. - Your device is pointed %1° %2 and %3° %4. 사용자의 장치가 %1° %2 및 %3° %4 위치에 설치되어있습니다. - down 아래로 - up 위로 - left 좌측으로 - right 우측으로 - Are you sure you want to reboot? 재부팅 하시겠습니까? - Disengage to Reboot 재부팅 하려면 해제하세요 - Are you sure you want to power off? 전원을 종료하시겠습니까? - Disengage to Power Off 전원을 종료하려면 해제하세요 @@ -261,32 +219,26 @@ DriveStats - Drives 주행 - Hours 시간 - ALL TIME 전체 - PAST WEEK 지난주 - KM Km - Miles Miles @@ -294,7 +246,6 @@ DriverViewScene - camera starting 카메라 시작중 @@ -302,12 +253,10 @@ InputDialog - Cancel 취소 - Need at least %n character(s)! 최소 %n 자가 필요합니다! @@ -317,22 +266,18 @@ Installer - Installing... 설치중... - Receiving objects: 수신중: - Resolving deltas: 델타병합: - Updating files: 파일갱신: @@ -340,27 +285,22 @@ MapETA - eta 도착 - min - hr 시간 - km km - mi mi @@ -368,22 +308,18 @@ MapInstructions - km km - m m - mi mi - ft ft @@ -391,48 +327,40 @@ MapPanel - Current Destination 현재 목적지 - CLEAR 삭제 - Recent Destinations 최근 목적지 - Try the Navigation Beta 네비게이션(베타)를 사용해보세요 - Get turn-by-turn directions displayed and more with a comma prime subscription. Sign up now: https://connect.comma.ai 자세한 경로안내를 원하시면 comma prime을 구독하세요. 등록:https://connect.comma.ai - No home location set 집 설정되지않음 - No work location set 회사 설정되지않음 - no recent destinations 최근 목적지 없음 @@ -440,12 +368,10 @@ location set MapWindow - Map Loading 지도 로딩 - Waiting for GPS GPS를 기다리는 중 @@ -453,12 +379,10 @@ location set MultiOptionDialog - Select 선택 - Cancel 취소 @@ -466,23 +390,18 @@ location set Networking - Advanced 고급 설정 - Enter password 비밀번호를 입력하세요 - - for "%1" "%1"에 접속하려면 인증이 필요합니다 - Wrong password 비밀번호가 틀렸습니다 @@ -490,30 +409,22 @@ location set NvgWindow - km/h km/h - mph mph - - MAX MAX - - SPEED SPEED - - LIMIT LIMIT @@ -521,17 +432,14 @@ location set OffroadHome - UPDATE 업데이트 - ALERTS 알림 - ALERT 알림 @@ -539,22 +447,18 @@ location set PairingPopup - Pair your device to your comma account 장치를 콤마 계정과 페어링합니다 - Go to https://connect.comma.ai on your phone https://connect.comma.ai에 접속하세요 - Click "add new device" and scan the QR code on the right "새 장치 추가"를 클릭하고 오른쪽 QR 코드를 검색합니다 - Bookmark connect.comma.ai to your home screen to use it like an app connect.comma.ai을 앱처럼 사용하려면 홈 화면에 바로가기를 만드십시오 @@ -562,32 +466,26 @@ location set PrimeAdWidget - Upgrade Now 지금 업그레이드 - Become a comma prime member at connect.comma.ai connect.comma.ai에서 comma prime에 가입합니다 - PRIME FEATURES: PRIME 기능: - Remote access 원격 접속 - 1 year of storage 1년간 저장 - Developer perks 개발자 혜택 @@ -595,22 +493,18 @@ location set PrimeUserWidget - ✓ SUBSCRIBED ✓ 구독함 - comma prime comma prime - CONNECT.COMMA.AI CONNECT.COMMA.AI - COMMA POINTS COMMA POINTS @@ -618,41 +512,34 @@ location set QObject - Reboot 재부팅 - Exit 종료 - dashcam dashcam - openpilot openpilot - %n minute(s) ago %n 분전 - %n hour(s) ago %n 시간전 - %n day(s) ago %n 일전 @@ -662,47 +549,38 @@ location set Reset - Reset failed. Reboot to try again. 초기화 실패. 재부팅후 다시 시도하세요. - Are you sure you want to reset your device? 장치를 초기화 하시겠습니까? - Resetting device... 장치 초기화중... - System Reset 장치 초기화 - System reset triggered. Press confirm to erase all content and settings. Press cancel to resume boot. 장치를 초기화 합니다. 확인버튼을 누르면 모든 내용과 설정이 초기화됩니다. 부팅을 재개하려면 취소를 누르세요. - Cancel 취소 - Reboot 재부팅 - Confirm 확인 - Unable to mount data partition. Press confirm to reset your device. 데이터 파티션을 마운트할 수 없습니다. 확인 버튼을 눌러 장치를 리셋합니다. @@ -710,7 +588,6 @@ location set RichTextDialog - Ok 확인 @@ -718,33 +595,26 @@ location set SettingsWindow - × × - Device 장치 - - Network 네트워크 - Toggles 토글 - Software 소프트웨어 - Navigation 네비게이션 @@ -752,105 +622,82 @@ location set Setup - WARNING: Low Voltage 경고: 전압이 낮습니다 - Power your device in a car with a harness or proceed at your own risk. 하네스 보드에 차량의 전원을 연결하세요. - Power off 전원 종료 - - - Continue 계속 - Getting Started 설정 시작 - Before we get on the road, let’s finish installation and cover some details. 출발하기 전에 설정을 완료하고 몇 가지 세부 사항을 살펴보겠습니다. - Connect to Wi-Fi wifi 연결 - - Back 뒤로 - Continue without Wi-Fi wifi 연결없이 계속하기 - Waiting for internet 네트워크 접속을 기다립니다 - Choose Software to Install 설치할 소프트웨어를 선택하세요 - Dashcam Dashcam - Custom Software Custom Software - Enter URL URL 입력 - for Custom Software for Custom Software - Downloading... 다운로드중... - Download Failed 다운로드 실패 - Ensure the entered URL is valid, and the device’s internet connection is good. 입력된 URL이 유효하고 장치의 네트워크 연결이 잘 되어 있는지 확인하세요. - Reboot device 재부팅 - Start over 다시 시작 @@ -858,17 +705,14 @@ location set SetupWidget - Finish Setup 설정 완료 - Pair your device with comma connect (connect.comma.ai) and claim your comma prime offer. 장치를 (connect.comma.ai)에서 페어링하고 comma prime 오퍼를 청구합니다. - Pair device 장치 페어링 @@ -876,106 +720,82 @@ location set Sidebar - - CONNECT 연결 - OFFLINE 오프라인 - - ONLINE 온라인 - ERROR 오류 - - - TEMP 온도 - HIGH 높음 - GOOD 좋음 - OK 경고 - VEHICLE 차량 - NO NO - PANDA PANDA - GPS GPS - SEARCH 검색중 - -- -- - Wi-Fi Wi-Fi - ETH 이더넷 - 2G 2G - 3G 3G - LTE LTE - 5G 5G @@ -983,89 +803,50 @@ location set SoftwarePanel - - Git Branch - Git 브렌치 + Updates are only downloaded while the car is off. + 업데이트는 차량 연결이 해제되어 있는 동안에만 다운로드됩니다. - - Git Commit - Git 커밋 + Current Version + 현재 버전 - - OS Version - OS 버전 + Download + 다운로드 - - Version - 버전 + Install Update + 업데이트 설치 - - Last Update Check - 최신 업데이트 검사 + INSTALL + 설치 - - The last time openpilot successfully checked for an update. The updater only runs while the car is off. - 최근에 openpilot이 업데이트를 성공적으로 확인했습니다. 업데이트 프로그램은 차량 연결이 해제되었을때만 작동합니다. + Target Branch + 대상 브랜치 - - Check for Update - 업데이트 확인 + SELECT + 선택 - - CHECKING - 확인중 + Select a branch + 브랜치 선택 - - Switch Branch - 브랜치 변경 - - - - ENTER - 입력하세요 - - - - - The new branch will be pulled the next time the updater runs. - 다음 업데이트 프로그램이 실행될 때 새 브랜치가 적용됩니다. - - - - Enter branch name - 브랜치명 입력 - - - UNINSTALL 제거 - Uninstall %1 %1 제거 - Are you sure you want to uninstall? 제거하시겠습니까? - - failed to fetch update - 업데이트를 가져올수없습니다 - - - - CHECK 확인 @@ -1073,48 +854,38 @@ location set SshControl - SSH Keys SSH 키 - Warning: This grants SSH access to all public keys in your GitHub settings. Never enter a GitHub username other than your own. A comma employee will NEVER ask you to add their GitHub username. 경고: 허용으로 설정하면 GitHub 설정의 모든 공용 키에 대한 SSH 액세스 권한이 부여됩니다. GitHub 사용자 ID 이외에는 입력하지 마십시오. comma에서는 GitHub ID를 추가하라는 요청을 하지 않습니다. - - ADD 추가 - Enter your GitHub username GitHub 사용자 ID - LOADING 로딩 - REMOVE 제거 - Username '%1' has no keys on GitHub '%1'의 키가 GitHub에 없습니다 - Request timed out 요청 시간 초과 - Username '%1' doesn't exist on GitHub '%1'은 GitHub에 없습니다 @@ -1122,7 +893,6 @@ location set SshToggle - Enable SSH SSH 사용 @@ -1130,22 +900,18 @@ location set TermsPage - Terms & Conditions 약관 - Decline 거절 - Scroll to accept 허용하려면 아래로 스크롤하세요 - Agree 동의 @@ -1153,92 +919,82 @@ location set TogglesPanel - Enable openpilot openpilot 사용 - Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off. 어댑티브 크루즈 컨트롤 및 차선 유지 운전자 보조를 위해 openpilot 시스템을 사용하십시오. 이 기능을 사용하려면 항상 주의를 기울여야 합니다. 설정변경은 장치 재부팅후 적용됩니다. - Enable Lane Departure Warnings 차선 이탈 경고 사용 - Receive alerts to steer back into the lane when your vehicle drifts over a detected lane line without a turn signal activated while driving over 31 mph (50 km/h). 차량이 50km/h(31mph) 이상의 속도로 주행하는 동안 방향지시등 없이 감지된 차선 위를 주행할 경우 차선이탈 경고를 표시합니다. - Use Metric System 미터법 사용 - Display speed in km/h instead of mph. mph 대신 km/h로 속도를 표시합니다. - Record and Upload Driver Camera 운전자 카메라 녹화 및 업로드 - Upload data from the driver facing camera and help improve the driver monitoring algorithm. 운전자 카메라에서 데이터를 업로드하고 운전자 모니터링 알고리즘을 개선합니다. - 🌮 End-to-end longitudinal (extremely alpha) 🌮 🌮 e2e 롱컨트롤 사용 (매우 실험적) 🌮 - Experimental openpilot longitudinal control openpilot 롱컨트롤 (실험적) - <b>WARNING: openpilot longitudinal control is experimental for this car and will disable AEB.</b> <b>경고: openpilot 롱컨트롤은 실험적인 기능으로 차량의 AEB를 비활성화합니다.</b> - Let the driving model control the gas and brakes. openpilot will drive as it thinks a human would. Super experimental. 주행모델이 가속과 감속을 제어하도록 하면 openpilot은 운전자가 생각하는것처럼 운전합니다. (매우 실험적) - + openpilot longitudinal control is not currently available for this car. + 현재 이 차량에는 openpilot 롱컨트롤을 사용할 수 없습니다. + + + Enable experimental longitudinal control to enable this. + openpilot 롱컨트롤을 활성화합니다. (실험적) + + Disengage On Accelerator Pedal 가속페달 조작시 해제 - When enabled, pressing the accelerator pedal will disengage openpilot. 활성화된 경우 가속 페달을 누르면 openpilot이 해제됩니다. - Show ETA in 24h Format 24시간 형식으로 도착예정시간 표시 - Use 24h format instead of am/pm 오전/오후 대신 24시간 형식 사용 - Show Map on Left Side of UI UI 왼쪽에 지도 표시 - Show map on left side when in split screen view. 분할 화면 보기에서 지도를 왼쪽에 표시합니다. @@ -1246,42 +1002,34 @@ location set Updater - Update Required 업데이트 필요 - An operating system update is required. Connect your device to Wi-Fi for the fastest update experience. The download size is approximately 1GB. OS 업데이트가 필요합니다. 장치를 wifi에 연결하면 가장 빠른 업데이트 경험을 제공합니다. 다운로드 크기는 약 1GB입니다. - Connect to Wi-Fi wifi 연결 - Install 설치 - Back 뒤로 - Loading... 로딩중... - Reboot 재부팅 - Update failed 업데이트 실패 @@ -1289,23 +1037,18 @@ location set WifiUI - - Scanning for networks... 네트워크 검색 중... - CONNECTING... 연결중... - FORGET 저장안함 - Forget Wi-Fi Network "%1"? wifi 네트워크 저장안함 "%1"? diff --git a/selfdrive/ui/translations/main_pt-BR.ts b/selfdrive/ui/translations/main_pt-BR.ts index 2b3acb369..6a772a1f6 100644 --- a/selfdrive/ui/translations/main_pt-BR.ts +++ b/selfdrive/ui/translations/main_pt-BR.ts @@ -4,17 +4,14 @@ AbstractAlert - Close Fechar - Snooze Update Adiar Atualização - Reboot and Update Reiniciar e Atualizar @@ -22,67 +19,61 @@ AdvancedNetworking - Back Voltar - Enable Tethering Ativar Tether - Tethering Password Senha Tethering - - EDIT EDITAR - Enter new tethering password Insira nova senha tethering - IP Address Endereço IP - Enable Roaming Ativar Roaming - APN Setting APN Config - Enter APN Insira APN - leave blank for automatic configuration deixe em branco para configuração automática + + Cellular Metered + + + + Prevent large data uploads when on a metered connection + + ConfirmationDialog - - Ok OK - Cancel Cancelar @@ -90,17 +81,14 @@ DeclinePage - You must accept the Terms and Conditions in order to use openpilot. Você precisa aceitar os Termos e Condições para utilizar openpilot. - Back Voltar - Decline, uninstall %1 Rejeitar, desintalar %1 @@ -108,152 +96,122 @@ DevicePanel - Dongle ID Dongle ID - N/A N/A - Serial Serial - Driver Camera Câmera voltada para o Motorista - PREVIEW PREVISUAL - Preview the driver facing camera to ensure that driver monitoring has good visibility. (vehicle must be off) Pré-visualizar a câmera voltada para o motorista para garantir que monitor tem uma boa visibilidade (veículo precisa estar desligado) - Reset Calibration Resetar Calibragem - RESET RESET - Are you sure you want to reset calibration? Tem certeza que quer resetar a calibragem? - Review Training Guide Revisar Guia de Treinamento - REVIEW REVISAR - Review the rules, features, and limitations of openpilot Revisar regras, aprimoramentos e limitações do openpilot - Are you sure you want to review the training guide? Tem certeza que quer rever o treinamento? - Regulatory Regulatório - VIEW VER - Change Language Alterar Idioma - CHANGE ALTERAR - Select a language Selecione o Idioma - Reboot Reiniciar - Power Off Desligar - openpilot requires the device to be mounted within 4° left or right and within 5° up or 8° down. openpilot is continuously calibrating, resetting is rarely required. o openpilot requer que o dispositivo seja montado dentro de 4° esquerda ou direita e dentro de 5° para cima ou 8° para baixo. o openpilot está continuamente calibrando, resetar raramente é necessário. - Your device is pointed %1° %2 and %3° %4. Seu dispositivo está montado %1° %2 e %3° %4. - down baixo - up cima - left esquerda - right direita - Are you sure you want to reboot? Tem certeza que quer reiniciar? - Disengage to Reboot Desacione para Reiniciar - Are you sure you want to power off? Tem certeza que quer desligar? - Disengage to Power Off Desacione para Desligar @@ -261,32 +219,26 @@ DriveStats - Drives Dirigidas - Hours Horas - ALL TIME TOTAL - PAST WEEK SEMANA PASSADA - KM KM - Miles Milhas @@ -294,7 +246,6 @@ DriverViewScene - camera starting câmera iniciando @@ -302,12 +253,10 @@ InputDialog - Cancel Cancelar - Need at least %n character(s)! Necessita no mínimo %n caractere! @@ -318,22 +267,18 @@ Installer - Installing... Instalando... - Receiving objects: Recebendo objetos: - Resolving deltas: Resolvendo deltas: - Updating files: Atualizando arquivos: @@ -341,27 +286,22 @@ MapETA - eta eta - min min - hr hr - km km - mi mi @@ -369,22 +309,18 @@ MapInstructions - km km - m m - mi milha - ft pés @@ -392,48 +328,40 @@ MapPanel - Current Destination Destino Atual - CLEAR LIMPAR - Recent Destinations Destinos Recentes - Try the Navigation Beta Experimente a Navegação Beta - Get turn-by-turn directions displayed and more with a comma prime subscription. Sign up now: https://connect.comma.ai Obtenha instruções passo a passo exibidas e muito mais com uma assinatura prime Inscreva-se agora: https://connect.comma.ai - No home location set Sem local residência definido - No work location set Sem local de trabalho definido - no recent destinations sem destinos recentes @@ -441,12 +369,10 @@ trabalho definido MapWindow - Map Loading Carregando Mapa - Waiting for GPS Esperando por GPS @@ -454,12 +380,10 @@ trabalho definido MultiOptionDialog - Select Selecione - Cancel Cancelar @@ -467,23 +391,18 @@ trabalho definido Networking - Advanced Avançado - Enter password Insira a senha - - for "%1" para "%1" - Wrong password Senha incorreta @@ -491,30 +410,22 @@ trabalho definido NvgWindow - km/h km/h - mph mph - - MAX LIMITE - - SPEED MAX - - LIMIT VELO @@ -522,17 +433,14 @@ trabalho definido OffroadHome - UPDATE ATUALIZAÇÃO - ALERTS ALERTAS - ALERT ALERTA @@ -540,22 +448,18 @@ trabalho definido PairingPopup - Pair your device to your comma account Pareie seu dispositivo à sua conta comma - Go to https://connect.comma.ai on your phone navegue até https://connect.comma.ai no seu telefone - Click "add new device" and scan the QR code on the right Clique "add new device" e escaneie o QR code a seguir - Bookmark connect.comma.ai to your home screen to use it like an app Salve connect.comma.ai como sua página inicial para utilizar como um app @@ -563,32 +467,26 @@ trabalho definido PrimeAdWidget - Upgrade Now Atualizar Agora - Become a comma prime member at connect.comma.ai Torne-se um membro comma prime em connect.comma.ai - PRIME FEATURES: APRIMORAMENTOS PRIME: - Remote access Acesso remoto - 1 year of storage 1 ano de armazenamento - Developer perks Benefícios para desenvolvedor @@ -596,22 +494,18 @@ trabalho definido PrimeUserWidget - ✓ SUBSCRIBED ✓ INSCRITO - comma prime comma prime - CONNECT.COMMA.AI CONNECT.COMMA.AI - COMMA POINTS PONTOS COMMA @@ -619,27 +513,22 @@ trabalho definido QObject - Reboot Reiniciar - Exit Sair - dashcam dashcam - openpilot openpilot - %n minute(s) ago há %n minuto @@ -647,7 +536,6 @@ trabalho definido - %n hour(s) ago há %n hora @@ -655,7 +543,6 @@ trabalho definido - %n day(s) ago há %n dia @@ -666,47 +553,38 @@ trabalho definido Reset - Reset failed. Reboot to try again. Reset falhou. Reinicie para tentar novamente. - Are you sure you want to reset your device? Tem certeza que quer resetar seu dispositivo? - Resetting device... Resetando dispositivo... - System Reset Resetar Sistema - System reset triggered. Press confirm to erase all content and settings. Press cancel to resume boot. Solicitado reset do sistema. Confirme para apagar todo conteúdo e configurações. Aperte cancelar para continuar boot. - Cancel Cancelar - Reboot Reiniciar - Confirm Confirmar - Unable to mount data partition. Press confirm to reset your device. Não foi possível montar a partição de dados. Pressione confirmar para resetar seu dispositivo. @@ -714,7 +592,6 @@ trabalho definido RichTextDialog - Ok Ok @@ -722,33 +599,26 @@ trabalho definido SettingsWindow - × × - Device Dispositivo - - Network Rede - Toggles Ajustes - Software Software - Navigation Navegação @@ -756,105 +626,82 @@ trabalho definido Setup - WARNING: Low Voltage ALERTA: Baixa Voltagem - Power your device in a car with a harness or proceed at your own risk. Ligue seu dispositivo em um carro com um chicote ou prossiga por sua conta e risco. - Power off Desligar - - - Continue Continuar - Getting Started Começando - Before we get on the road, let’s finish installation and cover some details. Antes de pegarmos a estrada, vamos terminar a instalação e cobrir alguns detalhes. - Connect to Wi-Fi Conectar ao Wi-Fi - - Back Voltar - Continue without Wi-Fi Continuar sem Wi-Fi - Waiting for internet Esperando pela internet - Choose Software to Install Escolher Software para Instalar - Dashcam Dashcam - Custom Software Sofware Customizado - Enter URL Preencher URL - for Custom Software para o Software Customizado - Downloading... Baixando... - Download Failed Download Falhou - Ensure the entered URL is valid, and the device’s internet connection is good. Garanta que a URL inserida é valida, e uma boa conexão à internet. - Reboot device Reiniciar Dispositivo - Start over Inicializar @@ -862,17 +709,14 @@ trabalho definido SetupWidget - Finish Setup Concluir - Pair your device with comma connect (connect.comma.ai) and claim your comma prime offer. Pareie seu dispositivo com comma connect (connect.comma.ai) e reivindique sua oferta de comma prime. - Pair device Parear dispositivo @@ -880,106 +724,82 @@ trabalho definido Sidebar - - CONNECT CONEXÃO - OFFLINE - DESCONEC + OFFLINE - - ONLINE - CONECTADO + ONLINE - ERROR ERRO - - - TEMP TEMP - HIGH ALTA - GOOD BOA - OK OK - VEHICLE VEÍCULO - NO SEM - PANDA PANDA - GPS GPS - SEARCH PROCURA - -- -- - Wi-Fi Wi-Fi - ETH ETH - 2G 2G - 3G 3G - LTE LTE - 5G 5G @@ -987,89 +807,50 @@ trabalho definido SoftwarePanel - - Git Branch - Git Branch + Updates are only downloaded while the car is off. + Atualizações baixadas durante o motor desligado. - - Git Commit - Último Commit + Current Version + Versao Atual - - OS Version - Versão do Sistema + Download + Download - - Version - Versão + Install Update + Instalar Atualização - - Last Update Check - Verificação da última atualização + INSTALL + INSTALAR - - The last time openpilot successfully checked for an update. The updater only runs while the car is off. - A última vez que o openpilot verificou com sucesso uma atualização. O atualizador só funciona com o carro desligado. - - - - Check for Update - Verifique atualizações - - - - CHECKING - VERIFICANDO - - - - Switch Branch + Target Branch Alterar Branch - - ENTER - INSERIR + SELECT + SELECIONE - - - The new branch will be pulled the next time the updater runs. - A nova branch será aplicada ao verificar atualizações. + Select a branch + Selecione uma branch - - Enter branch name - Inserir o nome da branch - - - UNINSTALL - DESINSTALAR + DESINSTAL - Uninstall %1 Desintalar o %1 - Are you sure you want to uninstall? Tem certeza que quer desinstalar? - - failed to fetch update - falha ao buscar atualização - - - - CHECK VERIFICAR @@ -1077,48 +858,38 @@ trabalho definido SshControl - SSH Keys Chave SSH - Warning: This grants SSH access to all public keys in your GitHub settings. Never enter a GitHub username other than your own. A comma employee will NEVER ask you to add their GitHub username. Aviso: isso concede acesso SSH a todas as chaves públicas nas configurações do GitHub. Nunca insira um nome de usuário do GitHub que não seja o seu. Um funcionário da comma NUNCA pedirá que você adicione seu nome de usuário do GitHub. - - ADD ADICIONAR - Enter your GitHub username Insira seu nome de usuário do GitHub - LOADING CARREGANDO - REMOVE REMOVER - Username '%1' has no keys on GitHub Usuário "%1” não possui chaves no GitHub - Request timed out A solicitação expirou - Username '%1' doesn't exist on GitHub Usuário '%1' não existe no GitHub @@ -1126,7 +897,6 @@ trabalho definido SshToggle - Enable SSH Habilitar SSH @@ -1134,22 +904,18 @@ trabalho definido TermsPage - Terms & Conditions Termos & Condições - Decline Declinar - Scroll to accept Role a tela para aceitar - Agree Concordo @@ -1157,92 +923,82 @@ trabalho definido TogglesPanel - Enable openpilot Ativar openpilot - Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off. Use o sistema openpilot para controle de cruzeiro adaptativo e assistência ao motorista de manutenção de faixa. Sua atenção é necessária o tempo todo para usar esse recurso. A alteração desta configuração tem efeito quando o carro é desligado. - Enable Lane Departure Warnings Ativar Avisos de Saída de Faixa - Receive alerts to steer back into the lane when your vehicle drifts over a detected lane line without a turn signal activated while driving over 31 mph (50 km/h). Receba alertas para voltar para a pista se o seu veículo sair da faixa e a seta não tiver sido acionada previamente quando em velocidades superiores a 50 km/h. - Use Metric System Usar Sistema Métrico - Display speed in km/h instead of mph. Exibir velocidade em km/h invés de mph. - Record and Upload Driver Camera Gravar e Upload Câmera Motorista - Upload data from the driver facing camera and help improve the driver monitoring algorithm. Upload dados da câmera voltada para o motorista e ajude a melhorar o algoritmo de monitoramentor. - 🌮 End-to-end longitudinal (extremely alpha) 🌮 🌮 End-to-end longitudinal (experimental) 🌮 - Experimental openpilot longitudinal control - + Controle longitudinal experimental openpilot - <b>WARNING: openpilot longitudinal control is experimental for this car and will disable AEB.</b> - + <b>AVISO: o controle longitudinal openpilot é experimental para este carro e irá desabilitar AEB.</b> - Let the driving model control the gas and brakes. openpilot will drive as it thinks a human would. Super experimental. - + Deixe o modelo controlar o acelerador e os freios. openpilot irá conduzir como pensa que um humano faria. Super experimental. + + + openpilot longitudinal control is not currently available for this car. + controle longitudinal openpilot não está disponível para este carro. + + + Enable experimental longitudinal control to enable this. + Habilite o controle longitudinal experimental para habilitar isso. - Disengage On Accelerator Pedal Desacionar Com Pedal Do Acelerador - When enabled, pressing the accelerator pedal will disengage openpilot. Quando ativado, pressionar o pedal do acelerador desacionará o openpilot. - Show ETA in 24h Format Mostrar ETA em formato 24h - Use 24h format instead of am/pm Use o formato 24h em vez de am/pm - Show Map on Left Side of UI Exibir Mapa no Lado Esquerdo - Show map on left side when in split screen view. Exibir mapa do lado esquerdo quando a tela for dividida. @@ -1250,42 +1006,34 @@ trabalho definido Updater - Update Required Atualização Necessária - An operating system update is required. Connect your device to Wi-Fi for the fastest update experience. The download size is approximately 1GB. Uma atualização do sistema operacional é necessária. Conecte seu dispositivo ao Wi-Fi para a experiência de atualização mais rápida. O tamanho do download é de aproximadamente 1GB. - Connect to Wi-Fi Conecte-se ao Wi-Fi - Install Instalar - Back Voltar - Loading... Carregando... - Reboot Reiniciar - Update failed Falha na atualização @@ -1293,23 +1041,18 @@ trabalho definido WifiUI - - Scanning for networks... Procurando redes... - CONNECTING... CONECTANDO... - FORGET ESQUECER - Forget Wi-Fi Network "%1"? Esquecer Rede Wi-Fi "%1"? diff --git a/selfdrive/ui/translations/main_zh-CHS.ts b/selfdrive/ui/translations/main_zh-CHS.ts index d6afbf589..3f3afe95c 100644 --- a/selfdrive/ui/translations/main_zh-CHS.ts +++ b/selfdrive/ui/translations/main_zh-CHS.ts @@ -4,17 +4,14 @@ AbstractAlert - Close 关闭 - Snooze Update 暂停更新 - Reboot and Update 重启并更新 @@ -22,67 +19,61 @@ AdvancedNetworking - Back 返回 - Enable Tethering 启用WiFi热点 - Tethering Password WiFi热点密码 - - EDIT 编辑 - Enter new tethering password 输入新的WiFi热点密码 - IP Address IP地址 - Enable Roaming 启用数据漫游 - APN Setting APN设置 - Enter APN 输入APN - leave blank for automatic configuration 留空以自动配置 + + Cellular Metered + + + + Prevent large data uploads when on a metered connection + + ConfirmationDialog - - Ok 好的 - Cancel 取消 @@ -90,17 +81,14 @@ DeclinePage - You must accept the Terms and Conditions in order to use openpilot. 您必须接受条款和条件以使用openpilot。 - Back 返回 - Decline, uninstall %1 拒绝并卸载%1 @@ -108,152 +96,122 @@ DevicePanel - Dongle ID 设备ID(Dongle ID) - N/A N/A - Serial 序列号 - Driver Camera 驾驶员摄像头 - PREVIEW 预览 - Preview the driver facing camera to ensure that driver monitoring has good visibility. (vehicle must be off) 打开并预览驾驶员摄像头,以确保驾驶员监控具有良好视野。仅熄火时可用。 - Reset Calibration 重置设备校准 - RESET 重置 - Are you sure you want to reset calibration? 您确定要重置设备校准吗? - Review Training Guide 新手指南 - REVIEW 查看 - Review the rules, features, and limitations of openpilot 查看openpilot的使用规则,以及其功能和限制。 - Are you sure you want to review the training guide? 您确定要查看新手指南吗? - Regulatory 监管信息 - VIEW 查看 - Change Language 切换语言 - CHANGE 切换 - Select a language 选择语言 - Reboot 重启 - Power Off 关机 - openpilot requires the device to be mounted within 4° left or right and within 5° up or 8° down. openpilot is continuously calibrating, resetting is rarely required. openpilot要求设备安装的偏航角在左4°和右4°之间,俯仰角在上5°和下8°之间。一般来说,openpilot会持续更新校准,很少需要重置。 - Your device is pointed %1° %2 and %3° %4. 您的设备校准为%1° %2、%3° %4。 - down 朝下 - up 朝上 - left 朝左 - right 朝右 - Are you sure you want to reboot? 您确定要重新启动吗? - Disengage to Reboot 取消openpilot以重新启动 - Are you sure you want to power off? 您确定要关机吗? - Disengage to Power Off 取消openpilot以关机 @@ -261,32 +219,26 @@ DriveStats - Drives 旅程数 - Hours 小时 - ALL TIME 全部 - PAST WEEK 过去一周 - KM 公里 - Miles 英里 @@ -294,7 +246,6 @@ DriverViewScene - camera starting 正在启动相机 @@ -302,12 +253,10 @@ InputDialog - Cancel 取消 - Need at least %n character(s)! 至少需要 %n 个字符! @@ -317,22 +266,18 @@ Installer - Installing... 正在安装…… - Receiving objects: 正在接收: - Resolving deltas: 正在处理: - Updating files: 正在更新文件: @@ -340,27 +285,22 @@ MapETA - eta 埃塔 - min 分钟 - hr 小时 - km km - mi mi @@ -368,22 +308,18 @@ MapInstructions - km km - m m - mi mi - ft ft @@ -391,46 +327,38 @@ MapPanel - Current Destination 当前目的地 - CLEAR 清空 - Recent Destinations 最近目的地 - Try the Navigation Beta 试用导航测试版 - Get turn-by-turn directions displayed and more with a comma prime subscription. Sign up now: https://connect.comma.ai 订阅comma prime以获取导航。 立即注册:https://connect.comma.ai - No home location set 家:未设定 - No work location set 工作:未设定 - no recent destinations 无最近目的地 @@ -438,12 +366,10 @@ location set MapWindow - Map Loading 地图加载中 - Waiting for GPS 等待 GPS @@ -451,12 +377,10 @@ location set MultiOptionDialog - Select 选择 - Cancel 取消 @@ -464,23 +388,18 @@ location set Networking - Advanced 高级 - Enter password 输入密码 - - for "%1" 网络名称:"%1" - Wrong password 密码错误 @@ -488,30 +407,22 @@ location set NvgWindow - km/h km/h - mph mph - - MAX 最高定速 - - SPEED SPEED - - LIMIT LIMIT @@ -519,17 +430,14 @@ location set OffroadHome - UPDATE 更新 - ALERTS 警报 - ALERT 警报 @@ -537,22 +445,18 @@ location set PairingPopup - Pair your device to your comma account 将您的设备与comma账号配对 - Go to https://connect.comma.ai on your phone 在手机上访问 https://connect.comma.ai - Click "add new device" and scan the QR code on the right 点击“添加新设备”,扫描右侧二维码 - Bookmark connect.comma.ai to your home screen to use it like an app 将 connect.comma.ai 收藏到您的主屏幕,以便像应用程序一样使用它 @@ -560,32 +464,26 @@ location set PrimeAdWidget - Upgrade Now 现在升级 - Become a comma prime member at connect.comma.ai 打开connect.comma.ai以注册comma prime会员 - PRIME FEATURES: comma prime特权: - Remote access 远程访问 - 1 year of storage 1年数据存储 - Developer perks 开发者福利 @@ -593,22 +491,18 @@ location set PrimeUserWidget - ✓ SUBSCRIBED ✓ 已订阅 - comma prime comma prime - CONNECT.COMMA.AI CONNECT.COMMA.AI - COMMA POINTS COMMA POINTS点数 @@ -616,41 +510,34 @@ location set QObject - Reboot 重启 - Exit 退出 - dashcam 行车记录仪 - openpilot openpilot - %n minute(s) ago %n 分钟前 - %n hour(s) ago %n 小时前 - %n day(s) ago %n 天前 @@ -660,47 +547,38 @@ location set Reset - Reset failed. Reboot to try again. 重置失败。 重新启动以重试。 - Are you sure you want to reset your device? 您确定要重置您的设备吗? - Resetting device... 正在重置设备…… - System Reset 恢复出厂设置 - System reset triggered. Press confirm to erase all content and settings. Press cancel to resume boot. 已触发系统重置:确认以删除所有内容和设置。取消以正常启动设备。 - Cancel 取消 - Reboot 重启 - Confirm 确认 - Unable to mount data partition. Press confirm to reset your device. 无法挂载数据分区。 确认以重置您的设备。 @@ -708,7 +586,6 @@ location set RichTextDialog - Ok 好的 @@ -716,33 +593,26 @@ location set SettingsWindow - × × - Device 设备 - - Network 网络 - Toggles 设定 - Software 软件 - Navigation 导航 @@ -750,105 +620,82 @@ location set Setup - WARNING: Low Voltage 警告:低电压 - Power your device in a car with a harness or proceed at your own risk. 请使用car harness线束为您的设备供电,或自行承担风险。 - Power off 关机 - - - Continue 继续 - Getting Started 开始设置 - Before we get on the road, let’s finish installation and cover some details. 开始旅程之前,让我们完成安装并介绍一些细节。 - Connect to Wi-Fi 连接到WiFi - - Back 返回 - Continue without Wi-Fi 不连接WiFi并继续 - Waiting for internet 等待网络连接 - Choose Software to Install 选择要安装的软件 - Dashcam Dashcam(行车记录仪) - Custom Software 自定义软件 - Enter URL 输入网址 - for Custom Software 以下载自定义软件 - Downloading... 正在下载…… - Download Failed 下载失败 - Ensure the entered URL is valid, and the device’s internet connection is good. 请确保互联网连接良好且输入的URL有效。 - Reboot device 重启设备 - Start over 重来 @@ -856,17 +703,14 @@ location set SetupWidget - Finish Setup 完成设置 - Pair your device with comma connect (connect.comma.ai) and claim your comma prime offer. 将您的设备与comma connect (connect.comma.ai)配对并领取您的comma prime优惠。 - Pair device 配对设备 @@ -874,106 +718,82 @@ location set Sidebar - - CONNECT CONNECT - OFFLINE 离线 - - ONLINE 在线 - ERROR 连接出错 - - - TEMP 设备温度 - HIGH 过热 - GOOD 良好 - OK 一般 - VEHICLE 车辆连接 - NO - PANDA PANDA - GPS GPS - SEARCH 搜索中 - -- -- - Wi-Fi Wi-Fi - ETH 以太网 - 2G 2G - 3G 3G - LTE LTE - 5G 5G @@ -981,89 +801,50 @@ location set SoftwarePanel - - Git Branch - Git Branch + Updates are only downloaded while the car is off. + - - Git Commit - Git Commit + Current Version + - - OS Version - 系统版本 + Download + - - Version - 软件版本 + Install Update + - - Last Update Check - 上次检查更新 + INSTALL + - - The last time openpilot successfully checked for an update. The updater only runs while the car is off. - 上一次成功检查更新的时间。更新程序仅在汽车熄火时运行。 + Target Branch + - - Check for Update - 检查更新 + SELECT + - - CHECKING - 正在检查更新 + Select a branch + - - Switch Branch - 切换分支 - - - - ENTER - 输入 - - - - - The new branch will be pulled the next time the updater runs. - 分支将在更新服务下次启动时自动切换。 - - - - Enter branch name - 输入分支名称 - - - UNINSTALL 卸载 - Uninstall %1 卸载 %1 - Are you sure you want to uninstall? 您确定要卸载吗? - - failed to fetch update - 获取更新失败 - - - - CHECK 查看 @@ -1071,48 +852,38 @@ location set SshControl - SSH Keys SSH密钥 - Warning: This grants SSH access to all public keys in your GitHub settings. Never enter a GitHub username other than your own. A comma employee will NEVER ask you to add their GitHub username. 警告:这将授予SSH访问权限给您GitHub设置中的所有公钥。切勿输入您自己以外的GitHub用户名。comma员工永远不会要求您添加他们的GitHub用户名。 - - ADD 添加 - Enter your GitHub username 输入您的GitHub用户名 - LOADING 正在加载 - REMOVE 删除 - Username '%1' has no keys on GitHub 用户名“%1”在GitHub上没有密钥 - Request timed out 请求超时 - Username '%1' doesn't exist on GitHub GitHub上不存在用户名“%1” @@ -1120,7 +891,6 @@ location set SshToggle - Enable SSH 启用SSH @@ -1128,22 +898,18 @@ location set TermsPage - Terms & Conditions 条款和条件 - Decline 拒绝 - Scroll to accept 滑动以接受 - Agree 同意 @@ -1151,92 +917,82 @@ location set TogglesPanel - Enable openpilot 启用openpilot - Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off. 使用openpilot进行自适应巡航和车道保持辅助。使用此功能时您必须时刻保持注意力。该设置的更改在熄火时生效。 - Enable Lane Departure Warnings 启用车道偏离警告 - Receive alerts to steer back into the lane when your vehicle drifts over a detected lane line without a turn signal activated while driving over 31 mph (50 km/h). 车速超过31mph(50km/h)时,若检测到车辆越过车道线且未打转向灯,系统将发出警告以提醒您返回车道。 - Use Metric System 使用公制单位 - Display speed in km/h instead of mph. 显示车速时,以km/h代替mph。 - Record and Upload Driver Camera 录制并上传驾驶员摄像头 - Upload data from the driver facing camera and help improve the driver monitoring algorithm. 上传驾驶员摄像头的数据,帮助改进驾驶员监控算法。 - 🌮 End-to-end longitudinal (extremely alpha) 🌮 - + 🌮 端对端纵向控制(实验性功能) 🌮 - Experimental openpilot longitudinal control - <b>WARNING: openpilot longitudinal control is experimental for this car and will disable AEB.</b> - Let the driving model control the gas and brakes. openpilot will drive as it thinks a human would. Super experimental. + 让驾驶模型直接控制油门和刹车,openpilot将会模仿人类司机的驾驶方式。该功能仍非常实验性。 + + + openpilot longitudinal control is not currently available for this car. + + + + Enable experimental longitudinal control to enable this. - Disengage On Accelerator Pedal 踩油门时取消控制 - When enabled, pressing the accelerator pedal will disengage openpilot. 启用后,踩下油门踏板将取消openpilot。 - Show ETA in 24h Format 以24小时格式显示预计到达时间 - Use 24h format instead of am/pm 使用24小时制代替am/pm - Show Map on Left Side of UI 在介面左侧显示地图 - Show map on left side when in split screen view. 在分屏模式中,将地图置于屏幕左侧。 @@ -1244,42 +1000,34 @@ location set Updater - Update Required 需要更新 - An operating system update is required. Connect your device to Wi-Fi for the fastest update experience. The download size is approximately 1GB. 操作系统需要更新。请将您的设备连接到WiFi以获取更快的更新体验。下载大小约为1GB。 - Connect to Wi-Fi 连接到WiFi - Install 安装 - Back 返回 - Loading... 正在加载…… - Reboot 重启 - Update failed 更新失败 @@ -1287,23 +1035,18 @@ location set WifiUI - - Scanning for networks... 正在扫描网络…… - CONNECTING... 正在连接…… - FORGET 忘记 - Forget Wi-Fi Network "%1"? 忘记WiFi网络 "%1"? diff --git a/selfdrive/ui/translations/main_zh-CHT.ts b/selfdrive/ui/translations/main_zh-CHT.ts index 52bd30136..816d4fd3c 100644 --- a/selfdrive/ui/translations/main_zh-CHT.ts +++ b/selfdrive/ui/translations/main_zh-CHT.ts @@ -4,17 +4,14 @@ AbstractAlert - Close 關閉 - Snooze Update 暫停更新 - Reboot and Update 重啟並更新 @@ -22,67 +19,61 @@ AdvancedNetworking - Back 回上頁 - Enable Tethering 啟用網路分享 - Tethering Password 網路分享密碼 - - EDIT 編輯 - Enter new tethering password 輸入新的網路分享密碼 - IP Address IP 地址 - Enable Roaming 啟用漫遊 - APN Setting APN 設置 - Enter APN 輸入 APN - leave blank for automatic configuration 留空白將自動配置 + + Cellular Metered + + + + Prevent large data uploads when on a metered connection + + ConfirmationDialog - - Ok 確定 - Cancel 取消 @@ -90,17 +81,14 @@ DeclinePage - You must accept the Terms and Conditions in order to use openpilot. 您必須先接受條款和條件才能使用 openpilot。 - Back 回上頁 - Decline, uninstall %1 拒絕並卸載 %1 @@ -108,152 +96,122 @@ DevicePanel - Dongle ID Dongle ID - N/A 無法使用 - Serial 序號 - Driver Camera 駕駛員攝像頭 - PREVIEW 預覽 - Preview the driver facing camera to ensure that driver monitoring has good visibility. (vehicle must be off) 預覽駕駛員監控鏡頭畫面,以確保其具有良好視野。(僅在熄火時可用) - Reset Calibration 重置校準 - RESET 重置 - Are you sure you want to reset calibration? 您確定要重置校準嗎? - Review Training Guide 觀看使用教學 - REVIEW 觀看 - Review the rules, features, and limitations of openpilot 觀看 openpilot 的使用規則、功能和限制 - Are you sure you want to review the training guide? 您確定要觀看使用教學嗎? - Regulatory 法規/監管 - VIEW 觀看 - Change Language 更改語言 - CHANGE 更改 - Select a language 選擇語言 - Reboot 重新啟動 - Power Off 關機 - openpilot requires the device to be mounted within 4° left or right and within 5° up or 8° down. openpilot is continuously calibrating, resetting is rarely required. openpilot 需要將裝置固定在左右偏差 4° 以內,朝上偏差 5° 以内或朝下偏差 8° 以内。鏡頭在後台會持續自動校準,很少有需要重置的情况。 - Your device is pointed %1° %2 and %3° %4. 你的設備目前朝%2 %1° 以及朝%4 %3° 。 - down - up - left - right - Are you sure you want to reboot? 您確定要重新啟動嗎? - Disengage to Reboot 請先取消控車才能重新啟動 - Are you sure you want to power off? 您確定您要關機嗎? - Disengage to Power Off 請先取消控車才能關機 @@ -261,32 +219,26 @@ DriveStats - Drives 旅程 - Hours 小時 - ALL TIME 總共 - PAST WEEK 上周 - KM 公里 - Miles 英里 @@ -294,7 +246,6 @@ DriverViewScene - camera starting 開啟相機中 @@ -302,12 +253,10 @@ InputDialog - Cancel 取消 - Need at least %n character(s)! 需要至少 %n 個字元! @@ -317,22 +266,18 @@ Installer - Installing... 安裝中… - Receiving objects: 接收對象: - Resolving deltas: 分析差異: - Updating files: 更新檔案: @@ -340,27 +285,22 @@ MapETA - eta 抵達 - min 分鐘 - hr 小時 - km km - mi mi @@ -368,22 +308,18 @@ MapInstructions - km km - m m - mi mi - ft ft @@ -391,48 +327,40 @@ MapPanel - Current Destination 當前目的地 - CLEAR 清除 - Recent Destinations 最近目的地 - Try the Navigation Beta 試用導航功能 - Get turn-by-turn directions displayed and more with a comma prime subscription. Sign up now: https://connect.comma.ai 成為 comma 高級會員來使用導航功能 立即註冊:https://connect.comma.ai - No home location set 未設定 住家位置 - No work location set 未設定 工作位置 - no recent destinations 沒有最近的導航記錄 @@ -440,12 +368,10 @@ location set MapWindow - Map Loading 地圖加載中 - Waiting for GPS 等待 GPS @@ -453,12 +379,10 @@ location set MultiOptionDialog - Select 選擇 - Cancel 取消 @@ -466,23 +390,18 @@ location set Networking - Advanced 進階 - Enter password 輸入密碼 - - for "%1" 給 "%1" - Wrong password 密碼錯誤 @@ -490,30 +409,22 @@ location set NvgWindow - km/h km/h - mph mph - - MAX 最高 - - SPEED 速度 - - LIMIT 速限 @@ -521,17 +432,14 @@ location set OffroadHome - UPDATE 更新 - ALERTS 提醒 - ALERT 提醒 @@ -539,22 +447,18 @@ location set PairingPopup - Pair your device to your comma account 將設備與您的 comma 帳號配對 - Go to https://connect.comma.ai on your phone 用手機連至 https://connect.comma.ai - Click "add new device" and scan the QR code on the right 點選 "add new device" 後掃描右邊的二維碼 - Bookmark connect.comma.ai to your home screen to use it like an app 將 connect.comma.ai 加入您的主屏幕,以便像手機 App 一樣使用它 @@ -562,32 +466,26 @@ location set PrimeAdWidget - Upgrade Now 馬上升級 - Become a comma prime member at connect.comma.ai 成為 connect.comma.ai 的高級會員 - PRIME FEATURES: 高級會員特點: - Remote access 遠程訪問 - 1 year of storage 一年的雲端行車記錄 - Developer perks 開發者福利 @@ -595,22 +493,18 @@ location set PrimeUserWidget - ✓ SUBSCRIBED ✓ 已訂閱 - comma prime comma 高級會員 - CONNECT.COMMA.AI CONNECT.COMMA.AI - COMMA POINTS COMMA 積分 @@ -618,41 +512,34 @@ location set QObject - Reboot 重新啟動 - Exit 離開 - dashcam 行車記錄器 - openpilot openpilot - %n minute(s) ago %n 分鐘前 - %n hour(s) ago %n 小時前 - %n day(s) ago %n 天前 @@ -662,47 +549,38 @@ location set Reset - Reset failed. Reboot to try again. 重置失敗。請重新啟動後再試。 - Are you sure you want to reset your device? 您確定要重置你的設備嗎? - Resetting device... 重置設備中… - System Reset 系統重置 - System reset triggered. Press confirm to erase all content and settings. Press cancel to resume boot. 系統重置已觸發。請按確認刪除所有內容和設置。按取消恢復啟動。 - Cancel 取消 - Reboot 重新啟動 - Confirm 確認 - Unable to mount data partition. Press confirm to reset your device. 無法掛載數據分區。請按確認重置您的設備。 @@ -710,7 +588,6 @@ location set RichTextDialog - Ok 確定 @@ -718,33 +595,26 @@ location set SettingsWindow - × × - Device 設備 - - Network 網路 - Toggles 設定 - Software 軟體 - Navigation 導航 @@ -752,105 +622,82 @@ location set Setup - WARNING: Low Voltage 警告:電壓過低 - Power your device in a car with a harness or proceed at your own risk. 請使用車上 harness 提供的電源,若繼續的話您需要自擔風險。 - Power off 關機 - - - Continue 繼續 - Getting Started 入門 - Before we get on the road, let’s finish installation and cover some details. 在我們上路之前,讓我們完成安裝並介紹一些細節。 - Connect to Wi-Fi 連接到無線網絡 - - Back 回上頁 - Continue without Wi-Fi 在沒有 Wi-Fi 的情況下繼續 - Waiting for internet 連接至網路中 - Choose Software to Install 選擇要安裝的軟體 - Dashcam 行車記錄器 - Custom Software 定制的軟體 - Enter URL 輸入網址 - for Custom Software 定制的軟體 - Downloading... 下載中… - Download Failed 下載失敗 - Ensure the entered URL is valid, and the device’s internet connection is good. 請確定您輸入的是有效的安裝網址,並且確定設備的網路連線狀態良好。 - Reboot device 重新啟動 - Start over 重新開始 @@ -858,17 +705,14 @@ location set SetupWidget - Finish Setup 完成設置 - Pair your device with comma connect (connect.comma.ai) and claim your comma prime offer. 將您的設備與 comma connect (connect.comma.ai) 配對並領取您的 comma 高級會員優惠。 - Pair device 配對設備 @@ -876,106 +720,82 @@ location set Sidebar - - CONNECT 雲端服務 - OFFLINE 已離線 - - ONLINE 已連線 - ERROR 錯誤 - - - TEMP 溫度 - HIGH 偏高 - GOOD 正常 - OK 一般 - VEHICLE 車輛通訊 - NO 未連線 - PANDA 車輛通訊 - GPS GPS - SEARCH 車輛通訊 - -- -- - Wi-Fi - ETH - 2G - 3G - LTE - 5G @@ -983,89 +803,50 @@ location set SoftwarePanel - - Git Branch - Git 分支 + Updates are only downloaded while the car is off. + 系統更新只會在熄火時下載。 - - Git Commit - Git 提交 + Current Version + 當前版本 - - OS Version - 系統版本 + Download + 下載 - - Version - 版本 + Install Update + 安裝更新 - - Last Update Check - 上次檢查時間 + INSTALL + 安裝 - - The last time openpilot successfully checked for an update. The updater only runs while the car is off. - 上次成功檢查更新的時間。更新系統只會在車子熄火時執行。 + Target Branch + 目標分支 - - Check for Update - 檢查更新 + SELECT + 選取 - - CHECKING - 檢查中 + Select a branch + 選取一個分支 - - Switch Branch - 切換分支 - - - - ENTER - 切換 - - - - - The new branch will be pulled the next time the updater runs. - 新的分支將會在下次檢查更新時切換過去。 - - - - Enter branch name - 輸入分支名稱 - - - UNINSTALL 卸載 - Uninstall %1 卸載 %1 - Are you sure you want to uninstall? 您確定您要卸載嗎? - - failed to fetch update - 下載更新失敗 - - - - CHECK 檢查 @@ -1073,48 +854,38 @@ location set SshControl - SSH Keys SSH 密鑰 - Warning: This grants SSH access to all public keys in your GitHub settings. Never enter a GitHub username other than your own. A comma employee will NEVER ask you to add their GitHub username. 警告:這將授權給 GitHub 帳號中所有公鑰 SSH 訪問權限。切勿輸入非您自己的 GitHub 用戶名。comma 員工「永遠不會」要求您添加他們的 GitHub 用戶名。 - - ADD 新增 - Enter your GitHub username 請輸入您 GitHub 的用戶名 - LOADING 載入中 - REMOVE 移除 - Username '%1' has no keys on GitHub GitHub 用戶 '%1' 沒有設定任何密鑰 - Request timed out 請求超時 - Username '%1' doesn't exist on GitHub GitHub 用戶 '%1' 不存在 @@ -1122,7 +893,6 @@ location set SshToggle - Enable SSH 啟用 SSH 服務 @@ -1130,22 +900,18 @@ location set TermsPage - Terms & Conditions 條款和條件 - Decline 拒絕 - Scroll to accept 滑動至頁尾接受條款 - Agree 接受 @@ -1153,92 +919,82 @@ location set TogglesPanel - Enable openpilot 啟用 openpilot - Use the openpilot system for adaptive cruise control and lane keep driver assistance. Your attention is required at all times to use this feature. Changing this setting takes effect when the car is powered off. 使用 openpilot 的主動式巡航和車道保持功能,開啟後您需要持續集中注意力,設定變更在重新啟動車輛後生效。 - Enable Lane Departure Warnings 啟用車道偏離警告 - Receive alerts to steer back into the lane when your vehicle drifts over a detected lane line without a turn signal activated while driving over 31 mph (50 km/h). 車速在時速 50 公里 (31 英里) 以上且未打方向燈的情況下,如果偵測到車輛駛出目前車道線時,發出車道偏離警告。 - Use Metric System 使用公制單位 - Display speed in km/h instead of mph. 啟用後,速度單位顯示將從 mp/h 改為 km/h。 - Record and Upload Driver Camera 記錄並上傳駕駛監控影像 - Upload data from the driver facing camera and help improve the driver monitoring algorithm. 上傳駕駛監控的錄像來協助我們提升駕駛監控的準確率。 - 🌮 End-to-end longitudinal (extremely alpha) 🌮 - + 🌮 端對端縱向控制(實驗性功能) 🌮 - Experimental openpilot longitudinal control - + 使用 openpilot 縱向控制(實驗) - <b>WARNING: openpilot longitudinal control is experimental for this car and will disable AEB.</b> - + <b>注意:這台車的 openpilot 縱向控制仍然是實驗中的功能,開啟這功能將會關閉自動緊急煞車 (AEB)。</b> - Let the driving model control the gas and brakes. openpilot will drive as it thinks a human would. Super experimental. - + 讓駕駛模型直接控製油門和剎車,openpilot將會模仿人類司機的駕駛方式。該功能仍非常實驗性。 + + + openpilot longitudinal control is not currently available for this car. + openpilot 縱向控制目前不適用於這輛車。 + + + Enable experimental longitudinal control to enable this. + 打開縱向控制(實驗)以啟用此功能。 - Disengage On Accelerator Pedal 油門取消控車 - When enabled, pressing the accelerator pedal will disengage openpilot. 啟用後,踩踏油門將會取消 openpilot 控制。 - Show ETA in 24h Format 預計到達時間單位改用 24 小時制 - Use 24h format instead of am/pm 使用 24 小時制。(預設值為 12 小時制) - Show Map on Left Side of UI 將地圖顯示在畫面的左側 - Show map on left side when in split screen view. 進入分割畫面後,地圖將會顯示在畫面的左側。 @@ -1246,42 +1002,34 @@ location set Updater - Update Required 系統更新 - An operating system update is required. Connect your device to Wi-Fi for the fastest update experience. The download size is approximately 1GB. 設備的操作系統需要更新。請將您的設備連接到 Wi-Fi 以獲得最快的更新體驗。下載大小約為 1GB。 - Connect to Wi-Fi 連接到無線網絡 - Install 安裝 - Back 回上頁 - Loading... 載入中… - Reboot 重新啟動 - Update failed 更新失敗 @@ -1289,23 +1037,18 @@ location set WifiUI - - Scanning for networks... 掃描無線網路中... - CONNECTING... 連線中... - FORGET 清除 - Forget Wi-Fi Network "%1"? 清除 Wi-Fi 網路 "%1"? diff --git a/selfdrive/ui/update_translations.py b/selfdrive/ui/update_translations.py new file mode 100755 index 000000000..b4b0543eb --- /dev/null +++ b/selfdrive/ui/update_translations.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +import argparse +import json +import os +try: + from common.basedir import BASEDIR + + UI_DIR = os.path.join(BASEDIR, "selfdrive", "ui") +except ModuleNotFoundError: + UI_DIR = os.path.join("", "selfdrive", "ui") + +TRANSLATIONS_DIR = os.path.join(UI_DIR, "translations") +LANGUAGES_FILE = os.path.join(TRANSLATIONS_DIR, "languages.json") + + +def update_translations(vanish=False, plural_only=None, translations_dir=TRANSLATIONS_DIR): + if plural_only is None: + plural_only = [] + + with open(LANGUAGES_FILE, "r") as f: + translation_files = json.load(f) + + for file in translation_files.values(): + tr_file = os.path.join(translations_dir, f"{file}.ts") + args = f"lupdate -locations none -recursive {UI_DIR} -ts {tr_file}" + if vanish: + args += " -no-obsolete" + if file in plural_only: + args += " -pluralonly" + ret = os.system(args) + assert ret == 0 + + ret = os.system(f"lrelease {tr_file}") + assert ret == 0 + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Update translation files for UI", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument("--vanish", action="store_true", help="Remove translations with source text no longer found") + parser.add_argument("--plural-only", type=str, nargs="*", default=["main_en"], help="Translation codes to only create plural translations for (ie. the base language)") + args = parser.parse_args() + + update_translations(args.vanish, args.plural_only) diff --git a/selfdrive/updated.py b/selfdrive/updated.py index 8658cb257..bf4d75e64 100755 --- a/selfdrive/updated.py +++ b/selfdrive/updated.py @@ -1,28 +1,6 @@ #!/usr/bin/env python3 - -# Safe Update: A simple service that waits for network access and tries to -# update every 10 minutes. It's intended to make the OP update process more -# robust against Git repository corruption. This service DOES NOT try to fix -# an already-corrupt BASEDIR Git repo, only prevent it from happening. -# -# During normal operation, both onroad and offroad, the update process makes -# no changes to the BASEDIR install of OP. All update attempts are performed -# in a disposable staging area provided by OverlayFS. It assumes the deleter -# process provides enough disk space to carry out the process. -# -# If an update succeeds, a flag is set, and the update is swapped in at the -# next reboot. If an update is interrupted or otherwise fails, the OverlayFS -# upper layer and metadata can be discarded before trying again. -# -# The swap on boot is triggered by launch_chffrplus.sh -# gated on the existence of $FINALIZED/.overlay_consistent and also the -# existence and mtime of $BASEDIR/.overlay_init. -# -# Other than build byproducts, BASEDIR should not be modified while this -# service is running. Developers modifying code directly in BASEDIR should -# disable this service. - import os +import re import datetime import subprocess import psutil @@ -31,8 +9,9 @@ import signal import fcntl import time import threading +from collections import defaultdict from pathlib import Path -from typing import List, Tuple, Optional +from typing import List, Union, Optional from markdown_it import MarkdownIt from common.basedir import BASEDIR @@ -52,42 +31,33 @@ OVERLAY_METADATA = os.path.join(STAGING_ROOT, "metadata") OVERLAY_MERGED = os.path.join(STAGING_ROOT, "merged") FINALIZED = os.path.join(STAGING_ROOT, "finalized") +OVERLAY_INIT = Path(os.path.join(BASEDIR, ".overlay_init")) + DAYS_NO_CONNECTIVITY_MAX = 14 # do not allow to engage after this many days DAYS_NO_CONNECTIVITY_PROMPT = 10 # send an offroad prompt after this many days class WaitTimeHelper: - def __init__(self, proc): - self.proc = proc + def __init__(self): self.ready_event = threading.Event() - self.shutdown = False - signal.signal(signal.SIGTERM, self.graceful_shutdown) - signal.signal(signal.SIGINT, self.graceful_shutdown) + self.only_check_for_update = False signal.signal(signal.SIGHUP, self.update_now) - - def graceful_shutdown(self, signum: int, frame) -> None: - # umount -f doesn't appear effective in avoiding "device busy" on NEOS, - # so don't actually die until the next convenient opportunity in main(). - cloudlog.info("caught SIGINT/SIGTERM, dismounting overlay at next opportunity") - - # forward the signal to all our child processes - child_procs = self.proc.children(recursive=True) - for p in child_procs: - p.send_signal(signum) - - self.shutdown = True - self.ready_event.set() + signal.signal(signal.SIGUSR1, self.check_now) def update_now(self, signum: int, frame) -> None: - cloudlog.info("caught SIGHUP, running update check immediately") + cloudlog.info("caught SIGHUP, attempting to downloading update") + self.only_check_for_update = False + self.ready_event.set() + + def check_now(self, signum: int, frame) -> None: + cloudlog.info("caught SIGUSR1, checking for updates") + self.only_check_for_update = True self.ready_event.set() def sleep(self, t: float) -> None: self.ready_event.wait(timeout=t) -def run(cmd: List[str], cwd: Optional[str] = None, low_priority: bool = False): - if low_priority: - cmd = ["nice", "-n", "19"] + cmd +def run(cmd: List[str], cwd: Optional[str] = None) -> str: return subprocess.check_output(cmd, cwd=cwd, stderr=subprocess.STDOUT, encoding='utf8') @@ -100,59 +70,19 @@ def set_consistent_flag(consistent: bool) -> None: consistent_file.unlink(missing_ok=True) os.sync() - -def set_params(new_version: bool, failed_count: int, exception: Optional[str]) -> None: - params = Params() - - params.put("UpdateFailedCount", str(failed_count)) - - last_update = datetime.datetime.utcnow() - if failed_count == 0: - t = last_update.isoformat() - params.put("LastUpdateTime", t.encode('utf8')) - else: +def parse_release_notes(basedir: str) -> bytes: + try: + with open(os.path.join(basedir, "CHANGELOGS.md"), "rb") as f: + r = f.read().split(b'\n\n', 1)[0] # Slice latest release notes try: - t = params.get("LastUpdateTime", encoding='utf8') - last_update = datetime.datetime.fromisoformat(t) - except (TypeError, ValueError): - pass - - if exception is None: - params.remove("LastUpdateException") - else: - params.put("LastUpdateException", exception) - - # Write out release notes for new versions - if new_version: - try: - with open(os.path.join(FINALIZED, "CHANGELOGS.md"), "rb") as f: - r = f.read().split(b'\n\n', 1)[0] # Slice latest release notes - try: - params.put("ReleaseNotes", MarkdownIt().render(r.decode("utf-8"))) - except Exception: - params.put("ReleaseNotes", r + b"\n") + return bytes(MarkdownIt().render(r.decode("utf-8")), encoding="utf-8") except Exception: - params.put("ReleaseNotes", "") - params.put_bool("UpdateAvailable", True) - - # Handle user prompt - for alert in ("Offroad_UpdateFailed", "Offroad_ConnectivityNeeded", "Offroad_ConnectivityNeededPrompt"): - set_offroad_alert(alert, False) - - now = datetime.datetime.utcnow() - dt = now - last_update - if failed_count > 15 and exception is not None: - if is_tested_branch(): - extra_text = "Ensure the software is correctly installed" - else: - extra_text = exception - set_offroad_alert("Offroad_UpdateFailed", True, extra_text=extra_text) - elif dt.days > DAYS_NO_CONNECTIVITY_MAX and failed_count > 1: - set_offroad_alert("Offroad_ConnectivityNeeded", True) - elif dt.days > DAYS_NO_CONNECTIVITY_PROMPT: - remaining = max(DAYS_NO_CONNECTIVITY_MAX - dt.days, 1) - set_offroad_alert("Offroad_ConnectivityNeededPrompt", True, extra_text=f"{remaining} day{'' if remaining == 1 else 's'}.") - + return r + b"\n" + except FileNotFoundError: + pass + except Exception: + cloudlog.exception("failed to parse release notes") + return b"" def setup_git_options(cwd: str) -> None: # We sync FS object atimes (which NEOS doesn't use) and mtimes, but ctimes @@ -188,12 +118,10 @@ def dismount_overlay() -> None: def init_overlay() -> None: - overlay_init_file = Path(os.path.join(BASEDIR, ".overlay_init")) - # Re-create the overlay if BASEDIR/.git has changed since we created the overlay - if overlay_init_file.is_file(): + if OVERLAY_INIT.is_file() and os.path.ismount(OVERLAY_MERGED): git_dir_path = os.path.join(BASEDIR, ".git") - new_files = run(["find", git_dir_path, "-newer", str(overlay_init_file)]) + new_files = run(["find", git_dir_path, "-newer", str(OVERLAY_INIT)]) if not len(new_files.splitlines()): # A valid overlay already exists return @@ -225,7 +153,7 @@ def init_overlay() -> None: consistent_file = Path(os.path.join(BASEDIR, ".overlay_consistent")) if consistent_file.is_file(): consistent_file.unlink() - overlay_init_file.touch() + OVERLAY_INIT.touch() os.sync() overlay_opts = f"lowerdir={BASEDIR},upperdir={OVERLAY_UPPER},workdir={OVERLAY_METADATA}" @@ -237,12 +165,12 @@ def init_overlay() -> None: else: run(mount_cmd) - #git_diff = run(["git", "diff"], OVERLAY_MERGED, low_priority=True) - #params.put("GitDiff", git_diff) - #cloudlog.info(f"git diff output:\n{git_diff}") + # git_diff = run(["git", "diff"], OVERLAY_MERGED) + # params.put("GitDiff", git_diff) + # cloudlog.info(f"git diff output:\n{git_diff}") -def finalize_update(wait_helper: WaitTimeHelper) -> None: +def finalize_update() -> None: """Take the current OverlayFS merged view and finalize a copy outside of OverlayFS, ready to be swapped-in at BASEDIR. Copy using shutil.copytree""" @@ -258,22 +186,20 @@ def finalize_update(wait_helper: WaitTimeHelper) -> None: run(["git", "reset", "--hard"], FINALIZED) run(["git", "submodule", "foreach", "--recursive", "git", "reset"], FINALIZED) - cloudlog.info("Starting git gc") + cloudlog.info("Starting git cleanup in finalized update") t = time.monotonic() try: run(["git", "gc"], FINALIZED) - cloudlog.event("Done git gc", duration=time.monotonic() - t) + run(["git", "lfs", "prune"], FINALIZED) + cloudlog.event("Done git cleanup", duration=time.monotonic() - t) except subprocess.CalledProcessError: - cloudlog.exception(f"Failed git gc, took {time.monotonic() - t:.3f} s") + cloudlog.exception(f"Failed git cleanup, took {time.monotonic() - t:.3f} s") - if wait_helper.shutdown: - cloudlog.info("got interrupted finalizing overlay") - else: - set_consistent_flag(True) - cloudlog.info("done finalizing overlay") + set_consistent_flag(True) + cloudlog.info("done finalizing overlay") -def handle_agnos_update(wait_helper: WaitTimeHelper) -> None: +def handle_agnos_update() -> None: from system.hardware.tici.agnos import flash_agnos_update, get_target_slot_number cur_version = HARDWARE.get_os_version() @@ -310,89 +236,177 @@ def handle_neos_update(wait_helper: WaitTimeHelper) -> None: cloudlog.info(f"Beginning background download for NEOS {updated_neos}") set_offroad_alert("Offroad_NeosUpdate", True) - update_manifest = os.path.join(OVERLAY_MERGED, "system/hardware/eon/neos.json") - - neos_downloaded = False - start_time = time.monotonic() - # Try to download for one day - while not neos_downloaded and not wait_helper.shutdown and \ - (time.monotonic() - start_time < 60*60*24): - wait_helper.ready_event.clear() - try: - download_neos_update(update_manifest, cloudlog) - neos_downloaded = True - except Exception: - cloudlog.info("NEOS background download failed, retrying") - wait_helper.sleep(120) - - # If the download failed, we'll show the alert again when we retry + manifest_path = os.path.join(OVERLAY_MERGED, "system/hardware/eon/neos.json") + download_neos_update(manifest_path, cloudlog) set_offroad_alert("Offroad_NeosUpdate", False) - if not neos_downloaded: - raise Exception("Failed to download NEOS update") - cloudlog.info(f"NEOS background download successful, took {time.monotonic() - start_time} seconds") +class Updater: + def __init__(self): + self.params = Params() + self.branches = defaultdict(lambda: '') + self._has_internet: bool = False -def check_git_fetch_result(fetch_txt: str) -> bool: - err_msg = "Failed to add the host to the list of known hosts (/data/data/com.termux/files/home/.ssh/known_hosts).\n" - return len(fetch_txt) > 0 and (fetch_txt != err_msg) + @property + def has_internet(self) -> bool: + return self._has_internet + @property + def target_branch(self) -> str: + b: Union[str, None] = self.params.get("UpdaterTargetBranch", encoding='utf-8') + if b is None: + b = self.get_branch(BASEDIR) + self.params.put("UpdaterTargetBranch", b) + return b -def check_for_update() -> Tuple[bool, bool]: - setup_git_options(OVERLAY_MERGED) - try: - git_fetch_output = run(["git", "fetch", "--dry-run"], OVERLAY_MERGED, low_priority=True) - return True, check_git_fetch_result(git_fetch_output) - except subprocess.CalledProcessError: - return False, False + @property + def update_ready(self) -> bool: + consistent_file = Path(os.path.join(FINALIZED, ".overlay_consistent")) + if consistent_file.is_file(): + hash_mismatch = self.get_commit_hash(BASEDIR) != self.branches[self.target_branch] + branch_mismatch = self.get_branch(BASEDIR) != self.target_branch + on_target_branch = self.get_branch(FINALIZED) == self.target_branch + return ((hash_mismatch or branch_mismatch) and on_target_branch) + return False + @property + def update_available(self) -> bool: + if os.path.isdir(OVERLAY_MERGED): + hash_mismatch = self.get_commit_hash(OVERLAY_MERGED) != self.branches[self.target_branch] + branch_mismatch = self.get_branch(OVERLAY_MERGED) != self.target_branch + return hash_mismatch or branch_mismatch + return False -def fetch_update(wait_helper: WaitTimeHelper) -> bool: - cloudlog.info("attempting git fetch inside staging overlay") + def get_branch(self, path: str) -> str: + return run(["git", "rev-parse", "--abbrev-ref", "HEAD"], path).rstrip() - setup_git_options(OVERLAY_MERGED) + def get_commit_hash(self, path: str = OVERLAY_MERGED) -> str: + return run(["git", "rev-parse", "HEAD"], path).rstrip() - git_fetch_output = run(["git", "fetch"], OVERLAY_MERGED, low_priority=True) - cloudlog.info("git fetch success: %s", git_fetch_output) + def set_params(self, failed_count: int, exception: Optional[str]) -> None: + self.params.put("UpdateFailedCount", str(failed_count)) - cur_hash = run(["git", "rev-parse", "HEAD"], OVERLAY_MERGED).rstrip() - upstream_hash = run(["git", "rev-parse", "@{u}"], OVERLAY_MERGED).rstrip() - new_version: bool = cur_hash != upstream_hash - git_fetch_result = check_git_fetch_result(git_fetch_output) + self.params.put_bool("UpdaterFetchAvailable", self.update_available) + self.params.put("UpdaterAvailableBranches", ','.join(self.branches.keys())) - new_branch = Params().get("SwitchToBranch", encoding='utf8') - if new_branch is not None: - new_version = True + last_update = datetime.datetime.utcnow() + if failed_count == 0: + t = last_update.isoformat() + self.params.put("LastUpdateTime", t.encode('utf8')) + else: + try: + t = self.params.get("LastUpdateTime", encoding='utf8') + last_update = datetime.datetime.fromisoformat(t) + except (TypeError, ValueError): + pass - cloudlog.info(f"comparing {cur_hash} to {upstream_hash}") - if new_version or git_fetch_result: - cloudlog.info("Running update") + if exception is None: + self.params.remove("LastUpdateException") + else: + self.params.put("LastUpdateException", exception) - if new_version: - cloudlog.info("git reset in progress") - cmds = [ - ["git", "reset", "--hard", "@{u}"], - ["git", "clean", "-xdf"], - ["git", "submodule", "init"], - ["git", "submodule", "update"], - ] - if new_branch is not None: - cloudlog.info(f"switching to branch {repr(new_branch)}") - cmds.insert(0, ["git", "checkout", "-f", new_branch]) - r = [run(cmd, OVERLAY_MERGED, low_priority=True) for cmd in cmds] - cloudlog.info("git reset success: %s", '\n'.join(r)) + # Write out current and new version info + def get_description(basedir: str) -> str: + version = "" + branch = "" + commit = "" + try: + branch = self.get_branch(basedir) + commit = self.get_commit_hash(basedir) + with open(os.path.join(basedir, "common", "version.h")) as f: + version = f.read().split('"')[1] + except Exception: + pass + return f"{version} / {branch} / {commit[:7]}" + self.params.put("UpdaterCurrentDescription", get_description(BASEDIR)) + self.params.put("UpdaterCurrentReleaseNotes", parse_release_notes(BASEDIR)) + self.params.put("UpdaterNewDescription", get_description(FINALIZED)) + self.params.put("UpdaterNewReleaseNotes", parse_release_notes(FINALIZED)) + self.params.put_bool("UpdateAvailable", self.update_ready) - if EON and not os.path.isfile("/ONEPLUS"): - handle_neos_update(wait_helper) - elif AGNOS: - handle_agnos_update(wait_helper) + # Handle user prompt + for alert in ("Offroad_UpdateFailed", "Offroad_ConnectivityNeeded", "Offroad_ConnectivityNeededPrompt"): + set_offroad_alert(alert, False) + + now = datetime.datetime.utcnow() + dt = now - last_update + if failed_count > 15 and exception is not None and self.has_internet: + if is_tested_branch(): + extra_text = "Ensure the software is correctly installed. Uninstall and re-install if this error persists." + else: + extra_text = exception + set_offroad_alert("Offroad_UpdateFailed", True, extra_text=extra_text) + elif dt.days > DAYS_NO_CONNECTIVITY_MAX and failed_count > 1: + set_offroad_alert("Offroad_ConnectivityNeeded", True) + elif dt.days > DAYS_NO_CONNECTIVITY_PROMPT: + remaining = max(DAYS_NO_CONNECTIVITY_MAX - dt.days, 1) + set_offroad_alert("Offroad_ConnectivityNeededPrompt", True, extra_text=f"{remaining} day{'' if remaining == 1 else 's'}.") + + def check_for_update(self) -> None: + cloudlog.info("checking for updates") + + excluded_branches = ('release2', 'dashcam', 'dashcam-staging') + + try: + run(["git", "ls-remote", "origin", "HEAD"], OVERLAY_MERGED) + self._has_internet = True + except subprocess.CalledProcessError: + self._has_internet = False + + setup_git_options(OVERLAY_MERGED) + output = run(["git", "ls-remote", "--heads", "origin"], OVERLAY_MERGED) + + self.branches = defaultdict(lambda: None) + for line in output.split('\n'): + ls_remotes_re = r'(?P\b[0-9a-f]{5,40}\b)(\s+)(refs\/heads\/)(?P.*$)' + x = re.fullmatch(ls_remotes_re, line.strip()) + if x is not None and x.group('branch_name') not in excluded_branches: + self.branches[x.group('branch_name')] = x.group('commit_sha') + + cur_branch = self.get_branch(OVERLAY_MERGED) + cur_commit = self.get_commit_hash(OVERLAY_MERGED) + new_branch = self.target_branch + new_commit = self.branches[new_branch] + if (cur_branch, cur_commit) != (new_branch, new_commit): + cloudlog.info(f"update available, {cur_branch} ({str(cur_commit)[:7]}) -> {new_branch} ({str(new_commit)[:7]})") + else: + cloudlog.info(f"up to date on {cur_branch} ({str(cur_commit)[:7]})") + + def fetch_update(self) -> None: + cloudlog.info("attempting git fetch inside staging overlay") + + self.params.put("UpdaterState", "downloading...") + + # TODO: cleanly interrupt this and invalidate old update + set_consistent_flag(False) + self.params.put_bool("UpdateAvailable", False) + + setup_git_options(OVERLAY_MERGED) + + branch = self.target_branch + git_fetch_output = run(["git", "fetch", "origin", branch], OVERLAY_MERGED) + cloudlog.info("git fetch success: %s", git_fetch_output) + + cloudlog.info("git reset in progress") + cmds = [ + ["git", "checkout", "--force", "--no-recurse-submodules", "-B", branch, "FETCH_HEAD"], + ["git", "branch", "--set-upstream-to", f"origin/{branch}"], + ["git", "reset", "--hard"], + ["git", "clean", "-xdff"], + ["git", "submodule", "init"], + ["git", "submodule", "update"], + ] + r = [run(cmd, OVERLAY_MERGED) for cmd in cmds] + cloudlog.info("git reset success: %s", '\n'.join(r)) + + if EON and not os.path.isfile("/ONEPLUS"): + handle_neos_update() + elif AGNOS: + handle_agnos_update() # Create the finalized, ready-to-swap update - finalize_update(wait_helper) - cloudlog.info("openpilot update successful!") - else: - cloudlog.info("nothing new from git at this time") - - return new_version + self.params.put("UpdaterState", "finalizing update...") + finalize_update() + cloudlog.info("finalize success!") def main() -> None: @@ -421,33 +435,37 @@ def main() -> None: t = datetime.datetime.utcnow().isoformat() params.put("InstallDate", t.encode('utf8')) - overlay_init = Path(os.path.join(BASEDIR, ".overlay_init")) - overlay_init.unlink(missing_ok=True) - + updater = Updater() update_failed_count = 0 # TODO: Load from param? - wait_helper = WaitTimeHelper(proc) + + # no fetch on the first time + wait_helper = WaitTimeHelper() + wait_helper.only_check_for_update = True # Run the update loop - while not wait_helper.shutdown: + while True: wait_helper.ready_event.clear() # Attempt an update exception = None - new_version = False - update_failed_count += 1 try: + # TODO: reuse overlay from previous updated instance if it looks clean init_overlay() - # TODO: still needed? skip this and just fetch? - # Lightweight internt check - internet_ok, update_available = check_for_update() - if internet_ok and not update_available: - update_failed_count = 0 + # ensure we have some params written soon after startup + updater.set_params(update_failed_count, exception) + update_failed_count += 1 - # Fetch update - if internet_ok: - new_version = fetch_update(wait_helper) - update_failed_count = 0 + # check for update + params.put("UpdaterState", "checking...") + updater.check_for_update() + + # download update + if wait_helper.only_check_for_update: + cloudlog.info("skipping fetch this cycle") + else: + updater.fetch_update() + update_failed_count = 0 except subprocess.CalledProcessError as e: cloudlog.event( "update process failed", @@ -456,22 +474,21 @@ def main() -> None: returncode=e.returncode ) exception = f"command failed: {e.cmd}\n{e.output}" - overlay_init.unlink(missing_ok=True) + OVERLAY_INIT.unlink(missing_ok=True) except Exception as e: cloudlog.exception("uncaught updated exception, shouldn't happen") exception = str(e) - overlay_init.unlink(missing_ok=True) + OVERLAY_INIT.unlink(missing_ok=True) - if not wait_helper.shutdown: - try: - set_params(new_version, update_failed_count, exception) - except Exception: - cloudlog.exception("uncaught updated exception while setting params, shouldn't happen") + try: + params.put("UpdaterState", "idle") + updater.set_params(update_failed_count, exception) + except Exception: + cloudlog.exception("uncaught updated exception while setting params, shouldn't happen") # infrequent attempts if we successfully updated recently - wait_helper.sleep(5*60 if update_failed_count > 0 else 90*60) - - dismount_overlay() + wait_helper.only_check_for_update = False + wait_helper.sleep(5*60 if update_failed_count > 0 else 1.5*60*60) if __name__ == "__main__": diff --git a/system/camerad/camerad b/system/camerad/camerad index ad87df9e4..168a599c1 100755 Binary files a/system/camerad/camerad and b/system/camerad/camerad differ diff --git a/system/camerad/cameras/camera_common.h b/system/camerad/cameras/camera_common.h index 1a0f6cc0e..95f96561d 100644 --- a/system/camerad/cameras/camera_common.h +++ b/system/camerad/cameras/camera_common.h @@ -25,9 +25,8 @@ #define CAMERA_ID_LGC920 6 #define CAMERA_ID_LGC615 7 #define CAMERA_ID_AR0231 8 -#define CAMERA_ID_IMX390 9 -#define CAMERA_ID_IMX477 10 -#define CAMERA_ID_MAX 11 +#define CAMERA_ID_OX03C10 9 +#define CAMERA_ID_MAX 10 const int UI_BUF_COUNT = 4; const int YUV_BUFFER_COUNT = Hardware::EON() ? 100 : 40; @@ -49,7 +48,6 @@ const bool env_disable_wide_road = getenv("DISABLE_WIDE_ROAD") != NULL; const bool env_disable_driver = getenv("DISABLE_DRIVER") != NULL; const bool env_debug_frames = getenv("DEBUG_FRAMES") != NULL; const bool env_log_raw_frames = getenv("LOG_RAW_FRAMES") != NULL; -const bool env_ctrl_exp_from_params = getenv("CTRL_EXP_FROM_PARAMS") != NULL; typedef void (*release_cb)(void *cookie, int buf_idx); @@ -94,7 +92,7 @@ typedef struct CameraExpInfo { } CameraExpInfo; struct MultiCameraState; -struct CameraState; +class CameraState; class Debayer; class CameraBuf { @@ -103,13 +101,9 @@ private: CameraState *camera_state; Debayer *debayer = nullptr; std::unique_ptr rgb2yuv; - VisionStreamType rgb_type, yuv_type; - int cur_buf_idx; - SafeQueue safe_queue; - int frame_buf_count; release_cb release_callback; @@ -135,7 +129,7 @@ public: typedef void (*process_thread_cb)(MultiCameraState *s, CameraState *c, int cnt); -void fill_frame_data(cereal::FrameData::Builder &framed, const FrameMetadata &frame_data); +void fill_frame_data(cereal::FrameData::Builder &framed, const FrameMetadata &frame_data, CameraState *c); kj::Array get_frame_image(const CameraBuf *b); kj::Array get_raw_frame_image(const CameraBuf *b); float set_exposure_target(const CameraBuf *b, int x_start, int x_end, int x_skip, int y_start, int y_end, int y_skip); diff --git a/system/camerad/cameras/sensor2_i2c.h b/system/camerad/cameras/sensor2_i2c.h index 284347623..ab51059d9 100644 --- a/system/camerad/cameras/sensor2_i2c.h +++ b/system/camerad/cameras/sensor2_i2c.h @@ -1,48 +1,754 @@ struct i2c_random_wr_payload start_reg_array_ar0231[] = {{0x301A, 0x91C}}; struct i2c_random_wr_payload stop_reg_array_ar0231[] = {{0x301A, 0x918}}; -struct i2c_random_wr_payload start_reg_array_imx390[] = {{0x0, 0}}; -struct i2c_random_wr_payload stop_reg_array_imx390[] = {{0x0, 1}}; +struct i2c_random_wr_payload start_reg_array_ox03c10[] = {{0x100, 1}}; +struct i2c_random_wr_payload stop_reg_array_ox03c10[] = {{0x100, 0}}; -struct i2c_random_wr_payload init_array_imx390[] = { - {0x2008, 0xd0}, {0x2009, 0x07}, {0x200a, 0x00}, // MODE_VMAX = time between frames - {0x200C, 0xe4}, {0x200D, 0x0c}, // MODE_HMAX +struct i2c_random_wr_payload init_array_ox03c10[] = { + {0x103, 1}, + {0x107, 1}, - // crop - {0x3410, 0x88}, {0x3411, 0x7}, // CROP_H_SIZE - {0x3418, 0xb8}, {0x3419, 0x4}, // CROP_V_SIZE - {0x0078, 1}, {0x03c0, 1}, + // X3C_1920x1280_60fps_HDR4_LFR_PWL12_mipi1200 - // external trigger (off) - // while images still come in, they are blank with this - {0x3650, 0}, // CU_MODE + // TPM + {0x4d5a, 0x1a}, {0x4d09, 0xff}, {0x4d09, 0xdf}, - // exposure - {0x000c, 0xc0}, {0x000d, 0x07}, - {0x0010, 0xc0}, {0x0011, 0x07}, + /*) + // group 4 + {0x3208, 0x04}, + {0x4620, 0x04}, + {0x3208, 0x14}, - // WUXGA mode - // not in datasheet, from https://github.com/bogsen/STLinux-Kernel/blob/master/drivers/media/platform/tegra/imx185.c - {0x0086, 0xc4}, {0x0087, 0xff}, // WND_SHIFT_V = -60 - {0x03c6, 0xc4}, {0x03c7, 0xff}, // SM_WND_SHIFT_V_APL = -60 + // group 5 + {0x3208, 0x05}, + {0x4620, 0x04}, + {0x3208, 0x15}, - {0x201c, 0xe1}, {0x201d, 0x12}, // image read amount - {0x21ee, 0xc4}, {0x21ef, 0x04}, // image send amount (1220 is the end) - {0x21f0, 0xc4}, {0x21f1, 0x04}, // image processing amount + // group 2 + {0x3208, 0x02}, + {0x3507, 0x00}, + {0x3208, 0x12}, - // disable a bunch of errors causing blanking - {0x0390, 0x00}, {0x0391, 0x00}, {0x0392, 0x00}, + // delay launch group 2 + {0x3208, 0xa2},*/ - // flip bayer - {0x2D64, 0x64 + 2}, + // PLL setup + {0x0301, 0xc8}, // pll1_divs, pll1_predivp, pll1_divpix + {0x0303, 0x01}, // pll1_prediv + {0x0304, 0x01}, {0x0305, 0x2c}, // pll1_loopdiv = 300 + {0x0306, 0x04}, // pll1_divmipi = 4 + {0x0307, 0x01}, // pll1_divm = 1 + {0x0316, 0x00}, + {0x0317, 0x00}, + {0x0318, 0x00}, + {0x0323, 0x05}, // pll2_prediv + {0x0324, 0x01}, {0x0325, 0x2c}, // pll2_divp = 300 - // color correction - {0x0030, 0xf8}, {0x0031, 0x00}, // red gain - {0x0032, 0x9a}, {0x0033, 0x00}, // gr gain - {0x0034, 0x9a}, {0x0035, 0x00}, // gb gain - {0x0036, 0x22}, {0x0037, 0x01}, // blue gain + // SCLK/PCLK + {0x0400, 0xe0}, {0x0401, 0x80}, + {0x0403, 0xde}, {0x0404, 0x34}, + {0x0405, 0x3b}, {0x0406, 0xde}, + {0x0407, 0x08}, + {0x0408, 0xe0}, {0x0409, 0x7f}, + {0x040a, 0xde}, {0x040b, 0x34}, + {0x040c, 0x47}, {0x040d, 0xd8}, + {0x040e, 0x08}, - // hdr enable (noise with this on for now) - {0x00f9, 0} + // xchk + {0x2803, 0xfe}, {0x280b, 0x00}, {0x280c, 0x79}, + + // SC ctrl + {0x3001, 0x03}, // io_pad_oen + {0x3002, 0xf8}, // io_pad_oen + {0x3005, 0x80}, // io_pad_out + {0x3007, 0x01}, // io_pad_sel + {0x3008, 0x80}, // io_pad_sel + + // FSIN first frame + /* + {0x3009, 0x2}, + {0x3015, 0x2}, + {0x3822, 0x20}, + {0x3823, 0x58}, + + {0x3826, 0x0}, {0x3827, 0x8}, + {0x3881, 0x4}, + + {0x3882, 0x8}, {0x3883, 0x0D}, + {0x3836, 0x1F}, {0x3837, 0x40}, + */ + + // FSIN with external pulses + {0x3009, 0x2}, + {0x3015, 0x2}, + {0x383E, 0x80}, + {0x3881, 0x4}, + {0x3882, 0x8}, {0x3883, 0x0D}, + {0x3836, 0x1F}, {0x3837, 0x40}, + + {0x3012, 0x41}, // SC_PHY_CTRL = 4 lane MIPI + {0x3020, 0x05}, // SC_CTRL_20 + + // this is not in the datasheet, listed as RSVD + // but the camera doesn't work without it + {0x3700, 0x28}, {0x3701, 0x15}, {0x3702, 0x19}, {0x3703, 0x23}, + {0x3704, 0x0a}, {0x3705, 0x00}, {0x3706, 0x3e}, {0x3707, 0x0d}, + {0x3708, 0x50}, {0x3709, 0x5a}, {0x370a, 0x00}, {0x370b, 0x96}, + {0x3711, 0x11}, {0x3712, 0x13}, {0x3717, 0x02}, {0x3718, 0x73}, + {0x372c, 0x40}, {0x3733, 0x01}, {0x3738, 0x36}, {0x3739, 0x36}, + {0x373a, 0x25}, {0x373b, 0x25}, {0x373f, 0x21}, {0x3740, 0x21}, + {0x3741, 0x21}, {0x3742, 0x21}, {0x3747, 0x28}, {0x3748, 0x28}, + {0x3749, 0x19}, {0x3755, 0x1a}, {0x3756, 0x0a}, {0x3757, 0x1c}, + {0x3765, 0x19}, {0x3766, 0x05}, {0x3767, 0x05}, {0x3768, 0x13}, + {0x376c, 0x07}, {0x3778, 0x20}, {0x377c, 0xc8}, {0x3781, 0x02}, + {0x3783, 0x02}, {0x379c, 0x58}, {0x379e, 0x00}, {0x379f, 0x00}, + {0x37a0, 0x00}, {0x37bc, 0x22}, {0x37c0, 0x01}, {0x37c4, 0x3e}, + {0x37c5, 0x3e}, {0x37c6, 0x2a}, {0x37c7, 0x28}, {0x37c8, 0x02}, + {0x37c9, 0x12}, {0x37cb, 0x29}, {0x37cd, 0x29}, {0x37d2, 0x00}, + {0x37d3, 0x73}, {0x37d6, 0x00}, {0x37d7, 0x6b}, {0x37dc, 0x00}, + {0x37df, 0x54}, {0x37e2, 0x00}, {0x37e3, 0x00}, {0x37f8, 0x00}, + {0x37f9, 0x01}, {0x37fa, 0x00}, {0x37fb, 0x19}, + + // also RSVD + {0x3c03, 0x01}, {0x3c04, 0x01}, {0x3c06, 0x21}, {0x3c08, 0x01}, + {0x3c09, 0x01}, {0x3c0a, 0x01}, {0x3c0b, 0x21}, {0x3c13, 0x21}, + {0x3c14, 0x82}, {0x3c16, 0x13}, {0x3c21, 0x00}, {0x3c22, 0xf3}, + {0x3c37, 0x12}, {0x3c38, 0x31}, {0x3c3c, 0x00}, {0x3c3d, 0x03}, + {0x3c44, 0x16}, {0x3c5c, 0x8a}, {0x3c5f, 0x03}, {0x3c61, 0x80}, + {0x3c6f, 0x2b}, {0x3c70, 0x5f}, {0x3c71, 0x2c}, {0x3c72, 0x2c}, + {0x3c73, 0x2c}, {0x3c76, 0x12}, + + // PEC checks + {0x3182, 0x12}, + + {0x320e, 0x00}, {0x320f, 0x00}, // RSVD + {0x3211, 0x61}, + {0x3215, 0xcd}, + {0x3219, 0x08}, + + {0x3506, 0x20}, {0x3507, 0x00}, // hcg fine exposure + {0x350a, 0x04}, {0x350b, 0x00}, {0x350c, 0x00}, // hcg digital gain + + {0x3586, 0x40}, {0x3587, 0x00}, // lcg fine exposure + {0x358a, 0x01}, {0x358b, 0x00}, {0x358c, 0x00}, // lcg digital gain + + {0x3546, 0x20}, {0x3547, 0x00}, // spd fine exposure + {0x354a, 0x01}, {0x354b, 0x00}, {0x354c, 0x00}, // spd digital gain + + {0x35c6, 0xb0}, {0x35c7, 0x00}, // vs fine exposure + {0x35ca, 0x01}, {0x35cb, 0x00}, {0x35cc, 0x00}, // vs digital gain + + // also RSVD + {0x3600, 0x8f}, {0x3605, 0x16}, {0x3609, 0xf0}, {0x360a, 0x01}, + {0x360e, 0x1d}, {0x360f, 0x10}, {0x3610, 0x70}, {0x3611, 0x3a}, + {0x3612, 0x28}, {0x361a, 0x29}, {0x361b, 0x6c}, {0x361c, 0x0b}, + {0x361d, 0x00}, {0x361e, 0xfc}, {0x362a, 0x00}, {0x364d, 0x0f}, + {0x364e, 0x18}, {0x364f, 0x12}, {0x3653, 0x1c}, {0x3654, 0x00}, + {0x3655, 0x1f}, {0x3656, 0x1f}, {0x3657, 0x0c}, {0x3658, 0x0a}, + {0x3659, 0x14}, {0x365a, 0x18}, {0x365b, 0x14}, {0x365c, 0x10}, + {0x365e, 0x12}, {0x3674, 0x08}, {0x3677, 0x3a}, {0x3678, 0x3a}, + {0x3679, 0x19}, + + // Y_ADDR_START = 4 + {0x3802, 0x00}, {0x3803, 0x04}, + // Y_ADDR_END = 0x50b + {0x3806, 0x05}, {0x3807, 0x0b}, + + // X_OUTPUT_SIZE = 0x780 = 1920 (changed to 1928) + {0x3808, 0x07}, {0x3809, 0x88}, + + // Y_OUTPUT_SIZE = 0x500 = 1280 (changed to 1208) + {0x380a, 0x04}, {0x380b, 0xb8}, + + // horizontal timing 0x447 + {0x380c, 0x04}, {0x380d, 0x47}, + + // rows per frame (was 0x2ae) + // 0x8ae = 53.65 ms + {0x380e, 0x08}, {0x380f, 0x15}, + // this should be triggered by FSIN, not free running + + {0x3810, 0x00}, {0x3811, 0x08}, // x cutoff + {0x3812, 0x00}, {0x3813, 0x04}, // y cutoff + {0x3816, 0x01}, + {0x3817, 0x01}, + {0x381c, 0x18}, + {0x381e, 0x01}, + {0x381f, 0x01}, + + // don't mirror, just flip + {0x3820, 0x04}, + + {0x3821, 0x19}, + {0x3832, 0x00}, + {0x3834, 0x00}, + {0x384c, 0x02}, + {0x384d, 0x0d}, + {0x3850, 0x00}, + {0x3851, 0x42}, + {0x3852, 0x00}, + {0x3853, 0x40}, + {0x3858, 0x04}, + {0x388c, 0x02}, + {0x388d, 0x2b}, + + // APC + {0x3b40, 0x05}, {0x3b41, 0x40}, {0x3b42, 0x00}, {0x3b43, 0x90}, + {0x3b44, 0x00}, {0x3b45, 0x20}, {0x3b46, 0x00}, {0x3b47, 0x20}, + {0x3b48, 0x19}, {0x3b49, 0x12}, {0x3b4a, 0x16}, {0x3b4b, 0x2e}, + {0x3b4c, 0x00}, {0x3b4d, 0x00}, + {0x3b86, 0x00}, {0x3b87, 0x34}, {0x3b88, 0x00}, {0x3b89, 0x08}, + {0x3b8a, 0x05}, {0x3b8b, 0x00}, {0x3b8c, 0x07}, {0x3b8d, 0x80}, + {0x3b8e, 0x00}, {0x3b8f, 0x00}, {0x3b92, 0x05}, {0x3b93, 0x00}, + {0x3b94, 0x07}, {0x3b95, 0x80}, {0x3b9e, 0x09}, + + // OTP + {0x3d82, 0x73}, + {0x3d85, 0x05}, + {0x3d8a, 0x03}, + {0x3d8b, 0xff}, + {0x3d99, 0x00}, + {0x3d9a, 0x9f}, + {0x3d9b, 0x00}, + {0x3d9c, 0xa0}, + {0x3da4, 0x00}, + {0x3da7, 0x50}, + + // DTR + {0x420e, 0x6b}, + {0x420f, 0x6e}, + {0x4210, 0x06}, + {0x4211, 0xc1}, + {0x421e, 0x02}, + {0x421f, 0x45}, + {0x4220, 0xe1}, + {0x4221, 0x01}, + {0x4301, 0xff}, + {0x4307, 0x03}, + {0x4308, 0x13}, + {0x430a, 0x13}, + {0x430d, 0x93}, + {0x430f, 0x57}, + {0x4310, 0x95}, + {0x4311, 0x16}, + {0x4316, 0x00}, + + {0x4317, 0x38}, // both embedded rows are enabled + + {0x4319, 0x03}, // spd dcg + {0x431a, 0x00}, // 8 bit mipi + {0x431b, 0x00}, + {0x431d, 0x2a}, + {0x431e, 0x11}, + + {0x431f, 0x20}, // enable PWL (pwl0_en), 12 bits + //{0x431f, 0x00}, // disable PWL + + {0x4320, 0x19}, + {0x4323, 0x80}, + {0x4324, 0x00}, + {0x4503, 0x4e}, + {0x4505, 0x00}, + {0x4509, 0x00}, + {0x450a, 0x00}, + {0x4580, 0xf8}, + {0x4583, 0x07}, + {0x4584, 0x6a}, + {0x4585, 0x08}, + {0x4586, 0x05}, + {0x4587, 0x04}, + {0x4588, 0x73}, + {0x4589, 0x05}, + {0x458a, 0x1f}, + {0x458b, 0x02}, + {0x458c, 0xdc}, + {0x458d, 0x03}, + {0x458e, 0x02}, + {0x4597, 0x07}, + {0x4598, 0x40}, + {0x4599, 0x0e}, + {0x459a, 0x0e}, + {0x459b, 0xfb}, + {0x459c, 0xf3}, + {0x4602, 0x00}, + {0x4603, 0x13}, + {0x4604, 0x00}, + {0x4609, 0x0a}, + {0x460a, 0x30}, + {0x4610, 0x00}, + {0x4611, 0x70}, + {0x4612, 0x01}, + {0x4613, 0x00}, + {0x4614, 0x00}, + {0x4615, 0x70}, + {0x4616, 0x01}, + {0x4617, 0x00}, + + {0x4800, 0x04}, // invert output PCLK + {0x480a, 0x22}, + {0x4813, 0xe4}, + + // mipi + {0x4814, 0x2a}, + {0x4837, 0x0d}, + {0x484b, 0x47}, + {0x484f, 0x00}, + {0x4887, 0x51}, + {0x4d00, 0x4a}, + {0x4d01, 0x18}, + {0x4d05, 0xff}, + {0x4d06, 0x88}, + {0x4d08, 0x63}, + {0x4d09, 0xdf}, + {0x4d15, 0x7d}, + {0x4d1a, 0x20}, + {0x4d30, 0x0a}, + {0x4d31, 0x00}, + {0x4d34, 0x7d}, + {0x4d3c, 0x7d}, + {0x4f00, 0x00}, + {0x4f01, 0x00}, + {0x4f02, 0x00}, + {0x4f03, 0x20}, + {0x4f04, 0xe0}, + {0x6a00, 0x00}, + {0x6a01, 0x20}, + {0x6a02, 0x00}, + {0x6a03, 0x20}, + {0x6a04, 0x02}, + {0x6a05, 0x80}, + {0x6a06, 0x01}, + {0x6a07, 0xe0}, + {0x6a08, 0xcf}, + {0x6a09, 0x01}, + {0x6a0a, 0x40}, + {0x6a20, 0x00}, + {0x6a21, 0x02}, + {0x6a22, 0x00}, + {0x6a23, 0x00}, + {0x6a24, 0x00}, + {0x6a25, 0x00}, + {0x6a26, 0x00}, + {0x6a27, 0x00}, + {0x6a28, 0x00}, + + // isp + {0x5000, 0x8f}, + {0x5001, 0x75}, + {0x5002, 0x7f}, // PWL0 + //{0x5002, 0x3f}, // PWL disable + {0x5003, 0x7a}, + + {0x5004, 0x3e}, + {0x5005, 0x1e}, + {0x5006, 0x1e}, + {0x5007, 0x1e}, + + {0x5008, 0x00}, + {0x500c, 0x00}, + {0x502c, 0x00}, + {0x502e, 0x00}, + {0x502f, 0x00}, + {0x504b, 0x00}, + {0x5053, 0x00}, + {0x505b, 0x00}, + {0x5063, 0x00}, + {0x5070, 0x00}, + {0x5074, 0x04}, + {0x507a, 0x04}, + {0x507b, 0x09}, + {0x5500, 0x02}, + {0x5700, 0x02}, + {0x5900, 0x02}, + {0x6007, 0x04}, + {0x6008, 0x05}, + {0x6009, 0x02}, + {0x600b, 0x08}, + {0x600c, 0x07}, + {0x600d, 0x88}, + {0x6016, 0x00}, + {0x6027, 0x04}, + {0x6028, 0x05}, + {0x6029, 0x02}, + {0x602b, 0x08}, + {0x602c, 0x07}, + {0x602d, 0x88}, + {0x6047, 0x04}, + {0x6048, 0x05}, + {0x6049, 0x02}, + {0x604b, 0x08}, + {0x604c, 0x07}, + {0x604d, 0x88}, + {0x6067, 0x04}, + {0x6068, 0x05}, + {0x6069, 0x02}, + {0x606b, 0x08}, + {0x606c, 0x07}, + {0x606d, 0x88}, + {0x6087, 0x04}, + {0x6088, 0x05}, + {0x6089, 0x02}, + {0x608b, 0x08}, + {0x608c, 0x07}, + {0x608d, 0x88}, + + // 12-bit PWL0 + {0x5e00, 0x00}, + + // m_ndX_exp[0:32] + // 9*2+0xa*3+0xb*2+0xc*2+0xd*2+0xe*2+0xf*2+0x10*2+0x11*2+0x12*4+0x13*3+0x14*3+0x15*3+0x16 = 518 + {0x5e01, 0x09}, + {0x5e02, 0x09}, + {0x5e03, 0x0a}, + {0x5e04, 0x0a}, + {0x5e05, 0x0a}, + {0x5e06, 0x0b}, + {0x5e07, 0x0b}, + {0x5e08, 0x0c}, + {0x5e09, 0x0c}, + {0x5e0a, 0x0d}, + {0x5e0b, 0x0d}, + {0x5e0c, 0x0e}, + {0x5e0d, 0x0e}, + {0x5e0e, 0x0f}, + {0x5e0f, 0x0f}, + {0x5e10, 0x10}, + {0x5e11, 0x10}, + {0x5e12, 0x11}, + {0x5e13, 0x11}, + {0x5e14, 0x12}, + {0x5e15, 0x12}, + {0x5e16, 0x12}, + {0x5e17, 0x12}, + {0x5e18, 0x13}, + {0x5e19, 0x13}, + {0x5e1a, 0x13}, + {0x5e1b, 0x14}, + {0x5e1c, 0x14}, + {0x5e1d, 0x14}, + {0x5e1e, 0x15}, + {0x5e1f, 0x15}, + {0x5e20, 0x15}, + {0x5e21, 0x16}, + + // m_ndY_val[0:32] + // 0x200+0xff+0x100*3+0x80*12+0x40*16 = 4095 + {0x5e22, 0x00}, {0x5e23, 0x02}, {0x5e24, 0x00}, + {0x5e25, 0x00}, {0x5e26, 0x00}, {0x5e27, 0xff}, + {0x5e28, 0x00}, {0x5e29, 0x01}, {0x5e2a, 0x00}, + {0x5e2b, 0x00}, {0x5e2c, 0x01}, {0x5e2d, 0x00}, + {0x5e2e, 0x00}, {0x5e2f, 0x01}, {0x5e30, 0x00}, + {0x5e31, 0x00}, {0x5e32, 0x00}, {0x5e33, 0x80}, + {0x5e34, 0x00}, {0x5e35, 0x00}, {0x5e36, 0x80}, + {0x5e37, 0x00}, {0x5e38, 0x00}, {0x5e39, 0x80}, + {0x5e3a, 0x00}, {0x5e3b, 0x00}, {0x5e3c, 0x80}, + {0x5e3d, 0x00}, {0x5e3e, 0x00}, {0x5e3f, 0x80}, + {0x5e40, 0x00}, {0x5e41, 0x00}, {0x5e42, 0x80}, + {0x5e43, 0x00}, {0x5e44, 0x00}, {0x5e45, 0x80}, + {0x5e46, 0x00}, {0x5e47, 0x00}, {0x5e48, 0x80}, + {0x5e49, 0x00}, {0x5e4a, 0x00}, {0x5e4b, 0x80}, + {0x5e4c, 0x00}, {0x5e4d, 0x00}, {0x5e4e, 0x80}, + {0x5e4f, 0x00}, {0x5e50, 0x00}, {0x5e51, 0x80}, + {0x5e52, 0x00}, {0x5e53, 0x00}, {0x5e54, 0x80}, + {0x5e55, 0x00}, {0x5e56, 0x00}, {0x5e57, 0x40}, + {0x5e58, 0x00}, {0x5e59, 0x00}, {0x5e5a, 0x40}, + {0x5e5b, 0x00}, {0x5e5c, 0x00}, {0x5e5d, 0x40}, + {0x5e5e, 0x00}, {0x5e5f, 0x00}, {0x5e60, 0x40}, + {0x5e61, 0x00}, {0x5e62, 0x00}, {0x5e63, 0x40}, + {0x5e64, 0x00}, {0x5e65, 0x00}, {0x5e66, 0x40}, + {0x5e67, 0x00}, {0x5e68, 0x00}, {0x5e69, 0x40}, + {0x5e6a, 0x00}, {0x5e6b, 0x00}, {0x5e6c, 0x40}, + {0x5e6d, 0x00}, {0x5e6e, 0x00}, {0x5e6f, 0x40}, + {0x5e70, 0x00}, {0x5e71, 0x00}, {0x5e72, 0x40}, + {0x5e73, 0x00}, {0x5e74, 0x00}, {0x5e75, 0x40}, + {0x5e76, 0x00}, {0x5e77, 0x00}, {0x5e78, 0x40}, + {0x5e79, 0x00}, {0x5e7a, 0x00}, {0x5e7b, 0x40}, + {0x5e7c, 0x00}, {0x5e7d, 0x00}, {0x5e7e, 0x40}, + {0x5e7f, 0x00}, {0x5e80, 0x00}, {0x5e81, 0x40}, + {0x5e82, 0x00}, {0x5e83, 0x00}, {0x5e84, 0x40}, + + // disable PWL + /*{0x5e01, 0x18}, {0x5e02, 0x00}, {0x5e03, 0x00}, {0x5e04, 0x00}, + {0x5e05, 0x00}, {0x5e06, 0x00}, {0x5e07, 0x00}, {0x5e08, 0x00}, + {0x5e09, 0x00}, {0x5e0a, 0x00}, {0x5e0b, 0x00}, {0x5e0c, 0x00}, + {0x5e0d, 0x00}, {0x5e0e, 0x00}, {0x5e0f, 0x00}, {0x5e10, 0x00}, + {0x5e11, 0x00}, {0x5e12, 0x00}, {0x5e13, 0x00}, {0x5e14, 0x00}, + {0x5e15, 0x00}, {0x5e16, 0x00}, {0x5e17, 0x00}, {0x5e18, 0x00}, + {0x5e19, 0x00}, {0x5e1a, 0x00}, {0x5e1b, 0x00}, {0x5e1c, 0x00}, + {0x5e1d, 0x00}, {0x5e1e, 0x00}, {0x5e1f, 0x00}, {0x5e20, 0x00}, + {0x5e21, 0x00}, + + {0x5e22, 0x00}, {0x5e23, 0x0f}, {0x5e24, 0xFF},*/ + + {0x4001, 0x2b}, // BLC_CTRL_1 + {0x4008, 0x02}, {0x4009, 0x03}, + {0x4018, 0x12}, + {0x4022, 0x40}, + {0x4023, 0x20}, + + // all black level targets are 0x40 + {0x4026, 0x00}, {0x4027, 0x40}, + {0x4028, 0x00}, {0x4029, 0x40}, + {0x402a, 0x00}, {0x402b, 0x40}, + {0x402c, 0x00}, {0x402d, 0x40}, + + {0x407e, 0xcc}, + {0x407f, 0x18}, + {0x4080, 0xff}, + {0x4081, 0xff}, + {0x4082, 0x01}, + {0x4083, 0x53}, + {0x4084, 0x01}, + {0x4085, 0x2b}, + {0x4086, 0x00}, + {0x4087, 0xb3}, + + {0x4640, 0x40}, + {0x4641, 0x11}, + {0x4642, 0x0e}, + {0x4643, 0xee}, + {0x4646, 0x0f}, + {0x4648, 0x00}, + {0x4649, 0x03}, + + {0x4f00, 0x00}, + {0x4f01, 0x00}, + {0x4f02, 0x80}, + {0x4f03, 0x2c}, + {0x4f04, 0xf8}, + + {0x4d09, 0xff}, + {0x4d09, 0xdf}, + + {0x5003, 0x7a}, + {0x5b80, 0x08}, + {0x5c00, 0x08}, + {0x5c80, 0x00}, + {0x5bbe, 0x12}, + {0x5c3e, 0x12}, + {0x5cbe, 0x12}, + {0x5b8a, 0x80}, + {0x5b8b, 0x80}, + {0x5b8c, 0x80}, + {0x5b8d, 0x80}, + {0x5b8e, 0x60}, + {0x5b8f, 0x80}, + {0x5b90, 0x80}, + {0x5b91, 0x80}, + {0x5b92, 0x80}, + {0x5b93, 0x20}, + {0x5b94, 0x80}, + {0x5b95, 0x80}, + {0x5b96, 0x80}, + {0x5b97, 0x20}, + {0x5b98, 0x00}, + {0x5b99, 0x80}, + {0x5b9a, 0x40}, + {0x5b9b, 0x20}, + {0x5b9c, 0x00}, + {0x5b9d, 0x00}, + {0x5b9e, 0x80}, + {0x5b9f, 0x00}, + {0x5ba0, 0x00}, + {0x5ba1, 0x00}, + {0x5ba2, 0x00}, + {0x5ba3, 0x00}, + {0x5ba4, 0x00}, + {0x5ba5, 0x00}, + {0x5ba6, 0x00}, + {0x5ba7, 0x00}, + {0x5ba8, 0x02}, + {0x5ba9, 0x00}, + {0x5baa, 0x02}, + {0x5bab, 0x76}, + {0x5bac, 0x03}, + {0x5bad, 0x08}, + {0x5bae, 0x00}, + {0x5baf, 0x80}, + {0x5bb0, 0x00}, + {0x5bb1, 0xc0}, + {0x5bb2, 0x01}, + {0x5bb3, 0x00}, + + // m_nNormCombineWeight + {0x5c0a, 0x80}, {0x5c0b, 0x80}, {0x5c0c, 0x80}, {0x5c0d, 0x80}, {0x5c0e, 0x60}, + {0x5c0f, 0x80}, {0x5c10, 0x80}, {0x5c11, 0x80}, {0x5c12, 0x60}, {0x5c13, 0x20}, + {0x5c14, 0x80}, {0x5c15, 0x80}, {0x5c16, 0x80}, {0x5c17, 0x20}, {0x5c18, 0x00}, + {0x5c19, 0x80}, {0x5c1a, 0x40}, {0x5c1b, 0x20}, {0x5c1c, 0x00}, {0x5c1d, 0x00}, + {0x5c1e, 0x80}, {0x5c1f, 0x00}, {0x5c20, 0x00}, {0x5c21, 0x00}, {0x5c22, 0x00}, + {0x5c23, 0x00}, {0x5c24, 0x00}, {0x5c25, 0x00}, {0x5c26, 0x00}, {0x5c27, 0x00}, + + // m_nCombinThreL + {0x5c28, 0x02}, {0x5c29, 0x00}, + {0x5c2a, 0x02}, {0x5c2b, 0x76}, + {0x5c2c, 0x03}, {0x5c2d, 0x08}, + + // m_nCombinThreS + {0x5c2e, 0x00}, {0x5c2f, 0x80}, + {0x5c30, 0x00}, {0x5c31, 0xc0}, + {0x5c32, 0x01}, {0x5c33, 0x00}, + + // m_nNormCombineWeight + {0x5c8a, 0x80}, {0x5c8b, 0x80}, {0x5c8c, 0x80}, {0x5c8d, 0x80}, {0x5c8e, 0x80}, + {0x5c8f, 0x80}, {0x5c90, 0x80}, {0x5c91, 0x80}, {0x5c92, 0x80}, {0x5c93, 0x60}, + {0x5c94, 0x80}, {0x5c95, 0x80}, {0x5c96, 0x80}, {0x5c97, 0x60}, {0x5c98, 0x40}, + {0x5c99, 0x80}, {0x5c9a, 0x80}, {0x5c9b, 0x80}, {0x5c9c, 0x40}, {0x5c9d, 0x00}, + {0x5c9e, 0x80}, {0x5c9f, 0x80}, {0x5ca0, 0x80}, {0x5ca1, 0x20}, {0x5ca2, 0x00}, + {0x5ca3, 0x80}, {0x5ca4, 0x80}, {0x5ca5, 0x00}, {0x5ca6, 0x00}, {0x5ca7, 0x00}, + + {0x5ca8, 0x01}, {0x5ca9, 0x00}, + {0x5caa, 0x02}, {0x5cab, 0x00}, + {0x5cac, 0x03}, {0x5cad, 0x08}, + + {0x5cae, 0x01}, {0x5caf, 0x00}, + {0x5cb0, 0x02}, {0x5cb1, 0x00}, + {0x5cb2, 0x03}, {0x5cb3, 0x08}, + + // combine ISP + {0x5be7, 0x80}, + {0x5bc9, 0x80}, + {0x5bca, 0x80}, + {0x5bcb, 0x80}, + {0x5bcc, 0x80}, + {0x5bcd, 0x80}, + {0x5bce, 0x80}, + {0x5bcf, 0x80}, + {0x5bd0, 0x80}, + {0x5bd1, 0x80}, + {0x5bd2, 0x20}, + {0x5bd3, 0x80}, + {0x5bd4, 0x40}, + {0x5bd5, 0x20}, + {0x5bd6, 0x00}, + {0x5bd7, 0x00}, + {0x5bd8, 0x00}, + {0x5bd9, 0x00}, + {0x5bda, 0x00}, + {0x5bdb, 0x00}, + {0x5bdc, 0x00}, + {0x5bdd, 0x00}, + {0x5bde, 0x00}, + {0x5bdf, 0x00}, + {0x5be0, 0x00}, + {0x5be1, 0x00}, + {0x5be2, 0x00}, + {0x5be3, 0x00}, + {0x5be4, 0x00}, + {0x5be5, 0x00}, + {0x5be6, 0x00}, + + // m_nSPDCombineWeight + {0x5c49, 0x80}, {0x5c4a, 0x80}, {0x5c4b, 0x80}, {0x5c4c, 0x80}, {0x5c4d, 0x40}, + {0x5c4e, 0x80}, {0x5c4f, 0x80}, {0x5c50, 0x80}, {0x5c51, 0x60}, {0x5c52, 0x20}, + {0x5c53, 0x80}, {0x5c54, 0x80}, {0x5c55, 0x80}, {0x5c56, 0x20}, {0x5c57, 0x00}, + {0x5c58, 0x80}, {0x5c59, 0x40}, {0x5c5a, 0x20}, {0x5c5b, 0x00}, {0x5c5c, 0x00}, + {0x5c5d, 0x80}, {0x5c5e, 0x00}, {0x5c5f, 0x00}, {0x5c60, 0x00}, {0x5c61, 0x00}, + {0x5c62, 0x00}, {0x5c63, 0x00}, {0x5c64, 0x00}, {0x5c65, 0x00}, {0x5c66, 0x00}, + + // m_nSPDCombineWeight + {0x5cc9, 0x80}, {0x5cca, 0x80}, {0x5ccb, 0x80}, {0x5ccc, 0x80}, {0x5ccd, 0x80}, + {0x5cce, 0x80}, {0x5ccf, 0x80}, {0x5cd0, 0x80}, {0x5cd1, 0x80}, {0x5cd2, 0x60}, + {0x5cd3, 0x80}, {0x5cd4, 0x80}, {0x5cd5, 0x80}, {0x5cd6, 0x60}, {0x5cd7, 0x40}, + {0x5cd8, 0x80}, {0x5cd9, 0x80}, {0x5cda, 0x80}, {0x5cdb, 0x40}, {0x5cdc, 0x20}, + {0x5cdd, 0x80}, {0x5cde, 0x80}, {0x5cdf, 0x80}, {0x5ce0, 0x20}, {0x5ce1, 0x00}, + {0x5ce2, 0x80}, {0x5ce3, 0x80}, {0x5ce4, 0x80}, {0x5ce5, 0x00}, {0x5ce6, 0x00}, + + {0x5d74, 0x01}, + {0x5d75, 0x00}, + + {0x5d1f, 0x81}, + {0x5d11, 0x00}, + {0x5d12, 0x10}, + {0x5d13, 0x10}, + {0x5d15, 0x05}, + {0x5d16, 0x05}, + {0x5d17, 0x05}, + {0x5d08, 0x03}, + {0x5d09, 0xb6}, + {0x5d0a, 0x03}, + {0x5d0b, 0xb6}, + {0x5d18, 0x03}, + {0x5d19, 0xb6}, + {0x5d62, 0x01}, + {0x5d40, 0x02}, + {0x5d41, 0x01}, + {0x5d63, 0x1f}, + {0x5d64, 0x00}, + {0x5d65, 0x80}, + {0x5d56, 0x00}, + {0x5d57, 0x20}, + {0x5d58, 0x00}, + {0x5d59, 0x20}, + {0x5d5a, 0x00}, + {0x5d5b, 0x0c}, + {0x5d5c, 0x02}, + {0x5d5d, 0x40}, + {0x5d5e, 0x02}, + {0x5d5f, 0x40}, + {0x5d60, 0x03}, + {0x5d61, 0x40}, + {0x5d4a, 0x02}, + {0x5d4b, 0x40}, + {0x5d4c, 0x02}, + {0x5d4d, 0x40}, + {0x5d4e, 0x02}, + {0x5d4f, 0x40}, + {0x5d50, 0x18}, + {0x5d51, 0x80}, + {0x5d52, 0x18}, + {0x5d53, 0x80}, + {0x5d54, 0x18}, + {0x5d55, 0x80}, + {0x5d46, 0x20}, + {0x5d47, 0x00}, + {0x5d48, 0x22}, + {0x5d49, 0x00}, + {0x5d42, 0x20}, + {0x5d43, 0x00}, + {0x5d44, 0x22}, + {0x5d45, 0x00}, + + {0x5004, 0x1e}, + {0x4221, 0x03}, // this is changed from 1 -> 3 + + // DCG exposure coarse + {0x3501, 0x01}, {0x3502, 0xc8}, + // SPD exposure coarse + {0x3541, 0x01}, {0x3542, 0xc8}, + // VS exposure coarse + {0x35c1, 0x00}, {0x35c2, 0x01}, + + // crc reference + {0x420e, 0x66}, {0x420f, 0x5d}, {0x4210, 0xa8}, {0x4211, 0x55}, + // crc stat check + {0x507a, 0x5f}, {0x507b, 0x46}, + + // watchdog control + {0x4f00, 0x00}, {0x4f01, 0x01}, {0x4f02, 0x80}, {0x4f04, 0x2c}, + + // color balance gains + // blue + {0x5280, 0x06}, {0x5281, 0xCB}, // hcg + {0x5480, 0x06}, {0x5481, 0xCB}, // lcg + {0x5680, 0x06}, {0x5681, 0xCB}, // spd + {0x5880, 0x06}, {0x5881, 0xCB}, // vs + + // green(blue) + {0x5282, 0x04}, {0x5283, 0x00}, + {0x5482, 0x04}, {0x5483, 0x00}, + {0x5682, 0x04}, {0x5683, 0x00}, + {0x5882, 0x04}, {0x5883, 0x00}, + + // green(red) + {0x5284, 0x04}, {0x5285, 0x00}, + {0x5484, 0x04}, {0x5485, 0x00}, + {0x5684, 0x04}, {0x5685, 0x00}, + {0x5884, 0x04}, {0x5885, 0x00}, + + // red + {0x5286, 0x08}, {0x5287, 0xDE}, + {0x5486, 0x08}, {0x5487, 0xDE}, + {0x5686, 0x08}, {0x5687, 0xDE}, + {0x5886, 0x08}, {0x5887, 0xDE}, }; struct i2c_random_wr_payload init_array_ar0231[] = { diff --git a/system/clocksd/clocksd b/system/clocksd/clocksd index d124c32fd..235aec334 100755 Binary files a/system/clocksd/clocksd and b/system/clocksd/clocksd differ diff --git a/system/hardware/eon/libs/osm-3s_v0.7.56.tar.gz b/system/hardware/eon/libs/osm-3s_v0.7.56.tar.gz new file mode 100644 index 000000000..0e1d5b1f1 Binary files /dev/null and b/system/hardware/eon/libs/osm-3s_v0.7.56.tar.gz differ diff --git a/system/hardware/tici/agnos.json b/system/hardware/tici/agnos.json index 7ccea95ee..dc0fa6f1c 100644 --- a/system/hardware/tici/agnos.json +++ b/system/hardware/tici/agnos.json @@ -1,9 +1,9 @@ [ { "name": "boot", - "url": "https://commadist.azureedge.net/agnosupdate/boot-243ddbb9e2256aa7af7fed0daf8cff4017a3c838c759373a634b8539f271bfb8.img.xz", - "hash": "243ddbb9e2256aa7af7fed0daf8cff4017a3c838c759373a634b8539f271bfb8", - "hash_raw": "243ddbb9e2256aa7af7fed0daf8cff4017a3c838c759373a634b8539f271bfb8", + "url": "https://commadist.azureedge.net/agnosupdate/boot-57626d7737ab2fa1318e8707a202b1295b5da79ad2fa0a36377cc9481ad0d136.img.xz", + "hash": "57626d7737ab2fa1318e8707a202b1295b5da79ad2fa0a36377cc9481ad0d136", + "hash_raw": "57626d7737ab2fa1318e8707a202b1295b5da79ad2fa0a36377cc9481ad0d136", "size": 14780416, "sparse": false, "full_check": true, @@ -41,9 +41,9 @@ }, { "name": "system", - "url": "https://commadist.azureedge.net/agnosupdate/system-59622eddd068d49f2e9df69ef5115e3f205ad369539690a5b240c8c93796dd13.img.xz", - "hash": "44da205d17b44b2be7c94854a6bb3efb2928ec9a9889fe62af8b322d2295b74f", - "hash_raw": "59622eddd068d49f2e9df69ef5115e3f205ad369539690a5b240c8c93796dd13", + "url": "https://commadist.azureedge.net/agnosupdate/system-9db38e27c912005472f3ac02be336af4f82307295118b6db22921479d44a941d.img.xz", + "hash": "05e7ce440b33721b020a249043d9568a5898080e26411ca250fb330ad2e5ed8e", + "hash_raw": "9db38e27c912005472f3ac02be336af4f82307295118b6db22921479d44a941d", "size": 10737418240, "sparse": true, "full_check": false, diff --git a/system/hardware/tici/agnos.py b/system/hardware/tici/agnos.py index 51998bf8b..5f446a8e9 100755 --- a/system/hardware/tici/agnos.py +++ b/system/hardware/tici/agnos.py @@ -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}) # type: ignore # pylint: disable=missing-timeout + self.req = requests.get(url, stream=True, headers={'Accept-Encoding': None}, timeout=60) # type: ignore self.it = self.req.iter_content(chunk_size=1024 * 1024) self.decompressor = lzma.LZMADecompressor(format=lzma.FORMAT_AUTO) self.eof = False diff --git a/system/hardware/tici/casync.py b/system/hardware/tici/casync.py index 8ae42fa71..993336616 100755 --- a/system/hardware/tici/casync.py +++ b/system/hardware/tici/casync.py @@ -86,6 +86,7 @@ class RemoteChunkReader(ChunkReader): 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 if os.path.isfile(caibx_path): caibx = open(caibx_path, 'rb') else: diff --git a/system/hardware/tici/pins.py b/system/hardware/tici/pins.py index 61e528d30..fe31b9311 100644 --- a/system/hardware/tici/pins.py +++ b/system/hardware/tici/pins.py @@ -19,3 +19,9 @@ class GPIO: CAM0_RSTN = 9 CAM1_RSTN = 7 CAM2_RSTN = 12 + + # Sensor interrupts + BMX055_ACCEL_INT = 21 + BMX055_GYRO_INT = 23 + BMX055_MAGN_INT = 87 + LSM_INT = 84 diff --git a/tools/lib/bootlog.py b/tools/lib/bootlog.py index 351537082..1e474e5dd 100644 --- a/tools/lib/bootlog.py +++ b/tools/lib/bootlog.py @@ -1,6 +1,7 @@ import datetime import functools import re +from typing import List, Optional from tools.lib.auth_config import get_token from tools.lib.api import CommaApi @@ -48,8 +49,15 @@ class Bootlog: return False return self.datetime < b.datetime +def get_bootlog_from_id(bootlog_id: str) -> Optional[Bootlog]: + # TODO: implement an API endpoint for this + bl = Bootlog(bootlog_id) + for b in get_bootlogs(bl.dongle_id): + if b == bl: + return b + return None -def get_bootlogs(dongle_id: str): +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/replay/replay.h b/tools/replay/replay.h index e86c453f7..3327362f9 100644 --- a/tools/replay/replay.h +++ b/tools/replay/replay.h @@ -52,8 +52,11 @@ public: inline void removeFlag(REPLAY_FLAGS flag) { flags_ &= ~flag; } inline const Route* route() const { return route_.get(); } inline int currentSeconds() const { return (cur_mono_time_ - route_start_ts_) / 1e9; } + inline uint64_t routeStartTime() const { return route_start_ts_; } inline int toSeconds(uint64_t mono_time) const { return (mono_time - route_start_ts_) / 1e9; } inline int totalSeconds() const { return segments_.size() * 60; } + inline void setSpeed(float speed) { speed_ = speed; } + inline float getSpeed() const { return speed_; } inline const std::string &carFingerprint() const { return car_fingerprint_; } inline const std::vector> getTimeline() { std::lock_guard lk(timeline_lock); @@ -112,4 +115,5 @@ protected: QFuture timeline_future; std::vector> timeline; std::string car_fingerprint_; + float speed_ = 1.0; };