|
Re: JAVA code to drive straight using H-drive
sure
Quote:
public double getDegreesFromEncoderValues(){
double leftDistance = Robot.drivetrain.leftEncoder.getDistance();
double rightDistance = Robot.drivetrain.rightEncoder.getDistance();
double robotArcLength = (leftDistance-rightDistance)/2;
double robotDegrees = 360*(robotArcLength/(Math.PI*wheelbase);
return robotDegrees;
}
|
__________________
 2010-2017 Mentor Team 319
2012 - Rockwell Automation Award Winner
2014 - Xerox Creativity in Engineering Winner, Archimedes Division
2015 - Rockwell Automation and Gracious Proffesionalism Winner, Tesla Division
2016 - North Shore and UNH District Event Winner, Carson Division
http://www.frc319.com
|