|
LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
|
Misc math, geometry, and unit-conversion helpers. More...
Functions | |
| int | places_after_decimal (double input, int min=0) |
| Returns the amount of places after a decimal, maxing out at 6. | |
| std::string | to_string_with_precision (double input, int n=2) |
| Returns a string with a specific number of decimal points. | |
| int | sgn (double input) |
| Returns 1 if input is positive and -1 if input is negative. | |
| bool | reversed_active (double input) |
| Returns true if the input is < 0. | |
| double | clamp (double input, double max, double min) |
| Returns input restricted to min-max threshold. | |
| double | clamp (double input, double max) |
| Returns input restricted to min-max threshold. | |
| double | to_deg (double input) |
| Converts radians to degrees. | |
| double | to_rad (double input) |
| Converts degrees to radians. | |
| double | absolute_angle_to_point (pose itarget, pose icurrent) |
| Returns the angle between two points. | |
| double | distance_to_point (pose itarget, pose icurrent) |
| Returns the distance between two points. | |
| double | wrap_angle (double theta) |
| Constrains an angle between 180 and -180. | |
| float | wrap_rad (float a) |
| Wraps an angle in radians to the half-open interval (-pi, pi]. | |
| pose | vector_off_point (double added, pose icurrent) |
| Returns a new pose that is projected off of the current pose. | |
| double | turn_shortest (double target, double current, bool print=false) |
| Returns the shortest angle for the robot to turn to in order to get to target. | |
| double | turn_longest (double target, double current, bool print=false) |
| Returns the farthest away angle for the robot to turn to in order to get to target. | |
| pose | united_pose_to_pose (united_pose input) |
| Converts pose with okapi units to a pose without okapi units. | |
| std::vector< odom > | united_odoms_to_odoms (std::vector< united_odom > inputs) |
| Converts vector of poses with okapi units to a vector of poses without okapi units. | |
| odom | united_odom_to_odom (united_odom input) |
| Converts odom movement with united pose to an odom movement without united pose. | |
Variables | |
| bool | AUTON_RAN |
| Set true once any autonomous routine has run this match. | |
| const bool | SD_CARD_ACTIVE = pros::usd::is_installed() |
| True if an SD card is currently inserted. | |
| const int | DELAY_TIME = 10 |
| Default loop period for LightLib background tasks, in milliseconds. | |
Misc math, geometry, and unit-conversion helpers.
Returns the angle between two points.
| itarget | target position |
| icurrent | current position |
| double light::util::clamp | ( | double | input, |
| double | max | ||
| ) |
Returns input restricted to min-max threshold.
The minimum used is negative max.
| input | your input value |
| max | the absolute value maximum input can be |
| double light::util::clamp | ( | double | input, |
| double | max, | ||
| double | min | ||
| ) |
Returns input restricted to min-max threshold.
| input | your input value |
| max | the maximum input can be |
| min | the minimum input can be |
Returns the distance between two points.
| itarget | target position |
| icurrent | current position |
| int light::util::places_after_decimal | ( | double | input, |
| int | min = 0 |
||
| ) |
Returns the amount of places after a decimal, maxing out at 6.
| input | your input value with decimals |
| min | minimum number of decimal places to print, this is defaulted to 0 |
| bool light::util::reversed_active | ( | double | input | ) |
Returns true if the input is < 0.
| input | your input value |
| int light::util::sgn | ( | double | input | ) |
Returns 1 if input is positive and -1 if input is negative.
| input | your input value |
| double light::util::to_deg | ( | double | input | ) |
Converts radians to degrees.
| input | your input radian |
| double light::util::to_rad | ( | double | input | ) |
Converts degrees to radians.
| input | your input degree |
| std::string light::util::to_string_with_precision | ( | double | input, |
| int | n = 2 |
||
| ) |
Returns a string with a specific number of decimal points.
| input | your input value |
| n | the amount of decimals you want to display |
| double light::util::turn_longest | ( | double | target, |
| double | current, | ||
| bool | print = false |
||
| ) |
Returns the farthest away angle for the robot to turn to in order to get to target.
| target | target value in degrees |
| current | current value in degrees |
| = false will print the new value if this is true, defaults to false |
| double light::util::turn_shortest | ( | double | target, |
| double | current, | ||
| bool | print = false |
||
| ) |
Returns the shortest angle for the robot to turn to in order to get to target.
| target | target value in degrees |
| current | current value in degrees |
| = false will print the new value if this is true, defaults to false |
| odom light::util::united_odom_to_odom | ( | united_odom | input | ) |
Converts odom movement with united pose to an odom movement without united pose.
| input | odom movement with units |
| std::vector< odom > light::util::united_odoms_to_odoms | ( | std::vector< united_odom > | inputs | ) |
Converts vector of poses with okapi units to a vector of poses without okapi units.
| inputs | poses with units |
| pose light::util::united_pose_to_pose | ( | united_pose | input | ) |
Converts pose with okapi units to a pose without okapi units.
| input | a pose with units |
Returns a new pose that is projected off of the current pose.
| added | how far to project a new point |
| icurrent | point to project off of |
| double light::util::wrap_angle | ( | double | theta | ) |
Constrains an angle between 180 and -180.
| theta | input angle in degrees |
|
inline |
|
extern |
Set true once any autonomous routine has run this match.
| const int light::util::DELAY_TIME = 10 |