コード例 #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
ファイル: ObjectLibrary.cs プロジェクト: omanamos/robotics
        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
ファイル: VoiceRecogition.cs プロジェクト: omanamos/robotics
        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
ファイル: VoiceRecogition.cs プロジェクト: omanamos/robotics
        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
ファイル: NaoController.cs プロジェクト: omanamos/robotics
 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
ファイル: ObjectLibrary.cs プロジェクト: omanamos/robotics
        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
ファイル: MainWindow.xaml.cs プロジェクト: omanamos/robotics
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     controller = new MainController(this);
 }
コード例 #9
0
 public ForeCastViewModel()
 {
     _controller     = MainController.Instance;
     GrowthInPercent = _controller.GetGrowthInPercent();
 }
コード例 #10
0
ファイル: VoiceRecogition.cs プロジェクト: omanamos/robotics
 public VoiceRecogition(Grammar grammar, MainController controller)
 {
     this.initialize(grammar, controller, false);
 }
コード例 #11
0
ファイル: VoiceRecogition.cs プロジェクト: omanamos/robotics
 public VoiceRecogition(MainController.State state, MainController controller)
 {
     this.initialize(new CommandGrammarBuilder(state, controller.getLibrary()).getGrammar(), controller, true);
 }