Monado OpenXR Runtime
t_euroc_recorder.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 EuRoC dataset recorder utility.
6 * @author Mateo de Mayo <mateo.demayo@collabora.com>
7 * @ingroup aux_tracking
8 */
9
10#pragma once
11
12#include "xrt/xrt_tracking.h"
13#include "xrt/xrt_frame.h"
14
15#define CSV_EOL "\r\n"
16#define CSV_PRECISION 10
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/*!
23 * Create SLAM sinks to record samples in EuRoC format.
24 *
25 * @param xfctx Frame context for the sinks.
26 * @param record_path Directory name to save the dataset or NULL for a default based on the current datetime.
27 * @param cam_count Number of cameras to record
28 * @param record_from_start Whether to start recording immediately on creation.
29 * @return struct xrt_slam_sinks* Sinks to push samples to for recording.
30 *
31 * @ingroup aux_tracking
32 */
33struct xrt_slam_sinks *
34euroc_recorder_create(struct xrt_frame_context *xfctx, const char *record_path, int cam_count, bool record_from_start);
35
36/*!
37 * Start recording samples sent to the recorder sinks.
38 *
39 * @param er_sinks The recorder sinks returned by @ref euroc_recorder_create
40 */
41void
42euroc_recorder_start(struct xrt_slam_sinks *er_sinks);
43
44/*!
45 * Stop recording samples sent to the recorder sinks. You can start and
46 * stop as many times as you like.
47 *
48 * @param er_sinks The recorder sinks returned by @ref euroc_recorder_create
49 */
50void
51euroc_recorder_stop(struct xrt_slam_sinks *er_sinks);
52
53/*!
54 * Add EuRoC recorder UI button to start recording after creation.
55 *
56 * @param er_sinks The sinks returned by @ref euroc_recorder_create
57 * @param root The pointer to add UI button to
58 * @param prefix Prefix in case you have multiple recorders, otherwise pass an empty string
59 */
60void
61euroc_recorder_add_ui(struct xrt_slam_sinks *er_sinks, void *root, const char *prefix);
62
63#ifdef __cplusplus
64}
65#endif
struct xrt_slam_sinks * euroc_recorder_create(struct xrt_frame_context *xfctx, const char *record_path, int cam_count, bool record_from_start)
Create SLAM sinks to record samples in EuRoC format.
Definition: t_euroc_recorder.cpp:341
Object used to track all sinks and frame producers in a graph.
Definition: xrt_frame.h:108
Container of pointers to sinks that could be used for a SLAM system.
Definition: xrt_tracking.h:202
void euroc_recorder_stop(struct xrt_slam_sinks *er_sinks)
Stop recording samples sent to the recorder sinks.
Definition: t_euroc_recorder.cpp:421
void euroc_recorder_start(struct xrt_slam_sinks *er_sinks)
Start recording samples sent to the recorder sinks.
Definition: t_euroc_recorder.cpp:399
void euroc_recorder_add_ui(struct xrt_slam_sinks *er_sinks, void *root, const char *prefix)
Add EuRoC recorder UI button to start recording after creation.
Definition: t_euroc_recorder.cpp:450
Data frame header.
Header defining the tracking system integration in Monado.