-
-
Notifications
You must be signed in to change notification settings - Fork 609
feat: Pico Motion Trackers object tracking support #2712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
zmerp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this code able to track individual trackers or only for let tracking when wore? If the latter, what is the advantage over XR_BD_body_tracking?
First. Pico Motion Trackers have two modes: body tracking and object tracking. While body tracking uses some prediction model and gives body joints positions, object tracking allows to get position of each tracker. At first I wanted to add mode switch in ALVR settings but then I found being able to switch tracker mode on the fly is pretty great. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from a couple of nits I forgot to mention before, the PR looks good architecture and style-wise. I'm worried a bit about @0JXI0 's performance issues
| transform_draw(&mut pass, view_proj * transform, 4); | ||
| } | ||
|
|
||
| fn draw_crosshair( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be "crossair" without "h". Actually it should be cross-air, but when there is a hyphenated word i usually remove the space in between when using snake_case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's a 'cross-air'? Crosshair would actually make sense, tho perhaps not the best word?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh damn, you're right. it's actually a single word, not cross-hair lol. @curoviyxru let's revert this back to crosshair
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The etymology is actually correct for "hair", where hair, spiderwebs or wires were used for the scopes
|
It should be better with latest commit I think. @0JXI0, could you test it again, please? |
|
@curoviyxru Sorry for not responding sooner. I've built this with the latest commits you've added and the performance is better but it's still around 10-15ms (30ms before) on the game render when it should be around 4-6ms. |
|
Oh forgot to mention, the performance is fine when the object tracker mode in ALVR is disabled |
|
It was slow |
Also fixes full body tracking if body_tracking_fb is disabled.
|
@curoviyxru Your solution doesn't work. The pico trackers shouldn't be handled on the c++ code. in alvr_server_openvr, in tracking.rs, add a funnction to map client trackers with SteamVR vive trackers. Currently we just pass them straight to the c++ code, and we are using the same paths for client and SteamVR, but we should now add the mapping step. So using the mapping system, we don't always enable all SteamVR trackers. We should enable a SteamVR tracker only if it is mapped to a client tracker path, because I don't think it would be useful to create an unmapped tracker. Furthermore, we should allow a SteamVR tracker to be mapped to multiple client tracker paths, so it will work for Pico, Meta and HTC. The mapping setting should have type |
zmerp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You haven't implemented the tracker remapping system but the solution to default to hips and feet is fine to me
alvr/session/src/settings.rs
Outdated
| enabled: true, | ||
| content: BodyTrackingBDConfigDefault { | ||
| body_tracking: true, | ||
| object_tracking: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object tracking should default to true, like body_tracking. You said that you select which to enable in the system settings, and they are mutually exclusive. I might be still misunderstanding things, but doesn't either body tracking or object tracking fail to initialize or to poll tracking data because it is disabled in the system settings? so if we attempt to use both we have the certainty that at least one works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_motion_tracker_locations works anyway ignoring current mode setting in Motion Tracker app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh hm. But what do you mean with "works"? Can you poll the data but it would be null if the user sets body tracking mode, or polling always returns valid data regardless of the user setting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It always returns valid data regardless of the user setting, yeah.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, let's go back to your idea of having mutually exclusive body and object tracking, using an enum. Sorry for the confusion.
| { | ||
| let mut joints = Vec::<(u64, DeviceMotion)>::with_capacity(3); | ||
|
|
||
| let joints_ids = [*BODY_LEFT_FOOT_ID, *BODY_RIGHT_FOOT_ID, *BODY_HIPS_ID]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order I wold use as default is first hips, then left and right feet. This is because of games like VRchat, where the minimum tracker configuration is only hips, then you can add feet.
|
Yeah, it is not an implementation of remapping system. I don't have a full understanding how this system should work and how it should be implemented so I've just pushed things that are unrelated to it. |
|
Sorry for going back and forth on this, but let's leave out the tracker mapping system for now. I think the solution of exposing hips then left and right feet is alright. Don't throw away your code, you can make a separate PR with the tracker mapping system after we merge this PR. |
29c114d to
be52c8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me. Only one last thing: add a help string for the body_tracking_bd setting saying that it's recommended to set trackers mode as body tracking in the system settings (use precise name), since that will allow both body and object tracking in ALVR, depending on the choice on the dashboard.
zmerp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time to merge, finally :)
* feat: Pico object motion tracking * style: uses formatting * refactor: Make draw_crosshair function * feat: Add velocity for object tracking * style: Match Bytedance official naming * refactor: Store Session instead of Instance * refactor: Implement MotionTrackerBD * refactor: Split body skeleton data back * chore: Allow clippy's `too_many_arguments` * chore: Expect clippy's `too_many_arguments` * refactor: Body and object tracking mode switch * fix: Reset MotionTrackingBD to None * refactor: Flatten BodyTrackingBDConfig * refactor: Make trackers order predictable * refactor: Add separate trackers for objects Also fixes full body tracking if body_tracking_fb is disabled. * refactor: Revert Add separate trackers for objects * refactor: Capacity change, fullbody fix, crosshair * refactor: Correct addressed issues * refactor: Bring back BodyTrackingBDConfig enum * chore: Add help strings for body tracking options * Add help string about tracking mode selection
* feat: Pico object motion tracking * style: uses formatting * refactor: Make draw_crosshair function * feat: Add velocity for object tracking * style: Match Bytedance official naming * refactor: Store Session instead of Instance * refactor: Implement MotionTrackerBD * refactor: Split body skeleton data back * chore: Allow clippy's `too_many_arguments` * chore: Expect clippy's `too_many_arguments` * refactor: Body and object tracking mode switch * fix: Reset MotionTrackingBD to None * refactor: Flatten BodyTrackingBDConfig * refactor: Make trackers order predictable * refactor: Add separate trackers for objects Also fixes full body tracking if body_tracking_fb is disabled. * refactor: Revert Add separate trackers for objects * refactor: Capacity change, fullbody fix, crosshair * refactor: Correct addressed issues * refactor: Bring back BodyTrackingBDConfig enum * chore: Add help strings for body tracking options * Add help string about tracking mode selection
|
Hi, i want to know how to use the object tracking mode. |

Works fine
but I'm not sure about binding trackers to body joints.