ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Detecting user position with Kinect without PSI pose

asked 2012-03-27 05:59:54 -0500

Carlitos gravatar image


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 flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2012-04-12 22:27:27 -0500

Miguel Prada gravatar image

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.

edit flag offensive delete link more

answered 2012-05-07 19:37:43 -0500

Carlitos gravatar image

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 ( ) 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?

edit flag offensive delete link more

answered 2012-04-12 21:57:59 -0500

McMurdo gravatar image

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);
        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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-03-27 05:59:54 -0500

Seen: 2,224 times

Last updated: May 07 '12