#include <generic_auto.h>
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
◆ add()
void GenericAuto::add |
( |
state_ptr | new_state | ) |
|
Add a new state to the autonomous via function point of type "bool (ptr*)()"
- Parameters
-
new_state | the 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_state | the 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
-
ms | how 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
-
blocking | Whether 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: