LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
extras.hpp File Reference

Miscellaneous helpers wired into the LightLib base init: brain-screen status print, motor-temperature controller buzz, a moveToPoint helper, and a small standalone PID struct used by characterization paths. More...

#include "LightLib/lib.hpp"
#include "LightLib/drive/odometry.hpp"
#include "pros/motor_group.hpp"

Go to the source code of this file.

Classes

struct  LightPID
 Lightweight PID controller used by characterization helpers. More...
 

Namespaces

namespace  light
 Public LightLib odometry / pose-estimation API.
 

Functions

void screen_print_tracker (light::tracking_wheel *tracker, std::string name, int line)
 Render one tracking-wheel's live position to a brain-screen line.
 
void screen_task ()
 Background task that paints status text to the brain screen.
 
void lib_extras ()
 Boots all the LightLib helper tasks (screen, temp watch, etc.).
 
void checkMotorTemp (pros::Controller &controller, pros::Motor &Top, pros::Motor &Bottom)
 Buzz the controller when a key drive motor exceeds the configured heat threshold (HEAT_BUZZ_TEMP in main.cpp).
 
void default_positions ()
 Set initial piston / mechanism states.
 
void track_basket ()
 Tracks a basket / scoring target (project-specific).
 
void light::extras_init (light::Drive *chassis, pros::MotorGroup *leftMotors, pros::MotorGroup *rightMotors)
 Register the user's drivetrain objects with LightLib.
 
void light::getDriveMotorGroups (pros::MotorGroup **leftOut, pros::MotorGroup **rightOut)
 Look up the registered drivetrain motor groups.
 
light::Drivelight::getChassis ()
 
void moveToPoint (float x, float y, int timeout, float maxSpeed=127.0f, bool reversed=false)
 Move the chassis to a field-relative (x, y) point.
 

Detailed Description

Miscellaneous helpers wired into the LightLib base init: brain-screen status print, motor-temperature controller buzz, a moveToPoint helper, and a small standalone PID struct used by characterization paths.

Definition in file extras.hpp.

Function Documentation

◆ checkMotorTemp()

void checkMotorTemp ( pros::Controller &  controller,
pros::Motor &  Top,
pros::Motor &  Bottom 
)

Buzz the controller when a key drive motor exceeds the configured heat threshold (HEAT_BUZZ_TEMP in main.cpp).

Parameters
controllercontroller to buzz
Topfirst motor to monitor
Bottomsecond motor to monitor

◆ default_positions()

void default_positions ( )

Set initial piston / mechanism states.

User-defined in autons.cpp.

◆ lib_extras()

void lib_extras ( )

Boots all the LightLib helper tasks (screen, temp watch, etc.).

◆ moveToPoint()

void moveToPoint ( float  x,
float  y,
int  timeout,
float  maxSpeed = 127.0f,
bool  reversed = false 
)

Move the chassis to a field-relative (x, y) point.

Parameters
xtarget X in inches
ytarget Y in inches
timeoutgive up after this many milliseconds
maxSpeedspeed cap, 0..127
reverseddrive to the point backwards

◆ screen_print_tracker()

void screen_print_tracker ( light::tracking_wheel tracker,
std::string  name,
int  line 
)

Render one tracking-wheel's live position to a brain-screen line.

Parameters
trackertracking_wheel to print
namelabel printed before the value
linebrain-screen line index (0..7)

◆ screen_task()

void screen_task ( )

Background task that paints status text to the brain screen.

◆ track_basket()

void track_basket ( )

Tracks a basket / scoring target (project-specific).