Skeleton Capability
C Reference » Production Nodes Functionality » User Generator

## Functions

XN_C_API XnBool XN_C_DECL | xnIsJointAvailable (XnNodeHandle hInstance, XnSkeletonJoint eJoint)
XN_C_API XnBool XN_C_DECL | xnIsProfileAvailable (XnNodeHandle hInstance, XnSkeletonProfile eProfile)
XN_C_API XnStatus XN_C_DECL | xnSetSkeletonProfile (XnNodeHandle hInstance, XnSkeletonProfile eProfile)
XN_C_API XnStatus XN_C_DECL | xnSetJointActive (XnNodeHandle hInstance, XnSkeletonJoint eJoint, XnBool bState)
XN_C_API XnBool XN_C_DECL | xnIsJointActive (XnNodeHandle hInstance, XnSkeletonJoint eJoint)
XN_C_API XnStatus XN_C_DECL | xnRegisterToJointConfigurationChange (XnNodeHandle hInstance, XnStateChangedHandler handler, void *pCookie, XnCallbackHandle *phCallback)
XN_C_API void XN_C_DECL | xnUnregisterFromJointConfigurationChange (XnNodeHandle hInstance, XnCallbackHandle hCallback)
XN_C_API XnStatus XN_C_DECL | xnEnumerateActiveJoints (XnNodeHandle hInstance, XnSkeletonJoint *pJoints, XnUInt16 *pnJoints)
XN_C_API XnStatus XN_C_DECL | xnGetSkeletonJoint (XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointTransformation *pJoint)
XN_C_API XnStatus XN_C_DECL | xnGetSkeletonJointPosition (XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointPosition *pJoint)
XN_C_API XnStatus XN_C_DECL | xnGetSkeletonJointOrientation (XnNodeHandle hInstance, XnUserID user, XnSkeletonJoint eJoint, XnSkeletonJointOrientation *pJoint)
XN_C_API XnBool XN_C_DECL | xnIsSkeletonTracking (XnNodeHandle hInstance, XnUserID user)
XN_C_API XnBool XN_C_DECL | xnIsSkeletonCalibrated (XnNodeHandle hInstance, XnUserID user)
XN_C_API XnBool XN_C_DECL | xnIsSkeletonCalibrating (XnNodeHandle hInstance, XnUserID user)
XN_C_API XnStatus XN_C_DECL | xnRequestSkeletonCalibration (XnNodeHandle hInstance, XnUserID user, XnBool bForce)
XN_C_API XnStatus XN_C_DECL | xnAbortSkeletonCalibration (XnNodeHandle hInstance, XnUserID user)
XN_C_API XnStatus XN_C_DECL | xnSaveSkeletonCalibrationDataToFile (XnNodeHandle hInstance, XnUserID user, const XnChar *strFileName)
XN_C_API XnStatus XN_C_DECL | xnLoadSkeletonCalibrationDataFromFile (XnNodeHandle hInstance, XnUserID user, const XnChar *strFileName)
XN_C_API XnStatus XN_C_DECL | xnSaveSkeletonCalibrationData (XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot)
XN_C_API XnStatus XN_C_DECL | xnLoadSkeletonCalibrationData (XnNodeHandle hInstance, XnUserID user, XnUInt32 nSlot)
XN_C_API XnStatus XN_C_DECL | xnClearSkeletonCalibrationData (XnNodeHandle hInstance, XnUInt32 nSlot)
XN_C_API XnBool XN_C_DECL | xnIsSkeletonCalibrationData (XnNodeHandle hInstance, XnUInt32 nSlot)
XN_C_API XnStatus XN_C_DECL | xnStartSkeletonTracking (XnNodeHandle hInstance, XnUserID user)
XN_C_API XnStatus XN_C_DECL | xnStopSkeletonTracking (XnNodeHandle hInstance, XnUserID user)
XN_C_API XnStatus XN_C_DECL | xnResetSkeleton (XnNodeHandle hInstance, XnUserID user)
XN_C_API XnBool XN_C_DECL | xnNeedPoseForSkeletonCalibration (XnNodeHandle hInstance)
XN_C_API XnStatus XN_C_DECL | xnGetSkeletonCalibrationPose (XnNodeHandle hInstance, XnChar *strPose)
XN_C_API XnStatus XN_C_DECL | xnSetSkeletonSmoothing (XnNodeHandle hInstance, XnFloat fFactor)
XN_C_API XnStatus XN_C_DECL | xnRegisterCalibrationCallbacks (XnNodeHandle hInstance, XnCalibrationStart CalibrationStartCB, XnCalibrationEnd CalibrationEndCB, void *pCookie, XnCallbackHandle *phCallback)
XN_C_API void XN_C_DECL | xnUnregisterCalibrationCallbacks (XnNodeHandle hInstance, XnCallbackHandle hCallback)
XN_C_API XnStatus XN_C_DECL | xnRegisterToCalibrationStart (XnNodeHandle hInstance, XnCalibrationStart handler, void *pCookie, XnCallbackHandle *phCallback)
XN_C_API void XN_C_DECL | xnUnregisterFromCalibrationStart (XnNodeHandle hInstance, XnCallbackHandle hCallback)
XN_C_API XnStatus XN_C_DECL | xnRegisterToCalibrationInProgress (XnNodeHandle hInstance, XnCalibrationInProgress handler, void *pCookie, XnCallbackHandle *phCallback)
XN_C_API void XN_C_DECL | xnUnregisterFromCalibrationInProgress (XnNodeHandle hInstance, XnCallbackHandle hCallback)
XN_C_API XnStatus XN_C_DECL | xnRegisterToCalibrationComplete (XnNodeHandle hInstance, XnCalibrationComplete handler, void *pCookie, XnCallbackHandle *phCallback)
XN_C_API void XN_C_DECL | xnUnregisterFromCalibrationComplete (XnNodeHandle hInstance, XnCallbackHandle hCallback)

## Detailed Description

The Skeleton capability (XN_CAPABILITY_SKELETON) allows a User Generator to also output the skeleton data of the user, meaning, where every joint is located.

## Function Documentation

## xnAbortSkeletonCalibration()

XN_C_API XnStatus XN_C_DECL xnAbortSkeletonCalibration | ( | XnNodeHandle | hInstance,
|  | XnUserID | user )

stop calibration

Parameters

  hInstance | [in] A handle to the instance
  user | [in] Id of the user to check

## xnClearSkeletonCalibrationData()

XN_C_API XnStatus XN_C_DECL xnClearSkeletonCalibrationData | ( | XnNodeHandle | hInstance,
|  | XnUInt32 | nSlot )

Clear the requested slot from any saved calibration data.

Parameters

  hInstance | [in] A handle to the instance
  nSlot | [in] The slot to clear

## xnEnumerateActiveJoints()

XN_C_API XnStatus XN_C_DECL xnEnumerateActiveJoints | ( | XnNodeHandle | hInstance,
|  | XnSkeletonJoint * | pJoints,
|  | XnUInt16 * | pnJoints )

Get all active joints.

Parameters

  hInstance | [in] A handle to the instance
  pJoints | [out] Preallocated memory for the joints
  pnJoints | [in,out] The size of the preallocated memory. Changed to the number of the active joints.

## xnGetSkeletonCalibrationPose()

XN_C_API XnStatus XN_C_DECL xnGetSkeletonCalibrationPose | ( | XnNodeHandle | hInstance,
|  | XnChar * | strPose )

Get the pose that is required for calibration.

Parameters

  hInstance | [in] A handle to the instance
  strPose | [in] Name of the required pose

## xnGetSkeletonJoint()

XN_C_API XnStatus XN_C_DECL xnGetSkeletonJoint | ( | XnNodeHandle | hInstance,
|  | XnUserID | user,
|  | XnSkeletonJoint | eJoint,
|  | XnSkeletonJointTransformation * | pJoint )

Get a specific joint's full information.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] The ID of the user to which the skeleton belongs
  eJoint | [in] The interesting joint
  pJoint | [out] The joint's full information

## xnGetSkeletonJointOrientation()

XN_C_API XnStatus XN_C_DECL xnGetSkeletonJointOrientation | ( | XnNodeHandle | hInstance,
|  | XnUserID | user,
|  | XnSkeletonJoint | eJoint,
|  | XnSkeletonJointOrientation * | pJoint )

Get a specific joint's orientation.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] The ID of the user to which the skeleton belongs
  eJoint | [in] The interesting joint
  pJoint | [out] The joint's current orientation

## xnGetSkeletonJointPosition()

XN_C_API XnStatus XN_C_DECL xnGetSkeletonJointPosition | ( | XnNodeHandle | hInstance,
|  | XnUserID | user,
|  | XnSkeletonJoint | eJoint,
|  | XnSkeletonJointPosition * | pJoint )

Get a specific joint's position.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] The ID of the user to which the skeleton belongs
  eJoint | [in] The interesting joint
  pJoint | [out] The joint's current position

## xnIsJointActive()

XN_C_API XnBool XN_C_DECL xnIsJointActive | ( | XnNodeHandle | hInstance,
|  | XnSkeletonJoint | eJoint )

Check if joint is currently active.

Parameters

  hInstance | [in] A handle to the instance
  eJoint | [in] The joint to check

## xnIsJointAvailable()

XN_C_API XnBool XN_C_DECL xnIsJointAvailable | ( | XnNodeHandle | hInstance,
|  | XnSkeletonJoint | eJoint )

Check if generator supports a specific joint.

Parameters

  hInstance | [in] A handle to the instance
  eJoint | [in] The joint to check

## xnIsProfileAvailable()

XN_C_API XnBool XN_C_DECL xnIsProfileAvailable | ( | XnNodeHandle | hInstance,
|  | XnSkeletonProfile | eProfile )

Check if generator supports a specific profile.

Parameters

  hInstance | [in] A handle to the instance
  eProfile | [in] The profile to check

## xnIsSkeletonCalibrated()

XN_C_API XnBool XN_C_DECL xnIsSkeletonCalibrated | ( | XnNodeHandle | hInstance,
|  | XnUserID | user )

Check if skeleton is being calibrated.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] Id of the user to check

## xnIsSkeletonCalibrating()

XN_C_API XnBool XN_C_DECL xnIsSkeletonCalibrating | ( | XnNodeHandle | hInstance,
|  | XnUserID | user )

Check if skeleton is being calibrated.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] Id of the user to check

## xnIsSkeletonCalibrationData()

XN_C_API XnBool XN_C_DECL xnIsSkeletonCalibrationData | ( | XnNodeHandle | hInstance,
|  | XnUInt32 | nSlot )

Check if a specific slot already holds calibration data.

Parameters

  hInstance | [in] A handle to the instance
  nSlot | [in] The slot to check

## xnIsSkeletonTracking()

XN_C_API XnBool XN_C_DECL xnIsSkeletonTracking | ( | XnNodeHandle | hInstance,
|  | XnUserID | user )

Check if skeleton is being tracked.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] Id of the user to check

## xnLoadSkeletonCalibrationData()

XN_C_API XnStatus XN_C_DECL xnLoadSkeletonCalibrationData | ( | XnNodeHandle | hInstance,
|  | XnUserID | user,
|  | XnUInt32 | nSlot )

Load previously saved calibration data.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] the user to be assigned the calibration data
  nSlot | [in] The slot to use for saving the calibration data.

## xnLoadSkeletonCalibrationDataFromFile()

XN_C_API XnStatus XN_C_DECL xnLoadSkeletonCalibrationDataFromFile | ( | XnNodeHandle | hInstance,
|  | XnUserID | user,
|  | const XnChar * | strFileName )

Load previously saved calibration data from file.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] the user to be assigned the calibration data
  strFileName | [in] The file from which to load the calibration data.

## xnNeedPoseForSkeletonCalibration()

XN_C_API XnBool XN_C_DECL xnNeedPoseForSkeletonCalibration | ( | XnNodeHandle | hInstance | ) |

Check if a specific pose is required for calibration.

Parameters

  hInstance | [in] A handle to the instance

## xnRegisterCalibrationCallbacks()

XN_C_API XnStatus XN_C_DECL xnRegisterCalibrationCallbacks | ( | XnNodeHandle | hInstance,
|  | XnCalibrationStart | CalibrationStartCB,
|  | XnCalibrationEnd | CalibrationEndCB,
|  | void * | pCookie,
|  | XnCallbackHandle * | phCallback )

Register to calibration callbacks.

Parameters

  hInstance | [in] A handle to the instance
  CalibrationStartCB | [in] Callback to be called when calibration is starting
  CalibrationEndCB | [in] Callback to be called when calibration is complete
  pCookie | [in] User's cookie, to be delivered to the callbacks
  phCallback | [out] The handle to these callbacks, to allow unregistration

## xnRegisterToCalibrationComplete()

XN_C_API XnStatus XN_C_DECL xnRegisterToCalibrationComplete | ( | XnNodeHandle | hInstance,
|  | XnCalibrationComplete | handler,
|  | void * | pCookie,
|  | XnCallbackHandle * | phCallback )

Register to when calibration is complete, with status.

Parameters

  hInstance | [in] A handle to the instance
  handler | [in] Callback to be called when calibration is complete
  pCookie | [in] User's cookie, to be delivered to the callbacks
  phCallback | [out] The handle to this callback, to allow unregistration

## xnRegisterToCalibrationInProgress()

XN_C_API XnStatus XN_C_DECL xnRegisterToCalibrationInProgress | ( | XnNodeHandle | hInstance,
|  | XnCalibrationInProgress | handler,
|  | void * | pCookie,
|  | XnCallbackHandle * | phCallback )

Register to calibration status while calibration is in progress.

Parameters

  hInstance | [in] A handle to the instance
  handler | [in] Callback to be called when calibration is in progress
  pCookie | [in] User's cookie, to be delivered to the callbacks
  phCallback | [out] The handle to this callback, to allow unregistration

## xnRegisterToCalibrationStart()

XN_C_API XnStatus XN_C_DECL xnRegisterToCalibrationStart | ( | XnNodeHandle | hInstance,
|  | XnCalibrationStart | handler,
|  | void * | pCookie,
|  | XnCallbackHandle * | phCallback )

Register to calibration start callback.

Parameters

  hInstance | [in] A handle to the instance
  handler | [in] Callback to be called when calibration starts
  pCookie | [in] User's cookie, to be delivered to the callback
  phCallback | [out] the handle to this callback, to allow unregistration

## xnRegisterToJointConfigurationChange()

XN_C_API XnStatus XN_C_DECL xnRegisterToJointConfigurationChange | ( | XnNodeHandle | hInstance,
|  | XnStateChangedHandler | handler,
|  | void * | pCookie,
|  | XnCallbackHandle * | phCallback )

Register to joint configuration changes - when joints are activated and deactivated.

Parameters

  hInstance | [in] A handle to the instance
  handler | [in] The callback to be called when a joint is activated or deactivated
  pCookie | [in] User's cookie, to be delivered to the callbacks
  phCallback | [out] The handle to these callbacks, to allow unregistration

## xnRequestSkeletonCalibration()

XN_C_API XnStatus XN_C_DECL xnRequestSkeletonCalibration | ( | XnNodeHandle | hInstance,
|  | XnUserID | user,
|  | XnBool | bForce )

Request calibration when possible.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] Id of the user to check
  bForce | [in] Disregard previous calibration

## xnResetSkeleton()

XN_C_API XnStatus XN_C_DECL xnResetSkeleton | ( | XnNodeHandle | hInstance,
|  | XnUserID | user )

Reset the skeleton - discard calibration.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] Id of the user to check

## xnSaveSkeletonCalibrationData()

XN_C_API XnStatus XN_C_DECL xnSaveSkeletonCalibrationData | ( | XnNodeHandle | hInstance,
|  | XnUserID | user,
|  | XnUInt32 | nSlot )

Save the calibration data.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] the user for which the calibration is saved
  nSlot | [in] The slot to use for saving the calibration data

## xnSaveSkeletonCalibrationDataToFile()

XN_C_API XnStatus XN_C_DECL xnSaveSkeletonCalibrationDataToFile | ( | XnNodeHandle | hInstance,
|  | XnUserID | user,
|  | const XnChar * | strFileName )

Save the calibration data to file.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] the user for which the calibration is saved
  strFileName | [in] The file to which to save the calibration data

## xnSetJointActive()

XN_C_API XnStatus XN_C_DECL xnSetJointActive | ( | XnNodeHandle | hInstance,
|  | XnSkeletonJoint | eJoint,
|  | XnBool | bState )

Change the state of a specific joint, to be active or inactive.

Parameters

  hInstance | [in] A handle to the instance
  eJoint | [in] The joint
  bState | [in] The new state

## xnSetSkeletonProfile()

XN_C_API XnStatus XN_C_DECL xnSetSkeletonProfile | ( | XnNodeHandle | hInstance,
|  | XnSkeletonProfile | eProfile )

Set the profile. this will set some joints to be active, and others to be inactive.

Parameters

  hInstance | [in] A handle to the instance
  eProfile | [in] The profile to set

## xnSetSkeletonSmoothing()

XN_C_API XnStatus XN_C_DECL xnSetSkeletonSmoothing | ( | XnNodeHandle | hInstance,
|  | XnFloat | fFactor )

Set the skeleton's smoothing factor.

Parameters

  hInstance | [in] A handle to the instance
  fFactor | [in] The smoothing factor

## xnStartSkeletonTracking()

XN_C_API XnStatus XN_C_DECL xnStartSkeletonTracking | ( | XnNodeHandle | hInstance,
|  | XnUserID | user )

Start tracking a skeleton.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] Id of the user to check

## xnStopSkeletonTracking()

XN_C_API XnStatus XN_C_DECL xnStopSkeletonTracking | ( | XnNodeHandle | hInstance,
|  | XnUserID | user )

Stop tracking a skeleton.

Parameters

  hInstance | [in] A handle to the instance
  user | [in] Id of the user to check

## xnUnregisterCalibrationCallbacks()

XN_C_API void XN_C_DECL xnUnregisterCalibrationCallbacks | ( | XnNodeHandle | hInstance,
|  | XnCallbackHandle | hCallback )

Unregister from calibration callbacks.

Parameters

  hInstance | [in] A handle to the instance
  hCallback | [in] The handle received from registration

## xnUnregisterFromCalibrationComplete()

XN_C_API void XN_C_DECL xnUnregisterFromCalibrationComplete | ( | XnNodeHandle | hInstance,
|  | XnCallbackHandle | hCallback )

Unregister from calibration complete with status.

Parameters

  hInstance | [in] A handle to the instance
  hCallback | [in] The handle received from registration

## xnUnregisterFromCalibrationInProgress()

XN_C_API void XN_C_DECL xnUnregisterFromCalibrationInProgress | ( | XnNodeHandle | hInstance,
|  | XnCallbackHandle | hCallback )

Unregister from calibration status while in progress.

Parameters

  hInstance | [in] A handle to the instance
  hCallback | [in] The handle received from registration

## xnUnregisterFromCalibrationStart()

XN_C_API void XN_C_DECL xnUnregisterFromCalibrationStart | ( | XnNodeHandle | hInstance,
|  | XnCallbackHandle | hCallback )

Unregister from calibration start callback.

Parameters

  [in] | hInstance | A handle to the instance
  [in] | hCallback | The handle received from registration

## xnUnregisterFromJointConfigurationChange()

XN_C_API void XN_C_DECL xnUnregisterFromJointConfigurationChange | ( | XnNodeHandle | hInstance,
|  | XnCallbackHandle | hCallback )

Unregister from joint configuration changes.

Parameters

  hInstance | [in] A handle to the instance
  hCallback | [in] The handle received from registration