updated pid values and added setpoint
This commit is contained in:
parent
18ff5daaad
commit
0108b984b1
@ -15,6 +15,7 @@ public class Robot extends IterativeRobot {
|
||||
oi = new OI();
|
||||
chooser = new SendableChooser();
|
||||
SmartDashboard.putData("Auto mode", chooser);
|
||||
SmartDashboard.putData("MainArm",CommandBase.mainArm.getPIDController());
|
||||
}
|
||||
public void disabledInit() {
|
||||
}
|
||||
@ -39,6 +40,7 @@ public class Robot extends IterativeRobot {
|
||||
Scheduler.getInstance().run();
|
||||
SmartDashboard.putNumber("ArmAngleRaw",CommandBase.mainArm.getRaw());
|
||||
SmartDashboard.putNumber("ArmAngleDegrees",CommandBase.mainArm.getDegrees());
|
||||
System.out.println(CommandBase.mainArm.getDegrees());
|
||||
}
|
||||
public void testPeriodic() {
|
||||
LiveWindow.run();
|
||||
|
@ -9,19 +9,23 @@ public class MainArm extends PIDSubsystem {
|
||||
CANTalon armMotorRight = new CANTalon(RobotMap.armRightMotor);
|
||||
AnalogInput pot = new AnalogInput(RobotMap.armPot);
|
||||
public MainArm(){
|
||||
super("MainArm",0.0,0.0,0.0);
|
||||
super("MainArm",0.06,0.0,0.002);
|
||||
getPIDController().setContinuous(false);
|
||||
//setSetpoint(15);
|
||||
enable();
|
||||
}
|
||||
public void initDefaultCommand() {
|
||||
}
|
||||
public void moveArm(double speed){
|
||||
armMotorLeft.set(speed);
|
||||
armMotorRight.set(-speed);
|
||||
armMotorLeft.set(-speed);
|
||||
armMotorRight.set(speed);
|
||||
}
|
||||
protected double returnPIDInput(){
|
||||
return pot.getAverageVoltage();
|
||||
return getDegrees();
|
||||
}
|
||||
protected void usePIDOutput(double output){
|
||||
armMotorLeft.set(-output);
|
||||
armMotorRight.set(output);
|
||||
}
|
||||
public double getRaw(){
|
||||
return pot.getAverageVoltage();
|
||||
|
Loading…
x
Reference in New Issue
Block a user