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 / 8840
8839  |  8841
Subject: 
LNP <--> Java Interface
Newsgroups: 
lugnet.robotics
Date: 
Wed, 8 Dec 1999 06:23:38 GMT
Viewed: 
766 times
  
Well I have a program now which can talk LNP over the IR tower both send and
receive. Its running on a Solaris machine, because currently sun only
officially support the comm.api under Solaris and Windows (apparently there is
a port to unix but as yet still untested).

I am interestd to note that someone has found a bug in the collision detection
routines in legOS. Before I had the java thing running I had a small token
passing system going with 4 RCX's and found that sometimes the token would just
disappear (even when the RCX's were stationary). I might try those fixes but I
am still unsure how to implement collision detection in Java. I was just going
to check the packet format and if it was not what was expected (ie wrong header
or length or checksum or something) then I was going to ask the transmitting
RCX to resend.

Of course to get it to resend I would have to write a special task on the RCX
which saved the previously sent packet and resent it if required. So anyone
with any info on where I can start to look for collision detection information
would be appareciated.

Anyhow just a bit more on my java code. There is a reading thread and a writing
thread which are controlled by an "lnp-interface" class. So you create an
instance of lnp-interface and it can then use a method called "lnpSEND (dest
host, dest port, message)". The receiving was a bit trickier because its
asynchronous. We never know when messages are going to arrive.

The implementation I currently have is that when you create an instance of
lnp-interface you also create an instance of a "registry". There is an
lnp-event abstract interface which when implemented in an object allows an
object to listen for events on a certain host/port pair. Basically the listener
object gets created and then registers interest by sending a message to the
registry. When a valid LNP message is received it is passed to the registry and
then the registry tells all objects who have registered an interest in incoming
messages on hostx/porty there is a message and passes them the message
including the source port information.

Anyhow that is basically it. We don't have a website at the moment so I can't
post the code but if anyone is interested then please just drop me an email and
I can zip up the code and send it. There still needs to be some modifications.

key things that I would like to look deeper into are
1) collision detection routines
2) fixing up my keepalive ping so that it only pings if there has not been send
activity in the last 4 seconds (about how long an IR tower seems to last
between sends before it shuts down)

Any ideas/comments/questions or suggestions please email me

cheers
michael



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