CTRE Phoenix 6 C++ 26.0.0-beta-1
Loading...
Searching...
No Matches
ctre::phoenix6::configs::FeedbackConfigs Class Reference

Configs that affect the feedback of this motor controller. More...

#include <ctre/phoenix6/configs/FeedbackConfigs.hpp>

Inheritance diagram for ctre::phoenix6::configs::FeedbackConfigs:
ctre::phoenix6::configs::ParentConfiguration ctre::phoenix6::ISerializable

Public Member Functions

constexpr FeedbackConfigs ()=default
 
constexpr FeedbackConfigsWithFeedbackRotorOffset (units::angle::turn_t newFeedbackRotorOffset)
 Modifies this configuration's FeedbackRotorOffset parameter and returns itself for method-chaining and easier to use config API.
 
constexpr FeedbackConfigsWithSensorToMechanismRatio (units::dimensionless::scalar_t newSensorToMechanismRatio)
 Modifies this configuration's SensorToMechanismRatio parameter and returns itself for method-chaining and easier to use config API.
 
constexpr FeedbackConfigsWithRotorToSensorRatio (units::dimensionless::scalar_t newRotorToSensorRatio)
 Modifies this configuration's RotorToSensorRatio parameter and returns itself for method-chaining and easier to use config API.
 
constexpr FeedbackConfigsWithFeedbackSensorSource (signals::FeedbackSensorSourceValue newFeedbackSensorSource)
 Modifies this configuration's FeedbackSensorSource parameter and returns itself for method-chaining and easier to use config API.
 
constexpr FeedbackConfigsWithFeedbackRemoteSensorID (int newFeedbackRemoteSensorID)
 Modifies this configuration's FeedbackRemoteSensorID parameter and returns itself for method-chaining and easier to use config API.
 
constexpr FeedbackConfigsWithVelocityFilterTimeConstant (units::time::second_t newVelocityFilterTimeConstant)
 Modifies this configuration's VelocityFilterTimeConstant parameter and returns itself for method-chaining and easier to use config API.
 
FeedbackConfigsWithRemoteCANcoder (const hardware::core::CoreCANcoder &device)
 Helper method to configure this feedback group to use RemoteCANcoder by passing in the CANcoder object.
 
FeedbackConfigsWithFusedCANcoder (const hardware::core::CoreCANcoder &device)
 Helper method to configure this feedback group to use FusedCANcoder by passing in the CANcoder object.
 
FeedbackConfigsWithSyncCANcoder (const hardware::core::CoreCANcoder &device)
 Helper method to configure this feedback group to use SyncCANcoder by passing in the CANcoder object.
 
FeedbackConfigsWithRemotePigeon2Yaw (const hardware::core::CorePigeon2 &device)
 Helper method to configure this feedback group to use RemotePigeon2Yaw by passing in the Pigeon2 object.
 
FeedbackConfigsWithRemotePigeon2Pitch (const hardware::core::CorePigeon2 &device)
 Helper method to configure this feedback group to use RemotePigeon2Pitch by passing in the Pigeon2 object.
 
FeedbackConfigsWithRemotePigeon2Roll (const hardware::core::CorePigeon2 &device)
 Helper method to configure this feedback group to use RemotePigeon2Roll by passing in the Pigeon2 object.
 
FeedbackConfigsWithRemoteCANdiPWM1 (const hardware::core::CoreCANdi &device)
 Helper method to configure this feedback group to use RemoteCANdi PWM 1 by passing in the CANdi object.
 
FeedbackConfigsWithRemoteCANdiPWM2 (const hardware::core::CoreCANdi &device)
 Helper method to configure this feedback group to use RemoteCANdi PWM 2 by passing in the CANdi object.
 
FeedbackConfigsWithRemoteCANdiQuadrature (const hardware::core::CoreCANdi &device)
 Helper method to configure this feedback group to use RemoteCANdi Quadrature by passing in the CANdi object.
 
FeedbackConfigsWithFusedCANdiPWM1 (const hardware::core::CoreCANdi &device)
 Helper method to configure this feedback group to use FusedCANdi PWM 1 by passing in the CANdi object.
 
FeedbackConfigsWithFusedCANdiPWM2 (const hardware::core::CoreCANdi &device)
 Helper method to configure this feedback group to use FusedCANdi PWM 2 by passing in the CANdi object.
 
FeedbackConfigsWithFusedCANdiQuadrature (const hardware::core::CoreCANdi &device)
 Helper method to configure this feedback group to use FusedCANdi Quadrature by passing in the CANdi object.
 
FeedbackConfigsWithSyncCANdiPWM1 (const hardware::core::CoreCANdi &device)
 Helper method to configure this feedback group to use SyncCANdi PWM 1 by passing in the CANdi object.
 
FeedbackConfigsWithSyncCANdiPWM2 (const hardware::core::CoreCANdi &device)
 Helper method to configure this feedback group to use SyncCANdi PWM 2 by passing in the CANdi object.
 
std::string ToString () const override
 
std::string Serialize () const final
 
ctre::phoenix::StatusCode Deserialize (std::string const &to_deserialize) final
 
- Public Member Functions inherited from ctre::phoenix6::configs::ParentConfiguration
- Public Member Functions inherited from ctre::phoenix6::ISerializable

Public Attributes

units::angle::turn_t FeedbackRotorOffset = 0.0_tr
 The offset added to the absolute integrated rotor sensor.
 
units::dimensionless::scalar_t SensorToMechanismRatio = 1.0
 The ratio of sensor rotations to the mechanism's output, where a ratio greater than 1 is a reduction.
 
units::dimensionless::scalar_t RotorToSensorRatio = 1.0
 The ratio of motor rotor rotations to remote sensor rotations, where a ratio greater than 1 is a reduction.
 
signals::FeedbackSensorSourceValue FeedbackSensorSource = signals::FeedbackSensorSourceValue::RotorSensor
 Choose what sensor source is reported via API and used by closed-loop and limit features.
 
int FeedbackRemoteSensorID = 0
 Device ID of which remote device to use.
 
units::time::second_t VelocityFilterTimeConstant = 0_s
 The configurable time constant of the Kalman velocity filter.
 

Detailed Description

Configs that affect the feedback of this motor controller.

Includes feedback sensor source, any offsets for the feedback sensor, and various ratios to describe the relationship between the sensor and the mechanism for closed looping.

Constructor & Destructor Documentation

◆ FeedbackConfigs()

ctre::phoenix6::configs::FeedbackConfigs::FeedbackConfigs ( )
constexprdefault

Member Function Documentation

◆ Deserialize()

ctre::phoenix::StatusCode ctre::phoenix6::configs::FeedbackConfigs::Deserialize ( std::string const & to_deserialize)
finalvirtual

◆ Serialize()

std::string ctre::phoenix6::configs::FeedbackConfigs::Serialize ( ) const
finalvirtual

◆ ToString()

std::string ctre::phoenix6::configs::FeedbackConfigs::ToString ( ) const
overridevirtual

◆ WithFeedbackRemoteSensorID()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithFeedbackRemoteSensorID ( int newFeedbackRemoteSensorID)
inlineconstexpr

Modifies this configuration's FeedbackRemoteSensorID parameter and returns itself for method-chaining and easier to use config API.

Device ID of which remote device to use. This is not used if the Sensor Source is the internal rotor sensor.

  • Minimum Value: 0
  • Maximum Value: 62
  • Default Value: 0
  • Units:
Parameters
newFeedbackRemoteSensorIDParameter to modify
Returns
Itself

◆ WithFeedbackRotorOffset()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithFeedbackRotorOffset ( units::angle::turn_t newFeedbackRotorOffset)
inlineconstexpr

Modifies this configuration's FeedbackRotorOffset parameter and returns itself for method-chaining and easier to use config API.

The offset added to the absolute integrated rotor sensor. This can be used to zero the rotor in applications that are within one rotor rotation.

  • Minimum Value: -1
  • Maximum Value: 1
  • Default Value: 0.0
  • Units: rotations
Parameters
newFeedbackRotorOffsetParameter to modify
Returns
Itself

◆ WithFeedbackSensorSource()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithFeedbackSensorSource ( signals::FeedbackSensorSourceValue newFeedbackSensorSource)
inlineconstexpr

Modifies this configuration's FeedbackSensorSource parameter and returns itself for method-chaining and easier to use config API.

Choose what sensor source is reported via API and used by closed-loop and limit features. The default is RotorSensor, which uses the internal rotor sensor in the Talon.

Choose Remote* to use another sensor on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon will update its position and velocity whenever the remote sensor publishes its information on CAN bus, and the Talon internal rotor will not be used.

Choose Fused* (requires Phoenix Pro) and Talon will fuse another sensor's information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID). This was developed for applications such as swerve-azimuth.

Choose Sync* (requires Phoenix Pro) and Talon will synchronize its internal rotor position against another sensor, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID). The Talon will report if its internal position differs significantly from the reported remote sensor position. This was developed for mechanisms where there is a risk of the sensor failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.

Choose RemotePigeon2Yaw, RemotePigeon2Pitch, and RemotePigeon2Roll to use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon will update its position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon position will be in rotations and not degrees.

Note: When the feedback source is changed to Fused* or Sync*, the Talon needs a period of time to fuse before sensor-based (soft-limit, closed loop, etc.) features are used. This period of time is determined by the update frequency of the remote sensor's Position signal.

Parameters
newFeedbackSensorSourceParameter to modify
Returns
Itself

◆ WithFusedCANcoder()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithFusedCANcoder ( const hardware::core::CoreCANcoder & device)

Helper method to configure this feedback group to use FusedCANcoder by passing in the CANcoder object.

When using FusedCANcoder (requires Phoenix Pro), the Talon will fuse another CANcoder's information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth. FusedCANcoder was developed for applications such as swerve-azimuth.

Parameters
deviceCANcoder reference to use for FusedCANcoder
Returns
Itself

◆ WithFusedCANdiPWM1()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithFusedCANdiPWM1 ( const hardware::core::CoreCANdi & device)

Helper method to configure this feedback group to use FusedCANdi PWM 1 by passing in the CANdi object.

When using FusedCANdi (requires Phoenix Pro), the Talon will fuse another CANdi™ branded device's information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth.

Parameters
deviceCANdi reference to use for FusedCANdi
Returns
Itself

◆ WithFusedCANdiPWM2()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithFusedCANdiPWM2 ( const hardware::core::CoreCANdi & device)

Helper method to configure this feedback group to use FusedCANdi PWM 2 by passing in the CANdi object.

When using FusedCANdi (requires Phoenix Pro), the Talon will fuse another CANdi™ branded device's information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth.

Parameters
deviceCANdi reference to use for FusedCANdi
Returns
Itself

◆ WithFusedCANdiQuadrature()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithFusedCANdiQuadrature ( const hardware::core::CoreCANdi & device)

Helper method to configure this feedback group to use FusedCANdi Quadrature by passing in the CANdi object.

When using FusedCANdi (requires Phoenix Pro), the Talon will fuse another CANdi™ branded device's information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth.

Parameters
deviceCANdi reference to use for FusedCANdi
Returns
Itself

◆ WithRemoteCANcoder()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithRemoteCANcoder ( const hardware::core::CoreCANcoder & device)

Helper method to configure this feedback group to use RemoteCANcoder by passing in the CANcoder object.

When using RemoteCANcoder, the Talon will use another CANcoder on the same CAN bus. The Talon will update its position and velocity whenever CANcoder publishes its information on CAN bus, and the Talon internal rotor will not be used.

Parameters
deviceCANcoder reference to use for RemoteCANcoder
Returns
Itself

◆ WithRemoteCANdiPWM1()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithRemoteCANdiPWM1 ( const hardware::core::CoreCANdi & device)

Helper method to configure this feedback group to use RemoteCANdi PWM 1 by passing in the CANdi object.

When using RemoteCANdi, the Talon will use another CTR Electronics' CANdi™ on the same CAN bus. The Talon will update its position and velocity whenever the CTR Electronics' CANdi™ publishes its information on CAN bus, and the Talon commutation sensor will not be used.

Parameters
deviceCANdi reference to use for RemoteCANdi
Returns
Itself

◆ WithRemoteCANdiPWM2()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithRemoteCANdiPWM2 ( const hardware::core::CoreCANdi & device)

Helper method to configure this feedback group to use RemoteCANdi PWM 2 by passing in the CANdi object.

When using RemoteCANdi, the Talon will use another CTR Electronics' CANdi™ on the same CAN bus. The Talon will update its position and velocity whenever the CTR Electronics' CANdi™ publishes its information on CAN bus, and the Talon commutation sensor will not be used.

Parameters
deviceCANdi reference to use for RemoteCANdi
Returns
Itself

◆ WithRemoteCANdiQuadrature()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithRemoteCANdiQuadrature ( const hardware::core::CoreCANdi & device)

Helper method to configure this feedback group to use RemoteCANdi Quadrature by passing in the CANdi object.

When using RemoteCANdi, the Talon will use another CTR Electronics' CANdi™ on the same CAN bus. The Talon will update its position and velocity whenever the CTR Electronics' CANdi™ publishes its information on CAN bus, and the Talon commutation sensor will not be used.

Parameters
deviceCANdi reference to use for RemoteCANdi
Returns
Itself

◆ WithRemotePigeon2Pitch()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithRemotePigeon2Pitch ( const hardware::core::CorePigeon2 & device)

Helper method to configure this feedback group to use RemotePigeon2Pitch by passing in the Pigeon2 object.

When using RemotePigeon2Pitch, the Talon will use another Pigeon2 on the same CAN bus. The Talon will update its position to match the Pigeon2 pitch whenever Pigeon2 publishes its information on CAN bus. Note that the Talon position will be in rotations and not degrees.

Parameters
devicePigeon2 reference to use for RemotePigeon2Pitch
Returns
Itself

◆ WithRemotePigeon2Roll()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithRemotePigeon2Roll ( const hardware::core::CorePigeon2 & device)

Helper method to configure this feedback group to use RemotePigeon2Roll by passing in the Pigeon2 object.

When using RemotePigeon2Roll, the Talon will use another Pigeon2 on the same CAN bus. The Talon will update its position to match the Pigeon2 roll whenever Pigeon2 publishes its information on CAN bus. Note that the Talon position will be in rotations and not degrees.

Parameters
devicePigeon2 reference to use for RemotePigeon2Roll
Returns
Itself

◆ WithRemotePigeon2Yaw()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithRemotePigeon2Yaw ( const hardware::core::CorePigeon2 & device)

Helper method to configure this feedback group to use RemotePigeon2Yaw by passing in the Pigeon2 object.

When using RemotePigeon2Yaw, the Talon will use another Pigeon2 on the same CAN bus. The Talon will update its position to match the Pigeon2 yaw whenever Pigeon2 publishes its information on CAN bus. Note that the Talon position will be in rotations and not degrees.

Parameters
devicePigeon2 reference to use for RemotePigeon2Yaw
Returns
Itself

◆ WithRotorToSensorRatio()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithRotorToSensorRatio ( units::dimensionless::scalar_t newRotorToSensorRatio)
inlineconstexpr

Modifies this configuration's RotorToSensorRatio parameter and returns itself for method-chaining and easier to use config API.

The ratio of motor rotor rotations to remote sensor rotations, where a ratio greater than 1 is a reduction.

The Talon FX is capable of fusing a remote CANcoder with its rotor sensor to produce a high-bandwidth sensor source. This feature requires specifying the ratio between the motor rotor and the remote sensor.

If this is set to zero, the device will reset back to one.

  • Minimum Value: -1000
  • Maximum Value: 1000
  • Default Value: 1.0
  • Units: scalar
Parameters
newRotorToSensorRatioParameter to modify
Returns
Itself

◆ WithSensorToMechanismRatio()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithSensorToMechanismRatio ( units::dimensionless::scalar_t newSensorToMechanismRatio)
inlineconstexpr

Modifies this configuration's SensorToMechanismRatio parameter and returns itself for method-chaining and easier to use config API.

The ratio of sensor rotations to the mechanism's output, where a ratio greater than 1 is a reduction.

This is equivalent to the mechanism's gear ratio if the sensor is located on the input of a gearbox. If sensor is on the output of a gearbox, then this is typically set to 1.

We recommend against using this config to perform onboard unit conversions. Instead, unit conversions should be performed in robot code using the units library.

If this is set to zero, the device will reset back to one.

  • Minimum Value: -1000
  • Maximum Value: 1000
  • Default Value: 1.0
  • Units: scalar
Parameters
newSensorToMechanismRatioParameter to modify
Returns
Itself

◆ WithSyncCANcoder()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithSyncCANcoder ( const hardware::core::CoreCANcoder & device)

Helper method to configure this feedback group to use SyncCANcoder by passing in the CANcoder object.

When using SyncCANcoder (requires Phoenix Pro), the Talon will synchronize its internal rotor position against another CANcoder, then continue to use the rotor sensor for closed loop control. The Talon will report if its internal position differs significantly from the reported CANcoder position. SyncCANcoder was developed for mechanisms where there is a risk of the CANcoder failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.

Parameters
deviceCANcoder reference to use for SyncCANcoder
Returns
Itself

◆ WithSyncCANdiPWM1()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithSyncCANdiPWM1 ( const hardware::core::CoreCANdi & device)

Helper method to configure this feedback group to use SyncCANdi PWM 1 by passing in the CANdi object.

When using SyncCANdi (requires Phoenix Pro), the Talon will synchronize its internal rotor position against another CANdi™ branded device, then continue to use the rotor sensor for closed loop control. The Talon will report if its internal position differs significantly from the reported CANdi™ branded device's position. SyncCANdi was developed for mechanisms where there is a risk of the CANdi™ branded device failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.

Parameters
deviceCANdi reference to use for SyncCANdi
Returns
Itself

◆ WithSyncCANdiPWM2()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithSyncCANdiPWM2 ( const hardware::core::CoreCANdi & device)

Helper method to configure this feedback group to use SyncCANdi PWM 2 by passing in the CANdi object.

When using SyncCANdi (requires Phoenix Pro), the Talon will synchronize its internal rotor position against another CANdi™ branded device, then continue to use the rotor sensor for closed loop control. The Talon will report if its internal position differs significantly from the reported CANdi™ branded device's position. SyncCANdi was developed for mechanisms where there is a risk of the CANdi™ branded device failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.

Parameters
deviceCANdi reference to use for SyncCANdi
Returns
Itself

◆ WithVelocityFilterTimeConstant()

FeedbackConfigs & ctre::phoenix6::configs::FeedbackConfigs::WithVelocityFilterTimeConstant ( units::time::second_t newVelocityFilterTimeConstant)
inlineconstexpr

Modifies this configuration's VelocityFilterTimeConstant parameter and returns itself for method-chaining and easier to use config API.

The configurable time constant of the Kalman velocity filter. The velocity Kalman filter will adjust to act as a low-pass with this value as its time constant.

If the user is aiming for an expected cutoff frequency, the frequency is calculated as 1 / (2 * π * τ) with τ being the time constant.

  • Minimum Value: 0
  • Maximum Value: 1
  • Default Value: 0
  • Units: seconds
Parameters
newVelocityFilterTimeConstantParameter to modify
Returns
Itself

Member Data Documentation

◆ FeedbackRemoteSensorID

int ctre::phoenix6::configs::FeedbackConfigs::FeedbackRemoteSensorID = 0

Device ID of which remote device to use.

This is not used if the Sensor Source is the internal rotor sensor.

  • Minimum Value: 0
  • Maximum Value: 62
  • Default Value: 0
  • Units:

◆ FeedbackRotorOffset

units::angle::turn_t ctre::phoenix6::configs::FeedbackConfigs::FeedbackRotorOffset = 0.0_tr

The offset added to the absolute integrated rotor sensor.

This can be used to zero the rotor in applications that are within one rotor rotation.

  • Minimum Value: -1
  • Maximum Value: 1
  • Default Value: 0.0
  • Units: rotations

◆ FeedbackSensorSource

signals::FeedbackSensorSourceValue ctre::phoenix6::configs::FeedbackConfigs::FeedbackSensorSource = signals::FeedbackSensorSourceValue::RotorSensor

Choose what sensor source is reported via API and used by closed-loop and limit features.

The default is RotorSensor, which uses the internal rotor sensor in the Talon.

Choose Remote* to use another sensor on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon will update its position and velocity whenever the remote sensor publishes its information on CAN bus, and the Talon internal rotor will not be used.

Choose Fused* (requires Phoenix Pro) and Talon will fuse another sensor's information with the internal rotor, which provides the best possible position and velocity for accuracy and bandwidth (this also requires setting FeedbackRemoteSensorID). This was developed for applications such as swerve-azimuth.

Choose Sync* (requires Phoenix Pro) and Talon will synchronize its internal rotor position against another sensor, then continue to use the rotor sensor for closed loop control (this also requires setting FeedbackRemoteSensorID). The Talon will report if its internal position differs significantly from the reported remote sensor position. This was developed for mechanisms where there is a risk of the sensor failing in such a way that it reports a position that does not match the mechanism, such as the sensor mounting assembly breaking off.

Choose RemotePigeon2Yaw, RemotePigeon2Pitch, and RemotePigeon2Roll to use another Pigeon2 on the same CAN bus (this also requires setting FeedbackRemoteSensorID). Talon will update its position to match the selected value whenever Pigeon2 publishes its information on CAN bus. Note that the Talon position will be in rotations and not degrees.

Note: When the feedback source is changed to Fused* or Sync*, the Talon needs a period of time to fuse before sensor-based (soft-limit, closed loop, etc.) features are used. This period of time is determined by the update frequency of the remote sensor's Position signal.

◆ RotorToSensorRatio

units::dimensionless::scalar_t ctre::phoenix6::configs::FeedbackConfigs::RotorToSensorRatio = 1.0

The ratio of motor rotor rotations to remote sensor rotations, where a ratio greater than 1 is a reduction.

The Talon FX is capable of fusing a remote CANcoder with its rotor sensor to produce a high-bandwidth sensor source. This feature requires specifying the ratio between the motor rotor and the remote sensor.

If this is set to zero, the device will reset back to one.

  • Minimum Value: -1000
  • Maximum Value: 1000
  • Default Value: 1.0
  • Units: scalar

◆ SensorToMechanismRatio

units::dimensionless::scalar_t ctre::phoenix6::configs::FeedbackConfigs::SensorToMechanismRatio = 1.0

The ratio of sensor rotations to the mechanism's output, where a ratio greater than 1 is a reduction.

This is equivalent to the mechanism's gear ratio if the sensor is located on the input of a gearbox. If sensor is on the output of a gearbox, then this is typically set to 1.

We recommend against using this config to perform onboard unit conversions. Instead, unit conversions should be performed in robot code using the units library.

If this is set to zero, the device will reset back to one.

  • Minimum Value: -1000
  • Maximum Value: 1000
  • Default Value: 1.0
  • Units: scalar

◆ VelocityFilterTimeConstant

units::time::second_t ctre::phoenix6::configs::FeedbackConfigs::VelocityFilterTimeConstant = 0_s

The configurable time constant of the Kalman velocity filter.

The velocity Kalman filter will adjust to act as a low-pass with this value as its time constant.

If the user is aiming for an expected cutoff frequency, the frequency is calculated as 1 / (2 * π * τ) with τ being the time constant.

  • Minimum Value: 0
  • Maximum Value: 1
  • Default Value: 0
  • Units: seconds

The documentation for this class was generated from the following file: