-
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
Showing
10 changed files
with
108 additions
and
82 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/commands/arm/ArmCommand.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,13 @@ | ||
package org.firstinspires.ftc.teamcode.commands.arm | ||
|
||
import com.arcrobotics.ftclib.command.CommandBase | ||
import org.firstinspires.ftc.teamcode.subsystems.arm.ArmSubsystem | ||
|
||
class ArmCommand( | ||
private val setpoint: Double, | ||
private val subsystem: ArmSubsystem | ||
) : CommandBase() { | ||
override fun initialize() { | ||
subsystem.setpoint = setpoint | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
...ftc/teamcode/commands/drive/ArmCommand.kt → ...c/teamcode/commands/arm/OpenArmCommand.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
2 changes: 1 addition & 1 deletion
2
...eamcode/commands/drive/SpinDownCommand.kt → ...code/commands/elevator/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
2 changes: 1 addition & 1 deletion
2
.../teamcode/commands/drive/SpinUpCommand.kt → ...amcode/commands/elevator/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
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
4 changes: 4 additions & 0 deletions
4
TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/opModes/tuning/arm/ArmPIDTuner.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,4 @@ | ||
package org.firstinspires.ftc.teamcode.opModes.tuning.arm | ||
|
||
class ArmPIDTuner { | ||
} |
34 changes: 0 additions & 34 deletions
34
TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/arm/ArmPIDSubsystem.kt
This file was deleted.
Oops, something went wrong.
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
48 changes: 48 additions & 0 deletions
48
TeamCode/src/main/kotlin/org/firstinspires/ftc/teamcode/subsystems/arm/OpenArmSubsystem.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,48 @@ | ||
package org.firstinspires.ftc.teamcode.subsystems.arm | ||
|
||
import com.acmerobotics.dashboard.config.Config | ||
import com.arcrobotics.ftclib.command.SubsystemBase | ||
import com.arcrobotics.ftclib.hardware.motors.Motor | ||
import com.arcrobotics.ftclib.hardware.motors.Motor.GoBILDA | ||
import com.arcrobotics.ftclib.hardware.motors.MotorGroup | ||
import kotlin.math.PI | ||
|
||
@Config | ||
class OpenArmSubsystem( | ||
// Here I am just declaring the motors and what they are called on our driver hub. | ||
armRight : Motor, | ||
armLeft : 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(armRight, armLeft) | ||
val armAngle: Double | ||
get() = turnMotors.positions[0] / GoBILDA.RPM_435.cpr * 2 * PI | ||
|
||
init { | ||
armLeft.inverted = true | ||
turnMotors.resetEncoder() | ||
turnMotors.setZeroPowerBehavior(Motor.ZeroPowerBehavior.BRAKE) | ||
} | ||
|
||
|
||
// Here are functions that work the motor, and the double is the speed of the motor, 1 being 100%. | ||
fun clockwise() { | ||
turnMotors.set(0.35) | ||
} | ||
|
||
fun anticlockwise() { | ||
turnMotors.set(-0.35) | ||
} | ||
|
||
fun stop() { | ||
turnMotors.set(kCos * Math.cos(armAngle)) | ||
} | ||
|
||
companion object { | ||
@JvmField | ||
var kCos = 0.3 | ||
} | ||
} |
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