Class OneShotTriggerEvent

java.lang.Object
com.pathplanner.lib.events.Event
com.pathplanner.lib.events.OneShotTriggerEvent

public class OneShotTriggerEvent extends Event
Event that will activate a trigger, then deactivate it the next loop
  • Constructor Details

    • OneShotTriggerEvent

      public OneShotTriggerEvent(double timestamp, String name)
      Create an event for activating a trigger, then deactivating it the next loop
      Parameters:
      timestamp - The trajectory timestamp of this event
      name - The name of the trigger to control
    • OneShotTriggerEvent

      public OneShotTriggerEvent(edu.wpi.first.units.measure.Time timestamp, String name)
      Create an event for activating a trigger, then deactivating it the next loop
      Parameters:
      timestamp - The trajectory timestamp of this event
      name - The name of the trigger to control
  • Method Details

    • getEventName

      public String getEventName()
      Get the event name for this event
      Returns:
      The event name
    • handleEvent

      public void handleEvent(EventScheduler eventScheduler)
      Description copied from class: Event
      Handle this event
      Specified by:
      handleEvent in class Event
      Parameters:
      eventScheduler - Reference to the EventScheduler handling this event
    • cancelEvent

      public void cancelEvent(EventScheduler eventScheduler)
      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 class Event
      Parameters:
      eventScheduler - Reference to the EventScheduler handling this event
    • copyWithTimestamp

      public Event copyWithTimestamp(double timestampSeconds)
      Description copied from class: Event
      Copy this event with a different timestamp
      Specified by:
      copyWithTimestamp in class Event
      Parameters:
      timestampSeconds - The new timestamp
      Returns:
      Copied event with new time