Skip to content

Add Velocity calculation logic and GUI toggle (end-to-end MVP).#1753

Open
M1DNYT3 wants to merge 11 commits intoSlimeVR:mainfrom
M1DNYT3:velocity-mvp
Open

Add Velocity calculation logic and GUI toggle (end-to-end MVP).#1753
M1DNYT3 wants to merge 11 commits intoSlimeVR:mainfrom
M1DNYT3:velocity-mvp

Conversation

@M1DNYT3
Copy link
Copy Markdown

@M1DNYT3 M1DNYT3 commented Feb 17, 2026

This PR completes velocity transmission end-to-end, adding RPC settings and a GUI toggle on top of the foundation from #1754.

What's added:

  • Protobuf velocity transmission via ProtobufBridge, per-tracker
  • RPC settings support - toggle persists across restarts
  • GUI toggle in General Settings with i18n

Toggle's GUI Path:
Settings > General > Tracker Settings > Toggle is at the very bottom of the section.

Technicalities:
Most of the line count (~400) comes from regenerated ProtobufMessages.java. The handwritten change itself is small.

Depends on SlimeVR/SolarXR-Protocol#202, should be merged only after the submodule is updated to the tracked HEAD.

Addresses the issue: #25

@github-actions github-actions Bot added Area: Skeletal Model Deals with the model of the skeleton and its pose Area: Server Related to the server labels Feb 17, 2026
@M1DNYT3 M1DNYT3 force-pushed the velocity-mvp branch 3 times, most recently from b502b9c to b83d03d Compare February 17, 2026 12:26
@M1DNYT3
Copy link
Copy Markdown
Author

M1DNYT3 commented Feb 17, 2026

Force pushes in history are changes made by spotless.
For some reason, one application wasn't enough for it to fix all the issues in Tracker.kt, so I had to push it twice, and I didn't want to make 2 separate commits for spotless alone.

@M1DNYT3 M1DNYT3 changed the title MVP. Add Velocity transmission toggle and calculation logic. MVP. Add Velocity calculation toggle and logic. Feb 17, 2026
@M1DNYT3 M1DNYT3 changed the title MVP. Add Velocity calculation toggle and logic. Velocity MVP. Add Velocity calculation toggle and logic. Feb 17, 2026
@github-actions github-actions Bot added Area: Application Protocol Related to communication with apps like the GUI, overlay, games Area: GUI Related to the GUI Area: Translation Improvements or additions to translations Area: SteamVR Driver Related to the SteamVR Driver labels Mar 20, 2026
@M1DNYT3
Copy link
Copy Markdown
Author

M1DNYT3 commented Mar 20, 2026

At some point, I had a conversation with @ButterscotchV in DMs, and there was a recommendation expressed to ship the whole feature (Implying a toggle, nothing overkill) in one PR.

The description is edited accordingly to reflect each affected part of the code.
The handwritten part (meaning not regenerated flatbuf, and not regenerated ProtobufMessages) follows the existing code architecture 1:1 and reuses the methods, styles, and classes, where necessary.

@M1DNYT3 M1DNYT3 changed the title Velocity MVP. Add Velocity calculation toggle and logic. Add Velocity calculation logic and GUI toggle (end-to-end MVP). Mar 20, 2026
M1DNYT3 added 6 commits April 22, 2026 18:36
… latest definition from the Driver's main branch.
…ce, Replace allowVelocity with hasVelocity in ProtobufBridge.
…#1811

# Conflicts:
#	server/core/src/main/java/dev/slimevr/protocol/rpc/settings/RPCSettingsBuilder.kt
� Conflicts:
�	server/core/src/main/java/dev/slimevr/protocol/rpc/settings/RPCSettingsBuilder.kt
@M1DNYT3
Copy link
Copy Markdown
Author

M1DNYT3 commented Apr 22, 2026

I had some additional feedback from @ButterscotchV in DMs, addressed it all + rebased to the latest main + also did some changes of my own.

Feedback changes:

  • drop applyVelocityPolicyTo() in VRServer.kt; initially made for expandability, but turned out to be redundant because VRConfig.applyVelocityPolicy() already covers expandability.
  • replace System.nanoTime() with Kotlin's TimeSource; self-explaining, did precisely that.

My own improvement:
Noticed that I forgot to wire hasVelocity instead of allowVelocity in the ProtobufBridge.kt; the former was created for a safeguard to not send anything if we don't have any velocity in the tracker. Technically, both calls would result in the same behavior, but hasVelocity follows architecture better and explicitly states that there has to be something for it to be sent, whereas allowVelocity simply states whether the toggle is on or off.

Comment thread server/desktop/src/main/java/dev/slimevr/desktop/platform/ProtobufBridge.kt Outdated
Comment thread server/core/src/main/java/dev/slimevr/config/VRConfig.kt Outdated
Comment thread server/core/src/main/java/dev/slimevr/tracking/trackers/Tracker.kt Outdated
Comment thread server/core/src/main/java/dev/slimevr/tracking/trackers/Tracker.kt Outdated
Comment thread server/core/src/main/java/dev/slimevr/tracking/trackers/Tracker.kt Outdated
…timing fix, non-nullable writeTrackerUpdate param
@M1DNYT3
Copy link
Copy Markdown
Author

M1DNYT3 commented Apr 24, 2026

Review changes were shipped and tested E2E with SteamVR.

One thing to note. Jitter is still noticeable. I may think of a one-euro filter or some velocity smoothing added, but I suggest that to be a separate PR once this one is shipped.

@M1DNYT3 M1DNYT3 requested a review from ButterscotchV April 24, 2026 11:26
Comment thread server/core/src/main/java/dev/slimevr/tracking/trackers/Tracker.kt Outdated
Comment thread server/core/src/main/java/dev/slimevr/tracking/trackers/Tracker.kt Outdated
Copy link
Copy Markdown
Member

@ButterscotchV ButterscotchV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, SolarXR needs to be merged/fixed before this PR.

@ButterscotchV ButterscotchV added the Status: Blocked by other issue Progress cannot be made until linked issue is resolved label Apr 24, 2026
@ButterscotchV ButterscotchV removed the Status: Blocked by other issue Progress cannot be made until linked issue is resolved label Apr 27, 2026
// Disables derived velocity for all trackers. Driver zeroes out velocity if nothing is returned in protobuf message.
var sendDerivedVelocity: Boolean = false

fun updateTrackersVelocityPolicy() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"policy" is a wording not used in the rest of the codebase and was confusing for me on the first read. This should probably be named updateTrackersVelocitySettings, like in ResetsConfig.

Comment on lines +369 to +376
/**
* Updates the derived velocity of the tracker by differentiating position over time.
*
* This method enforces the [allowVelocity] policy and checks for valid position data before
* proceeding. If conditions are met, it calculates velocity based on the displacement since the
* last update, applying a sanity check on the time delta to filter out noise and ensure data stability.
*
*/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be shortened

Suggested change
/**
* Updates the derived velocity of the tracker by differentiating position over time.
*
* This method enforces the [allowVelocity] policy and checks for valid position data before
* proceeding. If conditions are met, it calculates velocity based on the displacement since the
* last update, applying a sanity check on the time delta to filter out noise and ensure data stability.
*
*/
/**
* If derived velocity is enabled, updates the derived velocity of the tracker, calculating it based on the position displacement
* since the last update, applying a sanity check on the time delta to filter out noise and ensure data stability.
*
*/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Application Protocol Related to communication with apps like the GUI, overlay, games Area: GUI Related to the GUI Area: Server Related to the server Area: Skeletal Model Deals with the model of the skeleton and its pose Area: SteamVR Driver Related to the SteamVR Driver Area: Translation Improvements or additions to translations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants