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 / 22683
22682  |  22684
Subject: 
Re: Competitive MINDSTORMS: try again...
Newsgroups: 
lugnet.robotics
Date: 
Fri, 20 Aug 2004 18:14:19 GMT
Viewed: 
1307 times
  
In lugnet.robotics, Steve Hassenplug wrote:
In lugnet.robotics, David Perdue wrote:

It provides the program
with a reading of the light in the room once, but never again.

Therefore, in this line of code:

if(LBump<=thresh | LBump==100)

the first part says that if LBump is less than the value of thresh


Actually, it says that if LBump is less than OR EQUAL TO the value of thresh...


Yes, that's correct.

Which means if the light in the room NOW is the same (or less than) the light in
the room when the program started running, then "we have the opponent in sight"



Likewise, if LBump starts to read that it is equal to
thresh+5--a value which is taken once and will never change--it knows that it
has lost sight of the opponent.


So, if the light in the room is brighter NOW then when the program started, "it
has lost sight of the opponent"

There is one piece of missing information you've missed that is causing the
confusion: When the program starts, the program doesn't put the normal light
value of the room into the variable thresh - read this from the chapter:

"Let’s back up a bit. For the line-detecting light sensor, something physical
was involved in the calibration, and that physical action was placing the light
sensor over the line. For this calibration—the searching light sensor’s
calibration—physical action is involved as well. That physical action is putting
something in front of the searching light sensor: your hand! It might come as a
surprise, but your hand is a very good emulator of a sumo-bot when it comes to
calibrating the light sensor. You simply put your hand in front of the searching
light sensor, press and release the right bumper, and your searching light
sensor has been calibrated! (I’ll explain in more detail how to
properly calibrate the searching light sensor in the “Testing ZR1” section later
in this chapter.)"

You see, the variable thresh doesn't mearly store the value of the normal
lighting in the room, you put your hand in front of the light sensor--which
lowers the value the light sensor returns, about to what it would be if a
sumo-bot got that close--and then perform the calibration, essentially telling
the program, "From now on, when you read this value, you have seen the
opponent." All the instructions on how to properly perform the calibration is in
the section "Testing ZR1."

Thanks,

David J. Perdue

www.davidjperdue.com

www.davidjperdue.com/competitivemindstorms



Message has 1 Reply:
  Re: Competitive MINDSTORMS: try again...
 
(...) Again, this sounds really good, but it just won't work. Just to prove it to myself, I did a little test. I connected a light sensor to an RCX, and set it so I could read the values. As it turns out, I have four sumo robots sitting around, so I (...) (20 years ago, 21-Aug-04, to lugnet.robotics)

Message is in Reply To:
  Re: Competitive MINDSTORMS: try again...
 
(...) No, that's not what I was thinking. I see Calibrate and Calibrate2 only run at the beginning of the program. (...) Actually, it says that if LBump is less than OR EQUAL TO the value of thresh... Which means if the light in the room NOW is the (...) (20 years ago, 20-Aug-04, to lugnet.robotics)

29 Messages in This Thread:






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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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