Skip to content

Commit 8fbb0cf

Browse files
themehdevsinghsharmadev-png
authored andcommitted
added constants and started hardware
1 parent 42515f3 commit 8fbb0cf

2 files changed

Lines changed: 94 additions & 1 deletion

File tree

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
package frc.robot.subsystems.grabber;
2+
3+
import static edu.wpi.first.units.Units.Milliseconds;
4+
import static edu.wpi.first.units.Units.RotationsPerSecond;
5+
import static edu.wpi.first.units.Units.Volts;
6+
7+
import edu.wpi.first.units.measure.AngularVelocity;
8+
import edu.wpi.first.units.measure.Time;
9+
import edu.wpi.first.units.measure.Voltage;
10+
11+
public class GrabberConstants {
12+
13+
public static final int kDistanceSensorInput = 1 ;
14+
public static final double kDistanceSensorSlope = 1.0 ;
15+
public static final double kDistanceSensorIntercept = 0.0 ;
16+
17+
public static final Voltage kCollectVoltage = Volts.of(3.0) ;
18+
19+
public class Grabber {
20+
21+
public static final int kMotorCANID = 1;
22+
public static final double kGearRatio = 1.0;
23+
public static final boolean kInverted = true;
24+
public static final double kHoldingVoltage = -3.0 ;
25+
public static final double kDepositVoltage = 3.0 ;
26+
27+
public class PID {
28+
public static final double kP = 5.0;
29+
public static final double kI = 0.0 ;
30+
public static final double kD = 0.0 ;
31+
public static final double kV = 0.14 ;
32+
public static final double kA = 0.0 ;
33+
public static final double kG = 0.0 ;
34+
public static final double kS = 0.36102 ;
35+
}
36+
37+
public class MotionMagic {
38+
public static final double kMaxVelocity = 60.0 ;
39+
public static final double kMaxAcceleration = 300.0 ;
40+
public static final double kJerk = 0.0 ;
41+
}
42+
43+
public class CoralSensor {
44+
public static final int kChannel = 0;
45+
}
46+
47+
public class AlgaeSensor {
48+
public static final int kChannel1 = 1;
49+
public static final int kChannel2 = 5;
50+
}
51+
52+
public class DepositCoral {
53+
public static final AngularVelocity l1velocity = RotationsPerSecond.of(40.0) ;
54+
public static final AngularVelocity velocity = RotationsPerSecond.of(100.0) ;
55+
public static final Time delay = Milliseconds.of(400.0) ;
56+
public static final Time l1delay = Milliseconds.of(1000.0) ;
57+
}
58+
59+
public class CollectCoral {
60+
public static final AngularVelocity kVelocity = RotationsPerSecond.of(15.0) ;
61+
public static final AngularVelocity kBackupVelocity = RotationsPerSecond.of(-20.0) ;
62+
}
63+
64+
public class CollectAlgae {
65+
public static final AngularVelocity velocity = RotationsPerSecond.of(-20.0) ;
66+
}
67+
68+
public class DepositAlgae {
69+
public static final AngularVelocity velocity = RotationsPerSecond.of(-120.0) ;
70+
public static final Time delay = Milliseconds.of(500.0) ;
71+
}
72+
73+
public class Positions {
74+
public static final double CoralPositionVelocity = 0.0;
75+
76+
public static final double ejectCoralVelocty = 1.0;
77+
public static final double ejectCoralWait = 0.0;
78+
79+
public static final double collectAlgaeVelocity = 0.0;
80+
public static final double ejectAlgaeVelocity = 0.0;
81+
public static final double ejectAlgaeWait = 0.0;
82+
}
83+
84+
}
85+
}
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
package frc.robot.subsystems.grabber;
22

3+
import com.ctre.phoenix6.hardware.TalonFX;
4+
5+
import frc.robot.subsystems.grabber.GrabberConstants.Grabber;
6+
37
public class GrabberIOHardware {
4-
8+
private TalonFX grabber_motor_;
9+
10+
public GrabberIOHardware() {
11+
grabber_motor_ = new TalonFX(GrabberConstants.Grabber.kMotorCANID);
12+
}
513
}

0 commit comments

Comments
 (0)