Class MovementPlanner


  • public class MovementPlanner
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      MovementSegment compute​(FieldPosition end, DriveConstraints constraints, double turnRate, double epsilon)
      Compute a MovementSegment from the current robot location, and some parameters.
      void publishPIDControllers()
      Publish PIDController objects to Shuffleboard in the "MovementPlanner" tab
      void publishPIDControllers​(java.lang.String tabName)
      Publish PIDController objects to Shuffleboard
      void reset()
      Reset the MovementPlanner.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MovementPlanner

        public MovementPlanner​(PIDProfile forwardCFG,
                               PIDProfile turnCFG)
        Create a MovementPlanner from two PIDProfiles
        Parameters:
        forwardCFG - Front-Back movement PIDProfile
        turnCFG - 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 to
        constraints - System output constraints
        turnRate - How quickly the robot should turn to it's goal. Play with this number to generate arcs
        epsilon - 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