Package trclib.archive
Class TrcTankMotionProfileFollower
java.lang.Object
trclib.archive.TrcTankMotionProfileFollower
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTrcTankMotionProfileFollower
(String instanceName) Constructor: Create an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionabstract void
cancel()
This method stops following the path and cancel the event.abstract TrcTankMotionProfile
This method returns the motion profile currently being followed by the follower.abstract boolean
isActive()
This method checks if path is currently being followed.abstract boolean
This method checks if path following has been cancelled.void
start
(TrcTankMotionProfile profile) This method starts following the supplied motion profile.void
start
(TrcTankMotionProfile profile, TrcEvent event) This method starts following the supplied motion profile.abstract void
start
(TrcTankMotionProfile profile, TrcEvent event, double timeout) This method starts following the supplied motion profile.toString()
This method returns the instance name.
-
Field Details
-
instanceName
-
-
Constructor Details
-
TrcTankMotionProfileFollower
Constructor: Create an instance of the object.- Parameters:
instanceName
- specifies the instance name.
-
-
Method Details
-
start
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
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
This method returns the instance name. -
start
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
This method starts following the supplied motion profile.- Parameters:
profile
- specifies the TrcTankMotionProfile object representing the path to follow. Remember to match units!
-