Class Event

java.lang.Object
com.pathplanner.lib.events.Event
Direct Known Subclasses:
CancelCommandEvent, OneShotTriggerEvent, PointTowardsZoneEvent, ScheduleCommandEvent, TriggerEvent

public abstract class Event extends Object
Base class for an event to be handled while path following
  • 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

      public abstract void handleEvent(EventScheduler eventScheduler)
      Handle this event
      Parameters:
      eventScheduler - Reference to the EventScheduler handling this event
    • cancelEvent

      public abstract void cancelEvent(EventScheduler eventScheduler)
      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

      public abstract Event copyWithTimestamp(double timestampSeconds)
      Copy this event with a different timestamp
      Parameters:
      timestampSeconds - The new timestamp
      Returns:
      Copied event with new time
    • copyWithTimestamp

      public Event copyWithTimestamp(edu.wpi.first.units.measure.Time timestamp)
      Copy this event with a different timestamp
      Parameters:
      timestamp - The new timestamp
      Returns:
      Copied event with new time