mirror of
https://github.com/Team4388/2023WayOfTheRobot.git
synced 2026-06-09 00:37:59 -06:00
added velocity control
This commit is contained in:
@@ -46,6 +46,14 @@ public class Arm extends SubsystemBase {
|
||||
this(pivot, tele, encoder, false);
|
||||
}
|
||||
|
||||
public void setRotVel(double vel) {
|
||||
m_pivot.set(ControlMode.Velocity, vel);
|
||||
}
|
||||
|
||||
public void setTeleVel(double vel) {
|
||||
m_tele.set(ControlMode.Velocity, vel);
|
||||
}
|
||||
|
||||
public void armSetRotation(double rot) {
|
||||
if (rot > 1 || rot < 0) return;
|
||||
// Move arm code
|
||||
@@ -71,6 +79,11 @@ public class Arm extends SubsystemBase {
|
||||
(ArmConstants.TELE_REVERSE_SOFT_LIMIT - ArmConstants.TELE_FORWARD_SOFT_LIMIT);
|
||||
}
|
||||
|
||||
public double getArmRotation() {
|
||||
return (m_pivotEncoder.getAbsolutePosition() - ArmConstants.PIVOT_FORWARD_SOFT_LIMIT) /
|
||||
(ArmConstants.PIVOT_REVERSE_SOFT_LIMIT - ArmConstants.PIVOT_FORWARD_SOFT_LIMIT);
|
||||
}
|
||||
|
||||
public void runPivotTele(double pivot, double tele) {
|
||||
var rot = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user