Monado OpenXR Runtime
Loading...
Searching...
No Matches
sensor_fusion.hpp File Reference

Constellation tracker sensor fusion. More...

#include "xrt/xrt_config_build.h"
#include "os/os_threading.h"
#include "tracking/t_constellation.h"
#include "constellation/t_constellation_tracker.h"
#include "math/m_relation_history.h"
#include "imu_preintegration.hpp"
#include <array>
#include <atomic>
#include <ceres/context.h>
#include <cstddef>
#include <cstring>
#include <memory>
#include <optional>
#include <string>
#include <type_traits>
#include <vector>
Include dependency graph for sensor_fusion.hpp:

Go to the source code of this file.

Data Structures

struct  xrt::tracking::constellation::optimizer::sensor_fusion::DeviceObservation
 
struct  xrt::tracking::constellation::optimizer::sensor_fusion::Keyframe
 
struct  xrt::tracking::constellation::optimizer::sensor_fusion::RingImuSample
 One IMU sample as it sits in Device::imu_samples. More...
 
struct  xrt::tracking::constellation::optimizer::sensor_fusion::DevicePreintegration
 Stores state for a single preintegration residual for a device. More...
 
struct  xrt::tracking::constellation::optimizer::sensor_fusion::DeviceImuCalibration
 The IMU intrinsics the rig calibration happened to solve for, as the fusion takes them in as a seed. More...
 
struct  xrt::tracking::constellation::optimizer::sensor_fusion::DeviceSolveState
 
struct  xrt::tracking::constellation::optimizer::sensor_fusion::Device
 
struct  xrt::tracking::constellation::optimizer::sensor_fusion::CameraDescription
 
struct  xrt::tracking::constellation::optimizer::sensor_fusion::SolvedDeviceKeyframe
 A device's solved state at one keyframe. More...
 
struct  xrt::tracking::constellation::optimizer::sensor_fusion::SnapshotObservation
 One camera's view of one device at one keyframe. More...
 
struct  xrt::tracking::constellation::optimizer::sensor_fusion::SnapshotKeyframe
 
struct  xrt::tracking::constellation::optimizer::sensor_fusion::SnapshotDevice
 
struct  xrt::tracking::constellation::optimizer::sensor_fusion::SolveSnapshot
 One solve, whole: what went in, what came out, and how the solver got there. More...
 
struct  xrt::tracking::constellation::optimizer::sensor_fusion::SensorFusion
 

Enumerations

enum class  xrt::tracking::constellation::optimizer::sensor_fusion::DevicePreintegrationState { Dirty , Empty , Integrated }
 

Variables

static constexpr uint32_t xrt::tracking::constellation::optimizer::sensor_fusion::kSlidingWindowSize = 3
 How many keyframes to keep in our sliding window.
 
static constexpr uint32_t xrt::tracking::constellation::optimizer::sensor_fusion::kImuBufferSize = 5000
 The number of IMU samples to keep in our ring buffer.
 
static constexpr uint32_t xrt::tracking::constellation::optimizer::sensor_fusion::kMaxImuSamplesPerKeyframe = 512
 The most IMU samples we ever expect to find between two keyframes.
 
static constexpr uint32_t xrt::tracking::constellation::optimizer::sensor_fusion::kKeyframeSealLagKeyframes = 2
 How many newer keyframes have to pile up before a keyframe gets sealed and marginalized.
 
static constexpr uint32_t xrt::tracking::constellation::optimizer::sensor_fusion::kMaxQueuedCameraSamples = 32
 How many camera samples may be queued for the fusion thread before new ones start being dropped.
 

Detailed Description

Constellation tracker sensor fusion.

Author
Beyley Cardellio ep1cm.nosp@m.1n10.nosp@m.n123@.nosp@m.gmai.nosp@m.l.com

Enumeration Type Documentation

◆ DevicePreintegrationState

Enumerator
Dirty 

Needs to be recomputed.

Empty 

Does not refer to any real pre-integration. This term contributes nothing and can be skipped.

Integrated 

This preintegration is complete and will never change.

Variable Documentation

◆ kImuBufferSize

constexpr uint32_t xrt::tracking::constellation::optimizer::sensor_fusion::kImuBufferSize = 5000
staticconstexpr

The number of IMU samples to keep in our ring buffer.

◆ kKeyframeSealLagKeyframes

constexpr uint32_t xrt::tracking::constellation::optimizer::sensor_fusion::kKeyframeSealLagKeyframes = 2
staticconstexpr

How many newer keyframes have to pile up before a keyframe gets sealed and marginalized.

◆ kMaxImuSamplesPerKeyframe

constexpr uint32_t xrt::tracking::constellation::optimizer::sensor_fusion::kMaxImuSamplesPerKeyframe = 512
staticconstexpr

The most IMU samples we ever expect to find between two keyframes.

At a 1KHz IMU and a keyframe every few tens of milliseconds the real count is well under a hundred, so this is generous headroom rather than a tight bound. Sizing the staging buffer off this instead of kImuBufferSize keeps it small enough to sit on the stack.

◆ kMaxQueuedCameraSamples

constexpr uint32_t xrt::tracking::constellation::optimizer::sensor_fusion::kMaxQueuedCameraSamples = 32
staticconstexpr

How many camera samples may be queued for the fusion thread before new ones start being dropped.

The fusion thread drains the whole queue every pass, so if this grows past even a handful, the thread has stalled a lot and we should just warn and start dropping them to not use an ever-increasing amount of RAM.

◆ kSlidingWindowSize

constexpr uint32_t xrt::tracking::constellation::optimizer::sensor_fusion::kSlidingWindowSize = 3
staticconstexpr

How many keyframes to keep in our sliding window.