47 tracking_wheel(std::vector<int> ports,
double wheel_diameter,
double distance_to_center = 0.0,
double ratio = 1.0);
63 tracking_wheel(
int smart_port, std::vector<int> ports,
double wheel_diameter,
double distance_to_center = 0.0,
double ratio = 1.0);
77 tracking_wheel(
int port,
double wheel_diameter,
double distance_to_center = 0.0,
double ratio = 1.0);
167#define DRIVE_ADI_ENCODER 2
168#define DRIVE_ROTATION 3
171 bool IS_FLIPPED =
false;
173 double DISTANCE_TO_CENTER = 0.0;
174 double WHEEL_DIAMETER = 0.0;
176 double ENCODER_TICKS_PER_REV = 0.0;
177 double WHEEL_TICK_PER_REV = 0.0;
Single tracking wheel for odometry.
void ticks_per_rev_set(double input)
Sets the amount of ticks per revolution of your sensor.
pros::Rotation smart_encoder
Backing Rotation sensor (used when constructed from a smart port).
void ratio_set(double input)
Sets the gear ratio for your tracking wheel.
tracking_wheel(std::vector< int > ports, double wheel_diameter, double distance_to_center=0.0, double ratio=1.0)
Creates a new tracking wheel with an ADI Encoder.
bool distance_to_center_flip_get()
Returns if the distance to center is flipped or not.
pros::adi::Encoder adi_encoder
Backing ADI encoder (used when constructed from ADI ports).
void wheel_diameter_set(double input)
Sets the diameter of your wheel.
double get()
Returns how far the wheel has traveled in inches.
double get_raw()
Returns the raw sensor value.
tracking_wheel(int smart_port, std::vector< int > ports, double wheel_diameter, double distance_to_center=0.0, double ratio=1.0)
Creates a new tracking wheel with an ADI Encoder plugged into a 3-wire expander.
tracking_wheel(int port, double wheel_diameter, double distance_to_center=0.0, double ratio=1.0)
Creates a new tracking wheel with a Rotation sensor.
double wheel_diameter_get()
Returns the diameter of your wheel.
double distance_to_center_get()
Returns the distance to the center of the robot.
void distance_to_center_set(double input)
Sets the distance to the center of the robot.
double ratio_get()
Returns the gear ratio for your tracking wheel.
void reset()
Resets your sensor.
double ticks_per_rev_get()
Returns the amount of ticks per revolution of your sensor.
void distance_to_center_flip_set(bool input)
Sets the distance to the center to be flipped to negative or not.
double ticks_per_inch()
Returns the constant for how many ticks is 1 inch.
Public LightLib odometry / pose-estimation API.