LemLib  0.4.7
An easy to use and feature-rich PROS template
Loading...
Searching...
No Matches
trackingWheel.hpp
Go to the documentation of this file.
1
12#pragma once
13
14#include "pros/motors.hpp"
15#include "pros/adi.hpp"
16#include "pros/rotation.hpp"
17
18namespace lemlib {
20 public:
29 TrackingWheel(pros::ADIEncoder* encoder, float diameter, float distance, float gearRatio = 1);
38 TrackingWheel(pros::Rotation* encoder, float diameter, float distance, float gearRatio = 1);
47 TrackingWheel(pros::Motor_Group* motors, float diameter, float distance, float rpm);
52 void reset();
64 float getOffset();
70 int getType();
71 private:
72 float diameter;
73 float distance;
74 float rpm;
75 pros::ADIEncoder* encoder = nullptr;
76 pros::Rotation* rotation = nullptr;
77 pros::Motor_Group* motors = nullptr;
78 float gearRatio = 1;
79};
80} // namespace lemlib
Definition: trackingWheel.hpp:19
int getType()
Get the type of tracking wheel.
TrackingWheel(pros::Rotation *encoder, float diameter, float distance, float gearRatio=1)
Create a new tracking wheel.
float getDistanceTraveled()
Get the distance traveled by the tracking wheel.
TrackingWheel(pros::Motor_Group *motors, float diameter, float distance, float rpm)
Create a new tracking wheel.
float getOffset()
Get the offset of the tracking wheel from the center of rotation.
void reset()
Reset the tracking wheel position to 0.
TrackingWheel(pros::ADIEncoder *encoder, float diameter, float distance, float gearRatio=1)
Create a new tracking wheel.