Beispiel #1
0
        public ControlWindow()
        {
            InitializeComponent();

            servoManager = new ServoManager(servoConfigFileName);
            servoManager.ConnectToHardware();
            UpdateConnectedTextblock(servoManager.IsConnected(), servoHardwareState);

            ariaManager = new AriaManager();
            ariaManager.InitializeAria();
            UpdateConnectedTextblock(ariaManager.IsConnected(), ariaHardwareState);

            robotSpeech = new RobotSpeech(servoManager);

            robotEyes = new RobotEyes();
            robotEyes.InitializeHardware();

            personTracking = new PersonTracking(servoManager, ariaManager);

            sequenceProcessor = new SequenceProcessor(servoManager, ariaManager, robotSpeech, robotEyes, sequenceFileName);

            kinectManager = new KinectManager(sequenceProcessor, personTracking, robotSpeech);
            kinectManager.InitializeKinect();
            UpdateConnectedTextblock(kinectManager.IsConnected(), kinectHardwareState);
            UpdateMotionEnabledDisplay();

            logUpdateTimer.Tick    += new EventHandler(logUpdateTimer_Tick);
            logUpdateTimer.Interval = new TimeSpan(0, 0, 0, 0, 500);
            logUpdateTimer.Start();
        }
        public ControlWindow()
        {
            InitializeComponent();

            servoManager = new ServoManager(servoConfigFileName);
            servoManager.ConnectToHardware();
            UpdateConnectedTextblock(servoManager.IsConnected(), servoHardwareState);

            ariaManager = new AriaManager();
            ariaManager.InitializeAria();
            UpdateConnectedTextblock(ariaManager.IsConnected(), ariaHardwareState);

            robotSpeech = new RobotSpeech(servoManager);

            robotEyes = new RobotEyes();
            robotEyes.InitializeHardware();

            personTracking = new PersonTracking(servoManager, ariaManager);

            sequenceProcessor = new SequenceProcessor(servoManager, ariaManager, robotSpeech, robotEyes, sequenceFileName);

            kinectManager = new KinectManager(sequenceProcessor, personTracking, robotSpeech);
            kinectManager.InitializeKinect();
            UpdateConnectedTextblock(kinectManager.IsConnected(), kinectHardwareState);
            UpdateMotionEnabledDisplay();

            logUpdateTimer.Tick += new EventHandler(logUpdateTimer_Tick);
            logUpdateTimer.Interval = new TimeSpan(0, 0, 0, 0, 500);
            logUpdateTimer.Start();
        }
Beispiel #3
0
 public SequenceProcessor(ServoManager servoManager, AriaManager ariaManager, RobotSpeech robotSpeech, RobotEyes robotEyes, string sequenceFileName)
 {
     this.servoManager = servoManager;
     this.ariaManager  = ariaManager;
     this.robotSpeech  = robotSpeech;
     this.robotEyes    = robotEyes;
     sequenceList      = new SequenceList(sequenceFileName);
 }
        public PersonTracking(ServoManager servoManager, AriaManager ariaManager)
        {
            this.servoManager = servoManager;
            this.ariaManager = ariaManager;

            wheelWatchdogTimer.AutoReset = false;
            wheelWatchdogTimer.Elapsed += OnWheelWatchdogTimerEvent;
        }
Beispiel #5
0
        public PersonTracking(ServoManager servoManager, AriaManager ariaManager)
        {
            this.servoManager = servoManager;
            this.ariaManager  = ariaManager;

            wheelWatchdogTimer.AutoReset = false;
            wheelWatchdogTimer.Elapsed  += OnWheelWatchdogTimerEvent;
        }
Beispiel #6
0
        public RobotSpeech(ServoManager servoManager)
        {
            this.servoManager = servoManager;
            mouthServoIndex   = servoManager.GetServoIndex("Mouth open/close");

            speechSynthesizer.SelectVoice(speechSynthesizer.GetInstalledVoices().Where(i => i.Enabled && i.VoiceInfo.Gender == VoiceGender.Female).First().VoiceInfo.Name);
            speechSynthesizer.Rate = 0;

            Thread speechAnimationThread = new Thread(new ThreadStart(SpeechAnimationThread));

            speechAnimationThread.IsBackground = true;
            speechAnimationThread.Start();

            speechSynthesizer.StateChanged += StateChanged;
        }
        public ControlWindow()
        {
            InitializeComponent();

            servoManager = new ServoManager(servoConfigFileName);
            servoManager.ConnectToHardware();
            UpdateConnectedTextblock(servoManager.IsConnected(), servoHardwareState);

            sequenceProcessor = new SequenceProcessor(servoManager, sequenceFileName);

            kinectManager = new KinectManager(sequenceProcessor);
            kinectManager.InitializeKinect();
            UpdateConnectedTextblock(kinectManager.IsConnected(), kinectHardwareState);

            logUpdateTimer.Tick    += new EventHandler(logUpdateTimer_Tick);
            logUpdateTimer.Interval = new TimeSpan(0, 0, 0, 0, 500);
            logUpdateTimer.Start();
        }
        public ControlWindow()
        {
            InitializeComponent();

            servoManager = new ServoManager(servoConfigFileName);
            servoManager.ConnectToHardware();
            UpdateConnectedTextblock(servoManager.IsConnected(), servoHardwareState);

            sequenceProcessor = new SequenceProcessor(servoManager, sequenceFileName);

            kinectManager = new KinectManager(sequenceProcessor);
            kinectManager.InitializeKinect();
            UpdateConnectedTextblock(kinectManager.IsConnected(), kinectHardwareState);

            logUpdateTimer.Tick += new EventHandler(logUpdateTimer_Tick);
            logUpdateTimer.Interval = new TimeSpan(0, 0, 0, 0, 500);
            logUpdateTimer.Start();
        }
 public SequenceProcessor(ServoManager servoManager, string sequenceFileName)
 {
     this.servoManager = servoManager;
     sequenceList = new SequenceList(sequenceFileName);
 }
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            ServoManager servoManager = new ServoManager();

            servoManager.AddServo(new Servo(1));
            servoManager.AddServo(new Servo(2));
            servoManager.AddServo(new Servo(3));

            servoManager.GenerateExampleConfigFile("ExampleConfig.xml");

            SequenceProcessor sequenceProcessor = new SequenceProcessor(servoManager);

            // Create test sequence 1.
            Sequence testSequence = new Sequence("Sequence 1");

            Frame frame1 = new Frame("Frame 1");

            frame1.AddServoPosition(new ServoPosition(1, 100));
            frame1.AddServoPosition(new ServoPosition(2, 200));
            frame1.AddServoPosition(new ServoPosition(3, 300));

            Frame frame2 = new Frame("Frame 2");

            frame2.AddServoPosition(new ServoPosition(1, 400));
            frame2.AddServoPosition(new ServoPosition(2, 500));
            frame2.AddServoPosition(new ServoPosition(3, 600));

            testSequence.AddFrame(frame1);
            testSequence.AddFrame(frame2);

            // Create test sequence 2.
            Sequence testSequence2 = new Sequence("Sequence 2");

            Frame frame3 = new Frame("Frame 3");

            frame3.AddServoPosition(new ServoPosition(1, 900));
            frame3.AddServoPosition(new ServoPosition(2, 800));
            frame3.AddServoPosition(new ServoPosition(3, 700));

            Frame frame4 = new Frame("Frame 4");

            frame4.AddServoPosition(new ServoPosition(1, 600));
            frame4.AddServoPosition(new ServoPosition(2, 500));
            frame4.AddServoPosition(new ServoPosition(3, 400));

            testSequence2.AddFrame(frame3);
            testSequence2.AddFrame(frame4);

            SequenceList sequenceList = new SequenceList();

            sequenceList.AddSequence(testSequence);
            sequenceList.AddSequence(testSequence2);

            sequenceList.SaveToXml("SequenceList.xml");


            SequenceList sequenceList2 = new SequenceList();

            sequenceList2.LoadFromXml("SequenceList.xml");

            //sequenceProcessor.RunSequence(testSequence);
        }
 public SequenceProcessor(ServoManager servoManager, string sequenceFileName)
 {
     this.servoManager = servoManager;
     sequenceList      = new SequenceList(sequenceFileName);
 }