Skip to content

Commit dd6e48a

Browse files
committed
Fix merge issues
1 parent b6e4cf2 commit dd6e48a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

TeamCode/src/main/kotlin/pioneer/decode/GoalTag.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,11 @@ enum class GoalTag(
4747

4848
val shootingHeight = height + 50.0
4949

50-
// Tag pose plus half the goal depth (46.45 cm)
5150
val shootingPose: Pose
5251
get() =
5352
when (this) {
5453
BLUE -> this.pose + Pose(x = -32.0, y = 30.0) // -X +Y
55-
RED -> this.pose + Pose(x = (46.45 / 2) / sqrt(2.0), y = (46.45 / 2) / sqrt(2.0)) // +X +Y //TODO: Update when back at HS
54+
RED -> this.pose + Pose(x = 32.0, y = 30.0) // +X +Y
5655
}
5756
}
5857

TeamCode/src/main/kotlin/pioneer/opmodes/auto/GoalSideAuto.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ class GoalSideAuto : BaseOpMode() {
5656
private var targetVelocity = 0.0
5757
// Motif logic variables
5858
private var motifOrder: Motif = Motif(21)
59-
private var motifIndex = 0
6059
private var lookForTag = true
6160

6261
override fun onInit() {
@@ -95,9 +94,9 @@ class GoalSideAuto : BaseOpMode() {
9594
State.STOP -> state_stop()
9695
}
9796

98-
val target = if (bot.allianceColor == AllianceColor.RED) GoalTag.RED.shootingPose else GoalTag.BLUE.shootingPose
99-
targetVelocity = bot.flywheel!!.estimateVelocity(target, bot.pinpoint!!.pose)
100-
bot.turret?.autoTrack(bot.pinpoint!!.pose, target)
97+
val targetGoal = if (bot.allianceColor == AllianceColor.RED) GoalTag.RED else GoalTag.BLUE
98+
targetVelocity = bot.flywheel!!.estimateVelocity(targetGoal.shootingPose, bot.pinpoint!!.pose, targetGoal.shootingHeight)
99+
bot.turret?.autoTrack(bot.pinpoint!!.pose, targetGoal.shootingPose)
101100

102101
telemetry.addData("Next Artifact", motifOrder.currentArtifact)
103102
telemetry.addData("Detected Motif", motifOrder.toString())

0 commit comments

Comments
 (0)