コード例 #1
0
        private static void TestHands()
        {
            _cam.AddCapability(Capability.HandTracking);

            _cam.RightHand.Visible    += (s, a) => { Update("Hand Right Visible", "True"); };
            _cam.RightHand.NotVisible += (s, a) => { Update("Hand Right Visible", "False"); };
            _cam.RightHand.Opened     += (s, a) => { Update("Hand Right Open", "True"); };
            _cam.RightHand.Closed     += (s, a) => { Update("Hand Right Open", "False"); };

            _cam.LeftHand.Visible    += (s, a) => { Update("Hand Left Visible", "True"); };
            _cam.LeftHand.NotVisible += (s, a) => { Update("Hand Left Visible", "False"); };
            _cam.LeftHand.Opened     += (s, a) => { Update("Hand Left Open", "True"); };
            _cam.LeftHand.Closed     += (s, a) => { Update("Hand Left Open", "False"); };

            _cam.RightHand.Moved += (s, a) => { Update("Hand Right Move", a.NewPosition.World.ToString()); };
            _cam.LeftHand.Moved  += (s, a) => { Update("Hand Left Move", a.NewPosition.World.ToString()); };

            _cam.RightHand.RotationChanged += (s, a) => {
                var roll  = _cam.RightHand.Rotation.Roll;
                var yaw   = _cam.RightHand.Rotation.Yaw;
                var pitch = _cam.RightHand.Rotation.Pitch;
                Update("Hand Right Rotation", $"Roll: {roll:0} Yaw: {yaw:0} Pitch {pitch:0}");
            };
            _cam.LeftHand.RotationChanged += (s, a) => {
                var roll  = _cam.LeftHand.Rotation.Roll;
                var yaw   = _cam.LeftHand.Rotation.Yaw;
                var pitch = _cam.LeftHand.Rotation.Pitch;
                Update("Hand Left Rotation", $"Roll: {roll:0} Yaw: {yaw:0} Pitch {pitch:0}");
            };
        }
コード例 #2
0
ファイル: Camera.cs プロジェクト: mbahar94/SharpSenses
        public static ICamera Create(params Capability[] capabilities)
        {
            RealSenseAssembliesLoader.Load();
            var camera = new RealSenseCamera();

            if (capabilities != null)
            {
                foreach (var capability in capabilities)
                {
                    camera.AddCapability(capability);
                }
            }
            return(camera);
        }