/// <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); } }
/// <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()); } }
/// <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()); } }
/// <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."); }
///<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>(); }