Class TrcTankMotionProfileFollower

java.lang.Object
trclib.archive.TrcTankMotionProfileFollower

public abstract class TrcTankMotionProfileFollower extends Object
This class is intended to be extended by a platform dependent Tank Motion Profile Follower. The extended class will implement the necessary abstract methods to start following the provided motion profile. In the future, this class will also implement the motion profile following logic for motor controllers that do not have native motion profile support. In this case, the extended class will provide methods to receive each profile way point and program the motor controller accordingly.
  • Field Details

    • instanceName

      protected final String instanceName
  • Constructor Details

    • TrcTankMotionProfileFollower

      public TrcTankMotionProfileFollower(String instanceName)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
  • Method Details

    • start

      public abstract void start(TrcTankMotionProfile profile, TrcEvent event, double timeout)
      This method starts following the supplied motion profile.
      Parameters:
      profile - specifies the TrcTankMotionProfile object representing the path to follow. Remember to match units!
      event - specifies the event to signal when path has been followed.
      timeout - specifies maximum number of seconds to spend following the path. 0.0 means no timeout.
    • getActiveProfile

      public abstract TrcTankMotionProfile getActiveProfile()
      This method returns the motion profile currently being followed by the follower.
      Returns:
      profile object currently being followed (null if not following any profile).
    • isActive

      public abstract boolean isActive()
      This method checks if path is currently being followed.
      Returns:
      true if yes, false otherwise.
    • isCancelled

      public abstract boolean isCancelled()
      This method checks if path following has been cancelled.
      Returns:
      true if someone has called the cancel() method while it was running, false otherwise.
    • cancel

      public abstract void cancel()
      This method stops following the path and cancel the event.
    • toString

      public String toString()
      This method returns the instance name.
      Overrides:
      toString in class Object
      Returns:
      instance name.
    • start

      public void start(TrcTankMotionProfile profile, TrcEvent event)
      This method starts following the supplied motion profile.
      Parameters:
      profile - specifies the TrcTankMotionProfile object representing the path to follow. Remember to match units!
      event - specifies the event to signal when path has been followed.
    • start

      public void start(TrcTankMotionProfile profile)
      This method starts following the supplied motion profile.
      Parameters:
      profile - specifies the TrcTankMotionProfile object representing the path to follow. Remember to match units!