LemLib  0.4.7
An easy to use and feature-rich PROS template
Loading...
Searching...
No Matches
lemlib::TrackingWheel Class Reference

Public Member Functions

 TrackingWheel (pros::ADIEncoder *encoder, float diameter, float distance, float gearRatio=1)
 Create a new tracking wheel. More...
 
 TrackingWheel (pros::Rotation *encoder, float diameter, float distance, float gearRatio=1)
 Create a new tracking wheel. More...
 
 TrackingWheel (pros::Motor_Group *motors, float diameter, float distance, float rpm)
 Create a new tracking wheel. More...
 
void reset ()
 Reset the tracking wheel position to 0. More...
 
float getDistanceTraveled ()
 Get the distance traveled by the tracking wheel. More...
 
float getOffset ()
 Get the offset of the tracking wheel from the center of rotation. More...
 
int getType ()
 Get the type of tracking wheel. More...
 

Constructor & Destructor Documentation

◆ TrackingWheel() [1/3]

lemlib::TrackingWheel::TrackingWheel ( pros::ADIEncoder *  encoder,
float  diameter,
float  distance,
float  gearRatio = 1 
)

Create a new tracking wheel.

Parameters
encoderthe optical shaft encoder to use
diameterdiameter of the tracking wheel in inches
distancedistance between the tracking wheel and the center of rotation in inches
gearRatiogear ratio of the tracking wheel, defaults to 1

◆ TrackingWheel() [2/3]

lemlib::TrackingWheel::TrackingWheel ( pros::Rotation *  encoder,
float  diameter,
float  distance,
float  gearRatio = 1 
)

Create a new tracking wheel.

Parameters
encoderthe v5 rotation sensor to use
diameterdiameter of the tracking wheel in inches
distancedistance between the tracking wheel and the center of rotation in inches
gearRatiogear ratio of the tracking wheel, defaults to 1

◆ TrackingWheel() [3/3]

lemlib::TrackingWheel::TrackingWheel ( pros::Motor_Group *  motors,
float  diameter,
float  distance,
float  rpm 
)

Create a new tracking wheel.

Parameters
motorsthe motor group to use
diameterdiameter of the drivetrain wheels in inches
distancehalf the track width of the drivetrain in inches
rpmtheoretical maximum rpm of the drivetrain wheels

Member Function Documentation

◆ getDistanceTraveled()

float lemlib::TrackingWheel::getDistanceTraveled ( )

Get the distance traveled by the tracking wheel.

Returns
float distance traveled in inches

◆ getOffset()

float lemlib::TrackingWheel::getOffset ( )

Get the offset of the tracking wheel from the center of rotation.

Returns
float offset in inches

◆ getType()

int lemlib::TrackingWheel::getType ( )

Get the type of tracking wheel.

Returns
int - 1 if motor group, 0 otherwise

◆ reset()

void lemlib::TrackingWheel::reset ( )

Reset the tracking wheel position to 0.


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