예제 #1
0
파일: Logger.cs 프로젝트: boschbc/NaoRobot
 /// <summary>
 /// speak out a message. the message is also logged.
 /// </summary>
 /// <param name="message"></param>
 public static void Say(string message)
 {
     Log(message);
     if (CanSay && NaoState.Instance.Connected)
     {
         Proxies.GetProxy <Aldebaran.Proxies.TextToSpeechProxy>().say(message);
     }
 }
예제 #2
0
        /// <summary>
        /// Unsubscribes from any sonar proxies.
        /// </summary>
        private static void UnsubscribeSonarProxies()
        {
            SonarProxy sonar = Proxies.GetProxy <SonarProxy>();

            foreach (ArrayList sub in (ArrayList)sonar.getSubscribersInfo())
            {
                sonar.unsubscribe(sub[0].ToString());
            }
        }
예제 #3
0
        /// <summary>
        /// Unsubscribes from any landmark-detection proxies.
        /// </summary>
        private static void UnsubscribeLandMarkProxies()
        {
            LandMarkDetectionProxy landmark = Proxies.GetProxy <LandMarkDetectionProxy>();

            foreach (ArrayList sub in (ArrayList)landmark.getSubscribersInfo())
            {
                landmark.unsubscribe(sub[0].ToString());
            }
        }
예제 #4
0
        /// <summary>
        /// Disconnect from the currently connected-to Nao. Will do nothing if not connected.
        /// </summary>
        public virtual void Disconnect()
        {
            if (!Connected)
            {
                return;
            }

            Logger.Log(this, "Disconnecting from Nao...");
            if (!Proxies.UnsubscribeAll())
            {
                Logger.Log(this, "Can't unsubscribe. But that's OK if you're using WeBots.");
            }
            IP        = null;
            Port      = -1;
            connected = false;
            Proxies.DisposeAllProxies();
            if (OnDisconnect != null)
            {
                OnDisconnect(IP.ToString(), Port);
            }
            Logger.Log(this, "Disconnected.");
        }
예제 #5
0
 ///<summary>
 /// Creates proxes to be used by this class only.
 /// </summary>
 private void CreateMyProxies()
 {
     motion  = Proxies.GetProxy <MotionProxy>();
     battery = Proxies.GetProxy <BatteryProxy>();
     memory  = Proxies.GetProxy <MemoryProxy>();
 }