|
CTRE Phoenix 6 C++ 26.0.0-beta-1
|
All constants for setting up the motors of a differential mechanism. More...
#include <ctre/phoenix6/mechanisms/DifferentialConstants.hpp>
Public Member Functions | |
| constexpr | DifferentialMotorConstants ()=default |
| constexpr DifferentialMotorConstants< MotorConfigsT > & | WithCANBusName (std::string_view newCANBusName) |
| Modifies the CANBusName parameter and returns itself. | |
| constexpr DifferentialMotorConstants< MotorConfigsT > & | WithLeaderId (int newLeaderId) |
| Modifies the LeaderId parameter and returns itself. | |
| constexpr DifferentialMotorConstants< MotorConfigsT > & | WithFollowerId (int newFollowerId) |
| Modifies the FollowerId parameter and returns itself. | |
| constexpr DifferentialMotorConstants< MotorConfigsT > & | WithAlignment (signals::MotorAlignmentValue newAlignment) |
| Modifies the Alignment parameter and returns itself. | |
| constexpr DifferentialMotorConstants< MotorConfigsT > & | WithSensorToDifferentialRatio (units::dimensionless::scalar_t newSensorToDifferentialRatio) |
| Modifies the SensorToDifferentialRatio parameter and returns itself. | |
| constexpr DifferentialMotorConstants< MotorConfigsT > & | WithClosedLoopRate (units::frequency::hertz_t newClosedLoopRate) |
| Modifies the ClosedLoopRate parameter and returns itself. | |
| constexpr DifferentialMotorConstants< MotorConfigsT > & | WithLeaderInitialConfigs (const MotorConfigsT &newLeaderInitialConfigs) |
| Modifies the LeaderInitialConfigs parameter and returns itself. | |
| constexpr DifferentialMotorConstants< MotorConfigsT > & | WithFollowerInitialConfigs (const MotorConfigsT &newFollowerInitialConfigs) |
| Modifies the FollowerInitialConfigs parameter and returns itself. | |
| constexpr DifferentialMotorConstants< MotorConfigsT > & | WithFollowerUsesCommonLeaderConfigs (bool newFollowerUsesCommonLeaderConfigs) |
| Modifies the FollowerUsesCommonLeaderConfigs parameter and returns itself. | |
Public Attributes | |
| std::string_view | CANBusName = "" |
| Name of the CAN bus the mechanism is on. | |
| int | LeaderId = 0 |
| CAN ID of the leader motor in the differential mechanism. | |
| int | FollowerId = 0 |
| CAN ID of the follower motor in the differential mechanism. | |
| signals::MotorAlignmentValue | Alignment = signals::MotorAlignmentValue::Aligned |
| The alignment of the differential leader and follower motors, ignoring the configured inverts. | |
| units::dimensionless::scalar_t | SensorToDifferentialRatio = 1.0 |
| The ratio of sensor rotations to the differential mechanism's difference output, where a ratio greater than 1 is a reduction. | |
| units::frequency::hertz_t | ClosedLoopRate = 100_Hz |
| The update rate of the closed-loop controllers. | |
| MotorConfigsT | LeaderInitialConfigs = {} |
| The initial configs used to configure the differential leader. | |
| MotorConfigsT | FollowerInitialConfigs = {} |
| The initial configs used to configure the differential follower. | |
| bool | FollowerUsesCommonLeaderConfigs = true |
| Whether the follower should overwrite some of its initial configs with common configs from the LeaderInitialConfigs, such as current limits. | |
All constants for setting up the motors of a differential mechanism.
|
constexprdefault |
|
inlineconstexpr |
Modifies the Alignment parameter and returns itself.
The alignment of the differential leader and follower motors, ignoring the configured inverts.
| newAlignment | Parameter to modify |
|
inlineconstexpr |
Modifies the CANBusName parameter and returns itself.
Name of the CAN bus the mechanism is on. Possible CAN bus strings are:
Note that all devices must be on the same CAN bus.
| newCANBusName | Parameter to modify |
|
inlineconstexpr |
Modifies the ClosedLoopRate parameter and returns itself.
The update rate of the closed-loop controllers. This determines the update rate of the differential leader's DifferentialOutput status signal, the follower's Position and Velocity signals, and the relevant signals for any other selected differential sensor.
| newClosedLoopRate | Parameter to modify |
|
inlineconstexpr |
Modifies the FollowerId parameter and returns itself.
CAN ID of the follower motor in the differential mechanism. The follower will have the differential output subtracted from its regular output.
| newFollowerId | Parameter to modify |
|
inlineconstexpr |
Modifies the FollowerInitialConfigs parameter and returns itself.
The initial configs used to configure the differential follower. The default value is the factory-default.
Users may change the initial configuration as they need. Any config that's not referenced in the DifferentialMotorConstants class is available to be changed.
The list of configs that will be overwritten is as follows:
If FollowerUsesCommonLeaderConfigs is set to true (default), the following configs are copied from LeaderInitialConfigs:
| newFollowerInitialConfigs | Parameter to modify |
|
inlineconstexpr |
Modifies the FollowerUsesCommonLeaderConfigs parameter and returns itself.
Whether the follower should overwrite some of its initial configs with common configs from the LeaderInitialConfigs, such as current limits. The list of configs that are copied is documented in FollowerInitialConfigs.
| newFollowerUsesCommonLeaderConfigs | Parameter to modify |
|
inlineconstexpr |
Modifies the LeaderId parameter and returns itself.
CAN ID of the leader motor in the differential mechanism. The leader will have the differential output added to its regular output.
| newLeaderId | Parameter to modify |
|
inlineconstexpr |
Modifies the LeaderInitialConfigs parameter and returns itself.
The initial configs used to configure the differential leader. The default value is the factory-default.
Users may change the initial configuration as they need. Any config that's not referenced in the DifferentialMotorConstants class is available to be changed.
The list of configs that will be overwritten is as follows:
| newLeaderInitialConfigs | Parameter to modify |
|
inlineconstexpr |
Modifies the SensorToDifferentialRatio parameter and returns itself.
The ratio of sensor rotations to the differential mechanism's difference output, where a ratio greater than 1 is a reduction.
When not using a separate sensor on the difference axis, the sensor is considered half of the difference between the two motor controllers' mechanism positions/velocities. As a result, this should be set to the gear ratio on the difference axis in that scenario, or any gear ratio between the sensor and the mechanism differential when using another sensor source.
| newSensorToDifferentialRatio | Parameter to modify |
| signals::MotorAlignmentValue ctre::phoenix6::mechanisms::DifferentialMotorConstants< MotorConfigsT >::Alignment = signals::MotorAlignmentValue::Aligned |
The alignment of the differential leader and follower motors, ignoring the configured inverts.
| std::string_view ctre::phoenix6::mechanisms::DifferentialMotorConstants< MotorConfigsT >::CANBusName = "" |
Name of the CAN bus the mechanism is on.
Possible CAN bus strings are:
Note that all devices must be on the same CAN bus.
| units::frequency::hertz_t ctre::phoenix6::mechanisms::DifferentialMotorConstants< MotorConfigsT >::ClosedLoopRate = 100_Hz |
The update rate of the closed-loop controllers.
This determines the update rate of the differential leader's DifferentialOutput status signal, the follower's Position and Velocity signals, and the relevant signals for any other selected differential sensor.
| int ctre::phoenix6::mechanisms::DifferentialMotorConstants< MotorConfigsT >::FollowerId = 0 |
CAN ID of the follower motor in the differential mechanism.
The follower will have the differential output subtracted from its regular output.
| MotorConfigsT ctre::phoenix6::mechanisms::DifferentialMotorConstants< MotorConfigsT >::FollowerInitialConfigs = {} |
The initial configs used to configure the differential follower.
The default value is the factory-default.
Users may change the initial configuration as they need. Any config that's not referenced in the DifferentialMotorConstants class is available to be changed.
The list of configs that will be overwritten is as follows:
If FollowerUsesCommonLeaderConfigs is set to true (default), the following configs are copied from LeaderInitialConfigs:
| bool ctre::phoenix6::mechanisms::DifferentialMotorConstants< MotorConfigsT >::FollowerUsesCommonLeaderConfigs = true |
Whether the follower should overwrite some of its initial configs with common configs from the LeaderInitialConfigs, such as current limits.
The list of configs that are copied is documented in FollowerInitialConfigs.
| int ctre::phoenix6::mechanisms::DifferentialMotorConstants< MotorConfigsT >::LeaderId = 0 |
CAN ID of the leader motor in the differential mechanism.
The leader will have the differential output added to its regular output.
| MotorConfigsT ctre::phoenix6::mechanisms::DifferentialMotorConstants< MotorConfigsT >::LeaderInitialConfigs = {} |
The initial configs used to configure the differential leader.
The default value is the factory-default.
Users may change the initial configuration as they need. Any config that's not referenced in the DifferentialMotorConstants class is available to be changed.
The list of configs that will be overwritten is as follows:
| units::dimensionless::scalar_t ctre::phoenix6::mechanisms::DifferentialMotorConstants< MotorConfigsT >::SensorToDifferentialRatio = 1.0 |
The ratio of sensor rotations to the differential mechanism's difference output, where a ratio greater than 1 is a reduction.
When not using a separate sensor on the difference axis, the sensor is considered half of the difference between the two motor controllers' mechanism positions/velocities. As a result, this should be set to the gear ratio on the difference axis in that scenario, or any gear ratio between the sensor and the mechanism differential when using another sensor source.