Package com.pathplanner.lib.events
Class TriggerEvent
java.lang.Object
com.pathplanner.lib.events.Event
com.pathplanner.lib.events.TriggerEvent
Event for setting the value of an event trigger
-
Constructor Summary
ConstructorDescriptionTriggerEvent
(double timestamp, String name, boolean active) Create an event for changing the value of a named triggerTriggerEvent
(edu.wpi.first.units.measure.Time timestamp, String name, boolean active) Create an event for changing the value of a named trigger -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancelEvent
(EventScheduler eventScheduler) Cancel this event.copyWithTimestamp
(double timestampSeconds) Copy this event with a different timestampGet the event name for this eventboolean
getValue()
Get whether this event will set the trigger high or lowvoid
handleEvent
(EventScheduler eventScheduler) Handle this eventMethods inherited from class com.pathplanner.lib.events.Event
copyWithTimestamp, getTimestamp, getTimestampSeconds, setTimestamp, setTimestamp
-
Constructor Details
-
TriggerEvent
Create an event for changing the value of a named trigger- Parameters:
timestamp
- The trajectory timestamp of this eventname
- The name of the trigger to controlactive
- Should the trigger be activated by this event
-
TriggerEvent
Create an event for changing the value of a named trigger- Parameters:
timestamp
- The trajectory timestamp of this eventname
- The name of the trigger to controlactive
- Should the trigger be activated by this event
-
-
Method Details
-
getEventName
Get the event name for this event- Returns:
- The event name
-
getValue
public boolean getValue()Get whether this event will set the trigger high or low- Returns:
- Value of the trigger
-
handleEvent
Handle this event- Specified by:
handleEvent
in classEvent
- Parameters:
eventScheduler
- Reference to the EventScheduler running this event
-
cancelEvent
Description copied from class:Event
Cancel this event. This will be called if a path following command ends before this event gets handled.- Specified by:
cancelEvent
in classEvent
- Parameters:
eventScheduler
- Reference to the EventScheduler handling this event
-
copyWithTimestamp
Description copied from class:Event
Copy this event with a different timestamp- Specified by:
copyWithTimestamp
in classEvent
- Parameters:
timestampSeconds
- The new timestamp- Returns:
- Copied event with new time
-