Monado OpenXR Runtime
vive_lighthouse.h
Go to the documentation of this file.
1 // Copyright 2016-2019, Philipp Zabel
2 // Copyright 2020, Collabora, Ltd.
3 // SPDX-License-Identifier: BSL-1.0
4 /*!
5  * @file
6  * @brief Vive Lighthouse Watchman implementation
7  * @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
8  * @ingroup drv_vive
9  */
10 
11 #pragma once
12 
13 #include <math.h>
14 #include <stdbool.h>
15 #include <stdint.h>
16 #include <stdlib.h>
17 #include <string.h>
18 #include <unistd.h>
19 
20 #include "xrt/xrt_defines.h"
21 
23 {
24  float tilt;
25  float phase;
26  float curve;
27  float gibphase;
28  float gibmag;
29 };
30 
32 {
33  struct lighthouse_rotor_calibration rotor[2];
34 };
35 
37 {
38  uint32_t sync_timestamp;
39  uint32_t sync_duration;
40  uint32_t sync_ids;
41  uint32_t sweep_ids;
42  uint32_t sweep_offset[32];
43  uint16_t sweep_duration[32];
44  uint32_t frame_duration;
45 };
46 
48 {
49  int data_sync;
50  int data_word;
51  int data_bit;
52  uint8_t ootx[40];
53 
54  int firmware_version;
55  uint32_t serial;
56  struct lighthouse_base_calibration calibration;
57  struct xrt_vec3 gravity;
58  char channel;
59  int model_id;
60  int reset_count;
61 
62  uint32_t last_sync_timestamp;
63  int active_rotor;
64 
65  struct lighthouse_frame frame[2];
66 };
67 
69 {
70  uint32_t timestamp;
71  uint16_t duration;
72  uint8_t id;
73 };
74 
76 {
77  struct lighthouse_pulse sync;
78  struct lighthouse_pulse sweep;
79 };
80 
82 {
83  uint32_t num_points;
84  struct xrt_vec3 *points;
85  struct xrt_vec3 *normals;
86 };
87 
89 {
90  uint32_t id;
91  const char *name;
92  struct tracking_model model;
93  bool base_visible;
94  struct lighthouse_base base[2];
95  struct lighthouse_base *active_base;
96  uint32_t seen_by;
97  uint32_t last_timestamp;
98  struct lighthouse_sensor sensor[32];
99  struct lighthouse_pulse last_sync;
100  bool sync_lock;
101 };
102 
103 void
104 lighthouse_watchman_handle_pulse(struct lighthouse_watchman *watchman,
105  uint8_t id,
106  uint16_t duration,
107  uint32_t timestamp);
108 void
109 lighthouse_watchman_init(struct lighthouse_watchman *watchman, const char *name);
Definition: u_pacing_compositor.c:55
Definition: vive_lighthouse.h:32
Definition: vive_lighthouse.h:48
Definition: vive_lighthouse.h:37
Definition: vive_lighthouse.h:69
Definition: vive_lighthouse.h:23
Definition: vive_lighthouse.h:76
Definition: vive_lighthouse.h:89
Definition: vive_lighthouse.h:82
A 3 element vector with single floats.
Definition: xrt_defines.h:271
Common defines and enums for XRT.