Autonomous Guide

Every auton command, what it does, and examples.

Auton Skeleton

void pre_auton() {
  vexcodeInit();
  drive.init();
  selector.add("DriveToPoint", auton_drive_to_point);
  selector.show();
}

void autonomous() {
  selector.run_selected();
}

Drive Commands (Core)

drive_distance

Drives straight for a distance in inches.

drive.drive_distance(24, 60);

turn_to_heading

Turns to an absolute heading in degrees.

drive.turn_to_heading(90, 50);

turn_to_point

Turns to face a point on the field.

drive.turn_to_point(30, 18, 50);

swing_to_heading

Turns using only one side of the drive.

drive.swing_to_heading(90, 50, true);

drive_to_point

Drives to a target point with heading correction.

drive.drive_to_point(24, 12, 60);

drive_to_pose

Drives to a target point and ends at a heading.

drive.drive_to_pose(30, 18, 45, 60);

Async Motion

drive.drive_to_point_async(24, 12, 60);
if (drive.motion_running()) {
  // do other actions
}
drive.stop_motion();

Motion Chaining

clasi::MotionChain chain;
chain.add([&](){ drive.drive_distance(24, 60); });
chain.add([&](){ drive.turn_to_heading(90, 50); });
chain.add([&](){ drive.drive_to_point(36, 18, 60); });
chain.run();

Path Following

Pure Pursuit

auto path = clasi::make_arc(0, 0, 24, 0, 60, 8);
pure_pursuit.follow_path(drive, path,
                         clasi_config::kLookaheadIn,
                         clasi_config::kPathMaxPct);

Boomerang

boomerang.go_to(drive, 30, 18, 45, 60);

Beginner (Easy API) Auton

clasi_easy::drive_forward(drive, 24, 60);
clasi_easy::turn_deg(drive, 90, 50);
clasi_easy::go_to(drive, 24, 12, 60);
clasi_easy::go_to_pose(drive, 30, 18, 45, 60);

Best Practices

Reset odom at the start: drive.odom().reset(0,0,0);

Start with maxPct around 50–60.

Tune PID before running advanced paths.