-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ishaan Ghaskadbi
authored and
Ishaan Ghaskadbi
committed
Oct 28, 2024
1 parent
5af7472
commit 5ca8677
Showing
6 changed files
with
117 additions
and
134 deletions.
There are no files selected for viewing
87 changes: 0 additions & 87 deletions
87
.../java/org/firstinspires/ftc/teamcode/roadrunner/drive/StandardTrackingWheelLocalizer.java
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/commands/drive/SpinDownCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.firstinspires.ftc.teamcode.commands.drive | ||
|
||
import com.arcrobotics.ftclib.command.CommandBase | ||
import org.firstinspires.ftc.teamcode.subsystems.slides.SlidesSubsystem | ||
|
||
class SpinDownCommand ( | ||
private val subsystem: SlidesSubsystem | ||
) : CommandBase() { | ||
|
||
|
||
override fun execute() { | ||
subsystem.down() | ||
} | ||
|
||
override fun end(interrupted: Boolean) { | ||
subsystem.stop() | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/commands/drive/SpinUpCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.firstinspires.ftc.teamcode.commands.drive | ||
|
||
import com.arcrobotics.ftclib.command.CommandBase | ||
import org.firstinspires.ftc.teamcode.subsystems.slides.SlidesSubsystem | ||
|
||
class SpinUpCommand ( | ||
private val subsystem: SlidesSubsystem | ||
) : CommandBase() { | ||
|
||
override fun execute() { | ||
subsystem.up() | ||
} | ||
|
||
override fun end(interrupted: Boolean) { | ||
subsystem.stop() | ||
} | ||
|
||
|
||
} |
38 changes: 37 additions & 1 deletion
38
TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/opModes/teleOp/MainTeleOp.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,47 @@ | ||
package org.firstinspires.ftc.teamcode.opModes.teleOp | ||
|
||
import com.arcrobotics.ftclib.command.CommandOpMode | ||
import com.arcrobotics.ftclib.gamepad.GamepadEx | ||
import com.arcrobotics.ftclib.gamepad.GamepadKeys | ||
import com.arcrobotics.ftclib.hardware.motors.Motor | ||
import com.qualcomm.robotcore.eventloop.opmode.TeleOp | ||
import org.firstinspires.ftc.teamcode.commands.drive.SpinDownCommand | ||
import org.firstinspires.ftc.teamcode.commands.drive.SpinUpCommand | ||
import org.firstinspires.ftc.teamcode.constants.ControlBoard | ||
import org.firstinspires.ftc.teamcode.subsystems.slides.SlidesSubsystem | ||
|
||
@TeleOp | ||
class MainTeleOp: CommandOpMode() { | ||
|
||
private lateinit var leftSlideString : Motor | ||
private lateinit var rightSlideString : Motor | ||
|
||
|
||
private lateinit var slidesSubsystem: SlidesSubsystem | ||
|
||
|
||
private lateinit var spinUpCommand: SpinUpCommand | ||
private lateinit var spinDownCommand: SpinDownCommand | ||
|
||
|
||
private lateinit var driver : GamepadEx | ||
private lateinit var operator : GamepadEx | ||
|
||
override fun initialize() { | ||
TODO("Not yet implemented") | ||
driver = GamepadEx(gamepad1) | ||
operator = GamepadEx(gamepad2) | ||
|
||
rightSlideString = Motor(hardwareMap, ControlBoard.SLIDES_RIGHT.deviceName) | ||
leftSlideString = Motor(hardwareMap, ControlBoard.SLIDES_LEFT.deviceName) | ||
|
||
|
||
slidesSubsystem = SlidesSubsystem(rightSlideString, leftSlideString) | ||
|
||
|
||
spinUpCommand = SpinUpCommand(slidesSubsystem) | ||
spinDownCommand = SpinDownCommand(slidesSubsystem) | ||
|
||
operator.getGamepadButton(GamepadKeys.Button.DPAD_UP).whileHeld(spinUpCommand) | ||
operator.getGamepadButton(GamepadKeys.Button.DPAD_DOWN).whileHeld(spinDownCommand) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters