Merge branch '7.4' of https://github.com/HarryWang163/FRC6494_2026Regional into 7.4
This commit is contained in:
@@ -3,6 +3,7 @@ package frc.robot;
|
||||
import com.ctre.phoenix6.configs.Slot0Configs;
|
||||
import edu.wpi.first.math.geometry.Pose2d;
|
||||
import edu.wpi.first.math.geometry.Rotation2d;
|
||||
import edu.wpi.first.math.interpolation.InterpolatingDoubleTreeMap;
|
||||
|
||||
public final class Constants {
|
||||
private Constants() {}
|
||||
@@ -33,6 +34,16 @@ public final class Constants {
|
||||
public static final double flywheelSpeedToleranceRps = 5.0;
|
||||
public static final double defaultFlywheelTargetRps = 64.0;
|
||||
|
||||
// 距离(米) -> 飞轮转速(RPS) 射表。当前为占位点;
|
||||
// 真车试射后按实测数据加点即可,查表自动线性插值并在两端取边界值。
|
||||
public static final InterpolatingDoubleTreeMap flywheelRpsByDistance = new InterpolatingDoubleTreeMap();
|
||||
static {
|
||||
flywheelRpsByDistance.put(1.2, 58.8);
|
||||
flywheelRpsByDistance.put(2.5, 64.0);
|
||||
flywheelRpsByDistance.put(3.5, 68.0);
|
||||
flywheelRpsByDistance.put(5.0, 74.0);
|
||||
}
|
||||
|
||||
public static final double conveyorSpeed = 150;
|
||||
public static final double conveyorSpeedForAuto = 10;
|
||||
|
||||
@@ -143,7 +154,16 @@ public final class Constants {
|
||||
.withKV(0.00).withKA(0.00).withKS(0.00);
|
||||
|
||||
public static final double IntakeGetterSpeedforAuto = 0.5;
|
||||
public static final double positionToleranceRotations = 0.00;
|
||||
// atGoal 判定容差。为 0 会导致 atGoal 永远为 false、射击门控永远不通过;
|
||||
// 这里给出可用的占位值,真车调好位置闭环后再收紧。
|
||||
public static final double positionToleranceRotations = 0.3;
|
||||
|
||||
// 上电时按机构处于收拢(STOW)姿态直接归零。
|
||||
// 比赛规则要求开赛前机器人处于合法初始姿态,因此这是安全假设;
|
||||
// 若维修后姿态不确定,置 false 并用操作员 A 键手动归零。
|
||||
// 没有这个假设,自动赛阶段无人能按归零键,收球和射击会被
|
||||
// 未归零保护永久拦下。
|
||||
public static final boolean assumeZeroedOnBoot = true;
|
||||
}
|
||||
|
||||
public static class Conveyor {
|
||||
@@ -160,5 +180,19 @@ public final class Constants {
|
||||
public static final double shootTimeoutSeconds = 1.0;
|
||||
public static final double aimToleranceDegrees = 1.5;
|
||||
public static final double stationarySpeedToleranceMetersPerSecond = 0.5;
|
||||
|
||||
// 松开 intake 键后,INDEXING 状态继续收纳球的时长。
|
||||
public static final double indexingSeconds = 0.5;
|
||||
// 射击时背板的目标位置(外接编码器计数)。
|
||||
public static final double backboardShootPosition = 175.0;
|
||||
// 没有球检测传感器,持球状态由状态机跟踪推断。
|
||||
// 若跟踪不可靠导致射击被卡,可临时置 false 旁路 hasNote 门控。
|
||||
public static final boolean hasNoteGateEnabled = true;
|
||||
// 比赛开局机器人带预装球,开机默认持球为 true;
|
||||
// 否则自动赛的第一发射击会被 hasNote 门控拦死。
|
||||
// 空车调试时可置 false,或用操作员 X 键运行时翻转持球状态。
|
||||
public static final boolean assumePreloadedAtBoot = true;
|
||||
// 射击门控是否要求底盘接近静止。
|
||||
public static final boolean stationaryGateEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user