diff --git a/simgui.json b/simgui.json index 08662d3..f5c6abf 100644 --- a/simgui.json +++ b/simgui.json @@ -14,5 +14,12 @@ "/SmartDashboard/Field": "Field2d", "/SmartDashboard/SendableChooser[0]": "String Chooser" } + }, + "NetworkTables": { + "transitory": { + "SmartDashboard": { + "open": true + } + } } } diff --git a/src/main/java/frc/robot/commands/ArmCommand.java b/src/main/java/frc/robot/commands/ArmCommand.java index 8e55b4c..21089f9 100644 --- a/src/main/java/frc/robot/commands/ArmCommand.java +++ b/src/main/java/frc/robot/commands/ArmCommand.java @@ -24,7 +24,7 @@ public class ArmCommand extends CommandBase { 16; // to reduce stick sensitivity, this value indicates how much to scale the returned speed // by private final double m_minBaseRange = 0; // min range for the arm's base - private final double m_maxBaseRange = 1; // max range for the arm's base + private final double m_maxBaseRange = 0.5; // max range for the arm's base public ArmCommand(Arm arm, DoubleSupplier baseSpeed) { m_arm = arm; diff --git a/src/main/java/frc/robot/commands/GripperCommand.java b/src/main/java/frc/robot/commands/GripperCommand.java index be49167..2bcc61e 100644 --- a/src/main/java/frc/robot/commands/GripperCommand.java +++ b/src/main/java/frc/robot/commands/GripperCommand.java @@ -1,6 +1,7 @@ package frc.robot.commands; import edu.wpi.first.math.MathUtil; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.CommandBase; import frc.robot.subsystems.Gripper; import java.util.function.DoubleSupplier; @@ -21,7 +22,7 @@ public class GripperCommand extends CommandBase { // to prevent stick drift, this value sets the min absolute value the speed needs to be // before we assume it is not zero private final double m_speedScale = - 16; // to reduce stick sensitivity, this value indicates how much to scale the returned speed + 64; // to reduce stick sensitivity, this value indicates how much to scale the returned speed // by private final double m_minBaseRange = 0; // min range for the gripper's base private final double m_maxBaseRange = 1; // max range for the gripper's base @@ -60,5 +61,8 @@ public void execute() { // Finally, set the gripper base positon to the new calculated gripper position. m_gripper.setClawPosition(newClawPosition); + + SmartDashboard.putNumber("Gripper Position", m_gripper.getClawPosition()); + SmartDashboard.putNumber("New Gripper Position", newClawPosition); } } diff --git a/src/main/java/frc/robot/subsystems/Arm.java b/src/main/java/frc/robot/subsystems/Arm.java index cb428e9..38c9fe5 100644 --- a/src/main/java/frc/robot/subsystems/Arm.java +++ b/src/main/java/frc/robot/subsystems/Arm.java @@ -7,7 +7,7 @@ public class Arm extends SubsystemBase { // This code assumes we are using the ROMI's external IO configuration and the arm base servo is // connected to Romi Pin EXT4 which is configured as PWM and mapped to port 3 // https://docs.wpilib.org/en/stable/docs/romi-robot/web-ui.html#external-io-configuration - private final Servo m_armBaseServo = new Servo(3); + private final Servo m_armBaseServo = new Servo(2); // Note: If you have a multi-axis arm, you could create another Servo object using a differemt PWM // channel and add the corresponding methods for controlling the position. diff --git a/src/main/java/frc/robot/subsystems/Gripper.java b/src/main/java/frc/robot/subsystems/Gripper.java index 8742472..8e6b6b1 100644 --- a/src/main/java/frc/robot/subsystems/Gripper.java +++ b/src/main/java/frc/robot/subsystems/Gripper.java @@ -7,7 +7,7 @@ public class Gripper extends SubsystemBase { // This code assumes we are using the ROMI's external IO configuration and the arm claw servo is // connected to Romi Pin EXT4 which is configured as PWM and mapped to port 2 // https://docs.wpilib.org/en/stable/docs/romi-robot/web-ui.html#external-io-configuration - private final Servo m_armClawServo = new Servo(2); + private final Servo m_armClawServo = new Servo(3); // Note: If you have a multi-axis arm, you could create another Servo object using a differemt PWM // channel and add the corresponding methods for controlling the position.