Problem with Boe-Bot code
Hello all of you that are interested in robotics.
My objective is to
create a program for the boe bot to be able to go all around a space (house in this case), avoiding
obstacles and all that sort of things using 2 IR. The programation is pretty much like the one in the book of Andy Lindsay that came with the kit.
The avoidance of objects is well done, the only problem is the way·the robot·goes forward:
it goes forward·for a certain time, than stops, than
goes, than stops and so on. I don't see· a solution but my knowledges
about
robotics are·still relatively·limited.
I think the robot does that because it cannot go forward and scan for
objects at the same time, what I mean is that it can't do 2 things at
the same time. I have changed my code lots of time and I realy can't see the solution to this problem.
The latest experimentation code I has made is atached so if the interested people could just take a look and maybe try it. I will then put it on the Project section of the forum.
Thanks,
····· Lawrence![sad.gif](http://forums.parallax.com/images/smilies/sad.gif)
Post Edited By Moderator (Dave Andreae (Parallax)) : 6/13/2005 11:15:57 PM GMT
My objective is to
create a program for the boe bot to be able to go all around a space (house in this case), avoiding
obstacles and all that sort of things using 2 IR. The programation is pretty much like the one in the book of Andy Lindsay that came with the kit.
The avoidance of objects is well done, the only problem is the way·the robot·goes forward:
it goes forward·for a certain time, than stops, than
goes, than stops and so on. I don't see· a solution but my knowledges
about
robotics are·still relatively·limited.
I think the robot does that because it cannot go forward and scan for
objects at the same time, what I mean is that it can't do 2 things at
the same time. I have changed my code lots of time and I realy can't see the solution to this problem.
The latest experimentation code I has made is atached so if the interested people could just take a look and maybe try it. I will then put it on the Project section of the forum.
Thanks,
····· Lawrence
![sad.gif](http://forums.parallax.com/images/smilies/sad.gif)
Post Edited By Moderator (Dave Andreae (Parallax)) : 6/13/2005 11:15:57 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
Here's an interesting trick - combine your two nibbles into a byte and evaluate it with a SELECT...CASE statement. With two nibbles, you can evaluate them as individual digits if you use the $ hexadecimal operator. It's very convenient.
irBoth······· VAR· Byte
irDetectLeft· VAR· irBoth.HIGHNIB
irDetectRight VAR· irBoth.LOWNIB
'
' Etc...
'
SELECT irBoth
· CASE $55, $45, $54 ',...Etc
··· GOSUB Forward
· CASE $33
··· GOSUB Forward_1
··'...Etc.
· CASE ELSE
··· FREQOUT 4, 50, 4000
· ENDSELECT
Post Edited (Andy Lindsay (Parallax)) : 6/14/2005 6:55:28 PM GMT
Andy, See:
http://forums.parallax.com/showthread.php?p=537942
PAR
The task code tries to put the 20 mSec 'refresh' delay in the main routine -- because your robot can be doing something besides 'pausing' for 20 mSec -- like deciding what to do next.
It's completely possible for your robot to 'decide' to turn left, then leave the left turn action for another 'task'. With Servo's, your robot CAN do two things at once -- Send the PULSOUT to both servo's, then go do something else for a while before you send the PULSOUT again.
Debug commands are not so memory effective...
You will surely find it difficult if you want to expand your code and also having debug messages.
They may also slow down your robot's overall speed.
Your overall code is quite impressive and nicely done containing details that for most of us may seem useless but are the one who makes the difference and give the robot a very good precission...
Keep trying...
P.S.
I think that if you activate the Hide_Shadow mode you will have problem with you bot...
It may stuck...
But this may not be true because you have the other two SubRoutines...
then...my bad...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rule your Destiny-
--Be Good. Be Bad. Be Provas--
Regards,
Lawrence
I am trying to make my own tank robot and I don't even have a boe-bot!!!
My story about electronics and robotics is a long one...
I have of course a BS2 but I didn't get it from parallax
I am from Greece, and things here are a little difficult...(about ordering anything from Parallax like servos and whatever...)
And as I stated before, you have to delete all the debug commands, think of it clearly, even if you have debug command, the robot will be always able to be connected to your computer...
P.S.
I need a little help about shift-registers, about how·they are programmed...
I have a MM74HC164 shift-register and I only know about how to control HIGH-LOW by TOGGLEing DATA_ and I need some further documentation about it in order to·expand my knowledge...
Thanks, for your time, Provas
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rule your Destiny-
--Be Good. Be Bad. Be Provas--