Monado OpenXR Runtime
Loading...
Searching...
No Matches
pssense_led_model.h
Go to the documentation of this file.
1// Copyright 2026, Beyley Cardellio
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief PlayStation Sense controller LED models. Data extracted from Sony's PC driver.
6 * @author Beyley Cardellio <ep1cm1n10n123@gmail.com>
7 * @ingroup drv_pssense
8 */
9
10#pragma once
11
13
14#include "math/m_api.h"
15
16
17static const float LED_RADIUS_M = 0.006f; // 6mm
18static const float LED_VISIBILITY_ANGLE = DEG_TO_RAD(90);
19static const struct t_constellation_tracker_led_model_match_parameters DEFAULT_MATCH_PARAMETERS = {
21 .min_leds_for_correspondence_search_with_prior = 5,
22};
23
24//! Rotation on X axis from LED -> IMU.
25const float pssense_imu_angle = DEG_TO_RAD(50.27f);
26
27//! The offset from the LED origin -> IMU origin, for the left controller
28static struct xrt_vec3 T_led_imu_left = {
29 .x = 0.0093727f,
30 .y = -0.0122481f,
31 .z = -0.0060039f,
32};
33//! The offset from the LED origin -> IMU origin, for the right controller
34static struct xrt_vec3 T_led_imu_right = {
35 .x = -0.0200727f,
36 .y = -0.0122481f,
37 .z = -0.0060039f,
38};
39
40/*
41 * Intercepted at address 0xdde10 in the driver, within a vector in the first
42 * parameter object.
43 */
44static struct t_constellation_tracker_led pssense_left_leds[] = {
45 {
46 .position = {-0.012054, -0.055213, 0.038152},
47 .normal = {-0.176485, -0.811967, 0.556384},
48 .radius_m = LED_RADIUS_M,
49 .visibility_angle = LED_VISIBILITY_ANGLE,
50 .id = 0,
51 },
52 {
53 .position = {-0.033088, -0.055236, 0.020190},
54 .normal = {-0.426232, -0.891845, -0.151455},
55 .radius_m = LED_RADIUS_M,
56 .visibility_angle = LED_VISIBILITY_ANGLE,
57 .id = 1,
58 },
59 {
60 .position = {-0.053695, -0.031009, 0.028350},
61 .normal = {-0.788493, -0.456350, 0.412339},
62 .radius_m = LED_RADIUS_M,
63 .visibility_angle = LED_VISIBILITY_ANGLE,
64 .id = 2,
65 },
66 {
67 .position = {-0.066986, -0.010505, 0.008679},
68 .normal = {-0.980055, -0.153898, 0.125726},
69 .radius_m = LED_RADIUS_M,
70 .visibility_angle = LED_VISIBILITY_ANGLE,
71 .id = 3,
72 },
73 {
74 .position = {-0.063505, 0.024601, 0.004185},
75 .normal = {-0.930796, 0.360502, 0.060482},
76 .radius_m = LED_RADIUS_M,
77 .visibility_angle = LED_VISIBILITY_ANGLE,
78 .id = 4,
79 },
80 {
81 .position = {-0.047803, 0.044966, 0.018502},
82 .normal = {-0.701817, 0.660177, 0.267618},
83 .radius_m = LED_RADIUS_M,
84 .visibility_angle = LED_VISIBILITY_ANGLE,
85 .id = 5,
86 },
87 {
88 .position = {0.045472, -0.027042, 0.043022},
89 .normal = {0.667492, -0.396842, 0.630056},
90 .radius_m = LED_RADIUS_M,
91 .visibility_angle = LED_VISIBILITY_ANGLE,
92 .id = 6,
93 },
94 {
95 .position = {0.059535, -0.013977, 0.028536},
96 .normal = {0.961512, -0.273488, -0.026435},
97 .radius_m = LED_RADIUS_M,
98 .visibility_angle = LED_VISIBILITY_ANGLE,
99 .id = 7,
100 },
101 {
102 .position = {0.061060, 0.014608, 0.024725},
103 .normal = {0.984435, 0.154641, -0.083507},
104 .radius_m = LED_RADIUS_M,
105 .visibility_angle = LED_VISIBILITY_ANGLE,
106 .id = 8,
107 },
108 {
109 .position = {0.050994, 0.027255, 0.036184},
110 .normal = {0.748123, 0.399672, 0.529693},
111 .radius_m = LED_RADIUS_M,
112 .visibility_angle = LED_VISIBILITY_ANGLE,
113 .id = 9,
114 },
115 {
116 .position = {0.048475, 0.043025, 0.018776},
117 .normal = {0.795992, 0.580182, -0.172584},
118 .radius_m = LED_RADIUS_M,
119 .visibility_angle = LED_VISIBILITY_ANGLE,
120 .id = 10,
121 },
122 {
123 .position = {0.030569, 0.053446, 0.029350},
124 .normal = {0.448555, 0.783814, 0.429458},
125 .radius_m = LED_RADIUS_M,
126 .visibility_angle = LED_VISIBILITY_ANGLE,
127 .id = 11,
128 },
129 {
130 .position = {0.018498, 0.063913, 0.011230},
131 .normal = {0.346695, 0.893406, -0.285708},
132 .radius_m = LED_RADIUS_M,
133 .visibility_angle = LED_VISIBILITY_ANGLE,
134 .id = 12,
135 },
136 {
137 .position = {-0.002748, 0.064260, 0.022718},
138 .normal = {-0.040150, 0.942362, 0.332178},
139 .radius_m = LED_RADIUS_M,
140 .visibility_angle = LED_VISIBILITY_ANGLE,
141 .id = 13,
142 },
143 {
144 .position = {-0.029078, 0.013435, -0.060735},
145 .normal = {-0.417589, 0.258817, -0.870996},
146 .radius_m = LED_RADIUS_M,
147 .visibility_angle = LED_VISIBILITY_ANGLE,
148 .id = 14,
149 },
150 {
151 .position = {0.001067, 0.013435, -0.067327},
152 .normal = {0.014114, 0.258800, -0.965828},
153 .radius_m = LED_RADIUS_M,
154 .visibility_angle = LED_VISIBILITY_ANGLE,
155 .id = 15,
156 },
157 {
158 .position = {0.031783, 0.013435, -0.059270},
159 .normal = {0.458628, 0.258803, -0.850106},
160 .radius_m = LED_RADIUS_M,
161 .visibility_angle = LED_VISIBILITY_ANGLE,
162 .id = 16,
163 },
164};
165
166static struct t_constellation_tracker_led pssense_right_leds[] = {
167 {
168 .position = {0.012054, -0.055213, 0.038152},
169 .normal = {0.176485, -0.811967, 0.556384},
170 .radius_m = LED_RADIUS_M,
171 .visibility_angle = LED_VISIBILITY_ANGLE,
172 .id = 0,
173 },
174 {
175 .position = {0.033088, -0.055236, 0.020190},
176 .normal = {0.426232, -0.891845, -0.151455},
177 .radius_m = LED_RADIUS_M,
178 .visibility_angle = LED_VISIBILITY_ANGLE,
179 .id = 1,
180 },
181 {
182 .position = {0.053695, -0.031009, 0.028350},
183 .normal = {0.788493, -0.456350, 0.412339},
184 .radius_m = LED_RADIUS_M,
185 .visibility_angle = LED_VISIBILITY_ANGLE,
186 .id = 2,
187 },
188 {
189 .position = {0.066986, -0.010505, 0.008679},
190 .normal = {0.980055, -0.153898, 0.125726},
191 .radius_m = LED_RADIUS_M,
192 .visibility_angle = LED_VISIBILITY_ANGLE,
193 .id = 3,
194 },
195 {
196 .position = {0.063505, 0.024601, 0.004185},
197 .normal = {0.930796, 0.360502, 0.060482},
198 .radius_m = LED_RADIUS_M,
199 .visibility_angle = LED_VISIBILITY_ANGLE,
200 .id = 4,
201 },
202 {
203 .position = {0.047803, 0.044966, 0.018502},
204 .normal = {0.701817, 0.660177, 0.267618},
205 .radius_m = LED_RADIUS_M,
206 .visibility_angle = LED_VISIBILITY_ANGLE,
207 .id = 5,
208 },
209 {
210 .position = {-0.045472, -0.027042, 0.043022},
211 .normal = {-0.667492, -0.396842, 0.630056},
212 .radius_m = LED_RADIUS_M,
213 .visibility_angle = LED_VISIBILITY_ANGLE,
214 .id = 6,
215 },
216 {
217 .position = {-0.059535, -0.013977, 0.028536},
218 .normal = {-0.961512, -0.273488, -0.026435},
219 .radius_m = LED_RADIUS_M,
220 .visibility_angle = LED_VISIBILITY_ANGLE,
221 .id = 7,
222 },
223 {
224 .position = {-0.061060, 0.014608, 0.024725},
225 .normal = {-0.984435, 0.154641, -0.083507},
226 .radius_m = LED_RADIUS_M,
227 .visibility_angle = LED_VISIBILITY_ANGLE,
228 .id = 8,
229 },
230 {
231 .position = {-0.050994, 0.027255, 0.036184},
232 .normal = {-0.748123, 0.399672, 0.529693},
233 .radius_m = LED_RADIUS_M,
234 .visibility_angle = LED_VISIBILITY_ANGLE,
235 .id = 9,
236 },
237 {
238 .position = {-0.048475, 0.043025, 0.018776},
239 .normal = {-0.795992, 0.580182, -0.172584},
240 .radius_m = LED_RADIUS_M,
241 .visibility_angle = LED_VISIBILITY_ANGLE,
242 .id = 10,
243 },
244 {
245 .position = {-0.030569, 0.053446, 0.029350},
246 .normal = {-0.448555, 0.783814, 0.429458},
247 .radius_m = LED_RADIUS_M,
248 .visibility_angle = LED_VISIBILITY_ANGLE,
249 .id = 11,
250 },
251 {
252 .position = {-0.018498, 0.063913, 0.011230},
253 .normal = {-0.346695, 0.893406, -0.285708},
254 .radius_m = LED_RADIUS_M,
255 .visibility_angle = LED_VISIBILITY_ANGLE,
256 .id = 12,
257 },
258 {
259 .position = {0.002748, 0.064260, 0.022718},
260 .normal = {0.040150, 0.942362, 0.332178},
261 .radius_m = LED_RADIUS_M,
262 .visibility_angle = LED_VISIBILITY_ANGLE,
263 .id = 13,
264 },
265 {
266 .position = {0.029078, 0.013435, -0.060735},
267 .normal = {0.417589, 0.258817, -0.870996},
268 .radius_m = LED_RADIUS_M,
269 .visibility_angle = LED_VISIBILITY_ANGLE,
270 .id = 14,
271 },
272 {
273 .position = {-0.001067, 0.013435, -0.067327},
274 .normal = {-0.014114, 0.258800, -0.965828},
275 .radius_m = LED_RADIUS_M,
276 .visibility_angle = LED_VISIBILITY_ANGLE,
277 .id = 15,
278 },
279 {
280 .position = {-0.031783, 0.013435, -0.059270},
281 .normal = {-0.458628, 0.258803, -0.850106},
282 .radius_m = LED_RADIUS_M,
283 .visibility_angle = LED_VISIBILITY_ANGLE,
284 .id = 16,
285 },
286};
#define DEG_TO_RAD(DEG)
Degrees to radians conversion.
Definition m_api.h:87
C interface to math library.
const float pssense_imu_angle
Rotation on X axis from LED -> IMU.
Definition pssense_led_model.h:25
static struct xrt_vec3 T_led_imu_right
The offset from the LED origin -> IMU origin, for the right controller.
Definition pssense_led_model.h:34
static struct xrt_vec3 T_led_imu_left
The offset from the LED origin -> IMU origin, for the left controller.
Definition pssense_led_model.h:28
uint32_t min_leds_for_correspondence_search_without_prior
The minimum number of LEDs required to accept a brute-force solve without a prior.
Definition t_constellation.h:269
Definition t_constellation.h:253
struct xrt_vec3 position
The position of the LED in the model.
Definition t_constellation.h:255
A 3 element vector with single floats.
Definition xrt_defines.h:310
Header defining the tracking system integration in Monado.