86 template <
typename DriveReq,
typename SteerReq>
87 void Apply(DriveReq &&driveRequest, SteerReq &&steerRequest)
89 return _module->
Apply(std::forward<DriveReq>(driveRequest), std::forward<SteerReq>(steerRequest));
Class for CANcoder, a CAN based magnetic encoder that provides absolute and relative position along w...
Definition CANcoder.hpp:27
Class description for the Talon FX integrated motor controller.
Definition TalonFX.hpp:30
Swerve Module class that encapsulates a swerve module powered by CTR Electronics devices.
Definition SwerveModule.hpp:28
SwerveModulePosition GetCachedPosition() const
Gets the last cached swerve module position.
Definition SwerveModule.hpp:113
virtual void Apply(ModuleRequest const &moduleRequest)
Applies the desired ModuleRequest to this module.
Definition SwerveModule.hpp:73
virtual ~SwerveModule()=default
void Apply(DriveReq &&driveRequest, SteerReq &&steerRequest)
Controls this module using the specified drive and steer control requests.
Definition SwerveModule.hpp:87
SwerveModulePosition GetPosition(bool refresh)
Gets the state of this module and passes it back as a SwerveModulePosition object with latency compen...
Definition SwerveModule.hpp:101
SwerveModuleState GetCurrentState() const
Get the current state of the module.
Definition SwerveModule.hpp:126
SwerveModuleState GetTargetState() const
Get the target state of the module.
Definition SwerveModule.hpp:138
SwerveModule(SwerveModuleConstants const &constants, std::string_view canbusName, impl::SwerveModuleImpl &module)
Construct a SwerveModule with the specified constants.
hardware::TalonFX & GetSteerMotor()
Gets this module's Steer Motor TalonFX reference.
Definition SwerveModule.hpp:172
hardware::TalonFX & GetDriveMotor()
Gets this module's Drive Motor TalonFX reference.
Definition SwerveModule.hpp:159
impl::SwerveModuleImpl * _module
The underlying swerve module instance.
Definition SwerveModule.hpp:49
virtual void ResetPosition()
Resets this module's drive motor position to 0 rotations.
Definition SwerveModule.hpp:146
static constexpr int kNumConfigAttempts
Number of times to attempt config applies.
Definition SwerveModule.hpp:46
hardware::CANcoder & GetCANcoder()
Gets this module's CANcoder reference.
Definition SwerveModule.hpp:185
Swerve Module class that encapsulates a swerve module powered by CTR Electronics devices.
Definition SwerveModuleImpl.hpp:29
SwerveModuleState GetCurrentState() const
Get the current state of the module.
Definition SwerveModuleImpl.hpp:333
DriveRequestType
All possible control requests for the module drive motor.
Definition SwerveModuleImpl.hpp:50
SteerRequestType
All possible control requests for the module steer motor.
Definition SwerveModuleImpl.hpp:34
SwerveModuleState GetTargetState() const
Get the target state of the module.
Definition SwerveModuleImpl.hpp:345
void Apply(ModuleRequest const &moduleRequest)
Applies the desired ModuleRequest to this module.
SwerveModulePosition GetPosition(bool refresh)
Gets the state of this module and passes it back as a SwerveModulePosition object with latency compen...
void ResetPosition()
Resets this module's drive motor position to 0 rotations.
Definition SwerveModuleImpl.hpp:350
SwerveModulePosition GetCachedPosition() const
Gets the last cached swerve module position.
Definition SwerveModuleImpl.hpp:323
Definition StatusCodes.h:18
All constants for a swerve module.
Definition SwerveModuleConstants.hpp:53
Contains everything the swerve module needs to apply a request.
Definition SwerveModuleImpl.hpp:65