ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
One way to do what you want is this. Type
roscd openni_tracker
then do
cd src
cp openni_tracker.cpp ~/(your ros_workspace)/(your ros package)/src
Make sure you type the workspace path and your package name correctly. Then also copy the lines corresponding to dependencies from the main package's manifest.xml to your manifest.xml...
Now you can clearly see these lines in openni_tracker.cpp
void XN_CALLBACK_TYPE User_NewUser(xn::UserGenerator& generator, XnUserID nId, void* pCookie) {
ROS_INFO("New User %d", nId);
if (g_bNeedPose)
g_UserGenerator.GetPoseDetectionCap().StartPoseDetection(g_strPose, nId);
else
g_UserGenerator.GetSkeletonCap().RequestCalibration(nId, TRUE);
}
These are the lines for detecting the user and doing the next job. You should try creating a publisher and then posting/publishing the information you require to a topic that you would create. I am not sure if this would work, but I am sure it is some valuable information.