Author Topic: object avoidance photovore  (Read 1622 times)

0 Members and 1 Guest are viewing this topic.

Offline quickflameTopic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
object avoidance photovore
« on: October 15, 2009, 07:15:24 PM »
is it possible to add an ability to a photovore/light follower robot to have an ability to avoid objects?
and how woud this be attained???  has anyone did this before? any help woud be appreciated (ideas,schematic diagrams, programming) thanks!

Offline parallax

  • Full Member
  • ***
  • Posts: 94
  • Helpful? 1
Re: object avoidance photovore
« Reply #1 on: October 16, 2009, 09:47:56 AM »
If you give the range-finding sensor priority over your photoresistors in the code you'll be all set. This can be achieved with an if-else statement in the main loop of your program. Here's some example psuedo-code:

Do-While(){
if (object is to close){
    avoidance_behavior();
    exit();
    }else{
    Lightseeking/fleeing_behavior();
    }
Other code here
}
End_Do-While

If the first condition is true then the robot will skip the light seeking (or fleeing depending if your building a photovore or a photophobe) and go into whatever avoidance routine you program. Otherwise it will continue to love or hate the light.  ;)

Hope that helps!
   
 
 
"Less than a drop of blood in me remains that does not tremble;
I recognize the signals of the ancient flame"

 


Get Your Ad Here