SubZero Common
Common library components for an FRC CommandRobot
Loading...
Searching...
No Matches
subzero::PidMotorControllerPair< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder > Class Template Reference

Encapsulates a pair of motors that should be treated as a single unit. More...

#include <PidMotorControllerPair.h>

+ Collaboration diagram for subzero::PidMotorControllerPair< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder >:

Public Member Functions

 PidMotorControllerPair (std::string prefix, PidMotorController< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder > &first, PidMotorController< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder > &second)
 Construct a new Pi MotorControllerPair.
 
void RunWithVelocity (units::revolutions_per_minute_t rpmFirst, units::revolutions_per_minute_t rpmSecond)
 Run motors at the given RPM.
 
void RunWithVelocity (double percentageFirst, double percentageSecond)
 Run motors at the given percentage of max RPM.
 
void Stop ()
 Stop both motors.
 
const PidSettingsGetPidSettings () const
 
void UpdatePidSettings (PidSettings settings)
 

Public Attributes

const std::string m_shuffleboardPrefix
 

Detailed Description

template<typename TMotor, typename TController, typename TRelativeEncoder, typename TAbsoluteEncoder>
class subzero::PidMotorControllerPair< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder >

Encapsulates a pair of motors that should be treated as a single unit.

Template Parameters
TMotor
TController
TRelativeEncoder
TAbsoluteEncoder

Definition at line 25 of file PidMotorControllerPair.h.

Constructor & Destructor Documentation

◆ PidMotorControllerPair()

template<typename TMotor , typename TController , typename TRelativeEncoder , typename TAbsoluteEncoder >
subzero::PidMotorControllerPair< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder >::PidMotorControllerPair ( std::string prefix,
PidMotorController< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder > & first,
PidMotorController< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder > & second )
inlineexplicit

Construct a new Pi MotorControllerPair.

Parameters
prefixCommon identifier prefix in SmartDashboard
first
second

Definition at line 34 of file PidMotorControllerPair.h.

Member Function Documentation

◆ GetPidSettings()

template<typename TMotor , typename TController , typename TRelativeEncoder , typename TAbsoluteEncoder >
const PidSettings & subzero::PidMotorControllerPair< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder >::GetPidSettings ( ) const
inline

Definition at line 75 of file PidMotorControllerPair.h.

◆ RunWithVelocity() [1/2]

template<typename TMotor , typename TController , typename TRelativeEncoder , typename TAbsoluteEncoder >
void subzero::PidMotorControllerPair< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder >::RunWithVelocity ( double percentageFirst,
double percentageSecond )
inline

Run motors at the given percentage of max RPM.

Parameters
percentageFirstPercentage of the first motor
percentageSecondPercentage of the second motor

Definition at line 61 of file PidMotorControllerPair.h.

◆ RunWithVelocity() [2/2]

template<typename TMotor , typename TController , typename TRelativeEncoder , typename TAbsoluteEncoder >
void subzero::PidMotorControllerPair< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder >::RunWithVelocity ( units::revolutions_per_minute_t rpmFirst,
units::revolutions_per_minute_t rpmSecond )
inline

Run motors at the given RPM.

Parameters
rpmFirstRPM of the first motor
rpmSecondRPM of the second motor

Definition at line 49 of file PidMotorControllerPair.h.

◆ Stop()

template<typename TMotor , typename TController , typename TRelativeEncoder , typename TAbsoluteEncoder >
void subzero::PidMotorControllerPair< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder >::Stop ( )
inline

Stop both motors.

Definition at line 70 of file PidMotorControllerPair.h.

◆ UpdatePidSettings()

template<typename TMotor , typename TController , typename TRelativeEncoder , typename TAbsoluteEncoder >
void subzero::PidMotorControllerPair< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder >::UpdatePidSettings ( PidSettings settings)
inline

Definition at line 77 of file PidMotorControllerPair.h.

Member Data Documentation

◆ m_shuffleboardPrefix

template<typename TMotor , typename TController , typename TRelativeEncoder , typename TAbsoluteEncoder >
const std::string subzero::PidMotorControllerPair< TMotor, TController, TRelativeEncoder, TAbsoluteEncoder >::m_shuffleboardPrefix

Definition at line 84 of file PidMotorControllerPair.h.


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