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 / 4742
4741  |  4743
Subject: 
Re: A robot who knows his position (fwd)
Newsgroups: 
lugnet.robotics
Date: 
Fri, 30 Apr 1999 16:13:19 GMT
Viewed: 
2778 times
  
In lugnet.robotics, lego-robotics@crynwr.com (Ralph M. Deal) writes:
> On Fri, 30 Apr 1999, Mike Moran wrote:
> 
> . . .
> > Now I come to think of it, if you allowed the light sensor to move such that
> > it could follow the head of the arrow, then we could arrange it so that the
> > light sensor starts off above the bright arrow. However, when the arrow • moves
> > as a result of movement then the light sensor assembly starts "seeking" • right
> > and left until it encounters the bright arrow again. Since the assembly • knows
> > how far it has travelled, and in what direction, it can give a reading on
> > bearing. Unfortunately this would require use of a motor and some fidgeting
> > around with some code to drive the thing. However, it sounds like it may be
> > do-able and useful.
> > Can anyone see any problems with this?
> 
> Yes.  It is unnecessarily clumsy and heavy and would require considerable
> computer attention to track rotation successfully.

That sounds like a challenge to me! ;-) I may just try and build something to
prove it can be done or can't be done easily. I believe the attention required
from the computer could be minimal. A first go at the algorithm would be:

#define INCREMENT <some time>
#define CIRCUMFERENCE <some number of increments>
sub moveLeftAnInc {}
sub moveRightAnInc {}

int aboveArrowLightLevel;
sub aboveArrow {}

int direction;
sub init {
  // find the arrow
  while (!foundArrow) {
    moveLeft();
  }
  direction = 0;
  aboveArrowLightLevel = <current level>;
}

int tmpDirection;
int seekTo;
int foundArrow; // 0 = false, 1 = true
int lostArrow;
int count;
task trackArrow {
  init();
  foundArrow = 1;
  lostArrow = 0;
  while (!lostArrow) {
    wait (!aboveArrow()); // dunno if you can do this in wait
    // seek the arrow
    tmpDirection = direction;
    seekTo = 1;
    foundArrow = 0;
    while (!foundArrow) {
      if (abs(seekTo) >= CIRCUMFERENCE) {
        lostArrow = 1; break;
      }
      // look left
      while (count != seekTo && !foundArrow) {
        moveLeftAnInc();
        if (aboveArrow()) {
          foundArrow = 1;
        }
        count += 1;
      }
      if (!foundArrow) {
        // look right
        < ... similar to look left ... >
      }
      seekTo *= 2;
    }
  }
}

Thier are some bugs in this impl. but basically its: first sample to find where
the arrow is, then as soon as you lose it, look further and further away until
you find it. It doesn't matter *too* much if you missed an intermediate value,
since you still know where you are pointing *know*. I think I'll have a go at
this at the weekend.

>                                                   I believe digital
> encoding would be better.

Of course it would, but beggers can't be choosers; I, personally, don't know
enough about electronics to build things from a circuit diagram and don't have
enough dosh to buy some of the sensors that have been mentioned.



Message is in Reply To:
  Re: A robot who knows his position (fwd)
 
On Fri, 30 Apr 1999, Mike Moran wrote: . . . (...) Yes. It is unnecessarily clumsy and heavy and would require considerable computer attention to track rotation successfully. I believe digital encoding would be better. Anyone know how one determines (...) (27 years ago, 30-Apr-99, to lugnet.robotics)

6 Messages in This Thread:



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

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