예제 #1
0
        public void position_nao()
        {
            if (coms.naoStatus.ip == null || coms.naoStatus.port == 0)
            {
                nao_status = false;
            }
            else
            {
                try
                {

                    tools tool = new tools(coms.naoStatus.ip, coms.naoStatus.port);
                    behavior manager = new behavior(coms.naoStatus.ip, coms.naoStatus.port);

                    if (manager.start("initialPosition_SitStraight"))
                    {

                        nao_status = true;
                    }
                    else
                    {
                        nao_status = false;
                    }
                }
                catch (Exception)
                {
                    nao_status = false;
                }
            }
            kinect_status = false;
            foreach (var potentialSensor in KinectSensor.KinectSensors)
            {
                if (potentialSensor.Status == KinectStatus.Connected)
                {
                    kinect_status = true;
                    break;
                }
            }
        }
예제 #2
0
        public void connect_nao()
        {
            if (coms.naoStatus.ip == null || coms.naoStatus.port == 0)
            {
                nao_status = false;
            }
            else
            {
                try
                {
                    tools tool = new tools(coms.naoStatus.ip, coms.naoStatus.port);
                    if (tool.tryConnection())
                    {

                        nao_status = true;
                    }
                    else
                    {
                        nao_status = false;
                    }
                }
                catch (Exception)
                {
                    nao_status = false;
                }
            }
            kinect_status = false;
            foreach (var potentialSensor in KinectSensor.KinectSensors)
            {
                if (potentialSensor.Status == KinectStatus.Connected)
                {
                    kinect_status = true;
                    break;
                }
            }
        }