-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drivetrain code #13
base: master
Are you sure you want to change the base?
Drivetrain code #13
Conversation
|
||
public class Drivetrain extends Subsystem { | ||
|
||
/** | ||
* Drivetrain four wheel drive. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drivetrain subsystem, configured for 4 wheel drive
// empty | ||
this.setPercentDrive(); | ||
|
||
this.holdHeading.setInputRange(-180.0, 180.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment explaining this
this.holdHeading.setAbsoluteTolerance(5.0); | ||
this.holdHeading.setContinuous(); | ||
|
||
this.turnToAngle.setAbsoluteTolerance(10.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be a constant, and we need an explanation comment
this.frontLeft.reverseOutput(true); | ||
this.frontLeft.reverseSensor(true); | ||
this.frontLeft.setPID(0.02, 0.0, 0.08); | ||
this.frontLeft.configNominalOutputVoltage(+0.0f, -0.0f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's an automatic coercion from double to float
|
||
this.turnToAngle.setAbsoluteTolerance(10.0); | ||
|
||
this.frontLeft.changeControlMode(TalonControlMode.PercentVbus); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need comment explaining this
|
||
@Override | ||
public double pidGet() { | ||
// TODO Auto-generated method stub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove comment
return Robot.DRIVETRAIN.frontRight.getPosition(); | ||
} | ||
|
||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if method is abstract and remove auto generated comment
} | ||
} | ||
|
||
private class HoldHeadingOutput implements PIDOutput { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class should not change the outer class
|
||
@Override | ||
public void pidWrite(double power) { | ||
angle = power; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class should not change the outer class
|
||
@Override | ||
public void pidWrite(double power) { | ||
distance = power; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class should not change the outer class
Just Drivetrain Things: