diff --git a/template_projects/sources/kitbot_2025/src/main/deploy/pathplanner/autos/Example Auto.auto b/template_projects/sources/kitbot_2025/src/main/deploy/pathplanner/autos/Example Auto.auto index 70b7ab2e..c6c7bb76 100644 --- a/template_projects/sources/kitbot_2025/src/main/deploy/pathplanner/autos/Example Auto.auto +++ b/template_projects/sources/kitbot_2025/src/main/deploy/pathplanner/autos/Example Auto.auto @@ -9,6 +9,12 @@ "data": { "pathName": "Example Path" } + }, + { + "type": "named", + "data": { + "name": "Score" + } } ] } diff --git a/template_projects/sources/kitbot_2025/src/main/deploy/pathplanner/navgrid.json b/template_projects/sources/kitbot_2025/src/main/deploy/pathplanner/navgrid.json index 18fe1e1d..bbd91940 100644 --- a/template_projects/sources/kitbot_2025/src/main/deploy/pathplanner/navgrid.json +++ b/template_projects/sources/kitbot_2025/src/main/deploy/pathplanner/navgrid.json @@ -1,1634 +1,1656 @@ { - "field_size": { - "x": 16.54, - "y": 8.21 - }, - "nodeSizeMeters": 0.3, - "grid": [ - [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true - ], - [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true - ], - [ - true, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - true, - true - ], - [ - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true - ], - [ - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true - ], - [ - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true - ], - [ - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true - ], - [ - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true - ], - [ - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true - ], - [ - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true - ], - [ - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true - ], - [ - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true - ], - [ - true, - true, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true - ], - [ - true, - true, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true - ], - [ - true, - true, - true, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true - ], - [ - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true - ], - [ - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - true - ], - [ - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - true - ], - [ - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - true - ], - [ - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - true - ], - [ - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true, - true - ], - [ - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true, - true - ], - [ - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true, - true - ], - [ - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - true - ], - [ - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true - ], - [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true - ], - [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true - ], - [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true - ] + "field_size": { + "x": 17.548, + "y": 8.052 + }, + "nodeSizeMeters": 0.3, + "grid": [ + [ + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + [ + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + [ + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true + ], + [ + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true + ], + [ + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true + ], + [ + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true + ], + [ + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true + ], + [ + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + [ + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true ] - } - \ No newline at end of file + ] +} diff --git a/template_projects/sources/kitbot_2025/src/main/deploy/pathplanner/paths/Example Path.path b/template_projects/sources/kitbot_2025/src/main/deploy/pathplanner/paths/Example Path.path index 303dbb20..27509123 100644 --- a/template_projects/sources/kitbot_2025/src/main/deploy/pathplanner/paths/Example Path.path +++ b/template_projects/sources/kitbot_2025/src/main/deploy/pathplanner/paths/Example Path.path @@ -3,41 +3,25 @@ "waypoints": [ { "anchor": { - "x": 2.0, - "y": 7.0 + "x": 7.585319010416666, + "y": 6.652197627314815 }, "prevControl": null, "nextControl": { - "x": 3.013282910175676, - "y": 6.5274984191074985 + "x": 6.695252066386318, + "y": 6.652197627314815 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 5.166769560390973, - "y": 5.0964860911203305 + "x": 5.132468171296296, + "y": 5.18579788773148 }, "prevControl": { - "x": 4.166769560390973, - "y": 6.0964860911203305 - }, - "nextControl": { - "x": 6.166769560390973, - "y": 4.0964860911203305 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 7.0, - "y": 1.0 - }, - "prevControl": { - "x": 6.75, - "y": 2.5 + "x": 5.77864231772467, + "y": 6.305004339882877 }, "nextControl": null, "isLocked": false, diff --git a/template_projects/sources/kitbot_2025/src/main/java/frc/robot/RobotContainer.java b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/RobotContainer.java index 634c7545..1f0c3026 100644 --- a/template_projects/sources/kitbot_2025/src/main/java/frc/robot/RobotContainer.java +++ b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/RobotContainer.java @@ -14,6 +14,7 @@ package frc.robot; import com.pathplanner.lib.auto.AutoBuilder; +import com.pathplanner.lib.auto.NamedCommands; import edu.wpi.first.wpilibj.GenericHID; import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj2.command.Command; @@ -26,6 +27,10 @@ import frc.robot.subsystems.drive.DriveIOTalonSRX; import frc.robot.subsystems.drive.GyroIO; import frc.robot.subsystems.drive.GyroIOPigeon2; +import frc.robot.subsystems.roller.Roller; +import frc.robot.subsystems.roller.RollerIO; +import frc.robot.subsystems.roller.RollerIOSim; +import frc.robot.subsystems.roller.RollerIOTalonSRX; import org.littletonrobotics.junction.networktables.LoggedDashboardChooser; /** @@ -37,6 +42,7 @@ public class RobotContainer { // Subsystems private final Drive drive; + private final Roller roller; // Controller private final CommandXboxController controller = new CommandXboxController(0); @@ -50,20 +56,24 @@ public RobotContainer() { case REAL: // Real robot, instantiate hardware IO implementations drive = new Drive(new DriveIOTalonSRX(), new GyroIOPigeon2()); + roller = new Roller(new RollerIOTalonSRX()); break; case SIM: // Sim robot, instantiate physics sim IO implementations drive = new Drive(new DriveIOSim(), new GyroIO() {}); + roller = new Roller(new RollerIOSim()); break; default: // Replayed robot, disable IO implementations drive = new Drive(new DriveIO() {}, new GyroIO() {}); + roller = new Roller(new RollerIO() {}); break; } // Set up auto routines + NamedCommands.registerCommand("Score", roller.runPercent(1.0).withTimeout(3.0)); autoChooser = new LoggedDashboardChooser<>("Auto Choices", AutoBuilder.buildAutoChooser()); // Set up SysId routines @@ -91,10 +101,15 @@ public RobotContainer() { * edu.wpi.first.wpilibj2.command.button.JoystickButton}. */ private void configureButtonBindings() { - // Default command, normal arcade drive + // Default drive command, normal arcade drive drive.setDefaultCommand( DriveCommands.arcadeDrive( drive, () -> -controller.getLeftY(), () -> -controller.getRightX())); + + // Default roller command, control with triggers + roller.setDefaultCommand( + roller.runTeleop( + () -> controller.getRightTriggerAxis(), () -> controller.getLeftTriggerAxis())); } /** diff --git a/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/Roller.java b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/Roller.java new file mode 100644 index 00000000..25921e8e --- /dev/null +++ b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/Roller.java @@ -0,0 +1,44 @@ +// Copyright 2021-2025 FRC 6328 +// http://github.com/Mechanical-Advantage +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// version 3 as published by the Free Software Foundation or +// available in the root directory of this project. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +package frc.robot.subsystems.roller; + +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.SubsystemBase; +import java.util.function.DoubleSupplier; +import org.littletonrobotics.junction.Logger; + +public class Roller extends SubsystemBase { + private final RollerIO io; + private final RollerIOInputsAutoLogged inputs = new RollerIOInputsAutoLogged(); + + public Roller(RollerIO io) { + this.io = io; + } + + @Override + public void periodic() { + io.updateInputs(inputs); + Logger.processInputs("Roller", inputs); + } + + public Command runPercent(double percent) { + return runEnd(() -> io.setVoltage(percent * 12.0), () -> io.setVoltage(0.0)); + } + + public Command runTeleop(DoubleSupplier forward, DoubleSupplier reverse) { + return runEnd( + () -> io.setVoltage((forward.getAsDouble() - reverse.getAsDouble()) * 12.0), + () -> io.setVoltage(0.0)); + } +} diff --git a/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerConstants.java b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerConstants.java new file mode 100644 index 00000000..d33cd309 --- /dev/null +++ b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerConstants.java @@ -0,0 +1,20 @@ +// Copyright 2021-2025 FRC 6328 +// http://github.com/Mechanical-Advantage +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// version 3 as published by the Free Software Foundation or +// available in the root directory of this project. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +package frc.robot.subsystems.roller; + +public class RollerConstants { + public static final int rollerCanId = 5; + public static final double motorReduction = 1.0; + public static final int currentLimit = 40; +} diff --git a/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIO.java b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIO.java new file mode 100644 index 00000000..692bca27 --- /dev/null +++ b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIO.java @@ -0,0 +1,32 @@ +// Copyright 2021-2025 FRC 6328 +// http://github.com/Mechanical-Advantage +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// version 3 as published by the Free Software Foundation or +// available in the root directory of this project. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +package frc.robot.subsystems.roller; + +import org.littletonrobotics.junction.AutoLog; + +public interface RollerIO { + @AutoLog + public static class RollerIOInputs { + public double positionRad = 0.0; + public double velocityRadPerSec = 0.0; + public double appliedVolts = 0.0; + public double currentAmps = 0.0; + } + + /** Update the set of loggable inputs. */ + public default void updateInputs(RollerIOInputs inputs) {} + + /** Run open loop at the specified voltage. */ + public default void setVoltage(double volts) {} +} diff --git a/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIOSim.java b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIOSim.java new file mode 100644 index 00000000..2d595376 --- /dev/null +++ b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIOSim.java @@ -0,0 +1,46 @@ +// Copyright 2021-2025 FRC 6328 +// http://github.com/Mechanical-Advantage +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// version 3 as published by the Free Software Foundation or +// available in the root directory of this project. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +package frc.robot.subsystems.roller; + +import static frc.robot.subsystems.roller.RollerConstants.*; + +import edu.wpi.first.math.MathUtil; +import edu.wpi.first.math.system.plant.DCMotor; +import edu.wpi.first.math.system.plant.LinearSystemId; +import edu.wpi.first.wpilibj.simulation.DCMotorSim; + +public class RollerIOSim implements RollerIO { + private DCMotorSim sim = + new DCMotorSim( + LinearSystemId.createDCMotorSystem(DCMotor.getCIM(1), 0.004, motorReduction), + DCMotor.getCIM(1)); + + private double appliedVolts = 0.0; + + @Override + public void updateInputs(RollerIOInputs inputs) { + sim.setInputVoltage(appliedVolts); + sim.update(0.02); + + inputs.positionRad = sim.getAngularPositionRad(); + inputs.velocityRadPerSec = sim.getAngularVelocityRadPerSec(); + inputs.appliedVolts = appliedVolts; + inputs.currentAmps = sim.getCurrentDrawAmps(); + } + + @Override + public void setVoltage(double volts) { + appliedVolts = MathUtil.clamp(volts, -12.0, 12.0); + } +} diff --git a/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIOSpark.java b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIOSpark.java new file mode 100644 index 00000000..2e5f4315 --- /dev/null +++ b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIOSpark.java @@ -0,0 +1,71 @@ +// Copyright 2021-2025 FRC 6328 +// http://github.com/Mechanical-Advantage +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// version 3 as published by the Free Software Foundation or +// available in the root directory of this project. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +package frc.robot.subsystems.roller; + +import static frc.robot.subsystems.roller.RollerConstants.*; +import static frc.robot.util.SparkUtil.*; + +import com.revrobotics.RelativeEncoder; +import com.revrobotics.spark.SparkBase.PersistMode; +import com.revrobotics.spark.SparkBase.ResetMode; +import com.revrobotics.spark.SparkLowLevel.MotorType; +import com.revrobotics.spark.SparkMax; +import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; +import com.revrobotics.spark.config.SparkMaxConfig; +import java.util.function.DoubleSupplier; + +/** + * This roller implementation is for Spark devices. It defaults to brushless control, but can be + * easily adapted for a brushed motor. A Spark Flex can be used by swapping all instances of + * "SparkMax" with "SparkFlex". + */ +public class RollerIOSpark implements RollerIO { + private final SparkMax roller = new SparkMax(rollerCanId, MotorType.kBrushless); + private final RelativeEncoder encoder = roller.getEncoder(); + + public RollerIOSpark() { + var config = new SparkMaxConfig(); + config.idleMode(IdleMode.kBrake).smartCurrentLimit(currentLimit).voltageCompensation(12.0); + config + .encoder + .positionConversionFactor( + 2.0 * Math.PI / motorReduction) // Rotor Rotations -> Roller Radians + .velocityConversionFactor((2.0 * Math.PI) / 60.0 / motorReduction) + .uvwMeasurementPeriod(10) + .uvwAverageDepth(2); + + tryUntilOk( + roller, + 5, + () -> + roller.configure( + config, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters)); + } + + @Override + public void updateInputs(RollerIOInputs inputs) { + ifOk(roller, encoder::getPosition, (value) -> inputs.positionRad = value); + ifOk(roller, encoder::getVelocity, (value) -> inputs.velocityRadPerSec = value); + ifOk( + roller, + new DoubleSupplier[] {roller::getAppliedOutput, roller::getBusVoltage}, + (values) -> inputs.appliedVolts = values[0] * values[1]); + ifOk(roller, roller::getOutputCurrent, (value) -> inputs.currentAmps = value); + } + + @Override + public void setVoltage(double volts) { + roller.setVoltage(volts); + } +} diff --git a/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIOTalonFX.java b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIOTalonFX.java new file mode 100644 index 00000000..e6abf46d --- /dev/null +++ b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIOTalonFX.java @@ -0,0 +1,70 @@ +// Copyright 2021-2025 FRC 6328 +// http://github.com/Mechanical-Advantage +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// version 3 as published by the Free Software Foundation or +// available in the root directory of this project. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +package frc.robot.subsystems.roller; + +import static frc.robot.subsystems.roller.RollerConstants.*; +import static frc.robot.util.PhoenixUtil.*; + +import com.ctre.phoenix6.BaseStatusSignal; +import com.ctre.phoenix6.StatusSignal; +import com.ctre.phoenix6.configs.TalonFXConfiguration; +import com.ctre.phoenix6.controls.VoltageOut; +import com.ctre.phoenix6.hardware.TalonFX; +import com.ctre.phoenix6.signals.NeutralModeValue; +import edu.wpi.first.math.util.Units; +import edu.wpi.first.units.measure.Angle; +import edu.wpi.first.units.measure.AngularVelocity; +import edu.wpi.first.units.measure.Current; +import edu.wpi.first.units.measure.Voltage; + +/** + * This roller implementation is for a Talon FX driving a motor like the Falon 500 or Kraken X60. + */ +public class RollerIOTalonFX implements RollerIO { + private final TalonFX roller = new TalonFX(rollerCanId); + private final StatusSignal positionRot = roller.getPosition(); + private final StatusSignal velocityRotPerSec = roller.getVelocity(); + private final StatusSignal appliedVolts = roller.getMotorVoltage(); + private final StatusSignal currentAmps = roller.getSupplyCurrent(); + + private final VoltageOut voltageRequest = new VoltageOut(0.0); + + public RollerIOTalonFX() { + var config = new TalonFXConfiguration(); + config.CurrentLimits.SupplyCurrentLimit = currentLimit; + config.CurrentLimits.SupplyCurrentLimitEnable = true; + config.MotorOutput.NeutralMode = NeutralModeValue.Brake; + + tryUntilOk(5, () -> roller.getConfigurator().apply(config, 0.25)); + + BaseStatusSignal.setUpdateFrequencyForAll( + 50.0, positionRot, velocityRotPerSec, appliedVolts, currentAmps); + roller.optimizeBusUtilization(); + } + + @Override + public void updateInputs(RollerIOInputs inputs) { + BaseStatusSignal.refreshAll(positionRot, velocityRotPerSec, appliedVolts, currentAmps); + + inputs.positionRad = Units.rotationsToRadians(positionRot.getValueAsDouble()); + inputs.velocityRadPerSec = Units.rotationsToRadians(velocityRotPerSec.getValueAsDouble()); + inputs.appliedVolts = appliedVolts.getValueAsDouble(); + inputs.currentAmps = currentAmps.getValueAsDouble(); + } + + @Override + public void setVoltage(double volts) { + roller.setControl(voltageRequest.withOutput(volts)); + } +} diff --git a/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIOTalonSRX.java b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIOTalonSRX.java new file mode 100644 index 00000000..3df2ae38 --- /dev/null +++ b/template_projects/sources/kitbot_2025/src/main/java/frc/robot/subsystems/roller/RollerIOTalonSRX.java @@ -0,0 +1,47 @@ +// Copyright 2021-2025 FRC 6328 +// http://github.com/Mechanical-Advantage +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// version 3 as published by the Free Software Foundation or +// available in the root directory of this project. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +package frc.robot.subsystems.roller; + +import static frc.robot.subsystems.roller.RollerConstants.*; +import static frc.robot.util.PhoenixUtil.tryUntilOkV5; + +import com.ctre.phoenix.motorcontrol.TalonSRXControlMode; +import com.ctre.phoenix.motorcontrol.can.TalonSRX; +import com.ctre.phoenix.motorcontrol.can.TalonSRXConfiguration; + +/** This drive implementation is for a Talon SRX driving a brushed motor. */ +public class RollerIOTalonSRX implements RollerIO { + private final TalonSRX roller = new TalonSRX(rollerCanId); + + public RollerIOTalonSRX() { + var config = new TalonSRXConfiguration(); + config.peakCurrentLimit = currentLimit; + config.continuousCurrentLimit = currentLimit - 15; + config.peakCurrentDuration = 250; + config.voltageCompSaturation = 12.0; + + tryUntilOkV5(5, () -> roller.configAllSettings(config)); + } + + @Override + public void updateInputs(RollerIOInputs inputs) { + inputs.appliedVolts = roller.getMotorOutputVoltage(); + inputs.currentAmps = roller.getStatorCurrent(); + } + + @Override + public void setVoltage(double volts) { + roller.set(TalonSRXControlMode.PercentOutput, volts * 12.0); + } +}