Hello,
I have a problem. We are trying to achieve a function to drive to a specific distance, for exemple 10 inches. What I would like to be able to do is call driveToDistance(leftDistance, rightDistance).
We are using encoders, and they are well calibrated. For exemple, if we manually push the robot during 10 feets, RobotMap.driveTrainEncoderLeft.getDistance(); really return 120 inches for the left encoder.
How could we make a function so the robot goes forward to 10 feets using information returned by the encoders? I'm trying to understand PID, but a code exemple would help greatly.
For your information, in our code,
Code:
Left encoder is RobotMap.driveTrainEncoderLeft ;
Right encoder is RobotMap.driveTrainEncodeRight ;
Left motor is RobotMap.driveTrainLeftController ;
Right motor is RobotMap.driveTrainRightController ;
RobotDrive is RobotMap.driveTrainRobotDrive ;
(for tankDrive and arcadeDrive)
Thanks,
Acrilex