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

Commit

Permalink
wrist
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaJenkins committed Nov 14, 2024
1 parent a2386b4 commit b2e0743
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.frcteam3636.frc2024.subsystems.wrist
import com.frcteam3636.frc2024.Robot
import com.frcteam3636.frc2024.subsystems.intake.IntakeIO
import com.frcteam3636.frc2024.subsystems.wrist.WristIO
import edu.wpi.first.units.Units.Radians
import edu.wpi.first.wpilibj2.command.Command
import edu.wpi.first.wpilibj2.command.Subsystem
import org.littletonrobotics.junction.Logger
Expand All @@ -15,6 +16,6 @@ object Wrist: Subsystem {
override fun periodic() {
Logger.processInputs("Intake", inputs)
//the wrist should always be parallel to the ground
io.pivotToAndStop() //use position variable from arm
io.pivotToAndStop(Radians.zero()) //use position variable from arm
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ interface WristIO {
}
fun updateInputs(inputs: Inputs)

fun pivotToAndStop(position: Rotation2d)
fun pivotToAndStop(position: Measure<Angle>)

class WristIOKraken: WristIO {
private val wristMotor = TalonFX(CTREMotorControllerId.WristMotor)
Expand Down Expand Up @@ -101,12 +101,12 @@ interface WristIO {
inputs.voltage = Volts.zero()
}

override fun pivotToAndStop(position: Rotation2d) {
override fun pivotToAndStop(position: Measure<Angle>) {
Logger.recordOutput("Shooter/Pivot/Position Setpoint", position)

val wristControl = MotionMagicTorqueCurrentFOC(0.0).apply {
Slot = 0
Position = position.rotations
Position = position.`in`(Rotations)
}
wristMotor.setControl(wristControl)
}
Expand Down

0 comments on commit b2e0743

Please sign in to comment.