diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/AprilTagToPose.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/AprilTagToPose.kt index 137c00ed73ff..8e0a597198ff 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/AprilTagToPose.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/AprilTagToPose.kt @@ -1,9 +1,9 @@ package org.firstinspires.ftc.teamcode -import org.firstinspires.ftc.teamcode.odo.Pose -import org.firstinspires.ftc.teamcode.odo.degrees -import org.firstinspires.ftc.teamcode.odo.inches -import org.firstinspires.ftc.teamcode.utility.Vector2 +import org.firstinspires.ftc.teamcode.utilities.Pose +import org.firstinspires.ftc.teamcode.utilities.Vector2 +import org.firstinspires.ftc.teamcode.utilities.degrees +import org.firstinspires.ftc.teamcode.utilities.inches import org.firstinspires.ftc.vision.apriltag.AprilTagDetection import kotlin.math.abs import kotlin.math.cos diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Var.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Var.kt new file mode 100644 index 000000000000..33e6507f3e69 --- /dev/null +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Var.kt @@ -0,0 +1,48 @@ +package org.firstinspires.ftc.teamcode +/* + * Servo rotations: minimum 0.0, maximum 1.0 + */ +/** + * All the things that a driver might need to change, in one place. + */ +object Var { + // Rotations. + + // 'hover' - just above ground + const val CLAW_HOVER_ROTATION = 0.669 + + // 'closing' - touching ground as much as possible without hindering claw operation + const val CLAW_CLOSING_ROTATION = 0.720 + + // 'flipped' - pixel drop-off location + const val CLAW_FLIPPED_ROTATION = 0.069 + + // 'stowed' - straight up or otherwise out of the way + const val CLAW_STOWED_ROTATION = 0.370 + + const val CLAW_OPENED = 0.109 + const val CLAW_CLOSED = 0.432 + + /** + * The rotation of the box in the idle position. + * The box is in the idle position when it is not being dumped, and also when the lift + * is all the way down. Tune (DumperTestBench) with lift at 0 to avoid collisions. + */ + const val BOX_ROTATE_IDLE = 0.531 + + /** + * The rotation of the box in the dumping position. + * Tune with the lift raised by hand. + */ + const val BOX_ROTATE_DUMP = 0.316 + + /** + * Latch position such that it does not block movement of the bottom pixel in the box. + */ + const val BOX_LATCH_UNLATCHED = 0.4 + + /** + * Latch position such that it blocks movement of the bottom pixel in the box. + */ + const val BOX_LATCH_LATCHED = 0.78 +} diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Variables.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Variables.kt deleted file mode 100644 index 2bdf701fb08d..000000000000 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Variables.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.firstinspires.ftc.teamcode - -/* - * Servo rotations: minimum 0.0, maximum 1.0 - */ - -/** - * Claw constants. - */ -object ClawVar { - // Rotations. - - // 'hover' - just above ground - const val HoverRotation = 0.669 - // 'closing' - touching ground as much as possible without hindering claw operation - const val ClosingRotation = 0.720 - // 'flipped' - pixel drop-off location - const val FlippedRotation = 0.069 - // 'stowed' - straight up or otherwise out of the way - const val StowedRotation = 0.370 - - const val ClawOpened = 0.109 - const val ClawClosed = 0.432 -} diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Zoom.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Zoom.java deleted file mode 100644 index 4f6430b638ab..000000000000 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Zoom.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.firstinspires.ftc.teamcode; - -import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; -import com.qualcomm.robotcore.eventloop.opmode.TeleOp; -import com.qualcomm.robotcore.hardware.DcMotor; - -@TeleOp -public class Zoom extends LinearOpMode { - - @Override - public void runOpMode() { - DcMotor daMotor = hardwareMap.get(DcMotor.class, "frontRight"); - daMotor.setPower(0); - waitForStart(); - daMotor.setPower(1); - while (opModeIsActive()) { - sleep(20); - } - daMotor.setPower(0); - - } -} diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/abstractions/Claw.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/abstractions/Claw.kt index 9f702b684800..b720c64394d4 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/abstractions/Claw.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/abstractions/Claw.kt @@ -7,23 +7,29 @@ import dev.aether.collaborative_multitasking.MultitaskScheduler import dev.aether.collaborative_multitasking.SharedResource import dev.aether.collaborative_multitasking.Task import dev.aether.collaborative_multitasking.ext.maxDuration -import org.firstinspires.ftc.teamcode.ClawVar +import org.firstinspires.ftc.teamcode.Var +/** + * This class represents the robot's claw. For manual control of the claw's positions, + * get a reference to the Servo from your RobotConfiguration. + * @see org.firstinspires.ftc.teamcode.configurations.RobotConfiguration.clawGrab + * @see org.firstinspires.ftc.teamcode.configurations.RobotConfiguration.clawRotate + * + * @param scheduler Scheduler used to manage the claw's tasks. If null, then methods relying on + * the scheduler will throw an AssertionError. + * @param grip Servo used to control the claw's grip. + * @param rotate Servo used to control the claw's rotation. + * @param lock SharedResource used to prevent the claw's tasks from running at the same time as another. + */ class Claw( - private val scheduler: MultitaskScheduler, + private val scheduler: MultitaskScheduler?, @JvmField val grip: Servo, @JvmField val rotate: Servo, private val lock: SharedResource, ) { - companion object { - // Try to avoid changing these here. Instead, change them in Variables.kt. - const val ROTATE_HOVER = ClawVar.HoverRotation - const val ROTATE_CLOSING = ClawVar.ClosingRotation - const val ROTATE_FLIP = ClawVar.FlippedRotation - const val ROTATE_STOW = ClawVar.StowedRotation - const val GRIP_OPEN = ClawVar.ClawOpened - const val GRIP_CLOSED = ClawVar.ClawClosed + constructor(grip: Servo, rotate: Servo, lock: SharedResource) : this(null, grip, rotate, lock) + companion object { // TODO trim timings const val CloseRotateTime = 100 // ms const val GripTime = 450 // ms @@ -46,7 +52,14 @@ class Claw( private var clawState: StateV2 = StateV2.Hover + + /** + * Schedule a task to grab an item with the claw. + * Action is automatically cancelled if the claw is already in use. + */ fun grab() { + scheduler + ?: throw AssertionError("The Claw instance needs to be defined with a scheduler to use this method") if (scheduler.isResourceInUse(lock)) return // (dep: hover) open -> grab -> hover var base: Task? = null @@ -55,21 +68,27 @@ class Claw( +lock onStart { -> clawState = StateV2.Active - grip.position = GRIP_OPEN - rotate.position = ROTATE_CLOSING + grip.position = Var.CLAW_OPENED + rotate.position = Var.CLAW_CLOSING_ROTATION } maxDuration(FlipTime) }.then { +lock onStart { -> - grip.position = GRIP_CLOSED + grip.position = Var.CLAW_CLOSED } maxDuration(GripTime) }.then(gotoHover()) base?.then(main) } + /** + * Schedule a task to drop the item that is currently in the claw into the box. + * Action is automatically cancelled if the claw is already in use. + */ fun deposit() { + scheduler + ?: throw AssertionError("The Claw instance needs to be defined with a scheduler to use this method") if (scheduler.isResourceInUse(lock)) return // (dep: hover) -> deposit -> stowed var base: Task? = null @@ -78,19 +97,19 @@ class Claw( +lock onStart { -> clawState = StateV2.Active - rotate.position = ROTATE_FLIP + rotate.position = Var.CLAW_FLIPPED_ROTATION } maxDuration(FlipTime) }.then { +lock onStart { -> - grip.position = GRIP_OPEN + grip.position = Var.CLAW_OPENED } maxDuration(GripTime) }.then { +lock onStart { -> - rotate.position = ROTATE_STOW + rotate.position = Var.CLAW_STOWED_ROTATION } maxDuration(FlipTime) onFinish { -> @@ -100,18 +119,30 @@ class Claw( base?.then(main) } + /** + * Schedule a task to move the claw to the hovering position. + * Action is automatically cancelled if the claw is already in use. + */ fun resetTele() { + scheduler + ?: throw AssertionError("The Claw instance needs to be defined with a scheduler to use this method") if (scheduler.isResourceInUse(lock)) return // (hover and open) reset() } + + /** + * Schedule a task to move the claw to the hovering position. + */ fun reset(): Task { + scheduler + ?: throw AssertionError("The Claw instance needs to be defined with a scheduler to use this method") return scheduler.task { +lock onStart { -> clawState = StateV2.Active - grip.position = GRIP_OPEN - rotate.position = ROTATE_HOVER + grip.position = Var.CLAW_OPENED + rotate.position = Var.CLAW_HOVER_ROTATION } maxDuration(FlipTime) onFinish { -> @@ -121,10 +152,12 @@ class Claw( } private fun gotoHover(): Task { + scheduler + ?: throw AssertionError("The Claw instance needs to be defined with a scheduler to use this method") return scheduler.task { +lock onStart { -> - rotate.position = ROTATE_HOVER + rotate.position = Var.CLAW_HOVER_ROTATION } maxDuration(FlipTime) onFinish { -> @@ -133,13 +166,18 @@ class Claw( } } + /** + * WIP; schedules a task to open the claw. + */ fun release(): Task { + scheduler + ?: throw AssertionError("The Claw instance needs to be defined with a scheduler to use this method") var base: Task? = null if (clawState != StateV2.Hover) base = gotoHover() val ext = scheduler.task { +lock onStart { -> - grip.position = GRIP_OPEN + grip.position = Var.CLAW_OPENED } maxDuration(GripTime) } diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/abstractions/Dumper.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/abstractions/Dumper.kt index f05e24fe64a4..508cf8ce6a1f 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/abstractions/Dumper.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/abstractions/Dumper.kt @@ -3,6 +3,7 @@ package org.firstinspires.ftc.teamcode.abstractions import dev.aether.collaborative_multitasking.MultitaskScheduler import dev.aether.collaborative_multitasking.Task import dev.aether.collaborative_multitasking.ext.maxDuration +import org.firstinspires.ftc.teamcode.Var import org.firstinspires.ftc.teamcode.configurations.RobotConfiguration class Dumper( @@ -16,11 +17,6 @@ class Dumper( private val lock = config.dumperLock companion object { - const val ROTATE_IDLE = 0.531 - const val ROTATE_DUMP = 0.316 - const val UNLATCHED = 0.4 - const val LATCHED = 0.78 - // TODO trim timings const val RotateTime = 1000 // ms const val LatchTime = 200 // ms @@ -41,8 +37,8 @@ class Dumper( +lock onStart { -> dumperState = State.Dump - rotate.position = ROTATE_DUMP - latch.position = LATCHED + rotate.position = Var.BOX_ROTATE_DUMP + latch.position = Var.BOX_LATCH_LATCHED } maxDuration(RotateTime) } @@ -55,8 +51,8 @@ class Dumper( +lock onStart { -> dumperState = State.Dump - rotate.position = ROTATE_DUMP - latch.position = LATCHED + rotate.position = Var.BOX_ROTATE_DUMP + latch.position = Var.BOX_LATCH_LATCHED } maxDuration(RotateTime) } @@ -65,7 +61,7 @@ class Dumper( +lock onStart { -> dumperState = State.Dump2 - latch.position = UNLATCHED + latch.position = Var.BOX_LATCH_UNLATCHED } maxDuration(LatchTime) } @@ -78,8 +74,8 @@ class Dumper( +lock onStart { -> dumperState = State.Idle - rotate.position = ROTATE_IDLE - latch.position = LATCHED + rotate.position = Var.BOX_ROTATE_IDLE + latch.position = Var.BOX_LATCH_LATCHED } maxDuration(RotateTime) } diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/configurations/NeoRobot1.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/configurations/Robot.kt similarity index 94% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/configurations/NeoRobot1.kt rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/configurations/Robot.kt index 35c082e1aec2..622c05aeb9af 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/configurations/NeoRobot1.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/configurations/Robot.kt @@ -5,10 +5,10 @@ import com.qualcomm.robotcore.hardware.DcMotorSimple import com.qualcomm.robotcore.hardware.HardwareMap import com.qualcomm.robotcore.hardware.Servo import dev.aether.collaborative_multitasking.SharedResource -import org.firstinspires.ftc.teamcode.utility.MotorSet -import org.firstinspires.ftc.teamcode.utility.typedGet +import org.firstinspires.ftc.teamcode.utilities.MotorSet +import org.firstinspires.ftc.teamcode.utilities.typedGet -class NeoRobot1(map: HardwareMap) : RobotConfiguration() { +class Robot(map: HardwareMap) : RobotConfiguration() { @JvmField var frontLeft // 0 : DcMotor = map.typedGet("frontLeft") diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/configurations/RobotConfiguration.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/configurations/RobotConfiguration.kt index b8fb68da22da..dd63f1a4b355 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/configurations/RobotConfiguration.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/configurations/RobotConfiguration.kt @@ -5,12 +5,12 @@ import com.qualcomm.robotcore.hardware.HardwareMap import com.qualcomm.robotcore.hardware.Servo import dev.aether.collaborative_multitasking.SharedResource import org.firstinspires.ftc.robotcore.external.Telemetry -import org.firstinspires.ftc.teamcode.utility.MotorSet +import org.firstinspires.ftc.teamcode.utilities.MotorSet abstract class RobotConfiguration { companion object { @JvmStatic - fun currentConfiguration(): (HardwareMap) -> RobotConfiguration = ::NeoRobot1 + fun currentConfiguration(): (HardwareMap) -> RobotConfiguration = ::Robot } protected abstract val driveMotors: MotorSet? diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/configurations/RobotLocks.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/configurations/RobotLocks.kt deleted file mode 100644 index 7bca7e15e917..000000000000 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/configurations/RobotLocks.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.firstinspires.ftc.teamcode.configurations - -import dev.aether.collaborative_multitasking.SharedResource - -object RobotLocks { - @Deprecated("Use a RobotConfiguration's locks for panic support.") - val driveMotors = SharedResource("driveMotors") -} \ No newline at end of file diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/OdoTracker.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/OdoTracker.kt index ead9774fc31d..d0045546c501 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/OdoTracker.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/OdoTracker.kt @@ -3,6 +3,9 @@ package org.firstinspires.ftc.teamcode.odo import com.qualcomm.robotcore.hardware.DcMotor import com.qualcomm.robotcore.util.ElapsedTime import dev.aether.collaborative_multitasking.Task +import org.firstinspires.ftc.teamcode.utilities.LengthUnit +import org.firstinspires.ftc.teamcode.utilities.Pose +import org.firstinspires.ftc.teamcode.utilities.inches import java.util.concurrent.TimeUnit class OdoTracker(val odoPerp: DcMotor, val odoPara1: DcMotor, val odoPara2: DcMotor, val origin: Pose) { diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/AprilTagSample.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/AprilTagSample.java similarity index 99% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/AprilTagSample.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/AprilTagSample.java index 4df7222bdf64..a8d9daa0c0cd 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/AprilTagSample.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/AprilTagSample.java @@ -27,7 +27,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.opmodes; import android.annotation.SuppressLint; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ClawTestBench.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/ClawTestBench.java similarity index 96% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ClawTestBench.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/ClawTestBench.java index 83c9a417dbbe..5710ebb9450f 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ClawTestBench.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/ClawTestBench.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.opmodes; import static androidx.core.math.MathUtils.clamp; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Crab.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/Crab.java similarity index 99% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Crab.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/Crab.java index afbde3658966..8b2d444d2fbc 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Crab.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/Crab.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.opmodes; import com.qualcomm.hardware.rev.RevHubOrientationOnRobot; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DetectTags.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DetectTags.java similarity index 95% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DetectTags.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DetectTags.java index 8befcad7d4f8..cb8b9467af37 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DetectTags.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DetectTags.java @@ -1,6 +1,6 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.opmodes; -import static org.firstinspires.ftc.teamcode.utility.CollectionUtils.pairs; +import static org.firstinspires.ftc.teamcode.utilities.CollectionUtils.pairs; import android.util.Pair; import android.util.Size; @@ -11,8 +11,9 @@ import com.qualcomm.robotcore.eventloop.opmode.TeleOp; import org.firstinspires.ftc.robotcore.external.hardware.camera.WebcamName; -import org.firstinspires.ftc.teamcode.odo.Pose; -import org.firstinspires.ftc.teamcode.utility.Vector2; +import org.firstinspires.ftc.teamcode.AprilTagToPoseKt; +import org.firstinspires.ftc.teamcode.utilities.Pose; +import org.firstinspires.ftc.teamcode.utilities.Vector2; import org.firstinspires.ftc.vision.VisionPortal; import org.firstinspires.ftc.vision.apriltag.AprilTagDetection; import org.firstinspires.ftc.vision.apriltag.AprilTagGameDatabase; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DirtyStrafeToParkingZone.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DirtyStrafeToParkingZone.java similarity index 94% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DirtyStrafeToParkingZone.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DirtyStrafeToParkingZone.java index ae918de5e57a..cb29659b31ee 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DirtyStrafeToParkingZone.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DirtyStrafeToParkingZone.java @@ -1,12 +1,11 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.opmodes; import com.qualcomm.robotcore.eventloop.opmode.Autonomous; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; -import com.qualcomm.robotcore.eventloop.opmode.TeleOp; import com.qualcomm.robotcore.hardware.DcMotor; import org.firstinspires.ftc.teamcode.configurations.RobotConfiguration; -import org.firstinspires.ftc.teamcode.utility.MotorSet; +import org.firstinspires.ftc.teamcode.utilities.MotorSet; @Autonomous public class DirtyStrafeToParkingZone extends LinearOpMode { diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DriveToTagAuto.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DriveToTagAuto.java similarity index 93% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DriveToTagAuto.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DriveToTagAuto.java index ff7d9f3ef8b0..911fe4fd6227 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DriveToTagAuto.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DriveToTagAuto.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.opmodes; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DriveToTagBacking.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DriveToTagBacking.kt similarity index 89% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DriveToTagBacking.kt rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DriveToTagBacking.kt index 08618344fec0..cfb67b02ea29 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DriveToTagBacking.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DriveToTagBacking.kt @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode +package org.firstinspires.ftc.teamcode.opmodes import android.util.Size import com.qualcomm.robotcore.hardware.Gamepad @@ -8,13 +8,16 @@ import dev.aether.collaborative_multitasking.ext.minTicks import org.firstinspires.ftc.robotcore.external.Telemetry import org.firstinspires.ftc.robotcore.external.hardware.camera.CameraName import org.firstinspires.ftc.teamcode.configurations.RobotConfiguration -import org.firstinspires.ftc.teamcode.odo.Pose -import org.firstinspires.ftc.teamcode.odo.degrees -import org.firstinspires.ftc.teamcode.odo.inches -import org.firstinspires.ftc.teamcode.odo.radians -import org.firstinspires.ftc.teamcode.utility.CollectionUtils.pairs -import org.firstinspires.ftc.teamcode.utility.MotorSet -import org.firstinspires.ftc.teamcode.utility.typedGet +import org.firstinspires.ftc.teamcode.detectPairToPose +import org.firstinspires.ftc.teamcode.detectSingleToPose +import org.firstinspires.ftc.teamcode.utilities.Pose +import org.firstinspires.ftc.teamcode.utilities.degrees +import org.firstinspires.ftc.teamcode.utilities.inches +import org.firstinspires.ftc.teamcode.utilities.radians +import org.firstinspires.ftc.teamcode.tagPositions +import org.firstinspires.ftc.teamcode.utilities.CollectionUtils.pairs +import org.firstinspires.ftc.teamcode.utilities.MotorSet +import org.firstinspires.ftc.teamcode.utilities.typedGet import org.firstinspires.ftc.vision.VisionPortal import org.firstinspires.ftc.vision.apriltag.AprilTagProcessor import kotlin.math.abs diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DumperTestBench.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DumperTestBench.java similarity index 96% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DumperTestBench.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DumperTestBench.java index f873f8d206d9..734f3575ae2d 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/DumperTestBench.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/DumperTestBench.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.opmodes; import static androidx.core.math.MathUtils.clamp; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ExampleScheduledAuto.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/ExampleScheduledAuto.java similarity index 97% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ExampleScheduledAuto.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/ExampleScheduledAuto.java index a966c043e852..0364c8d2a393 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/ExampleScheduledAuto.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/ExampleScheduledAuto.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.opmodes; import static dev.aether.collaborative_multitasking.KotlinHelper.kbu; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/GenericDRAuto.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/GenericDRAuto.java similarity index 94% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/GenericDRAuto.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/GenericDRAuto.java index 82e3d7707f75..ac62b6ae06e9 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/GenericDRAuto.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/GenericDRAuto.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.opmodes; import com.qualcomm.robotcore.eventloop.opmode.Autonomous; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/GenericDRAutoB.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/GenericDRAutoB.kt similarity index 92% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/GenericDRAutoB.kt rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/GenericDRAutoB.kt index 35105df24920..c705d44f3b46 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/GenericDRAutoB.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/GenericDRAutoB.kt @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode +package org.firstinspires.ftc.teamcode.opmodes import com.qualcomm.robotcore.hardware.IMU import dev.aether.collaborative_multitasking.MultitaskScheduler @@ -7,9 +7,9 @@ import dev.aether.collaborative_multitasking.ext.maxDuration import org.firstinspires.ftc.robotcore.external.navigation.AngleUnit import org.firstinspires.ftc.teamcode.abstractions.Claw import org.firstinspires.ftc.teamcode.configurations.RobotConfiguration -import org.firstinspires.ftc.teamcode.odo.RotationUnit -import org.firstinspires.ftc.teamcode.odo.degrees -import org.firstinspires.ftc.teamcode.utility.MotorPowers +import org.firstinspires.ftc.teamcode.utilities.MotorPowers +import org.firstinspires.ftc.teamcode.utilities.RotationUnit +import org.firstinspires.ftc.teamcode.utilities.degrees /** * @param imu IMU in degrees, reset to 0 diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MoveSlidesToHang.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/MoveSlidesToHang.java similarity index 96% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MoveSlidesToHang.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/MoveSlidesToHang.java index 70e1fa268c78..4b49bf12baed 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/MoveSlidesToHang.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/MoveSlidesToHang.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.opmodes; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/README.md b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/README.md new file mode 100644 index 000000000000..addc49b5509e --- /dev/null +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/README.md @@ -0,0 +1,5 @@ +# opmodes + +this is where the opmodes go. if the class has `@TeleOp` or `@Autonomous` it goes here. + +also put any files that are *closely linked* with opmodes here - i.e. they're only used in one opmode. diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/TFODObjectDetectionSpikes.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/TFODObjectDetectionSpikes.java similarity index 97% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/TFODObjectDetectionSpikes.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/TFODObjectDetectionSpikes.java index 2cdb5046554e..8cf42d8b6516 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/TFODObjectDetectionSpikes.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/TFODObjectDetectionSpikes.java @@ -1,9 +1,8 @@ -package org.firstinspires.ftc.teamcode.utility; +package org.firstinspires.ftc.teamcode.opmodes; import com.qualcomm.robotcore.eventloop.opmode.Autonomous; -import com.qualcomm.robotcore.eventloop.opmode.Disabled; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; -import com.qualcomm.robotcore.eventloop.opmode.TeleOp; + import org.firstinspires.ftc.robotcore.external.hardware.camera.BuiltinCameraDirection; import org.firstinspires.ftc.robotcore.external.hardware.camera.WebcamName; import org.firstinspires.ftc.robotcore.external.tfod.Recognition; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TeleOp.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/TeleOp.java similarity index 98% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TeleOp.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/TeleOp.java index 756c5cc5c31e..edbf8d03e2c4 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/TeleOp.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/TeleOp.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode; +package org.firstinspires.ftc.teamcode.opmodes; import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode; import com.qualcomm.robotcore.hardware.DcMotor; @@ -7,7 +7,7 @@ import org.firstinspires.ftc.teamcode.abstractions.Claw; import org.firstinspires.ftc.teamcode.abstractions.Dumper; import org.firstinspires.ftc.teamcode.configurations.RobotConfiguration; -import org.firstinspires.ftc.teamcode.utility.MotorSet; +import org.firstinspires.ftc.teamcode.utilities.MotorSet; import dev.aether.collaborative_multitasking.MultitaskScheduler; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/WhitePixelSpikeDetection.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/WhitePixelSpikeDetection.java similarity index 99% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/WhitePixelSpikeDetection.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/WhitePixelSpikeDetection.java index 4096c904e394..08b1861f8db4 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/WhitePixelSpikeDetection.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmodes/WhitePixelSpikeDetection.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.utility; +package org.firstinspires.ftc.teamcode.opmodes; import android.util.Size; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/CollectionUtils.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/CollectionUtils.java similarity index 95% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/CollectionUtils.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/CollectionUtils.java index 6d55c3a4ccdf..a170f0f32601 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/CollectionUtils.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/CollectionUtils.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.utility; +package org.firstinspires.ftc.teamcode.utilities; import android.util.Pair; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/KotlinHardwareMapExtensions.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/KotlinHardwareMapExtensions.kt similarity index 79% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/KotlinHardwareMapExtensions.kt rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/KotlinHardwareMapExtensions.kt index cac6ad0185ba..5b41d2a9f079 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/KotlinHardwareMapExtensions.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/KotlinHardwareMapExtensions.kt @@ -1,7 +1,6 @@ -package org.firstinspires.ftc.teamcode.utility +package org.firstinspires.ftc.teamcode.utilities import com.qualcomm.robotcore.hardware.HardwareMap -import java.lang.IllegalArgumentException inline fun HardwareMap.typedGet(name: String): T { return this.get(T::class.java, name) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/LengthUnit.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/LengthUnit.kt similarity index 97% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/LengthUnit.kt rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/LengthUnit.kt index 450abdf5db5c..8f0d5bdb86cf 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/LengthUnit.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/LengthUnit.kt @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.odo +package org.firstinspires.ftc.teamcode.utilities abstract class LengthUnit(value: Double) : MeasureUnit(value) { diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/Line.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/Line.java similarity index 96% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/Line.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/Line.java index 6fceb729dd1e..043a5cb40d1f 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/Line.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/Line.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.utility; +package org.firstinspires.ftc.teamcode.utilities; public interface Line { double perpendicularSlope(); diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/MeasureUnit.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/MeasureUnit.kt similarity index 96% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/MeasureUnit.kt rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/MeasureUnit.kt index 57fda55accc3..7d78e760bd7f 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/MeasureUnit.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/MeasureUnit.kt @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.odo +package org.firstinspires.ftc.teamcode.utilities abstract class Converter diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/MotorPowers.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/MotorPowers.kt similarity index 97% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/MotorPowers.kt rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/MotorPowers.kt index eec75082bf44..1e5601a2e1de 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/MotorPowers.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/MotorPowers.kt @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.utility +package org.firstinspires.ftc.teamcode.utilities import com.qualcomm.robotcore.hardware.DcMotor import kotlin.math.abs diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/Pose.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/Pose.kt similarity index 96% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/Pose.kt rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/Pose.kt index 544394e7458a..bac1664a28bb 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/Pose.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/Pose.kt @@ -1,9 +1,7 @@ @file:Suppress("unused") -package org.firstinspires.ftc.teamcode.odo +package org.firstinspires.ftc.teamcode.utilities -import org.firstinspires.ftc.teamcode.utility.MotorPowers -import org.firstinspires.ftc.teamcode.utility.Vector2 import kotlin.math.PI import kotlin.math.abs import kotlin.math.cos diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/README.md b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/README.md new file mode 100644 index 000000000000..141479b2e5b2 --- /dev/null +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/README.md @@ -0,0 +1,14 @@ +# utilities + +utilities are classes that aren't necessarily immediately related to robot operation, but are useful +for other things. + +## things that are utilities +- generic code for manipulating data structures, like `CollectionUtils` +- data structures not directly related to robot hardware, like `MeasureUnit`, `Vector2`, and `Pose` +- maybe some other stuff + +## things that are *not* utilities +- opmodes. use the `opmodes` folder for those. +- robot hardware. if it's an abstraction over a specific part of the robot, use `abstractions`. if it's a + hardware configuration interface, use `configurations`. diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/RotationUnit.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/RotationUnit.kt similarity index 98% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/RotationUnit.kt rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/RotationUnit.kt index aade91932ee4..91e3681a2701 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/odo/RotationUnit.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/RotationUnit.kt @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.odo +package org.firstinspires.ftc.teamcode.utilities import kotlin.math.PI diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/StandardLine.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/StandardLine.java similarity index 96% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/StandardLine.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/StandardLine.java index f89a40d272bc..b74462ec52e2 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/StandardLine.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/StandardLine.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.utility; +package org.firstinspires.ftc.teamcode.utilities; public class StandardLine implements Line { private final double slope; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/Vector2.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/Vector2.java similarity index 93% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/Vector2.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/Vector2.java index fdc2b5a5a76f..d15fa869d84c 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/Vector2.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/Vector2.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.utility; +package org.firstinspires.ftc.teamcode.utilities; import androidx.annotation.NonNull; diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/VerticalLine.java b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/VerticalLine.java similarity index 95% rename from TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/VerticalLine.java rename to TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/VerticalLine.java index 431b8d6a3175..ffd2076e5bcd 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utility/VerticalLine.java +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/utilities/VerticalLine.java @@ -1,4 +1,4 @@ -package org.firstinspires.ftc.teamcode.utility; +package org.firstinspires.ftc.teamcode.utilities; /** * A special case of a line that is vertical. diff --git a/TeamCode/src/test/java/org/firstinspires/ftc/tests/TestDriveToTag.kt b/TeamCode/src/test/java/org/firstinspires/ftc/tests/TestDriveToTag.kt index 28e21d32d02f..6faae0a8276c 100644 --- a/TeamCode/src/test/java/org/firstinspires/ftc/tests/TestDriveToTag.kt +++ b/TeamCode/src/test/java/org/firstinspires/ftc/tests/TestDriveToTag.kt @@ -1,13 +1,13 @@ package org.firstinspires.ftc.tests -import org.firstinspires.ftc.teamcode.DriveToTagBacking -import org.firstinspires.ftc.teamcode.DriveToTagBacking.Companion.MAX_SPEED -import org.firstinspires.ftc.teamcode.DriveToTagBacking.Companion.MIN_SPEED -import org.firstinspires.ftc.teamcode.DriveToTagBacking.Companion.STOPPING_ANGLE -import org.firstinspires.ftc.teamcode.DriveToTagBacking.Companion.THRESHOLD_ANGLE -import org.firstinspires.ftc.teamcode.DriveToTagBacking.Companion.THRESHOLD_DISTANCE -import org.firstinspires.ftc.teamcode.DriveToTagBacking.Companion.cvtAngleToPower -import org.firstinspires.ftc.teamcode.DriveToTagBacking.Companion.cvtRangeToPower +import org.firstinspires.ftc.teamcode.opmodes.DriveToTagBacking +import org.firstinspires.ftc.teamcode.opmodes.DriveToTagBacking.Companion.MAX_SPEED +import org.firstinspires.ftc.teamcode.opmodes.DriveToTagBacking.Companion.MIN_SPEED +import org.firstinspires.ftc.teamcode.opmodes.DriveToTagBacking.Companion.STOPPING_ANGLE +import org.firstinspires.ftc.teamcode.opmodes.DriveToTagBacking.Companion.THRESHOLD_ANGLE +import org.firstinspires.ftc.teamcode.opmodes.DriveToTagBacking.Companion.THRESHOLD_DISTANCE +import org.firstinspires.ftc.teamcode.opmodes.DriveToTagBacking.Companion.cvtAngleToPower +import org.firstinspires.ftc.teamcode.opmodes.DriveToTagBacking.Companion.cvtRangeToPower import kotlin.math.abs import kotlin.test.Test diff --git a/TeamCode/src/test/java/org/firstinspires/ftc/tests/TestPose.kt b/TeamCode/src/test/java/org/firstinspires/ftc/tests/TestPose.kt index 0ff88c423f19..f2a2d31164f1 100644 --- a/TeamCode/src/test/java/org/firstinspires/ftc/tests/TestPose.kt +++ b/TeamCode/src/test/java/org/firstinspires/ftc/tests/TestPose.kt @@ -1,10 +1,10 @@ package org.firstinspires.ftc.tests -import org.firstinspires.ftc.teamcode.odo.MeasureUnit -import org.firstinspires.ftc.teamcode.odo.Pose -import org.firstinspires.ftc.teamcode.odo.degrees -import org.firstinspires.ftc.teamcode.odo.feet -import org.firstinspires.ftc.teamcode.odo.inches +import org.firstinspires.ftc.teamcode.utilities.MeasureUnit +import org.firstinspires.ftc.teamcode.utilities.Pose +import org.firstinspires.ftc.teamcode.utilities.degrees +import org.firstinspires.ftc.teamcode.utilities.feet +import org.firstinspires.ftc.teamcode.utilities.inches import kotlin.math.abs import kotlin.math.sqrt import kotlin.test.Test