AttitudeTracker Integration Guide
raptor::sync::AttitudeTracker, part of Raptor Sync™, refines camera orientation across an image sequence by matching imagery to licensed 3D reference maps.
The application supplies a sufficiently accurate camera position for every frame.
AttitudeTracker retains that position and returns a refined orientation, lens model, and figure of merit (FOM).
It does not estimate position or supply an independent GNSS-denied navigation solution.
Inputs and lifetime
Complete the common setup and use its image storage and Context lifetime rules. The following requirements apply to each tracking sequence:
| Input | Requirement |
|---|---|
| Lens | Supported calibration matching the supplied image geometry and distortion; see model support. |
| Pose | Externally supplied camera position and approximate camera orientation, in a supported pose/CRS representation. |
| Timestamp | Capture timestamp, strictly increasing for this tracker. |
Construct one tracker for each independent camera sequence and reuse it across its frames. Calls to one tracker must run one at a time, in capture order; different trackers may run concurrently (see Thread safety).
Construction prepares tracking resources; image matching starts when frames are supplied.
C++ sequence loop
This excerpt assumes the application has prepared each frame's pixels, nominal calibration, prior pose, and capture timestamp.
#include <raptor/Config.hpp>
#include <raptor/Context.hpp>
#include <raptor/sync/AttitudeTracker.hpp>
#include <variant>
// Reuse the Context created during common setup.
raptor::sync::AttitudeTracker tracker{context};
for (const auto& frame : frames) { // Capture order; serialize calls on this tracker.
auto result = tracker.update(frame.image, frame.lens, frame.priorPose,
frame.captureTimestamp);
if (const auto* output = std::get_if<raptor::sync::AttitudeTrackerUpdate>(&result)) {
if (output->fom >= applicationMinFom) {
consume(output->timestamp, output->pose, output->lens, output->fom);
}
} else {
handleError(std::get<raptor::sync::AttitudeTrackerError>(result));
}
}
Choose and validate applicationMinFom for the integrating application; there is no universal FOM threshold.
The application should continue after EstimationFailed and stop on configuration, licensing, or unexpected runtime errors.
Python sequence loop
Install the raptor wheel from the matching SDK distribution.
Python returns an update object or an error enum directly, rather than a C++ std::variant.
from datetime import timedelta
import raptor
from raptor.sync import AttitudeTracker, AttitudeTrackerError, AttitudeTrackerUpdate
# Reuse the Context created during common setup.
tracker = AttitudeTracker(context)
for frame in frames: # Application-provided data, in capture order.
image = raptor.Image.from_array(frame.gray8, raptor.ImageType.GRAY8)
timestamp = timedelta(microseconds=frame.capture_time_us)
result = tracker.update(image, frame.nominal_lens, frame.prior_pose, timestamp)
if isinstance(result, AttitudeTrackerUpdate):
if result.fom >= application_min_fom:
consume(result.timestamp, result.pose, result.lens, result.fom)
elif result == AttitudeTrackerError.EstimationFailed:
continue # No corrected result for this frame; retain tracker state.
else:
raise RuntimeError(f"Attitude tracking failed: {result}")
For Gray8, use a contiguous NumPy uint8 array of shape (height, width).
RGB8/RGBA8 use (height, width, 3) and (height, width, 4) respectively; convert BGR images before supplying RGB input.
raptor.Image.from_array copies pixels into an owned SDK image.
Timestamps follow the common timestamp rules.
The Python binding keeps the Context alive for the tracker and releases the GIL during construction and update work.
Calibration and result use
Supply the calibration of the image being passed on each call, following the common lens-model rules.
The returned lens has the same model type as the input, with refined parameters. Use it together with the returned pose when interpreting corrected image geometry. Refinement does not replace camera calibration or guarantee correction of every calibration error. Continue supplying the measured nominal calibration and navigation prior for each new input frame. Do not automatically feed the previous output pose/lens back as a new measurement: the tracker already maintains sequence state. An accurate orientation estimate cannot remove misalignment caused by an inaccurate supplied position.
FOM and acceptance
FOM is in [0, 1] on successful updates and describes match quality; larger values indicate a better match.
It is not a calibrated probability of correctness or a bound on position, attitude, or pixel error.
A successful return alone does not establish geometric accuracy.
Validate acceptance using representative imagery and independent reference information for the intended application.
Coordinate extraction
Use the returned pose and lens with map intersection queries.
A radial lens returned by AttitudeTracker can be passed directly to pixel queries; map rendering takes a
pinhole lens only (see lens-model support).
Errors and frames without estimates
Context/tracker construction can throw; catch initialization failures before entering the sequence loop.
AttitudeTracker::update() is noexcept and returns an error instead of an update on failure.
Python can also raise input-conversion exceptions before the native call, for example for an argument of the wrong type or a malformed buffer.
| Error | Meaning and application action |
|---|---|
InvalidInput | Check dimensions, storage, lens/pose values, and positive strictly increasing timestamps. Correct input preparation; do not blindly retry an old frame in a running sequence. |
EstimationFailed | A valid frame produced no usable estimate. Record its unavailable result and continue with the next capture timestamp; investigate repeated failure. |
ExpiredLicense | Stop processing and renew the license. |
InvalidLicense | Stop processing and check the required Attitude and Tracking entitlements. |
Failed | Unexpected runtime failure. Preserve logs and investigate before deciding how to restart. |
A frame without an estimate has no corrected pose/lens/FOM result.
If the application uses the original pose as a fallback, mark it explicitly as uncorrected.
Do not reset timestamps after EstimationFailed or recreate the tracker on every such frame.
There is no promised number of frames or time interval to acquire or recover an estimate.
New sequences and changed inputs
Create a new tracker when switching cameras, starting an unrelated recording, or seeking/replaying with earlier capture times. Starting a new tracker explicitly discards previous state. For a forward discontinuity, assess whether the frames still form a useful continuous sequence. Do not concatenate unrelated inputs just because their timestamps increase.
If the image size or lens parameters change on a running tracker, it continues on a best-effort basis; supply calibration matching each image. Results may be unavailable for some frames after such a change. To change the map configuration, follow the common Context rules.
Further reference
- SDK Integration Guide: common setup, inputs, configuration, and map operations
- Coordinate and camera conventions
- License Management Guide
- Troubleshooting: missing estimates, low FOM, and misaligned results
- API reference:
include/raptor/sync/AttitudeTracker.hppandinclude/raptor/sync/errors.hpp - Runnable example:
examples/cpp/attitude_tracker.cppandexamples/python/attitude_tracker.py