Skip to content

Spindexer Aware Auto #39

@MGross21

Description

@MGross21

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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions