OpenNI::Device device; // initialize device object OpenNI::UserGenerator userGenerator; userGenerator.Create(device); OpenNI::PoseDetectionCapability poseDetectionCap = userGenerator.GetPoseDetectionCap(); poseDetectionCap.RegisterToPoseDetected(PoseDetectedCallback, NULL); poseDetectionCap.LoadPose("Psi"); userGenerator.GetSkeletonCap().SetSkeletonProfile(OpenNI::SkeletonProfile::ALL); userGenerator.StartGenerating(); while (true) { // continuously update data and trigger callbacks device.waitAndUpdateAll(); } void PoseDetectedCallback(const char* poseName, unsigned int userId, void* cookie) { std::cout << "Pose detected: " << poseName << " for user: " << userId << std::endl; }In this example, we create an instance of the UserGenerator and use GetPoseDetectionCap to retrieve the PoseDetectionCapability object. We then load a predefined pose named "Psi" and register a callback function to be triggered when the pose is detected for any user in the scene. Finally, we start generating data from the UserGenerator and continuously update the data stream while waiting for the PoseDetectedCallback to be called when the "Psi" pose is made. The cpp_xn library is a part of the OpenNI SDK which provides interfaces for developing applications that can interact with 3D sensors such as the Microsoft Kinect.