コード例 #1
0
        private void waitClient()
        {
            _server = new Server(StereoVision.PORT);
            _server.waitConnection();
            _connected = true;

            _vrAibo.Dispose();
            _frmVrAiboRemote.Dispose();

            _vrAibo = new GLab.VirtualAibo.VrAibo(parcours)
            {
                Position = START_POS, Rotation = START_ANGLE
            };
        }
コード例 #2
0
        public override void Setup()
        {
            /*
             * DEFAULT PARCOURS LAB TASK WITH TERRAIN
             */
            parcours = new List <Parcours>
            {
                new ParcoursTerrain(),
                new Parcours00(0, 0, 0, false),
                new Parcours01(1, 0, -90, false),
                new Parcours02(1, 1, 180, false),
                new Parcours03(0, 1, 90, false)
            };

            // Creates a new Virtual Aibo
            _vrAibo = new GLab.VirtualAibo.VrAibo(parcours)
            {
                Position = START_POS, Rotation = START_ANGLE
            };

            /*
             * TREASURE LAB TASK
             */
            //List<Parcours> stripes = new List<Parcours>
            //                             {
            //                                 new Stripe00(),
            //                                 new Stripe01(),
            //                                 new Stripe02(),
            //                                 new Stripe03(),
            //                                 new StripeTreasure()
            //                             };

            /*
             * TREASURE LAB TASK WITH TERRAIN
             */
            //List<Parcours> stripes = new List<Parcours>
            //                             {
            //                                 new ParcoursTerrain(),
            //                                 new Stripe00(false),
            //                                 new Stripe01(false),
            //                                 new Stripe02(false),
            //                                 new Stripe03(false),
            //                                 new StripeTreasure(false)
            //                             };

            // Creates a new Virtual Aibo
            //_vrAibo = new GLab.VirtualAibo.VrAibo(stripes) { Position = new Vector2(0, 20) };

            // Use left and right cameras, omit center camera
            _vrAibo.ShowLeftCamera(true);
            _vrAibo.ShowRightCamera(true);
            _vrAibo.ShowCenterCamera(false);

            // Create a remote control window an link to Aibo instance
            _frmVrAiboRemote = new FrmVrAiboRemote(_vrAibo, _timer);

            // Hook functionality to blue green and red button.
            _frmVrAiboRemote.HookMeBlue  += delegate { GoAibo = !GoAibo; };
            _frmVrAiboRemote.HookMeGreen += ImageProcessing;
            // _frmVrAiboRemote.HookMeRed += delegate { };

            Logger.Instance.LogInfo("Use Aibo remote to walk around.");
            Logger.Instance.LogInfo("Walk onto the red line and press the BLUE button to start line tracking.");

            // Setup stereo vision facilities
            _stereoVision = new GLab.StereoVision.StereoVision(
                GLab.VirtualAibo.VrAibo.SurfaceWidth,
                GLab.VirtualAibo.VrAibo.SurfaceHeight,
                _vrAibo.Disparity * 200
                );
            Start();
        }