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

Shared internal helpers for every constellation rerun recorder. More...

#include "xrt/xrt_defines.h"
#include "xrt/xrt_frame.h"
#include "math/m_api.h"
#include "math/m_vec3.h"
#include "tracking/t_tracking.h"
#include "tracking/t_constellation.h"
#include "tracking/t_camera_models.hpp"
#include <rerun.hpp>
#include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <format>
#include <memory>
#include <string>
#include <vector>
Include dependency graph for constellation_rerun_common.hpp:

Go to the source code of this file.

Data Structures

struct  xrt::tracking::constellation::RerunStream
 The recording stream a rerun recorder logs through. More...
 

Functions

xrt_pose xrt::tracking::constellation::predictedCameraDevicePose (const xrt_pose &Tcv_world_cam, const xrt_pose &Tcv_world_device)
 The pose the solved poses predict this camera would have observed the device at.
 
float xrt::tracking::constellation::orientationErrorDegrees (const xrt_quat &a, const xrt_quat &b)
 The angle between two orientations, in degrees.
 
float xrt::tracking::constellation::reprojectionErrorPixels (const t_camera_model_params &dist, const xrt_pose &Tcv_world_cam, const xrt_pose &Tcv_world_device, uint32_t num_points, std::span< const xrt_vec2 > points2d, std::span< const xrt_vec3 > points3d)
 
rerun::components::Translation3D xrt::tracking::constellation::toRerunTranslation (const xrt_vec3 &position)
 
rerun::Rotation3D xrt::tracking::constellation::toRerunRotation (const xrt_quat &orientation)
 
rerun::Transform3D xrt::tracking::constellation::toRerunTransform (const xrt_pose &pose, bool from_parent=true)
 
rerun::Pinhole xrt::tracking::constellation::makePinhole (const t_camera_calibration &calibration)
 The camera's intrinsics as the projection rerun needs to place an image in the 3D scene.
 
rerun::Image xrt::tracking::constellation::makeImage (const xrt_frame &frame)
 
rerun::components::Color xrt::tracking::constellation::deviceColor (t_constellation_device_id_t device_id, float brightness)
 A stable colour per device, so one device keeps its colour across every recorder and every view.
 
rerun::components::Color xrt::tracking::constellation::cameraColor (size_t mosaic_idx, size_t camera_idx, float brightness)
 A stable colour per camera, chosen the same way as deviceColor and for the same reason.
 
std::string_view xrt::tracking::constellation::getWorldEntityName ()
 The root every 3D entity hangs off, so the recorders agree on where the world is.
 
std::string xrt::tracking::constellation::getWorldCameraEntityName (size_t mosaic_idx, size_t camera_idx)
 Where a camera sits in the world. Its image, observations and metrics are logged under this.
 

Variables

constexpr float xrt::tracking::constellation::kLedPointRadiusM = 0.003f
 How large a LED is drawn in the 3D views, in meters.
 
constexpr float xrt::tracking::constellation::kAxisLength = 0.03f
 
constexpr float xrt::tracking::constellation::kBlobRadiusPixels = 3.0f
 
constexpr float xrt::tracking::constellation::kTrajectoryPointRadiusM = 0.005f
 
constexpr float xrt::tracking::constellation::kTrajectoryLineRadiusM = 0.002f
 

Detailed Description

Shared internal helpers for every constellation rerun recorder.

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

Function Documentation

◆ cameraColor()

rerun::components::Color xrt::tracking::constellation::cameraColor ( size_t  mosaic_idx,
size_t  camera_idx,
float  brightness 
)
inline

A stable colour per camera, chosen the same way as deviceColor and for the same reason.

References xrt::tracking::constellation::cameraColor().

Referenced by xrt::tracking::constellation::cameraColor().

◆ deviceColor()

rerun::components::Color xrt::tracking::constellation::deviceColor ( t_constellation_device_id_t  device_id,
float  brightness 
)
inline

A stable colour per device, so one device keeps its colour across every recorder and every view.

References xrt::tracking::constellation::deviceColor().

Referenced by xrt::tracking::constellation::deviceColor().

◆ getWorldCameraEntityName()

std::string xrt::tracking::constellation::getWorldCameraEntityName ( size_t  mosaic_idx,
size_t  camera_idx 
)
inline

◆ getWorldEntityName()

std::string_view xrt::tracking::constellation::getWorldEntityName ( )
inline

The root every 3D entity hangs off, so the recorders agree on where the world is.

References xrt::tracking::constellation::getWorldEntityName().

Referenced by xrt::tracking::constellation::getWorldCameraEntityName(), and xrt::tracking::constellation::getWorldEntityName().

◆ makePinhole()

rerun::Pinhole xrt::tracking::constellation::makePinhole ( const t_camera_calibration &  calibration)
inline

The camera's intrinsics as the projection rerun needs to place an image in the 3D scene.

References t_camera_calibration::image_size_pixels, t_camera_calibration::intrinsics, and xrt::tracking::constellation::makePinhole().

Referenced by xrt::tracking::constellation::makePinhole().

◆ orientationErrorDegrees()

float xrt::tracking::constellation::orientationErrorDegrees ( const xrt_quat &  a,
const xrt_quat &  b 
)
inline

The angle between two orientations, in degrees.

References xrt::tracking::constellation::orientationErrorDegrees().

Referenced by xrt::tracking::constellation::orientationErrorDegrees().

◆ predictedCameraDevicePose()

xrt_pose xrt::tracking::constellation::predictedCameraDevicePose ( const xrt_pose &  Tcv_world_cam,
const xrt_pose &  Tcv_world_device 
)
inline

The pose the solved poses predict this camera would have observed the device at.

References xrt::tracking::constellation::predictedCameraDevicePose().

Referenced by xrt::tracking::constellation::predictedCameraDevicePose().

Variable Documentation

◆ kLedPointRadiusM

constexpr float xrt::tracking::constellation::kLedPointRadiusM = 0.003f
constexpr

How large a LED is drawn in the 3D views, in meters.