mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
Head tracking for the XREAL One, One Pro, One Pro+ and Aura (#2532)
* Head tracking for the XREAL One, One Pro, One Pro+ and Aura These glasses use the same USB Ethernet link and 128-byte IMU report as the 1S. XrealModel now has one model per product: the 1S keeps its tested display-mode control, and the others switch 2D and 3D only with GET_INPUT (0x2821) and SET_INPUT (0x2822). Display-mode set (0x275f), brightness and the dimmer are never sent to them. The Aura's IMU reads x right, y up, z back (about +9.8 m/s2 on y at rest), so its axes are not flipped like the rest of the family. Recovery-mode product ids (one below each) stay excluded. Signed-off-by: Mike Haye <84657517+mhaye20@users.noreply.github.com> * Describe the wider XREAL support in the glasses panel and docs The panel's help text and docs/smart-glasses-support.md named only the 1S. They now list the One, One Pro, One Pro+ and Aura, say what was tested on the Aura (head tracking and 2D/3D switching), and note that these models get 2D and SBS only, without brightness, dimming or display-mode set commands. Translations still describe the 1S only. Signed-off-by: Mike Haye <84657517+mhaye20@users.noreply.github.com> * Docs: XREAL support is no longer 1S only The paragraph under the support matrix still said the One and One Pro were excluded. Signed-off-by: Mike Haye <84657517+mhaye20@users.noreply.github.com> --------- Signed-off-by: Mike Haye <84657517+mhaye20@users.noreply.github.com>
This commit is contained in:
1 parent
253756d45f
commit
33cd43237e
11 files changed
+136
-45
No files matched your search
@@ -30,7 +30,8 @@ class Glasses3dRoutingTest {
|
||||
RayNeoModel.model(0x1bbb, 0xaf50, "RayNeo Air 4 Pro")!!,
|
||||
RayNeoModel.model(0x3941, 0xaf50, "RayNeo GT")!!,
|
||||
RayNeoModel.model(0x3941, 0xaf50, "RayNeo GT MAX")!!,
|
||||
XrealModel,
|
||||
XrealModel.ONE_S,
|
||||
XrealModel.AURA,
|
||||
)
|
||||
private fun field(name: String) = Glasses::class.java.getDeclaredField(name).apply { isAccessible = true }
|
||||
|
||||
|
||||
@@ -252,10 +252,14 @@ class GlassesUsbTest {
|
||||
.apply { isAccessible = true }.invoke(Glasses, ask)
|
||||
}
|
||||
|
||||
@Test fun xreal1SUsesExactIdentityAndExcludesAirOneProAndRecoveryProducts() {
|
||||
assertEquals(XrealModel, Glasses.deviceModel(device(0x043e, 0x3318, "XREAL 1S")))
|
||||
@Test fun xrealOneFamilyUsesExactIdentityAndExcludesAirAndRecoveryProducts() {
|
||||
assertEquals(XrealModel.ONE_S, Glasses.deviceModel(device(0x043e, 0x3318, "XREAL 1S")))
|
||||
assertEquals(XrealModel.ONE, Glasses.deviceModel(device(0x0438, 0x3318, "XREAL One")))
|
||||
assertEquals(XrealModel.ONE_PRO, Glasses.deviceModel(device(0x0436, 0x3318, "XREAL One Pro")))
|
||||
assertEquals(XrealModel.ONE_PRO_PLUS, Glasses.deviceModel(device(0x0444, 0x3318, "XREAL 1 Pro+")))
|
||||
assertEquals(XrealModel.AURA, Glasses.deviceModel(device(0x043a, 0x3318, "XREAL Aura")))
|
||||
assertTrue(Glasses.isGlassesDisplayName("XREAL 1S"))
|
||||
for (pid in listOf(0x043d, 0x0435, 0x0436, 0x0424, 0xffff)) {
|
||||
for (pid in listOf(0x043d, 0x0435, 0x0437, 0x0439, 0x0443, 0x0424, 0xffff)) {
|
||||
assertEquals(null, Glasses.deviceModel(device(pid, 0x3318, "XREAL 1S")))
|
||||
}
|
||||
assertEquals(null, Glasses.deviceModel(device(0x043e, 0x1234, "XREAL 1S")))
|
||||
|
||||
@@ -60,6 +60,12 @@ class XrealOrientationFilterTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun auraAxesAreNotFlippedLikeTheRestOfTheOneFamily() {
|
||||
val aura = XrealOrientationFilter(flipYz = false).update(sample(1000000, accel = Vec3(0f, 9.81f, 0f)))!!
|
||||
assertTrue(matrix(aura)[7] > 0.99f)
|
||||
assertNull(XrealOrientationFilter(flipYz = false).update(sample(1000000, accel = Vec3(0f, 0f, 0f))))
|
||||
}
|
||||
|
||||
@Test fun capturedNeutralGravityStartsUprightBeforeRecenter() {
|
||||
val pose = XrealOrientationFilter().update(sample(1000000,
|
||||
accel = Vec3(-0.0909f, -9.6529f, -1.0731f)))!!
|
||||
|
||||
@@ -69,6 +69,20 @@ class XrealProtocolTest {
|
||||
assertEquals(26, output.size())
|
||||
}
|
||||
|
||||
@Test fun stereoOnlyControlSwitches3dWithoutDisplayModeCommands() {
|
||||
val output = ByteArrayOutputStream()
|
||||
val replies = response(XrealProtocol.GET_INPUT, 1, byteArrayOf(0x22, 0)) +
|
||||
response(XrealProtocol.SET_INPUT, 2, byteArrayOf(0x22, 0)) +
|
||||
response(XrealProtocol.GET_INPUT, 3, byteArrayOf(0x22, 2, 0x10, 1))
|
||||
val control = XrealControl(channels(replies.inputStream(), output), stereoOnly = true, settleDelayMs = 0)
|
||||
assertEquals(XrealModel.NATIVE_60HZ, control.display())
|
||||
assertEquals(5, control.changeDisplay(5))
|
||||
val written = output.toByteArray().inputStream()
|
||||
val commands = List(3) { XrealProtocol.read(written).command }
|
||||
assertEquals(listOf(XrealProtocol.GET_INPUT, XrealProtocol.SET_INPUT, XrealProtocol.GET_INPUT), commands)
|
||||
assertFalse(commands.any { it == XrealProtocol.GET_DISPLAY || it == XrealProtocol.SET_DISPLAY })
|
||||
}
|
||||
|
||||
@Test fun unrelatedResponsesCannotKeepControlWaitingForever() {
|
||||
val replies = ByteArrayOutputStream().apply { repeat(32) { write(frame(0x272e, ByteArray(8))) } }
|
||||
val control = XrealControl(channels(replies.toByteArray().inputStream(), ByteArrayOutputStream()))
|
||||
@@ -79,7 +93,9 @@ class XrealProtocolTest {
|
||||
val reply = byteArrayOf(0x22, 2, 0x10, 0x1d)
|
||||
val control = XrealControl(channels(response(0x275e, 1, reply).inputStream(), ByteArrayOutputStream()))
|
||||
assertEquals(29, control.display())
|
||||
assertEquals(29, XrealModel.mode(60, false))
|
||||
assertEquals(29, XrealModel.ONE_S.mode(60, false))
|
||||
assertEquals(29, XrealModel.AURA.mode(120, false))
|
||||
assertEquals(5, XrealModel.AURA.mode(60, true))
|
||||
}
|
||||
|
||||
@Test fun stereoWaitsForEdidChangeWithoutSendingASecondModeCommandWhileBusy() {
|
||||
|
||||
Reference in new issue
Block a user