Package org.wildstang.framework.auto
Class AutoManager
- java.lang.Object
-
- org.wildstang.framework.auto.AutoManager
-
public class AutoManager extends java.lang.Object
Manages all autonomous and AutoPrograms for the framework. Note: This manager previously tracked an AutoStartPosition Enum which was used to compare the current position to where the robot started autonomous. Due to a lack of use this was removed.
-
-
Constructor Summary
Constructors Constructor Description AutoManager()
Loads in AutoPrograms and adds selectors to the SmartDashboard.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProgram(AutoProgram program)
Adds a new program to AutoManager and SmartDashboard chooser.void
endPeriod()
Ends the autonomous period, prevents it from continuing into tele.AutoProgram
getRunningProgram()
Returns the current running AutoProgram, if one is running.java.lang.String
getRunningProgramName()
Returns the name of the current running AutoProgram, if one is running.void
init()
Resets the current program and all states.void
preloadLockedProgram()
Preloads the currently selected program from SmartDashboard if locked in.void
startCurrentProgram()
Starts the currently selected program from SmartDashboard if locked in.void
startSleeper()
Starts the default program, Sleeper, which does nothing and never ends.void
update()
Updates the running AutoProgram and detects if it is finished.
-
-
-
Method Detail
-
update
public void update()
Updates the running AutoProgram and detects if it is finished.
-
preloadLockedProgram
public void preloadLockedProgram()
Preloads the currently selected program from SmartDashboard if locked in.
-
startCurrentProgram
public void startCurrentProgram()
Starts the currently selected program from SmartDashboard if locked in.
-
startSleeper
public void startSleeper()
Starts the default program, Sleeper, which does nothing and never ends.
-
init
public void init()
Resets the current program and all states.
-
getRunningProgram
public AutoProgram getRunningProgram()
Returns the current running AutoProgram, if one is running.- Returns:
- The current running program, or null.
-
getRunningProgramName
public java.lang.String getRunningProgramName()
Returns the name of the current running AutoProgram, if one is running.- Returns:
- The name of the running program, or an empty String.
-
addProgram
public void addProgram(AutoProgram program)
Adds a new program to AutoManager and SmartDashboard chooser.- Parameters:
program
- New AutoProgram to add.
-
endPeriod
public void endPeriod()
Ends the autonomous period, prevents it from continuing into tele.
-
-