Skip to content

Commit

Permalink
Task 5 Completion and Task 6 Completion Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
InfinityJuice committed Oct 24, 2024
1 parent ec1caf5 commit 19edfcf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/frc/robot/commands/ServoCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package frc.robot.commands;

import frc.robot.Constants;
import frc.robot.Robot;
import frc.robot.RobotContainer;
import frc.robot.subsystems.Servo;
import frc.robot.subsystems.XRPDrivetrain;
Expand All @@ -26,11 +27,17 @@ public class ServoCommands {
public static Command servoAdjustAngleCommand(double adjustAmount) {
return new RunCommand(
() -> RobotContainer.m_servo.adjustAngleBy(adjustAmount)
//() -> frc.robot.subsystems.Servo.m_armServo.adjustAngleBy() or maybe RobotContainer.m_servo
//note to self: if hiIhopeThisWorks doesn't work, then do ^^^ and change m_armServo to public
//AdjustAngleBy code is in Servo.java: m_armServo.setAngle(adjustAmount+m_armServo.getAngle())

);
}

public static Command servoAdjustAngleCommandOnce(double adjustAmount) {
return new InstantCommand(
() -> RobotContainer.m_servo.adjustAngleBy(adjustAmount)
);
}

public static Command servoSetAngleCommand(double angle) {
return new InstantCommand(
() -> RobotContainer.m_servo.setAngle(angle)
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/subsystems/Servo.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ public void adjustAngleBy(double adjustAmount) {
//makes the current angle larger or smaller by adjusting angle by adjustAmount
m_armServo.setAngle(adjustAmount+m_armServo.getAngle());
}

public double getAngle() {
return(m_armServo.getAngle());
}
}

0 comments on commit 19edfcf

Please sign in to comment.