36extern pros::Controller
master;
218double clamp(
double input,
double max,
double min);
230double clamp(
double input,
double max);
292 return std::atan2(std::sin(a), std::cos(a));
PROS API header provides high-level user functionality.
constexpr double IN_PER_M
Inches per meter.
constexpr double MM_PER_IN
Millimeters per inch.
constexpr double IN_PER_MM
Inches per millimeter.
constexpr double DEG_PER_RAD
Degrees per radian.
constexpr double RAD_PER_DEG
Radians per degree.
constexpr double M_PER_IN
Meters per inch.
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.
const int DELAY_TIME
Default loop period for LightLib background tasks, in milliseconds.
int places_after_decimal(double input, int min=0)
Returns the amount of places after a decimal, maxing out at 6.
double to_rad(double input)
Converts degrees to radians.
int sgn(double input)
Returns 1 if input is positive and -1 if input is negative.
bool AUTON_RAN
Set true once any autonomous routine has run this match.
double distance_to_point(pose itarget, pose icurrent)
Returns the distance between two points.
const bool SD_CARD_ACTIVE
True if an SD card is currently inserted.
pose vector_off_point(double added, pose icurrent)
Returns a new pose that is projected off of the current pose.
odom united_odom_to_odom(united_odom input)
Converts odom movement with united pose to an odom movement without united pose.
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.
float wrap_rad(float a)
Wraps an angle in radians to the half-open interval (-pi, pi].
double absolute_angle_to_point(pose itarget, pose icurrent)
Returns the angle between two points.
bool reversed_active(double input)
Returns true if the input is < 0.
pose united_pose_to_pose(united_pose input)
Converts pose with okapi units to a pose without okapi units.
double to_deg(double input)
Converts radians to degrees.
double wrap_angle(double theta)
Constrains an angle between 180 and -180.
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 clamp(double input, double max, double min)
Returns input restricted to min-max threshold.
std::string to_string_with_precision(double input, int n=2)
Returns a string with a specific number of decimal points.
Public LightLib odometry / pose-estimation API.
e_type
Arcade joystick layout.
@ SINGLE
Single-stick arcade (one stick = throttle + turn).
e_angle_behavior
How to choose a turn direction when reaching an absolute heading.
@ left_turn
Always turn counterclockwise.
@ raw
Use signed delta as-is (no wrap).
@ right_turn
Always turn clockwise.
@ shortest
Pick the smaller of CW/CCW.
const okapi::QAngle p_ANGLE_NOT_SET
Sentinel value indicating "no angle specified" (united).
void screen_print(std::string text, int line=0)
Prints to the brain screen in one string.
e_swing
Direction for swing-turn motions.
@ LEFT_SWING
Left side stationary, right side drives.
std::string exit_to_string(exit_output input)
Returns a human-readable name for an exit_output code.
const double ANGLE_NOT_SET
Sentinel value indicating "no angle specified".
exit_output
Result codes returned by PID::exit_condition.
@ VELOCITY_EXIT
Stopped moving long enough.
@ RUNNING
Still inside the motion.
@ BIG_EXIT
Big-error timer expired.
@ SMALL_EXIT
Small-error timer expired.
@ mA_EXIT
Motor current limit hit.
e_mode
Active chassis motion mode.
@ TURN
Turn-in-place to absolute heading.
@ TURN_TO_POINT
Turn to face a field point.
@ DISABLE
No motion active.
@ DRIVE
Straight-line drive.
@ POINT_TO_POINT
Drive to a field point.
void ez_template_print()
Prints our branding all over your pros terminal.
drive_directions
Drive direction with multiple spelling aliases.
One waypoint of an odom-mode movement.
int max_xy_speed
Speed cap, 0..127.
drive_directions drive_direction
Drive forward or reverse.
e_angle_behavior turn_behavior
How to choose turn direction.
2D pose: position (in) and heading (deg).
double y
Y position, inches.
double theta
Heading, degrees.
double x
X position, inches.
One waypoint of an odom-mode movement, with okapi units.
e_angle_behavior turn_behavior
How to choose turn direction.
int max_xy_speed
Speed cap, 0..127.
united_pose target
Target pose with units.
drive_directions drive_direction
Drive forward or reverse.
2D pose with okapi units.
okapi::QLength y
Y position with units.
okapi::QLength x
X position with units.
okapi::QAngle theta
Heading with units.
pros::Controller master
Global V5 master controller, used by opcontrol throughout LightLib.