Using the Positional Tracking API
Positional Tracking Configuration
To configure positional tracking, use InitParameters at initialization and RuntimeParameters to change specific parameters during use.
Enabling Positional Tracking
After opening the camera, enable positional tracking using enablePositionalTracking() with default PositionalTrackingParameters.
You can disable tracking anytime using disablePositionalTracking().
For more information on positional tracking settings, refer to the Positional Tracking Settings page.
Getting Pose
The camera position gets updated with every new frame.
To retrieve pose data, use getPosition() after grabbing a frame.
In the following example, we extract the pose relative to the World Frame and retrieve the translation and orientation quaternion values using getTranslation() and getOrientation().
The class Pose is used to store camera position and additional information such as timestamp and confidence. Since position is always relative to a reference, it is important to set the coordinate frame that will be used as base. To get camera position in real world space, use REFERENCE_FRAME::WORLD, otherwise use REFERENCE_FRAME::CAMERA to get the change in pose relative to the last position (odometry).
By default, the pose of the left eye of the camera is returned. To get the pose at the center of the camera, see Frame Transforms. You can also retrieve a translation, orientation or rotation matrix using getTranslation(), getOrientation() and getRotation().
Getting Velocity
The velocity gets updated with every new frame. To retrieve velocity data, use getPosition() after grabbing a frame. In the following example, we extract the velocity relative to the Camera Frame and retrieve the linear and angular velocities along the [x,y,z] axes.
Saving an Area Map
Relocalizing within an Area map
Code Example
For code examples, check out the Tutorial and Sample on GitHub.

