ActivityBot Does not want to Stop
I used the code below to try to program my ActivityBot to stop moving once it is 20cm away from an object. Instead of stopping completely, it keeps turning around slowly. It seems the problem is that drive_ramp(0, 0) is causing the wheels to turn for some reason.
#include "simpletools.h" #include "abdrive.h" #include "ping.h" int main() { drive_setRampStep(10); drive_ramp(128, 128); while(ping_cm(8) >= 20) pause(5); drive_ramp(0, 0); drive_speed(0, 0); while(ping_cm(8) < 20); drive_ramp(0, 0); }
Comments
If you run the calibration program and still get some slight rotation when the robot should be still, try manually centering the servos (gently) using a screwdriver and then run the calibration program again. It is very important to always re-calibrate after manual centering of ActivityBot servos; do not forget to do so or you will see strange behaviour.
Here is some code to run that will allow you to manually center ActivityBot servos:
http://forums.parallax.com/discussion/150281/activity-bot-mechanical-assembly-step-7-8-heads-up