Monado OpenXR Runtime
Loading...
Searching...
No Matches
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 imu_count Number of IMU sensors to record
29 * @param record_from_start Whether to start recording immediately on creation.
30 * @return struct xrt_slam_sinks* Sinks to push samples to for recording.
31 *
32 * @ingroup aux_tracking
33 */
34struct xrt_slam_sinks *
36 struct xrt_frame_context *xfctx, const char *record_path, int cam_count, int imu_count, bool record_from_start);
37
38/*!
39 * Start recording samples sent to the recorder sinks.
40 *
41 * @param er_sinks The recorder sinks returned by @ref euroc_recorder_create
42 */
43void
44euroc_recorder_start(struct xrt_slam_sinks *er_sinks);
45
46/*!
47 * Stop recording samples sent to the recorder sinks. You can start and
48 * stop as many times as you like.
49 *
50 * @param er_sinks The recorder sinks returned by @ref euroc_recorder_create
51 */
52void
53euroc_recorder_stop(struct xrt_slam_sinks *er_sinks);
54
55/*!
56 * Add EuRoC recorder UI button to start recording after creation.
57 *
58 * @param er_sinks The sinks returned by @ref euroc_recorder_create
59 * @param root The pointer to add UI button to
60 * @param prefix Prefix in case you have multiple recorders, otherwise pass an empty string
61 */
62void
63euroc_recorder_add_ui(struct xrt_slam_sinks *er_sinks, void *root, const char *prefix);
64
65#ifdef __cplusplus
66}
67#endif
struct xrt_slam_sinks * euroc_recorder_create(struct xrt_frame_context *xfctx, const char *record_path, int cam_count, int imu_count, bool record_from_start)
Create SLAM sinks to record samples in EuRoC format.
Definition t_euroc_recorder.cpp:372
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:214
void euroc_recorder_stop(struct xrt_slam_sinks *er_sinks)
Stop recording samples sent to the recorder sinks.
Definition t_euroc_recorder.cpp:462
void euroc_recorder_start(struct xrt_slam_sinks *er_sinks)
Start recording samples sent to the recorder sinks.
Definition t_euroc_recorder.cpp:440
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:491
Data frame header.
Header defining the tracking system integration in Monado.