Skip to content

Commit

Permalink
roadrunner
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishaan Ghaskadbi authored and Ishaan Ghaskadbi committed Oct 28, 2024
1 parent 457d430 commit 5af7472
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 32 deletions.
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")
}
}

This file was deleted.

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)
}


}
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)
}


}

0 comments on commit 5af7472

Please sign in to comment.