File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
TeamCode/src/main/kotlin/pioneer Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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())
You can’t perform that action at this time.
0 commit comments