From ce7cb76273431bffb1a0cdcac367a06e5aa6b393 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sat, 11 Nov 2023 02:52:54 -0500 Subject: [PATCH] Update to latest Phoenix 5 --- .github/workflows/dist.yml | 10 +- ctre/__init__.py | 1 + ctre/_init_phoenix6.py | 3 + gen/BaseMotorController.yml | 3 +- gen/BasePigeon.yml | 3 +- gen/BufferedTrajectoryPointStream.yml | 5 +- gen/CANdleConfiguration.yml | 21 ++-- gen/ColorFlowAnimation.yml | 2 - gen/LarsonAnimation.yml | 2 - gen/LimitSwitchType.yml | 6 +- gen/Pigeon2.yml | 12 ++- gen/PigeonIMU.yml | 6 +- gen/StatorCurrentLimitConfiguration.yml | 2 +- gen/SupplyCurrentLimitConfiguration.yml | 2 +- gen/TalonSRX.yml | 2 +- gen/TwinkleAnimation.yml | 2 - gen/TwinkleOffAnimation.yml | 2 - gen/VictorSPX.yml | 2 +- pyproject.toml | 123 +++++++++++++----------- 19 files changed, 111 insertions(+), 98 deletions(-) create mode 100644 ctre/_init_phoenix6.py diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 2765b53..e4a4c43 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -11,16 +11,18 @@ on: jobs: ci: - uses: robotpy/build-actions/.github/workflows/package-ci.yml@v2023 + uses: robotpy/build-actions/.github/workflows/package-ci.yml@v2024 with: enable_raspbian: false enable_sphinx_check: false + artifactory_repo_type: vendor fail_fast: false + python_versions: >- + ["3.9", "3.10", "3.11", "3.12"] secrets: - SSH_USER: ${{ secrets.SSH_USER }} - SSH_KEY: ${{ secrets.SSH_KEY }} - SSH_PASSPHRASE: ${{ secrets.SSH_PASSPHRASE }} META_REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }} RTD_TOKEN: ${{ secrets.RTD_TOKEN }} RTD_WEBHOOK: ${{ secrets.RTD_WEBHOOK }} + WPI_ARTIFACTORY_USERNAME: ${{ secrets.WPI_ARTIFACTORY_USERNAME }} + WPI_ARTIFACTORY_TOKEN: ${{ secrets.WPI_ARTIFACTORY_TOKEN }} PYPI_API_TOKEN: ${{ secrets.PYPI_PASSWORD }} diff --git a/ctre/__init__.py b/ctre/__init__.py index 8e5d0b6..ab29932 100644 --- a/ctre/__init__.py +++ b/ctre/__init__.py @@ -1,3 +1,4 @@ +from . import _init_phoenix6 from . import _init_ctre # autogenerated by 'robotpy-build create-imports ctre' diff --git a/ctre/_init_phoenix6.py b/ctre/_init_phoenix6.py new file mode 100644 index 0000000..d862b17 --- /dev/null +++ b/ctre/_init_phoenix6.py @@ -0,0 +1,3 @@ +from phoenix6.phoenix_native import Native + +Native.instance() diff --git a/gen/BaseMotorController.yml b/gen/BaseMotorController.yml index 2351977..0d9b27e 100644 --- a/gen/BaseMotorController.yml +++ b/gen/BaseMotorController.yml @@ -13,7 +13,7 @@ classes: overloads: "": rename: __str__ - std::string&: + const std::string&: FilterConfiguration: shared_ptr: true attributes: @@ -322,6 +322,7 @@ classes: GetSlotConfigs: GetFilterConfigs: GetHandle: + ignore: true GetVictorSPXSimCollection: BaseConfigAllSettings: BaseGetAllConfigs: diff --git a/gen/BasePigeon.yml b/gen/BasePigeon.yml index 61ecf15..9523fdb 100644 --- a/gen/BasePigeon.yml +++ b/gen/BasePigeon.yml @@ -55,8 +55,6 @@ classes: GetCompassHeading: GetCompassFieldStrength: GetTemp: - overloads: - '[const]': GetUpTime: GetRawMagnetometer: GetBiasedMagnetometer: @@ -79,6 +77,7 @@ classes: GetFirmwareVersion: ClearStickyFaults: GetLowLevelHandle: + ignore: true ConfigAllSettings: GetAllConfigs: ConfigFactoryDefault: diff --git a/gen/BufferedTrajectoryPointStream.yml b/gen/BufferedTrajectoryPointStream.yml index 024211b..08f6ba4 100644 --- a/gen/BufferedTrajectoryPointStream.yml +++ b/gen/BufferedTrajectoryPointStream.yml @@ -8,6 +8,7 @@ classes: Clear: Write: overloads: - TrajectoryPoint&: - TrajectoryPoint*, uint32_t: + const TrajectoryPoint&: + const TrajectoryPoint*, uint32_t: GetHandle: + ignore: true diff --git a/gen/CANdleConfiguration.yml b/gen/CANdleConfiguration.yml index d83262f..2b41e50 100644 --- a/gen/CANdleConfiguration.yml +++ b/gen/CANdleConfiguration.yml @@ -10,21 +10,14 @@ classes: force_no_trampoline: true base_qualnames: CustomParamConfiguration: ctre::phoenix::CustomParamConfiguration + attributes: + stripType: + brightnessScalar: + disableWhenLOS: + statusLedOffWhenActive: + vBatOutputMode: + v5Enabled: methods: CANdleConfiguration: toString: rename: __str__ - -inline_code: | - cls_CANdleConfiguration - .def_readwrite("stripType", &ctre::phoenix::led::CANdleConfiguration::stripType, - py::doc("What type of LEDs the CANdle controls")) - .def_readwrite("brightnessScalar", &ctre::phoenix::led::CANdleConfiguration::brightnessScalar, - py::doc("Brightness scalar for all LEDs controlled")) - .def_readwrite("disableWhenLOS", &ctre::phoenix::led::CANdleConfiguration::disableWhenLOS, - py::doc("True to turn off LEDs when Loss of Signal occurrs")) - .def_readwrite("statusLedOffWhenActive", &ctre::phoenix::led::CANdleConfiguration::statusLedOffWhenActive, - py::doc("True to turn off Status LED when CANdle is actively being controlled")) - .def_readwrite("vBatOutputMode", &ctre::phoenix::led::CANdleConfiguration::vBatOutputMode, - py::doc("The behavior of VBat output")) - ; \ No newline at end of file diff --git a/gen/ColorFlowAnimation.yml b/gen/ColorFlowAnimation.yml index 43c78fb..3d8d69d 100644 --- a/gen/ColorFlowAnimation.yml +++ b/gen/ColorFlowAnimation.yml @@ -3,8 +3,6 @@ classes: ColorFlowAnimation: subpackage: led - typealias: - - ctre::phoenix::led::ColorFlowAnimation::Direction enums: Direction: methods: diff --git a/gen/LarsonAnimation.yml b/gen/LarsonAnimation.yml index 2155de3..3eb2023 100644 --- a/gen/LarsonAnimation.yml +++ b/gen/LarsonAnimation.yml @@ -3,8 +3,6 @@ classes: LarsonAnimation: subpackage: led - typealias: - - ctre::phoenix::led::LarsonAnimation::BounceMode enums: BounceMode: methods: diff --git a/gen/LimitSwitchType.yml b/gen/LimitSwitchType.yml index fa1d6ab..6d0772d 100644 --- a/gen/LimitSwitchType.yml +++ b/gen/LimitSwitchType.yml @@ -13,9 +13,9 @@ classes: IsRemote: toString: overloads: - ctre::phoenix::motorcontrol::LimitSwitchSource: + LimitSwitchSource: ignore: true - ctre::phoenix::motorcontrol::RemoteLimitSwitchSource: + RemoteLimitSwitchSource: ignore: true - ctre::phoenix::motorcontrol::LimitSwitchNormal: + LimitSwitchNormal: ignore: true diff --git a/gen/Pigeon2.yml b/gen/Pigeon2.yml index c0f5d49..c5686c8 100644 --- a/gen/Pigeon2.yml +++ b/gen/Pigeon2.yml @@ -12,6 +12,16 @@ classes: force_no_trampoline: true base_qualnames: CustomParamConfiguration: ctre::phoenix::CustomParamConfiguration + attributes: + MountPoseYaw: + MountPosePitch: + MountPoseRoll: + EnableCompass: + DisableTemperatureCompensation: + DisableNoMotionCalibration: + XAxisGyroError: + YAxisGyroError: + ZAxisGyroError: methods: Pigeon2Configuration: toString: @@ -44,7 +54,7 @@ classes: GetStickyFaults: ConfigMountPose: overloads: - ctre::phoenix::sensors::AxisDirection, ctre::phoenix::sensors::AxisDirection, int: + AxisDirection, AxisDirection, int: double, double, double, int: ConfigMountPoseYaw: ConfigMountPosePitch: diff --git a/gen/PigeonIMU.yml b/gen/PigeonIMU.yml index 0a54f97..537ba12 100644 --- a/gen/PigeonIMU.yml +++ b/gen/PigeonIMU.yml @@ -102,7 +102,7 @@ classes: default: "{0,0,0}" GetFusedHeading: overloads: - PigeonIMU::FusionStatus&: + FusionStatus&: "[const]": GetResetCount: GetResetFlags: @@ -110,8 +110,8 @@ classes: HasResetOccurred: ToString: overloads: - ctre::phoenix::sensors::PigeonIMU::PigeonState: - ctre::phoenix::sensors::PigeonIMU::CalibrationMode: + PigeonIMU::PigeonState: + CalibrationMode: ConfigSetCustomParam: ConfigGetCustomParam: ignore: true diff --git a/gen/StatorCurrentLimitConfiguration.yml b/gen/StatorCurrentLimitConfiguration.yml index f867174..4e9c475 100644 --- a/gen/StatorCurrentLimitConfiguration.yml +++ b/gen/StatorCurrentLimitConfiguration.yml @@ -12,7 +12,7 @@ classes: StatorCurrentLimitConfiguration: overloads: "": - double*, int: + const double*, int: ignore: true # unsafe array bool, double, double, double: ToString: diff --git a/gen/SupplyCurrentLimitConfiguration.yml b/gen/SupplyCurrentLimitConfiguration.yml index 9908cff..35db164 100644 --- a/gen/SupplyCurrentLimitConfiguration.yml +++ b/gen/SupplyCurrentLimitConfiguration.yml @@ -13,7 +13,7 @@ classes: overloads: "": bool, double, double, double: - double*, int: + const double*, int: ignore: true # unsafe array ToString: rename: __str__ diff --git a/gen/TalonSRX.yml b/gen/TalonSRX.yml index c1e4ef1..eb84ee3 100644 --- a/gen/TalonSRX.yml +++ b/gen/TalonSRX.yml @@ -45,7 +45,7 @@ classes: TalonSRX: overloads: int: - int, std::string&: + int, const std::string&: "": ignore: true ConfigSelectedFeedbackSensor: diff --git a/gen/TwinkleAnimation.yml b/gen/TwinkleAnimation.yml index 501e10b..7e7dc47 100644 --- a/gen/TwinkleAnimation.yml +++ b/gen/TwinkleAnimation.yml @@ -3,8 +3,6 @@ classes: TwinkleAnimation: subpackage: led - typealias: - - ctre::phoenix::led::TwinkleAnimation::TwinklePercent enums: TwinklePercent: methods: diff --git a/gen/TwinkleOffAnimation.yml b/gen/TwinkleOffAnimation.yml index 387cf33..af6f5d4 100644 --- a/gen/TwinkleOffAnimation.yml +++ b/gen/TwinkleOffAnimation.yml @@ -3,8 +3,6 @@ classes: TwinkleOffAnimation: subpackage: led - typealias: - - ctre::phoenix::led::TwinkleOffAnimation::TwinkleOffPercent enums: TwinkleOffPercent: methods: diff --git a/gen/VictorSPX.yml b/gen/VictorSPX.yml index 20a2571..647b7c9 100644 --- a/gen/VictorSPX.yml +++ b/gen/VictorSPX.yml @@ -68,7 +68,7 @@ classes: VictorSPX: overloads: int: - int, std::string&: + int, const std::string&: GetPIDConfigs: ConfigAllSettings: GetAllConfigs: diff --git a/pyproject.toml b/pyproject.toml index 3641344..75df29d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,13 +6,15 @@ author_email = "robotpy@googlegroups.com" url = "https://github.com/robotpy/robotpy-ctre" license = "MIT" install_requires = [ - "wpilib<2024.0.0,>=2023.1.1.0", + "wpilib<2025.0.0,>=2024.0.0b2", + "phoenix6~=24.0.0b2", ] [build-system] requires = [ - "robotpy-build<2024.0.0,>=2023.0.0", - "wpilib<2024.0.0,>=2023.1.1.0", + "robotpy-build<2025.0.0,>=2024.0.0b4", + "wpilib<2025.0.0,>=2024.0.0b2", + "phoenix6~=24.0.0b2", ] [tool.robotpy-build] @@ -44,7 +46,7 @@ depends = [ artifact_id = "wpiapi-cpp" group_id = "com.ctre.phoenix" repo_url = "https://maven.ctr-electronics.com/release" -version = "5.30.4" +version = "5.32.0-beta-1" libs = [ "CTRE_Phoenix_WPI", ] @@ -64,7 +66,7 @@ depends = [ artifact_id = "api-cpp" group_id = "com.ctre.phoenix" repo_url = "https://maven.ctr-electronics.com/release" -version = "5.30.4" +version = "5.32.0-beta-1" libs = [ "CTRE_Phoenix", ] @@ -83,7 +85,7 @@ depends = [ artifact_id = "cci" group_id = "com.ctre.phoenix" repo_url = "https://maven.ctr-electronics.com/release" -version = "5.30.4" +version = "5.32.0-beta-1" libs = [ "CTRE_PhoenixCCI", ] @@ -97,9 +99,9 @@ ignore = false [tool.robotpy-build.wrappers."ctre._tools".maven_lib_download] artifact_id = "tools" -group_id = "com.ctre.phoenixpro" +group_id = "com.ctre.phoenix6" repo_url = "https://maven.ctr-electronics.com/release" -version = "23.0.8" +version = "24.0.0-beta-2" libs = [ "CTRE_PhoenixTools", ] @@ -121,7 +123,7 @@ ignore = true artifact_id = "wpiapi-cpp-sim" group_id = "com.ctre.phoenix.sim" repo_url = "https://maven.ctr-electronics.com/release" -version = "5.30.4" +version = "5.32.0-beta-1" libs = [ "CTRE_Phoenix_WPISim", ] @@ -140,7 +142,7 @@ ignore = true artifact_id = "api-cpp-sim" group_id = "com.ctre.phoenix.sim" repo_url = "https://maven.ctr-electronics.com/release" -version = "5.30.4" +version = "5.32.0-beta-1" libs = [ "CTRE_PhoenixSim", ] @@ -158,7 +160,7 @@ ignore = true artifact_id = "cci-sim" group_id = "com.ctre.phoenix.sim" repo_url = "https://maven.ctr-electronics.com/release" -version = "5.30.4" +version = "5.32.0-beta-1" libs = [ "CTRE_PhoenixCCISim", ] @@ -181,12 +183,13 @@ ignore = true [tool.robotpy-build.wrappers."ctre._tools_sim".maven_lib_download] artifact_id = "tools-sim" -group_id = "com.ctre.phoenixpro.sim" +group_id = "com.ctre.phoenix6.sim" repo_url = "https://maven.ctr-electronics.com/release" -version = "23.0.8" -libs = [ - "CTRE_PhoenixTools_Sim", -] +version = "24.0.0-beta-2" +libs = [] +# libs = [ +# "CTRE_PhoenixTools_Sim", +# ] [tool.robotpy-build.wrappers."ctre._simtalonsrx"] name = "ctre_simtalonsrx" @@ -196,12 +199,13 @@ ignore = true [tool.robotpy-build.wrappers."ctre._simtalonsrx".maven_lib_download] artifact_id = "simTalonSRX" -group_id = "com.ctre.phoenixpro.sim" +group_id = "com.ctre.phoenix6.sim" repo_url = "https://maven.ctr-electronics.com/release" -version = "23.0.8" -libs = [ - "CTRE_SimTalonSRX", -] +version = "24.0.0-beta-2" +libs = [] +# libs = [ +# "CTRE_SimTalonSRX", +# ] [tool.robotpy-build.wrappers."ctre._simtalonfx"] name = "ctre_simtalonfx" @@ -211,12 +215,13 @@ ignore = true [tool.robotpy-build.wrappers."ctre._simtalonfx".maven_lib_download] artifact_id = "simTalonFX" -group_id = "com.ctre.phoenixpro.sim" +group_id = "com.ctre.phoenix6.sim" repo_url = "https://maven.ctr-electronics.com/release" -version = "23.0.8" -libs = [ - "CTRE_SimTalonFX", -] +version = "24.0.0-beta-2" +libs = [] +# libs = [ +# "CTRE_SimTalonFX", +# ] [tool.robotpy-build.wrappers."ctre._simvictorspx"] name = "ctre_simvictorspx" @@ -226,12 +231,13 @@ ignore = true [tool.robotpy-build.wrappers."ctre._simvictorspx".maven_lib_download] artifact_id = "simVictorSPX" -group_id = "com.ctre.phoenixpro.sim" +group_id = "com.ctre.phoenix6.sim" repo_url = "https://maven.ctr-electronics.com/release" -version = "23.0.8" -libs = [ - "CTRE_SimVictorSPX", -] +version = "24.0.0-beta-2" +libs = [] +# libs = [ +# "CTRE_SimVictorSPX", +# ] [tool.robotpy-build.wrappers."ctre._simpigeonimu"] name = "ctre_simpigeonimu" @@ -241,12 +247,13 @@ ignore = true [tool.robotpy-build.wrappers."ctre._simpigeonimu".maven_lib_download] artifact_id = "simPigeonIMU" -group_id = "com.ctre.phoenixpro.sim" +group_id = "com.ctre.phoenix6.sim" repo_url = "https://maven.ctr-electronics.com/release" -version = "23.0.8" -libs = [ - "CTRE_SimPigeonIMU", -] +version = "24.0.0-beta-2" +libs = [] +# libs = [ +# "CTRE_SimPigeonIMU", +# ] [tool.robotpy-build.wrappers."ctre._simcancoder"] name = "ctre_simcancoder" @@ -256,12 +263,13 @@ ignore = true [tool.robotpy-build.wrappers."ctre._simcancoder".maven_lib_download] artifact_id = "simCANCoder" -group_id = "com.ctre.phoenixpro.sim" +group_id = "com.ctre.phoenix6.sim" repo_url = "https://maven.ctr-electronics.com/release" -version = "23.0.8" -libs = [ - "CTRE_SimCANCoder", -] +version = "24.0.0-beta-2" +libs = [] +# libs = [ +# "CTRE_SimCANCoder", +# ] [tool.robotpy-build.wrappers."ctre._simprotalonfx"] name = "ctre_simprotalonfx" @@ -271,12 +279,13 @@ ignore = true [tool.robotpy-build.wrappers."ctre._simprotalonfx".maven_lib_download] artifact_id = "simProTalonFX" -group_id = "com.ctre.phoenixpro.sim" +group_id = "com.ctre.phoenix6.sim" repo_url = "https://maven.ctr-electronics.com/release" -version = "23.0.8" -libs = [ - "CTRE_SimProTalonFX", -] +version = "24.0.0-beta-2" +libs = [] +# libs = [ +# "CTRE_SimProTalonFX", +# ] [tool.robotpy-build.wrappers."ctre._simprocancoder"] name = "ctre_simprocancoder" @@ -286,12 +295,13 @@ ignore = true [tool.robotpy-build.wrappers."ctre._simprocancoder".maven_lib_download] artifact_id = "simProCANcoder" -group_id = "com.ctre.phoenixpro.sim" +group_id = "com.ctre.phoenix6.sim" repo_url = "https://maven.ctr-electronics.com/release" -version = "23.0.8" -libs = [ - "CTRE_SimProCANcoder", -] +version = "24.0.0-beta-2" +libs = [] +# libs = [ +# "CTRE_SimProCANcoder", +# ] [tool.robotpy-build.wrappers."ctre._simpropigeon2"] name = "ctre_simpropigeon2" @@ -301,12 +311,13 @@ ignore = true [tool.robotpy-build.wrappers."ctre._simpropigeon2".maven_lib_download] artifact_id = "simProPigeon2" -group_id = "com.ctre.phoenixpro.sim" +group_id = "com.ctre.phoenix6.sim" repo_url = "https://maven.ctr-electronics.com/release" -version = "23.0.8" -libs = [ - "CTRE_SimProPigeon2", -] +version = "24.0.0-beta-2" +libs = [] +# libs = [ +# "CTRE_SimProPigeon2", +# ] # End autogenerated TOML