Skip to content

Commit

Permalink
setarrmtarget in teleop
Browse files Browse the repository at this point in the history
  • Loading branch information
sofiebudman committed Mar 3, 2024
1 parent baf30a2 commit 999bb89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/main/java/org/carlmontrobotics/commands/ArmTeleop.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ public void execute() {
double goalArmRad = goalState.position + speeds * deltaT;
goalArmRad = MathUtil.clamp(goalArmRad, LOWER_ANGLE_LIMIT, UPPER_ANGLE_LIMIT);
goalState = new TrapezoidProfile.State(goalArmRad, 0);
TrapezoidProfile.State setpoint = armSubsystem.calculateCustomSetPoint(0.02, armSubsystem.getCurrentArmState(), goalState);
armSubsystem.setArmTarget(setpoint.position);
armSubsystem.setArmTarget(goalState.position);
lastTime = currTime;
}

Expand Down
5 changes: 1 addition & 4 deletions src/main/java/org/carlmontrobotics/subsystems/Arm.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,7 @@ public void periodic() {
driveArm(goalState.position);
}

public TrapezoidProfile.State calculateCustomSetPoint(double goalSeconds, TrapezoidProfile.State currentPoint, TrapezoidProfile.State goalState) {
return armProfile.calculate(goalSeconds, currentPoint, goalState);

}


public void autoCancelArmCommand() {
if(!(getDefaultCommand() instanceof ArmTeleop) || DriverStation.isAutonomous()) return;
Expand Down

0 comments on commit 999bb89

Please sign in to comment.