Accept fixed tracker accel

This commit is contained in:
Butterscotch!
2026-01-06 22:51:17 -05:00
parent f09cd687c7
commit 9f8be6551c

View File

@@ -417,9 +417,13 @@ class TrackersUDPServer(private val port: Int, name: String, private val tracker
if (tracker == null) return
tracker.setRotation(rot)
if (packet is UDPPacket23RotationAndAcceleration) {
// If sensorOffset was applied to accel correctly, the axes will already
// be correct for SlimeVR
tracker.setAcceleration(SENSOR_OFFSET_CORRECTION.sandwich(packet.acceleration))
// sensorOffset is applied correctly since protocol 22
// See: https://github.com/SlimeVR/SlimeVR-Tracker-ESP/pull/480
if (connection.protocolVersion >= 22) {
tracker.setAcceleration(packet.acceleration)
} else {
tracker.setAcceleration(SENSOR_OFFSET_CORRECTION.sandwich(packet.acceleration))
}
}
tracker.dataTick()
}
@@ -451,9 +455,13 @@ class TrackersUDPServer(private val port: Int, name: String, private val tracker
is UDPPacket4Acceleration -> {
tracker = connection?.getTracker(packet.sensorId)
if (tracker == null) return
// If sensorOffset was applied to accel correctly, the axes will already
// be correct for SlimeVR
tracker.setAcceleration(SENSOR_OFFSET_CORRECTION.sandwich(packet.acceleration))
// sensorOffset is applied correctly since protocol 22
// See: https://github.com/SlimeVR/SlimeVR-Tracker-ESP/pull/480
if (connection.protocolVersion >= 22) {
tracker.setAcceleration(packet.acceleration)
} else {
tracker.setAcceleration(SENSOR_OFFSET_CORRECTION.sandwich(packet.acceleration))
}
}
is UDPPacket10PingPong -> {