Skip to content

Commit

Permalink
Instant to Run Command
Browse files Browse the repository at this point in the history
  • Loading branch information
SachetK committed Nov 24, 2024
1 parent 2c56695 commit 981ed92
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .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 @@ -4,7 +4,6 @@ import com.acmerobotics.dashboard.FtcDashboard
import com.acmerobotics.dashboard.config.Config
import com.acmerobotics.dashboard.telemetry.MultipleTelemetry
import com.arcrobotics.ftclib.command.CommandOpMode
import com.arcrobotics.ftclib.command.InstantCommand
import com.arcrobotics.ftclib.command.RunCommand
import com.arcrobotics.ftclib.hardware.motors.Motor
import com.qualcomm.robotcore.eventloop.opmode.TeleOp
Expand All @@ -27,13 +26,13 @@ class ArmPIDTuner : CommandOpMode() {

armSubsystem = ArmSubsystem(armRight, armLeft, telemetry)

InstantCommand({
RunCommand({
armSubsystem.setpoint = Math.toRadians(target)
}).perpetually().schedule()

RunCommand({
telemetry.addData("Arm Angle: ", Math.toDegrees(armSubsystem.armAngle))
telemetry.addData("Setpoint: ", target)
telemetry.addData("Setpoint: ", armSubsystem.setpoint)
telemetry.update()
}).perpetually().schedule()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class ArmSubsystem(
override fun getMeasurement() = armAngle

companion object {

@JvmField
var kCos = 0.4

Expand Down

0 comments on commit 981ed92

Please sign in to comment.