本文整理汇总了C++中xnOSGetEpochTime函数的典型用法代码示例。如果您正苦于以下问题:C++ xnOSGetEpochTime函数的具体用法?C++ xnOSGetEpochTime怎么用?C++ xnOSGetEpochTime使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xnOSGetEpochTime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UserCalibration_CalibrationComplete
// Callback: Finished calibration
static void XN_CALLBACK_TYPE UserCalibration_CalibrationComplete (xn::SkeletonCapability& capability, XnUserID nId, XnCalibrationStatus eStatus, void* pCookie)
{
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
OpenNITrackerLoopback* self = (OpenNITrackerLoopback*) pCookie;
std::cerr << "got here: " << __FILE__ << " : " << __LINE__ << std::endl;
if (eStatus == XN_CALIBRATION_STATUS_OK)
{
// Calibration succeeded
printf("%d Calibration complete, start tracking user %d\n", epochTime, nId);
self->g_UserGenerator.GetSkeletonCap().StartTracking(nId);
self->publishEvent ("tracking", nId);
}
else
{
// Calibration failed
printf("%d Calibration failed for user %d\n", epochTime, nId);
if (self->g_bNeedPose)
{
self->g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(self->g_strPose, nId);
self->publishEvent ("posedetection", nId);
}
else
{
self->g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
self->publishEvent ("calibrating", nId);
}
}
}
示例2: xnOSGetEpochTime
void XN_CALLBACK_TYPE UserTracker::User_LostUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie)
{
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
printf("%d Lost user %d\n", epochTime, nId);
removeUser(nId);
}
示例3: xnOSGetEpochTime
void NiRecorder::print_text(const QString &text_ref)
{
XnUInt32 epoch_time = 0;
xnOSGetEpochTime(&epoch_time);
std::cout << (QString().setNum(epoch_time) + QString(": ") + text_ref).toAscii().data() << "\n";
}
示例4: User_LostUser
// Callback: An existing user was lost
void XN_CALLBACK_TYPE User_LostUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie)
{
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
ROS_INFO("%d Lost user %d\n", epochTime, nId);
publishUserLost(nId);
}
示例5: UserCalibration_CalibrationComplete
void XN_CALLBACK_TYPE UserCalibration_CalibrationComplete(xn::SkeletonCapability& capability, XnUserID nId, XnCalibrationStatus eStatus, void* pCookie)
{
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
if (eStatus == XN_CALIBRATION_STATUS_OK)
{
// Calibration succeeded
printf("%d Calibration complete, start tracking user %d\n", epochTime, nId);
g_UserGenerator.GetSkeletonCap().StartTracking(nId);
}
else
{
// Calibration failed
printf("%d Calibration failed for user %d\n", epochTime, nId);
if(eStatus==XN_CALIBRATION_STATUS_MANUAL_ABORT)
{
printf("Manual abort occured, stop attempting to calibrate!");
return;
}
if (g_bNeedPose)
{
g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(g_strPose, nId);
}
else
{
g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
}
}
}
示例6: User_NewUser
// Callback: New user was detected
void XN_CALLBACK_TYPE User_NewUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie)
{
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
XnUserID aUsers[MAX_NUM_USERS];
XnUInt16 nUsers;
g_UserGenerator.GetUsers(aUsers, nUsers);
printf("%d New User %d\n", epochTime, nId);
// New user found
//validate the number of users
XnUInt16 usersTracked=0;
for(XnUInt16 i=0; i<nUsers; i++)
{
if(g_UserGenerator.GetSkeletonCap().IsTracking(aUsers[i])==TRUE)
usersTracked++;
}
if(usersTracked >= numOfUser)
{
printf("%d users are currently being tracked, no more users allowed\n",numOfUser);
return;
}
if (g_bNeedPose)
{
g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(g_strPose, nId);
}
else
{
g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
}
}
示例7: User_NewUser
// Callback: New user was detected
void XN_CALLBACK_TYPE User_NewUser(xn::UserGenerator& /*generator*/, XnUserID nId, void* /*pCookie*/)
{
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
printf("%d New User %d\n", epochTime, nId);
//}
}
示例8: xnOSGetEpochTime
void testusuario::poseDetected(xn::PoseDetectionCapability &capability, const XnChar *strPose, XnUserID nId, void *pCookie)
{
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
printf("%d Pose %s detected for user %d\n", epochTime, strPose, nId);
instance->cam->userG[0].GetPoseDetectionCap().StopPoseDetection(nId);
instance->cam->userG[0].GetSkeletonCap().RequestCalibration(nId, TRUE);
}
示例9: User_LostUser
// Callback: An existing user was lost
static void XN_CALLBACK_TYPE User_LostUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie)
{
OpenNITrackerLoopback* self = (OpenNITrackerLoopback*) pCookie;
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
printf("%d Lost user %d\n", epochTime, nId);
self->publishEvent ("lost", nId);
}
示例10: UserPose_PoseDetected
// Callback: Detected a pose
void XN_CALLBACK_TYPE UserPose_PoseDetected(xn::PoseDetectionCapability& capability, const XnChar* strPose, XnUserID nId, void* pCookie)
{
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
printf("%d Pose %s detected for user %d\n", epochTime, strPose, nId);
g_UserGenerator.GetPoseDetectionCap().StopPoseDetection(nId);
g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
}
示例11: User_LostUser
// Callback: An existing user was lost
void XN_CALLBACK_TYPE User_LostUser(xn::UserGenerator& /*generator*/, XnUserID nId, void* /*pCookie*/){
//TODO : soit suppression de l'utilisateur de la map, soit archivage. Les poses du squelette archivées ne doivent pas être supprimées car on peut les réutiliser.
m_skeleton.erase(nId);
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
printf("%d Lost user %d\n", epochTime, nId);
}
示例12: User_NewUser
// Callback: New user was detected
void XN_CALLBACK_TYPE User_NewUser(xn::UserGenerator& /*generator*/, XnUserID nId, void* /*pCookie*/){
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
printf("%d New User %d\n", epochTime, nId);
// New user found
if (g_bNeedPose)
g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(g_strPose, nId);
else
g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
// ICI ajout de l'utilisateur
Skeleton s(nId);
m_skeleton.insert(std::pair<XnUserID, Skeleton>(nId,s));
}
示例13: xnOSGetEpochTime
// Callback: Finished calibration
void XN_CALLBACK_TYPE SimKinect::UserCalibration_CalibrationComplete(xn::SkeletonCapability& capability, XnUserID nId, XnCalibrationStatus eStatus, void* pCookie) {
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
if (eStatus == XN_CALIBRATION_STATUS_OK) {
// Calibration succeeded
printf("%d Calibration complete, start tracking user %d\n", epochTime, nId);
user_generator.GetSkeletonCap().StartTracking(nId);
}
else {
// Calibration failed
printf("%d Calibration failed for user %d\n", epochTime, nId);
user_generator.GetSkeletonCap().RequestCalibration(nId, TRUE);
}
}
示例14: User_NewUser
// Callback: New user was detected
void XN_CALLBACK_TYPE User_NewUser(xn::UserGenerator& /*generator*/, XnUserID nId, void* /*pCookie*/)
{
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
printf("%d New User %d\n", epochTime, nId);
// New user found
if (g_bNeedPose)
{
g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(g_strPose, nId);
}
else
{
g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
}
}
示例15: User_NewUser
// Callback: New user was detected
static void XN_CALLBACK_TYPE User_NewUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie)
{
OpenNITrackerLoopback* self = (OpenNITrackerLoopback*) pCookie;
if(nId > 15)
{
XnStatus res = self->g_UserGenerator.GetPoseDetectionCap().StopPoseDetection(nId);
if (res != XN_CALIBRATION_STATUS_OK)
{
std::cout << "Error StopPoseDetection";
}
res = self->g_UserGenerator.GetSkeletonCap().AbortCalibration(nId);
if (res != XN_CALIBRATION_STATUS_OK)
{
std::cout << "Error AbortCalibration";
}
res = self->g_UserGenerator.GetSkeletonCap().StopTracking(nId);
if (res != XN_CALIBRATION_STATUS_OK)
{
std::cout << "Error StopTracking";
}
self->g_UserGenerator.GetPoseDetectionCap().Release();
self->g_UserGenerator.GetSkeletonCap().Release();
return;
}
// New user found
XnUInt32 epochTime = 0;
xnOSGetEpochTime(&epochTime);
printf("%d New User %d\n", epochTime, nId);
self->publishEvent ("new", nId);
if (self->g_bNeedPose)
{
std::cerr << "starting pose deteciton: " << __FILE__ << " : " << __LINE__ << std::endl;
self->g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(self->g_strPose, nId);
self->publishEvent ("posedetection", nId);
}
else
{
std::cerr << "request calibration: " << __FILE__ << " : " << __LINE__ << std::endl;
self->g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
self->publishEvent ("calibrating", nId);
}
}