Subject:
|
Re: legOS (-> Interdisciplinary Learning?)
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Tue, 1 Dec 1998 21:40:32 GMT
|
Original-From:
|
Tim McSweeney <TIM@AMS.CO.stopspamNZ>
|
Viewed:
|
2622 times
|
| |
| |
A simpler way to look at this is to say a message consists of 8 bits (hece
0-255)
Bit 1 = team 0=prey 1=predator (High Bit)
Bit 2 = state, 0=mobile 1=active
Bit 3 = light
Bit 4 = Touch
Bit 5 = Compound RCX
Bit 6 = Inquire/Respond
Bits 7 and 8 = bot number (0 to 3) (Low Bit)
I can't remember if the RCX has bitwise operations and I'm at work so I
can't go looking it up but the easy way to test it is to do a logical and of
the message with a bit mask and check for equality with 0
For example if we want to test of the message we recieved has a light sensor
w do
if (msg AND 00100000) equals 0 then it's has a light sensor else it doesn't
The bot number is extracted by
(msg and 00000011) which should give you an 8 bit integer number in the
range 0 to 3
Note: this is a bit kack handed, it's more traditional to use a one bit to
represent the presence of something rather than absence but that's up to
you.
Cheers
Tim
-----------------------------------------------------------------------
int main(int _,int __){int i[3]={0xFE101010,0xFE1010FE,0xFE929282};if(_
==1)for(_=0,__=0;(__<4);_=(_+1>=24)?++__+0*putchar('\n'):_+1){putchar(
main(_+2,__)?(main(_+2,__+1)?' ':'_'):' ');main(_+2,__)&&!main(_+3,__)?
putchar('/')+0x0*_++:0;}else return((_>=26)||(__>=4))?0:i[(_-2)/8]>>(3-
__)*8>>(_-2)%8&0x1;}
-----------------------------------------------------------------------
> X = the IR send number.
>
> X <= 128 indicates that the RCX is on 'team one' (or,
> alternately, 'prey').
> X > 128 indicates 'team two', or 'predator'. X = X - 128.
>
> X <= 64 indicates that the RCX is mobile/in motion.
> X > 64 indicates that the RCX is stationary. X = X - 64.
>
> X <= 32 indicates that the RCX has (one or more) light sensors.
> X > 32 indicates that the RCX has no light sensor. X = X - 32.
>
> X <= 16 indicates that the RCX has (one or more) touch sensors.
> X > 16 indicates that the RCX has no touch sensors. X = X - 16.
>
> X = 8 indicates that the RCX is attached to a bot with more
> than one RCX.
> X > 8 indicates that the RCX is solo. X = X - 8.
>
> X <= 4 indicates that the RCX is inquiring/pinging.
> X > 4 indicates that the RCX is answering/responding. X = X - 4.
>
> This leaves us with X equal to 1 through 4. We use this last number to
> distinguish bots on a team (obviously, in this example, there
> could be a max
> of 4 bots on a team).
>
> So, to sum up this overblown and excessive data transfer:
>
> A bot sends the code 236. X = 236.
> 236 > 128. The bot is on team 2 (a predator). 236 - 128 = 108.
> 108 > 64. The bot is stationary (perhaps a venus fly-trap).
> 108 - 64 = 44.
> 44 > 32. The bot has no light sensor. 44 - 32 = 12.
> 12 <= 16. The bot has one or more touch sensors. 12 - 0 = 12.
> 12 > 8. The bot only has one RCX. 12 - 8 = 4.
> 4 <= 4. The bot is sending the message as a 'ping', or
> question. 4 - 0 = 4.
>
> X now equals 4. This means the bot is bot #4 on the predator team.
>
> So, you've got a stationary predator without light sensors,
> but with touch
> sensors, running on a single RCX, that is requesting
> information from the
> world in general (perhaps another predator, upon hearing
> this, will respond
> with an 'answer' to inform Predator #4 that it is in the
> vicinity -- or,
> upon hearing this request, a prey bot might use a flashing
> light (being
> aware that Predator #4 has no light sensors) to notify its
> teammates of its
> location.) A little far-fetched, but with enough forethought,
> a lot can be
> achieved using communication this basic.
>
> Simplistic, yes, but it shows that you can jam a lot of data into one
> number. And sending a sequence of IR transmissions is also a
> fairly easy
> process, to allow you a much more complex string of data.
>
> Of course, we've already contemplated bots that purposefully
> lie... which,
> in my mind, is getting quite a bit too close to human for
> comfort. Could the
> polygraph sensor be far behind?
>
> -- Tom Pierce
>
>
>
>
>
>
> >
> >
> > Stefano
> >
> >
> >
> >
> >
> >
> >
> > +-----------------------------------------------------------+
> > | Stefano Franchi |
> > | |
> > | Department of Philosophy Phone: Off: (650) 723-2192 |
> > | Stanford University Home: (650) 497-2812 |
> > | Stanford, CA 94305 Fax: (415) 723-0985 |
> > | USA |
> > | |
> > | e-mail: franchi@csli.stanford.edu |
> > +-----------------------------------------------------------+
> >
> >
>
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
Active threads in Robotics
|
|
|
|