To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 533
532  |  534
Subject: 
RE: Homebrew sensors?
Newsgroups: 
lugnet.robotics
Date: 
Sat, 14 Nov 1998 00:36:04 GMT
Original-From: 
Eric Eilebrecht <ericeil@microsoft.NOMORESPAMcom>
Viewed: 
2060 times
  
Why would you need an array to do that?  You could do it with three
variables:

var1 = starting angle
var2 = highest amplitude encountered so far
var3 = angle of highest amplitude

The algorithm goes something like this (in pseudo-C):

var1 = current_angle;
var2 = 0;
do
{
if (current_amplitude > var2)
{
var2 = current_amplitude;
var3 = current_angle;
}

turn();
}
while (current_angle != var1);

while (current_angle < var3)
{
turn()
}


Now you're pointed toward the highest-amplitude source


Eric


-----Original Message-----
From: Daniel Miller [mailto:danielmi@expert.cc.purdue.edu]
Sent: Friday, November 13, 1998 4:12 PM
To: lego-robotics@crynwr.com
Subject: Re: Homebrew sensors?


I know the logic of taking two sensors and differentiating to find
direction.  I was looking for a way to do it with only one.  I don't know
if what I proposed (do a 360 scan, then return to loudest) can be done
with the Spirit library; I think it would need arrays.  A better thing
would be to compare the current amplitude to the last.  However, the robot
would then go to the first sound it "saw" rather than the loudest.



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR