Skip to main content
Version: 3.2.1

Tracking Wheels

Constructors​

Rotation Sensor​

Creates a new tracking wheel with a Rotation sensor.

port the port your Rotation sensor is plugged into
wheel_diameter assumed inches, this is the diameter of your wheel
distance_to_center the distance to the center of your robot, this is used for tracking
ratio the gear ratio of your tracking wheel. if it's not geared, this should be 1.0

tracking_wheel(int port, double wheel_diameter, double distance_to_center = 0.0, double ratio = 1.0);

ADI Encoder​

Creates a new tracking wheel with an ADI Encoder.

ports {'A', 'B'} make the encoder negative if reversed
wheel_diameter assumed inches, this is the diameter of your wheel
distance_to_center the distance to the center of your robot, this is used for tracking
ratio the gear ratio of your tracking wheel. if it's not geared, this should be 1.0

tracking_wheel(std::vector<int> ports, double wheel_diameter, double distance_to_center = 0.0, double ratio = 1.0);

ADI Encoder 3-wire Expander​

Creates a new tracking wheel with an ADI Encoder plugged into a 3-wire expander.

smart_port the smart port your ADI Expander is plugged into
ports {'A', 'B'} make the encoder negative if reversed
wheel_diameter assumed inches, this is the diameter of your wheel
distance_to_center the distance to the center of your robot, this is used for tracking
ratio the gear ratio of your tracking wheel. if it's not geared, this should be 1.0

tracking_wheel(int smart_port, std::vector<int> ports, double wheel_diameter, double distance_to_center = 0.0, double ratio = 1.0);

Getters​

get()​

Returns how far the wheel has traveled in inches.

double get();

get_raw()​

Returns the raw sensor value.

double get_raw();

distance_to_center_get()​

Returns the distance to the center of the robot.

double distance_to_center_get();

distance_to_center_flip_get()​

Returns if the distance to center is flipped or not. False is not, true is.

double distance_to_center_flip_get();

ticks_per_inch()​

Returns the constant for how many ticks is 1 inch.

double ticks_per_inch();

ticks_per_rev_get()​

Returns the amount of ticks per revolution of your sensor.

double ticks_per_rev_get();

ratio_get()​

Returns the gear ratio for your tracking wheel.

double ratio_get();

wheel_diameter_get()​

Returns the diameter of your wheel.

double wheel_diameter_get();

Setters​

reset()​

Returns the diameter of your wheel.

void reset();

distance_to_center_set()​

Sets the distance to the center of the robot.

input distance to center of your robot in inches

void distance_to_center_set(double input);

distance_to_center_flip_set()​

Sets the distance to the center to be flipped to negative or not.

input flips distance to center to negative. false leaves it alone, true flips it

void distance_to_center_flip_set(bool input);

ticks_per_rev_set()​

Sets the amount of ticks per revolution of your sensor.

This is useful for custom encoders.

input ticks per revolution

void ticks_per_rev_set(double input);

ratio_set()​

Sets the gear ratio for your tracking wheel.

input gear ratio of tracking wheel

void ratio_set(double input);

wheel_diameter_set()​

Sets the diameter of your wheel.

input wheel diameter

void wheel_diameter_set(double input);