PathPlannerLib
Loading...
Searching...
No Matches
pathplanner::EventScheduler Class Reference

Public Member Functions

 EventScheduler ()
 
void initialize (PathPlannerTrajectory trajectory)
 
void execute (units::second_t time)
 
void end ()
 
void scheduleCommand (std::shared_ptr< frc2::Command > command)
 
void cancelCommand (std::shared_ptr< frc2::Command > command)
 

Static Public Member Functions

static wpi::SmallSet< frc2::Subsystem *, 4 > getSchedulerRequirements (std::shared_ptr< PathPlannerPath > path)
 
static frc::EventLoop * getEventLoop ()
 

Constructor & Destructor Documentation

◆ EventScheduler()

pathplanner::EventScheduler::EventScheduler ( )
inline

Create a new EventScheduler

Member Function Documentation

◆ cancelCommand()

void EventScheduler::cancelCommand ( std::shared_ptr< frc2::Command >  command)

Cancel a command on this scheduler. Do not call this.

Parameters
commandThe command to cancel

◆ end()

void EventScheduler::end ( )

End commands currently/events currently being handled by this scheduler. This should be called from the end method of the command running this scheduler.

◆ execute()

void EventScheduler::execute ( units::second_t  time)

Run the scheduler. This should be called from the execute method of the command running this scheduler.

Parameters
timeThe current time along the trajectory

◆ getSchedulerRequirements()

static wpi::SmallSet< frc2::Subsystem *, 4 > pathplanner::EventScheduler::getSchedulerRequirements ( std::shared_ptr< PathPlannerPath path)
inlinestatic

Get the event requirements for the given path

Parameters
pathThe path to get all requirements for
Returns
Set of event requirements for the given path

◆ initialize()

void pathplanner::EventScheduler::initialize ( PathPlannerTrajectory  trajectory)
inline

Initialize the EventScheduler for the given trajectory. This should be called from the initialize method of the command running this scheduler.

Parameters
trajectoryThe trajectory this scheduler should handle events for

◆ scheduleCommand()

void EventScheduler::scheduleCommand ( std::shared_ptr< frc2::Command >  command)

Schedule a command on this scheduler. This will cancel other commands that share requirements with the given command. Do not call this.

Parameters
commandThe command to schedule

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