10 Commits
Author SHA1 Message Date
OnDYCLaptop c98ef164c5 整理季后赛仓库说明并保留本地自动路径 2026-10-13 00:54:56 +08:00
OnDYCLaptop 40c5b5d642 7.21 2026-07-21 00:22:54 +08:00
OnDYCLaptop a6595a79d7 7.19 2026-07-19 14:49:14 +08:00
OnDYCLaptop 5c1d9c3230 7.13 2026-07-13 14:41:25 +08:00
OnDYCLaptop 632da8d654 autocommand 2026-07-11 23:01:27 +08:00
OnDYCLaptop c5919af3ef 7.10晚晚 2026-07-10 22:23:23 +08:00
OnDYCLaptop d2f5adc813 7.10晚 2026-07-10 22:10:06 +08:00
OnDYCLaptop 6abdf34cf0 7.10午 2026-07-10 11:35:22 +08:00
OnDYCLaptop 915b1b1af0 7.9晚 2026-07-09 20:12:25 +08:00
OnDYCLaptop 914584b71c 背板完成 2026-07-09 11:58:36 +08:00
77 changed files with 6435 additions and 3912 deletions
+103
View File
@@ -0,0 +1,103 @@
# FRC 6494 · 2026 Regional Offseason
FRC 6494 的 2026 季后赛机器人 Java 项目。代码包含 Phoenix 6 Swerve 底盘、PathPlanner 自动程序、Limelight 定位,以及射击、进球、输送和灯带控制。
## 当前版本与分支
- 默认工作分支:`7.4`。
- Gitea 地址:<https://git.6494.team/admin6494/FRC6494_2026Regional-offseason>。
- 原 GitHub 仓库:<https://github.com/HarryWang163/FRC6494_2026Regional>。
- `main`、`1`、`季后赛季后赛季后赛` 和 `手搓` 保留为原有历史分支。当前季后赛开发以 `7.4` 为准。
- 本次整理保留原提交历史,并纳入本地已有的 `New Auto.auto` 与 `New Path.path`。
## 开发环境
| 项目 | 配置版本 |
| --- | --- |
| Java 源码与目标版本 | 17 |
| WPILib / GradleRIO | 2026.2.1 |
| Gradle Wrapper | 8.11 |
| CTRE Phoenix 6 | 26.1.1 |
| PathPlannerLib | 2026.1.2 |
| 队号 | 6494 |
建议使用 WPILib 2026 开发环境。第三方依赖由 `vendordeps/` 中的 JSON 定义,首次构建需要取得 Gradle 与相关依赖。队号保存在 `.wpilib/wpilib_preferences.json`。
## 获取与构建
```powershell
git clone --branch 7.4 https://git.6494.team/admin6494/FRC6494_2026Regional-offseason.git
cd FRC6494_2026Regional-offseason
.\gradlew.bat build
```
Linux/macOS 构建命令为 `./gradlew build`。
在具备桌面仿真依赖的 WPILib 环境中,可以运行:
```powershell
.\gradlew.bat simulateJava
```
连接队伍机器人并确认队号、网络和机构参数后,可以通过 WPILib VS Code 的部署命令部署,或手动运行 `.\gradlew.bat deploy`。仿真不能替代真实传感器、机构动作和射击参数的实机验证。
## 代码结构
| 位置 | 用途 |
| --- | --- |
| `src/main/java/frc/robot/Robot.java` | 机器人模式切换与周期调度 |
| `src/main/java/frc/robot/RobotContainer.java` | 子系统组装、手柄绑定、自动程序选择 |
| `src/main/java/frc/robot/Constants.java` | CAN ID、机构参数、场地坐标和状态机阈值 |
| `src/main/java/frc/robot/controls/` | 驾驶控制、操作员意图和自动命令注册 |
| `src/main/java/frc/robot/subsystems/Superstructure.java` | 协调射击、进球、输送等机构的状态机 |
| `src/main/java/frc/robot/subsystems/` | 底盘、机构、Limelight 和 LED 子系统 |
| `src/main/java/frc/robot/generated/TunerConstants.java` | Phoenix Tuner X 底盘配置 |
| `src/main/java/frc/robot/tuning/` | 仪表盘调参入口 |
| `src/main/deploy/pathplanner/` | 自动程序、路径、导航网格和机器人配置 |
| `vendordeps/` | 第三方库版本与依赖描述 |
| `elastic-layout*.json` | Elastic 仪表盘布局 |
| `tuner-project.json` | Phoenix Tuner 项目配置 |
自动程序通过 `Auto Chooser` 选择。PathPlanner NamedCommands 在 `controls/Autocommand.java` 中注册。`New Auto` 会引用 `New Path`;它们是已有的本地自动程序资源,使用前应检查路径与起始位姿。
## 当前手柄绑定
代码使用 0 号端口的单个 Xbox 手柄。以下绑定以 `RobotContainer.java` 为准:
| 输入 | 动作 |
| --- | --- |
| 左摇杆 | 底盘平移 |
| 右摇杆 X | 底盘旋转输入 |
| Back | 重置场地坐标驾驶角度 |
| 右扳机 | 请求向 Hub 射击 |
| 右肩键 | 启用驾驶加速模式 |
| 左扳机 | 请求传球 |
| 左肩键 | 请求进球 |
| B | 请求反转排球 |
| Y / A | 手动抬起 / 放下进球机构 |
| 十字键左 / 右 | 飞轮目标速度偏移 -1 / +1 |
| 十字键上 / 下 | 背板目标位置偏移 +100 / -100 |
| Start | 运行背板复位命令 |
主要射击和进球按钮受 Teleop 模式门控。射击准备、喂球及超时回退逻辑位于 `Superstructure.java`,相关阈值位于 `Constants.Superstructure`,应结合实机检查这些行为。
## 仓库维护
源码、自动路径、硬件配置、Gradle Wrapper 和仪表盘布局应提交到 Git。`.gitignore` 已排除 `build/`、`.gradle/`、`bin/`、`ctre_sim/` 等生成文件和缓存。
新克隆的仓库可以通过以下命令提交更新:
```powershell
git status
git add <需要提交的文件>
git commit -m "说明本次修改"
git push origin 7.4
```
原本连接 GitHub 的本地副本另加了名为 `gitea` 的远程地址,上传到 Gitea 时使用 `git push gitea 7.4`。公开仓库允许匿名浏览和克隆,推送需要具有写入权限的账号或访问令牌。
## 验证范围与许可
本次仓库整理检查了文件、Git 历史和上传内容,并验证远程仓库的分支与匿名克隆;未执行编译、桌面仿真或机器人部署。构建命令是开发使用说明,不代表本次已通过构建或实机测试。
保留项目中的 WPILib 声明与 `WPILib-License.md`。第三方库及外部代码应遵循各自原有的许可说明。
+983 -657
View File
File diff suppressed because it is too large Load Diff
+2560 -1151
View File
File diff suppressed because it is too large Load Diff
@@ -1,31 +0,0 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Back To Shoot Blue"
}
},
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{
"type": "named",
"data": {
"name": "shoot_hub"
}
}
]
}
},
"resetOdom": true,
"folder": "Blue Middle",
"choreoAuto": false
}
@@ -1,25 +0,0 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Back To Shoot Red"
}
},
{
"type": "named",
"data": {
"name": "shoot_hub"
}
}
]
}
},
"resetOdom": true,
"folder": "Red Middle",
"choreoAuto": false
}
@@ -8,12 +8,6 @@
"type": "parallel", "type": "parallel",
"data": { "data": {
"commands": [ "commands": [
{
"type": "path",
"data": {
"pathName": "Back To Shoot Red"
}
},
{ {
"type": "named", "type": "named",
"data": { "data": {
@@ -23,18 +17,18 @@
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "climber_init" "name": "start_intake_and_conveyor"
}
},
{
"type": "path",
"data": {
"pathName": "blueLeft1"
} }
} }
] ]
} }
}, },
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{ {
"type": "named", "type": "named",
"data": { "data": {
@@ -42,42 +36,21 @@
} }
}, },
{ {
"type": "parallel", "type": "path",
"data": { "data": {
"commands": [ "pathName": "blueLeft2"
{
"type": "path",
"data": {
"pathName": "Shoot to Depot Red"
}
}
]
} }
}, },
{ {
"type": "parallel", "type": "path",
"data": { "data": {
"commands": [ "pathName": "blueLeft3"
{
"type": "path",
"data": {
"pathName": "Depot Intake Red"
}
}
]
} }
}, },
{ {
"type": "parallel", "type": "path",
"data": { "data": {
"commands": [ "pathName": "blueLeftTurnToHub2"
{
"type": "named",
"data": {
"name": "AutoAim"
}
}
]
} }
}, },
{ {
@@ -99,13 +72,50 @@
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "Shake" "name": "AutoAim"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "start_intake_and_conveyor"
}
},
{
"type": "path",
"data": {
"pathName": "blueLeftTurnToHub1"
}
},
{
"type": "path",
"data": {
"pathName": "blueLeft4"
}
},
{
"type": "path",
"data": {
"pathName": "blueLeft5"
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "shoot_hub"
} }
}, },
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "intaker_up" "name": "AutoAim"
} }
} }
] ]
@@ -115,6 +125,6 @@
} }
}, },
"resetOdom": true, "resetOdom": true,
"folder": "Red Middle", "folder": "Blue",
"choreoAuto": false "choreoAuto": false
} }
@@ -8,12 +8,6 @@
"type": "parallel", "type": "parallel",
"data": { "data": {
"commands": [ "commands": [
{
"type": "path",
"data": {
"pathName": "Back To Shoot Blue"
}
},
{ {
"type": "named", "type": "named",
"data": { "data": {
@@ -23,18 +17,18 @@
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "climber_init" "name": "start_intake_and_conveyor"
}
},
{
"type": "path",
"data": {
"pathName": "blueRight1"
} }
} }
] ]
} }
}, },
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{ {
"type": "named", "type": "named",
"data": { "data": {
@@ -42,42 +36,21 @@
} }
}, },
{ {
"type": "parallel", "type": "path",
"data": { "data": {
"commands": [ "pathName": "blueRight2"
{
"type": "path",
"data": {
"pathName": "Shoot to Depot Blue"
}
}
]
} }
}, },
{ {
"type": "parallel", "type": "path",
"data": { "data": {
"commands": [ "pathName": "blueRight3"
{
"type": "path",
"data": {
"pathName": "Depot Intake Blue"
}
}
]
} }
}, },
{ {
"type": "parallel", "type": "path",
"data": { "data": {
"commands": [ "pathName": "blueRightTurnToHub2"
{
"type": "named",
"data": {
"name": "AutoAim"
}
}
]
} }
}, },
{ {
@@ -99,53 +72,59 @@
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "Shake" "name": "AutoAim"
}
},
{
"type": "named",
"data": {
"name": "intaker_up"
} }
} }
] ]
} }
}, },
{
"type": "named",
"data": {
"name": "start_intake_and_conveyor"
}
},
{
"type": "path",
"data": {
"pathName": "blueRightTurnToHub1"
}
},
{
"type": "path",
"data": {
"pathName": "blueRight4"
}
},
{
"type": "path",
"data": {
"pathName": "blueRight5"
}
},
{ {
"type": "parallel", "type": "parallel",
"data": { "data": {
"commands": [ "commands": [
{ {
"type": "path", "type": "named",
"data": { "data": {
"pathName": "Depot To Climb Blue" "name": "shoot_hub"
} }
}, },
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "climb_up" "name": "AutoAim"
} }
} }
] ]
} }
},
{
"type": "path",
"data": {
"pathName": "Climb Step2 Blue"
}
},
{
"type": "path",
"data": {
"pathName": "Climb Step3 Blue"
}
} }
] ]
} }
}, },
"resetOdom": true, "resetOdom": true,
"folder": "Blue Middle", "folder": "Blue",
"choreoAuto": false "choreoAuto": false
} }
@@ -1,152 +0,0 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Back To Shoot Red"
}
},
{
"type": "named",
"data": {
"name": "intaker_down"
}
}
]
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{
"type": "named",
"data": {
"name": "intaker_down"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "start_intake_and_conveyor"
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Shoot to Depot Red"
}
}
]
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Depot Intake Red"
}
}
]
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "AutoAim"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "stop_intake_and_conveyor"
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{
"type": "named",
"data": {
"name": "Shake"
}
},
{
"type": "named",
"data": {
"name": "intaker_up"
}
}
]
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{
"type": "named",
"data": {
"name": "Shake"
}
},
{
"type": "named",
"data": {
"name": "intaker_up"
}
}
]
}
}
]
}
},
"resetOdom": true,
"folder": "Red Middle",
"choreoAuto": false
}
@@ -4,6 +4,12 @@
"type": "sequential", "type": "sequential",
"data": { "data": {
"commands": [ "commands": [
{
"type": "wait",
"data": {
"waitTime": 0.0
}
},
{ {
"type": "path", "type": "path",
"data": { "data": {
@@ -13,19 +19,13 @@
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "AutoAim" "name": "intaker_down"
}
},
{
"type": "named",
"data": {
"name": "shoot_hub"
} }
} }
] ]
} }
}, },
"resetOdom": true, "resetOdom": true,
"folder": "Blue Middle", "folder": null,
"choreoAuto": false "choreoAuto": false
} }
@@ -4,20 +4,26 @@
"type": "sequential", "type": "sequential",
"data": { "data": {
"commands": [ "commands": [
{
"type": "named",
"data": {
"name": "intaker_down"
}
},
{ {
"type": "parallel", "type": "parallel",
"data": { "data": {
"commands": [ "commands": [
{
"type": "named",
"data": {
"name": "intaker_down"
}
},
{
"type": "named",
"data": {
"name": "start_intake_and_conveyor"
}
},
{ {
"type": "path", "type": "path",
"data": { "data": {
"pathName": "To Depot Blue" "pathName": "red1"
} }
} }
] ]
@@ -26,7 +32,31 @@
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "start_intake_timelimit" "name": "start_intake_and_conveyor"
}
},
{
"type": "path",
"data": {
"pathName": "red2"
}
},
{
"type": "path",
"data": {
"pathName": "red3"
}
},
{
"type": "path",
"data": {
"pathName": "turntohub2"
}
},
{
"type": "named",
"data": {
"name": "stop_intake_and_conveyor"
} }
}, },
{ {
@@ -36,38 +66,13 @@
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "start_intake_timelimit" "name": "shoot_hub"
} }
}, },
{
"type": "path",
"data": {
"pathName": "Depot Intake Blue"
}
}
]
}
},
{
"type": "wait",
"data": {
"waitTime": 2.0
}
},
{
"type": "parallel",
"data": {
"commands": [
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "intaker_up" "name": "AutoAim"
}
},
{
"type": "path",
"data": {
"pathName": "Depot to Shoot Blue"
} }
} }
] ]
@@ -76,13 +81,31 @@
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "shoot_hub" "name": "start_intake_and_conveyor"
}
},
{
"type": "path",
"data": {
"pathName": "turntohub1"
}
},
{
"type": "path",
"data": {
"pathName": "red4"
}
},
{
"type": "path",
"data": {
"pathName": "red5"
} }
} }
] ]
} }
}, },
"resetOdom": true, "resetOdom": true,
"folder": "Blue Middle", "folder": "Red",
"choreoAuto": false "choreoAuto": false
} }
@@ -4,31 +4,31 @@
"type": "sequential", "type": "sequential",
"data": { "data": {
"commands": [ "commands": [
{
"type": "named",
"data": {
"name": "intaker_down"
}
},
{ {
"type": "parallel", "type": "parallel",
"data": { "data": {
"commands": [ "commands": [
{
"type": "named",
"data": {
"name": "intaker_down"
}
},
{
"type": "named",
"data": {
"name": "start_intake_and_conveyor"
}
},
{ {
"type": "path", "type": "path",
"data": { "data": {
"pathName": "To Depot Red" "pathName": "RedGotodepot"
} }
} }
] ]
} }
}, },
{
"type": "named",
"data": {
"name": "start_intake_timelimit"
}
},
{ {
"type": "parallel", "type": "parallel",
"data": { "data": {
@@ -36,53 +36,46 @@
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "start_intake_timelimit" "name": "shoot_hub"
} }
}, },
{
"type": "path",
"data": {
"pathName": "Depot Intake Red"
}
}
]
}
},
{
"type": "wait",
"data": {
"waitTime": 2.0
}
},
{
"type": "parallel",
"data": {
"commands": [
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "intaker_up" "name": "AutoAim"
}
},
{
"type": "path",
"data": {
"pathName": "Depot to Shoot Red"
} }
} }
] ]
} }
}, },
{
"type": "path",
"data": {
"pathName": "redDepotToGoudong"
}
},
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "shoot_hub" "name": "start_intake_and_conveyor"
}
},
{
"type": "path",
"data": {
"pathName": "red4"
}
},
{
"type": "path",
"data": {
"pathName": "red5"
} }
} }
] ]
} }
}, },
"resetOdom": true, "resetOdom": true,
"folder": "Red Middle", "folder": "Red",
"choreoAuto": false "choreoAuto": false
} }
@@ -8,12 +8,6 @@
"type": "parallel", "type": "parallel",
"data": { "data": {
"commands": [ "commands": [
{
"type": "path",
"data": {
"pathName": "Back To Shoot Red"
}
},
{ {
"type": "named", "type": "named",
"data": { "data": {
@@ -23,18 +17,18 @@
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "climber_init" "name": "start_intake_and_conveyor"
}
},
{
"type": "path",
"data": {
"pathName": "redRight1"
} }
} }
] ]
} }
}, },
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{ {
"type": "named", "type": "named",
"data": { "data": {
@@ -42,42 +36,21 @@
} }
}, },
{ {
"type": "parallel", "type": "path",
"data": { "data": {
"commands": [ "pathName": "redRight2"
{
"type": "path",
"data": {
"pathName": "Shoot to Depot Red"
}
}
]
} }
}, },
{ {
"type": "parallel", "type": "path",
"data": { "data": {
"commands": [ "pathName": "redRight3"
{
"type": "path",
"data": {
"pathName": "Depot Intake Red"
}
}
]
} }
}, },
{ {
"type": "parallel", "type": "path",
"data": { "data": {
"commands": [ "pathName": "redRightTurnToHub2"
{
"type": "named",
"data": {
"name": "AutoAim"
}
}
]
} }
}, },
{ {
@@ -99,59 +72,40 @@
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "Shake" "name": "AutoAim"
}
},
{
"type": "named",
"data": {
"name": "intaker_up"
} }
} }
] ]
} }
}, },
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Depot To Climb Red"
}
},
{
"type": "named",
"data": {
"name": "climb_up"
}
}
]
}
},
{
"type": "path",
"data": {
"pathName": "Climb Step2 Red"
}
},
{
"type": "path",
"data": {
"pathName": "Climb Step3 Red"
}
},
{ {
"type": "named", "type": "named",
"data": { "data": {
"name": "climb_down" "name": "start_intake_and_conveyor"
}
},
{
"type": "path",
"data": {
"pathName": "redRightTurnToHub1"
}
},
{
"type": "path",
"data": {
"pathName": "redRight4"
}
},
{
"type": "path",
"data": {
"pathName": "redRight5"
} }
} }
] ]
} }
}, },
"resetOdom": true, "resetOdom": true,
"folder": "Red Middle", "folder": "Red",
"choreoAuto": false "choreoAuto": false
} }
@@ -1,67 +0,0 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Back To Shoot Blue"
}
},
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{
"type": "wait",
"data": {
"waitTime": 0.25
}
},
{
"type": "path",
"data": {
"pathName": "Shoot to Climb Step1 Blue"
}
},
{
"type": "named",
"data": {
"name": "climb_up"
}
},
{
"type": "path",
"data": {
"pathName": "Climb Step2 Blue"
}
},
{
"type": "path",
"data": {
"pathName": "Climb Step3 Blue"
}
},
{
"type": "wait",
"data": {
"waitTime": 0.25
}
},
{
"type": "named",
"data": {
"name": "climb_down"
}
}
]
}
},
"resetOdom": true,
"folder": "Blue Middle",
"choreoAuto": false
}
@@ -1,80 +0,0 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Back To Shoot Red"
}
},
{
"type": "named",
"data": {
"name": "climber_init"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{
"type": "wait",
"data": {
"waitTime": 0.25
}
},
{
"type": "path",
"data": {
"pathName": "Shoot to Climb Step1 Red"
}
},
{
"type": "named",
"data": {
"name": "climb_up"
}
},
{
"type": "path",
"data": {
"pathName": "Climb Step2 Red"
}
},
{
"type": "path",
"data": {
"pathName": "Climb Step3 Red"
}
},
{
"type": "wait",
"data": {
"waitTime": 0.25
}
},
{
"type": "named",
"data": {
"name": "climb_down"
}
}
]
}
},
"resetOdom": true,
"folder": "Red Middle",
"choreoAuto": false
}
@@ -1,158 +0,0 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Back To Shoot Blue"
}
},
{
"type": "named",
"data": {
"name": "intaker_down"
}
}
]
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{
"type": "named",
"data": {
"name": "intaker_down"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "start_intake_and_conveyor"
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Shoot to Depot Blue"
}
}
]
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Depot Intake Blue"
}
}
]
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "AutoAim"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "stop_intake_and_conveyor"
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{
"type": "named",
"data": {
"name": "Shake"
}
},
{
"type": "named",
"data": {
"name": "intaker_up"
}
}
]
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{
"type": "named",
"data": {
"name": "Shake"
}
},
{
"type": "named",
"data": {
"name": "intaker_up"
}
}
]
}
},
{
"type": "path",
"data": {
"pathName": "blue depot go 1"
}
}
]
}
},
"resetOdom": true,
"folder": "Blue Middle",
"choreoAuto": false
}
@@ -1,151 +0,0 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Back To Shoot Red"
}
},
{
"type": "named",
"data": {
"name": "intaker_down"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "path",
"data": {
"pathName": "Shoot to Depot Red"
}
},
{
"type": "named",
"data": {
"name": "start_intake_timelimit"
}
}
]
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "start_intake_timelimit"
}
},
{
"type": "path",
"data": {
"pathName": "Depot Intake Red"
}
}
]
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "intaker_up"
}
},
{
"type": "path",
"data": {
"pathName": "Depot to Shoot Red"
}
}
]
}
},
{
"type": "named",
"data": {
"name": "AutoAim"
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{
"type": "named",
"data": {
"name": "Shake"
}
},
{
"type": "named",
"data": {
"name": "intaker_up"
}
}
]
}
},
{
"type": "parallel",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "shoot_hub"
}
},
{
"type": "named",
"data": {
"name": "Shake"
}
},
{
"type": "named",
"data": {
"name": "intaker_up"
}
}
]
}
}
]
}
},
"resetOdom": true,
"folder": "Red Middle",
"choreoAuto": false
}
@@ -1,31 +0,0 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "start_intake"
}
},
{
"type": "wait",
"data": {
"waitTime": 2.0
}
},
{
"type": "named",
"data": {
"name": "stop_intake"
}
}
]
}
},
"resetOdom": false,
"folder": "Blue Middle",
"choreoAuto": false
}
@@ -1,25 +0,0 @@
{
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
"commands": [
{
"type": "named",
"data": {
"name": "start_intake_and_conveyor"
}
},
{
"type": "wait",
"data": {
"waitTime": 1.0
}
}
]
}
},
"resetOdom": false,
"folder": "Red Middle",
"choreoAuto": false
}
File diff suppressed because one or more lines are too long
@@ -1,54 +0,0 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 0.64,
"y": 4.704
},
"prevControl": null,
"nextControl": {
"x": 0.9248292506025121,
"y": 4.704
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 1.073,
"y": 4.704
},
"prevControl": {
"x": 0.823,
"y": 4.704
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 0.5,
"maxAcceleration": 1.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 0.0
},
"reversed": false,
"folder": "Blue Middle",
"idealStartingState": {
"velocity": 0,
"rotation": 0.0
},
"useDefaultConstraints": false
}
@@ -1,54 +0,0 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 15.9,
"y": 3.465
},
"prevControl": null,
"nextControl": {
"x": 15.522355156858092,
"y": 3.465
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 15.517,
"y": 3.465
},
"prevControl": {
"x": 15.77785583456356,
"y": 3.465
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 0.5,
"maxAcceleration": 1.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 180.0
},
"reversed": false,
"folder": "Red Middle",
"idealStartingState": {
"velocity": 0,
"rotation": 180.0
},
"useDefaultConstraints": false
}
@@ -1,54 +0,0 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 1.073,
"y": 4.704
},
"prevControl": null,
"nextControl": {
"x": 1.323,
"y": 4.704
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 1.073,
"y": 4.604
},
"prevControl": {
"x": 0.7925211774538647,
"y": 4.604
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 0.25,
"maxAcceleration": 0.5,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 0.0
},
"reversed": false,
"folder": "Blue Middle",
"idealStartingState": {
"velocity": 0,
"rotation": 0.0
},
"useDefaultConstraints": false
}
@@ -1,54 +0,0 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 15.517,
"y": 3.465
},
"prevControl": null,
"nextControl": {
"x": 15.767,
"y": 3.465
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 15.517,
"y": 3.565
},
"prevControl": {
"x": 15.239842716853756,
"y": 3.565
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 0.25,
"maxAcceleration": 0.5,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 180.0
},
"reversed": false,
"folder": "Red Middle",
"idealStartingState": {
"velocity": 0,
"rotation": 180.0
},
"useDefaultConstraints": false
}
@@ -1,63 +0,0 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 0.64,
"y": 5.969
},
"prevControl": null,
"nextControl": {
"x": 0.9200056277857709,
"y": 5.902393157337589
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.485927152317881,
"y": 5.276448675496688
},
"prevControl": {
"x": 5.220827814571248,
"y": 5.6757450331143255
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 0.4,
"rotationDegrees": 135.0
},
{
"waypointRelativePos": 0.68,
"rotationDegrees": 135.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.5,
"maxAcceleration": 3.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 180.0
},
"reversed": false,
"folder": "Blue Middle",
"idealStartingState": {
"velocity": 0,
"rotation": 0.0
},
"useDefaultConstraints": true
}
@@ -1,54 +0,0 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 1.14,
"y": 5.969
},
"prevControl": null,
"nextControl": {
"x": 1.39,
"y": 5.969
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 0.64,
"y": 5.969
},
"prevControl": {
"x": 0.39,
"y": 5.969
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 0.25,
"maxAcceleration": 0.5,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 0.0
},
"reversed": false,
"folder": "Blue Middle",
"idealStartingState": {
"velocity": 0,
"rotation": 0.0
},
"useDefaultConstraints": false
}
@@ -1,54 +0,0 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 15.9,
"y": 2.1
},
"prevControl": null,
"nextControl": {
"x": 15.9,
"y": 3.0999999999999983
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 15.9,
"y": 3.465
},
"prevControl": {
"x": 15.9,
"y": 2.465000000000005
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.0,
"maxAcceleration": 2.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 180.0
},
"reversed": false,
"folder": "Red Middle",
"idealStartingState": {
"velocity": 0,
"rotation": 180.0
},
"useDefaultConstraints": false
}
+11 -11
View File
@@ -3,25 +3,25 @@
"waypoints": [ "waypoints": [
{ {
"anchor": { "anchor": {
"x": 3.5, "x": 3.5467141162514837,
"y": 2.5 "y": 4.051138790035587
}, },
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 3.8524186062054477, "x": 4.255399988299603,
"y": 2.382931901404091 "y": 4.013414379701552
}, },
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": null
}, },
{ {
"anchor": { "anchor": {
"x": 2.0, "x": 2.944199288256229,
"y": 3.0 "y": 4.051138790035587
}, },
"prevControl": { "prevControl": {
"x": 1.7628130762195064, "x": 2.694910022767602,
"y": 3.0790086272982027 "y": 4.069976574197767
}, },
"nextControl": null, "nextControl": null,
"isLocked": false, "isLocked": false,
@@ -33,8 +33,8 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 1.5, "maxVelocity": 2.0,
"maxAcceleration": 3.0, "maxAcceleration": 4.0,
"maxAngularVelocity": 360.0, "maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0, "maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,
@@ -45,7 +45,7 @@
"rotation": 0.0 "rotation": 0.0
}, },
"reversed": false, "reversed": false,
"folder": "Blue Middle", "folder": null,
"idealStartingState": { "idealStartingState": {
"velocity": 0, "velocity": 0,
"rotation": 0.0 "rotation": 0.0
@@ -0,0 +1,54 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 13.00554921540656,
"y": 4.054407988587732
},
"prevControl": null,
"nextControl": {
"x": 13.221096992334767,
"y": 3.9277621996277037
},
"isLocked": false,
"linkedName": "middle"
},
{
"anchor": {
"x": 15.613421686746985,
"y": 2.2319277108433733
},
"prevControl": {
"x": 14.309604731740064,
"y": 3.053280693788945
},
"nextControl": null,
"isLocked": false,
"linkedName": "depot"
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.5,
"maxAcceleration": 3.0,
"maxAngularVelocity": 180.0,
"maxAngularAcceleration": 360.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 158.4590240814616
},
"reversed": false,
"folder": "Red Right from pwz",
"idealStartingState": {
"velocity": 0,
"rotation": 180.0
},
"useDefaultConstraints": false
}
@@ -1,70 +0,0 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 3.04,
"y": 4.0
},
"prevControl": null,
"nextControl": {
"x": 3.3282933300270625,
"y": 3.975244391494451
},
"isLocked": true,
"linkedName": null
},
{
"anchor": {
"x": 1.97314,
"y": 4.704
},
"prevControl": {
"x": 1.4585920284163918,
"y": 4.684160090340553
},
"nextControl": {
"x": 2.2475848605490505,
"y": 4.714582028383155
},
"isLocked": true,
"linkedName": null
},
{
"anchor": {
"x": 0.64,
"y": 4.704
},
"prevControl": {
"x": 0.3610340465991982,
"y": 4.704101661030112
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.5,
"maxAcceleration": 3.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 0.0
},
"reversed": false,
"folder": "Blue Middle",
"idealStartingState": {
"velocity": 0,
"rotation": 0.0
},
"useDefaultConstraints": true
}
@@ -1,70 +0,0 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 13.5,
"y": 4.0
},
"prevControl": null,
"nextControl": {
"x": 14.25,
"y": 4.0
},
"isLocked": true,
"linkedName": null
},
{
"anchor": {
"x": 14.567,
"y": 3.4
},
"prevControl": {
"x": 14.088847622018482,
"y": 3.5461858523613685
},
"nextControl": {
"x": 14.806076188990758,
"y": 3.326907073819316
},
"isLocked": true,
"linkedName": null
},
{
"anchor": {
"x": 15.9,
"y": 3.365
},
"prevControl": {
"x": 15.572533463420765,
"y": 3.399470424413628
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.5,
"maxAcceleration": 3.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 180.0
},
"reversed": false,
"folder": "Red Middle",
"idealStartingState": {
"velocity": 0,
"rotation": 180.0
},
"useDefaultConstraints": true
}
@@ -1,54 +0,0 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 3.54,
"y": 4.0
},
"prevControl": null,
"nextControl": {
"x": 2.539999999999999,
"y": 4.0
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 1.14,
"y": 5.97
},
"prevControl": {
"x": 2.1399999999999992,
"y": 5.97
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.5,
"maxAcceleration": 3.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 0.0
},
"reversed": false,
"folder": "Blue Middle",
"idealStartingState": {
"velocity": 0,
"rotation": 0.0
},
"useDefaultConstraints": true
}
@@ -1,95 +0,0 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 0.64,
"y": 5.969
},
"prevControl": null,
"nextControl": {
"x": 1.678433584781481,
"y": 5.9229373186851895
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 2.6943708609271524,
"y": 7.381829470198674
},
"prevControl": {
"x": 2.178364289572292,
"y": 7.226083943133918
},
"nextControl": {
"x": 3.0531960414062747,
"y": 7.490133162361142
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.0,
"y": 7.2
},
"prevControl": {
"x": 5.804119228777829,
"y": 7.355340669064503
},
"nextControl": {
"x": 6.195880771222171,
"y": 7.044659330935497
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.195529801324503,
"y": 5.969
},
"prevControl": {
"x": 7.354483593458411,
"y": 5.7760396621938845
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 0.9,
"rotationDegrees": 180.0
},
{
"waypointRelativePos": 1.7,
"rotationDegrees": 180.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.5,
"maxAcceleration": 3.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 135.0
},
"reversed": false,
"folder": "Blue Middle",
"idealStartingState": {
"velocity": 0,
"rotation": 0.0
},
"useDefaultConstraints": true
}
@@ -0,0 +1,75 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 4.466034236804566,
"y": 7.454255952380953
},
"prevControl": null,
"nextControl": {
"x": 5.426124431791342,
"y": 7.458578116355653
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 5.7055580357142865,
"y": 7.454255952380953
},
"prevControl": {
"x": 5.362545053990692,
"y": 7.465613159152816
},
"nextControl": {
"x": 6.019722228934057,
"y": 7.443853932944885
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.765392296718973,
"y": 6.784465049928674
},
"prevControl": {
"x": 7.765392296718973,
"y": 7.285812251387297
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 1.0,
"rotationDegrees": 0.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 180.0,
"maxAngularAcceleration": 360.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 1.5,
"rotation": 90.0
},
"reversed": false,
"folder": "Blue Left from pwz",
"idealStartingState": {
"velocity": 0.0,
"rotation": 0.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,54 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 7.765392296718973,
"y": 6.784465049928674
},
"prevControl": null,
"nextControl": {
"x": 7.750697804389789,
"y": 5.401087218387813
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.765392296718973,
"y": 4.597831669044222
},
"prevControl": {
"x": 7.743897101946867,
"y": 5.99227817461089
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.5,
"maxAcceleration": 4.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0.0,
"rotation": 90.0
},
"reversed": false,
"folder": "Blue Left from pwz",
"idealStartingState": {
"velocity": 1.5,
"rotation": 90.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,79 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 7.765392296718973,
"y": 4.597831669044222
},
"prevControl": null,
"nextControl": {
"x": 7.323255476508917,
"y": 5.464573812325125
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.182807228915662,
"y": 7.247746987951809
},
"prevControl": {
"x": 6.705631547302918,
"y": 6.92851993042499
},
"nextControl": {
"x": 5.9062353004038926,
"y": 7.416616797232436
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 3.418096385542169,
"y": 7.3788795180722895
},
"prevControl": {
"x": 3.8149559923113934,
"y": 7.302711465107156
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 1.0,
"rotationDegrees": 0.0
},
{
"waypointRelativePos": 2.0,
"rotationDegrees": 0.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 1.2,
"rotation": 0.0
},
"reversed": false,
"folder": "Blue Left from pwz",
"idealStartingState": {
"velocity": 0.0,
"rotation": 90.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,99 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 3.418096385542169,
"y": 7.3788795180722895
},
"prevControl": null,
"nextControl": {
"x": 3.6528666325574033,
"y": 7.464803502595855
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 3.778710843373494,
"y": 7.510012048192771
},
"prevControl": {
"x": 3.540175760112069,
"y": 7.435172125334279
},
"nextControl": {
"x": 4.022178849802291,
"y": 7.586399666192227
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.33579518072289,
"y": 7.3788795180722895
},
"prevControl": {
"x": 5.948962229553457,
"y": 7.4850837462721405
},
"nextControl": {
"x": 6.584826721475427,
"y": 7.310508396886549
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.765392296718973,
"y": 6.784465049928674
},
"prevControl": {
"x": 6.937920174570973,
"y": 7.201986151309663
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 0.1,
"rotationDegrees": 0.0
},
{
"waypointRelativePos": 1,
"rotationDegrees": 0.0
},
{
"waypointRelativePos": 2.0,
"rotationDegrees": 0.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 4.0,
"maxAngularVelocity": 180.0,
"maxAngularAcceleration": 360.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 1.5,
"rotation": 90.0
},
"reversed": false,
"folder": "Blue Left from pwz",
"idealStartingState": {
"velocity": 1.2,
"rotation": 0.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,119 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 7.765392296718973,
"y": 6.784465049928674
},
"prevControl": null,
"nextControl": {
"x": 7.733458465905914,
"y": 6.464214217773148
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.813229166666666,
"y": 4.668807228915663
},
"prevControl": {
"x": 8.011674331775877,
"y": 5.027990467000143
},
"nextControl": {
"x": 7.485447276626493,
"y": 4.075526155097174
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.33579518072289,
"y": 4.668807228915663
},
"prevControl": {
"x": 6.546160668095942,
"y": 4.185317251794125
},
"nextControl": {
"x": 6.148280431906521,
"y": 5.099778595689354
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.1609518072289156,
"y": 7.302385542168675
},
"prevControl": {
"x": 6.655393279169644,
"y": 6.772626822232179
},
"nextControl": {
"x": 5.9903722446389125,
"y": 7.485149359229394
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 5.29766265060241,
"y": 7.4553734939759035
},
"prevControl": {
"x": 6.100054686274564,
"y": 7.328414006675032
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 1,
"rotationDegrees": 43.66778014613041
},
{
"waypointRelativePos": 2,
"rotationDegrees": -90.0
},
{
"waypointRelativePos": 2.4,
"rotationDegrees": -90.0
},
{
"waypointRelativePos": 3.0,
"rotationDegrees": 0.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.5,
"maxAcceleration": 4.0,
"maxAngularVelocity": 180.0,
"maxAngularAcceleration": 180.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 0.0
},
"reversed": false,
"folder": "Blue Left from pwz",
"idealStartingState": {
"velocity": 1.5,
"rotation": 90.0
},
"useDefaultConstraints": false
}
@@ -3,25 +3,25 @@
"waypoints": [ "waypoints": [
{ {
"anchor": { "anchor": {
"x": 3.04, "x": 3.0028433734939757,
"y": 4.0 "y": 6.471879518072289
}, },
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 3.4702773700848932, "x": 3.1230481927710834,
"y": 3.562911556367572 "y": 6.941771084337349
}, },
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": null
}, },
{ {
"anchor": { "anchor": {
"x": 1.14, "x": 3.418096385542169,
"y": 5.969 "y": 7.3788795180722895
}, },
"prevControl": { "prevControl": {
"x": 0.8995187790061673, "x": 3.260671343049193,
"y": 6.223926270411972 "y": 7.152135161355801
}, },
"nextControl": null, "nextControl": null,
"isLocked": false, "isLocked": false,
@@ -41,14 +41,14 @@
"unlimited": false "unlimited": false
}, },
"goalEndState": { "goalEndState": {
"velocity": 0, "velocity": 1.2,
"rotation": 0.0 "rotation": 0.0
}, },
"reversed": false, "reversed": false,
"folder": "Blue Middle", "folder": "Blue Left from pwz",
"idealStartingState": { "idealStartingState": {
"velocity": 0, "velocity": 0,
"rotation": 0.0 "rotation": -38.99099404250592
}, },
"useDefaultConstraints": false "useDefaultConstraints": true
} }
@@ -3,25 +3,25 @@
"waypoints": [ "waypoints": [
{ {
"anchor": { "anchor": {
"x": 0.84, "x": 3.418096385542169,
"y": 5.969 "y": 7.3788795180722895
}, },
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 1.2669518600756762, "x": 3.175553518148792,
"y": 5.612104897874479 "y": 7.3182745885978715
}, },
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": null
}, },
{ {
"anchor": { "anchor": {
"x": 3.04, "x": 3.0028433734939757,
"y": 4.0 "y": 6.471879518072289
}, },
"prevControl": { "prevControl": {
"x": 2.8248463530252574, "x": 3.540329100641909,
"y": 4.180015650217846 "y": 7.025981025402732
}, },
"nextControl": null, "nextControl": null,
"isLocked": false, "isLocked": false,
@@ -33,8 +33,8 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 1.5, "maxVelocity": 2.0,
"maxAcceleration": 3.0, "maxAcceleration": 4.0,
"maxAngularVelocity": 360.0, "maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0, "maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,
@@ -42,13 +42,13 @@
}, },
"goalEndState": { "goalEndState": {
"velocity": 0, "velocity": 0,
"rotation": 0.0 "rotation": -38.99099404250592
}, },
"reversed": false, "reversed": false,
"folder": "Blue Middle", "folder": "Blue Left from pwz",
"idealStartingState": { "idealStartingState": {
"velocity": 0, "velocity": 1.2,
"rotation": 0.0 "rotation": 0.0
}, },
"useDefaultConstraints": true "useDefaultConstraints": true
} }
@@ -0,0 +1,75 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 4.466034236804566,
"y": 0.6157440476190477
},
"prevControl": null,
"nextControl": {
"x": 5.426124431791342,
"y": 0.611421883644347
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 5.7055580357142865,
"y": 0.6157440476190477
},
"prevControl": {
"x": 5.362545053990692,
"y": 0.6043868408471844
},
"nextControl": {
"x": 6.019722228934057,
"y": 0.626146067055116
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.765392296718973,
"y": 1.2855349500713271
},
"prevControl": {
"x": 7.765392296718973,
"y": 0.7841877486127031
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 1.0,
"rotationDegrees": 0.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 180.0,
"maxAngularAcceleration": 360.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 1.5,
"rotation": -90.0
},
"reversed": false,
"folder": "Blue Right from pwz",
"idealStartingState": {
"velocity": 0.0,
"rotation": 0.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,54 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 7.765392296718973,
"y": 1.2855349500713271
},
"prevControl": null,
"nextControl": {
"x": 7.750697804389789,
"y": 2.668912781612187
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.765392296718973,
"y": 3.472168330955778
},
"prevControl": {
"x": 7.743897101946867,
"y": 2.0777218253891108
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.5,
"maxAcceleration": 4.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0.0,
"rotation": -90.0
},
"reversed": false,
"folder": "Blue Right from pwz",
"idealStartingState": {
"velocity": 1.5,
"rotation": -90.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,79 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 7.765392296718973,
"y": 3.472168330955778
},
"prevControl": null,
"nextControl": {
"x": 7.323255476508917,
"y": 2.605426187674875
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.182807228915662,
"y": 0.8222530120481917
},
"prevControl": {
"x": 6.705631547302918,
"y": 1.1414800695750102
},
"nextControl": {
"x": 5.9062353004038926,
"y": 0.6533832027675645
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 3.418096385542169,
"y": 0.691120481927711
},
"prevControl": {
"x": 3.8149559923113934,
"y": 0.7672885348928444
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 1.0,
"rotationDegrees": 0.0
},
{
"waypointRelativePos": 2.0,
"rotationDegrees": 0.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 1.2,
"rotation": 0.0
},
"reversed": false,
"folder": "Blue Right from pwz",
"idealStartingState": {
"velocity": 0.0,
"rotation": -90.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,99 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 3.418096385542169,
"y": 0.691120481927711
},
"prevControl": null,
"nextControl": {
"x": 3.6528666325574033,
"y": 0.6051964974041462
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 3.778710843373494,
"y": 0.5599879518072293
},
"prevControl": {
"x": 3.540175760112069,
"y": 0.634827874665722
},
"nextControl": {
"x": 4.022178849802291,
"y": 0.48360033380777306
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.33579518072289,
"y": 0.691120481927711
},
"prevControl": {
"x": 5.948962229553457,
"y": 0.5849162537278598
},
"nextControl": {
"x": 6.584826721475427,
"y": 0.7594916031134517
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.765392296718973,
"y": 1.2855349500713271
},
"prevControl": {
"x": 6.937920174570973,
"y": 0.8680138486903368
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 0.1,
"rotationDegrees": 0.0
},
{
"waypointRelativePos": 1,
"rotationDegrees": 0.0
},
{
"waypointRelativePos": 2.0,
"rotationDegrees": 0.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 4.0,
"maxAngularVelocity": 180.0,
"maxAngularAcceleration": 360.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 1.5,
"rotation": -90.0
},
"reversed": false,
"folder": "Blue Right from pwz",
"idealStartingState": {
"velocity": 1.2,
"rotation": 0.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,119 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 7.765392296718973,
"y": 1.2855349500713271
},
"prevControl": null,
"nextControl": {
"x": 7.733458465905914,
"y": 1.6057857822268522
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 7.813229166666666,
"y": 3.4011927710843373
},
"prevControl": {
"x": 8.011674331775877,
"y": 3.042009532999857
},
"nextControl": {
"x": 7.485447276626493,
"y": 3.9944738449028265
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.33579518072289,
"y": 3.4011927710843373
},
"prevControl": {
"x": 6.546160668095942,
"y": 3.8846827482058757
},
"nextControl": {
"x": 6.148280431906521,
"y": 2.9702214043106463
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 6.1609518072289156,
"y": 0.7676144578313244
},
"prevControl": {
"x": 6.655393279169644,
"y": 1.2973731777678212
},
"nextControl": {
"x": 5.9903722446389125,
"y": 0.584850640770607
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 5.29766265060241,
"y": 0.6146265060240967
},
"prevControl": {
"x": 6.100054686274564,
"y": 0.7415859933249683
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 1,
"rotationDegrees": -43.66778014613044
},
{
"waypointRelativePos": 2,
"rotationDegrees": 90.0
},
{
"waypointRelativePos": 2.4,
"rotationDegrees": 90.0
},
{
"waypointRelativePos": 3.0,
"rotationDegrees": 0.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.5,
"maxAcceleration": 4.0,
"maxAngularVelocity": 180.0,
"maxAngularAcceleration": 180.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 0.0
},
"reversed": false,
"folder": "Blue Right from pwz",
"idealStartingState": {
"velocity": 1.5,
"rotation": -90.0
},
"useDefaultConstraints": false
}
@@ -3,25 +3,25 @@
"waypoints": [ "waypoints": [
{ {
"anchor": { "anchor": {
"x": 3.53, "x": 3.0028433734939757,
"y": 4.0 "y": 1.5981204819277117
}, },
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 3.9033070768298836, "x": 3.1230481927710834,
"y": 3.9994852751840226 "y": 1.128228915662652
}, },
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": null
}, },
{ {
"anchor": { "anchor": {
"x": 3.04, "x": 3.418096385542169,
"y": 4.0 "y": 0.691120481927711
}, },
"prevControl": { "prevControl": {
"x": 2.783639997726092, "x": 3.260671343049193,
"y": 4.003292975326709 "y": 0.9178648386441994
}, },
"nextControl": null, "nextControl": null,
"isLocked": false, "isLocked": false,
@@ -33,22 +33,22 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 1.5, "maxVelocity": 2.0,
"maxAcceleration": 3.0, "maxAcceleration": 4.0,
"maxAngularVelocity": 360.0, "maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0, "maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,
"unlimited": false "unlimited": false
}, },
"goalEndState": { "goalEndState": {
"velocity": 0, "velocity": 1.2,
"rotation": 0.0 "rotation": 0.0
}, },
"reversed": false, "reversed": false,
"folder": "Blue Middle", "folder": "Blue Right from pwz",
"idealStartingState": { "idealStartingState": {
"velocity": 0, "velocity": 0,
"rotation": 0.0 "rotation": 38.99099404250589
}, },
"useDefaultConstraints": true "useDefaultConstraints": true
} }
@@ -0,0 +1,54 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 3.418096385542169,
"y": 0.691120481927711
},
"prevControl": null,
"nextControl": {
"x": 3.175553518148792,
"y": 0.7517254114021283
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 3.0028433734939757,
"y": 1.5981204819277117
},
"prevControl": {
"x": 3.540329100641909,
"y": 1.0440189745972686
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 4.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 38.99099404250589
},
"reversed": false,
"folder": "Blue Right from pwz",
"idealStartingState": {
"velocity": 1.2,
"rotation": 0.0
},
"useDefaultConstraints": true
}
@@ -0,0 +1,75 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 12.073965763195433,
"y": 0.6157440476190477
},
"prevControl": null,
"nextControl": {
"x": 11.113875568208657,
"y": 0.6114218836443469
},
"isLocked": false,
"linkedName": "trench"
},
{
"anchor": {
"x": 10.834441964285713,
"y": 0.6157440476190477
},
"prevControl": {
"x": 11.177454946009307,
"y": 0.6043868408471843
},
"nextControl": {
"x": 10.520277771065942,
"y": 0.626146067055116
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 8.774607703281026,
"y": 1.2855349500713271
},
"prevControl": {
"x": 8.774607703281026,
"y": 0.7841877486127031
},
"nextControl": null,
"isLocked": false,
"linkedName": "1"
}
],
"rotationTargets": [
{
"waypointRelativePos": 1.0,
"rotationDegrees": 180.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 180.0,
"maxAngularAcceleration": 360.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 1.5,
"rotation": -90.0
},
"reversed": false,
"folder": "Red Right from pwz",
"idealStartingState": {
"velocity": 0.0,
"rotation": 180.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,54 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 8.774607703281026,
"y": 1.2855349500713271
},
"prevControl": null,
"nextControl": {
"x": 8.78930219561021,
"y": 2.668912781612187
},
"isLocked": false,
"linkedName": "1"
},
{
"anchor": {
"x": 8.774607703281026,
"y": 3.472168330955778
},
"prevControl": {
"x": 8.796102898053132,
"y": 2.0777218253891108
},
"nextControl": null,
"isLocked": false,
"linkedName": "2"
}
],
"rotationTargets": [],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.5,
"maxAcceleration": 4.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0.0,
"rotation": -90.0
},
"reversed": false,
"folder": "Red Right from pwz",
"idealStartingState": {
"velocity": 1.5,
"rotation": -90.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,79 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 8.774607703281026,
"y": 3.472168330955778
},
"prevControl": null,
"nextControl": {
"x": 9.216744523491082,
"y": 2.605426187674875
},
"isLocked": false,
"linkedName": "2"
},
{
"anchor": {
"x": 10.357192771084337,
"y": 0.8222530120481917
},
"prevControl": {
"x": 9.834368452697081,
"y": 1.1414800695750102
},
"nextControl": {
"x": 10.633764699596107,
"y": 0.6533832027675643
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 13.12190361445783,
"y": 0.691120481927711
},
"prevControl": {
"x": 12.725044007688606,
"y": 0.7672885348928444
},
"nextControl": null,
"isLocked": false,
"linkedName": "3"
}
],
"rotationTargets": [
{
"waypointRelativePos": 1.0,
"rotationDegrees": 180.0
},
{
"waypointRelativePos": 2.0,
"rotationDegrees": 180.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 1.2,
"rotation": 180.0
},
"reversed": false,
"folder": "Red Right from pwz",
"idealStartingState": {
"velocity": 0.0,
"rotation": -90.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,99 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 13.12190361445783,
"y": 0.691120481927711
},
"prevControl": null,
"nextControl": {
"x": 12.887133367442596,
"y": 0.6051964974041462
},
"isLocked": false,
"linkedName": "3"
},
{
"anchor": {
"x": 12.761289156626505,
"y": 0.5599879518072293
},
"prevControl": {
"x": 12.99982423988793,
"y": 0.634827874665722
},
"nextControl": {
"x": 12.517821150197708,
"y": 0.48360033380777306
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 10.204204819277109,
"y": 0.691120481927711
},
"prevControl": {
"x": 10.591037770446542,
"y": 0.5849162537278597
},
"nextControl": {
"x": 9.955173278524573,
"y": 0.7594916031134517
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 8.774607703281026,
"y": 1.2855349500713271
},
"prevControl": {
"x": 9.602079825429026,
"y": 0.868013848690337
},
"nextControl": null,
"isLocked": false,
"linkedName": "1"
}
],
"rotationTargets": [
{
"waypointRelativePos": 0.1,
"rotationDegrees": 180.0
},
{
"waypointRelativePos": 1,
"rotationDegrees": 180.0
},
{
"waypointRelativePos": 2.0,
"rotationDegrees": 180.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 4.0,
"maxAngularVelocity": 180.0,
"maxAngularAcceleration": 360.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 1.5,
"rotation": -90.0
},
"reversed": false,
"folder": "Red Right from pwz",
"idealStartingState": {
"velocity": 0.0,
"rotation": 180.0
},
"useDefaultConstraints": false
}
+119
View File
@@ -0,0 +1,119 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 8.774607703281026,
"y": 1.2855349500713271
},
"prevControl": null,
"nextControl": {
"x": 8.806541534094086,
"y": 1.6057857822268522
},
"isLocked": false,
"linkedName": "1"
},
{
"anchor": {
"x": 8.726770833333333,
"y": 3.4011927710843373
},
"prevControl": {
"x": 8.528325668224122,
"y": 3.042009532999857
},
"nextControl": {
"x": 9.054552723373506,
"y": 3.9944738449028265
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 10.204204819277109,
"y": 3.4011927710843373
},
"prevControl": {
"x": 9.993839331904057,
"y": 3.8846827482058757
},
"nextControl": {
"x": 10.391719568093478,
"y": 2.9702214043106463
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 10.379048192771084,
"y": 0.7676144578313244
},
"prevControl": {
"x": 9.884606720830355,
"y": 1.2973731777678212
},
"nextControl": {
"x": 10.549627755361087,
"y": 0.584850640770607
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 11.242337349397589,
"y": 0.6146265060240967
},
"prevControl": {
"x": 10.439945313725435,
"y": 0.7415859933249683
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 1,
"rotationDegrees": -136.3322198538696
},
{
"waypointRelativePos": 2,
"rotationDegrees": 90.0
},
{
"waypointRelativePos": 2.4,
"rotationDegrees": 90.0
},
{
"waypointRelativePos": 3.0,
"rotationDegrees": 180.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.5,
"maxAcceleration": 4.0,
"maxAngularVelocity": 180.0,
"maxAngularAcceleration": 180.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 180.0
},
"reversed": false,
"folder": "Red Right from pwz",
"idealStartingState": {
"velocity": 1.5,
"rotation": -90.0
},
"useDefaultConstraints": false
}
@@ -3,29 +3,29 @@
"waypoints": [ "waypoints": [
{ {
"anchor": { "anchor": {
"x": 15.4, "x": 15.613421686746985,
"y": 2.1 "y": 2.2319277108433733
}, },
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 15.65, "x": 15.36208433734939,
"y": 2.1 "y": 2.2319277108433733
}, },
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": "depot"
}, },
{ {
"anchor": { "anchor": {
"x": 15.9, "x": 13.12190361445783,
"y": 2.1 "y": 0.691120481927711
}, },
"prevControl": { "prevControl": {
"x": 15.65, "x": 13.37190361445783,
"y": 2.1 "y": 0.691120481927711
}, },
"nextControl": null, "nextControl": null,
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": "3"
} }
], ],
"rotationTargets": [], "rotationTargets": [],
@@ -33,7 +33,7 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 0.5, "maxVelocity": 1.5,
"maxAcceleration": 3.0, "maxAcceleration": 3.0,
"maxAngularVelocity": 360.0, "maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0, "maxAngularAcceleration": 720.0,
@@ -41,14 +41,14 @@
"unlimited": false "unlimited": false
}, },
"goalEndState": { "goalEndState": {
"velocity": 0, "velocity": 0.0,
"rotation": 180.0 "rotation": 180.0
}, },
"reversed": false, "reversed": false,
"folder": "Red Middle", "folder": "Red Right from pwz",
"idealStartingState": { "idealStartingState": {
"velocity": 0, "velocity": 0,
"rotation": 180.0 "rotation": 158.4590240814616
}, },
"useDefaultConstraints": false "useDefaultConstraints": false
} }
@@ -0,0 +1,75 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 12.073965763195433,
"y": 7.454255952380953
},
"prevControl": null,
"nextControl": {
"x": 11.113875568208657,
"y": 7.458578116355653
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 10.834441964285713,
"y": 7.454255952380953
},
"prevControl": {
"x": 11.177454946009307,
"y": 7.465613159152816
},
"nextControl": {
"x": 10.520277771065942,
"y": 7.443853932944885
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 8.774607703281026,
"y": 6.784465049928674
},
"prevControl": {
"x": 8.774607703281026,
"y": 7.285812251387297
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 1.0,
"rotationDegrees": 180.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 180.0,
"maxAngularAcceleration": 360.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 1.5,
"rotation": 90.0
},
"reversed": false,
"folder": "Red Right from pwz",
"idealStartingState": {
"velocity": 0.0,
"rotation": 180.0
},
"useDefaultConstraints": false
}
@@ -3,25 +3,25 @@
"waypoints": [ "waypoints": [
{ {
"anchor": { "anchor": {
"x": 0.64, "x": 8.774607703281026,
"y": 5.97 "y": 6.784465049928674
}, },
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 0.6399999999999998, "x": 8.78930219561021,
"y": 4.9700000000000015 "y": 5.401087218387813
}, },
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": null
}, },
{ {
"anchor": { "anchor": {
"x": 0.64, "x": 8.774607703281026,
"y": 4.705 "y": 4.597831669044222
}, },
"prevControl": { "prevControl": {
"x": 0.6400000000000002, "x": 8.796102898053132,
"y": 5.705 "y": 5.99227817461089
}, },
"nextControl": null, "nextControl": null,
"isLocked": false, "isLocked": false,
@@ -34,21 +34,21 @@
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 1.5, "maxVelocity": 1.5,
"maxAcceleration": 3.0, "maxAcceleration": 4.0,
"maxAngularVelocity": 360.0, "maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0, "maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,
"unlimited": false "unlimited": false
}, },
"goalEndState": { "goalEndState": {
"velocity": 0, "velocity": 0.0,
"rotation": 0.0 "rotation": 90.0
}, },
"reversed": false, "reversed": false,
"folder": "Blue Middle", "folder": "Red Right from pwz",
"idealStartingState": { "idealStartingState": {
"velocity": 0, "velocity": 1.5,
"rotation": 0.0 "rotation": 90.0
}, },
"useDefaultConstraints": false "useDefaultConstraints": false
} }
@@ -0,0 +1,79 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 8.774607703281026,
"y": 4.597831669044222
},
"prevControl": null,
"nextControl": {
"x": 9.216744523491082,
"y": 5.464573812325125
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 10.357192771084337,
"y": 7.247746987951809
},
"prevControl": {
"x": 9.834368452697081,
"y": 6.92851993042499
},
"nextControl": {
"x": 10.633764699596107,
"y": 7.416616797232436
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 13.12190361445783,
"y": 7.3788795180722895
},
"prevControl": {
"x": 12.725044007688606,
"y": 7.302711465107156
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 1.0,
"rotationDegrees": 180.0
},
{
"waypointRelativePos": 2.0,
"rotationDegrees": 180.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 1.2,
"rotation": 180.0
},
"reversed": false,
"folder": "Red Right from pwz",
"idealStartingState": {
"velocity": 0.0,
"rotation": 90.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,99 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 13.12190361445783,
"y": 7.3788795180722895
},
"prevControl": null,
"nextControl": {
"x": 12.887133367442596,
"y": 7.464803502595855
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 12.761289156626505,
"y": 7.510012048192771
},
"prevControl": {
"x": 12.99982423988793,
"y": 7.435172125334279
},
"nextControl": {
"x": 12.517821150197708,
"y": 7.586399666192227
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 10.204204819277109,
"y": 7.3788795180722895
},
"prevControl": {
"x": 10.591037770446542,
"y": 7.4850837462721405
},
"nextControl": {
"x": 9.955173278524573,
"y": 7.310508396886549
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 8.774607703281026,
"y": 6.784465049928674
},
"prevControl": {
"x": 9.602079825429026,
"y": 7.201986151309663
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 0.1,
"rotationDegrees": 180.0
},
{
"waypointRelativePos": 1,
"rotationDegrees": 180.0
},
{
"waypointRelativePos": 2.0,
"rotationDegrees": 180.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 2.0,
"maxAcceleration": 4.0,
"maxAngularVelocity": 180.0,
"maxAngularAcceleration": 360.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 1.5,
"rotation": 90.0
},
"reversed": false,
"folder": "Red Right from pwz",
"idealStartingState": {
"velocity": 0.0,
"rotation": 180.0
},
"useDefaultConstraints": false
}
@@ -0,0 +1,119 @@
{
"version": "2025.0",
"waypoints": [
{
"anchor": {
"x": 8.774607703281026,
"y": 6.784465049928674
},
"prevControl": null,
"nextControl": {
"x": 8.806541534094086,
"y": 6.464214217773148
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 8.726770833333333,
"y": 4.668807228915663
},
"prevControl": {
"x": 8.528325668224122,
"y": 5.027990467000143
},
"nextControl": {
"x": 9.054552723373506,
"y": 4.075526155097174
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 10.204204819277109,
"y": 4.668807228915663
},
"prevControl": {
"x": 9.993839331904057,
"y": 4.185317251794125
},
"nextControl": {
"x": 10.391719568093478,
"y": 5.099778595689354
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 10.379048192771084,
"y": 7.302385542168675
},
"prevControl": {
"x": 9.884606720830355,
"y": 6.772626822232179
},
"nextControl": {
"x": 10.549627755361087,
"y": 7.485149359229394
},
"isLocked": false,
"linkedName": null
},
{
"anchor": {
"x": 11.242337349397589,
"y": 7.4553734939759035
},
"prevControl": {
"x": 10.439945313725435,
"y": 7.328414006675032
},
"nextControl": null,
"isLocked": false,
"linkedName": null
}
],
"rotationTargets": [
{
"waypointRelativePos": 1,
"rotationDegrees": 136.33221985386956
},
{
"waypointRelativePos": 2,
"rotationDegrees": -90.0
},
{
"waypointRelativePos": 2.4,
"rotationDegrees": -90.0
},
{
"waypointRelativePos": 3.0,
"rotationDegrees": 180.0
}
],
"constraintZones": [],
"pointTowardsZones": [],
"eventMarkers": [],
"globalConstraints": {
"maxVelocity": 1.5,
"maxAcceleration": 4.0,
"maxAngularVelocity": 180.0,
"maxAngularAcceleration": 180.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
"rotation": 180.0
},
"reversed": false,
"folder": "Red Right from pwz",
"idealStartingState": {
"velocity": 1.5,
"rotation": 90.0
},
"useDefaultConstraints": false
}
@@ -3,25 +3,25 @@
"waypoints": [ "waypoints": [
{ {
"anchor": { "anchor": {
"x": 15.7, "x": 13.537156626506023,
"y": 2.1 "y": 6.471879518072289
}, },
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 16.18921636103803, "x": 13.416951807228916,
"y": 1.647541846848796 "y": 6.941771084337349
}, },
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": null
}, },
{ {
"anchor": { "anchor": {
"x": 13.5, "x": 13.12190361445783,
"y": 4.0 "y": 7.3788795180722895
}, },
"prevControl": { "prevControl": {
"x": 13.247149348869588, "x": 13.279328656950806,
"y": 4.238251681778358 "y": 7.152135161355801
}, },
"nextControl": null, "nextControl": null,
"isLocked": false, "isLocked": false,
@@ -41,14 +41,14 @@
"unlimited": false "unlimited": false
}, },
"goalEndState": { "goalEndState": {
"velocity": 0, "velocity": 0.0,
"rotation": 180.0 "rotation": 180.0
}, },
"reversed": false, "reversed": false,
"folder": "Red Middle", "folder": "Red Right from pwz",
"idealStartingState": { "idealStartingState": {
"velocity": 0, "velocity": 0,
"rotation": 180.0 "rotation": -141.0090059574941
}, },
"useDefaultConstraints": false "useDefaultConstraints": true
} }
@@ -3,25 +3,25 @@
"waypoints": [ "waypoints": [
{ {
"anchor": { "anchor": {
"x": 13.5, "x": 13.12190361445783,
"y": 4.0 "y": 7.3788795180722895
}, },
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 13.699377937127288, "x": 13.364446481851207,
"y": 3.7771427571164287 "y": 7.3182745885978715
}, },
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": null
}, },
{ {
"anchor": { "anchor": {
"x": 15.400452528841061, "x": 13.537156626506023,
"y": 2.1 "y": 6.471879518072289
}, },
"prevControl": { "prevControl": {
"x": 15.073650526430217, "x": 12.99967089935809,
"y": 2.4474296685616617 "y": 7.025981025402732
}, },
"nextControl": null, "nextControl": null,
"isLocked": false, "isLocked": false,
@@ -42,13 +42,13 @@
}, },
"goalEndState": { "goalEndState": {
"velocity": 0, "velocity": 0,
"rotation": 180.0 "rotation": -141.0090059574941
}, },
"reversed": false, "reversed": false,
"folder": "Red Middle", "folder": "Red Right from pwz",
"idealStartingState": { "idealStartingState": {
"velocity": 0, "velocity": 1.2,
"rotation": 180.0 "rotation": 180.0
}, },
"useDefaultConstraints": false "useDefaultConstraints": true
} }
@@ -3,29 +3,29 @@
"waypoints": [ "waypoints": [
{ {
"anchor": { "anchor": {
"x": 13.01022182786158, "x": 13.537156626506023,
"y": 4.0 "y": 1.5981204819277117
}, },
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 13.865906250551847, "x": 13.416951807228916,
"y": 4.0 "y": 1.128228915662652
}, },
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": "sssss"
}, },
{ {
"anchor": { "anchor": {
"x": 13.5, "x": 13.12190361445783,
"y": 4.0 "y": 0.691120481927711
}, },
"prevControl": { "prevControl": {
"x": 13.231071353115471, "x": 13.279328656950806,
"y": 4.0 "y": 0.9178648386441994
}, },
"nextControl": null, "nextControl": null,
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": "3"
} }
], ],
"rotationTargets": [], "rotationTargets": [],
@@ -33,22 +33,22 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 1.5, "maxVelocity": 2.0,
"maxAcceleration": 3.0, "maxAcceleration": 4.0,
"maxAngularVelocity": 360.0, "maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0, "maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,
"unlimited": false "unlimited": false
}, },
"goalEndState": { "goalEndState": {
"velocity": 0, "velocity": 0.0,
"rotation": 180.0 "rotation": 180.0
}, },
"reversed": false, "reversed": false,
"folder": "Red Middle", "folder": "Red Right from pwz",
"idealStartingState": { "idealStartingState": {
"velocity": 0, "velocity": 0,
"rotation": 180.0 "rotation": 141.0090059574941
}, },
"useDefaultConstraints": true "useDefaultConstraints": true
} }
@@ -3,29 +3,29 @@
"waypoints": [ "waypoints": [
{ {
"anchor": { "anchor": {
"x": 13.0, "x": 13.12190361445783,
"y": 4.0 "y": 0.691120481927711
}, },
"prevControl": null, "prevControl": null,
"nextControl": { "nextControl": {
"x": 14.000000000000002, "x": 13.364446481851207,
"y": 4.0 "y": 0.7517254114021283
}, },
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": "3"
}, },
{ {
"anchor": { "anchor": {
"x": 15.400452528841061, "x": 13.537156626506023,
"y": 2.1 "y": 1.5981204819277117
}, },
"prevControl": { "prevControl": {
"x": 14.400452528841061, "x": 12.99967089935809,
"y": 2.1 "y": 1.0440189745972686
}, },
"nextControl": null, "nextControl": null,
"isLocked": false, "isLocked": false,
"linkedName": null "linkedName": "sssss"
} }
], ],
"rotationTargets": [], "rotationTargets": [],
@@ -33,8 +33,8 @@
"pointTowardsZones": [], "pointTowardsZones": [],
"eventMarkers": [], "eventMarkers": [],
"globalConstraints": { "globalConstraints": {
"maxVelocity": 1.5, "maxVelocity": 2.0,
"maxAcceleration": 3.0, "maxAcceleration": 4.0,
"maxAngularVelocity": 360.0, "maxAngularVelocity": 360.0,
"maxAngularAcceleration": 720.0, "maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0, "nominalVoltage": 12.0,
@@ -42,12 +42,12 @@
}, },
"goalEndState": { "goalEndState": {
"velocity": 0, "velocity": 0,
"rotation": 180.0 "rotation": 141.0090059574941
}, },
"reversed": false, "reversed": false,
"folder": "Red Middle", "folder": "Red Right from pwz",
"idealStartingState": { "idealStartingState": {
"velocity": 0, "velocity": 1.2,
"rotation": 180.0 "rotation": 180.0
}, },
"useDefaultConstraints": true "useDefaultConstraints": true
+9 -7
View File
@@ -3,19 +3,21 @@
"robotLength": 0.85, "robotLength": 0.85,
"holonomicMode": true, "holonomicMode": true,
"pathFolders": [ "pathFolders": [
"Blue Middle", "Blue Left from pwz",
"Red Middle" "Red Right from pwz",
"Blue Right from pwz"
], ],
"autoFolders": [ "autoFolders": [
"Red Middle", "Blue",
"Blue Middle" "New Folder",
"Red"
], ],
"defaultMaxVel": 1.5, "defaultMaxVel": 2.0,
"defaultMaxAccel": 3.0, "defaultMaxAccel": 4.0,
"defaultMaxAngVel": 360.0, "defaultMaxAngVel": 360.0,
"defaultMaxAngAccel": 720.0, "defaultMaxAngAccel": 720.0,
"defaultNominalVoltage": 12.0, "defaultNominalVoltage": 12.0,
"robotMass": 30.0, "robotMass": 50.0,
"robotMOI": 3.6, "robotMOI": 3.6,
"robotTrackwidth": 0.546, "robotTrackwidth": 0.546,
"driveWheelRadius": 0.045, "driveWheelRadius": 0.045,
+39 -33
View File
@@ -11,37 +11,38 @@ public final class Constants {
public static final boolean LEDUsing = false; public static final boolean LEDUsing = false;
public static class Shooter { public static class Shooter {
// 机构 CAN ID 目前是占位值;季后赛最终接线确认后,只需要改这里。 // Placeholder mechanism CAN IDs; update here after final wiring.
public static final int leftFlywheelID = 38; public static final int leftFlywheelID = 38;
public static final int rightFlywheelID = 39; public static final int rightFlywheelID = 39;
public static final int leftConveyorID = 40; public static final int leftConveyorID = 40;
public static final int rightConveyorID = 37; public static final int rightConveyorID = 37;
public static final int backboardMotorID = 44; public static final int backboardMotorID = 44;
public static final double flywheelNominalKv = 0.12;
public static final double defaultFlywheelVoltage = 3.34; public static final double defaultFlywheelVoltage = 3.34;
public static final double flywheelReadyVoltageThreshold = 1.0; public static final double defaultFlywheelVelocity = defaultFlywheelVoltage / flywheelNominalKv;
public static final double flywheelMaxVelocity = 120.0;
public static final double flywheelReadyVelocityThreshold = 5.0;
public static final double flywheelReadyVelocityTolerance = 2.0;
public static final double flywheelReadyDelaySeconds = 0.5; public static final double flywheelReadyDelaySeconds = 0.5;
// 距离(米) -> 飞轮电压(V) 射表。当前为占位点; // Distance (meters) -> flywheel velocity (rotations per second).
// 真车试射后按实测数据加点即可,查表自动线性插值并在两端取边界值。
public static final InterpolatingDoubleTreeMap flywheelVoltageByDistance = new InterpolatingDoubleTreeMap();
static {
flywheelVoltageByDistance.put(1.2, 5.82);
flywheelVoltageByDistance.put(2.5, 6.34);
flywheelVoltageByDistance.put(3.5, 6.73);
flywheelVoltageByDistance.put(5.0, 7.33);
}
public static final double shooterConveyorFeedVoltage = 3.0; public static final double shooterConveyorFeedVelocity = 40;
public static final double shooterConveyorReverseVoltage = -2.0; public static final double shooterConveyorReverseVelocity = -10;
public static final double shooterConveyorMaxVelocity = 120.0;
public static final Slot0Configs flyWheelSlot0Configs = new Slot0Configs() public static final Slot0Configs flyWheelSlot0Configs = new Slot0Configs()
.withKP(0.0).withKI(0).withKD(0) .withKP(0.21)
.withKV(0.099).withKA(0.0).withKS(0.0); .withKI(0)
.withKD(0.004)
.withKS(0.25)
.withKA(0.0)
.withKV(flywheelNominalKv);
public static final Slot0Configs conveyorSlot0Configs = new Slot0Configs() public static final Slot0Configs conveyorSlot0Configs = new Slot0Configs()
.withKP(0.0).withKI(0).withKD(0) .withKP(0.19).withKI(0).withKD(0.001)
.withKV(0.16).withKA(0.15).withKS(0); .withKV(0.125).withKA(0.0).withKS(0.07);
public static final Slot0Configs backboardSlot0Configs = new Slot0Configs() public static final Slot0Configs backboardSlot0Configs = new Slot0Configs()
.withKP(0.01).withKI(0).withKD(0) .withKP(0.01).withKI(0).withKD(0)
@@ -53,14 +54,19 @@ public final class Constants {
public static final double kD = 0.0; public static final double kD = 0.0;
} }
public static final double backboardSpeedMax = 5.0; public static final double backboardSpeedMax = 3.0;
public static final double backboardSpeedMin = 0.4; public static final double backboardSpeedMin = 0;
public static final double backboardGravityFeedforwardMinVolts = 0.2;
public static final double backboardGravityFeedforwardMaxVolts = 0.5;
public static final double backboardGravityFeedforwardMinPosition = 0.0;
public static final double backboardGravityFeedforwardMaxPosition = 2200.0;
public static final double backboardGravityFeedforwardDirection = 1.0;
public static final double backboardUpLimit = 2200.0; public static final double backboardUpLimit = 2200.0;
public static final double backboardDownLimit = 0.0; public static final double backboardDownLimit = 0.0;
} }
public static class AutoPositioning { public static class AutoPositioning {
public static final double autoRotationkP = 0.08; public static final double autoRotationkP = 0.07;
public static final double autoRotationForBumpTargetDegrees = 45; public static final double autoRotationForBumpTargetDegrees = 45;
public static final double autoRotationForTrenchTargetDegrees = 0; public static final double autoRotationForTrenchTargetDegrees = 0;
public static final boolean teleopOffsetEnabled = true; public static final boolean teleopOffsetEnabled = true;
@@ -113,7 +119,7 @@ public final class Constants {
} }
public static class Intaker { public static class Intaker {
// 进球机构 CAN ID 同样是占位值,真实 ID 确认后集中在这里修改。 // Placeholder intake CAN IDs; update here after wiring is confirmed.
public static final int leftIntakeRollerID = 20; public static final int leftIntakeRollerID = 20;
public static final int rightIntakeRollerID = 47; public static final int rightIntakeRollerID = 47;
public static final int leftIntakeRotaterID = 48; public static final int leftIntakeRotaterID = 48;
@@ -123,10 +129,7 @@ public final class Constants {
public static final double intakeRollerOuttakeVoltage = 3.0; public static final double intakeRollerOuttakeVoltage = 3.0;
public static final double intakeRotaterRaiseVoltage = 0.8; public static final double intakeRotaterRaiseVoltage = 0.8;
public static final double intakeRotaterLowerVoltage = 0.05; public static final double intakeRotaterLowerVoltage = -1.5;
public static final double intakeRotaterShootAssistPeriodSeconds = 0.4;
public static final double intakeRotaterShootAssistUpDutyCycle = 0.5;
public static final Slot0Configs intakeRollerSlot0Configs = new Slot0Configs() public static final Slot0Configs intakeRollerSlot0Configs = new Slot0Configs()
.withKP(0.00).withKI(0.00).withKD(0.00) .withKP(0.00).withKI(0.00).withKD(0.00)
@@ -138,12 +141,13 @@ public final class Constants {
.withKV(0.00).withKA(0.00).withKS(0.00); .withKV(0.00).withKA(0.00).withKS(0.00);
public static final double IntakeGetterSpeedforAuto = 0.5; public static final double IntakeGetterSpeedforAuto = 0.5;
// 这里给出可用的占位值,真车调好位置闭环后再收紧。 // Placeholder values; tighten after the real mechanism is tuned.
} }
public static class Conveyor { public static class Conveyor {
public static final int mainConveyorID = 42; public static final int mainConveyorID = 42;
public static final double feedVoltage = 2.5; public static final double feedVoltage = 2.5;
public static final double intakeFeedVoltage = 1.5;
public static final double reverseVoltage = -2.0; public static final double reverseVoltage = -2.0;
public static final Slot0Configs mainConveyorSlot0Configs = new Slot0Configs() public static final Slot0Configs mainConveyorSlot0Configs = new Slot0Configs()
@@ -152,18 +156,20 @@ public final class Constants {
} }
public static class Superstructure { public static class Superstructure {
// 状态机时间和门控容差。真车基础动作验证后,需要现场调这些值。 // State-machine timing and gate tolerances; tune on the real robot.
public static final double shooterFeedVoltage = Shooter.shooterConveyorFeedVoltage;
public static final double shooterReverseVoltage = Shooter.shooterConveyorReverseVoltage; public static final double shooterFeedVelocity = Shooter.shooterConveyorFeedVelocity;
public static final double shootTimeoutSeconds = 1.0; public static final double shooterReverseVelocity = Shooter.shooterConveyorReverseVelocity;
public static final double shootTimeoutSeconds = 4.0;
public static final double prepShootFallbackDelaySeconds = 0.5;
public static final double aimToleranceDegrees = 1.5; public static final double aimToleranceDegrees = 1.5;
public static final double stationarySpeedToleranceMetersPerSecond = 0.5; public static final double stationarySpeedToleranceMetersPerSecond = 0.5;
public static final double passBallFlywheelVoltage = Shooter.defaultFlywheelVoltage; public static final double passBallFlywheelVoltage = Shooter.defaultFlywheelVoltage;
public static final double passBallFlywheelVelocity = Shooter.defaultFlywheelVelocity;
public static final double passBallBackboardPosition = 175.0; public static final double passBallBackboardPosition = 175.0;
// 射击时背板的目标位置(外接编码器计数)。 // Shoot backboard target position in external encoder counts.
public static final double backboardShootPosition = 175.0; public static final double backboardShootPosition = 175.0;
// 射击门控是否要求底盘接近静止。 public static final double backboardReadyPositionTolerance = 100.0;
public static final boolean stationaryGateEnabled = true;
} }
} }
+1
View File
@@ -45,6 +45,7 @@ public class Robot extends TimedRobot {
@Override @Override
public void autonomousInit() { public void autonomousInit() {
m_autonomousCommand = m_robotContainer.getAutonomousCommand(); m_autonomousCommand = m_robotContainer.getAutonomousCommand();
System.out.println("Selected auto: " + (m_autonomousCommand == null ? "null" : m_autonomousCommand.getName()));
if (m_autonomousCommand != null) { if (m_autonomousCommand != null) {
CommandScheduler.getInstance().schedule(m_autonomousCommand); CommandScheduler.getInstance().schedule(m_autonomousCommand);
+31 -71
View File
@@ -36,9 +36,8 @@ public class RobotContainer {
/* 手柄 */ /* 手柄 */
/* ====================== */ /* ====================== */
// 使用两个 Xbox 手柄:0 号给底盘驾驶,1 号给机构操作员。 // 使用一个 Xbox 手柄:0 号口同时负责底盘驾驶和机构操作。
private final CommandXboxController controllerlower = new CommandXboxController(0); private final CommandXboxController controller = new CommandXboxController(0);
private final CommandXboxController controllerupper = new CommandXboxController(1);
/* ====================== */ /* ====================== */
/* 子系统 */ /* 子系统 */
@@ -70,24 +69,16 @@ public class RobotContainer {
/* 控制封装/调参 */ /* 控制封装/调参 */
/* ====================== */ /* ====================== */
public final DriveControls driveControls = new DriveControls(drivetrain, controllerlower, superstructure); public final DriveControls driveControls = new DriveControls(drivetrain, controller, superstructure);
// 操作员意图层替代旧的射击/进球分离控制类,让复杂动作判断集中留在 Superstructure。 // 操作员意图层替代旧的射击/进球分离控制类,让复杂动作判断集中留在 Superstructure。
private final OperatorControls operatorControls = new OperatorControls(superstructure, shooterSubsystem); private final OperatorControls operatorControls = new OperatorControls(superstructure, shooterSubsystem);
private final DriveGainsTuner driveGainsTuner = new DriveGainsTuner(drivetrain); private final DriveGainsTuner driveGainsTuner = new DriveGainsTuner(drivetrain);
private final GameData2026 gameData2026 = new GameData2026(); private final GameData2026 gameData2026 = new GameData2026();
private ConfigTalonFXMotorTuner configFlywheelTuner = private ConfigTalonFXMotorTuner configFlywheelTuner =
new ConfigTalonFXMotorTuner(shooterSubsystem.leftFlywheel, "flywheel", Constants.Shooter.flyWheelSlot0Configs); new ConfigTalonFXMotorTuner(shooterSubsystem.leftFlywheel, "flywheel", Constants.Shooter.flyWheelSlot0Configs, false);
private ConfigTalonFXMotorTuner configConveyorTuner =
new ConfigTalonFXMotorTuner(shooterSubsystem.leftConveyor, "conveyor", Constants.Shooter.conveyorSlot0Configs);
private ConfigTalonFXSMotorTuner configBackboardTuner = private ConfigTalonFXSMotorTuner configBackboardTuner =
new ConfigTalonFXSMotorTuner(shooterSubsystem.backboardMotor, "backboard", Constants.Shooter.backboardSlot0Configs); new ConfigTalonFXSMotorTuner(shooterSubsystem.backboardMotor, "backboard", Constants.Shooter.backboardSlot0Configs);
private ConfigTalonFXMotorTuner configMainConveyorTuner =
new ConfigTalonFXMotorTuner(conveyorSubsystem.mainConveyor, "mainconveyor", Constants.Conveyor.mainConveyorSlot0Configs);
private ConfigTalonFXMotorTuner configIntakerRollerTuner =
new ConfigTalonFXMotorTuner(intakeRollerSubsystem.leftIntakeRoller, "intakerroller", Constants.Intaker.intakeRollerSlot0Configs);
private ConfigTalonFXMotorTuner configIntakerRotaterTuner =
new ConfigTalonFXMotorTuner(intakeRotaterSubsystem.leftIntakeRotater, "intakerrotater", Constants.Intaker.intakeRotaterSlot0Configs);
private final SendableChooser<Command> autoChooser; private final SendableChooser<Command> autoChooser;
private final Trigger enableTrigger = new Trigger(DriverStation::isEnabled); private final Trigger enableTrigger = new Trigger(DriverStation::isEnabled);
@@ -128,44 +119,12 @@ public class RobotContainer {
// 禁用状态下进入空闲命令,防止模块继续响应上一周期的运动请求。 // 禁用状态下进入空闲命令,防止模块继续响应上一周期的运动请求。
RobotModeTriggers.disabled().whileTrue(driveControls.idleCommand()); RobotModeTriggers.disabled().whileTrue(driveControls.idleCommand());
// 左保险:按住刹车。
controllerlower.leftBumper()
.onTrue(Commands.runOnce(driveControls::emergencyStop))
.whileTrue(driveControls.brakeWhileHeld());
// 右保险:按住开启加速模式,松开后恢复普通速度。
controllerlower.rightBumper()
.onTrue(Commands.runOnce(() -> driveControls.setBoostEnabled(true)))
.onFalse(Commands.runOnce(() -> driveControls.setBoostEnabled(false)));
// Back 键:重置场地坐标系角度。 // Back 键:重置场地坐标系角度。
controllerlower.back().onTrue(drivetrain.runOnce(drivetrain::seedFieldCentric)); controller.back().onTrue(drivetrain.runOnce(drivetrain::seedFieldCentric));
// Start 键:强行使用 shooter 侧 Limelight 的 MegaTag2 全场定位。
controllerlower.start().whileTrue(drivetrain.run(drivetrain::forceUsingLimelightmt2));
controllerlower.a().whileTrue(drivetrain.run(() -> {
drivetrain.forceUsingLimelightmt2WithllName(Constants.Limelight.LIMELIGHT_NAME_Shooter);
System.out.println("Try using shooter for metatag2");
}));
controllerlower.b().whileTrue(drivetrain.run(() -> {
drivetrain.forceUsingLimelightmt2WithllName(Constants.Limelight.LIMELIGHT_NAME_Intaker);
System.out.println("Try using intaker for metatag2");
}));
// 预留的左摇杆自动瞄准切换,当前保持注释,避免改变驾驶员已习惯的按键。 // 预留的左摇杆自动瞄准切换,当前保持注释,避免改变驾驶员已习惯的按键。
// controllerlower.leftStick().onTrue(operatorControls.requestAimHubCommand()); // controller.leftStick().onTrue(operatorControls.requestAimHubCommand());
// controllerlower.leftStick().onFalse(operatorControls.requestIdleCommand()); // controller.leftStick().onFalse(operatorControls.requestIdleCommand());
// 上操作员右保险:按住进入自动瞄准模式,松开回到全手动模式。
Trigger autoAim = controllerupper.rightBumper(); // 可按需要再并入驾驶员左摇杆。
autoAim.onTrue(operatorControls.requestAimHubCommand());
autoAim.onFalse(operatorControls.requestIdleCommand());
// 上操作员左保险:按住进入传球模式,松开回到全手动模式。
Trigger autoAim2 = controllerupper.leftBumper(); // 可按需要再并入驾驶员左摇杆。
autoAim2.onTrue(operatorControls.requestPassBallCommand());
autoAim2.onFalse(operatorControls.requestIdleCommand());
} }
@@ -175,18 +134,20 @@ public class RobotContainer {
// 这些命令 require Superstructure,与自动程序共用需求; // 这些命令 require Superstructure,与自动程序共用需求;
// 用 teleop 门控避免自动赛阶段误触直接取消整个 PathPlanner 自动。 // 用 teleop 门控避免自动赛阶段误触直接取消整个 PathPlanner 自动。
Trigger teleopOnly = RobotModeTriggers.teleop(); Trigger teleopOnly = RobotModeTriggers.teleop();
controllerupper.rightTrigger().and(teleopOnly) controller.rightTrigger().and(teleopOnly)
.onTrue(operatorControls.requestShootHubCommand()) .onTrue(operatorControls.requestShootHubCommand())
.onFalse(operatorControls.requestIdleCommand()); .onFalse(operatorControls.requestIdleCommand());
controllerupper.b().and(teleopOnly) controller.rightBumper().and(teleopOnly)
.onTrue(Commands.runOnce(() -> driveControls.setBoostEnabled(true)))
.onFalse(Commands.runOnce(() -> driveControls.setBoostEnabled(false)));
controller.b().and(teleopOnly)
.onTrue(operatorControls.requestEjectCommand()) .onTrue(operatorControls.requestEjectCommand())
.onFalse(operatorControls.requestIdleCommand()); .onFalse(operatorControls.requestIdleCommand());
controllerupper.povLeft().onTrue(Commands.runOnce(() -> operatorControls.adjustFlywheelVoltageOffset(-0.1))); controller.povLeft().onTrue(Commands.runOnce(() -> operatorControls.adjustFlywheelVelocityOffset(-1.0)));
controllerupper.povRight().onTrue(Commands.runOnce(() -> operatorControls.adjustFlywheelVoltageOffset(0.1))); controller.povRight().onTrue(Commands.runOnce(() -> operatorControls.adjustFlywheelVelocityOffset(1.0)));
controllerupper.povUp().onTrue(Commands.runOnce(() -> operatorControls.adjustBackboardRateOffset(100))); controller.povUp().onTrue(Commands.runOnce(() -> operatorControls.adjustBackboardRateOffset(100)));
controllerupper.povDown().onTrue(Commands.runOnce(() -> operatorControls.adjustBackboardRateOffset(-100))); controller.povDown().onTrue(Commands.runOnce(() -> operatorControls.adjustBackboardRateOffset(-100)));
controllerupper.back().onTrue(Commands.runOnce(() -> operatorControls.resetOffsets())); controller.start().onTrue(operatorControls.resetBackboardCommand());
controllerupper.start().onTrue(operatorControls.resetBackboardCommand());
} }
private void bingdingLED() { private void bingdingLED() {
@@ -198,14 +159,16 @@ public class RobotContainer {
} }
public void tunerPeriodic() { public void tunerPeriodic() {
boolean allowMotorOutputTuning = DriverStation.isTest();
driveGainsTuner.periodic(); driveGainsTuner.periodic();
configFlywheelTuner.periodic(() -> shooterSubsystem.applyLeftConfigurationToRight()); configFlywheelTuner.periodic(() -> shooterSubsystem.applyLeftConfigurationToRight());
configConveyorTuner.periodic(null);
configBackboardTuner.periodic(); configBackboardTuner.periodic();
shooterSubsystem.debugBackboardTargetPeriodic(); shooterSubsystem.debugFlywheelVelocityPeriodic(allowMotorOutputTuning);
configMainConveyorTuner.periodic(null); shooterSubsystem.debugShooterConveyorVelocityPeriodic(allowMotorOutputTuning);
configIntakerRollerTuner.periodic(null); conveyorSubsystem.debugMainConveyorVoltagePeriodic(allowMotorOutputTuning);
configIntakerRotaterTuner.periodic(null); shooterSubsystem.debugBackboardTargetPeriodic(allowMotorOutputTuning);
shooterSubsystem.setRightFlywheelFollowLeft();
shooterSubsystem.setRightConveyorFollowLeft(); shooterSubsystem.setRightConveyorFollowLeft();
} }
@@ -216,27 +179,24 @@ public class RobotContainer {
private void configueIntaker() { private void configueIntaker() {
// 进球相关按钮也只请求 Superstructure 状态;intaker 开赛后默认保持下放。 // 进球相关按钮也只请求 Superstructure 状态;intaker 开赛后默认保持下放。
Trigger teleopOnly = RobotModeTriggers.teleop(); Trigger teleopOnly = RobotModeTriggers.teleop();
controllerupper.leftTrigger().and(teleopOnly) controller.leftTrigger().and(teleopOnly)
.onTrue(operatorControls.requestPassBallCommand())
.onFalse(operatorControls.requestIdleCommand());
controller.leftBumper().and(teleopOnly)
.onTrue(operatorControls.requestIntakeCommand()) .onTrue(operatorControls.requestIntakeCommand())
.onFalse(operatorControls.requestIdleCommand()); .onFalse(operatorControls.requestIdleCommand());
Trigger manualRaiseIntaker = controllerupper.x().and(teleopOnly); Trigger manualRaiseIntaker = controller.y().and(teleopOnly);
manualRaiseIntaker manualRaiseIntaker
.onTrue(operatorControls.requestManualCommand()) .onTrue(operatorControls.requestManualCommand())
.whileTrue(operatorControls.manualRaiseIntakeRotaterCommand(intakeRotaterSubsystem)) .whileTrue(operatorControls.manualRaiseIntakeRotaterCommand(intakeRotaterSubsystem))
.onFalse(operatorControls.requestIdleCommand()); .onFalse(operatorControls.requestIdleCommand());
Trigger manualLowerIntaker = controllerupper.a().and(teleopOnly); Trigger manualLowerIntaker = controller.a().and(teleopOnly);
manualLowerIntaker manualLowerIntaker
.onTrue(operatorControls.requestManualCommand()) .onTrue(operatorControls.requestManualCommand())
.whileTrue(operatorControls.manualLowerIntakeRotaterCommand(intakeRotaterSubsystem)) .whileTrue(operatorControls.manualLowerIntakeRotaterCommand(intakeRotaterSubsystem))
.onFalse(operatorControls.requestIdleCommand()); .onFalse(operatorControls.requestIdleCommand());
controllerupper.y().and(teleopOnly)
.onTrue(Commands.sequence(
operatorControls.requestManualCommand(),
operatorControls.lowerIntakeRotaterForMatchCommand(intakeRotaterSubsystem),
operatorControls.requestIdleCommand()
));
} }
} }
@@ -24,41 +24,35 @@ public class Autocommand extends SequentialCommandGroup {
) { ) {
NamedCommands.registerCommand("start_intake", startIntake(superstructure)); NamedCommands.registerCommand("start_intake", startIntake(superstructure));
NamedCommands.registerCommand("start_intake_and_conveyor", startIntake(superstructure)); NamedCommands.registerCommand("start_intake_and_conveyor", startIntake(superstructure));
NamedCommands.registerCommand("stop_intake_and_conveyor", idle(superstructure));
NamedCommands.registerCommand("start_intake_timelimit", timedIntake(superstructure));
NamedCommands.registerCommand("stop_intake", idle(superstructure)); NamedCommands.registerCommand("stop_intake", idle(superstructure));
NamedCommands.registerCommand("intaker_down", lowerIntaker(intakeRotater)); NamedCommands.registerCommand("stop_intake_", idle(superstructure));
NamedCommands.registerCommand("stop_intake_and_conveyor", idle(superstructure));
NamedCommands.registerCommand("init", init(superstructure));
NamedCommands.registerCommand("intaker_down", init(superstructure));
NamedCommands.registerCommand("intaker_up", raiseIntaker(intakeRotater)); NamedCommands.registerCommand("intaker_up", raiseIntaker(intakeRotater));
NamedCommands.registerCommand("shoot_hub", shootHub(superstructure)); NamedCommands.registerCommand("shoot_hub", shootHub(superstructure));
NamedCommands.registerCommand("Shake", shake(driveControls));
NamedCommands.registerCommand("AutoAim", autoAim(driveControls));
NamedCommands.registerCommand("reset_backboard0", operatorControls.resetBackboard0Command()); NamedCommands.registerCommand("reset_backboard0", operatorControls.resetBackboard0Command());
NamedCommands.registerCommand("AutoAimForShoot", autoAimForShoot(driveControls));
NamedCommands.registerCommand("AutoAim", autoAimForShoot(driveControls));
NamedCommands.registerCommand("Shake", driveControls.shakeCommand());
} }
public static Command startIntake(Superstructure superstructure) { public static Command startIntake(Superstructure superstructure) {
return superstructure.requestIntakeCommand(); return superstructure.requestIntakeCommand();
} }
public static Command timedIntake(Superstructure superstructure) {
return Commands.sequence(
superstructure.requestIntakeCommand(),
Commands.waitSeconds(1.5),
superstructure.requestIdleCommand()
);
}
public static Command idle(Superstructure superstructure) { public static Command idle(Superstructure superstructure) {
return superstructure.requestIdleCommand(); return superstructure.requestIdleCommand();
} }
public static Command lowerIntaker(IntakeRotaterSubsystem intakeRotater) { public static Command init(Superstructure superstructure) {
return intakeRotater.lowerForMatchCommand(); return superstructure.requestInitCommand();
} }
public static Command raiseIntaker(IntakeRotaterSubsystem intakeRotater) { public static Command raiseIntaker(IntakeRotaterSubsystem intakeRotater) {
return intakeRotater.raiseForMatchCommand(); return intakeRotater.raiseForMatchCommand();
} }
// 自动射击和手动射击使用同一套 gated shooting 流程。
public static Command shootHub(Superstructure superstructure) { public static Command shootHub(Superstructure superstructure) {
return Commands.sequence( return Commands.sequence(
superstructure.requestShootHubCommand(), superstructure.requestShootHubCommand(),
@@ -66,12 +60,8 @@ public class Autocommand extends SequentialCommandGroup {
superstructure.requestIdleCommand() superstructure.requestIdleCommand()
); );
} }
public static Command autoAimForShoot(DriveControls driveControls) {
public static Command autoAim(DriveControls driveControls) { return driveControls.autoAimForShootCommand();
return driveControls.autoAimCommand();
} }
public static Command shake(DriveControls driveControls) {
return driveControls.shakeCommand();
}
} }
@@ -37,18 +37,18 @@ public class DriveControls {
private final double maxAngularRate = RotationsPerSecond.of(0.75).in(edu.wpi.first.units.Units.RadiansPerSecond); private final double maxAngularRate = RotationsPerSecond.of(0.75).in(edu.wpi.first.units.Units.RadiansPerSecond);
// 默认速度比例,普通驾驶使用。 // 默认速度比例,普通驾驶使用。
private double normalDriveScale = 0.3; private double normalDriveScale = 0.6;
private double normalTurnScale = 0.7; private double normalTurnScale = 0.8;
// 加速模式比例,按住 RB 时使用。 // 加速模式比例,按住 RB 时使用。
private double boostDriveScale = 1.0; private double boostDriveScale = 1.0;
private double boostTurnScale = 1.0; private double boostTurnScale = 1.0;
// 自动瞄准时降低平移速度。 // 自动瞄准时降低平移速度。
private double slowDriveScale =0.1; private double slowDriveScale = 0.3;
private boolean boostEnabled = false; private boolean boostEnabled = false;
private final SlewRateLimiter vxLimiter = new SlewRateLimiter(5.0); // m/s^2 等效加速度限制 private final SlewRateLimiter vxLimiter = new SlewRateLimiter(3.5); // m/s^2 等效加速度限制
private final SlewRateLimiter vyLimiter = new SlewRateLimiter(5.0); private final SlewRateLimiter vyLimiter = new SlewRateLimiter(5.0);
private final SlewRateLimiter omegaLimiter = new SlewRateLimiter(9.0); // rad/s^2 等效角加速度限制 private final SlewRateLimiter omegaLimiter = new SlewRateLimiter(9.0); // rad/s^2 等效角加速度限制
@@ -244,7 +244,11 @@ public class DriveControls {
// If angle difference is within threshold, don't rotate // If angle difference is within threshold, don't rotate
if (Math.abs(calDifference) > 1.0) { if (Math.abs(calDifference) > 1.0) {
return calDifference * Constants.AutoPositioning.autoRotationkP; double rotationRate = calDifference * Constants.AutoPositioning.autoRotationkP;
if (Math.abs(rotationRate) < 0.24) {
return Math.copySign(0.24, rotationRate);
}
return rotationRate;
} else { } else {
return 0; return 0;
} }
@@ -334,21 +338,37 @@ public class DriveControls {
public Command getAllianceColorCommand() { public Command getAllianceColorCommand() {
return Commands.runOnce(this::setTeamColors); return Commands.runOnce(this::setTeamColors);
} }
public Command autoAimCommand() {
// DriveControls.java
public Command autoAimForShootCommand() {
return drivetrain.applyRequest(() -> { return drivetrain.applyRequest(() -> {
double[] distanceAndRotation = calculateDistanceAndRotationToHub(); double[] hubAim = calculateDistanceAndRotationToHub();
double vomega = calculateRotationSpeedFromRotationAngle(distanceAndRotation[1]); double distanceToHub = hubAim[0];
return fieldCentric double angleDifferenceToHub = hubAim[1];
.withVelocityX(0.0)
.withVelocityY(0.0) autoControlNetworkTable.getEntry("distanceToHub").setDouble(distanceToHub);
.withRotationalRate(vomega); autoControlNetworkTable.getEntry("angleDifferenceToHub").setDouble(angleDifferenceToHub);
drivetrain.setTargetHeading(
drivetrain.getRotation().plus(Rotation2d.fromDegrees(angleDifferenceToHub))
);
double vomega = calculateRotationSpeedFromRotationAngle(angleDifferenceToHub);
autoControlNetworkTable.getEntry("autoRotationRate").setDouble(vomega);
autoControlNetworkTable.getEntry("ActualVX").setDouble(0.0);
autoControlNetworkTable.getEntry("ActualVY").setDouble(0.0);
autoControlNetworkTable.getEntry("ActualVOmega").setDouble(vomega);
return fieldCentric
.withVelocityX(0.0)
.withVelocityY(0.0)
.withRotationalRate(vomega);
}, () -> DriveMode.FIELD_CENTRIC) }, () -> DriveMode.FIELD_CENTRIC)
.until(() -> Math.abs(calculateDistanceAndRotationToHub()[1]) < 1.5) .withTimeout(Constants.Superstructure.shootTimeoutSeconds)
.withTimeout(1.0) .andThen(new InstantCommand(() -> drivetrain.stop(), drivetrain));
.andThen(new InstantCommand(() -> {
drivetrain.stop();
}, drivetrain));
} }
public Command shakeCommand(double amplitude, double switchPeriod, double totalTime) { public Command shakeCommand(double amplitude, double switchPeriod, double totalTime) {
Timer timer = new Timer(); Timer timer = new Timer();
@@ -3,6 +3,7 @@ package frc.robot.controls;
import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.Commands;
import frc.robot.Constants; import frc.robot.Constants;
import frc.robot.subsystems.IntakeRollerSubsystem;
import frc.robot.subsystems.IntakeRotaterSubsystem; import frc.robot.subsystems.IntakeRotaterSubsystem;
import frc.robot.subsystems.ShooterSubsystem; import frc.robot.subsystems.ShooterSubsystem;
import frc.robot.subsystems.Superstructure; import frc.robot.subsystems.Superstructure;
@@ -54,6 +55,10 @@ public class OperatorControls {
superstructure.adjustFlywheelVoltageOffset(offset); superstructure.adjustFlywheelVoltageOffset(offset);
} }
public void adjustFlywheelVelocityOffset(double offset) {
superstructure.adjustFlywheelVelocityOffset(offset);
}
public void adjustBackboardRateOffset(double offset) { public void adjustBackboardRateOffset(double offset) {
superstructure.adjustBackboardPositionOffset(offset); superstructure.adjustBackboardPositionOffset(offset);
} }
@@ -70,6 +75,24 @@ public class OperatorControls {
return Commands.runEnd(intakeRotater::manualRaise, intakeRotater::stop, intakeRotater); return Commands.runEnd(intakeRotater::manualRaise, intakeRotater::stop, intakeRotater);
} }
public Command manualRaiseIntakeWithRollerCommand(
IntakeRotaterSubsystem intakeRotater,
IntakeRollerSubsystem intakeRoller
) {
return Commands.runEnd(
() -> {
intakeRotater.manualRaise();
intakeRoller.intake();
},
() -> {
intakeRotater.stop();
intakeRoller.stop();
},
intakeRotater,
intakeRoller
);
}
public Command manualLowerIntakeRotaterCommand(IntakeRotaterSubsystem intakeRotater) { public Command manualLowerIntakeRotaterCommand(IntakeRotaterSubsystem intakeRotater) {
return Commands.runEnd(intakeRotater::manualLower, intakeRotater::stop, intakeRotater); return Commands.runEnd(intakeRotater::manualLower, intakeRotater::stop, intakeRotater);
} }
@@ -46,8 +46,8 @@ public class TunerConstants {
private static final SteerMotorArrangement kSteerMotorType = SteerMotorArrangement.TalonFX_Integrated; private static final SteerMotorArrangement kSteerMotorType = SteerMotorArrangement.TalonFX_Integrated;
// The remote sensor feedback type to use for the steer motors; // The remote sensor feedback type to use for the steer motors;
// When not Pro-licensed, Fused*/Sync* automatically fall back to Remote* // Use RemoteCANcoder so the steer TalonFXs do not require Phoenix Pro licenses.
private static final SteerFeedbackType kSteerFeedbackType = SteerFeedbackType.FusedCANcoder; private static final SteerFeedbackType kSteerFeedbackType = SteerFeedbackType.RemoteCANcoder;
// The stator current at which the wheels start to slip; // The stator current at which the wheels start to slip;
// This needs to be tuned to your individual robot // This needs to be tuned to your individual robot
@@ -77,7 +77,7 @@ public class TunerConstants {
new Pigeon2Configuration() new Pigeon2Configuration()
.withGyroTrim( .withGyroTrim(
new GyroTrimConfigs() new GyroTrimConfigs()
.withGyroScalarZ(-5.0) .withGyroScalarZ(-6.7)
) )
.withPigeon2Features( .withPigeon2Features(
new Pigeon2FeaturesConfigs() new Pigeon2FeaturesConfigs()
@@ -1,10 +1,14 @@
package frc.robot.subsystems; package frc.robot.subsystems;
import com.ctre.phoenix6.configs.MotorOutputConfigs;
import com.ctre.phoenix6.controls.NeutralOut;
import com.ctre.phoenix6.controls.VoltageOut; import com.ctre.phoenix6.controls.VoltageOut;
import com.ctre.phoenix6.hardware.TalonFX; import com.ctre.phoenix6.hardware.TalonFX;
import com.ctre.phoenix6.signals.NeutralModeValue;
import edu.wpi.first.networktables.NetworkTable; import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableInstance; import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
import edu.wpi.first.math.MathUtil; import edu.wpi.first.math.MathUtil;
import frc.robot.Constants; import frc.robot.Constants;
@@ -15,30 +19,72 @@ import frc.robot.Constants;
public class ConveyorSubsystem extends SubsystemBase { public class ConveyorSubsystem extends SubsystemBase {
public final TalonFX mainConveyor; public final TalonFX mainConveyor;
private final VoltageOut voltageRequest = new VoltageOut(0); private final VoltageOut voltageRequest = new VoltageOut(0);
private final NeutralOut neutralRequest = new NeutralOut();
private final NetworkTable table = NetworkTableInstance.getDefault().getTable("Conveyor"); private final NetworkTable table = NetworkTableInstance.getDefault().getTable("Conveyor");
private final NetworkTable tuningTable = NetworkTableInstance.getDefault().getTable("Tuning/mainConveyor");
private double targetOutputVolts = 0.0; private double targetOutputVolts = 0.0;
private double commandedDebugVolts = Constants.Conveyor.feedVoltage;
private double clampedDebugVolts = Constants.Conveyor.feedVoltage;
private boolean voltageTuningActive = false;
public ConveyorSubsystem() { public ConveyorSubsystem() {
mainConveyor = new TalonFX(Constants.Conveyor.mainConveyorID); mainConveyor = new TalonFX(Constants.Conveyor.mainConveyorID);
mainConveyor.getConfigurator().apply(Constants.Conveyor.mainConveyorSlot0Configs); mainConveyor.getConfigurator().apply(Constants.Conveyor.mainConveyorSlot0Configs);
var mainConveyorMotorOutputConfigs = new MotorOutputConfigs();
mainConveyorMotorOutputConfigs.NeutralMode = NeutralModeValue.Coast;
mainConveyor.getConfigurator().apply(mainConveyorMotorOutputConfigs);
tuningTable.getEntry("mainConveyorVoltageEnable").setDefaultBoolean(false);
tuningTable.getEntry("mainConveyorTargetVolts").setDefaultDouble(Constants.Conveyor.feedVoltage);
} }
public void feedToShooter() { public void feedToShooter() {
setVoltage(Constants.Conveyor.feedVoltage); setVoltage(Constants.Conveyor.feedVoltage);
} }
public void feedForIntake() {
setVoltage(Constants.Conveyor.intakeFeedVoltage);
}
public void reverse() { public void reverse() {
setVoltage(Constants.Conveyor.reverseVoltage); setVoltage(Constants.Conveyor.reverseVoltage);
} }
public void stop() { public void stop() {
setVoltage(0.0); targetOutputVolts = 0.0;
mainConveyor.setControl(neutralRequest);
} }
public void setVoltage(double outputVolts) { public void setVoltage(double outputVolts) {
targetOutputVolts = MathUtil.clamp(outputVolts, -12.0, 12.0); targetOutputVolts = MathUtil.clamp(outputVolts, -12.0, 12.0);
mainConveyor.setControl(voltageRequest.withOutput(targetOutputVolts)); mainConveyor.setControl(voltageRequest.withOutput(targetOutputVolts));
} }
public boolean isMainConveyorTuningControlActive() {
return DriverStation.isTestEnabled()
&& tuningTable.getEntry("mainConveyorVoltageEnable").getBoolean(false);
}
public void debugMainConveyorVoltagePeriodic(boolean allowMotorOutput) {
voltageTuningActive =
allowMotorOutput
&& DriverStation.isTestEnabled()
&& tuningTable.getEntry("mainConveyorVoltageEnable").getBoolean(false);
commandedDebugVolts = tuningTable.getEntry("mainConveyorTargetVolts")
.getDouble(Constants.Conveyor.feedVoltage);
clampedDebugVolts = MathUtil.clamp(commandedDebugVolts, -12.0, 12.0);
tuningTable.getEntry("mainConveyorVoltageEnableActive").setBoolean(voltageTuningActive);
tuningTable.getEntry("mainConveyorCommandedTargetVolts").setDouble(commandedDebugVolts);
tuningTable.getEntry("mainConveyorClampedTargetVolts").setDouble(clampedDebugVolts);
if (voltageTuningActive) {
setVoltage(clampedDebugVolts);
}
}
@Override @Override
public void periodic() { public void periodic() {
table.getEntry("velocity").setDouble(mainConveyor.getVelocity().getValueAsDouble()); table.getEntry("velocity").setDouble(mainConveyor.getVelocity().getValueAsDouble());
table.getEntry("targetOutputVolts").setDouble(targetOutputVolts); table.getEntry("targetOutputVolts").setDouble(targetOutputVolts);
table.getEntry("motorOutputVolts").setDouble(mainConveyor.getMotorVoltage().getValueAsDouble());
table.getEntry("statorCurrent").setDouble(mainConveyor.getStatorCurrent().getValueAsDouble());
table.getEntry("voltageTuningActive").setBoolean(voltageTuningActive);
table.getEntry("commandedDebugVolts").setDouble(commandedDebugVolts);
table.getEntry("clampedDebugVolts").setDouble(clampedDebugVolts);
} }
} }
@@ -1,6 +1,7 @@
package frc.robot.subsystems; package frc.robot.subsystems;
import com.ctre.phoenix6.controls.Follower; import com.ctre.phoenix6.controls.Follower;
import com.ctre.phoenix6.controls.NeutralOut;
import com.ctre.phoenix6.controls.VoltageOut; import com.ctre.phoenix6.controls.VoltageOut;
import com.ctre.phoenix6.hardware.TalonFX; import com.ctre.phoenix6.hardware.TalonFX;
import com.ctre.phoenix6.signals.MotorAlignmentValue; import com.ctre.phoenix6.signals.MotorAlignmentValue;
@@ -22,6 +23,7 @@ public class IntakeRollerSubsystem extends SubsystemBase {
private final TalonFX rightIntakeRoller; private final TalonFX rightIntakeRoller;
private final VoltageOut voltageRequest = new VoltageOut(0); private final VoltageOut voltageRequest = new VoltageOut(0);
private final NeutralOut neutralRequest = new NeutralOut();
private final Follower rightFollower; private final Follower rightFollower;
private final NetworkTable table = NetworkTableInstance.getDefault().getTable("IntakeRoller"); private final NetworkTable table = NetworkTableInstance.getDefault().getTable("IntakeRoller");
private double targetOutputVolts = 0.0; private double targetOutputVolts = 0.0;
@@ -39,12 +41,18 @@ public class IntakeRollerSubsystem extends SubsystemBase {
setVoltage(Constants.Intaker.intakeRollerIntakeVoltage); setVoltage(Constants.Intaker.intakeRollerIntakeVoltage);
} }
public void intakeforshoot() {
setVoltage(-1.0);
}
public void outtake() { public void outtake() {
setVoltage(Constants.Intaker.intakeRollerOuttakeVoltage); setVoltage(Constants.Intaker.intakeRollerOuttakeVoltage);
} }
public void stop() { public void stop() {
setVoltage(0.0); targetOutputVolts = 0.0;
leftIntakeRoller.setControl(neutralRequest);
rightIntakeRoller.setControl(neutralRequest);
} }
public void setVoltage(double outputVolts) { public void setVoltage(double outputVolts) {
@@ -69,12 +69,20 @@ public class IntakeRotaterSubsystem extends SubsystemBase {
} }
public void shootAssist() { public void shootAssist() {
double period = Constants.Intaker.intakeRotaterShootAssistPeriodSeconds; double cycleTime = Timer.getFPGATimestamp() % 1.6;
double phase = (Timer.getFPGATimestamp() % period) / period;
double volts = phase < Constants.Intaker.intakeRotaterShootAssistUpDutyCycle if (cycleTime < 0.6) {
? Constants.Intaker.intakeRotaterRaiseVoltage setVoltage(1);
: Constants.Intaker.intakeRotaterLowerVoltage; } else if (cycleTime < 0.9) {
setVoltage(volts); setVoltage(0.0);
} else {
setVoltage(0.03);
}
}
public void postShootIdleAssist(double elapsedSeconds) {
double cycleTime = elapsedSeconds % 0.2;
setVoltage(cycleTime < 0.1 ? 0.0 : 0.0);
} }
public void manualRaise() { public void manualRaise() {
@@ -6,10 +6,10 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants; import frc.robot.Constants;
/** /**
* 对现有 LimelightHelpers 的薄只读封装。 * Thin read-only wrapper around the existing LimelightHelpers.
* *
* 本类不做视觉融合,也不控制任何机构;只给 Superstructure 提供稳定的 * This subsystem does not fuse vision or command mechanisms; it only gives
* 目标和距离读取接口。 * Superstructure stable target and distance read APIs.
*/ */
public class LimelightSubsystem extends SubsystemBase { public class LimelightSubsystem extends SubsystemBase {
private final String limelightName; private final String limelightName;
@@ -35,8 +35,8 @@ public class LimelightSubsystem extends SubsystemBase {
} }
public double getDistanceToTarget() { public double getDistanceToTarget() {
// DriveControls 已经把基于场地位姿计算的距离发布到 AutoControl; // DriveControls publishes the field-pose distance under AutoControl.
// 这里复用该值,保留旧定位和目标计算逻辑。 // Reuse that value to preserve the existing target calculation path.
return NetworkTableInstance.getDefault() return NetworkTableInstance.getDefault()
.getTable("AutoControl") .getTable("AutoControl")
.getEntry("distanceToHub") .getEntry("distanceToHub")
@@ -46,9 +46,4 @@ public class LimelightSubsystem extends SubsystemBase {
public Pose2d getEstimatedPose() { public Pose2d getEstimatedPose() {
return LimelightHelpers.getBotPoseEstimate_wpiBlue_MegaTag2(limelightName).pose; return LimelightHelpers.getBotPoseEstimate_wpiBlue_MegaTag2(limelightName).pose;
} }
public double getShooterVoltageByDistance() {
// 查 Constants 里的插值射表;真车试射后往表里加实测点即可。
return Constants.Shooter.flywheelVoltageByDistance.get(getDistanceToTarget());
}
} }
@@ -3,19 +3,22 @@ package frc.robot.subsystems;
import com.ctre.phoenix6.configs.MotorOutputConfigs; import com.ctre.phoenix6.configs.MotorOutputConfigs;
import com.ctre.phoenix6.configs.Slot0Configs; import com.ctre.phoenix6.configs.Slot0Configs;
import com.ctre.phoenix6.controls.Follower; import com.ctre.phoenix6.controls.Follower;
import com.ctre.phoenix6.controls.NeutralOut;
import com.ctre.phoenix6.controls.VelocityVoltage;
import com.ctre.phoenix6.controls.VoltageOut; import com.ctre.phoenix6.controls.VoltageOut;
import com.ctre.phoenix6.hardware.TalonFX; import com.ctre.phoenix6.hardware.TalonFX;
import com.ctre.phoenix6.hardware.TalonFXS; import com.ctre.phoenix6.hardware.TalonFXS;
import com.ctre.phoenix6.signals.InvertedValue; import com.ctre.phoenix6.signals.InvertedValue;
import com.ctre.phoenix6.signals.MotorAlignmentValue; import com.ctre.phoenix6.signals.MotorAlignmentValue;
import com.ctre.phoenix6.signals.NeutralModeValue;
import edu.wpi.first.math.MathUtil; import edu.wpi.first.math.MathUtil;
import edu.wpi.first.math.controller.ProfiledPIDController; import edu.wpi.first.math.controller.ProfiledPIDController;
import edu.wpi.first.math.trajectory.TrapezoidProfile.Constraints; import edu.wpi.first.math.trajectory.TrapezoidProfile.Constraints;
import edu.wpi.first.networktables.NetworkTable; import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableInstance; import edu.wpi.first.networktables.NetworkTableInstance;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.Encoder; import edu.wpi.first.wpilibj.Encoder;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.SubsystemBase; import edu.wpi.first.wpilibj2.command.SubsystemBase;
@@ -39,21 +42,32 @@ public class ShooterSubsystem extends SubsystemBase {
public final Encoder backboardEncoder; public final Encoder backboardEncoder;
public final ProfiledPIDController backboardPID; public final ProfiledPIDController backboardPID;
private final VoltageOut leftFlywheelVoltageRequest = new VoltageOut(0); private final VelocityVoltage leftFlywheelVelocityRequest = new VelocityVoltage(0).withSlot(0);
private final VoltageOut rightFlywheelVoltageRequest = new VoltageOut(0); private final VelocityVoltage conveyorVelocityRequest = new VelocityVoltage(0).withSlot(0);
private final VoltageOut conveyorVoltageRequest = new VoltageOut(0);
private final VoltageOut backboardVoltageRequest = new VoltageOut(0); private final VoltageOut backboardVoltageRequest = new VoltageOut(0);
private final NeutralOut flywheelNeutralRequest = new NeutralOut();
private final NeutralOut conveyorNeutralRequest = new NeutralOut();
private final Follower flywheelFollower;
private final Follower conveyorFollower; private final Follower conveyorFollower;
private final NetworkTable shooterNetworkTable; private final NetworkTable shooterNetworkTable;
private final NetworkTable flywheelTuningTable;
private final NetworkTable backboardTuningTable; private final NetworkTable backboardTuningTable;
private final NetworkTable shooterConveyorTuningTable;
private double flywheelOutputVolts = 0.0; private double flywheelOutputVolts = 0.0;
private double flywheelVoltageStartTimestamp = 0.0; private double flywheelTargetVelocity = 0.0;
private double flywheelVelocityTolerance = Constants.Shooter.flywheelReadyVelocityTolerance;
private boolean flywheelVelocityTuningActive = false;
private double shooterConveyorTargetVelocity = 0.0;
private double shooterConveyorCommandedTargetVelocity = Constants.Shooter.shooterConveyorFeedVelocity;
private double shooterConveyorClampedTargetVelocity = Constants.Shooter.shooterConveyorFeedVelocity;
private boolean shooterConveyorVelocityTuningActive = false;
private double shooterConveyorOutputVolts = 0.0; private double shooterConveyorOutputVolts = 0.0;
private double backboardOutputVolts = 0.0; private double backboardOutputVolts = 0.0;
private double backboardRawPidOutputVolts = 0.0; private double backboardRawPidOutputVolts = 0.0;
private double backboardGravityFeedforwardVolts = 0.0;
private double backboardClampedPidOutputVolts = 0.0; private double backboardClampedPidOutputVolts = 0.0;
private boolean backboardOutputSaturated = false; private boolean backboardOutputSaturated = false;
private boolean backboardMinimumOutputActive = false; private boolean backboardMinimumOutputActive = false;
@@ -69,16 +83,27 @@ public class ShooterSubsystem extends SubsystemBase {
leftConveyor.getConfigurator().apply(Constants.Shooter.conveyorSlot0Configs); leftConveyor.getConfigurator().apply(Constants.Shooter.conveyorSlot0Configs);
rightConveyor.getConfigurator().apply(Constants.Shooter.conveyorSlot0Configs); rightConveyor.getConfigurator().apply(Constants.Shooter.conveyorSlot0Configs);
var motorOutputConfigs = new MotorOutputConfigs(); var leftFlywheelMotorOutputConfigs = new MotorOutputConfigs();
motorOutputConfigs.Inverted = InvertedValue.Clockwise_Positive; leftFlywheelMotorOutputConfigs.Inverted = InvertedValue.Clockwise_Positive;
leftFlywheel.getConfigurator().apply(motorOutputConfigs); leftFlywheelMotorOutputConfigs.NeutralMode = NeutralModeValue.Coast;
leftConveyor.getConfigurator().apply(motorOutputConfigs); leftFlywheel.getConfigurator().apply(leftFlywheelMotorOutputConfigs);
var rightFlywheelMotorOutputConfigs = new MotorOutputConfigs();
rightFlywheelMotorOutputConfigs.NeutralMode = NeutralModeValue.Coast;
rightFlywheel.getConfigurator().apply(rightFlywheelMotorOutputConfigs);
var conveyorMotorOutputConfigs = new MotorOutputConfigs();
conveyorMotorOutputConfigs.Inverted = InvertedValue.Clockwise_Positive;
leftConveyor.getConfigurator().apply(conveyorMotorOutputConfigs);
flywheelFollower = new Follower(leftFlywheel.getDeviceID(), MotorAlignmentValue.Opposed).withUpdateFreqHz(50);
conveyorFollower = new Follower(leftConveyor.getDeviceID(), MotorAlignmentValue.Opposed).withUpdateFreqHz(50); conveyorFollower = new Follower(leftConveyor.getDeviceID(), MotorAlignmentValue.Opposed).withUpdateFreqHz(50);
setRightFlywheelFollowLeft();
setRightConveyorFollowLeft(); setRightConveyorFollowLeft();
backboardMotor = new TalonFXS(Constants.Shooter.backboardMotorID); backboardMotor = new TalonFXS(Constants.Shooter.backboardMotorID);
backboardMotor.getConfigurator().apply(Constants.Shooter.backboardSlot0Configs); backboardMotor.getConfigurator().apply(Constants.Shooter.backboardSlot0Configs);
setBackboardBrakeMode();
backboardEncoder = new Encoder(0, 1, false, Encoder.EncodingType.k4X); backboardEncoder = new Encoder(0, 1, false, Encoder.EncodingType.k4X);
backboardEncoder.setSamplesToAverage(5); backboardEncoder.setSamplesToAverage(5);
@@ -94,9 +119,17 @@ public class ShooterSubsystem extends SubsystemBase {
backboardPID.setTolerance(10.0); backboardPID.setTolerance(10.0);
shooterNetworkTable = NetworkTableInstance.getDefault().getTable("Shooter"); shooterNetworkTable = NetworkTableInstance.getDefault().getTable("Shooter");
flywheelTuningTable = NetworkTableInstance.getDefault().getTable("Tuning/flywheel");
flywheelTuningTable.getEntry("flywheelVelocityEnable").setDefaultBoolean(false);
flywheelTuningTable.getEntry("flywheelTargetVelocity").setDefaultDouble(Constants.Shooter.defaultFlywheelVelocity);
flywheelTuningTable.getEntry("flywheelVelocityTolerance").setDefaultDouble(Constants.Shooter.flywheelReadyVelocityTolerance);
backboardTuningTable = NetworkTableInstance.getDefault().getTable("Tuning/backboard"); backboardTuningTable = NetworkTableInstance.getDefault().getTable("Tuning/backboard");
backboardTuningTable.getEntry("backboardPositionEnable").setDefaultBoolean(false); backboardTuningTable.getEntry("backboardPositionEnable").setDefaultBoolean(false);
backboardTuningTable.getEntry("backboardTargetPosition").setDefaultDouble(0.0); backboardTuningTable.getEntry("backboardTargetPosition").setDefaultDouble(0.0);
shooterConveyorTuningTable = NetworkTableInstance.getDefault().getTable("Tuning/shooterConveyor");
shooterConveyorTuningTable.getEntry("shooterConveyorVelocityEnable").setDefaultBoolean(false);
shooterConveyorTuningTable.getEntry("shooterConveyorTargetVelocity")
.setDefaultDouble(Constants.Shooter.shooterConveyorFeedVelocity);
} }
/* ====================== */ /* ====================== */
@@ -108,38 +141,40 @@ public class ShooterSubsystem extends SubsystemBase {
rightConveyor.setControl(conveyorFollower); rightConveyor.setControl(conveyorFollower);
} }
public void setRightFlywheelFollowLeft() {
rightFlywheel.setControl(flywheelFollower);
}
public void applyLeftConfigurationToRight() { public void applyLeftConfigurationToRight() {
Slot0Configs configs = new Slot0Configs(); Slot0Configs configs = new Slot0Configs();
leftFlywheel.getConfigurator().refresh(configs); leftFlywheel.getConfigurator().refresh(configs);
rightFlywheel.getConfigurator().apply(configs); rightFlywheel.getConfigurator().apply(configs);
} }
public void setFlywheelVoltage(double outputVolts) { public void setFlywheelVelocity(double targetVelocityRps) {
double clampedOutputVolts = MathUtil.clamp(outputVolts, -12.0, 12.0); flywheelTargetVelocity = targetVelocityRps;
if (Math.abs(clampedOutputVolts - flywheelOutputVolts) > 1e-6) { leftFlywheel.setControl(leftFlywheelVelocityRequest.withVelocity(flywheelTargetVelocity));
flywheelVoltageStartTimestamp = Timer.getFPGATimestamp(); setRightFlywheelFollowLeft();
}
flywheelOutputVolts = clampedOutputVolts;
leftFlywheel.setControl(leftFlywheelVoltageRequest.withOutput(flywheelOutputVolts));
rightFlywheel.setControl(rightFlywheelVoltageRequest.withOutput(-flywheelOutputVolts));
}
public void setFlywheelVoltageByDistance(double distance) {
double targetVolts = Constants.Shooter.flywheelVoltageByDistance.get(distance);
setFlywheelVoltage(targetVolts);
} }
public void stopFlywheel() { public void stopFlywheel() {
setFlywheelVoltage(0.0); flywheelTargetVelocity = 0.0;
leftFlywheel.setControl(flywheelNeutralRequest);
rightFlywheel.setControl(flywheelNeutralRequest);
} }
public boolean atVoltage() { public boolean atVelocity() {
if (Math.abs(flywheelOutputVolts) < Constants.Shooter.flywheelReadyVoltageThreshold) { if (flywheelTargetVelocity <= 10.0) {
return false; return false;
} }
return Timer.getFPGATimestamp() - flywheelVoltageStartTimestamp double currentvelocity = getAverageFlywheelVelocity();
>= Constants.Shooter.flywheelReadyDelaySeconds; if(currentvelocity>flywheelTargetVelocity*0.95){
return true;
} else {
return false;
}
} }
public double getLeftFlywheelVelocity() { public double getLeftFlywheelVelocity() {
return leftFlywheel.getVelocity().getValueAsDouble(); return leftFlywheel.getVelocity().getValueAsDouble();
} }
@@ -156,22 +191,40 @@ public class ShooterSubsystem extends SubsystemBase {
return Math.abs(getLeftFlywheelVelocity()) - Math.abs(getRightFlywheelVelocity()); return Math.abs(getLeftFlywheelVelocity()) - Math.abs(getRightFlywheelVelocity());
} }
public double getTargetFlywheelVoltage() { public double getTargetFlywheelVelocity() {
return flywheelOutputVolts; return flywheelTargetVelocity;
}
public double getFlywheelVelocityError() {
return Math.abs(flywheelTargetVelocity) - getAverageFlywheelVelocity();
} }
/* ====================== */ /* ====================== */
/* shooter conveyor */ /* shooter conveyor */
/* ====================== */ /* ====================== */
public void runShooterConveyorVoltage(double outputVolts) { public void runShooterConveyorVelocity(double targetVelocityRps) {
shooterConveyorOutputVolts = MathUtil.clamp(outputVolts, -12.0, 12.0); shooterConveyorTargetVelocity = targetVelocityRps;
leftConveyor.setControl(conveyorVoltageRequest.withOutput(shooterConveyorOutputVolts)); leftConveyor.setControl(conveyorVelocityRequest.withVelocity(shooterConveyorTargetVelocity));
setRightConveyorFollowLeft(); setRightConveyorFollowLeft();
} }
public void stopShooterConveyor() { public void stopShooterConveyor() {
runShooterConveyorVoltage(0.0); shooterConveyorTargetVelocity = 0.0;
leftConveyor.setControl(conveyorNeutralRequest);
rightConveyor.setControl(conveyorNeutralRequest);
}
public double getShooterConveyorVelocity() {
return leftConveyor.getVelocity().getValueAsDouble();
}
public double getShooterConveyorTargetVelocity() {
return shooterConveyorTargetVelocity;
}
public double getShooterConveyorVelocityError() {
return shooterConveyorTargetVelocity - getShooterConveyorVelocity();
} }
public double getConveyorStatorCurrent() { public double getConveyorStatorCurrent() {
@@ -203,7 +256,8 @@ public class ShooterSubsystem extends SubsystemBase {
public void outputBackboard() { public void outputBackboard() {
// 背板仍使用旧外部编码器和 ProfiledPID;Superstructure 只选择目标位置。 // 背板仍使用旧外部编码器和 ProfiledPID;Superstructure 只选择目标位置。
double rawPidOutput = backboardPID.calculate(getBackboardPosition()); double backboardPosition = getBackboardPosition();
double rawPidOutput = backboardPID.calculate(backboardPosition);
double pidOutput = MathUtil.clamp( double pidOutput = MathUtil.clamp(
rawPidOutput, rawPidOutput,
-Constants.Shooter.backboardSpeedMax, -Constants.Shooter.backboardSpeedMax,
@@ -220,32 +274,62 @@ public class ShooterSubsystem extends SubsystemBase {
backboardMinimumOutputActive = false; backboardMinimumOutputActive = false;
} }
shooterNetworkTable.getEntry("backboardPIDOutput").setDouble(pidOutput); double gravityOutput = calculateBackboardGravityFeedforward(backboardPosition);
setBackboardVoltage(pidOutput); double outputVolts = MathUtil.clamp(
pidOutput + gravityOutput,
-Constants.Shooter.backboardSpeedMax,
Constants.Shooter.backboardSpeedMax
);
backboardGravityFeedforwardVolts = gravityOutput;
backboardOutputSaturated = backboardOutputSaturated
|| Math.abs((pidOutput + gravityOutput) - outputVolts) > 1e-9;
shooterNetworkTable.getEntry("backboardPIDOutput").setDouble(outputVolts);
setBackboardVoltage(outputVolts);
}
private double calculateBackboardGravityFeedforward(double backboardPosition) {
double clampedPosition = MathUtil.clamp(
backboardPosition,
Constants.Shooter.backboardGravityFeedforwardMinPosition,
Constants.Shooter.backboardGravityFeedforwardMaxPosition
);
double positionRange = Constants.Shooter.backboardGravityFeedforwardMaxPosition
- Constants.Shooter.backboardGravityFeedforwardMinPosition;
if (positionRange <= 0.0) {
return 0.0;
}
double positionRatio = (clampedPosition - Constants.Shooter.backboardGravityFeedforwardMinPosition)
/ positionRange;
double feedforwardVolts = Constants.Shooter.backboardGravityFeedforwardMinVolts
+ positionRatio
* (Constants.Shooter.backboardGravityFeedforwardMaxVolts
- Constants.Shooter.backboardGravityFeedforwardMinVolts);
return Constants.Shooter.backboardGravityFeedforwardDirection * feedforwardVolts;
} }
public void holdBackboardAt(double targetPosition) { public void holdBackboardAt(double targetPosition) {
// 上层只给目标位置;到位后停止输出,未到位时继续闭环。 // 上层只给目标位置;到位后仍继续输出重力补偿。
setBackboardPosition(targetPosition); setBackboardPosition(targetPosition);
if (isBackboardAtTarget()) { outputBackboard();
backboardRawPidOutputVolts = 0.0;
backboardClampedPidOutputVolts = 0.0;
backboardOutputSaturated = false;
backboardMinimumOutputActive = false;
setBackboardVoltage(0.0);
} else {
outputBackboard();
}
} }
public void stopBackboard() { public void stopBackboard() {
backboardRawPidOutputVolts = 0.0; backboardRawPidOutputVolts = 0.0;
backboardGravityFeedforwardVolts = 0.0;
backboardClampedPidOutputVolts = 0.0; backboardClampedPidOutputVolts = 0.0;
backboardOutputSaturated = false; backboardOutputSaturated = false;
backboardMinimumOutputActive = false; backboardMinimumOutputActive = false;
setBackboardVoltage(0.0); setBackboardVoltage(0.0);
} }
public void setBackboardBrakeMode() {
var backboardMotorOutputConfigs = new MotorOutputConfigs();
backboardMotorOutputConfigs.NeutralMode = NeutralModeValue.Brake;
backboardMotor.getConfigurator().apply(backboardMotorOutputConfigs);
}
public double getBackboardPosition() { public double getBackboardPosition() {
return backboardEncoder.getDistance(); return backboardEncoder.getDistance();
} }
@@ -254,6 +338,33 @@ public class ShooterSubsystem extends SubsystemBase {
return backboardPID.atGoal(); return backboardPID.atGoal();
} }
public double getBackboardGoalPosition() {
return backboardPID.getGoal().position;
}
public double getBackboardPositionError() {
return getBackboardGoalPosition() - getBackboardPosition();
}
public boolean isBackboardNearTarget(double tolerance) {
return Math.abs(getBackboardPositionError()) < tolerance;
}
public boolean isBackboardPositionTuningActive() {
return DriverStation.isTest()
&& backboardTuningTable.getEntry("backboardPositionEnable").getBoolean(false);
}
public boolean isFlywheelTuningControlActive() {
return DriverStation.isTest()
&& flywheelTuningTable.getEntry("flywheelVelocityEnable").getBoolean(false);
}
public boolean isShooterConveyorTuningControlActive() {
return DriverStation.isTestEnabled()
&& shooterConveyorTuningTable.getEntry("shooterConveyorVelocityEnable").getBoolean(false);
}
public void resetbackboardencoder() { public void resetbackboardencoder() {
backboardEncoder.reset(); backboardEncoder.reset();
backboardPID.reset(0); backboardPID.reset(0);
@@ -281,8 +392,9 @@ public class ShooterSubsystem extends SubsystemBase {
stopBackboard(); stopBackboard();
} }
public void debugBackboardTargetPeriodic() { public void debugBackboardTargetPeriodic(boolean allowMotorOutput) {
boolean positionEnable = backboardTuningTable.getEntry("backboardPositionEnable").getBoolean(false); boolean positionEnable =
allowMotorOutput && backboardTuningTable.getEntry("backboardPositionEnable").getBoolean(false);
double requestedTarget = backboardTuningTable.getEntry("backboardTargetPosition").getDouble(0.0); double requestedTarget = backboardTuningTable.getEntry("backboardTargetPosition").getDouble(0.0);
double clampedTarget = MathUtil.clamp( double clampedTarget = MathUtil.clamp(
requestedTarget, requestedTarget,
@@ -299,21 +411,91 @@ public class ShooterSubsystem extends SubsystemBase {
} }
} }
public void debugFlywheelVelocityPeriodic(boolean allowMotorOutput) {
flywheelVelocityTuningActive =
allowMotorOutput && flywheelTuningTable.getEntry("flywheelVelocityEnable").getBoolean(false);
double requestedTargetVelocity =
flywheelTuningTable.getEntry("flywheelTargetVelocity").getDouble(Constants.Shooter.defaultFlywheelVelocity);
flywheelVelocityTolerance = Math.max(
0.0,
flywheelTuningTable.getEntry("flywheelVelocityTolerance")
.getDouble(Constants.Shooter.flywheelReadyVelocityTolerance)
);
double clampedTargetVelocity = MathUtil.clamp(
requestedTargetVelocity,
-Constants.Shooter.flywheelMaxVelocity,
Constants.Shooter.flywheelMaxVelocity
);
flywheelTuningTable.getEntry("flywheelVelocityEnableActive").setBoolean(flywheelVelocityTuningActive);
flywheelTuningTable.getEntry("flywheelCommandedTargetVelocity").setDouble(requestedTargetVelocity);
flywheelTuningTable.getEntry("flywheelClampedTargetVelocity").setDouble(clampedTargetVelocity);
flywheelTuningTable.getEntry("flywheelVelocityToleranceActive").setDouble(flywheelVelocityTolerance);
if (flywheelVelocityTuningActive) {
setFlywheelVelocity(clampedTargetVelocity);
}
}
public void debugShooterConveyorVelocityPeriodic(boolean allowMotorOutput) {
shooterConveyorVelocityTuningActive =
allowMotorOutput
&& DriverStation.isTestEnabled()
&& shooterConveyorTuningTable.getEntry("shooterConveyorVelocityEnable").getBoolean(false);
shooterConveyorCommandedTargetVelocity = shooterConveyorTuningTable
.getEntry("shooterConveyorTargetVelocity")
.getDouble(Constants.Shooter.shooterConveyorFeedVelocity);
shooterConveyorClampedTargetVelocity = MathUtil.clamp(
shooterConveyorCommandedTargetVelocity,
-Constants.Shooter.shooterConveyorMaxVelocity,
Constants.Shooter.shooterConveyorMaxVelocity
);
shooterConveyorTuningTable.getEntry("shooterConveyorVelocityEnableActive")
.setBoolean(shooterConveyorVelocityTuningActive);
shooterConveyorTuningTable.getEntry("shooterConveyorCommandedTargetVelocity")
.setDouble(shooterConveyorCommandedTargetVelocity);
shooterConveyorTuningTable.getEntry("shooterConveyorClampedTargetVelocity")
.setDouble(shooterConveyorClampedTargetVelocity);
shooterConveyorTuningTable.getEntry("shooterConveyorMaxVelocity")
.setDouble(Constants.Shooter.shooterConveyorMaxVelocity);
if (shooterConveyorVelocityTuningActive) {
runShooterConveyorVelocity(shooterConveyorClampedTargetVelocity);
}
}
@Override @Override
public void periodic() { public void periodic() {
backboardPID.calculate(getBackboardPosition());
double backboardPosition = getBackboardPosition(); double backboardPosition = getBackboardPosition();
double backboardGoalPosition = backboardPID.getGoal().position; double backboardGoalPosition = backboardPID.getGoal().position;
double backboardSetpointPosition = backboardPID.getSetpoint().position; double backboardSetpointPosition = backboardPID.getSetpoint().position;
flywheelOutputVolts = leftFlywheel.getMotorVoltage().getValueAsDouble();
shooterNetworkTable.getEntry("flywheelVelocity").setDouble(getAverageFlywheelVelocity()); shooterNetworkTable.getEntry("flywheelVelocity").setDouble(getAverageFlywheelVelocity());
shooterNetworkTable.getEntry("leftFlywheelVelocity").setDouble(getLeftFlywheelVelocity()); shooterNetworkTable.getEntry("leftFlywheelVelocity").setDouble(getLeftFlywheelVelocity());
shooterNetworkTable.getEntry("rightFlywheelVelocity").setDouble(getRightFlywheelVelocity()); shooterNetworkTable.getEntry("rightFlywheelVelocity").setDouble(getRightFlywheelVelocity());
shooterNetworkTable.getEntry("flywheelVelocityDifference").setDouble(getFlywheelVelocityDifference()); shooterNetworkTable.getEntry("flywheelVelocityDifference").setDouble(getFlywheelVelocityDifference());
shooterNetworkTable.getEntry("flywheelTargetVoltage").setDouble(getTargetFlywheelVoltage()); shooterNetworkTable.getEntry("flywheelTargetVelocity").setDouble(getTargetFlywheelVelocity());
shooterNetworkTable.getEntry("flywheelVelocityError").setDouble(getFlywheelVelocityError());
shooterNetworkTable.getEntry("flywheelVelocityTolerance").setDouble(flywheelVelocityTolerance);
shooterNetworkTable.getEntry("flywheelAtVelocity").setBoolean(atVelocity());
shooterNetworkTable.getEntry("flywheelVelocityTuningActive").setBoolean(flywheelVelocityTuningActive);
shooterNetworkTable.getEntry("flywheelFollowerOpposed").setBoolean(true);
shooterNetworkTable.getEntry("flywheelOutputVolts").setDouble(flywheelOutputVolts); shooterNetworkTable.getEntry("flywheelOutputVolts").setDouble(flywheelOutputVolts);
shooterNetworkTable.getEntry("flywheelAtVoltage").setBoolean(atVoltage()); shooterNetworkTable.getEntry("leftFlywheelOutputVolts").setDouble(leftFlywheel.getMotorVoltage().getValueAsDouble());
shooterNetworkTable.getEntry("rightFlywheelOutputVolts").setDouble(rightFlywheel.getMotorVoltage().getValueAsDouble());
shooterNetworkTable.getEntry("leftFlywheelStatorCurrent").setDouble(leftFlywheel.getStatorCurrent().getValueAsDouble());
shooterNetworkTable.getEntry("rightFlywheelStatorCurrent").setDouble(rightFlywheel.getStatorCurrent().getValueAsDouble());
shooterConveyorOutputVolts = leftConveyor.getMotorVoltage().getValueAsDouble();
shooterNetworkTable.getEntry("shooterConveyorOutputVolts").setDouble(shooterConveyorOutputVolts); shooterNetworkTable.getEntry("shooterConveyorOutputVolts").setDouble(shooterConveyorOutputVolts);
shooterNetworkTable.getEntry("conveyorVelocity").setDouble(leftConveyor.getVelocity().getValueAsDouble()); shooterNetworkTable.getEntry("conveyorTargetVelocity").setDouble(getShooterConveyorTargetVelocity());
shooterNetworkTable.getEntry("conveyorVelocity").setDouble(getShooterConveyorVelocity());
shooterNetworkTable.getEntry("conveyorVelocityError").setDouble(getShooterConveyorVelocityError());
shooterNetworkTable.getEntry("conveyorVelocityTuningActive").setBoolean(shooterConveyorVelocityTuningActive);
shooterNetworkTable.getEntry("conveyorCommandedTargetVelocity").setDouble(shooterConveyorCommandedTargetVelocity);
shooterNetworkTable.getEntry("conveyorClampedTargetVelocity").setDouble(shooterConveyorClampedTargetVelocity);
shooterNetworkTable.getEntry("conveyorLeftStatorCurrent").setDouble(leftConveyor.getStatorCurrent().getValueAsDouble());
shooterNetworkTable.getEntry("conveyorRightStatorCurrent").setDouble(rightConveyor.getStatorCurrent().getValueAsDouble());
shooterNetworkTable.getEntry("backboardCurrentRate").setDouble(backboardPosition); shooterNetworkTable.getEntry("backboardCurrentRate").setDouble(backboardPosition);
shooterNetworkTable.getEntry("backboardTargetRate").setDouble(backboardSetpointPosition); shooterNetworkTable.getEntry("backboardTargetRate").setDouble(backboardSetpointPosition);
shooterNetworkTable.getEntry("backboardOutputVolts").setDouble(backboardOutputVolts); shooterNetworkTable.getEntry("backboardOutputVolts").setDouble(backboardOutputVolts);
@@ -324,11 +506,14 @@ public class ShooterSubsystem extends SubsystemBase {
shooterNetworkTable.getEntry("backboardGoalError").setDouble(backboardGoalPosition - backboardPosition); shooterNetworkTable.getEntry("backboardGoalError").setDouble(backboardGoalPosition - backboardPosition);
shooterNetworkTable.getEntry("backboardSetpointError").setDouble(backboardSetpointPosition - backboardPosition); shooterNetworkTable.getEntry("backboardSetpointError").setDouble(backboardSetpointPosition - backboardPosition);
shooterNetworkTable.getEntry("backboardRawPIDOutput").setDouble(backboardRawPidOutputVolts); shooterNetworkTable.getEntry("backboardRawPIDOutput").setDouble(backboardRawPidOutputVolts);
shooterNetworkTable.getEntry("backboardGravityFeedforward").setDouble(backboardGravityFeedforwardVolts);
shooterNetworkTable.getEntry("backboardClampedPIDOutput").setDouble(backboardClampedPidOutputVolts); shooterNetworkTable.getEntry("backboardClampedPIDOutput").setDouble(backboardClampedPidOutputVolts);
shooterNetworkTable.getEntry("backboardOutputSaturated").setBoolean(backboardOutputSaturated); shooterNetworkTable.getEntry("backboardOutputSaturated").setBoolean(backboardOutputSaturated);
shooterNetworkTable.getEntry("backboardMinimumOutputActive").setBoolean(backboardMinimumOutputActive); shooterNetworkTable.getEntry("backboardMinimumOutputActive").setBoolean(backboardMinimumOutputActive);
shooterNetworkTable.getEntry("backboardMaxOutputVolts").setDouble(Constants.Shooter.backboardSpeedMax); shooterNetworkTable.getEntry("backboardMaxOutputVolts").setDouble(Constants.Shooter.backboardSpeedMax);
shooterNetworkTable.getEntry("backboardMinOutputVolts").setDouble(Constants.Shooter.backboardSpeedMin); shooterNetworkTable.getEntry("backboardMinOutputVolts").setDouble(Constants.Shooter.backboardSpeedMin);
shooterNetworkTable.getEntry("backboardGravityFeedforwardMinVolts").setDouble(Constants.Shooter.backboardGravityFeedforwardMinVolts);
shooterNetworkTable.getEntry("backboardGravityFeedforwardMaxVolts").setDouble(Constants.Shooter.backboardGravityFeedforwardMaxVolts);
shooterNetworkTable.getEntry("backboardPositionTolerance").setDouble(10.0); shooterNetworkTable.getEntry("backboardPositionTolerance").setDouble(10.0);
shooterNetworkTable.getEntry("backboardShootPosition").setDouble(Constants.Superstructure.backboardShootPosition); shooterNetworkTable.getEntry("backboardShootPosition").setDouble(Constants.Superstructure.backboardShootPosition);
shooterNetworkTable.getEntry("backboardPassPosition").setDouble(Constants.Superstructure.passBallBackboardPosition); shooterNetworkTable.getEntry("backboardPassPosition").setDouble(Constants.Superstructure.passBallBackboardPosition);
@@ -339,4 +524,3 @@ public class ShooterSubsystem extends SubsystemBase {
shooterNetworkTable.getEntry("statorCurrent").setDouble(getConveyorStatorCurrent()); shooterNetworkTable.getEntry("statorCurrent").setDouble(getConveyorStatorCurrent());
} }
} }
@@ -1,5 +1,6 @@
package frc.robot.subsystems; package frc.robot.subsystems;
import edu.wpi.first.math.MathUtil;
import edu.wpi.first.math.kinematics.ChassisSpeeds; import edu.wpi.first.math.kinematics.ChassisSpeeds;
import edu.wpi.first.networktables.NetworkTable; import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableInstance; import edu.wpi.first.networktables.NetworkTableInstance;
@@ -21,6 +22,7 @@ import frc.robot.Constants;
public class Superstructure extends SubsystemBase { public class Superstructure extends SubsystemBase {
// 操作员或自动程序请求的目标状态。 // 操作员或自动程序请求的目标状态。
public enum WantedState { public enum WantedState {
INIT,
IDLE, IDLE,
INTAKE, INTAKE,
SHOOT_HUB, SHOOT_HUB,
@@ -33,6 +35,7 @@ public class Superstructure extends SubsystemBase {
// 机器人内部实际执行状态,用于动作排序和仪表盘诊断。 // 机器人内部实际执行状态,用于动作排序和仪表盘诊断。
public enum SystemState { public enum SystemState {
DISABLED, DISABLED,
INITIALIZING,
STOWED, STOWED,
INTAKING, INTAKING,
PREP_SHOOT, PREP_SHOOT,
@@ -52,9 +55,10 @@ public class Superstructure extends SubsystemBase {
private WantedState wantedState = WantedState.IDLE; private WantedState wantedState = WantedState.IDLE;
private SystemState systemState = SystemState.STOWED; private SystemState systemState = SystemState.STOWED;
private double stateStartTimestamp = Timer.getFPGATimestamp(); private double stateStartTimestamp = Timer.getFPGATimestamp();
private double flywheelVoltageOffset = 0.0; private double flywheelVelocityOffset = 0.0;
private double backboardPositionOffset = 0.0; private double backboardPositionOffset = 0.0;
private boolean shotCompletedThisRequest = false; private boolean shotCompletedThisRequest = false;
private double postShootIdleAssistStartTimestamp = Double.NaN;
public Superstructure( public Superstructure(
ShooterSubsystem shooter, ShooterSubsystem shooter,
@@ -77,9 +81,16 @@ public class Superstructure extends SubsystemBase {
/* ====================== */ /* ====================== */
public void requestIdle() { public void requestIdle() {
if (systemState == SystemState.SHOOTING) {
postShootIdleAssistStartTimestamp = Timer.getFPGATimestamp();
}
wantedState = WantedState.IDLE; wantedState = WantedState.IDLE;
} }
public void requestInit() {
wantedState = WantedState.INIT;
}
public void requestIntake() { public void requestIntake() {
wantedState = WantedState.INTAKE; wantedState = WantedState.INTAKE;
} }
@@ -118,6 +129,14 @@ public class Superstructure extends SubsystemBase {
return Commands.runOnce(this::requestIdle, this); return Commands.runOnce(this::requestIdle, this);
} }
public Command requestInitCommand() {
return Commands.sequence(
Commands.runOnce(this::requestInit),
intakeRotater.lowerForMatchCommand(),
Commands.runOnce(this::requestIntake)
);
}
public Command requestIntakeCommand() { public Command requestIntakeCommand() {
return Commands.runOnce(this::requestIntake, this); return Commands.runOnce(this::requestIntake, this);
} }
@@ -163,10 +182,9 @@ public class Superstructure extends SubsystemBase {
/* ====================== */ /* ====================== */
public boolean canShoot() { public boolean canShoot() {
boolean stationaryGate = !Constants.Superstructure.stationaryGateEnabled || isDriveStationary(); return shooter.atVelocity()
return shooter.atVoltage()
&& drive.isAimed() && drive.isAimed()
&& stationaryGate; && isBackboardReady();
} }
private boolean isDriveStationary() { private boolean isDriveStationary() {
@@ -175,12 +193,20 @@ public class Superstructure extends SubsystemBase {
return translationSpeed <= Constants.Superstructure.stationarySpeedToleranceMetersPerSecond; return translationSpeed <= Constants.Superstructure.stationarySpeedToleranceMetersPerSecond;
} }
private boolean isBackboardReady() {
return shooter.isBackboardNearTarget(Constants.Superstructure.backboardReadyPositionTolerance);
}
/* ====================== */ /* ====================== */
/* 现场微调 offset */ /* 现场微调 offset */
/* ====================== */ /* ====================== */
public void adjustFlywheelVelocityOffset(double offsetVelocity) {
flywheelVelocityOffset += offsetVelocity;
}
public void adjustFlywheelVoltageOffset(double offsetVolts) { public void adjustFlywheelVoltageOffset(double offsetVolts) {
flywheelVoltageOffset += offsetVolts; adjustFlywheelVelocityOffset(offsetVolts / Constants.Shooter.flywheelNominalKv);
} }
public void adjustBackboardPositionOffset(double offset) { public void adjustBackboardPositionOffset(double offset) {
@@ -188,7 +214,7 @@ public class Superstructure extends SubsystemBase {
} }
public void resetOffsets() { public void resetOffsets() {
flywheelVoltageOffset = 0.0; flywheelVelocityOffset = 0.0;
backboardPositionOffset = 0.0; backboardPositionOffset = 0.0;
} }
@@ -211,6 +237,7 @@ public class Superstructure extends SubsystemBase {
} }
switch (wantedState) { switch (wantedState) {
case INIT -> handleInit();
case IDLE -> handleIdle(); case IDLE -> handleIdle();
case INTAKE -> handleIntake(); case INTAKE -> handleIntake();
case SHOOT_HUB -> handleShootHub(); case SHOOT_HUB -> handleShootHub();
@@ -223,102 +250,183 @@ public class Superstructure extends SubsystemBase {
publishTelemetry(); publishTelemetry();
} }
private void handleInit() {
if (systemState != SystemState.INITIALIZING) {
setSystemState(SystemState.INITIALIZING);
}
stopMainConveyorUnlessTuning();
intakeRoller.stop();
stopFlywheelUnlessTuning();
stopShooterConveyorUnlessTuning();
holdBackboardStowedUnlessTuning();
}
private void handleIdle() { private void handleIdle() {
// 安全默认状态:球路不动,intaker 不主动动作,背板保持受控。 // 安全默认状态:球路不动,intaker 不主动动作,背板保持受控。
conveyor.stop(); stopMainConveyorUnlessTuning();
intakeRoller.stop(); intakeRoller.stop();
intakeRotater.stop(); if (!runPostShootIdleAssist()) {
shooter.stopFlywheel(); intakeRotater.stop();
shooter.stopShooterConveyor(); }
shooter.holdBackboardAt(0.0); stopFlywheelUnlessTuning();
stopShooterConveyorUnlessTuning();
holdBackboardStowedUnlessTuning();
setSystemState(SystemState.STOWED); setSystemState(SystemState.STOWED);
} }
private boolean runPostShootIdleAssist() {
if (Double.isNaN(postShootIdleAssistStartTimestamp)) {
return false;
}
double elapsed = Timer.getFPGATimestamp() - postShootIdleAssistStartTimestamp;
if (elapsed >= 0.6) {
postShootIdleAssistStartTimestamp = Double.NaN;
return false;
}
intakeRotater.postShootIdleAssist(elapsed);
return true;
}
private void handleIntake() { private void handleIntake() {
shooter.stopFlywheel(); stopFlywheelUnlessTuning();
shooter.stopShooterConveyor(); stopShooterConveyorUnlessTuning();
shooter.holdBackboardAt(0.0); holdBackboardStowedUnlessTuning();
// Intaker 比赛开始后保持下放,收球何时结束由操作员松开按键决定。 // Intaker 比赛开始后保持下放,收球何时结束由操作员松开按键决定。
intakeRoller.intake(); intakeRoller.intake();
conveyor.feedToShooter(); intakeFeedMainConveyorUnlessTuning();
setSystemState(SystemState.INTAKING); setSystemState(SystemState.INTAKING);
} }
private void handleAimHub() { private void handleAimHub() {
intakeRoller.stop(); intakeRoller.stop();
conveyor.stop(); stopMainConveyorUnlessTuning();
shooter.stopFlywheel(); stopFlywheelUnlessTuning();
shooter.stopShooterConveyor(); stopShooterConveyorUnlessTuning();
shooter.holdBackboardAt(0.0); holdBackboardStowedUnlessTuning();
setSystemState(SystemState.STOWED); setSystemState(SystemState.STOWED);
} }
private void handleShootHub() { private void handleShootHub() {
double targetVolts = limelight.getShooterVoltageByDistance() + flywheelVoltageOffset; double x = NetworkTableInstance.getDefault().getTable("AutoControl").getEntry("distanceToHub").getDouble(0.0);
double backboardPosition = Constants.Superstructure.backboardShootPosition + backboardPositionOffset; x = MathUtil.clamp(x, 1.2, 4.5);
handlePreparedFeed(targetVolts, backboardPosition); double rawtargetVelocity = -0.9702766369910669*x*x*x*x*x*x+16.17984114722666*x*x*x*x*x-107.89020547785285*x*x*x*x+365.6895126610877*x*x*x-659.1553030522557*x*x+598.8266122952737*x-188.96203796840197;
double targetVelocity = rawtargetVelocity + flywheelVelocityOffset;
double rawtargetbackboardPosition = +72.63723930800967*x*x*x*x*x*x-1226.7072434356646*x*x*x*x*x+8380.732539436454*x*x*x*x-29585.06108203164*x*x*x+56753.91414329895*x*x-55469.56099616276*x+21418.08191862802;
rawtargetbackboardPosition = MathUtil.clamp(rawtargetbackboardPosition, 0, 2200);
double backboardPosition = rawtargetbackboardPosition + backboardPositionOffset;
handlePreparedFeed(targetVelocity, backboardPosition);
} }
private void handlePassBall() { private void handlePassBall() {
double targetVolts = Constants.Superstructure.passBallFlywheelVoltage + flywheelVoltageOffset; double targetVelocity = 30;
double backboardPosition = Constants.Superstructure.passBallBackboardPosition + backboardPositionOffset; double backboardPosition = 2000;
handlePreparedFeed(targetVolts, backboardPosition); handlePreparedFeed(targetVelocity, backboardPosition);
} }
private void handlePreparedFeed(double targetVolts, double backboardPosition) { private void handlePreparedFeed(double targetVelocity, double backboardPosition) {
if (systemState != SystemState.PREP_SHOOT if (systemState != SystemState.PREP_SHOOT
&& systemState != SystemState.SHOOTING) { && systemState != SystemState.SHOOTING) {
setSystemState(SystemState.PREP_SHOOT); setSystemState(SystemState.PREP_SHOOT);
} }
intakeRoller.stop();
conveyor.stop();
shooter.stopShooterConveyor();
// 距离到射速的映射由 LimelightSubsystem 提供;操作员 offset 用于现场微调, // 距离到射速的映射由 LimelightSubsystem 提供;操作员 offset 用于现场微调,
// 但不会绕过 Superstructure 状态机。 // 但不会绕过 Superstructure 状态机。
shooter.setFlywheelVoltage(targetVolts); shooter.setFlywheelVelocity(targetVelocity);
shooter.holdBackboardAt(backboardPosition); shooter.holdBackboardAt(backboardPosition);
if (systemState == SystemState.SHOOTING) { if (systemState == SystemState.SHOOTING) {
// 只有 canShoot() 通过后才会进入本状态;喂球期间不再复查门控, // 只有 canShoot() 通过后才会进入本状态;喂球期间不再复查门控,
// 避免球接触飞轮导致的掉速中断喂球。 // 避免球接触飞轮导致的掉速中断喂球。
intakeRotater.shootAssist(); intakeRotater.shootAssist();
conveyor.feedToShooter(); intakeRoller.intakeforshoot();
shooter.runShooterConveyorVoltage(Constants.Superstructure.shooterFeedVoltage); feedMainConveyorUnlessTuning();
runShooterConveyorVelocityUnlessTuning(Constants.Superstructure.shooterFeedVelocity);
if (timeInState() > Constants.Superstructure.shootTimeoutSeconds) {
shotCompletedThisRequest = true;
setSystemState(SystemState.PREP_SHOOT);
}
return; return;
} }
// 未开始喂球前,球路保持静止。 // 未开始喂球前,球路保持静止。
conveyor.stop(); stopMainConveyorUnlessTuning();
shooter.stopShooterConveyor(); stopShooterConveyorUnlessTuning();
intakeRoller.stop();
// 门控条件实时刷新:条件回落时状态同步回退,仪表盘能看到卡在哪一关。 // Keep normal gating, but force the shot if prep takes too long.
if (canShoot()) { if (canShoot() || prepShootFallbackElapsed()) {
setSystemState(SystemState.SHOOTING); setSystemState(SystemState.SHOOTING);
} }
} }
private boolean prepShootFallbackElapsed() {
return systemState == SystemState.PREP_SHOOT
&& timeInState() >= Constants.Superstructure.prepShootFallbackDelaySeconds;
}
private void handleEject() { private void handleEject() {
// Eject 反转整条球路,飞轮保持停止。 // Eject 反转整条球路,飞轮保持停止。
setSystemState(SystemState.EJECTING); setSystemState(SystemState.EJECTING);
intakeRoller.outtake(); intakeRoller.outtake();
conveyor.reverse(); reverseMainConveyorUnlessTuning();
shooter.runShooterConveyorVoltage(Constants.Superstructure.shooterReverseVoltage); runShooterConveyorVelocityUnlessTuning(Constants.Superstructure.shooterReverseVelocity);
shooter.stopFlywheel(); stopFlywheelUnlessTuning();
shooter.holdBackboardAt(0.0); holdBackboardStowedUnlessTuning();
}
private void holdBackboardStowedUnlessTuning() {
if (!shooter.isBackboardPositionTuningActive()) {
shooter.holdBackboardAt(0.0);
}
}
private void stopFlywheelUnlessTuning() {
if (!shooter.isFlywheelTuningControlActive()) {
shooter.stopFlywheel();
}
}
private void runShooterConveyorVelocityUnlessTuning(double targetVelocity) {
if (!shooter.isShooterConveyorTuningControlActive()) {
shooter.runShooterConveyorVelocity(targetVelocity);
}
}
private void stopShooterConveyorUnlessTuning() {
if (!shooter.isShooterConveyorTuningControlActive()) {
shooter.stopShooterConveyor();
}
}
private void feedMainConveyorUnlessTuning() {
if (!conveyor.isMainConveyorTuningControlActive()) {
conveyor.feedToShooter();
}
}
private void intakeFeedMainConveyorUnlessTuning() {
if (!conveyor.isMainConveyorTuningControlActive()) {
conveyor.feedForIntake();
}
}
private void reverseMainConveyorUnlessTuning() {
if (!conveyor.isMainConveyorTuningControlActive()) {
conveyor.reverse();
}
}
private void stopMainConveyorUnlessTuning() {
if (!conveyor.isMainConveyorTuningControlActive()) {
conveyor.stop();
}
} }
private void handleManual() { private void handleManual() {
// 手动模式:状态机不再驱动机构,交给现场手动/调参工具; // 手动模式:状态机不再驱动机构,交给现场手动/调参工具;
// 只保持飞轮与喂球停止,避免意外射出。 // 只保持飞轮与喂球停止,避免意外射出。
setSystemState(SystemState.MANUAL_OVERRIDE); setSystemState(SystemState.MANUAL_OVERRIDE);
shooter.stopFlywheel(); stopFlywheelUnlessTuning();
shooter.stopShooterConveyor(); stopShooterConveyorUnlessTuning();
conveyor.stop(); stopMainConveyorUnlessTuning();
intakeRoller.stop(); intakeRoller.stop();
} }
@@ -333,6 +441,9 @@ public class Superstructure extends SubsystemBase {
if (systemState != nextState) { if (systemState != nextState) {
systemState = nextState; systemState = nextState;
stateStartTimestamp = Timer.getFPGATimestamp(); stateStartTimestamp = Timer.getFPGATimestamp();
if (nextState == SystemState.SHOOTING) {
shooter.setBackboardBrakeMode();
}
} }
} }
@@ -346,11 +457,20 @@ public class Superstructure extends SubsystemBase {
table.getEntry("systemState").setString(systemState.name()); table.getEntry("systemState").setString(systemState.name());
table.getEntry("timeInState").setDouble(timeInState()); table.getEntry("timeInState").setDouble(timeInState());
table.getEntry("canShoot").setBoolean(canShoot()); table.getEntry("canShoot").setBoolean(canShoot());
table.getEntry("shooterAtVoltage").setBoolean(shooter.atVoltage()); table.getEntry("shooterAtVelocity").setBoolean(shooter.atVelocity());
table.getEntry("driveAimed").setBoolean(drive.isAimed()); table.getEntry("driveAimed").setBoolean(drive.isAimed());
table.getEntry("driveHeadingError").setDouble(drive.getHeadingError()); table.getEntry("driveHeadingError").setDouble(drive.getHeadingError());
table.getEntry("driveStationary").setBoolean(isDriveStationary()); table.getEntry("driveStationary").setBoolean(isDriveStationary());
table.getEntry("flywheelVoltageOffset").setDouble(flywheelVoltageOffset); table.getEntry("backboardReady").setBoolean(isBackboardReady());
table.getEntry("backboardPositionError").setDouble(shooter.getBackboardPositionError());
table.getEntry("backboardReadyTolerance").setDouble(Constants.Superstructure.backboardReadyPositionTolerance);
table.getEntry("flywheelVelocityOffset").setDouble(flywheelVelocityOffset);
table.getEntry("flywheelTuningControlActive").setBoolean(shooter.isFlywheelTuningControlActive());
table.getEntry("shooterConveyorTuningControlActive")
.setBoolean(shooter.isShooterConveyorTuningControlActive());
table.getEntry("mainConveyorTuningControlActive")
.setBoolean(conveyor.isMainConveyorTuningControlActive());
table.getEntry("flywheelVoltageOffset").setDouble(flywheelVelocityOffset * Constants.Shooter.flywheelNominalKv);
table.getEntry("backboardPositionOffset").setDouble(backboardPositionOffset); table.getEntry("backboardPositionOffset").setDouble(backboardPositionOffset);
} }
} }
@@ -1,6 +1,4 @@
package frc.robot.tuning; package frc.robot.tuning;
import java.util.function.Function;
import com.ctre.phoenix6.configs.Slot0Configs; import com.ctre.phoenix6.configs.Slot0Configs;
import com.ctre.phoenix6.controls.VoltageOut; import com.ctre.phoenix6.controls.VoltageOut;
import com.ctre.phoenix6.hardware.TalonFX; import com.ctre.phoenix6.hardware.TalonFX;
@@ -12,6 +10,7 @@ public class ConfigTalonFXMotorTuner {
private final String motorName; private final String motorName;
private final Slot0Configs motorSlot0Configs; private final Slot0Configs motorSlot0Configs;
private final NetworkTable table; private final NetworkTable table;
private final boolean voltageRunEnabled;
// ---- Subscribers:读取 Elastic 改过的新值 ---- // ---- Subscribers:读取 Elastic 改过的新值 ----
private final BooleanSubscriber enableSub; private final BooleanSubscriber enableSub;
@@ -25,12 +24,23 @@ public class ConfigTalonFXMotorTuner {
private final BooleanSubscriber enableRuningSub; private final BooleanSubscriber enableRuningSub;
private final DoubleSubscriber runningVolts; private final DoubleSubscriber runningVolts;
private double lastKp = 0, lastKi = 0, lastKd = 0, lastKv = 0, lastKa = 0, lastKs = 0; private double lastKp = 0, lastKi = 0, lastKd = 0, lastKv = 0, lastKa = 0, lastKs = 0;
private boolean wasRunning = false;
private final VoltageOut voltageRequest = new VoltageOut(0); private final VoltageOut voltageRequest = new VoltageOut(0);
public ConfigTalonFXMotorTuner(TalonFX motor_, String motorName_, Slot0Configs motorSlot0Configs_) { public ConfigTalonFXMotorTuner(TalonFX motor_, String motorName_, Slot0Configs motorSlot0Configs_) {
this(motor_, motorName_, motorSlot0Configs_, true);
}
public ConfigTalonFXMotorTuner(
TalonFX motor_,
String motorName_,
Slot0Configs motorSlot0Configs_,
boolean voltageRunEnabled_
) {
this.motor = motor_; this.motor = motor_;
this.motorName = motorName_; this.motorName = motorName_;
this.motorSlot0Configs = motorSlot0Configs_; this.motorSlot0Configs = motorSlot0Configs_;
this.voltageRunEnabled = voltageRunEnabled_;
this.table = NetworkTableInstance.getDefault().getTable("Tuning/" + motorName); this.table = NetworkTableInstance.getDefault().getTable("Tuning/" + motorName);
@@ -42,8 +52,10 @@ public class ConfigTalonFXMotorTuner {
table.getDoubleTopic(motorName+"kA").publish().set(motorSlot0Configs.kA); table.getDoubleTopic(motorName+"kA").publish().set(motorSlot0Configs.kA);
table.getDoubleTopic(motorName+"kS").publish().set(motorSlot0Configs.kS); table.getDoubleTopic(motorName+"kS").publish().set(motorSlot0Configs.kS);
table.getBooleanTopic(motorName+"EnableRunning").publish().set(false);; if (voltageRunEnabled) {
table.getDoubleTopic(motorName+"RunningVolts").publish().set(0);; table.getBooleanTopic(motorName+"EnableRunning").publish().set(false);;
table.getDoubleTopic(motorName+"RunningVolts").publish().set(0);;
}
this.enableSub = table.getBooleanTopic(motorName+"Enable").subscribe(false); this.enableSub = table.getBooleanTopic(motorName+"Enable").subscribe(false);
this.KpSub = table.getDoubleTopic(motorName+"kP").subscribe(motorSlot0Configs.kP); this.KpSub = table.getDoubleTopic(motorName+"kP").subscribe(motorSlot0Configs.kP);
@@ -52,8 +64,12 @@ public class ConfigTalonFXMotorTuner {
this.KvSub = table.getDoubleTopic(motorName+"kV").subscribe(motorSlot0Configs.kV); this.KvSub = table.getDoubleTopic(motorName+"kV").subscribe(motorSlot0Configs.kV);
this.KaSub = table.getDoubleTopic(motorName+"kA").subscribe(motorSlot0Configs.kA); this.KaSub = table.getDoubleTopic(motorName+"kA").subscribe(motorSlot0Configs.kA);
this.KsSub = table.getDoubleTopic(motorName+"kS").subscribe(motorSlot0Configs.kS); this.KsSub = table.getDoubleTopic(motorName+"kS").subscribe(motorSlot0Configs.kS);
this.enableRuningSub = table.getBooleanTopic(motorName+"EnableRunning").subscribe(false); this.enableRuningSub = voltageRunEnabled
this.runningVolts = table.getDoubleTopic(motorName+"RunningVolts").subscribe(0); ? table.getBooleanTopic(motorName+"EnableRunning").subscribe(false)
: null;
this.runningVolts = voltageRunEnabled
? table.getDoubleTopic(motorName+"RunningVolts").subscribe(0)
: null;
} }
public void periodic(Runnable func) { public void periodic(Runnable func) {
@@ -80,12 +96,14 @@ public class ConfigTalonFXMotorTuner {
} }
} }
if (enableRuningSub.get()) {; if (voltageRunEnabled && enableRuningSub.get()) {;
double volts = MathUtil.clamp(runningVolts.get(), -12.0, 12.0); double volts = MathUtil.clamp(runningVolts.get(), -12.0, 12.0);
motor.setControl(voltageRequest.withOutput(volts)); motor.setControl(voltageRequest.withOutput(volts));
wasRunning = true;
// System.out.println("running motor with volts: "+volts+" on motor: "+motorName); // System.out.println("running motor with volts: "+volts+" on motor: "+motorName);
}else{ }else if (wasRunning){
motor.setControl(voltageRequest.withOutput(0)); motor.setControl(voltageRequest.withOutput(0));
wasRunning = false;
} }
} }
@@ -1,6 +1,5 @@
package frc.robot.tuning; package frc.robot.tuning;
import com.ctre.phoenix6.configs.Slot0Configs; import com.ctre.phoenix6.configs.Slot0Configs;
import com.ctre.phoenix6.controls.VelocityDutyCycle;
import com.ctre.phoenix6.hardware.TalonFXS; import com.ctre.phoenix6.hardware.TalonFXS;
import edu.wpi.first.networktables.*; import edu.wpi.first.networktables.*;
@@ -20,11 +19,8 @@ public class ConfigTalonFXSMotorTuner {
private final DoubleSubscriber KaSub; private final DoubleSubscriber KaSub;
private final DoubleSubscriber KsSub; private final DoubleSubscriber KsSub;
private final BooleanSubscriber enableRuningSub;
private final DoubleSubscriber runningSpeedRPS;
private double lastKp = 0, lastKi = 0, lastKd = 0, lastKv = 0, lastKa = 0, lastKs = 0; private double lastKp = 0, lastKi = 0, lastKd = 0, lastKv = 0, lastKa = 0, lastKs = 0;
private final VelocityDutyCycle velocityRequest = new VelocityDutyCycle(0);
public ConfigTalonFXSMotorTuner(TalonFXS motor_, String motorName_, Slot0Configs motorSlot0Configs_) { public ConfigTalonFXSMotorTuner(TalonFXS motor_, String motorName_, Slot0Configs motorSlot0Configs_) {
this.motor = motor_; this.motor = motor_;
this.motorName = motorName_; this.motorName = motorName_;
@@ -39,9 +35,6 @@ public class ConfigTalonFXSMotorTuner {
table.getDoubleTopic(motorName+"kA").publish().set(motorSlot0Configs.kA); table.getDoubleTopic(motorName+"kA").publish().set(motorSlot0Configs.kA);
table.getDoubleTopic(motorName+"kS").publish().set(motorSlot0Configs.kS); table.getDoubleTopic(motorName+"kS").publish().set(motorSlot0Configs.kS);
table.getBooleanTopic(motorName+"EnableRunning").publish().set(false);
table.getDoubleTopic(motorName+"RunningSpeedRPS").publish().set(0);
this.enableSub = table.getBooleanTopic(motorName+"Enable").subscribe(false); this.enableSub = table.getBooleanTopic(motorName+"Enable").subscribe(false);
this.KpSub = table.getDoubleTopic(motorName+"kP").subscribe(motorSlot0Configs.kP); this.KpSub = table.getDoubleTopic(motorName+"kP").subscribe(motorSlot0Configs.kP);
this.KiSub = table.getDoubleTopic(motorName+"kI").subscribe(motorSlot0Configs.kI); this.KiSub = table.getDoubleTopic(motorName+"kI").subscribe(motorSlot0Configs.kI);
@@ -49,8 +42,6 @@ public class ConfigTalonFXSMotorTuner {
this.KvSub = table.getDoubleTopic(motorName+"kV").subscribe(motorSlot0Configs.kV); this.KvSub = table.getDoubleTopic(motorName+"kV").subscribe(motorSlot0Configs.kV);
this.KaSub = table.getDoubleTopic(motorName+"kA").subscribe(motorSlot0Configs.kA); this.KaSub = table.getDoubleTopic(motorName+"kA").subscribe(motorSlot0Configs.kA);
this.KsSub = table.getDoubleTopic(motorName+"kS").subscribe(motorSlot0Configs.kS); this.KsSub = table.getDoubleTopic(motorName+"kS").subscribe(motorSlot0Configs.kS);
this.enableRuningSub = table.getBooleanTopic(motorName+"EnableRunning").subscribe(false);
this.runningSpeedRPS = table.getDoubleTopic(motorName+"RunningSpeedRPS").subscribe(0);
} }
public void periodic() { public void periodic() {
@@ -73,13 +64,5 @@ public class ConfigTalonFXSMotorTuner {
lastKp = kp; lastKi = ki; lastKd = kd; lastKv = kv; lastKa = ka; lastKs = ks; lastKp = kp; lastKi = ki; lastKd = kd; lastKv = kv; lastKa = ka; lastKs = ks;
} }
if (enableRuningSub.get()) {;
double speed = runningSpeedRPS.get();
motor.setControl(velocityRequest.withVelocity(speed));
// System.out.println("running motor with speed: "+speed+" on motor: "+motorName);
}else{
motor.setControl(velocityRequest.withVelocity(0));
}
} }
} }