Class TriggerEvent

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

public class TriggerEvent extends Event
Event for setting the value of an event trigger
  • Constructor Details

    • TriggerEvent

      public TriggerEvent(double timestamp, String name, boolean active)
      Create an event for changing the value of a named trigger
      Parameters:
      timestamp - The trajectory timestamp of this event
      name - The name of the trigger to control
      active - Should the trigger be activated by this event
    • TriggerEvent

      public TriggerEvent(edu.wpi.first.units.measure.Time timestamp, String name, boolean active)
      Create an event for changing the value of a named trigger
      Parameters:
      timestamp - The trajectory timestamp of this event
      name - The name of the trigger to control
      active - Should the trigger be activated by this event
  • Method Details

    • getEventName

      public String 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

      public void handleEvent(EventScheduler eventScheduler)
      Handle this event
      Specified by:
      handleEvent in class Event
      Parameters:
      eventScheduler - Reference to the EventScheduler running 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