# Detecting user position with Kinect without PSI pose

Hello,

I searched the documentation and forum and did not find any answer to this question, but I might have missed something. So apologies if this is a solved issue.

I'm a very new to ROS so this might be a rather silly question. I would like to know if the openni_tracker node is able to post the user detection event and the rough user position before the PSI pose is calibrated.

I know the tracker prints that a new user is detected or gone to the terminal, but is there a topic with this information I could use?

Also, is it possible to track a user rough position before surrendering to the machine (assuming the PSI pose)?

Should I be using another node in order to do this?

edit retag close merge delete

Sort by » oldest newest most voted

AFAIK, the short answer is no, the openni_tracker node cannot publish the rough user position before calibration.

However, OpenNI offers a function called GetCoM (get center of mass) that gives you the rough position of the user without requiring calibration.

To use it, you should write your own node, or modify the openni_tracker code so that it uses that function to obtain the user position and publishes it either to /tf or to a specific topic of your choice.

You can create a copy of the openni_tracker code, as suggested by @McMurdo, and modify it so that it publishes the CoM before calibration and the full skeleton after calibration.

Don't hesitate to ask for help if you run into trouble.

more

Thanks for the tip. CoM seems to be very interesting but I am too much of a noob to be able to implement it yet.

I found this related file ( https://amigo.wtb.tue.nl/svn/amigo/code/tue-ros-pkg/dev/tue_perception_dev/body_detector_dev/src/body_detector.cpp ) that seems to have done this already but I cannot compile it because I'm lacking this dependency:

# include "object_msgs/WorldEvidence.h"

Any idea where to find it?

more

One way to do what you want is this. Type

roscd openni_tracker

then do

cd 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.

more