예제 #1
0
        public KinectTester()
        {
            InitializeComponent();

            sensor = new SmartKinectSensor();
            renderCanvas = new RenderCanvas(TimeSpan.FromSeconds(10));
            sensor.EnableSkeletonRenderingSensor();

            renderCanvas.ImageRendered += DisplayRenderedImage;

            capturedLabel.Visible = false;

            jointController = new JointController();
            gestureController = new GestureController();
            skeletonRender = new SkeletonRenderer(sensor.Sensor);

            sensor.SkeletonController.AddFunction(jointController);
            sensor.SkeletonController.AddFunction(gestureController);
            sensor.SkeletonController.AddFunction(skeletonRender);

            skeletonRender.SkeletonRendered += renderCanvas.SkeletonFrameCaptured;
            gestureController.GestureCaptured += GestureCaptured;
            jointController.JointTrackingCaptured += JointTrackingCaptured;

            ArduinoSerialPort serialPort = new ArduinoSerialPort("COM5", 115200);
            serialPort.Open();
            bodyTracker = new KinectBodyTracker(sensor, serialPort);

            GestureBuilderForm test = new GestureBuilderForm(sensor);
            test.Show();

            // InitializeArduino();
        }
예제 #2
0
파일: Form1.cs 프로젝트: rjabaker/Skynet
        private void ArduinoSetup()
        {
            ledON = false;
            toggleLED.BackColor = Color.Red;

            serialPort = new ArduinoSerialPort("COM5", 115200);
            serialPort.Open();

            cwAnalogPinMapping = new PinMapping(11);
            ccwAnalogPinMapping = new PinMapping(10);
            pinMapping = new PinMapping(13);
            eStop = new PinMapping(8);
            serialPort.ComponentMappings.Add(cwAnalogPinMapping);
            serialPort.ComponentMappings.Add(ccwAnalogPinMapping);
            serialPort.ComponentMappings.Add(pinMapping);
            serialPort.ComponentMappings.Add(eStop);
            cwAnalogPinMapping.SetPinMode(SetPinModeStateCodes.OutputStateCode);
            cwAnalogPinMapping.SetPinMode(SetPinModeStateCodes.OutputStateCode);
            pinMapping.SetPinMode(SetPinModeStateCodes.OutputStateCode);
            eStop.SetPinMode(SetPinModeStateCodes.OutputStateCode);
            pinMapping.FeedbackEvent += new SkynetUtilities.FeedbackRecievedEventHandler(ResponsePackageRecieved);

            this.replyPackageTextBox.Text = "0";

            eStop.SetPin(true);
            stopped = false;
        }
예제 #3
0
        public KinectBodyTracker(SmartKinectSensor smartSensor, ArduinoSerialPort arduinoSerialPort)
        {
            this.skeletonController = smartSensor.SkeletonController;
            this.arduinoSerialPort = arduinoSerialPort;
            this.joints = new Joints();
            this.previousTimeStamp = DateTime.MinValue;
            this.frameCount = 0;

            CreateEmergencyStop();
            LoadJointProfiles();
            ConnectSkeletonController();
        }
예제 #4
0
        public void InitializeArduino()
        {
            serialPort = new ArduinoSerialPort("COM5", 115200);
            serialPort.Open();

            cwAnalogPinMapping = new PinMapping(11);
            ccwAnalogPinMapping = new PinMapping(10);
            eStop = new PinMapping(8);
            serialPort.ComponentMappings.Add(cwAnalogPinMapping);
            serialPort.ComponentMappings.Add(ccwAnalogPinMapping);
            serialPort.ComponentMappings.Add(eStop);
            cwAnalogPinMapping.SetPinMode(SetPinModeStateCodes.OutputStateCode);
            cwAnalogPinMapping.SetPinMode(SetPinModeStateCodes.OutputStateCode);
            eStop.SetPinMode(SetPinModeStateCodes.OutputStateCode);
            eStop.SetPin(true);
        }