Skip to content

Commit

Permalink
seperate rotation and translation
Browse files Browse the repository at this point in the history
  • Loading branch information
stheyounger authored and stheyounger committed Mar 7, 2024
1 parent 4411425 commit de57248
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions RoboCode/src/main/java/us/brainstormz/robotTwo/RobotTwoAuto.kt
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ class RobotTwoAuto(private val telemetry: Telemetry, private val aprilTagPipelin
),
navigatingTargetSetup(
targetPosition =
startPosition.copy(x= redDistanceFromCenterlineInches - 5, y = 52.0, r = 0.0),
startPosition.copy(x= redDistanceFromCenterlineInches - 5, y = 52.0),
isTargetReached = ::isRobotAtAngle
),
)
Expand All @@ -580,18 +580,22 @@ class RobotTwoAuto(private val telemetry: Telemetry, private val aprilTagPipelin
),
)
}
} + listOf(navigatingTargetSetup(
targetPosition = readyToGoAroundTrussWaypoint,
isTargetReached = { targetState: TargetWorld, actualState: ActualWorld, previousActualState: ActualWorld ->
val isRobotAtPosition = isRobotAtPosition(targetState, actualState, previousActualState)

drivetrain.rotationPID = if (isRobotAtPosition)
drivetrain.rotationOnlyPID
else
drivetrain.rotationWithOtherAxisPID

isRobotAtPosition
}))
} + listOf(
navigatingTargetSetup(
targetPosition = readyToGoAroundTrussWaypoint.copy(r = startPosition.r),
isTargetReached = { targetState: TargetWorld, actualState: ActualWorld, previousActualState: ActualWorld ->
val isRobotAtPosition = isRobotAtPosition(targetState, actualState, previousActualState)
isRobotAtPosition
}),
navigatingTargetSetup(
targetPosition = readyToGoAroundTrussWaypoint,
isTargetReached = { targetState: TargetWorld, actualState: ActualWorld, previousActualState: ActualWorld ->
val isRobotAtPosition = isRobotAtPosition(targetState, actualState, previousActualState)
isRobotAtPosition
}),


)

val driveToBackboard = listOf(
navigatingTargetSetup(targetPosition =
Expand Down

0 comments on commit de57248

Please sign in to comment.