|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
Single tracking wheel for odometry. More...
#include <tracking_wheel.hpp>
Public Member Functions | |
| 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. | |
| 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 | get () |
| Returns how far the wheel has traveled in inches. | |
| double | get_raw () |
| Returns the raw sensor value. | |
| void | distance_to_center_set (double input) |
| Sets the distance to the center of the robot. | |
| double | distance_to_center_get () |
| Returns the distance to the center of the robot. | |
| void | distance_to_center_flip_set (bool input) |
| Sets the distance to the center to be flipped to negative or not. | |
| bool | distance_to_center_flip_get () |
| Returns if the distance to center is flipped or not. | |
| void | reset () |
| Resets your sensor. | |
| double | ticks_per_inch () |
| Returns the constant for how many ticks is 1 inch. | |
| void | ticks_per_rev_set (double input) |
| Sets the amount of ticks per revolution of your sensor. | |
| double | ticks_per_rev_get () |
| Returns the amount of ticks per revolution of your sensor. | |
| void | ratio_set (double input) |
| Sets the gear ratio for your tracking wheel. | |
| double | ratio_get () |
| Returns the gear ratio for your tracking wheel. | |
| void | wheel_diameter_set (double input) |
| Sets the diameter of your wheel. | |
| double | wheel_diameter_get () |
| Returns the diameter of your wheel. | |
Public Attributes | |
| pros::adi::Encoder | adi_encoder |
| Backing ADI encoder (used when constructed from ADI ports). | |
| pros::Rotation | smart_encoder |
| Backing Rotation sensor (used when constructed from a smart port). | |
Single tracking wheel for odometry.
Construct from either an ADI encoder pair, an ADI encoder via a 3-wire expander, or a smart Rotation sensor. The class then reports distance traveled (inches) and exposes the offset to the robot center used by the odom kinematics.
Definition at line 30 of file tracking_wheel.hpp.
| light::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.
| 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 |
| light::tracking_wheel::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.
| 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 |
| light::tracking_wheel::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.
| port | the port your Rotation sensor is plugged into, make this 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 |
| bool light::tracking_wheel::distance_to_center_flip_get | ( | ) |
Returns if the distance to center is flipped or not.
False is not, true is.
| void light::tracking_wheel::distance_to_center_flip_set | ( | bool | input | ) |
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 |
| double light::tracking_wheel::distance_to_center_get | ( | ) |
Returns the distance to the center of the robot.
| void light::tracking_wheel::distance_to_center_set | ( | double | input | ) |
Sets the distance to the center of the robot.
| input | distance to the center of your robot in inches |
| double light::tracking_wheel::get | ( | ) |
Returns how far the wheel has traveled in inches.
| double light::tracking_wheel::get_raw | ( | ) |
Returns the raw sensor value.
| double light::tracking_wheel::ratio_get | ( | ) |
Returns the gear ratio for your tracking wheel.
| void light::tracking_wheel::ratio_set | ( | double | input | ) |
Sets the gear ratio for your tracking wheel.
| input | gear ratio of tracking wheel |
| void light::tracking_wheel::reset | ( | ) |
Resets your sensor.
| double light::tracking_wheel::ticks_per_inch | ( | ) |
Returns the constant for how many ticks is 1 inch.
| double light::tracking_wheel::ticks_per_rev_get | ( | ) |
Returns the amount of ticks per revolution of your sensor.
| void light::tracking_wheel::ticks_per_rev_set | ( | double | input | ) |
Sets the amount of ticks per revolution of your sensor.
This is useful for custom encoders.
| input | ticks per revolution |
| double light::tracking_wheel::wheel_diameter_get | ( | ) |
Returns the diameter of your wheel.
| void light::tracking_wheel::wheel_diameter_set | ( | double | input | ) |
Sets the diameter of your wheel.
| input | wheel diameter |
| pros::adi::Encoder light::tracking_wheel::adi_encoder |
Backing ADI encoder (used when constructed from ADI ports).
Definition at line 32 of file tracking_wheel.hpp.
| pros::Rotation light::tracking_wheel::smart_encoder |
Backing Rotation sensor (used when constructed from a smart port).
Definition at line 33 of file tracking_wheel.hpp.