Hi,
I need help with following modification.
I want imediate mower stop when left/right bumper is pressed.
Problem is, that motors are controled via motorControl(). Here with odometry via PID or without odometry with acceleration on - in both cases stop isn't imediate.
I tried change checkbumpers from :
to :
Mower will stop very fast, but will not start again till bumper is released.
Please can you help me modification which make imediate stop of mower when bumper is pressed ?
Thanks
Alex
I need help with following modification.
I want imediate mower stop when left/right bumper is pressed.
Problem is, that motors are controled via motorControl(). Here with odometry via PID or without odometry with acceleration on - in both cases stop isn't imediate.
I tried change checkbumpers from :
Code:
void Robot::checkBumpers(){
if ((mowPatternCurr == MOW_BIDIR) && (millis() < stateStartTime + 4000)) return;
if ((bumperLeft || bumperRight)) {
if (bumperLeft) {
reverseOrBidir(RIGHT);
} else {
reverseOrBidir(LEFT);
}
}
}
to :
Code:
// check bumpers
void Robot::checkBumpers(){
if ((mowPatternCurr == MOW_BIDIR) && (millis() < stateStartTime + 4000)) return;
if ((bumperLeft || bumperRight)) {
setMotorPWM( 0, 0, false ); // immediate stop at bumping
if (bumperLeft) {
reverseOrBidir(RIGHT);
} else {
reverseOrBidir(LEFT);
}
}
}
Mower will stop very fast, but will not start again till bumper is released.
Please can you help me modification which make imediate stop of mower when bumper is pressed ?
Thanks
Alex