RIT VEXU Core API
Loading...
Searching...
No Matches
GenericAuto Class Reference

#include <generic_auto.h>

Public Member Functions

bool run (bool blocking)
 
void add (state_ptr new_state)
 
void add_async (state_ptr async_state)
 
void add_delay (int ms)
 

Detailed Description

GenericAuto provides a pleasant interface for organizing an auto path steps of the path can be added with add() and when ready, calling run() will begin executing the path

Member Function Documentation

◆ add()

void GenericAuto::add ( state_ptr new_state)

Add a new state to the autonomous via function point of type "bool (ptr*)()"

Parameters
new_statethe function to run

◆ add_async()

void GenericAuto::add_async ( state_ptr async_state)

Add a new state to the autonomous via function point of type "bool (ptr*)()" that will run asynchronously

Parameters
async_statethe function to run

◆ add_delay()

void GenericAuto::add_delay ( int ms)

add_delay adds a period where the auto system will simply wait for the specified time

Parameters
mshow long to wait in milliseconds

◆ run()

bool GenericAuto::run ( bool blocking)

The method that runs the autonomous. If 'blocking' is true, then this method will run through every state until it finished.

If blocking is false, then assuming every state is also non-blocking, the method will run through the current state in the list and return immediately.

Parameters
blockingWhether or not to block the thread until all states have run
Returns
true after all states have finished.

The documentation for this class was generated from the following files: