If we perform GOTO_COLLECT -> COLLECT and Spindexer.isEmpty, we need to skip SHOOT and go to next GOTO_COLLECT.
|
// Main state for auto |
|
enum class State { |
|
GOTO_SHOOT, |
|
SHOOT, |
|
GOTO_COLLECT, |
|
COLLECT, |
|
STOP |
|
} |
|
|
|
// State for which line of artifacts to collect |
|
enum class CollectState { |
|
GOAL, |
|
MID, |
|
AUDIENCE, |
|
DONE |
|
} |
|
val START_GOAL = Pose(130.0, 137.0, 0.0).T(color) |
|
|
|
val SHOOT_GOAL_CLOSE = Pose(60.0, 60.0, 0.0).T(color) |
|
|
|
private fun collectY(i: Int) = 30 - (i * 60.0) // 30, -30, -90 |
|
|
|
private val prepCollectX = 70.0 |
|
private val collectTheta = -PI / 2 // Point to right |
|
val PREP_COLLECT_GOAL = Pose(prepCollectX, collectY(0), collectTheta).T(color) |
|
val PREP_COLLECT_MID = Pose(prepCollectX, collectY(1), collectTheta).T(color) |
|
val PREP_COLLECT_AUDIENCE = Pose(prepCollectX, collectY(2), collectTheta).T(color) |
|
|
|
private val collectX = 130.0 |
|
val COLLECT_GOAL = Pose(collectX, collectY(0), collectTheta).T(color) |
|
val COLLECT_MID = Pose(collectX, collectY(1), collectTheta).T(color) |
|
val COLLECT_AUDIENCE = Pose(collectX, collectY(2), collectTheta).T(color) |
If we perform
GOTO_COLLECT -> COLLECTandSpindexer.isEmpty, we need to skipSHOOTand go to nextGOTO_COLLECT.MissionDecodeTheFinalCodePartOne2025-2026/TeamCode/src/main/kotlin/pioneer/opmodes/auto/RedGoalSideAuto.kt
Lines 28 to 43 in d4b5c6d
MissionDecodeTheFinalCodePartOne2025-2026/TeamCode/src/main/kotlin/pioneer/decode/Points.kt
Lines 38 to 53 in d4b5c6d