Skip to content

Commit d74bcd5

Browse files
committed
manipulator constants (fixed errors)
1 parent 9fd4858 commit d74bcd5

2 files changed

Lines changed: 55 additions & 30 deletions

File tree

src/main/java/frc/robot/RobotContainer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public class RobotContainer {
4646
// Subsystems
4747
private final Drive drive_;
4848

49-
private final Manipulator manipulator_;
49+
private final Manipulator manipulator;
5050

5151
// Controller
5252
private final CommandXboxController gamepad_ = new CommandXboxController(0);
@@ -67,7 +67,7 @@ public RobotContainer() {
6767
new ModuleIOTalonFX(TunerConstants.BackLeft),
6868
new ModuleIOTalonFX(TunerConstants.BackRight));
6969

70-
manipulator_ = new Manipulator();
70+
manipulator = new Manipulator();
7171

7272
break;
7373

@@ -81,7 +81,7 @@ public RobotContainer() {
8181
new ModuleIOSim(TunerConstants.BackLeft),
8282
new ModuleIOSim(TunerConstants.BackRight));
8383

84-
manipulator_ = new Manipulator();
84+
manipulator = new Manipulator();
8585

8686
break;
8787

@@ -95,7 +95,7 @@ public RobotContainer() {
9595
new ModuleIO() {},
9696
new ModuleIO() {});
9797

98-
manipulator_ = new Manipulator();
98+
manipulator = new Manipulator();
9999
break;
100100
}
101101

src/main/java/frc/robot/subsystems/manipulator/ManipulatorIO.java

Lines changed: 51 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,70 @@
55
import static edu.wpi.first.units.Units.MetersPerSecond;
66
import static edu.wpi.first.units.Units.RadiansPerSecond;
77
import static edu.wpi.first.units.Units.Volts;
8-
8+
import static edu.wpi.first.units.Units.Watts;
99
import org.littletonrobotics.junction.AutoLog;
1010
import edu.wpi.first.units.measure.Angle;
1111
import edu.wpi.first.units.measure.AngularVelocity;
1212
import edu.wpi.first.units.measure.Current;
1313
import edu.wpi.first.units.measure.Distance;
1414
import edu.wpi.first.units.measure.LinearVelocity;
15+
import edu.wpi.first.units.measure.Power;
1516
import edu.wpi.first.units.measure.Voltage;
1617

1718

1819

1920
public interface ManipulatorIO {
2021
@AutoLog
21-
public static class ManipulatorIOInputs {
22+
public static class ManipulatorIOInputs {
2223
//inputs of postion,current,voltage and velocity (acceleration)
23-
public static final AngularVelocity DegreesperSecond = null;
2424

25-
public class ArmStatus {
26-
27-
public boolean armReady = false;
28-
public Angle armPosition = Degrees.of(0);
29-
public Current armCurrent = null;
30-
public Voltage armVoltage = null;
31-
public AngularVelocity armVelocity = RadiansPerSecond.of(0);
32-
public Angle armRawMotorPosition = Degrees.of(0);
33-
public AngularVelocity armRawMotorVelocity = DegreesperSecond;
34-
public int syncCount = Integer.MAX_VALUE;
35-
36-
//constants for elevator part of the manipulator
37-
public Distance elevatorPostion = Meters.of(0);
38-
public LinearVelocity elevatorVelocity = MetersPerSecond.of(0);
39-
public Angle elevatorRawMotorPostion = Degrees.of(syncCount);
40-
}
41-
}
42-
//elevator contants (inputs of voltage and postion)
43-
public boolean elevator1isReady = false;
44-
public Voltage elevator1vVoltage = Volts.of(0);
45-
public Current elevator1Current = Amps.of(0);
46-
47-
}
25+
public AngularVelocity DegreesperSecond = null;
26+
27+
public class ArmStatus {
28+
29+
public boolean armReady = false;
30+
public Angle armPosition = Degrees.of(0);
31+
public Current armCurrent = null;
32+
public Voltage armVoltage = null;
33+
public AngularVelocity armVelocity = RadiansPerSecond.of(0);
34+
public Angle armRawMotorPosition = Degrees.of(0);
35+
public AngularVelocity armRawMotorVelocity = DegreesperSecond;
36+
public int syncCount = Integer.MAX_VALUE;
37+
38+
//constants for elevator part of the manipulator
39+
public Distance elevatorPostion = Meters.of(0);
40+
public LinearVelocity elevatorVelocity = MetersPerSecond.of(0);
41+
public Angle elevatorRawMotorPostion = Degrees.of(syncCount);
42+
}
43+
}
44+
45+
//elevator contants (inputs of the voltage and postion)
46+
public boolean elevator1isReady = false;
47+
public Voltage elevator1vVoltage = Volts.of(0);
48+
public Current elevator1Current = Amps.of(0);
49+
public Power elevator1power = Watts.zero();
50+
public Power elevator1powerAvg = Watts.zero();
51+
52+
//elevator 2 constants (inputs of the voltage and postion)
53+
public boolean elevator2isReady = false;
54+
public Voltage elevator2vVoltage= Volts.of(0);
55+
public Current elevator2Current = Amps.of(0);
56+
public Power elevator2power= Watts.zero();
57+
public Power elevator2powerAvg = Watts.zero();
58+
59+
60+
//encoder
61+
public Angle absoluteEncoder = Degrees.of(0);
62+
public double rawabsoluteEncoder = 0;
63+
64+
// updating the inputs on the elevator
65+
public default void updateInputs(ManipulatorIOInputs inputs) {}
66+
public default void toggleSyncing() {} }
4867

68+
//need for SYS ID support
69+
70+
71+
72+
73+
4974

0 commit comments

Comments
 (0)