![]() |
||||||||||||
![]() |
||||||||||||
LEGO Lift Project | ||||||||||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
LEFO Lift: The software part I- The Idea:
We wanted a java package to control a legoMindstorm construction from the pc. It's true that some package to send opcode
(hexadecimal code of the rcx firmware instruction) or a java firmware
for the rcx tower already exists, The package delivers some methods to control the motor: startMotor, stopMotor, flipMotor, etc... or control the rcx tower: isAlive, playSound, etc... but it's also able to get the sensor values, so it provides a simple events structure that notices any listener when a sensor has been triggered.
II- The problem and some solutions given by the package: You might have noticed it, but the event model
is not sequencial and needs a thread to check each sensor at a quite
rapid time interval. YES, there is a big problem, all the commands have to be sent through the serial port and have to be sent sequentially, so we have to control the thread outputs!! The chosen solution is a pool where commands are pushed and wait to be sent when the port is not busy: this queue also implements a simple priority sorting as the user commands have to be executed immediatly, unlike the sensor checking commands that are sent every n seconds and can wait a bit... The data flow will look something like that (click to enlarge) :
III- Where Object oriented becomes hard to describe: Now I'll try to describe how the package is divided in objects. I'll make some categories:
|
![]() |
EPFL | DI | LGL |
|
|||
![]() |
|||||
Last modified 14/09/01 , Pierre Andrews. | ![]() |