Monado OpenXR Runtime
Loading...
Searching...
No Matches
sensor_fusion_rerun.hpp
Go to the documentation of this file.
1// Copyright 2026, Beyley Cardellio
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Internal header for sensor fusion usage of rerun logging.
6 * @author Beyley Cardellio <ep1cm1n10n123@gmail.com>
7 * @ingroup tracking
8 */
9
10#pragma once
11
13#include "sensor_fusion.hpp"
14
15#include <rerun.hpp>
16
17
18namespace xrt::tracking::constellation::optimizer::sensor_fusion {
19
20//! Whether to log older keyframes or just the newest.
21constexpr bool kLogOldKeyframes = false;
22
23const std::string_view kRerunRecordingId = "constellation_sensor_fusion";
24
26{
27public: // Methods
28 RerunContext() : RerunStream(kRerunRecordingId) {}
29
30 /*!
31 * Logs one sliding-window solve to rerun.
32 *
33 * Everything is logged against two timelines: a `solves` sequence, which is the only one that advances
34 * monotonically, and a `fusion_time` timestamp taken from the newest keyframe in the window.
35 *
36 * @param snapshot The window and its solved state, as captured around @ref SensorFusion::runFusionLocked.
37 */
38 void
39 logSolve(const SolveSnapshot &snapshot);
40
41 /*!
42 * Logs one dead reckoned IMU relation history entry to rerun.
43 *
44 * Logged only against its own `imu_time` timestamp timeline, and under its own entity, so it never moves the
45 * solved device on the solve timelines.
46 *
47 * @param entry The entry as it was pushed to the IMU relation history.
48 */
49 void
51
52private: // Methods
53 void
54 logStaticScene();
55
56 /*!
57 * Logs a 3 sigma position covariance ellipsoid at @p entity, which must be a child of an entity carrying the
58 * @p Tcv_world_device transform.
59 */
60 void
61 logPositionCovariance(const std::string &entity,
62 const xrt_pose &Tcv_world_device,
63 const PoseCovarianceMatrix &covariance);
64
65 void
66 logSolveSummary(const SolveSnapshot &snapshot);
67
68 void
69 logSolverMetrics(const SolveSnapshot &snapshot);
70
71 void
72 logCameras(const SolveSnapshot &snapshot);
73
74 void
75 logDevice(const SolveSnapshot &snapshot);
76
77 void
78 logDeviceWindow(const SolveSnapshot &snapshot);
79
80 void
81 logDeviceMetrics(const SolveSnapshot &snapshot);
82
83 void
84 logObservations(const SolveSnapshot &snapshot);
85};
86
87}; // namespace xrt::tracking::constellation::optimizer::sensor_fusion
Shared internal helpers for every constellation rerun recorder.
Matrix< double, kNumPoseCovIndices, kNumPoseCovIndices > PoseCovarianceMatrix
[position; rotation; velocity], the order computeImuResidual writes its residual in.
Definition imu_preintegration.hpp:197
Constellation tracker sensor fusion.
constexpr bool kLogOldKeyframes
Whether to log older keyframes or just the newest.
Definition sensor_fusion_rerun.hpp:21
The recording stream a rerun recorder logs through.
Definition constellation_rerun_common.hpp:149
Definition covariance_relation_history.hpp:19
void logSolve(const SolveSnapshot &snapshot)
Logs one sliding-window solve to rerun.
Definition sensor_fusion_rerun.cpp:575
void logImuRelation(const CovarianceRelationHistoryEntry &entry)
Logs one dead reckoned IMU relation history entry to rerun.
Definition sensor_fusion_rerun.cpp:605
One solve, whole: what went in, what came out, and how the solver got there.
Definition sensor_fusion.hpp:432
A pose composed of a position and orientation.
Definition xrt_defines.h:535