Skip to main content

Covariance API

Source headers: raptor/covariance.hpp

raptor​

Type Aliases​

NameDescription
ConfidenceIntervalConfidence interval driving the covariance search range (0.0, 1.0).
PoseCovariance6x6 pose covariance matrix (row-major).
PositionCovariance3x3 position covariance matrix (row-major), expressed in the camera frame.

Functions​

NameDescription
poseCovarianceFromSearchRangesConvert per-axis search ranges in caller-chosen frames to camera-frame pose covariance.

Type Alias Details​

ConfidenceInterval​

using ConfidenceInterval = double

Confidence interval driving the covariance search range (0.0, 1.0).

Controls how much of the input PoseCovariance ellipsoid is searched around the input pose. Per dimension, the search range is ±sqrt(chiSquared(confidenceInterval, 6 dof) * variance), where the chi-squared value is computed from this confidence level over the 6 degrees of freedom of the pose.

Larger values widen the search (slower, more robust to a poorly known prior); smaller values narrow it (faster, but may miss the true pose if the prior is off). Has no effect when no covariance is supplied.

Common values:

  • 0.68: 1-sigma
  • 0.90: Default
  • 0.95: 2-sigma
  • 0.99: High confidence
note

This controls how much of the prior uncertainty region is searched, not how confident you are in the covariance values themselves.

warning

Must be in range (0.0, 1.0) - validated at runtime.

See: PoseCovariance

See: prior_covariance.md "Search Range" for the full derivation.

PoseCovariance​

using PoseCovariance = std::array<double, 36>

6x6 pose covariance matrix (row-major).

The covariance is expressed in the camera frame, ordered (x, y, z, yaw, pitch, roll). Position units are meters² and attitude units are radians².

PositionCovariance​

using PositionCovariance = std::array<double, 9>

3x3 position covariance matrix (row-major), expressed in the camera frame.

Function Details​

poseCovarianceFromSearchRanges​
Function
PoseCovariance poseCovarianceFromSearchRanges( raptor::Context& context, const std::array<double, 3>& positionSearchRange, const Quaternion& positionRotation, const std::array<double, 3>& attitudeSearchRange, const Quaternion& attitudeRotation, ConfidenceInterval confidenceInterval = 0.9)

Convert per-axis search ranges in caller-chosen frames to camera-frame pose covariance.

Position ranges are ± distances along the position frame's X, Y, Z axes in meters. Attitude ranges are ± angles about the attitude frame's Z, Y, X axes (yaw, pitch, roll) in radians. Each rotation is the orientation of its search-range frame relative to the camera frame (DIN 9300); its rotation matrix converts search-range frame components into camera components. Identity means the ranges are already in camera axes. Use nedRelativeToCamera(pose) from transforms.hpp for ranges expressed in local North-East-Down coordinates.

Parameters:

  • context - SDK context providing the logger for numerical diagnostics.
  • positionSearchRange - X/Y/Z in the position frame [meters].
  • positionRotation - Orientation of the position frame relative to the camera.
  • attitudeSearchRange - Yaw/pitch/roll half-widths in the attitude frame [radians].
  • attitudeRotation - Orientation of the attitude frame relative to the camera.
  • confidenceInterval - Confidence the ranges correspond to; pass the same value as raptor::guide::EstimationOptions::confidenceInterval.

Returns: 6x6 row-major covariance in the camera frame. Throws: std::invalid_argument - If a range or the confidence interval is invalid.