Society of Robots - Robot Forum
|
Robot Tutorials
|
FAQ
|
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Squirrels have fuzzy tails.
Home
Help
Search
Login
Register
Society of Robots - Robot Forum
»
General Misc
»
Robot Videos
»
object avoidance photovore
Print
Author
Topic: object avoidance photovore (Read 2796 times)
0 Members and 1 Guest are viewing this topic.
quickflame
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!
Logged
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!
Logged
"Less than a drop of blood in me remains that does not tremble;
I recognize the signals of the ancient flame"
Print
Society of Robots - Robot Forum
»
General Misc
»
Robot Videos
»
object avoidance photovore
data_list