Package frc.lib5k.kinematics
Class MovementPlanner
- java.lang.Object
-
- frc.lib5k.kinematics.MovementPlanner
-
public class MovementPlanner extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MovementPlanner(PIDProfile forwardCFG, PIDProfile turnCFG)Create a MovementPlanner from two PIDProfiles
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MovementSegmentcompute(FieldPosition end, DriveConstraints constraints, double turnRate, double epsilon)Compute a MovementSegment from the current robot location, and some parameters.voidpublishPIDControllers()Publish PIDController objects to Shuffleboard in the "MovementPlanner" tabvoidpublishPIDControllers(java.lang.String tabName)Publish PIDController objects to Shuffleboardvoidreset()Reset the MovementPlanner.
-
-
-
Constructor Detail
-
MovementPlanner
public MovementPlanner(PIDProfile forwardCFG, PIDProfile turnCFG)
Create a MovementPlanner from two PIDProfiles- Parameters:
forwardCFG- Front-Back movement PIDProfileturnCFG- Turning PIDProfile
-
-
Method Detail
-
compute
public MovementSegment compute(FieldPosition end, DriveConstraints constraints, double turnRate, double epsilon)
Compute a MovementSegment from the current robot location, and some parameters. To follow a path from the current robot position to the end position, this should be called once every 20ms until the segment is finished. REMEMBER: a LocalizationEngine instance must exist and be updated for this to work!- Parameters:
end- Desired FieldPosition to move toconstraints- System output constraintsturnRate- How quickly the robot should turn to it's goal. Play with this number to generate arcsepsilon- Acceptable error from the end position (in meters)- Returns:
- MovementSegment to be executed by the robot's DriveTrain
-
publishPIDControllers
public void publishPIDControllers()
Publish PIDController objects to Shuffleboard in the "MovementPlanner" tab
-
publishPIDControllers
public void publishPIDControllers(java.lang.String tabName)
Publish PIDController objects to Shuffleboard- Parameters:
tabName- Shuffleboard tab name
-
reset
public void reset()
Reset the MovementPlanner. This should be called after each segment has been completed
-
-