public class TrajectoryFollower
Generic class Trajectory
follower for time-based pose reference tracking.
class Trajectory
@NotNull protected Trajectory trajectory
Trajectory being followed if isFollowing
is true.
isFollowing
@JvmOverloads public TrajectoryFollower(@NotNull Pose2d admissibleError, double timeout, @NotNull NanoClock clock)
Generic class Trajectory
follower for time-based pose reference tracking.
admissibleError
- admissible/satisfactory pose error at the end of each movetimeout
- max time to wait for the error to be admissibleclock
- clockclass Trajectory
@JvmOverloads public TrajectoryFollower(@NotNull Pose2d admissibleError, double timeout)
Generic class Trajectory
follower for time-based pose reference tracking.
admissibleError
- admissible/satisfactory pose error at the end of each movetimeout
- max time to wait for the error to be admissibleclass Trajectory
@JvmOverloads public TrajectoryFollower(@NotNull Pose2d admissibleError)
Generic class Trajectory
follower for time-based pose reference tracking.
admissibleError
- admissible/satisfactory pose error at the end of each moveclass Trajectory
@JvmOverloads public TrajectoryFollower()
Generic class Trajectory
follower for time-based pose reference tracking.
class Trajectory
@NotNull public Trajectory getTrajectory()
Trajectory being followed if isFollowing
is true.
isFollowing
protected void setTrajectory(@NotNull Trajectory p)
Trajectory being followed if isFollowing
is true.
isFollowing
@NotNull public Pose2d getLastError()
Robot pose error computed in the last update
call.
update
protected void setLastError(@NotNull Pose2d p)
Robot pose error computed in the last update
call.
update
public void followTrajectory(@NotNull Trajectory trajectory)
Follow the given trajectory
.
trajectory
public boolean isFollowing()
Returns true if the current trajectory is currently executing.
public double elapsedTime()
Returns the elapsed time since the last followTrajectory
call.
followTrajectory
@JvmOverloads @NotNull public DriveSignal update(@NotNull Pose2d currentPose, @Nullable Pose2d currentRobotVel)
Run a single iteration of the trajectory follower.
currentPose
- current field frame posecurrentRobotVel
- current robot frame velocity@JvmOverloads @NotNull public DriveSignal update(@NotNull Pose2d currentPose)
Run a single iteration of the trajectory follower.
currentPose
- current field frame pose@NotNull protected DriveSignal internalUpdate(@NotNull Pose2d currentPose, @Nullable Pose2d currentRobotVel)
@NotNull protected NanoClock getClock()
clock