Package com.pathplanner.lib.events
Class Event
java.lang.Object
com.pathplanner.lib.events.Event
- Direct Known Subclasses:
CancelCommandEvent
,OneShotTriggerEvent
,PointTowardsZoneEvent
,ScheduleCommandEvent
,TriggerEvent
Base class for an event to be handled while path following
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
cancelEvent
(EventScheduler eventScheduler) Cancel this event.abstract Event
copyWithTimestamp
(double timestampSeconds) Copy this event with a different timestampcopyWithTimestamp
(edu.wpi.first.units.measure.Time timestamp) Copy this event with a different timestampedu.wpi.first.units.measure.Time
Get the trajectory timestamp for this eventdouble
Get the trajectory timestamp for this eventabstract void
handleEvent
(EventScheduler eventScheduler) Handle this eventvoid
setTimestamp
(double timestampSeconds) Set the trajectory timestamp of this eventvoid
setTimestamp
(edu.wpi.first.units.measure.Time timestamp) Set the trajectory timestamp of this event
-
Constructor Details
-
Event
public Event(double timestampSeconds) Create a new event- Parameters:
timestampSeconds
- The trajectory timestamp this event should be handled at
-
Event
public Event(edu.wpi.first.units.measure.Time timestamp) Create a new event- Parameters:
timestamp
- The trajectory timestamp this event should be handled at
-
-
Method Details
-
getTimestampSeconds
public double getTimestampSeconds()Get the trajectory timestamp for this event- Returns:
- Trajectory timestamp, in seconds
-
getTimestamp
public edu.wpi.first.units.measure.Time getTimestamp()Get the trajectory timestamp for this event- Returns:
- Trajectory timestamp
-
setTimestamp
public void setTimestamp(double timestampSeconds) Set the trajectory timestamp of this event- Parameters:
timestampSeconds
- Timestamp of this event along the trajectory
-
setTimestamp
public void setTimestamp(edu.wpi.first.units.measure.Time timestamp) Set the trajectory timestamp of this event- Parameters:
timestamp
- Timestamp of this event along the trajectory
-
handleEvent
Handle this event- Parameters:
eventScheduler
- Reference to the EventScheduler handling this event
-
cancelEvent
Cancel this event. This will be called if a path following command ends before this event gets handled.- Parameters:
eventScheduler
- Reference to the EventScheduler handling this event
-
copyWithTimestamp
Copy this event with a different timestamp- Parameters:
timestampSeconds
- The new timestamp- Returns:
- Copied event with new time
-
copyWithTimestamp
Copy this event with a different timestamp- Parameters:
timestamp
- The new timestamp- Returns:
- Copied event with new time
-