Package com.pathplanner.lib.commands
Class PathfindThenFollowPath
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
edu.wpi.first.wpilibj2.command.SequentialCommandGroup
com.pathplanner.lib.commands.PathfindThenFollowPath
- All Implemented Interfaces:
Sendable
Command group that will pathfind to the start of a path, then follow that path
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command
Command.InterruptionBehavior
-
Constructor Summary
ConstructorDescriptionPathfindThenFollowPath
(PathPlannerPath goalPath, PathConstraints pathfindingConstraints, Supplier<Pose2d> poseSupplier, Supplier<ChassisSpeeds> currentRobotRelativeSpeeds, BiConsumer<ChassisSpeeds, DriveFeedforwards> output, PathFollowingController controller, RobotConfig robotConfig, BooleanSupplier shouldFlipPath, Subsystem... requirements) Constructs a new PathfindThenFollowPath command group. -
Method Summary
Methods inherited from class edu.wpi.first.wpilibj2.command.SequentialCommandGroup
addCommands, end, execute, getInterruptionBehavior, initialize, initSendable, isFinished, runsWhenDisabled
Methods inherited from class edu.wpi.first.wpilibj2.command.Command
addRequirements, addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineFor, deadlineWith, finallyDo, finallyDo, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, schedule, setName, setSubsystem, unless, until, withInterruptBehavior, withName, withTimeout, withTimeout
-
Constructor Details
-
PathfindThenFollowPath
public PathfindThenFollowPath(PathPlannerPath goalPath, PathConstraints pathfindingConstraints, Supplier<Pose2d> poseSupplier, Supplier<ChassisSpeeds> currentRobotRelativeSpeeds, BiConsumer<ChassisSpeeds, DriveFeedforwards> output, PathFollowingController controller, RobotConfig robotConfig, BooleanSupplier shouldFlipPath, Subsystem... requirements) Constructs a new PathfindThenFollowPath command group.- Parameters:
goalPath
- the goal path to followpathfindingConstraints
- the path constraints for pathfindingposeSupplier
- a supplier for the robot's current posecurrentRobotRelativeSpeeds
- a supplier for the robot's current robot relative speedsoutput
- Output function that accepts robot-relative ChassisSpeeds and feedforwards for each drive motor. If using swerve, these feedforwards will be in FL, FR, BL, BR order. If using a differential drive, they will be in L, R order.NOTE: These feedforwards are assuming unoptimized module states. When you optimize your module states, you will need to reverse the feedforwards for modules that have been flipped
controller
- Path following controller that will be used to follow the pathrobotConfig
- The robot configurationshouldFlipPath
- Should the target path be flipped to the other side of the field? This will maintain a global blue alliance origin.requirements
- the subsystems required by this command (drive subsystem)
-