> > I am building a small robot with 8 IR sensors (One analog > sensor on each > > side and one digital sensor at each corner). The problem is > that there are > > so many possibile detection combinations and I don't know a > good method to > > take care of them all. If I write the control program for all > different > > combination, one by one, it would be too much coding... > > Assign each sensor a relative strength and direction. > > Sum them all together as vectors and the resulting vector can be > used as the direction the robot should (or shouldn't) go in. > > Ed Koffeman I don't think this to be a good approach. The robot should move ONLY in the direction where it does not detect any obstacle. This reminds me the problem of "defuzzing" the output of a fuzzy controller. It could happen, for instance that when facing an obstacle a rule could say "go to the right" and another one "go to the left", and a bad defuzzing rule could translate both as "go ahead" ! :-( First of all, the robot should know where it should go, and once this is clear, some kind of obstacle avoidance strategy should be implemented (for instance, trying to avoid the obstacle by the left or the right hand side, following the obstacle till a clear path to the goal is found). Path planning is a VERY COMPLEX subject, but you can figure obstacle avoidance techniques that while cannot be guaranteed to work always, in MOST CASES will do the job. Cheers Joan -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu