mode auto manuel
This commit is contained in:
@ -49,14 +49,16 @@ public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Su
|
||||
try {
|
||||
var config = RobotConfig.fromGUISettings();
|
||||
AutoBuilder.configure(
|
||||
|
||||
() -> getState().Pose, // Supplier of current robot pose
|
||||
this::resetPose, // Consumer for seeding pose against auto
|
||||
() -> getState().Speeds, // Supplier of current robot speeds
|
||||
|
||||
// Consumer of ChassisSpeeds and feedforwards to drive the robot
|
||||
(speeds, feedforwards) -> setControl(
|
||||
m_pathApplyRobotSpeeds.withSpeeds(speeds)
|
||||
.withWheelForceFeedforwardsX(feedforwards.robotRelativeForcesXNewtons())
|
||||
.withWheelForceFeedforwardsY(feedforwards.robotRelativeForcesYNewtons())
|
||||
.withWheelForceFeedforwardsY(feedforwards.robotRelativeForcesXNewtons())
|
||||
.withWheelForceFeedforwardsX(feedforwards.robotRelativeForcesYNewtons())
|
||||
),
|
||||
new PPHolonomicDriveController(
|
||||
// PID constants for translation
|
||||
@ -70,6 +72,7 @@ public class CommandSwerveDrivetrain extends TunerSwerveDrivetrain implements Su
|
||||
// Assume the path needs to be flipped for Red vs Blue, this is normally the case
|
||||
() -> DriverStation.getAlliance().orElse(Alliance.Blue) == Alliance.Red,
|
||||
this // Subsystem for requirements
|
||||
|
||||
);
|
||||
} catch (Exception ex) {
|
||||
DriverStation.reportError("Failed to load PathPlanner config and configure AutoBuilder", ex.getStackTrace());
|
||||
|
Reference in New Issue
Block a user