public bool connect(string ip, bool onlymotion = false) { this.IP = ip; bool b = false; try { proxyMotion = new MotionProxy(ip, Port); if (onlymotion == false) { bool bc = proxyMotion.setCollisionProtectionEnabled("Arms", false); if (!bc) Console.WriteLine("Failed to disable collision protection"); StartMotorMonitor(); proxyBehaviorManager = new BehaviorManagerProxy(ip, Port); // Turn off the LEDs proxyLed = new LedsProxy(ip, Port); List<string> ledgroups = proxyLed.listGroups(); foreach (string ledgroup in ledgroups) { proxyLed.off(ledgroup); } // Speech proxyTTS = new TextToSpeechProxy(ip, Port); if (ip != "127.0.0.1") { // Sentinel proxySentinel = new SentinelProxy(ip, Port); // Turning off "Motor hot!" proxySentinel.enableHeatMonitoring(false); } // camera proxyCamera = new VideoDeviceProxy(ip, Port); // IdleMovement InitIdleMovement(); } b = true; } catch (Exception e) { Console.WriteLine("MotionProxy.Connect Exception: " + e); b = false; } IsConnected = b; return b; }
public Leds(string ip, int port) { LedsProxy led = new LedsProxy(ip, port); led.on("ChestLedsRed"); Thread.Sleep(2000); led.on("ChestLedsGreen"); Thread.Sleep(2000); led.off("ChestLeds"); }
public MainWindow(string ip,int port,int condition) : this() { this.ip = ip; this.port = port; this.condition = condition; this.started = false; led = new LedsProxy(ip, port); led.off("ChestLeds"); led.on("ChestLedsGreen"); completeCheck = new Check.Check(); }
public MainWindow(string ip,int port,int condition) : this() { this.ip = ip; this.port = port; led = new LedsProxy(ip, port); led.off("ChestLeds"); led.on("ChestLedsGreen"); this.condition = condition; this.started = false; this.interupted = false; }
public MainWindow(string ip, int port, int condition) { count = 1; this.ip = ip; this.port = port; this.condition = condition; ready = true; this.Background = new SolidColorBrush(Colors.LightGreen); InitializeComponent(); this.tts = new TextToSpeechProxy(ip, port); gazeControl = new GazeControl(ip, port); this.led = new LedsProxy(ip, port); led.off("ChestLeds"); led.on("ChestLedsGreen"); started = false; }
public MainWindow(string ip, int port, int condition) { this.ip = ip; this.port = port; this.condition = condition; InitializeComponent(); completeCheck = new Check.Check(); ready = true; this.Background = new SolidColorBrush(Colors.LightGreen); gazeControl = new GazeControl(ip, port); kinect = new HCI.GAS.Kinect.KinectAudio("XMLs\\Thoughtfulness_Grammar.xml",ip,port); led = new LedsProxy(ip, port); led.off("ChestLeds"); led.on("ChestLedsGreen"); //TODO: check if auto has been depreciated. kinect.auto = false; end = false; tts = new TextToSpeechProxy(ip, port); }
public void ledOff() { LedsProxy led = new LedsProxy(coms.naoStatus.ip, coms.naoStatus.port); led.off("ChestLeds"); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { end = true; if (gazeControl != null) gazeControl.end(); if (kinect != null) kinect.EndKinect(); LedsProxy led = new LedsProxy(ip, port); led.off("ChestLeds"); led.on("ChestLedsRed"); kinect = null; }