Class CancelCommandEvent

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

public class CancelCommandEvent extends Event
Event that will cancel a command within the EventScheduler
  • Constructor Details

    • CancelCommandEvent

      public CancelCommandEvent(double timestamp, Command command)
      Create an event to cancel a command
      Parameters:
      timestamp - The trajectory timestamp for this event
      command - The command to cancel
    • CancelCommandEvent

      public CancelCommandEvent(edu.wpi.first.units.measure.Time timestamp, Command command)
      Create an event to cancel a command
      Parameters:
      timestamp - The trajectory timestamp for this event
      command - The command to cancel
  • Method Details

    • 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