Skip to content

Commit

Permalink
all of the singular auto programs, they still need to be adjusted wit…
Browse files Browse the repository at this point in the history
…h dimensions
  • Loading branch information
Ishaan Ghaskadbi authored and Ishaan Ghaskadbi committed Nov 21, 2024
1 parent f127366 commit 358d6b7
Show file tree
Hide file tree
Showing 10 changed files with 520 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ enum class ControlBoard(val deviceName: String) {
SLIDES_LEFT("leftSlideString"),
SLIDES_RIGHT("rightSlideString"),

//Intake

INTAKE(""),

// Camera
CAMERA("lifeCam")
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.firstinspires.ftc.teamcode.opModes.auto.blue.basket
package org.firstinspires.ftc.teamcode.opModes.auto.blue.basket.left

import com.arcrobotics.ftclib.hardware.motors.CRServo
import com.arcrobotics.ftclib.hardware.motors.Motor
Expand All @@ -11,8 +11,8 @@ import org.firstinspires.ftc.teamcode.subsystems.drive.DriveSubsystem
import org.firstinspires.ftc.teamcode.subsystems.intake.IntakeSubsystem
import org.firstinspires.ftc.teamcode.subsystems.slides.SlidesSubsytem

@Autonomous
class BlueHighBasetLeft() : OpMode() {
@Autonomous(name = "Blue High Basket Left", group = "Basket", preselectTeleOp = "MainTeleOp")
class BlueHighBasketLeft() : OpMode() {
private lateinit var armLeft: Motor
private lateinit var armRight: Motor
private lateinit var elevatorLeft: Motor
Expand All @@ -26,7 +26,7 @@ class BlueHighBasetLeft() : OpMode() {
private lateinit var elevatorSubsystem: SlidesSubsytem

override fun init() {
intake = CRServo(hardwareMap, "intake")
intake = CRServo(hardwareMap, ControlBoard.INTAKE.deviceName)

armLeft = Motor(hardwareMap, ControlBoard.ARM_LEFT.deviceName)
armRight = Motor(hardwareMap, ControlBoard.ARM_RIGHT.deviceName)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package org.firstinspires.ftc.teamcode.opModes.auto.blue.basket.right

import com.arcrobotics.ftclib.hardware.motors.CRServo
import com.arcrobotics.ftclib.hardware.motors.Motor
import com.qualcomm.robotcore.eventloop.opmode.Autonomous
import com.qualcomm.robotcore.eventloop.opmode.OpMode
import org.firstinspires.ftc.teamcode.constants.AutoStartPose
import org.firstinspires.ftc.teamcode.constants.ControlBoard
import org.firstinspires.ftc.teamcode.subsystems.arm.ArmSubsystem
import org.firstinspires.ftc.teamcode.subsystems.drive.DriveSubsystem
import org.firstinspires.ftc.teamcode.subsystems.intake.IntakeSubsystem
import org.firstinspires.ftc.teamcode.subsystems.slides.SlidesSubsytem


@Autonomous(name = "Blue High Basket Right", group = "Basket", preselectTeleOp = "MainTeleOp")
class BlueHighBasketRight() : OpMode() {

private lateinit var armLeft: Motor
private lateinit var armRight: Motor
private lateinit var elevatorLeft: Motor
private lateinit var elevatorRight: Motor

private lateinit var intake: CRServo

private lateinit var driveSubsystem: DriveSubsystem
private lateinit var intakeSubsystem: IntakeSubsystem
private lateinit var armSubsystem: ArmSubsystem
private lateinit var elevatorSubsystem: SlidesSubsytem

override fun init() {
intake = CRServo(hardwareMap, ControlBoard.INTAKE.deviceName)

armLeft = Motor(hardwareMap, ControlBoard.ARM_LEFT.deviceName)
armRight = Motor(hardwareMap, ControlBoard.ARM_RIGHT.deviceName)

elevatorLeft = Motor(hardwareMap, ControlBoard.SLIDES_LEFT.deviceName)
elevatorRight = Motor(hardwareMap, ControlBoard.SLIDES_RIGHT.deviceName)

driveSubsystem = DriveSubsystem(hardwareMap)
intakeSubsystem = IntakeSubsystem(intake)
armSubsystem = ArmSubsystem(armLeft, armRight)
elevatorSubsystem = SlidesSubsytem(elevatorLeft, elevatorRight)

val trajectory = driveSubsystem.trajectorySequenceBuilder(AutoStartPose.BLUE_RIGHT.startPose)
.turn(Math.toRadians(90.0))
.forward(35.0)
.addTemporalMarker(2.0) {
armSubsystem.setpoint = Math.toRadians(150.0)
}
.waitSeconds(1.0)
.addTemporalMarker(3.0) {
elevatorSubsystem.setpoint = 2.0
}
.waitSeconds(2.0)
.addTemporalMarker(5.0){
intakeSubsystem.outtake()
}
.waitSeconds(1.0)
.addTemporalMarker(6.0) {
elevatorSubsystem.setpoint = 0.0
}
.waitSeconds(2.0)
.addTemporalMarker(8.0) {
armSubsystem.setpoint = Math.toRadians(0.0)
}
.build()

driveSubsystem.followTrajectorySequenceAsync(trajectory)
}

override fun loop() {
driveSubsystem.update()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package org.firstinspires.ftc.teamcode.opModes.auto.blue.chamber.left

import com.arcrobotics.ftclib.hardware.motors.CRServo
import com.arcrobotics.ftclib.hardware.motors.Motor
import com.qualcomm.robotcore.eventloop.opmode.Autonomous
import com.qualcomm.robotcore.eventloop.opmode.OpMode
import org.firstinspires.ftc.teamcode.constants.AutoStartPose
import org.firstinspires.ftc.teamcode.constants.ControlBoard
import org.firstinspires.ftc.teamcode.subsystems.arm.ArmSubsystem
import org.firstinspires.ftc.teamcode.subsystems.drive.DriveSubsystem
import org.firstinspires.ftc.teamcode.subsystems.intake.IntakeSubsystem
import org.firstinspires.ftc.teamcode.subsystems.slides.SlidesSubsytem

@Autonomous(name = "Blue High Chamber Left", group = "Chamber", preselectTeleOp = "MainTeleOp")
class BlueHighChamberLeft() : OpMode() {
private lateinit var armLeft: Motor
private lateinit var armRight: Motor
private lateinit var elevatorLeft: Motor
private lateinit var elevatorRight: Motor

private lateinit var intake: CRServo

private lateinit var driveSubsystem: DriveSubsystem
private lateinit var intakeSubsystem: IntakeSubsystem
private lateinit var armSubsystem: ArmSubsystem
private lateinit var elevatorSubsystem: SlidesSubsytem

override fun init() {
intake = CRServo(hardwareMap, ControlBoard.INTAKE.deviceName)

armLeft = Motor(hardwareMap, ControlBoard.ARM_LEFT.deviceName)
armRight = Motor(hardwareMap, ControlBoard.ARM_RIGHT.deviceName)

elevatorLeft = Motor(hardwareMap, ControlBoard.SLIDES_LEFT.deviceName)
elevatorRight = Motor(hardwareMap, ControlBoard.SLIDES_RIGHT.deviceName)

driveSubsystem = DriveSubsystem(hardwareMap)
intakeSubsystem = IntakeSubsystem(intake)
armSubsystem = ArmSubsystem(armLeft, armRight)
elevatorSubsystem = SlidesSubsytem(elevatorLeft, elevatorRight)

val trajectory = driveSubsystem.trajectorySequenceBuilder(AutoStartPose.BLUE_LEFT.startPose)

.forward(28.0)
.strafeLeft(11.0)
.addTemporalMarker(2.0) {
armSubsystem.setpoint = Math.toRadians(150.0)
}
.waitSeconds(1.0)
.addTemporalMarker(3.0) {
elevatorSubsystem.setpoint = 2.0
}
.waitSeconds(2.0)
.addTemporalMarker(5.0) {
intakeSubsystem.outtake()
}
.waitSeconds(1.0)
.addTemporalMarker(6.0) {
elevatorSubsystem.setpoint = 0.0
}
.waitSeconds(2.0)
.addTemporalMarker(8.0) {
armSubsystem.setpoint = Math.toRadians(0.0)
}
.build()

driveSubsystem.followTrajectorySequenceAsync(trajectory)
}

override fun loop() {
driveSubsystem.update()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package org.firstinspires.ftc.teamcode.opModes.auto.blue.chamber.right

import com.arcrobotics.ftclib.hardware.motors.CRServo
import com.arcrobotics.ftclib.hardware.motors.Motor
import com.qualcomm.robotcore.eventloop.opmode.Autonomous
import com.qualcomm.robotcore.eventloop.opmode.OpMode
import org.firstinspires.ftc.teamcode.constants.AutoStartPose
import org.firstinspires.ftc.teamcode.constants.ControlBoard
import org.firstinspires.ftc.teamcode.subsystems.arm.ArmSubsystem
import org.firstinspires.ftc.teamcode.subsystems.drive.DriveSubsystem
import org.firstinspires.ftc.teamcode.subsystems.intake.IntakeSubsystem
import org.firstinspires.ftc.teamcode.subsystems.slides.SlidesSubsytem

@Autonomous(name = "Blue High Chamber Right", group = "Chamber", preselectTeleOp = "MainTeleOp")
class BlueHighChamberRight() : OpMode() {
private lateinit var armLeft: Motor
private lateinit var armRight: Motor
private lateinit var elevatorLeft: Motor
private lateinit var elevatorRight: Motor

private lateinit var intake: CRServo

private lateinit var driveSubsystem: DriveSubsystem
private lateinit var intakeSubsystem: IntakeSubsystem
private lateinit var armSubsystem: ArmSubsystem
private lateinit var elevatorSubsystem: SlidesSubsytem

override fun init() {
intake = CRServo(hardwareMap, ControlBoard.INTAKE.deviceName)

armLeft = Motor(hardwareMap, ControlBoard.ARM_LEFT.deviceName)
armRight = Motor(hardwareMap, ControlBoard.ARM_RIGHT.deviceName)

elevatorLeft = Motor(hardwareMap, ControlBoard.SLIDES_LEFT.deviceName)
elevatorRight = Motor(hardwareMap, ControlBoard.SLIDES_RIGHT.deviceName)

driveSubsystem = DriveSubsystem(hardwareMap)
intakeSubsystem = IntakeSubsystem(intake)
armSubsystem = ArmSubsystem(armLeft, armRight)
elevatorSubsystem = SlidesSubsytem(elevatorLeft, elevatorRight)

val trajectory = driveSubsystem.trajectorySequenceBuilder(AutoStartPose.BLUE_RIGHT.startPose)

.forward(28.0)
.strafeRight(11.0)
.addTemporalMarker(2.0) {
armSubsystem.setpoint = Math.toRadians(150.0)
}
.waitSeconds(1.0)
.addTemporalMarker(3.0) {
elevatorSubsystem.setpoint = 2.0
}
.waitSeconds(2.0)
.addTemporalMarker(5.0) {
intakeSubsystem.outtake()
}
.waitSeconds(1.0)
.addTemporalMarker(6.0) {
elevatorSubsystem.setpoint = 0.0
}
.waitSeconds(2.0)
.addTemporalMarker(8.0) {
armSubsystem.setpoint = Math.toRadians(0.0)
}
.build()

driveSubsystem.followTrajectorySequenceAsync(trajectory)
}

override fun loop() {
driveSubsystem.update()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package org.firstinspires.ftc.teamcode.opModes.auto.red.basket.left

import com.arcrobotics.ftclib.hardware.motors.CRServo
import com.arcrobotics.ftclib.hardware.motors.Motor
import com.qualcomm.robotcore.eventloop.opmode.Autonomous
import com.qualcomm.robotcore.eventloop.opmode.OpMode
import org.firstinspires.ftc.teamcode.constants.AutoStartPose
import org.firstinspires.ftc.teamcode.constants.ControlBoard
import org.firstinspires.ftc.teamcode.subsystems.arm.ArmSubsystem
import org.firstinspires.ftc.teamcode.subsystems.drive.DriveSubsystem
import org.firstinspires.ftc.teamcode.subsystems.intake.IntakeSubsystem
import org.firstinspires.ftc.teamcode.subsystems.slides.SlidesSubsytem

@Autonomous(name = "Red High Basket Left", group = "Basket", preselectTeleOp = "MainTeleOp")
class RedHighBasketLeft() : OpMode() {

private lateinit var armLeft: Motor
private lateinit var armRight: Motor
private lateinit var elevatorLeft: Motor
private lateinit var elevatorRight: Motor

private lateinit var intake: CRServo

private lateinit var driveSubsystem: DriveSubsystem
private lateinit var intakeSubsystem: IntakeSubsystem
private lateinit var armSubsystem: ArmSubsystem
private lateinit var elevatorSubsystem: SlidesSubsytem

override fun init() {
intake = CRServo(hardwareMap, ControlBoard.INTAKE.deviceName)

armLeft = Motor(hardwareMap, ControlBoard.ARM_LEFT.deviceName)
armRight = Motor(hardwareMap, ControlBoard.ARM_RIGHT.deviceName)

elevatorLeft = Motor(hardwareMap, ControlBoard.SLIDES_LEFT.deviceName)
elevatorRight = Motor(hardwareMap, ControlBoard.SLIDES_RIGHT.deviceName)

driveSubsystem = DriveSubsystem(hardwareMap)
intakeSubsystem = IntakeSubsystem(intake)
armSubsystem = ArmSubsystem(armLeft, armRight)
elevatorSubsystem = SlidesSubsytem(elevatorLeft, elevatorRight)

val trajectory = driveSubsystem.trajectorySequenceBuilder(AutoStartPose.RED_LEFT.startPose)
.turn(Math.toRadians(90.0))
.forward(35.0)
.addTemporalMarker(2.0) {
armSubsystem.setpoint = Math.toRadians(150.0)
}
.waitSeconds(1.0)
.addTemporalMarker(3.0) {
elevatorSubsystem.setpoint = 2.0
}
.waitSeconds(2.0)
.addTemporalMarker(5.0){
intakeSubsystem.outtake()
}
.waitSeconds(1.0)
.addTemporalMarker(6.0) {
elevatorSubsystem.setpoint = 0.0
}
.waitSeconds(2.0)
.addTemporalMarker(8.0) {
armSubsystem.setpoint = Math.toRadians(0.0)
}
.build()

driveSubsystem.followTrajectorySequenceAsync(trajectory)
}

override fun loop() {
driveSubsystem.update()
}
}
Loading

0 comments on commit 358d6b7

Please sign in to comment.