WPILib 2012
WPILibRoboticsLibraryforFRC
Skeleton.h
00001 /*----------------------------------------------------------------------------*/
00002 /* Copyright (c) FIRST 2011. All Rights Reserved.                                                         */
00003 /* Open Source Software - may be modified and shared by FRC teams. The code   */
00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib.  */
00005 /*----------------------------------------------------------------------------*/
00006 
00007 #ifndef __SKELETON_H__
00008 #define __SKELETON_H__
00009 
00010 class Skeleton
00011 {
00012         friend class Kinect;
00013 public:
00014         typedef enum
00015         {
00016                 HipCenter = 0,
00017                 Spine = 1,
00018                 ShoulderCenter = 2,
00019                 Head = 3,
00020                 ShoulderLeft = 4,
00021                 ElbowLeft = 5,
00022                 WristLeft = 6,
00023                 HandLeft = 7,
00024                 ShoulderRight = 8,
00025                 ElbowRight = 9,
00026                 WristRight = 10,
00027                 HandRight = 11,
00028                 HipLeft = 12,
00029                 KneeLeft = 13,
00030                 AnkleLeft = 14,
00031                 FootLeft = 15,
00032                 HipRight = 16,
00033                 KneeRight = 17,
00034                 AnkleRight = 18,
00035                 FootRight = 19,
00036                 JointCount = 20
00037         } JointTypes;
00038 
00039         typedef enum {kNotTracked, kInferred, kTracked} JointTrackingState;
00040 
00041         typedef struct
00042         {
00043                 float x;
00044                 float y;
00045                 float z;
00046                 JointTrackingState trackingState;
00047         } Joint;
00048 
00049         Joint GetHandRight() { return m_joints[HandRight]; }
00050         Joint GetHandLeft() { return m_joints[HandLeft]; }
00051         Joint GetWristRight() { return m_joints[WristRight]; }
00052         Joint GetWristLeft() { return m_joints[WristLeft]; }
00053         Joint GetElbowLeft() { return m_joints[ElbowLeft]; }
00054         Joint GetElbowRight() { return m_joints[ElbowRight]; }
00055         Joint GetShoulderLeft() { return m_joints[ShoulderLeft]; }
00056         Joint GetShoulderRight() { return m_joints[ShoulderRight]; }
00057         Joint GetShoulderCenter() { return m_joints[ShoulderCenter]; }
00058         Joint GetHead() { return m_joints[Head]; }
00059         Joint GetSpine() { return m_joints[Spine]; }
00060         Joint GetHipCenter() { return m_joints[HipCenter]; }
00061         Joint GetHipRight() { return m_joints[HipRight]; }
00062         Joint GetHipLeft() { return m_joints[HipLeft]; }
00063         Joint GetKneeLeft() { return m_joints[KneeLeft]; }
00064         Joint GetKneeRight() { return m_joints[KneeRight]; }
00065         Joint GetAnkleLeft() { return m_joints[AnkleLeft]; }
00066         Joint GetAnkleRight() { return m_joints[AnkleRight]; }
00067         Joint GetFootLeft() { return m_joints[FootLeft]; }
00068         Joint GetFootRight() { return m_joints[FootRight]; }
00069         Joint GetJointValue(JointTypes index) { return m_joints[index]; }
00070 
00071 private:
00072         Joint m_joints[20];
00073 };
00074 
00075 #endif
00076 
 All Classes Functions Variables