Package com.ctre.phoenix.sensors
Class CANCoderConfiguration
java.lang.Object
com.ctre.phoenix.CustomParamConfiguration
com.ctre.phoenix.sensors.CANCoderConfiguration
@Deprecated(since="2024", forRemoval=true) public class CANCoderConfiguration extends CustomParamConfiguration
Deprecated, for removal: This API element is subject to removal in a future version.
This device's Phoenix 5 API is deprecated for removal in the
2025 season. Users should update to Phoenix 6 firmware and migrate to the
Phoenix 6 API. A migration guide is available at
https://v6.docs.ctr-electronics.com/en/stable/docs/migration/migration-guide/index.html.
If the Phoenix 5 API must be used for this device, the device must have 22.X firmware. This firmware is available in Tuner X after selecting Phoenix 5 in the firmware year dropdown.
Configurables available to CANCoder
-
Field Summary
Fields Modifier and Type Field Description AbsoluteSensorRange
absoluteSensorRange
Deprecated, for removal: This API element is subject to removal in a future version.Desired Sign / Range for the absolute position register.SensorInitializationStrategy
initializationStrategy
Deprecated, for removal: This API element is subject to removal in a future version.The sensor initialization strategy to use.This will impact the behavior the next time CANCoder boots up.double
magnetOffsetDegrees
Deprecated, for removal: This API element is subject to removal in a future version.Adjusts the zero point for the absolute position register.double
sensorCoefficient
Deprecated, for removal: This API element is subject to removal in a future version.Scalar to multiply the CANCoder's native 12-bit resolute sensor.boolean
sensorDirection
Deprecated, for removal: This API element is subject to removal in a future version.Choose which direction is interpreted as positive displacement.SensorTimeBase
sensorTimeBase
Deprecated, for removal: This API element is subject to removal in a future version.Desired denominator to report velocity in.String
unitString
Deprecated, for removal: This API element is subject to removal in a future version.String holding the unit to report in.SensorVelocityMeasPeriod
velocityMeasurementPeriod
Deprecated, for removal: This API element is subject to removal in a future version.Velocity measurement period to useint
velocityMeasurementWindow
Deprecated, for removal: This API element is subject to removal in a future version.Velocity measurement window to useFields inherited from class com.ctre.phoenix.CustomParamConfiguration
customParam0, customParam1, enableOptimizations
-
Constructor Summary
Constructors Constructor Description CANCoderConfiguration()
Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
-
Field Details
-
velocityMeasurementPeriod
Deprecated, for removal: This API element is subject to removal in a future version.Velocity measurement period to use -
velocityMeasurementWindow
Deprecated, for removal: This API element is subject to removal in a future version.Velocity measurement window to use -
absoluteSensorRange
Deprecated, for removal: This API element is subject to removal in a future version.Desired Sign / Range for the absolute position register. Choose unsigned for an absolute range of[0, +1) rotations, [0, 360) deg, etc. Choose signed for an absolute range of[-0.5, +0.5) rotations, [-180, +180) deg, etc. -
magnetOffsetDegrees
Deprecated, for removal: This API element is subject to removal in a future version.Adjusts the zero point for the absolute position register. The absolute position of the sensor will always have a discontinuity (360 -> 0 deg) or (+180 -> -180) and a hard-limited mechanism may have such a discontinuity in its functional range. In which case use this config to move the discontinuity outside of the function range. -
sensorDirection
Deprecated, for removal: This API element is subject to removal in a future version.Choose which direction is interpreted as positive displacement. This affects both "Position"and "Absolute Position". False(default) means positive rotation occurs when magnet is spun counter - clockwise when observer is facing the LED side of CANCoder. -
initializationStrategy
Deprecated, for removal: This API element is subject to removal in a future version.The sensor initialization strategy to use.This will impact the behavior the next time CANCoder boots up. Pick the strategy on how to initialize the CANCoder's "Position" register. Depending on the mechanism, it may be desirable to auto set the Position register to match the Absolute Position(swerve for example). Or it may be desired to zero the sensor on boot(drivetrain translation sensor or a relative servo). TIP: Tuner's self-test feature will report what the boot sensor value will be in the event the CANCoder is reset. -
sensorCoefficient
Deprecated, for removal: This API element is subject to removal in a future version.Scalar to multiply the CANCoder's native 12-bit resolute sensor. Defaults to 0.087890625 to produce degrees. -
unitString
Deprecated, for removal: This API element is subject to removal in a future version.String holding the unit to report in. This impacts all routines(except for ConfigMagnetOffset) and the self-test in Tuner. The string value itself is arbitrary.The max number of letters will depend on firmware versioning, but generally CANCoder supports up to eight letters.However, common units such as "centimeters" are supported explicitly despite exceeding the eight-letter limit. Default is "deg" -
sensorTimeBase
Deprecated, for removal: This API element is subject to removal in a future version.Desired denominator to report velocity in. This impacts GetVelocityand the reported velocity in self-test in Tuner. Default is "Per Second".
-
-
Constructor Details
-
CANCoderConfiguration
public CANCoderConfiguration()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
toString
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
toString
in classCustomParamConfiguration
- Returns:
- String representation of configs
-
toString
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
toString
in classCustomParamConfiguration
- Parameters:
prependString
- String to prepend to configs- Returns:
- String representation of configs
-