001/************************ PROJECT ZIXI ************************/
002/* Copyright (c) 2026 StuyPulse Robotics. All rights reserved.*/
003/* This work is licensed under the terms of the MIT license.  */
004/**************************************************************/
005package com.stuypulse.robot.commands.auton;
006
007import com.stuypulse.robot.RobotContainer;
008
009import org.wpilib.command3.Command;
010
011/**
012 *
013 *
014 * <h2>Auton </h2>
015 *
016 * <p>Used for previewing the selected auton's paths in elastic
017 *
018 * <p>The selected path disappears when a different auton is selected or when the robot is enabled
019 *
020 * <p>Define an auton in {@link AutonFactory} and add it to the auton chooser as shown in the
021 * example auton in {@link RobotContainer}
022 *
023 * <p>Auton routines without paths like characterization routines can be constructed using the
024 * {@link #noPaths} method
025 *
026 * @author Aiden Zhang (https://github.com/aidenzhang21345)
027 */
028public interface Auton {
029    /** Display auton path trajectories on elastic */
030    public default void displayPaths() {}
031
032    /** Clear auton path trajectories from elastic */
033    public default void clearPaths() {}
034
035    /**
036     * @return The auton command to be scheduled
037     */
038    public default Command getCommand() {
039        return Command.sequence().named("Do Nothing");
040    }
041
042    /**
043     * Used to construct autons with no paths such as sysid characterization routines
044     *
045     * @param command The command to run in the auton
046     */
047    public static Auton noPaths(Command command) {
048        return new Auton() {
049            @Override
050            public Command getCommand() {
051                return command;
052            }
053        };
054    }
055}