/** @param args */
  public static void main(String[] args) {

    // Work on this map
    RPLineMap lineMap = MapUtils.create2014Map2();

    // Grid map configuration

    // Grid junction numbers
    int xJunctions = 10;
    int yJunctions = 7;

    float junctionSeparation = 30;

    int xInset = 14;
    int yInset = 31;

    IGridMap gridMap =
        GridMapViewer.createGridMap(
            lineMap, xJunctions, yJunctions, xInset, yInset, junctionSeparation);

    // the starting position of the robot for the simulation. This is not
    // known in the action model or position distribution
    int startGridX = 2;
    int startGridY = 1;

    // this converts the grid position into the underlying continuous
    // coordinate frame
    Point startPoint = gridMap.getCoordinatesOfGridPosition(startGridX, startGridY);

    // starting heading
    float startTheta = Heading.toDegrees(Heading.PLUS_X);

    Pose startPose = new Pose(startPoint.x, startPoint.y, startTheta);

    // This creates a simulated robot with single, forward pointing distance
    // sensor with similar properties to the Lego ultrasonic sensor but
    // without the noise
    SimulatedRobot robot = SimulatedRobot.createSingleNoiseFreeSensorRobot(startPose, lineMap);

    // This does the same as above but adds noise to the range readings
    // SimulatedRobot robot = SimulatedRobot.createSingleSensorRobot(
    // startPose, lineMap);

    MarkovLocalisationSkeleton ml =
        new MarkovLocalisationSkeleton(robot, lineMap, gridMap, junctionSeparation);
    ml.visualise();
    ml.run();
  }
Exemple #2
0
 public TSP() {
   GridMap providedMap = MapUtils.createMarkingWarehouseMap();
   m = new Map(providedMap);
 }