Skip to content

Conversation

@JYoung413
Copy link

@JYoung413 JYoung413 commented Jan 25, 2017

Just Drivetrain Things:

  • Added proper PID functionality
  • Added some voltage code (from @camilo86)
  • Created Cheesy Drive Method and Command
  • Created OI buttons

@MiloDavis MiloDavis changed the title Did the thing Drivetrain code Jan 25, 2017
public class Drivetrain extends Subsystem {

/**
* Drivetrain four wheel drive.
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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 {
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants