Monado OpenXR Runtime
Loading...
Searching...
No Matches
constellation_tracker_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 constellation tracker usage of the constellation tracker rerun logging.
6 * @author Beyley Cardellio <ep1cm1n10n123@gmail.com>
7 * @ingroup tracking
8 */
9
10#pragma once
11
12#include "xrt/xrt_config_build.h"
13
14// @note In general usage, we don't use the internal header, rerun is an opt-in debugging feature, so we are OK using
15// internal APIs here to keep code clean and non-invasive. Please look at target_builder_rift.c instead for normal
16// usage of these APIs.
18
19#include <rerun.hpp>
20
21
22namespace xrt::tracking::constellation {
23
24const std::string rerun_recording_id = "constellation_tracking";
25
27{
28public: // Fields
29 std::unique_ptr<rerun::RecordingStream> stream{};
30
31public: // Methods
33 {
34 stream = std::make_unique<rerun::RecordingStream>(rerun_recording_id);
35 }
36
37 /*! Log a tracked frame to Rerun.
38 *
39 * All pose parameters must be in OpenXR coordinate space (Y-up). They will be converted to OpenCV space
40 * (Y-down) internally for logging.
41 *
42 * @param camera_sample Camera frame with blobs
43 * @param device_id Device being tracked
44 * @param led_model LED model in device-local OpenCV space
45 * @param calibration Camera intrinsics
46 * @param Txr_world_cam World → Camera pose (OpenXR space)
47 * @param Txr_cam_device Camera → Device pose (OpenXR space)
48 * @param Txr_world_device World → Device pose (OpenXR space)
49 * @param brightness Average brightness of matched blobs
50 */
51 void
52 LogTrackedFrame(const CameraSample &camera_sample,
53 t_constellation_device_id_t device_id,
54 const t_constellation_tracker_led_model &led_model,
55 const t_camera_calibration &calibration,
56 const xrt_pose &Txr_world_cam,
57 const xrt_pose &Txr_cam_device,
58 const xrt_pose &Txr_world_device,
59 float brightness);
60
61private: // Methods
62 void
63 LogStaticScene(const CameraSample &camera_sample, const t_camera_calibration &calibration);
64
65 void
66 LogLedModel(const std::string &entity_name, const t_constellation_tracker_led_model &led_model);
67
68 void
69 LogBlobSet(const std::string &entity_name,
70 const CameraSample &camera_sample,
71 t_constellation_device_id_t device_id,
72 bool matched_only);
73
74 void
75 LogFrameMetrics(const CameraSample &camera_sample, t_constellation_device_id_t device_id, float brightness);
76};
77
78}; // namespace xrt::tracking::constellation
Essential calibration data for a single camera, or single lens/sensor of a stereo camera.
Definition t_tracking.h:236
The LED model is a series of points which define the real-world positions of all LEDs.
Definition t_constellation.h:266
Definition t_constellation_tracker_internal.hpp:106
Definition constellation_tracker_rerun.hpp:27
void LogTrackedFrame(const CameraSample &camera_sample, t_constellation_device_id_t device_id, const t_constellation_tracker_led_model &led_model, const t_camera_calibration &calibration, const xrt_pose &Txr_world_cam, const xrt_pose &Txr_cam_device, const xrt_pose &Txr_world_device, float brightness)
Log a tracked frame to Rerun.
Definition constellation_tracker_rerun.cpp:283
A pose composed of a position and orientation.
Definition xrt_defines.h:492
Internal ures for the constellation tracker.