Screenshots
I will write a more detailed description of the improvements tomorrow.
If you want to see us demo the robot you should be @ Berzeliusskolan tomorrow (11/11) @ 18.00.
/Peter F
A SLAM implementation using LEGO Mindstorms NXT and leJOS.
// Setup data factories
// They produce empty instances of the data objects
NXTCommunicationDataFactories DataFactories = new NXTCommunicationDataFactories(
new ServerMessageDataFactory(), new TiltSensorDataFactory());
// Setup ..
NXTCommunication NXTC = new NXTCommunication(true, DataFactories,
new NXTDataStreamConnection());
// .. and start the communication
NXTC.ConnectAndStartAll(NXTConnectionModes.USB);
// Setup a data processor
// It will be given the incoming queue of data and handle it
ServerMessageDataProcessor SMDP = new ServerMessageDataProcessor(NXTC, DataFactories);
SMDP.start();
//Add some data to the send queue
NXTC.sendData(new TiltSensorData(TS.getXTilt(), TS.getYTilt(), TS.getZTilt()))public class SensorDataFactory implements INXTCommunicationDataFactory {
@Override
public SensorData getEmptyInstance() {
return new SensorData(NXTCommunicationData.MAIN_STATUS_NORMAL,
NXTCommunicationData.DATA_STATUS_EMPTY);
}
@Override
public INXTCommunicationData getEmptyIsShuttingDownInstance() {
return new SensorData(NXTCommunicationData.MAIN_STATUS_SHUTTING_DOWN,
NXTCommunicationData.DATA_STATUS_ONLY_STATUS);
}
@Override
public INXTCommunicationData getEmptyShutDownInstance() {
return new SensorData(NXTCommunicationData.MAIN_STATUS_SHUT_DOWN,
NXTCommunicationData.DATA_STATUS_ONLY_STATUS);
}
} @Override
public void ProcessItem(INXTCommunicationData dataItem,
NXTCommunication NXTComm) {
SensorData SensorDataItem = (SensorData) dataItem;
Acceleration.add(new AccelerationValues(SensorDataItem.getAccX(),
SensorDataItem.getAccY(), SensorDataItem.getAccZ()));
}In the third year of Swedish Gymnasium (roughly equivalent to 4th year in high school) every student has to make a project concerning at least one of the fields he/she studies. PenemuNXT is our project.
/Josef and Peter