Follower

public class Follower

This is the Follower class. It handles the actual following of the paths and all the on-the-fly calculations that are relevant for movement.

Author

Anyi Lin - 10158 Scott's Bots

Aaron Yang - 10158 Scott's Bots

Harrison Womack - 10158 Scott's Bots

Constructors

Link copied to clipboard
public void Follower(HardwareMap hardwareMap)
This creates a new Follower given a HardwareMap.
public void Follower(HardwareMap hardwareMap, Localizer localizer)
This creates a new Follower given a HardwareMap and a localizer.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
public static boolean drawOnDashboard
Link copied to clipboard
public double driveError
Link copied to clipboard
Link copied to clipboard
public double headingError
Link copied to clipboard
Link copied to clipboard
public boolean isBusy
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
public static boolean useCentripetal
Link copied to clipboard
public static boolean useDrive
Link copied to clipboard
public static boolean useHeading
Link copied to clipboard
public static boolean useTranslational
Link copied to clipboard
public double voltage

Functions

Link copied to clipboard
public boolean atParametricEnd()
This returns whether the follower is at the parametric end of its current Path.
Link copied to clipboard
public void breakFollowing()
This resets the PIDFs and stops following the current Path.
Link copied to clipboard
This calculates an averaged approximate velocity and acceleration.
Link copied to clipboard
public void drawOnDashBoard()
Draws everything in the debug() method on the dashboard
Link copied to clipboard
public void followPath(Path path)
public void followPath(Path path, boolean holdEnd)
This follows a Path.
public void followPath(PathChain pathChain)
public void followPath(PathChain pathChain, boolean holdEnd)
public void followPath(PathChain pathChain, double maxPower, boolean holdEnd)
This follows a PathChain.
Link copied to clipboard
This returns the current acceleration of the robot as a Vector.
Link copied to clipboard
This returns a Vector in the direction the robot must go to account for only centripetal force.
Link copied to clipboard
This returns the closest pose to the robot on the Path the Follower is currently following.
Link copied to clipboard
This returns a combined Vector in the direction the robot must go to correct both translational error as well as centripetal force.
Link copied to clipboard
This returns the current Path the Follower is following.
Link copied to clipboard
public double getCurrentPathNumber()
This returns the current path number.
Link copied to clipboard
public double getCurrentTValue()
This returns the t value of the closest point on the current Path to the robot In the absence of a current Path, it returns 1.0.
Link copied to clipboard
This returns the pose tracker for the robot to draw on the Dashboard.
Link copied to clipboard
This returns a Vector in the direction the robot must go to move along the path.
Link copied to clipboard
public double getDriveVelocityError()
This returns the velocity the robot needs to be at to make it to the end of the Path at some specified deceleration (well technically just some negative acceleration).
Link copied to clipboard
public double getHeadingOffset()
This returns the heading offset.
Link copied to clipboard
This returns a Vector in the direction of the robot that contains the heading correction as its magnitude.
Link copied to clipboard
public Point getPointFromPath(double t)
This gets a Point from the current Path from a specified t-value.
Link copied to clipboard
public Pose getPose()
This returns the current pose from the PoseUpdater.
Link copied to clipboard
public double getTotalHeading()
This returns the total number of radians the robot has turned.
Link copied to clipboard
This returns a Vector in the direction the robot must go to account for only translational error.
Link copied to clipboard
This returns the raw translational error, or how far off the closest point the robot is.
Link copied to clipboard
This returns the current velocity of the robot as a Vector.
Link copied to clipboard
public double getVelocityMagnitude()
This returns the magnitude of the current velocity.
Link copied to clipboard
public double getVoltage()
Link copied to clipboard
public double getVoltageNormalized()
Link copied to clipboard
public double getXOffset()
This returns the x offset.
Link copied to clipboard
public double getYOffset()
This returns the y offset.
Link copied to clipboard
public void holdPoint(Pose pose)
public void holdPoint(BezierPoint point, double heading)
public void holdPoint(Point point, double heading)
This holds a Point.
Link copied to clipboard
public void initialize()
public void initialize(Localizer localizer)
This initializes the follower.
Link copied to clipboard
public boolean isBusy()
This returns if the Follower is currently following a Path or a PathChain.
Link copied to clipboard
public boolean isLocalizationNAN()
Link copied to clipboard
public boolean isRobotStuck()
Link copied to clipboard
This returns a new PathBuilder object for easily building PathChains.
Link copied to clipboard
public void refreshVoltage()
Overrides the voltage cooldown.
Link copied to clipboard
public void resetOffset()
This resets all offsets set to the PoseUpdater.
Link copied to clipboard
public void resumePathFollowing()
Resumes pathing
Link copied to clipboard
public void setCentripetalScaling(double set)
Link copied to clipboard
public void setCurrentPoseWithOffset(Pose set)
This sets the current pose, using offsets so no reset time delay.
Link copied to clipboard
public void setHeadingOffset(double headingOffset)
This sets the offset for only the heading.
Link copied to clipboard
public void setMaxPower(double set)
This sets the maximum power the motors are allowed to use.
Link copied to clipboard
public void setPose(Pose pose)
This sets the current pose in the PoseUpdater without using offsets.
Link copied to clipboard
public void setStartingPose(Pose pose)
This sets the starting pose.
Link copied to clipboard
public void setTeleOpMovementVectors(double forwardDrive, double lateralDrive, double heading)
public void setTeleOpMovementVectors(double forwardDrive, double lateralDrive, double heading, boolean robotCentric)
This sets the teleop drive vectors.
Link copied to clipboard
public void setXOffset(double xOffset)
This sets the offset for only the x position.
Link copied to clipboard
public void setYOffset(double yOffset)
This sets the offset for only the y position.
Link copied to clipboard
public void startTeleopDrive()
This starts teleop drive control.
Link copied to clipboard
public void telemetryDebug(MultipleTelemetry telemetry)
public void telemetryDebug(Telemetry telemetry)
This writes out information about the various motion Vectors to the Telemetry specified.
Link copied to clipboard
public void turn(double radians, boolean isLeft)
Turns a certain amount of degrees left
Link copied to clipboard
public void turnDegrees(double degrees, boolean isLeft)
Turns a certain amount of degrees left
Link copied to clipboard
public void turnTo(double radians)
Turns to a specific heading
Link copied to clipboard
public void turnToDegrees(double degrees)
Turns to a specific heading in degrees
Link copied to clipboard
public void update()
This calls an update to the PoseUpdater, which updates the robot's current position estimate.
Link copied to clipboard
public void updateCallbacks()
This checks if any PathCallbacks should be run right now, and runs them if applicable.
Link copied to clipboard
public void updatePose()
Calls an update to the PoseUpdater, which updates the robot's current position estimate.