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

Autonomous routine declarations. More...

Go to the source code of this file.

Functions

Setup functions

Called once by initialize() in main.

Do not rename these.

void default_constants ()
 Tune PID gains, exit conditions, and slew rates.
 
void default_positions ()
 Set starting piston / mechanism states.
 
Autonomous routines

Competition autonomous entry points.

void run_jerryio_path_1 ()
 Run the path generated by the JerryIO path planner (path 1).
 
Example autons

One short routine per motion type.

Copy and edit when writing real autons.

void ex_drive ()
 pid_drive_set: straight forward + reverse.
 
void ex_turn ()
 pid_turn_set: in-place pivots to absolute headings.
 
void ex_swing ()
 pid_swing_set: single-side sweeping arcs.
 
void ex_chain ()
 pid_wait_quick_chain: flow drive→turn→drive.
 
void ex_odom_ptp ()
 pid_odom_set: drive to one field coordinate.
 
void ex_odom_path ()
 pid_odom_set: chain a path of odom waypoints.
 
void ex_move_to_point ()
 light::moveToPoint: simple odom move w/ timeout.
 
void ramsete_demo_s_curve ()
 followTrajectory: smooth RAMSETE S-curve.
 
void ramsete_char_kVkAkS ()
 Characterize feedforward kV/kA/kS.
 
void ramsete_char_trackwidth ()
 Characterize track width.
 
void ramsete_char_alat ()
 Characterize max lateral accel.
 
Test / tuning routines

Useful during practice for dialing in PID.

Register these in auton_config.cpp during tuning sessions; remove them before competition.

void con_test ()
 Basic connectivity / control check.
 
void drive_test (int inches)
 Drive straight N inches — tune drive PID.
 
void turn_test (int degrees)
 Turn to N degrees — tune turn PID.
 
void swing_test (int degrees)
 Swing to N degrees — tune swing PID.
 
void heading_test (int degrees)
 Drive while fighting a heading offset.
 
void odom_test (int degrees)
 Zero odom then drive 24 in — test odometry.
 

Detailed Description

Autonomous routine declarations.

Three files work together to set up autonomous:

  • autons.hpp — declare every auton function (this file)
  • autons.cpp — write the actual autonomous code
  • auton_config.cpp — register each auton with the brain-screen picker

Workflow for adding a new routine:

  1. Declare it here: void my_auton();
  2. Write it in autons.cpp
  3. Register it in auton_config.cpp: light::auton_selector.add("Label", "na", my_auton);

Definition in file autons.hpp.

Function Documentation

◆ con_test()

void con_test ( )

Basic connectivity / control check.

◆ default_constants()

void default_constants ( )

Tune PID gains, exit conditions, and slew rates.

◆ default_positions()

void default_positions ( )

Set starting piston / mechanism states.

◆ drive_test()

void drive_test ( int  inches)

Drive straight N inches — tune drive PID.

◆ ex_chain()

void ex_chain ( )

pid_wait_quick_chain: flow drive→turn→drive.

◆ ex_drive()

void ex_drive ( )

pid_drive_set: straight forward + reverse.

◆ ex_move_to_point()

void ex_move_to_point ( )

light::moveToPoint: simple odom move w/ timeout.

◆ ex_odom_path()

void ex_odom_path ( )

pid_odom_set: chain a path of odom waypoints.

◆ ex_odom_ptp()

void ex_odom_ptp ( )

pid_odom_set: drive to one field coordinate.

◆ ex_swing()

void ex_swing ( )

pid_swing_set: single-side sweeping arcs.

◆ ex_turn()

void ex_turn ( )

pid_turn_set: in-place pivots to absolute headings.

◆ heading_test()

void heading_test ( int  degrees)

Drive while fighting a heading offset.

◆ odom_test()

void odom_test ( int  degrees)

Zero odom then drive 24 in — test odometry.

◆ ramsete_char_alat()

void ramsete_char_alat ( )

Characterize max lateral accel.

◆ ramsete_char_kVkAkS()

void ramsete_char_kVkAkS ( )

Characterize feedforward kV/kA/kS.

◆ ramsete_char_trackwidth()

void ramsete_char_trackwidth ( )

Characterize track width.

◆ ramsete_demo_s_curve()

void ramsete_demo_s_curve ( )

followTrajectory: smooth RAMSETE S-curve.

◆ run_jerryio_path_1()

void run_jerryio_path_1 ( )

Run the path generated by the JerryIO path planner (path 1).

◆ swing_test()

void swing_test ( int  degrees)

Swing to N degrees — tune swing PID.

◆ turn_test()

void turn_test ( int  degrees)

Turn to N degrees — tune turn PID.