mirror of
https://github.com/Team4388/2026KPopRobotHunters.git
synced 2026-06-09 00:38:03 -06:00
fix auto
This commit is contained in:
@@ -137,10 +137,9 @@ public class RobotContainer {
|
|||||||
);
|
);
|
||||||
|
|
||||||
private Command RobotShootDriving = new SequentialCommandGroup(
|
private Command RobotShootDriving = new SequentialCommandGroup(
|
||||||
new InstantCommand(() ->
|
new RunCommand(() ->
|
||||||
m_robotSwerveDrive.enableRotationOverride(FieldPositions.HUB_POSITION)
|
m_robotSwerveDrive.enableRotationOverride(FieldPositions.HUB_POSITION, ShooterConstants.AIM_LEAD_TIME.get(), FieldPositions.HUB_POSITION)
|
||||||
),
|
).withTimeout(20)
|
||||||
new WaitCommand(99) // stays on for the duration of the auto segment
|
|
||||||
).finallyDo((interrupted) ->
|
).finallyDo((interrupted) ->
|
||||||
m_robotSwerveDrive.disableRotationOverride()
|
m_robotSwerveDrive.disableRotationOverride()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,12 +7,12 @@ public final class BuildConstants {
|
|||||||
public static final String MAVEN_GROUP = "";
|
public static final String MAVEN_GROUP = "";
|
||||||
public static final String MAVEN_NAME = "2026KPopRobotHunters";
|
public static final String MAVEN_NAME = "2026KPopRobotHunters";
|
||||||
public static final String VERSION = "unspecified";
|
public static final String VERSION = "unspecified";
|
||||||
public static final int GIT_REVISION = 172;
|
public static final int GIT_REVISION = 173;
|
||||||
public static final String GIT_SHA = "69677d5ae9e63125a30857f5f7afa0756dfa9416";
|
public static final String GIT_SHA = "95c8a167a56fa0c68e486c7a097dc4d31a3e290b";
|
||||||
public static final String GIT_DATE = "2026-03-20 15:40:07 MDT";
|
public static final String GIT_DATE = "2026-03-20 20:01:06 MDT";
|
||||||
public static final String GIT_BRANCH = "MiraOrg";
|
public static final String GIT_BRANCH = "MiraOrg";
|
||||||
public static final String BUILD_DATE = "2026-03-20 19:59:37 MDT";
|
public static final String BUILD_DATE = "2026-03-20 20:29:10 MDT";
|
||||||
public static final long BUILD_UNIX_TIME = 1774058377112L;
|
public static final long BUILD_UNIX_TIME = 1774060150289L;
|
||||||
public static final int DIRTY = 1;
|
public static final int DIRTY = 1;
|
||||||
|
|
||||||
private BuildConstants(){}
|
private BuildConstants(){}
|
||||||
|
|||||||
@@ -540,8 +540,15 @@ public class SwerveDrive extends SubsystemBase implements Queryable {
|
|||||||
softStop();
|
softStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableRotationOverride(Translation2d fieldTarget) {
|
public void enableRotationOverride(Translation2d fieldTarget, double aimLeadTime, Translation2d fieldPos) {
|
||||||
m_rotationOverrideTarget = fieldTarget;
|
Translation2d robotSpeed = new Translation2d(
|
||||||
|
chassisSpeeds.vxMetersPerSecond,
|
||||||
|
chassisSpeeds.vyMetersPerSecond
|
||||||
|
);
|
||||||
|
Translation2d fieldPosLead = robotSpeed.times(aimLeadTime).plus(fieldPos);
|
||||||
|
System.out.println("field pos lead: " + fieldPosLead);
|
||||||
|
Logger.recordOutput("Auto Aim", fieldPosLead);
|
||||||
|
m_rotationOverrideTarget = fieldPosLead;
|
||||||
m_useRotationOverride = true;
|
m_useRotationOverride = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user