From fdcb4b153113c796a908c8abbf23722024c37969 Mon Sep 17 00:00:00 2001 From: cadence <117321183+cadenceforney@users.noreply.github.com> Date: Sun, 3 Dec 2023 17:50:30 -0500 Subject: [PATCH 01/16] Box API initialized servos created functions to move box --- .../org/firstinspires/ftc/teamcode/api/Box.kt | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt new file mode 100644 index 00000000..e921bde9 --- /dev/null +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt @@ -0,0 +1,51 @@ +package org.firstinspires.ftc.teamcode.api + +import com.qualcomm.robotcore.eventloop.opmode.OpMode +import com.qualcomm.robotcore.hardware.DcMotor +import com.qualcomm.robotcore.hardware.Servo + +object Box : API() { + + private lateinit var boxL: Servo + private lateinit var boxR: Servo + private lateinit var grip: Servo + + override fun init(opMode : OpMode) { + + super.init(opMode) + + this.boxL = this.hardwareMap.get(Servo::class.java, "boxL") + this.boxR = this.hardwareMap.get(Servo::class.java, "boxR") + this.grip = this.hardwareMap.get(Servo::class.java, "grip") + } + + /* + * Moves the box to the ground + */ + fun dropBox() { + boxL.position = 90.0 + boxR.position = 90.0 + } + + /* + * Moves box to upright position + */ + fun pickUpBox() { + boxL.position = 0.0 + boxL.position = 0.0 + } + + /* + * Moves the grip to keep pixels in place when [pickUpBox] the box + */ + fun gripIn() { + grip.position = 20.0 + } + + /* + * Resets the grip to starting position + */ + fun gripOut() { + grip.position = 0.0 + } +} \ No newline at end of file From e9b0074d3425c7de93737bc2dba1e23378295bec Mon Sep 17 00:00:00 2001 From: cadence <117321183+cadenceforney@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:57:58 -0500 Subject: [PATCH 02/16] rebind slow mode Ben requested formally that we rebind the slowmode button --- .../org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt index d17ca103..105d6ff8 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt @@ -43,7 +43,7 @@ object TeleOpMovement : Component { var joyMagnitude = sqrt(joyY * joyY + joyX * joyX) // if the right bumper is pressed move slower - if (gamepad.right_bumper) { + if (gamepad.y) { joyMagnitude *= SLOW_MULTIPLIER } From 8e481b3746d4c2ec92b7d89ba7cc1db291e64699 Mon Sep 17 00:00:00 2001 From: cadence <117321183+cadenceforney@users.noreply.github.com> Date: Wed, 6 Dec 2023 19:04:07 -0500 Subject: [PATCH 03/16] Box and Gripper Movement Adds gamepad functionality to the box --- .../ftc/teamcode/components/TeleOpMovement.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt index 105d6ff8..6b9e3fcf 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt @@ -1,6 +1,7 @@ package org.firstinspires.ftc.teamcode.components import com.qualcomm.robotcore.eventloop.opmode.OpMode +import org.firstinspires.ftc.teamcode.api.Box import org.firstinspires.ftc.teamcode.api.TeleOpState import org.firstinspires.ftc.teamcode.api.TriWheels import kotlin.math.PI @@ -47,6 +48,22 @@ object TeleOpMovement : Component { joyMagnitude *= SLOW_MULTIPLIER } + // Inputs for the gripper on the box + if (gamepad.left_bumper) { + Box.gripIn() + } + if (gamepad.right_bumper) { + Box.gripOut() + } + + // Inputs for the movement of the box + if (gamepad.a) { + Box.dropBox() + } + if (gamepad.b) { + Box.pickUpBox() + } + // movement of all wheels TriWheels.driveWithRotation(joyRadians, joyMagnitude, rotationPower) } From 1563eafc3448d4d4979c2414bc2c893ce22d888b Mon Sep 17 00:00:00 2001 From: cadence <117321183+cadenceforney@users.noreply.github.com> Date: Wed, 6 Dec 2023 20:31:41 -0500 Subject: [PATCH 04/16] position update Changed position to represent the 0 to 1 scale used for servos --- .../src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt index e921bde9..29ebf8a8 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt @@ -23,8 +23,8 @@ object Box : API() { * Moves the box to the ground */ fun dropBox() { - boxL.position = 90.0 - boxR.position = 90.0 + boxL.position = 0.5 + boxR.position = 0.5 } /* @@ -39,7 +39,7 @@ object Box : API() { * Moves the grip to keep pixels in place when [pickUpBox] the box */ fun gripIn() { - grip.position = 20.0 + grip.position = 0.2 } /* From 4e3d91ea6c36c2f9c0c0af51a097eb6cd73c64fb Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:18:02 -0500 Subject: [PATCH 05/16] chore: format box api --- .../org/firstinspires/ftc/teamcode/api/Box.kt | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt index 29ebf8a8..f0ad98af 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt @@ -1,17 +1,14 @@ package org.firstinspires.ftc.teamcode.api import com.qualcomm.robotcore.eventloop.opmode.OpMode -import com.qualcomm.robotcore.hardware.DcMotor import com.qualcomm.robotcore.hardware.Servo object Box : API() { - private lateinit var boxL: Servo private lateinit var boxR: Servo private lateinit var grip: Servo - override fun init(opMode : OpMode) { - + override fun init(opMode: OpMode) { super.init(opMode) this.boxL = this.hardwareMap.get(Servo::class.java, "boxL") @@ -19,33 +16,33 @@ object Box : API() { this.grip = this.hardwareMap.get(Servo::class.java, "grip") } - /* - * Moves the box to the ground - */ + /** + * Moves the box to the ground + */ fun dropBox() { boxL.position = 0.5 boxR.position = 0.5 } - /* - * Moves box to upright position - */ + /** + * Moves box to upright position + */ fun pickUpBox() { boxL.position = 0.0 boxL.position = 0.0 } - /* - * Moves the grip to keep pixels in place when [pickUpBox] the box - */ + /** + * Moves the grip to keep pixels in place when [pickUpBox] the box + */ fun gripIn() { grip.position = 0.2 } - /* - * Resets the grip to starting position - */ + /** + * Resets the grip to starting position + */ fun gripOut() { grip.position = 0.0 } -} \ No newline at end of file +} From b08fa1b59eae49fae21285293731ec018b7fe3b0 Mon Sep 17 00:00:00 2001 From: cadence <117321183+cadenceforney@users.noreply.github.com> Date: Sun, 10 Dec 2023 16:47:00 -0500 Subject: [PATCH 06/16] documentation changes added more descriptions fixed logic error --- .../org/firstinspires/ftc/teamcode/api/Box.kt | 22 +++++++++++-------- .../ftc/teamcode/components/TeleOpMovement.kt | 6 ++--- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt index f0ad98af..ac1f232f 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt @@ -3,7 +3,11 @@ package org.firstinspires.ftc.teamcode.api import com.qualcomm.robotcore.eventloop.opmode.OpMode import com.qualcomm.robotcore.hardware.Servo +/** + * An API for controlling the Box on the robot. + * */ object Box : API() { + private lateinit var boxL: Servo private lateinit var boxR: Servo private lateinit var grip: Servo @@ -17,32 +21,32 @@ object Box : API() { } /** - * Moves the box to the ground - */ + * Moves the box to the ground + */ fun dropBox() { boxL.position = 0.5 boxR.position = 0.5 } /** - * Moves box to upright position - */ + * Moves box to upright position + */ fun pickUpBox() { boxL.position = 0.0 boxL.position = 0.0 } /** - * Moves the grip to keep pixels in place when [pickUpBox] the box - */ + * Moves the grip to keep pixels in place when [pickUpBox] the box + */ fun gripIn() { grip.position = 0.2 } /** - * Resets the grip to starting position - */ + * Resets the grip to starting position + */ fun gripOut() { grip.position = 0.0 } -} +} \ No newline at end of file diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt index 6b9e3fcf..cb91fb83 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt @@ -43,7 +43,7 @@ object TeleOpMovement : Component { val joyRadians = atan2(joyY, joyX) - (PI / 3.0) var joyMagnitude = sqrt(joyY * joyY + joyX * joyX) - // if the right bumper is pressed move slower + // if the y button is pressed move slower if (gamepad.y) { joyMagnitude *= SLOW_MULTIPLIER } @@ -52,7 +52,7 @@ object TeleOpMovement : Component { if (gamepad.left_bumper) { Box.gripIn() } - if (gamepad.right_bumper) { + else if (gamepad.right_bumper) { Box.gripOut() } @@ -60,7 +60,7 @@ object TeleOpMovement : Component { if (gamepad.a) { Box.dropBox() } - if (gamepad.b) { + else if (gamepad.b) { Box.pickUpBox() } From b543d0391a74eec7fe97bd6ca713f26f972f6761 Mon Sep 17 00:00:00 2001 From: BD103 <59022059+BD103@users.noreply.github.com> Date: Mon, 11 Dec 2023 08:20:23 -0500 Subject: [PATCH 07/16] refactor: format box api and teleop movement component --- .../org/firstinspires/ftc/teamcode/api/Box.kt | 33 +++++++++---------- .../ftc/teamcode/components/TeleOpMovement.kt | 6 ++-- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt index ac1f232f..4c2b735c 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt @@ -5,9 +5,8 @@ import com.qualcomm.robotcore.hardware.Servo /** * An API for controlling the Box on the robot. - * */ + */ object Box : API() { - private lateinit var boxL: Servo private lateinit var boxR: Servo private lateinit var grip: Servo @@ -21,32 +20,32 @@ object Box : API() { } /** - * Moves the box to the ground - */ + * Moves the box to the ground + */ fun dropBox() { - boxL.position = 0.5 - boxR.position = 0.5 + this.boxL.position = 0.5 + this.boxR.position = 0.5 } /** - * Moves box to upright position - */ + * Moves box to upright position + */ fun pickUpBox() { - boxL.position = 0.0 - boxL.position = 0.0 + this.boxL.position = 0.0 + this.boxL.position = 0.0 } /** - * Moves the grip to keep pixels in place when [pickUpBox] the box - */ + * Moves the grip to keep pixels in place when [pickUpBox] the box + */ fun gripIn() { - grip.position = 0.2 + this.grip.position = 0.2 } /** - * Resets the grip to starting position - */ + * Resets the grip to starting position + */ fun gripOut() { - grip.position = 0.0 + this.grip.position = 0.0 } -} \ No newline at end of file +} diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt index cb91fb83..15d04d9e 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt @@ -51,16 +51,14 @@ object TeleOpMovement : Component { // Inputs for the gripper on the box if (gamepad.left_bumper) { Box.gripIn() - } - else if (gamepad.right_bumper) { + } else if (gamepad.right_bumper) { Box.gripOut() } // Inputs for the movement of the box if (gamepad.a) { Box.dropBox() - } - else if (gamepad.b) { + } else if (gamepad.b) { Box.pickUpBox() } From e4e98424f147f0806a24859ec31943302a91c9e4 Mon Sep 17 00:00:00 2001 From: cadence <117321183+cadenceforney@users.noreply.github.com> Date: Sun, 14 Jan 2024 15:34:56 -0500 Subject: [PATCH 08/16] init the box api the box api needed to be initialized --- .../firstinspires/ftc/teamcode/opmode/teleop/TeleOpMain.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmode/teleop/TeleOpMain.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmode/teleop/TeleOpMain.kt index 40c104b2..96304ba3 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmode/teleop/TeleOpMain.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmode/teleop/TeleOpMain.kt @@ -2,6 +2,7 @@ package org.firstinspires.ftc.teamcode.opmode.teleop import com.qualcomm.robotcore.eventloop.opmode.OpMode import com.qualcomm.robotcore.eventloop.opmode.TeleOp +import org.firstinspires.ftc.teamcode.api.Box import org.firstinspires.ftc.teamcode.api.GamepadEx import org.firstinspires.ftc.teamcode.api.Telemetry import org.firstinspires.ftc.teamcode.api.TriWheels @@ -24,6 +25,9 @@ class TeleOpMain : OpMode() { // Advanced gamepad inputs GamepadEx.init(this) + // Box controls + Box.init(this) + // Log that we are initialized Telemetry.sayInitialized() } From d6e0a24ed9ba8b4610438473c998a8ed47db7cd4 Mon Sep 17 00:00:00 2001 From: cadence <117321183+cadenceforney@users.noreply.github.com> Date: Sun, 14 Jan 2024 16:14:06 -0500 Subject: [PATCH 09/16] small changes needed to make them move in the same direction --- .../src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt index 4c2b735c..c61179ab 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt @@ -23,7 +23,7 @@ object Box : API() { * Moves the box to the ground */ fun dropBox() { - this.boxL.position = 0.5 + this.boxL.position = -0.5 this.boxR.position = 0.5 } @@ -32,7 +32,7 @@ object Box : API() { */ fun pickUpBox() { this.boxL.position = 0.0 - this.boxL.position = 0.0 + this.boxR.position = 0.0 } /** From 3c9eb3685e8b3ab7f769da922b9ae48ce11d375d Mon Sep 17 00:00:00 2001 From: Vifi5 <117041326+Vif15@users.noreply.github.com> Date: Sun, 14 Jan 2024 18:16:31 -0500 Subject: [PATCH 10/16] Changed the values for boxL and boxR to sync them up. --- .../src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt index c61179ab..d8b6b6d8 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt @@ -23,15 +23,15 @@ object Box : API() { * Moves the box to the ground */ fun dropBox() { - this.boxL.position = -0.5 - this.boxR.position = 0.5 + this.boxL.position = 0.4 + this.boxR.position = 0.35 } /** * Moves box to upright position */ fun pickUpBox() { - this.boxL.position = 0.0 + this.boxL.position = 0.76 this.boxR.position = 0.0 } From 4b7c970d5b6a0d304e5037356e4b2e5954182b3e Mon Sep 17 00:00:00 2001 From: cadence <117321183+cadenceforney@users.noreply.github.com> Date: Thu, 18 Jan 2024 21:46:48 -0500 Subject: [PATCH 11/16] fine tune ben gave numbers Co-Authored-By: Vifi5 <117041326+Vif15@users.noreply.github.com> --- .../src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt index d8b6b6d8..210f24d2 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt @@ -39,13 +39,13 @@ object Box : API() { * Moves the grip to keep pixels in place when [pickUpBox] the box */ fun gripIn() { - this.grip.position = 0.2 + this.grip.position = 0.23 } /** * Resets the grip to starting position */ fun gripOut() { - this.grip.position = 0.0 + this.grip.position = 0.18 } } From e75b3ae96b355d9d0a469934e57d071a5aa2c2e5 Mon Sep 17 00:00:00 2001 From: cadence <117321183+cadenceforney@users.noreply.github.com> Date: Thu, 18 Jan 2024 22:10:01 -0500 Subject: [PATCH 12/16] fine tuning ben gave number Co-Authored-By: Vifi5 <117041326+Vif15@users.noreply.github.com> --- .../src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt index 210f24d2..402d97d9 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt @@ -46,6 +46,6 @@ object Box : API() { * Resets the grip to starting position */ fun gripOut() { - this.grip.position = 0.18 + this.grip.position = 0.11 } } From 335f95cbda2d33bc1492a150afbbe4d3141f6b36 Mon Sep 17 00:00:00 2001 From: cadence <117321183+cadenceforney@users.noreply.github.com> Date: Fri, 19 Jan 2024 20:07:18 -0500 Subject: [PATCH 13/16] comment stated that requires the box API changed grip position --- .../src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt | 2 +- .../org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt index 402d97d9..28c27eb4 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt @@ -39,7 +39,7 @@ object Box : API() { * Moves the grip to keep pixels in place when [pickUpBox] the box */ fun gripIn() { - this.grip.position = 0.23 + this.grip.position = 0.4 } /** diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt index e9792d8c..30dd607d 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt @@ -12,6 +12,7 @@ import kotlin.math.sqrt * Moves the robot wheels based on gamepad input. * * Requires the [TriWheels] API. + * Requires the [Box] API. */ object TeleOpMovement : Component { private const val ROTATION_GAIN = 0.6 From 03f27f359334d21e7f1e2921db18cebde89bb062 Mon Sep 17 00:00:00 2001 From: cadence <117321183+cadenceforney@users.noreply.github.com> Date: Fri, 19 Jan 2024 20:09:50 -0500 Subject: [PATCH 14/16] you are welcome fixed formatting --- .../firstinspires/ftc/teamcode/components/TeleOpMovement.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt index 30dd607d..2603a415 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt @@ -11,8 +11,7 @@ import kotlin.math.sqrt /** * Moves the robot wheels based on gamepad input. * - * Requires the [TriWheels] API. - * Requires the [Box] API. + * Requires the [TriWheels] and [Box] API. */ object TeleOpMovement : Component { private const val ROTATION_GAIN = 0.6 From 4d439b81f7dd34d36e99b8e6861c1c53c74a1314 Mon Sep 17 00:00:00 2001 From: cadence <117321183+cadenceforney@users.noreply.github.com> Date: Fri, 19 Jan 2024 20:10:52 -0500 Subject: [PATCH 15/16] i am sorry :( --- .../org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt index 2603a415..265cf8ce 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/components/TeleOpMovement.kt @@ -11,7 +11,7 @@ import kotlin.math.sqrt /** * Moves the robot wheels based on gamepad input. * - * Requires the [TriWheels] and [Box] API. + * Requires the [TriWheels] and [Box] APIs. */ object TeleOpMovement : Component { private const val ROTATION_GAIN = 0.6 From 8698b38f3eabe88955d4d53c0f7122a3cbfb58f3 Mon Sep 17 00:00:00 2001 From: cadence <117321183+cadenceforney@users.noreply.github.com> Date: Fri, 19 Jan 2024 23:06:59 -0500 Subject: [PATCH 16/16] Update Box.kt updated to run the box movement off of one servo. Co-Authored-By: Vifi5 <117041326+Vif15@users.noreply.github.com> --- .../java/org/firstinspires/ftc/teamcode/api/Box.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt index 28c27eb4..8ee8b79a 100644 --- a/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt +++ b/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/api/Box.kt @@ -7,15 +7,13 @@ import com.qualcomm.robotcore.hardware.Servo * An API for controlling the Box on the robot. */ object Box : API() { - private lateinit var boxL: Servo - private lateinit var boxR: Servo + private lateinit var box: Servo private lateinit var grip: Servo override fun init(opMode: OpMode) { super.init(opMode) - this.boxL = this.hardwareMap.get(Servo::class.java, "boxL") - this.boxR = this.hardwareMap.get(Servo::class.java, "boxR") + this.box = this.hardwareMap.get(Servo::class.java, "box") this.grip = this.hardwareMap.get(Servo::class.java, "grip") } @@ -23,16 +21,14 @@ object Box : API() { * Moves the box to the ground */ fun dropBox() { - this.boxL.position = 0.4 - this.boxR.position = 0.35 + this.box.position = 0.5 } /** * Moves box to upright position */ fun pickUpBox() { - this.boxL.position = 0.76 - this.boxR.position = 0.0 + this.box.position = 1.0 } /**