+ public void resetEncoders() {
+ leftEncoder.reset();
+ rightEncoder.reset();
+ }
+
+ // Returns inches per second
+ public double getRightSpeed() {
+ return rightEncoder.getRate();
+ }
+
+ public double getLeftSpeed() {
+ return leftEncoder.getRate();
+ }
+
+ public double getSpeed() {
+ return (getLeftSpeed() + getRightSpeed()) / 2.0;
+ }
+
+ // Returns distance in in
+ public double getRightDistance() {
+ return rightEncoder.getDistance();
+ }
+
+ // Returns distance in in
+ public double getLeftDistance() {
+ return leftEncoder.getDistance();
+ }
+
+ public double getDistance() {
+ return (getRightDistance() + getLeftDistance()) / 2.0;
+ }
+
+ public void stop() {
+ setMotorSpeeds(0, 0);
+ }
+
+ public void setMotorSpeeds(double leftSpeed, double rightSpeed) {
+ this.frontLeft.set(leftSpeed);
+ this.frontRight.set(-rightSpeed);
+ this.rearLeft.set(leftSpeed);
+ this.rearRight.set(-rightSpeed);
+ // TODO: add comment here to explain - in speed
+ }
+