ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I have not played with the openni_tracker, but I have spent a decent amount of time with the Microsoft SDK. Its probably best to simply use the data from the OpenNI libraries in your own node. You would subscribe to openni's topics (or write a node which publishes openni information on a topic) and publish whatever message you want when a person is inside your box. I have in mind two approaches you could take to define the square, each with their own disadvantages/advantages:

1) As Martin suggested, use real world units (meters). This allows you to specify a bounding box in terms of real world coordinates. This is helpful when you have a transform for your kinect and you want to focus on an area in the real world. Here you would simply be checking bounding box values using euclidean data (for example: left < x < right && bottom < y < top). (I use x and y here because with the Microsoft SDK, z is the depth dimension, perhaps its the same with the OpenNI libraries.)

2) If you're interested instead in what a kinect can see, regardless of where it is in the world, the best way would be with pixels. For the Microsoft SDK, the skeleton frames are printed in pixel coordinates (here you use pixels instead of meters). The advantage of this is that no matter where in the world you are, how far away the person is, if they are inside that view area, you'll capture them. Remember that pixel coordinate system is different, y is positive in the "down" direction, and all values are lower bound by 0. You would choose the bounding box using pixels (for example, with some arbitrary values: 400(left) < x < 800(right) && 100(top) < y < 400(bottom)). You can determine the pixel coordinates to use by looking up the field of view in the kinect specifications and choosing an average distance from the kinect you wish to track at.

I hope this is helpful.

Constantin