-
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
457d430
commit 5af7472
Showing
4 changed files
with
68 additions
and
32 deletions.
There are no files selected for viewing
27 changes: 2 additions & 25 deletions
27
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,34 +1,11 @@ | ||
package org.firstinspires.ftc.teamcode.opModes.teleOp | ||
|
||
import com.arcrobotics.ftclib.command.CommandOpMode | ||
import com.arcrobotics.ftclib.gamepad.GamepadEx | ||
import com.qualcomm.robotcore.eventloop.opmode.TeleOp | ||
import org.firstinspires.ftc.teamcode.commands.drive.DriveCommand | ||
import org.firstinspires.ftc.teamcode.subsystems.drive.DriveSubsystem | ||
|
||
@TeleOp | ||
class MainTeleOp : CommandOpMode() { | ||
private lateinit var driveSubsystem: DriveSubsystem | ||
|
||
private lateinit var driveCommand: DriveCommand | ||
|
||
private lateinit var driver: GamepadEx | ||
class MainTeleOp: CommandOpMode() { | ||
override fun initialize() { | ||
|
||
driveSubsystem = DriveSubsystem(hardwareMap) | ||
|
||
driver = GamepadEx(gamepad1) | ||
|
||
driveCommand = DriveCommand( | ||
driveSubsystem, | ||
leftX = driver::getLeftX, | ||
leftY = driver::getLeftY, | ||
rightX = driver::getRightX, | ||
zoneVal = 0.15 | ||
) | ||
|
||
register(driveSubsystem) | ||
|
||
driveSubsystem.defaultCommand = driveCommand | ||
TODO("Not yet implemented") | ||
} | ||
} |
7 changes: 0 additions & 7 deletions
7
TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/arm/ArmSlideSubsystem.kt
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/arm/ArmSubsystem.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,33 @@ | ||
package org.firstinspires.ftc.teamcode.subsystems.arm | ||
|
||
import com.arcrobotics.ftclib.command.SubsystemBase | ||
import com.arcrobotics.ftclib.hardware.motors.Motor | ||
import com.arcrobotics.ftclib.hardware.motors.MotorGroup | ||
|
||
class ArmSubsystem( | ||
// Here I am just declaring the motors and what they are called on our driver hub. | ||
private val leftSlideAxel : Motor, | ||
private val rightSlideAxel : Motor, | ||
|
||
) : SubsystemBase() { | ||
|
||
//Here I am making a motor group, as the arm motors are going to work together to to turn the slides. | ||
|
||
private val turnMotors = MotorGroup(leftSlideAxel, rightSlideAxel) | ||
|
||
|
||
// Here are functions that work the motor, and the double is the speed of the motor, 1 being 100%. | ||
fun clockwise() { | ||
turnMotors.set(1.0) | ||
} | ||
|
||
fun anticlockwise() { | ||
turnMotors.set(-1.0) | ||
} | ||
|
||
fun stop() { | ||
turnMotors.set(0.0) | ||
} | ||
|
||
|
||
} |
33 changes: 33 additions & 0 deletions
33
TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/slides/SlidesSubsystem.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,33 @@ | ||
package org.firstinspires.ftc.teamcode.subsystems.slides | ||
|
||
import com.arcrobotics.ftclib.command.SubsystemBase | ||
import com.arcrobotics.ftclib.hardware.motors.Motor | ||
import com.arcrobotics.ftclib.hardware.motors.MotorGroup | ||
|
||
class SlidesSubsystem( | ||
|
||
//sets them as a private variable thats a motor (same name as in driver hub) | ||
private val leftSlideString : Motor, | ||
private val rightSlideString : Motor, | ||
|
||
) : SubsystemBase() { | ||
//makes a motor group bc you have to move them at the same time | ||
private val elevatorMotors = MotorGroup(leftSlideString, rightSlideString) | ||
|
||
|
||
// Functions for moving slides up and down, number being speed, 1 being 100% | ||
fun up() { | ||
|
||
elevatorMotors.set(1.0) | ||
} | ||
|
||
fun down() { | ||
elevatorMotors.set(-1.0) | ||
} | ||
|
||
fun stop() { | ||
elevatorMotors.set(0.0) | ||
} | ||
|
||
|
||
} |