Index: lib/Status.java =================================================================== --- lib/Status.java (revision 22) +++ lib/Status.java (working copy) @@ -9,7 +9,10 @@ ***/ public class Status { + /** The number of degrees between each scan. */ public static final int DEGREES = 30; + + /** The number of laser scans. */ public static final int NUM_SCANS = 180/DEGREES + 1; /** Rotation taken before moving. */ @@ -20,6 +23,12 @@ /** The distance moved. */ public float distance; + + /** The real robot x-position. */ + public int realX; + + /** The real robot x-position. */ + public int realY; /** Sensor readings every 30 degrees. */ public int[] sensors; @@ -49,6 +58,7 @@ /** Basic constructor, everything is set to 0. */ public Status() { + realX = realY = 0; distance = 0.0f; initialRotation = 0.0f; finalRotation = 0.0f; Index: lib/RobotModel.java =================================================================== --- lib/RobotModel.java (revision 24) +++ lib/RobotModel.java (working copy) @@ -85,6 +85,18 @@ } } + /** Return the minimum x coordinate. */ + public int getMinX() { return mMap.mMinX; } + + /** Return the minimum y coordinate. */ + public int getMinY() { return mMap.mMinY; } + + /** Return the maximum x coordinate. */ + public int getMaxX() { return mMap.mMaxX; } + + /** Return the maximum y coordinate. */ + public int getMaxY() { return mMap.mMaxY; } + private void initialize() throws IOException { // look ahead until we find the first scan @@ -216,6 +228,8 @@ mMap.realRobotR = realro[0]; mMap.realRobotX = realxy[0]; mMap.realRobotY = realxy[1]; + status.realX = realxy[0]; + status.realY = realxy[1]; } debug.println("Located at ("+mMap.robotX+","+mMap.robotY+") "