Monado OpenXR Runtime
euroc_interface.h
Go to the documentation of this file.
1// Copyright 2021, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Interface for @ref drv_euroc
6 * @author Mateo de Mayo <mateo.demayo@collabora.com>
7 * @ingroup drv_euroc
8 */
9
10#pragma once
11
12#include "util/u_logging.h"
13#include "xrt/xrt_frameserver.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19/*!
20 * @defgroup drv_euroc Euroc driver
21 * @ingroup drv
22 *
23 * @brief Provide euroc dataset playback features for SLAM evaluation
24 *
25 * This driver works with any dataset using the EuRoC format.
26 * Original EuRoC datasets and more information about them can be found in
27 * https://projects.asl.ethz.ch/datasets/doku.php?id=kmavvisualinertialdatasets
28 */
29
30/*!
31 * Playback configuration for the euroc player.
32 *
33 * @ingroup drv_euroc
34 */
36{
37 int cam_count; //!< Number of cameras to stream from the dataset
38 bool color; //!< If RGB available but this is false, images will be loaded in grayscale
39 bool gt; //!< Whether to send groundtruth data (if available) to the SLAM tracker
40 bool skip_perc; //!< Whether @ref skip_first represents percentage or seconds
41 float skip_first; //!< How much of the first dataset samples to skip, @see skip_perc
42 float scale; //!< Scale of each frame; e.g., 0.5 (half), 1.0 (avoids resize)
43 bool max_speed; //!< If true, push samples as fast as possible, other wise @see speed
44 double speed; //!< Intended reproduction speed if @ref max_speed is false
45 bool send_all_imus_first; //!< If enabled all imu samples will be sent before img samples
46 bool paused; //!< Whether to pause the playback
47 bool use_source_ts; //!< If true, use the original timestamps from the dataset
48 bool play_from_start; //!< If set, the euroc player does not wait for user input to start
49 bool print_progress; //!< Whether to print progress to stdout (useful for CLI runs)
50};
51
52/*!
53 * Describes information about a particular EuRoC dataset residing in `path`.
54 *
55 * @ingroup drv_euroc
56 */
58{
59 char path[256];
60 int cam_count;
61 bool is_colored;
62 bool has_gt; //!< Whether this dataset has groundtruth data available
63 const char *gt_device_name;
64 uint32_t width;
65 uint32_t height;
66};
67
68/*!
69 * Configuration for the euroc player.
70 *
71 * @ingroup drv_euroc
72 */
74{
75 enum u_logging_level log_level;
76 struct euroc_player_dataset_info dataset;
77 struct euroc_player_playback_config playback;
78};
79
80/*!
81 * Fills in an @ref euroc_player_config with defaults based on the provided dataset path.
82 *
83 * @ingroup drv_euroc
84 */
85void
86euroc_player_fill_default_config_for(struct euroc_player_config *config, const char *path);
87
88/*!
89 * Create an euroc player from a path to a dataset.
90 *
91 * @ingroup drv_euroc
92 */
93struct xrt_fs *
94euroc_player_create(struct xrt_frame_context *xfctx, const char *path, struct euroc_player_config *config);
95
96/*!
97 * Create a auto prober for the fake euroc device.
98 *
99 * @ingroup drv_euroc
100 */
101struct xrt_auto_prober *
103
104/*!
105 * Tracks an euroc dataset with the SLAM tracker.
106 *
107 * @param should_exit External exit condition, the run will end if it becomes true
108 * @param euroc_path Dataset path
109 * @param slam_config Path to config file for the SLAM system
110 * @param output_path Path to write resulting tracking data to
111 *
112 * @ingroup drv_euroc
113 */
114void
115euroc_run_dataset(const char *euroc_path,
116 const char *slam_config,
117 const char *output_path,
118 const volatile bool *should_exit);
119
120/*!
121 * @dir drivers/euroc
122 *
123 * @brief @ref drv_euroc files.
124 */
125
126#ifdef __cplusplus
127}
128#endif
u_logging_level
Logging level enum.
Definition: u_logging.h:43
struct xrt_auto_prober * euroc_create_auto_prober(void)
Create a auto prober for the fake euroc device.
Definition: euroc_device.c:76
void euroc_player_fill_default_config_for(struct euroc_player_config *config, const char *path)
Fills in an euroc_player_config with defaults based on the provided dataset path.
Definition: euroc_player.cpp:924
void euroc_run_dataset(const char *euroc_path, const char *slam_config, const char *output_path, const volatile bool *should_exit)
Tracks an euroc dataset with the SLAM tracker.
Definition: euroc_runner.c:27
struct xrt_fs * euroc_player_create(struct xrt_frame_context *xfctx, const char *path, struct euroc_player_config *config)
Create an euroc player from a path to a dataset.
Definition: euroc_player.cpp:957
Configuration for the euroc player.
Definition: euroc_interface.h:74
Describes information about a particular EuRoC dataset residing in path.
Definition: euroc_interface.h:58
bool has_gt
Whether this dataset has groundtruth data available.
Definition: euroc_interface.h:62
Playback configuration for the euroc player.
Definition: euroc_interface.h:36
bool play_from_start
If set, the euroc player does not wait for user input to start.
Definition: euroc_interface.h:48
bool paused
Whether to pause the playback.
Definition: euroc_interface.h:46
int cam_count
Number of cameras to stream from the dataset.
Definition: euroc_interface.h:37
float scale
Scale of each frame; e.g., 0.5 (half), 1.0 (avoids resize)
Definition: euroc_interface.h:42
bool skip_perc
Whether skip_first represents percentage or seconds.
Definition: euroc_interface.h:40
bool send_all_imus_first
If enabled all imu samples will be sent before img samples.
Definition: euroc_interface.h:45
bool max_speed
If true, push samples as fast as possible, other wise.
Definition: euroc_interface.h:43
bool print_progress
Whether to print progress to stdout (useful for CLI runs)
Definition: euroc_interface.h:49
bool gt
Whether to send groundtruth data (if available) to the SLAM tracker.
Definition: euroc_interface.h:39
bool color
If RGB available but this is false, images will be loaded in grayscale.
Definition: euroc_interface.h:38
float skip_first
How much of the first dataset samples to skip,.
Definition: euroc_interface.h:41
bool use_source_ts
If true, use the original timestamps from the dataset.
Definition: euroc_interface.h:47
double speed
Intended reproduction speed if max_speed is false.
Definition: euroc_interface.h:44
An interface to be exposed by a device driver that should probe for the existence of its own device o...
Definition: xrt_prober.h:761
Object used to track all sinks and frame producers in a graph.
Definition: xrt_frame.h:108
Frameserver that generates frames.
Definition: xrt_frameserver.h:70
Basic logging functionality.
Frameserver interface for video drivers.