Added optional Velocity fields to Protobuf Position Message (Natural Locomotion Support) #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Natural Locomotion (NaLo) has been able to enumerate and identify SlimeVR trackers via SteamVR for quite some time.
The primary reason SlimeVR trackers were not usable by NaLo was that the OpenVR driver explicitly reported zero velocity and acceleration for all trackers.
Newly added code derives velocity and acceleration from per-frame positional deltas and reports these values to SteamVR using the expected OpenVR kinematic fields.Switched to server-side calculation, the new driver-side code adds a new definition to ProtobufMessages (Velocity Vector3: vx, vy, vz), and sends this data to SteamVR Virtual Trackers in the same package with Position and Rotation. This adds new functionality while keeping the code architecture and code-style the same. Velocity is optional, and if not received will always report 0 to SteamVR Trackers, basically, falling back to the current behaviour.
This change does not affect positional tracking, as the derived kinematic data is only consumed by SteamVR addons and is not used for pose estimation.This does affect SteamVR's pose prediction. Cannot be fixed by design. Proposed solution: Make feature toggleable and customizable to allow users decide how they want to use this feature.
Doing so allows NaLo to receive the data that was missing, while the only dependency is the position data we receive from the tracker. Because the implementation relies solely on positional data already provided by the tracker, the change is cross-hardware compatible and does not depend on IMU-specific acceleration data.
The additional computation is trivial for modern CPUs and is not expected to introduce measurable performance or latency impact. Observed per-frame processing time is on the order of a few milliseconds.
The implementation includes velocity clamping to suppress unrealistic spikes (e.g., sustained speeds above 6 m/s), as well as a delta-time guard to handle stale or invalid frame intervals and avoid division-by-zero or incorrect updates.Removed due to server-side data being more stable and filtered.
Directional movement (e.g., strafing with the head facing forward) is handled correctly by SteamVR based on the reported kinematic data, requiring no additional logic in the OpenVR driver.
Related to the issue:
SlimeVR/SlimeVR-Server#25