public void calcPath() {

        if (main.map == null) return;
        if (main.commands == null) return;

        if (main.commands.count == 0) return;

        rover = new MapRover();
        rover.point.x = main.map.roverStart.point.x;
        rover.point.y = main.map.roverStart.point.y;
        rover.heading = main.map.roverStart.heading;

        points = 0;
        roverNewPoint();

        int c = 0;
        while (c < main.commands.count) {
            c++;

            switch (main.commands.type[c]) {
                case CommandList.COMMAND_LEFT :
                    roverLeft(main.commands.value[c]);
                    travelDegrees += main.commands.value[c];
                    roverNewPoint();
                    break;
                case CommandList.COMMAND_RIGHT :
                    roverRight(main.commands.value[c]);
                    travelDegrees += main.commands.value[c];
                    roverNewPoint();
                    break;
                case CommandList.COMMAND_FORWARD :
                    roverForward(main.commands.value[c]);
                    travelDistance += main.commands.value[c];
                    roverNewPoint();
                    break;
                case CommandList.COMMAND_TEST :
                    MapExperiment experiment = main.map.getExperiment(main.commands.note[c]);
                    if (experiment != null) {
                        
                        int e = findTestResult(experiment.id);
                        testResult[e].id = experiment.id;
                        testResult[e].point.x = rover.point.x;
                        testResult[e].point.y = rover.point.y;
                        testResult[e].distError = experiment.point.distance(rover.point.x, rover.point.y);
                        testResult[e].completed = true;
                        
//                        point[points].testID = experiment.id;
//                        point[points].testError = experiment.point.distance(rover.point.x, rover.point.y);
//                        System.out.println(experiment.id + " Error = " + point[points].testError);
//                        System.out.println(experiment.point.toString());
//                        System.out.println(rover.point.toString());
                        experimentError += testResult[e].distError;
                    }
                    break;
            }
        }
        //System.out.println("motion path calced points = " + points);

    }