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

Revision history [back]

openni_tracker broadcasts tf data for the body pose (not just XYZ data), and to be clear, X DOES NOT represent the distance from the camera, it represents the X coordinate of the 3D position of that point in some coordinate frame.

If you want to find the distance of the tracked person from the camera, you should choose one of the frames that openni_tracker broadcasts (torso might be a good choice), then lookup the transform between camera_depth_optical_frame and torso. Once you have that transform, you can take the translation X,Y,Z values and use the Pythagorean theorem to find the distance.

openni_tracker broadcasts tf data for the body pose (not just XYZ data), and to be clear, X DOES NOT represent the distance from the camera, it represents the X coordinate of the 3D position of that point in some coordinate frame.

If you want to find the distance of the tracked person from the camera, you should choose one of the frames that openni_tracker broadcasts (torso might be a good choice), then lookup the transform between camera_depth_optical_frame and torso. Once you have that transform, you can take the translation X,Y,Z values and use the Pythagorean theorem to find the distance.distance. No OpenCV or PCL required.