Skip to content

Add sensors namespace #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 4 additions & 62 deletions ctre/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,17 @@

# autogenerated by 'robotpy-build create-imports ctre'
from ._ctre import (
AbsoluteSensorRange,
BaseMotorController,
BaseMotorControllerConfiguration,
BaseMotorControllerUtil,
BasePIDSetConfiguration,
BasePigeon,
BasePigeonConfigUtils,
BasePigeonConfiguration,
BasePigeonSimCollection,
BaseTalon,
BaseTalonConfigUtil,
BaseTalonConfiguration,
BaseTalonPIDSetConfigUtil,
BaseTalonPIDSetConfiguration,
BufferedTrajectoryPointStream,
CANBusAddressable,
CANCoder,
CANCoderConfigUtils,
CANCoderConfiguration,
CANCoderFaults,
CANCoderSimCollection,
CANCoderStatusFrame,
CANCoderStickyFaults,
CANifier,
CANifierConfigUtils,
CANifierConfiguration,
Expand Down Expand Up @@ -57,33 +45,17 @@
LimitSwitchNormal,
LimitSwitchRoutines,
LimitSwitchSource,
MagnetFieldStrength,
MotionProfileStatus,
MotorCommutation,
MovingAverage,
NeutralMode,
Orchestra,
ParamEnum,
Pigeon2,
Pigeon2ConfigUtils,
Pigeon2Configuration,
Pigeon2_Faults,
Pigeon2_StickyFaults,
PigeonIMU,
PigeonIMUConfigUtils,
PigeonIMUConfiguration,
PigeonIMU_ControlFrame,
PigeonIMU_Faults,
PigeonIMU_StatusFrame,
PigeonIMU_StickyFaults,
RemoteFeedbackDevice,
RemoteLimitSwitchSource,
RemoteSensorSource,
SensorCollection,
SensorInitializationStrategy,
SensorTerm,
SensorTimeBase,
SensorVelocityMeasPeriod,
SetValueMotionProfile,
SlotConfigUtil,
SlotConfiguration,
Expand Down Expand Up @@ -120,38 +92,23 @@
VictorSPXPIDSetConfiguration,
VictorSPXSimCollection,
WPI_BaseMotorController,
WPI_CANCoder,
WPI_Pigeon2,
WPI_PigeonIMU,
WPI_TalonFX,
WPI_TalonSRX,
WPI_VictorSPX,
)

__all__ = [
"AbsoluteSensorRange",
"BaseMotorController",
"BaseMotorControllerConfiguration",
"BaseMotorControllerUtil",
"BasePIDSetConfiguration",
"BasePigeon",
"BasePigeonConfigUtils",
"BasePigeonConfiguration",
"BasePigeonSimCollection",
"BaseTalon",
"BaseTalonConfigUtil",
"BaseTalonConfiguration",
"BaseTalonPIDSetConfigUtil",
"BaseTalonPIDSetConfiguration",
"BufferedTrajectoryPointStream",
"CANBusAddressable",
"CANCoder",
"CANCoderConfigUtils",
"CANCoderConfiguration",
"CANCoderFaults",
"CANCoderSimCollection",
"CANCoderStatusFrame",
"CANCoderStickyFaults",
"CANifier",
"CANifierConfigUtils",
"CANifierConfiguration",
Expand Down Expand Up @@ -184,33 +141,17 @@
"LimitSwitchNormal",
"LimitSwitchRoutines",
"LimitSwitchSource",
"MagnetFieldStrength",
"MotionProfileStatus",
"MotorCommutation",
"MovingAverage",
"NeutralMode",
"Orchestra",
"ParamEnum",
"Pigeon2",
"Pigeon2ConfigUtils",
"Pigeon2Configuration",
"Pigeon2_Faults",
"Pigeon2_StickyFaults",
"PigeonIMU",
"PigeonIMUConfigUtils",
"PigeonIMUConfiguration",
"PigeonIMU_ControlFrame",
"PigeonIMU_Faults",
"PigeonIMU_StatusFrame",
"PigeonIMU_StickyFaults",
"RemoteFeedbackDevice",
"RemoteLimitSwitchSource",
"RemoteSensorSource",
"SensorCollection",
"SensorInitializationStrategy",
"SensorTerm",
"SensorTimeBase",
"SensorVelocityMeasPeriod",
"SetValueMotionProfile",
"SlotConfigUtil",
"SlotConfiguration",
Expand Down Expand Up @@ -247,13 +188,14 @@
"VictorSPXPIDSetConfiguration",
"VictorSPXSimCollection",
"WPI_BaseMotorController",
"WPI_CANCoder",
"WPI_Pigeon2",
"WPI_PigeonIMU",
"WPI_TalonFX",
"WPI_TalonSRX",
"WPI_VictorSPX",
]


from .version import version as __version__

# backwards compat
# TODO: remove in 2024
from .sensors import *
70 changes: 70 additions & 0 deletions ctre/sensors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# autogenerated by 'robotpy-build create-imports ctre ctre._ctre.sensors'
from ._ctre.sensors import (
AbsoluteSensorRange,
AxisDirection,
BasePigeon,
BasePigeonConfigUtils,
BasePigeonConfiguration,
BasePigeonSimCollection,
CANCoder,
CANCoderConfigUtils,
CANCoderConfiguration,
CANCoderFaults,
CANCoderSimCollection,
CANCoderStatusFrame,
CANCoderStickyFaults,
MagnetFieldStrength,
Pigeon2,
Pigeon2ConfigUtils,
Pigeon2Configuration,
Pigeon2_Faults,
Pigeon2_StickyFaults,
PigeonIMU,
PigeonIMUConfigUtils,
PigeonIMUConfiguration,
PigeonIMU_ControlFrame,
PigeonIMU_Faults,
PigeonIMU_StatusFrame,
PigeonIMU_StickyFaults,
SensorInitializationStrategy,
SensorTimeBase,
SensorVelocityMeasPeriod,
WPI_CANCoder,
WPI_Pigeon2,
WPI_PigeonIMU,
)

__all__ = [
"AbsoluteSensorRange",
"AxisDirection",
"BasePigeon",
"BasePigeonConfigUtils",
"BasePigeonConfiguration",
"BasePigeonSimCollection",
"CANCoder",
"CANCoderConfigUtils",
"CANCoderConfiguration",
"CANCoderFaults",
"CANCoderSimCollection",
"CANCoderStatusFrame",
"CANCoderStickyFaults",
"MagnetFieldStrength",
"Pigeon2",
"Pigeon2ConfigUtils",
"Pigeon2Configuration",
"Pigeon2_Faults",
"Pigeon2_StickyFaults",
"PigeonIMU",
"PigeonIMUConfigUtils",
"PigeonIMUConfiguration",
"PigeonIMU_ControlFrame",
"PigeonIMU_Faults",
"PigeonIMU_StatusFrame",
"PigeonIMU_StickyFaults",
"SensorInitializationStrategy",
"SensorTimeBase",
"SensorVelocityMeasPeriod",
"WPI_CANCoder",
"WPI_Pigeon2",
"WPI_PigeonIMU",
]
1 change: 1 addition & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ and we'll try to address the problem.

ctre
ctre.led
ctre.sensors
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,4 @@

gen_package(root, "ctre")
gen_package(root, "ctre.led")
gen_package(root, "ctre.sensors")
2 changes: 2 additions & 0 deletions gen/AbsoluteSensorRange.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

enums:
AbsoluteSensorRange:
subpackage: sensors
classes:
AbsoluteSensorRangeRoutines:
subpackage: sensors
ignore: true # enum toString only
shared_ptr: false
methods:
Expand Down
3 changes: 3 additions & 0 deletions gen/BasePigeon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ extra_includes:

classes:
BasePigeonConfiguration:
subpackage: sensors
typealias:
- ctre::phoenix::CustomParamConfiguration
force_depends:
Expand All @@ -19,10 +20,12 @@ classes:
"":
std::string:
BasePigeonConfigUtils:
subpackage: sensors
methods:
CustomParam0Different:
CustomParam1Different:
BasePigeon:
subpackage: sensors
typealias:
- ctre::phoenix::ParamEnum
- ctre::phoenix::CANBusAddressable
Expand Down
1 change: 1 addition & 0 deletions gen/BasePigeonSimCollection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ extra_includes:

classes:
BasePigeonSimCollection:
subpackage: sensors
methods:
BasePigeonSimCollection:
SetRawHeading:
Expand Down
3 changes: 3 additions & 0 deletions gen/CANCoder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

classes:
CANCoderConfiguration:
subpackage: sensors
force_no_trampoline: true
base_qualnames:
CustomParamConfiguration: ctre::phoenix::CustomParamConfiguration
Expand All @@ -23,6 +24,7 @@ classes:
rename: __str__
std::string:
CANCoderConfigUtils:
subpackage: sensors
force_no_trampoline: true
base_qualnames:
CustomParamConfigUtil: ctre::phoenix::CustomParamConfigUtil
Expand All @@ -37,6 +39,7 @@ classes:
UnitStringDifferent:
SensorTimeBaseDifferent:
CANCoder:
subpackage: sensors
shared_ptr: true
force_no_trampoline: true
typealias:
Expand Down
1 change: 1 addition & 0 deletions gen/CANCoderFaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

classes:
CANCoderFaults:
subpackage: sensors
shared_ptr: true
attributes:
HardwareFault:
Expand Down
1 change: 1 addition & 0 deletions gen/CANCoderSimCollection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ extra_includes:

classes:
CANCoderSimCollection:
subpackage: sensors
methods:
CANCoderSimCollection:
SetBusVoltage:
Expand Down
1 change: 1 addition & 0 deletions gen/CANCoderStatusFrame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

enums:
CANCoderStatusFrame:
subpackage: sensors
1 change: 1 addition & 0 deletions gen/CANCoderStickyFaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

classes:
CANCoderStickyFaults:
subpackage: sensors
shared_ptr: true
attributes:
HardwareFault:
Expand Down
1 change: 1 addition & 0 deletions gen/MagnetFieldStrength.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

enums:
MagnetFieldStrength:
subpackage: sensors
4 changes: 4 additions & 0 deletions gen/Pigeon2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

enums:
AxisDirection:
subpackage: sensors

classes:
Pigeon2Configuration:
subpackage: sensors
typealias:
- ctre::phoenix::CustomParamConfiguration
force_no_trampoline: true
Expand All @@ -17,6 +19,7 @@ classes:
"":
std::string:
Pigeon2ConfigUtils:
subpackage: sensors
force_no_trampoline: true
methods:
MountPoseYawDifferent:
Expand All @@ -31,6 +34,7 @@ classes:
CustomParam0Different:
CustomParam1Different:
Pigeon2:
subpackage: sensors
force_no_trampoline: true
typealias:
- ctre::phoenix::ErrorCode
Expand Down
1 change: 1 addition & 0 deletions gen/Pigeon2_Faults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

classes:
Pigeon2_Faults:
subpackage: sensors
attributes:
HardwareFault:
APIError:
Expand Down
1 change: 1 addition & 0 deletions gen/Pigeon2_StickyFaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

classes:
Pigeon2_StickyFaults:
subpackage: sensors
attributes:
HardwareFault:
APIError:
Expand Down
Loading