Monado OpenXR Runtime
|
Main implementation of xrt_tracked_slam. More...
Data Structures | |
struct | Features |
Tracker feature tracking info. More... | |
Data Fields | |
struct xrt_tracked_slam | base = {} |
struct xrt_frame_node | node = {} |
Will be called on destruction. More... | |
struct t_vit_bundle | vit |
VIT system function pointers. More... | |
struct vit_tracker_extension_set | exts |
VIT tracker supported extensions. More... | |
struct vit_tracker * | tracker |
Pointer to the tracker created by the loaded VIT system;. More... | |
struct xrt_slam_sinks | sinks = {} |
Pointers to the sinks below. More... | |
struct xrt_frame_sink | cam_sinks [XRT_TRACKING_MAX_SLAM_CAMS] |
Sends camera frames to the SLAM system. More... | |
struct xrt_imu_sink | imu_sink = {} |
Sends imu samples to the SLAM system. More... | |
struct xrt_pose_sink | gt_sink = {} |
Register groundtruth trajectory for stats. More... | |
struct xrt_hand_masks_sink | hand_masks_sink = {} |
Register latest masks to ignore. More... | |
bool | submit |
Whether to submit data pushed to sinks to the SLAM tracker. More... | |
uint32_t | cam_count |
Number of cameras used for tracking. More... | |
struct u_var_button | reset_state_btn |
Reset tracker state button. More... | |
enum u_logging_level | log_level |
Logging level for the SLAM tracker, set by SLAM_LOG var. More... | |
struct xrt_slam_sinks * | euroc_recorder |
EuRoC dataset recording sinks. More... | |
struct openvr_tracker * | ovr_tracker |
OpenVR lighthouse tracker. More... | |
timepoint_ns | last_imu_ts |
Last received IMU sample timestamp. More... | |
vector< timepoint_ns > | last_cam_ts |
Last received image timestamp per cam. More... | |
struct xrt_hand_masks_sample | last_hand_masks |
Last received hand masks info. More... | |
Mutex | last_hand_masks_mutex |
Mutex for last_hand_masks. More... | |
t_slam_prediction_type | pred_type |
Type of prediction to use. More... | |
u_var_combo | pred_combo |
UI combo box to select pred_type. More... | |
RelationHistory | slam_rels {} |
A history of relations produced purely from external SLAM tracker data. More... | |
int | dbg_pred_every = 1 |
Skip X SLAM poses so that you get tracked mostly by the prediction algo. More... | |
int | dbg_pred_counter = 0 |
SLAM pose counter for prediction debugging. More... | |
struct os_mutex | lock_ff |
Lock for gyro_ff and accel_ff. More... | |
struct m_ff_vec3_f32 * | gyro_ff |
Last gyroscope samples. More... | |
struct m_ff_vec3_f32 * | accel_ff |
Last accelerometer samples. More... | |
vector< u_sink_debug > | ui_sink |
Sink to display frames in UI of each camera. More... | |
xrt_vec3 | gravity_correction {0, 0, -MATH_GRAVITY_M_S2} |
Used to correct accelerometer measurements when integrating into the prediction. More... | |
struct xrt_space_relation | last_rel = XRT_SPACE_RELATION_ZERO |
Last reported/tracked pose. More... | |
timepoint_ns | last_ts |
Last reported/tracked pose timestamp. More... | |
struct { | |
bool use_moving_average_filter = false | |
double window = 66 | |
Time window in ms take the average on. More... | |
struct m_ff_vec3_f32 * pos_ff | |
struct m_ff_vec3_f32 * rot_ff | |
Predicted positions fifo. More... | |
bool use_exponential_smoothing_filter = false | |
Predicted rotations fifo (only xyz components, w is inferred) More... | |
float alpha = 0.1 | |
How much should we lerp towards the target value on each update. More... | |
struct xrt_space_relation last = XRT_SPACE_RELATION_ZERO | |
Last filtered relation. More... | |
struct xrt_space_relation target = XRT_SPACE_RELATION_ZERO | |
Target relation. More... | |
bool use_one_euro_filter = false | |
m_filter_euro_vec3 pos_oe | |
One euro position filter. More... | |
m_filter_euro_quat rot_oe | |
One euro rotation filter. More... | |
const float min_cutoff = M_PI | |
Default minimum cutoff frequency. More... | |
const float min_dcutoff = 1 | |
Default minimum cutoff frequency for the derivative. More... | |
const float beta = 0.16 | |
Default speed coefficient. More... | |
} | filter |
Filters are used to smooth out the resulting trajectory. More... | |
TimingWriter * | slam_times_writer |
Timestamps of the pipeline for performance analysis. More... | |
FeaturesWriter * | slam_features_writer |
Feature tracking information for analysis. More... | |
TrajectoryWriter * | slam_traj_writer |
Estimated poses from the SLAM system. More... | |
TrajectoryWriter * | pred_traj_writer |
Predicted poses. More... | |
TrajectoryWriter * | filt_traj_writer |
Predicted and filtered poses. More... | |
struct { | |
bool enabled = false | |
Whether the timing extension is enabled. More... | |
float dur_ms [UI_TIMING_POSE_COUNT] | |
Timing durations in ms. More... | |
int idx = 0 | |
Index of latest entry in dur_ms. More... | |
u_var_combo start_ts | |
UI combo box to select initial timing measurement. More... | |
u_var_combo end_ts | |
UI combo box to select final timing measurement. More... | |
int start_ts_idx | |
Selected initial timing measurement in start_ts. More... | |
int end_ts_idx | |
Selected final timing measurement in end_ts. More... | |
struct u_var_timing ui | |
Realtime UI for tracker durations. More... | |
vector< string > columns | |
Column names of the measured timestamps. More... | |
string joined_columns | |
Column names as a null separated string. More... | |
struct u_var_button enable_btn | |
Toggle tracker timing reports. More... | |
} | timing |
Tracker timing info for performance evaluation. More... | |
struct xrt::auxiliary::tracking::slam::TrackerSlam::Features | features |
struct { | |
Trajectory * trajectory | |
Empty if we've not received groundtruth. More... | |
xrt_pose origin | |
First ground truth pose. More... | |
float diffs_mm [UI_GTDIFF_POSE_COUNT] | |
Positional error wrt ground truth. More... | |
int diff_idx = 0 | |
Index of last error in diffs_mm. More... | |
struct u_var_timing diff_ui | |
Realtime UI for positional error. More... | |
bool override_tracking = false | |
Force the tracker to report gt poses instead. More... | |
} | gt |
Ground truth related fields. More... | |
Data Fields inherited from xrt_tracked_slam | |
void(* | get_tracked_pose )(struct xrt_tracked_slam *, timepoint_ns when_ns, struct xrt_space_relation *out_relation) |
Called by the owning xrt_device to get the last estimated pose of the SLAM tracker. More... | |
Data Fields inherited from xrt_frame_node | |
struct xrt_frame_node * | next |
void(* | break_apart )(struct xrt_frame_node *node) |
Called first in when the graph is being destroyed, remove any references frames and other objects and stop threads. More... | |
void(* | destroy )(struct xrt_frame_node *node) |
Do the actual freeing of the objects. More... | |
Data Fields inherited from xrt_frame_sink | |
void(* | push_frame )(struct xrt_frame_sink *sink, struct xrt_frame *frame) |
Push a frame into the sink. More... | |
Data Fields inherited from xrt_imu_sink | |
void(* | push_imu )(struct xrt_imu_sink *, struct xrt_imu_sample *sample) |
Push an IMU sample into the sink. More... | |
Data Fields inherited from xrt_pose_sink | |
void(* | push_pose )(struct xrt_pose_sink *, struct xrt_pose_sample *sample) |
Additional Inherited Members | |
Public Member Functions inherited from xrt_tracked_slam | |
int | t_slam_create (struct xrt_frame_context *xfctx, struct t_slam_tracker_config *config, struct xrt_tracked_slam **out_xts, struct xrt_slam_sinks **out_sink) |
int | t_slam_start (struct xrt_tracked_slam *xts) |
Public Member Functions inherited from xrt_frame_sink | |
void | u_sink_create_format_converter (struct xrt_frame_context *xfctx, enum xrt_format f, struct xrt_frame_sink *downstream, struct xrt_frame_sink **out_xfs) |
void | u_sink_create_to_r8g8b8_or_l8 (struct xrt_frame_context *xfctx, struct xrt_frame_sink *downstream, struct xrt_frame_sink **out_xfs) |
void | u_sink_create_to_r8g8b8_bayer_or_l8 (struct xrt_frame_context *xfctx, struct xrt_frame_sink *downstream, struct xrt_frame_sink **out_xfs) |
void | u_sink_create_to_rgb_yuv_yuyv_uyvy_or_l8 (struct xrt_frame_context *xfctx, struct xrt_frame_sink *downstream, struct xrt_frame_sink **out_xfs) |
void | u_sink_create_to_yuv_yuyv_uyvy_or_l8 (struct xrt_frame_context *xfctx, struct xrt_frame_sink *downstream, struct xrt_frame_sink **out_xfs) |
void | u_sink_create_to_yuv_or_yuyv (struct xrt_frame_context *xfctx, struct xrt_frame_sink *downstream, struct xrt_frame_sink **out_xfs) |
void | u_sink_create_to_r8g8b8_r8g8b8a8_r8g8b8x8_or_l8 (struct xrt_frame_context *xfctx, struct xrt_frame_sink *downstream, struct xrt_frame_sink **out_xfs) |
void | u_sink_deinterleaver_create (struct xrt_frame_context *xfctx, struct xrt_frame_sink *downstream, struct xrt_frame_sink **out_xfs) |
bool | u_sink_queue_create (struct xrt_frame_context *xfctx, uint64_t max_size, struct xrt_frame_sink *downstream, struct xrt_frame_sink **out_xfs) |
bool | u_sink_simple_queue_create (struct xrt_frame_context *xfctx, struct xrt_frame_sink *downstream, struct xrt_frame_sink **out_xfs) |
void | u_sink_quirk_create (struct xrt_frame_context *xfctx, struct xrt_frame_sink *downstream, struct u_sink_quirk_params *params, struct xrt_frame_sink **out_xfs) |
void | u_sink_split_create (struct xrt_frame_context *xfctx, struct xrt_frame_sink *left, struct xrt_frame_sink *right, struct xrt_frame_sink **out_xfs) |
Public Member Functions inherited from xrt_imu_sink | |
void | u_imu_sink_split_create (struct xrt_frame_context *xfctx, struct xrt_imu_sink *downstream_one, struct xrt_imu_sink *downstream_two, struct xrt_imu_sink **out_imu_sink) |
void | u_imu_sink_force_monotonic_create (struct xrt_frame_context *xfctx, struct xrt_imu_sink *downstream, struct xrt_imu_sink **out_imu_sink) |
Static Public Member Functions inherited from xrt_tracked_slam | |
static void | xrt_tracked_slam_get_tracked_pose (struct xrt_tracked_slam *slam, timepoint_ns when_ns, struct xrt_space_relation *out_relation) |
Static Public Member Functions inherited from xrt_frame_sink | |
static void | xrt_sink_push_frame (struct xrt_frame_sink *sink, struct xrt_frame *frame) |
Push a frame into the sink. More... | |
Static Public Member Functions inherited from xrt_imu_sink | |
static void | xrt_sink_push_imu (struct xrt_imu_sink *sink, struct xrt_imu_sample *sample) |
Static Public Member Functions inherited from xrt_pose_sink | |
static void | xrt_sink_push_pose (struct xrt_pose_sink *sink, struct xrt_pose_sample *sample) |
Main implementation of xrt_tracked_slam.
This is an adapter class for SLAM tracking that wraps an external SLAM implementation.
struct m_ff_vec3_f32* xrt::auxiliary::tracking::slam::TrackerSlam::accel_ff |
Last accelerometer samples.
float xrt::auxiliary::tracking::slam::TrackerSlam::alpha = 0.1 |
How much should we lerp towards the target value on each update.
const float xrt::auxiliary::tracking::slam::TrackerSlam::beta = 0.16 |
Default speed coefficient.
uint32_t xrt::auxiliary::tracking::slam::TrackerSlam::cam_count |
Number of cameras used for tracking.
struct xrt_frame_sink xrt::auxiliary::tracking::slam::TrackerSlam::cam_sinks[XRT_TRACKING_MAX_SLAM_CAMS] |
Sends camera frames to the SLAM system.
vector<string> xrt::auxiliary::tracking::slam::TrackerSlam::columns |
Column names of the measured timestamps.
int xrt::auxiliary::tracking::slam::TrackerSlam::dbg_pred_counter = 0 |
SLAM pose counter for prediction debugging.
int xrt::auxiliary::tracking::slam::TrackerSlam::dbg_pred_every = 1 |
Skip X SLAM poses so that you get tracked mostly by the prediction algo.
int xrt::auxiliary::tracking::slam::TrackerSlam::diff_idx = 0 |
Index of last error in diffs_mm.
struct u_var_timing xrt::auxiliary::tracking::slam::TrackerSlam::diff_ui |
Realtime UI for positional error.
float xrt::auxiliary::tracking::slam::TrackerSlam::diffs_mm[UI_GTDIFF_POSE_COUNT] |
Positional error wrt ground truth.
float xrt::auxiliary::tracking::slam::TrackerSlam::dur_ms[UI_TIMING_POSE_COUNT] |
Timing durations in ms.
struct u_var_button xrt::auxiliary::tracking::slam::TrackerSlam::enable_btn |
Toggle tracker timing reports.
bool xrt::auxiliary::tracking::slam::TrackerSlam::enabled = false |
Whether the timing extension is enabled.
Referenced by xrt::auxiliary::tracking::slam::timing_ui_push().
u_var_combo xrt::auxiliary::tracking::slam::TrackerSlam::end_ts |
UI combo box to select final timing measurement.
int xrt::auxiliary::tracking::slam::TrackerSlam::end_ts_idx |
Selected final timing measurement in end_ts.
struct xrt_slam_sinks* xrt::auxiliary::tracking::slam::TrackerSlam::euroc_recorder |
EuRoC dataset recording sinks.
struct vit_tracker_extension_set xrt::auxiliary::tracking::slam::TrackerSlam::exts |
VIT tracker supported extensions.
TrajectoryWriter* xrt::auxiliary::tracking::slam::TrackerSlam::filt_traj_writer |
Predicted and filtered poses.
struct { ... } xrt::auxiliary::tracking::slam::TrackerSlam::filter |
Filters are used to smooth out the resulting trajectory.
xrt_vec3 xrt::auxiliary::tracking::slam::TrackerSlam::gravity_correction {0, 0, -MATH_GRAVITY_M_S2} |
Used to correct accelerometer measurements when integrating into the prediction.
struct { ... } xrt::auxiliary::tracking::slam::TrackerSlam::gt |
Ground truth related fields.
struct xrt_pose_sink xrt::auxiliary::tracking::slam::TrackerSlam::gt_sink = {} |
Register groundtruth trajectory for stats.
struct m_ff_vec3_f32* xrt::auxiliary::tracking::slam::TrackerSlam::gyro_ff |
Last gyroscope samples.
Referenced by xrt::auxiliary::tracking::slam::predict_pose_from_imu().
struct xrt_hand_masks_sink xrt::auxiliary::tracking::slam::TrackerSlam::hand_masks_sink = {} |
Register latest masks to ignore.
int xrt::auxiliary::tracking::slam::TrackerSlam::idx = 0 |
Index of latest entry in dur_ms.
struct xrt_imu_sink xrt::auxiliary::tracking::slam::TrackerSlam::imu_sink = {} |
Sends imu samples to the SLAM system.
string xrt::auxiliary::tracking::slam::TrackerSlam::joined_columns |
Column names as a null separated string.
struct xrt_space_relation xrt::auxiliary::tracking::slam::TrackerSlam::last = XRT_SPACE_RELATION_ZERO |
Last filtered relation.
vector<timepoint_ns> xrt::auxiliary::tracking::slam::TrackerSlam::last_cam_ts |
Last received image timestamp per cam.
struct xrt_hand_masks_sample xrt::auxiliary::tracking::slam::TrackerSlam::last_hand_masks |
Last received hand masks info.
Mutex xrt::auxiliary::tracking::slam::TrackerSlam::last_hand_masks_mutex |
Mutex for last_hand_masks.
timepoint_ns xrt::auxiliary::tracking::slam::TrackerSlam::last_imu_ts |
Last received IMU sample timestamp.
struct xrt_space_relation xrt::auxiliary::tracking::slam::TrackerSlam::last_rel = XRT_SPACE_RELATION_ZERO |
Last reported/tracked pose.
timepoint_ns xrt::auxiliary::tracking::slam::TrackerSlam::last_ts |
Last reported/tracked pose timestamp.
struct os_mutex xrt::auxiliary::tracking::slam::TrackerSlam::lock_ff |
Lock for gyro_ff and accel_ff.
Referenced by xrt::auxiliary::tracking::slam::predict_pose_from_imu().
enum u_logging_level xrt::auxiliary::tracking::slam::TrackerSlam::log_level |
Logging level for the SLAM tracker, set by SLAM_LOG var.
const float xrt::auxiliary::tracking::slam::TrackerSlam::min_cutoff = M_PI |
Default minimum cutoff frequency.
const float xrt::auxiliary::tracking::slam::TrackerSlam::min_dcutoff = 1 |
Default minimum cutoff frequency for the derivative.
struct xrt_frame_node xrt::auxiliary::tracking::slam::TrackerSlam::node = {} |
Will be called on destruction.
xrt_pose xrt::auxiliary::tracking::slam::TrackerSlam::origin |
First ground truth pose.
bool xrt::auxiliary::tracking::slam::TrackerSlam::override_tracking = false |
Force the tracker to report gt poses instead.
struct openvr_tracker* xrt::auxiliary::tracking::slam::TrackerSlam::ovr_tracker |
OpenVR lighthouse tracker.
m_filter_euro_vec3 xrt::auxiliary::tracking::slam::TrackerSlam::pos_oe |
One euro position filter.
u_var_combo xrt::auxiliary::tracking::slam::TrackerSlam::pred_combo |
UI combo box to select pred_type.
TrajectoryWriter* xrt::auxiliary::tracking::slam::TrackerSlam::pred_traj_writer |
Predicted poses.
t_slam_prediction_type xrt::auxiliary::tracking::slam::TrackerSlam::pred_type |
Type of prediction to use.
struct u_var_button xrt::auxiliary::tracking::slam::TrackerSlam::reset_state_btn |
Reset tracker state button.
struct m_ff_vec3_f32* xrt::auxiliary::tracking::slam::TrackerSlam::rot_ff |
Predicted positions fifo.
m_filter_euro_quat xrt::auxiliary::tracking::slam::TrackerSlam::rot_oe |
One euro rotation filter.
struct xrt_slam_sinks xrt::auxiliary::tracking::slam::TrackerSlam::sinks = {} |
Pointers to the sinks below.
FeaturesWriter* xrt::auxiliary::tracking::slam::TrackerSlam::slam_features_writer |
Feature tracking information for analysis.
RelationHistory xrt::auxiliary::tracking::slam::TrackerSlam::slam_rels {} |
A history of relations produced purely from external SLAM tracker data.
TimingWriter* xrt::auxiliary::tracking::slam::TrackerSlam::slam_times_writer |
Timestamps of the pipeline for performance analysis.
TrajectoryWriter* xrt::auxiliary::tracking::slam::TrackerSlam::slam_traj_writer |
Estimated poses from the SLAM system.
u_var_combo xrt::auxiliary::tracking::slam::TrackerSlam::start_ts |
UI combo box to select initial timing measurement.
int xrt::auxiliary::tracking::slam::TrackerSlam::start_ts_idx |
Selected initial timing measurement in start_ts.
bool xrt::auxiliary::tracking::slam::TrackerSlam::submit |
Whether to submit data pushed to sinks to the SLAM tracker.
struct xrt_space_relation xrt::auxiliary::tracking::slam::TrackerSlam::target = XRT_SPACE_RELATION_ZERO |
Target relation.
struct { ... } xrt::auxiliary::tracking::slam::TrackerSlam::timing |
Tracker timing info for performance evaluation.
Referenced by xrt::auxiliary::tracking::slam::timing_ui_push().
struct vit_tracker* xrt::auxiliary::tracking::slam::TrackerSlam::tracker |
Pointer to the tracker created by the loaded VIT system;.
Referenced by xrt::auxiliary::tracking::slam::flush_poses().
Trajectory* xrt::auxiliary::tracking::slam::TrackerSlam::trajectory |
Empty if we've not received groundtruth.
struct u_var_timing xrt::auxiliary::tracking::slam::TrackerSlam::ui |
Realtime UI for tracker durations.
vector<u_sink_debug> xrt::auxiliary::tracking::slam::TrackerSlam::ui_sink |
Sink to display frames in UI of each camera.
bool xrt::auxiliary::tracking::slam::TrackerSlam::use_exponential_smoothing_filter = false |
Predicted rotations fifo (only xyz components, w is inferred)
struct t_vit_bundle xrt::auxiliary::tracking::slam::TrackerSlam::vit |
VIT system function pointers.
Referenced by xrt::auxiliary::tracking::slam::flush_poses(), and xrt::auxiliary::tracking::slam::timing_ui_push().
double xrt::auxiliary::tracking::slam::TrackerSlam::window = 66 |
Time window in ms take the average on.
Increasing it smooths out the tracking at the cost of adding delay.