http://www.wbrobotics.com/javadoc/ed...ilibj/PWM.html
My team was having a similar issue. We decided to replace the continuous servo with a motor, but we had an untested idea to program a continuous rotation servo. I believe that there is a setSpeed(double speed) method in the PWM class, which the Servo class extends. If there isn't one, you'll have to play around with setRaw(int value). This is the code I found in the library itself:
Code:
final void setSpeed(double speed) {
// clamp speed to be in the range 1.0 >= speed >= -1.0
if (speed < -1.0) {
speed = -1.0;
} else if (speed > 1.0) {
speed = 1.0;
}
// calculate the desired output pwm value by scaling the speed appropriately
int rawValue;
if (speed == 0.0) {
rawValue = getCenterPwm();
} else if (speed > 0.0) {
rawValue = (int) (speed * (getPositiveScaleFactor()) +
(getMinPositivePwm()) + 0.5);
} else {
rawValue = (int) (speed * (getNegativeScaleFactor()) +
(getMaxNegativePwm()) + 0.5);
}
// send the computed pwm value to the FPGA
setRaw(rawValue);
}
This method is actually meant to be used with speed controllers, but in theory it should work with a continuous rotation servo. Once again, we've never tested this, so it's up to you whether or not you want to try it. If you do, please post the results as I think it could benefit a lot of people.
Good luck!