Exemplo n.º 1
1
        public SLAM(double mapWidth, double mapHeight, double cellSize, string port)
        {
            robot = new Robot ();
            map = new SlamMap (robot, mapWidth, mapHeight, cellSize);
            mapView = new MapView (map);

            ekfSlam = new EkfSlam (1); // 1 degree per scan.

            proxy = SerialProxy.GetInstance;
            proxy.Port = port;

            proxy.OdometryUpdated += new EventHandler<OdometryUpdateEventArgs> (SerialProxy_OdometryUpdate);
            proxy.Scanned += new EventHandler<ScanEventArgs> (SerialProxy_Scan);

            window = new MapWindow (mapView);

            window.DeleteEvent += delegate
            {
                proxy.Release ();
            };

            //AddSampleLandmarks ();
        }
Exemplo n.º 2
0
        public MainClass(string port, int baudRate)
        {
            proxy = SerialProxy.GetInstance;
            proxy.Port = port;
            proxy.BaudRate = baudRate;

            robot = new Robot ();

            proxy.OdometryUpdated += new EventHandler<OdometryUpdateEventArgs> (SerialProxy_OdometryUpdate);
            proxy.Scanned += new EventHandler<ScanEventArgs> (SerialProxy_Scan);
            proxy.Start ();
        }