예제 #1
0
 public NavigationController(MainController main, NaoController nao, ObjectLibrary lib)
 {
     this.stopped = false;
     this.nao = nao;
     this.lib = lib;
     this.main = main;
 }
예제 #2
0
 public CommandGrammarBuilder(MainController.State state, ObjectLibrary lib)
 {
     this.strings = new List<string>();
     switch (state)
     {
         case MainController.State.waiting:
             this.grammar = buildWaitingGrammar();
             break;
         case MainController.State.start:
             this.grammar = buildStartGrammar(lib);
             break;
         case MainController.State.learn:
             this.grammar = null;
             break;
         case MainController.State.find:
             this.grammar = buildFindGrammar();
             break;
         case MainController.State.confirmation:
             this.grammar = buildConfGrammar();
             break;
         case MainController.State.getName:
             this.grammar = buildGetNameGrammar();
             break;
         case MainController.State.getProperties:
             this.grammar = buildGetPropertiesGrammar();
             break;
     }
 }
예제 #3
0
        public ObjectLibrary(MainController parent, Rpc.Client client)
        {
            this.objects = new SerializableDictionary<string, RecogObject>();
            this.lookupByProperty = new SerializableDictionary<string, List<RecogObject>>();
            this.knownPointClouds = new Dictionary<string, PointCloud>();
            this.unknownPointClouds = new Dictionary<string, PointCloud>();

            this.client = client;
        }
예제 #4
0
        public VoiceRecogition(Controller.MainController.Mapping mapping, MainController controller)
        {
            this.controller = controller;
            this.recogEng = new SpeechRecognitionEngine();
            recogEng.SetInputToDefaultAudioDevice();

            recogEng.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(speechRecog_success);
            recogEng.SpeechRecognitionRejected += new EventHandler<SpeechRecognitionRejectedEventArgs>(
                    speechRecog_failure);

            recogEng.LoadGrammar(CreateSampleGrammar(mapping));
            this.start();
        }
예제 #5
0
        private void initialize(Grammar grammar, MainController controller, bool start)
        {
            if (grammar != null)
            {
                this.controller = controller;
                this.recogEng = new SpeechRecognitionEngine();
                recogEng.SetInputToDefaultAudioDevice();

                recogEng.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(speechRecog_success);
                recogEng.SpeechRecognitionRejected += new EventHandler<SpeechRecognitionRejectedEventArgs>(
                    speechRecog_failure);
                recogEng.LoadGrammar(grammar);
                if (start)
                {
                    this.start();
                }
            }
        }
예제 #6
0
 public NaoController(string ip, MainController main)
 {
     try
     {
         this.main = main;
         this.ip = ip;
         prevAng = PI;
         proxy = new MotionProxy(ip, 9559);
         if (this.ip != "127.0.0.1")
         {
             tts = new TextToSpeechProxy(this.ip, 9559);
         }
         else
         {
             tts = null;
         }
         //this.setStiffness(1.0f);
     }
     catch (Exception e)
     {
         Console.Out.WriteLine("Connect exception: " + e);
     }
 }
예제 #7
0
        public ObjectLibrary(MainController parent, Rpc.Client client, string path)
        {
            this.objects = new SerializableDictionary<string, RecogObject>();
            this.lookupByProperty = new Dictionary<string, List<RecogObject>>();
            this.knownPointClouds = new Dictionary<string, PointCloud>();
            this.unknownPointClouds = new Dictionary<string, PointCloud>();

            this.shut_down = false;
            this.block = false;

            this.parent = parent;
            this.client = client;

            if (System.IO.File.Exists(path))
            {
                string[] lines = System.IO.File.ReadAllLines(path);
                foreach (string line in lines)
                {
                    RecogObject obj = RecogObject.fromString(line);
                    this.addObject(obj);
                }
            }
        }
예제 #8
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     controller = new MainController(this);
 }
예제 #9
0
 public ForeCastViewModel()
 {
     _controller     = MainController.Instance;
     GrowthInPercent = _controller.GetGrowthInPercent();
 }
예제 #10
0
 public VoiceRecogition(Grammar grammar, MainController controller)
 {
     this.initialize(grammar, controller, false);
 }
예제 #11
0
 public VoiceRecogition(MainController.State state, MainController controller)
 {
     this.initialize(new CommandGrammarBuilder(state, controller.getLibrary()).getGrammar(), controller, true);
 }