Saturday, January 17, 2009

pc program

GUI

The GUI gives a overview of the samples (green dots), and the average of the samples is showed with a red circle, on the map. This data (green dots and red circle) is updated each time the robot car moves, and they are showed in the top console. Where to the robot car should move is done manuel by sending the distance and angel to turn. The map loaded/showed by the GUI is also the one used in the MCL algorithm.

MCL2D algorithm implementation

The implementation of the MCL2D algorithm is object orientated. The basis for the algorithm is
the sample class with consist of the position p = (x,y,t) and the importance i.
Furthermore there is the implementation of the MCL algorithm which is the class called MCL.
There are several constructors with are able to set the important variables:

samplescount = number of samples used in one round.
xrange and yrange = maximal range of the physical map with respect to the maps direction.
nx and ny = pixelwise resolution of the map representation.

In the beginning the function "initialise" makes it possible to set the samples randomly and
equally distributed on the map which is represented as a picture.
The function "setAllTheta" makes it possible to set all the angles of the samples with respect to
the direction to the same values.
The belief is represented by the function "expectedPosition" with calculates the average of the
samples, it could be a good idea to use other (clustering-) methods to calculated the belief.

The most important function is the "update" function which updated the samples and the belief.
The function gets the offset of the robot as well as the actual sensor readings and the uncertainty.

Implemented classes
- window.java (main)
- myMeasurements.java
- MyCanvas.java
- bluetooth.java

- MCL.java
- MyImage.java
- Position.java
- Sample.java

No comments: