Skip to content

Commit

Permalink
prep for goto avoiding stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
epshteinmatthew committed Dec 28, 2024
1 parent 6f84542 commit 77674cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/kotlin/frc/lib/FieldPositions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import java.util.function.Supplier

//for clarity, blue is the pose of the field element on the blue side, and red is the same but on the red side
data class FieldLocation(val red: Pose2d, val blue: Pose2d)
data class Obstacle(val location: FieldLocation, val radiusMeters: Double)

object FieldPositions {
val speakerCenter = FieldLocation(Pose2d(15.256, 5.547868, 0.0.rotation2dFromDeg()),
Pose2d(1.6096, 5.547868, 180.0.rotation2dFromDeg()))
Expand Down Expand Up @@ -34,7 +36,9 @@ object FieldPositions {
Pose2d(16.185134, 0.883666, 120.0.rotation2dFromDeg())
)

//obstacles do need to be iterated through, but they do not need to have names
val obstacles:Array<Obstacle> = arrayOf(
//list obstacles here...
)

//todo: source, all of the rings
//val source = FieldLocation
}
6 changes: 6 additions & 0 deletions src/main/kotlin/frc/robot/RobotContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ class RobotContainer {
else
goal.blue

//if theres a obstacle in the way:
//find a point that fixes that
//return 2 goto(), one to midpoint and one to endpoint
//this will be hard to do because start position is determined at runtime
//everything else should be easy enough

return SwerveAutoDrive(
to,
Pose2d(0.1, 0.1, 10.0.rotation2dFromDeg()),
Expand Down

0 comments on commit 77674cd

Please sign in to comment.