Skip to content

Commit

Permalink
remove extra arm stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
truher committed Jul 12, 2023
1 parent 0e1e80f commit 369c266
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 230 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.ProfiledPIDCommand;

// TODO: remove use of ProfiledPIDCommand
public class LowerArmToGoal extends ProfiledPIDCommand {
private final ArmController arm;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.ProfiledPIDCommand;

// TODO: remove use of ProfiledPIDCommand
public class UpperArmToGoal extends ProfiledPIDCommand {
private final ArmController m_arm;

Expand Down
126 changes: 0 additions & 126 deletions swerve100/src/main/java/org/team100/frc2023/subsystems/arm/Arm.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public ArmController() {
.withForwardSoftLimitEnabled(false)
.build();

lowerArmSegment = new ArmSegment(this::getLowerArm, lowerArmMotor, "Lower Motor");
upperArmSegment = new ArmSegment(this::getUpperArm, upperArmMotor, "Upper Motor");
lowerArmSegment = new ArmSegment(lowerArmMotor, "Lower Motor");
upperArmSegment = new ArmSegment(upperArmMotor, "Upper Motor");

Translation2d initial = ArmKinematics.getArmPosition(getLowerArm(), getUpperArm());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,67 +1,37 @@
package org.team100.frc2023.subsystems.arm;

import java.util.function.Supplier;

import org.team100.lib.motors.FRCNEO;

import edu.wpi.first.util.sendable.SendableBuilder;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.SubsystemBase;

public class ArmSegment extends SubsystemBase{
// TODO: remove this class
public class ArmSegment extends SubsystemBase {

private FRCNEO motor;
private Supplier<Double> positionSupplier;


/** Creates a new UpperArm. */
public ArmSegment(Supplier<Double> positionSupplier, FRCNEO motor, String name) {
public ArmSegment(FRCNEO motor, String name) {
this.motor = motor;
this.positionSupplier = positionSupplier;

SmartDashboard.putData(name, this);


}

/**
* Sets the motor output, accounting for soft limits.
* <p><b>THIS SHOULD BE THE ONLY PLACE WHERE MOTOR OUTPUT IS SET.</b></p>
* @param x
*/
public void setMotor(double x) {
// Account for soft limits
// kGravityGain *= Math.sin(positionSupplier.get());
// if (getAngle() <= lowerSoftLimit && x < 0)
// this.motor.motor.set(0);
// else if (getAngle() >= upperSoftLimit && x > 0)
// this.motor.motor.set(0);
// else
this.motor.motor.set(x) ;
}

@Override
public void periodic() {

}


public double getDegrees() {
return positionSupplier.get() * 180/Math.PI;
this.motor.motor.set(x);
}

public void initSendable(SendableBuilder builder) {
super.initSendable(builder);
// builder.addDoubleProperty("Error", () -> m_controller.getPositionError(), null);
// builder.addDoubleProperty("Error", () -> m_controller.getPositionError(),
// null);
// builder.addDoubleProperty("Measurement", () -> getMeasurement(), null);
// builder.addDoubleProperty("Setpoint", () -> m_controller.getSetpoint().position, null);
// builder.addDoubleProperty("Goal", () -> m_controller.getGoal().position, null);
// builder.addDoubleProperty("Setpoint", () ->
// m_controller.getSetpoint().position, null);
// builder.addDoubleProperty("Goal", () -> m_controller.getGoal().position,
// null);
// builder.addDoubleProperty("Output", () -> output, null);
// builder.addDoubleProperty("Degrees", () -> getDegrees(), null);




}
}

This file was deleted.

This file was deleted.

0 comments on commit 369c266

Please sign in to comment.