Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            //Connect to LiDAR
            lidarController = new LidarController("192.168.0.100", 2111); // Real Robot

            //COnnect to Motor Controller
            motorController = new MotorController(motorPort);
            motorController.Connect();

            //initialize obstacle detection tolerances
            Obstacle.ObstacleInitialize(15, 150, 5, 200);//maxrarius of 15m,

            //ImportLandmark Locations from Text file
            knownLandmarks = Localization.KnownLandmarksInit(@"..\..\landmarksDay2.txt");

            //Specify which XY Location the robot will start in the field at
            //YetiLocation = new LocationPoint(0.5, -1, 0);
            // YetiLocation = new LocationPoint(0.25, -1, 0);
            //YetiLocation = new LocationPoint(0.0, -1, 0);
            YetiLocation = new LocationPoint(0.0, 0, 0);

            //IMPORT the locations of the Waypoint navigation targets
            //TargetLocationList = Target.ReadLocationData(@"..\..\navigationQualification.txt");
            //TargetLocationList = Target.ReadLocationData(@"..\..\navigationDay1.txt");
            TargetLocationList = Target.ReadLocationData(@"..\..\navigationTripleIFinal.txt");
            TargetLocation     = TargetLocationList[0]; //set first target as first from txt file
            PrevTargetLocation = new Target();          //initialize previous target to null

            //Initialize the Yeti Location history for Stall detection
            YetiHistory = new Queue <LocationPoint>(YetiHistorySize); //stall detection

            //this is flag which specifies if this is the first lidar scan. This is set to false after the first LiDAR scan
            keepCorrecting = true;//do once

            //Main loop where all of the fun stuff happens
            while (AutonomousEnabled)
            {
                ScanThread();
            }
        }//end main