Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
feat: manual control
Browse files Browse the repository at this point in the history
  • Loading branch information
drive station committed Dec 12, 2024
1 parent a39e52e commit c7cae26
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 28 deletions.
53 changes: 29 additions & 24 deletions src/main/kotlin/com/frcteam3636/frc2024/Robot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -204,32 +204,37 @@ object Robot : PatchedLoggedRobot() {
// )

//SysId
controller.leftBumper()
.onTrue(Commands.runOnce(SignalLogger::start))

controller.rightBumper()
.onTrue(Commands.runOnce(SignalLogger::stop))

controller.y()
.whileTrue(
Commands.sequence(
Commands.print("Starting quasistatic"),
Arm.sysIdQuasistatic(SysIdRoutine.Direction.kForward)
)
.until(Arm.inSysIdUpperRange.negate())
)


controller.a()
.whileTrue(Arm.sysIdQuasistatic(SysIdRoutine.Direction.kReverse))
// controller.leftBumper()
// .onTrue(Commands.runOnce(SignalLogger::start))
//
// controller.rightBumper()
// .onTrue(Commands.runOnce(SignalLogger::stop))
//
// controller.y()
// .whileTrue(
// Commands.sequence(
// Commands.print("Starting quasistatic"),
// Arm.sysIdQuasistatic(SysIdRoutine.Direction.kForward)
// )
// .until(Arm.inSysIdUpperRange.negate())
// )
//
//
// controller.a()
// .whileTrue(Arm.sysIdQuasistatic(SysIdRoutine.Direction.kReverse))
//
// controller.rightBumper()
// .whileTrue(Arm.sysIdDynamic(SysIdRoutine.Direction.kForward)
//// .until(Arm.inSysIdUpperRange.negate()))
// )
// controller.leftBumper()
// .whileTrue(Arm.sysIdDynamic(SysIdRoutine.Direction.kReverse))
//

controller.rightBumper()
.whileTrue(Arm.sysIdDynamic(SysIdRoutine.Direction.kForward)
// .until(Arm.inSysIdUpperRange.negate()))
)
controller.leftBumper()
.whileTrue(Arm.sysIdDynamic(SysIdRoutine.Direction.kReverse))

.whileTrue(Arm.setSpeed(0.3))
controller.rightBumper()
.whileTrue(Arm.setSpeed(-0.3))
//Arm positions1
// controller.a()
// .onTrue(
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/com/frcteam3636/frc2024/subsystems/arm/Arm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ object Arm : Subsystem {
armAngleLigament.angle = inputs.position.`in`(Degrees)
armWristAngleLigament.angle = 90.0 - inputs.position.`in`(Degrees)

if (timer.advanceIfElapsed(SECONDS_BETWEEN_ARM_UPDATES) && inputs.absoluteEncoderConnected){
io.updatePosition(inputs.position)
}
// if (timer.advanceIfElapsed(SECONDS_BETWEEN_ARM_UPDATES) && inputs.absoluteEncoderConnected){
// io.updatePosition(inputs.position)
// }

Logger.recordOutput("/Arm/Mechanism", mechanism)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class ArmIOReal: ArmIO {
Logger.recordOutput("/Arm/Voltage", volts)
val control = VoltageOut(volts.`in`(Volts))
leftMotor.setControl(control) // TODO: fix gearbox
// rightMotor.setControl(control)
control.Output *= 1.0085146641438032
rightMotor.setControl(control)
}

init {
Expand Down

0 comments on commit c7cae26

Please sign in to comment.