CTRE Phoenix 6 C++ 25.0.0-beta-4
|
Common constants for a swerve drivetrain. More...
#include <ctre/phoenix6/swerve/SwerveDrivetrainConstants.hpp>
Public Member Functions | |
constexpr | SwerveDrivetrainConstants ()=default |
constexpr SwerveDrivetrainConstants & | WithCANBusName (std::string_view newCANBusName) |
Modifies the CANBusName parameter and returns itself. | |
constexpr SwerveDrivetrainConstants & | WithPigeon2Id (int newPigeon2Id) |
Modifies the Pigeon2Id parameter and returns itself. | |
SwerveDrivetrainConstants & | WithPigeon2Configs (const std::optional< configs::Pigeon2Configuration > &newPigeon2Configs) |
Modifies the Pigeon2Configs parameter and returns itself. | |
Public Attributes | |
std::string_view | CANBusName = "rio" |
Name of the CAN bus the swerve drive is on. | |
int | Pigeon2Id = 0 |
CAN ID of the Pigeon2 on the drivetrain. | |
std::optional< configs::Pigeon2Configuration > | Pigeon2Configs = std::nullopt |
The configuration object to apply to the Pigeon2. | |
Common constants for a swerve drivetrain.
|
constexprdefault |
|
inlineconstexpr |
Modifies the CANBusName parameter and returns itself.
Name of the CAN bus the swerve drive is on. Possible CAN bus strings are:
Note that all devices must be on the same CAN bus.
newCANBusName | Parameter to modify |
|
inline |
Modifies the Pigeon2Configs parameter and returns itself.
The configuration object to apply to the Pigeon2. This defaults to null. If this remains null, then the Pigeon2 will not be configured (and whatever configs are on it remain on it). If this is not null, the Pigeon2 will be overwritten with these configs.
newPigeon2Configs | Parameter to modify |
|
inlineconstexpr |
Modifies the Pigeon2Id parameter and returns itself.
CAN ID of the Pigeon2 on the drivetrain.
newPigeon2Id | Parameter to modify |
std::string_view ctre::phoenix6::swerve::SwerveDrivetrainConstants::CANBusName = "rio" |
Name of the CAN bus the swerve drive is on.
Possible CAN bus strings are:
Note that all devices must be on the same CAN bus.
std::optional<configs::Pigeon2Configuration> ctre::phoenix6::swerve::SwerveDrivetrainConstants::Pigeon2Configs = std::nullopt |
The configuration object to apply to the Pigeon2.
This defaults to null. If this remains null, then the Pigeon2 will not be configured (and whatever configs are on it remain on it). If this is not null, the Pigeon2 will be overwritten with these configs.
int ctre::phoenix6::swerve::SwerveDrivetrainConstants::Pigeon2Id = 0 |
CAN ID of the Pigeon2 on the drivetrain.