Boe-Bot newbie...problem with corners
I hope this post doesn't waste anyone's time.· I'm fairly new to this whole thing.· I have a Boe-Bot, bought the whole kit with the book, etc., and have been learning the code.· I have my boe-bot set up to navigate via IR detectors.· For the most part it works great, but when it gets in a corner, it starts freaking out (obviously, because as each IR detector sets to 1 it tries to correct its direction) but it ends up twitching side to side.· Is there a way to overcome this?· I checked on the chapter, regarding the whiskers, and it gives code for escaping corners, but I think because the inputs are different, it doesn't work.· I tried implementing a counter and a for..next loop and ended up making my bot blind, because after I downloaded the code, the bot began running into things as if it didn't "see".
I've tried doing some research, but am not having much luck.· Any information is greatly appreciated.
I've tried doing some research, but am not having much luck.· Any information is greatly appreciated.
Comments
One way to determine your turn to forward pulse ratio is to let the Boe-Bot run for a while as it counts turns vs. forwards while stuck in a corner. Embed the roaming program in a FOR...NEXT loop that only has it roam for 2000 pulses. After the FOR...NEXT loop, the program should move on to a DO...LOOP that uses the DEBUG command to display the turn pulse count and the forward pulse count. After the Boe-Bot stops moving, connect it to your Debug Terminal and see what the numbers turned out to be. Repeat that exercise in a healthy roaming situation to find ratios that indicate that the Boe-Bot is not stuck.
Thanks again!!
Mike
i found that turning the ir transmitters and detectors more to the sides made it much easier for the bot to navigate its way out of corners. the only situation was when it was facing directly into the corner and perfectly equidistant from both walls. but having a escape routine (such as back and do a 180) for when it continually registers a hit on both ir sensors takes care of that.
BTW, there's a nice ramping routine in the Boe-Bot® Robot Navigation with Accelerometer Incline Sensing post.
·· Adjusting the IR LEDs and Detectors does often help clear up many navigation problems.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
For the navigation make sure your IR sensors are a little offset so they aren't looking directly forward.
Add a variable to your program called "stuck".
At the beginning of the program but outside of your movement loop set stuck to 0.
In your program loop for each turn routine add 1 to the stuck variable.
In your program loop for forward and reverse routines reset the variable back to 0.
In your program loop add a line if stuck => 10 then gosub unstuck (doesn't have to be 10, experiment with it)
Add a routine for getting unstuck, like a 180 degree turn, at the end of that routine set the stuck variable back to 0.