Skip to content

Add body tracking based on XR_BD_body_tracking#925

Merged
bjornbytes merged 9 commits intobjornbytes:devfrom
gareth-morgan-nv:gmorgan/BodyTracking
Jan 30, 2026
Merged

Add body tracking based on XR_BD_body_tracking#925
bjornbytes merged 9 commits intobjornbytes:devfrom
gareth-morgan-nv:gmorgan/BodyTracking

Conversation

@gareth-morgan-nv
Copy link
Contributor

Adds body tracking to the LOVR LUA interface. It follows the handTracking pattern and adds a body device that can be passed to getSkeleton:

    local skeleton = lovr.headset.getSkeleton('body')
    if skeleton then
      local pelvis = skeleton[1]   -- pelvis
      local head = skeleton[16]    -- head

Internally uses the XR_BD_body_tracking extension, and exposes the skeleton via its joint conventions, but could use any of the other OXR body tracking extensions:
image

An example LUA script using it is here:
https://gist.github.com/gareth-morgan-nv/5218bdb91b47ac956edea82b54fe063a

@bjornbytes bjornbytes linked an issue Jan 28, 2026 that may be closed by this pull request
@bjornbytes
Copy link
Owner

bjornbytes commented Jan 28, 2026

Thanks for the PR, this is exciting!

  • I'm curious about the reason you chose XR_BD_body_tracking over the other body tracking extensions.
  • Have you tried this out on a specific device/runtime combination? I don't think I have access to any hardware that supports this extension atm, so it would be useful to know where it's been confirmed to work.
  • I will leave some more feedback on the code, but upfront I will say that there are way, way too many comments, relative to the typical style used in the rest of the codebase. (Some comments are fine! But we try to reserve them for the most important things to call out, or to break up very long functions/files into sections).
  • Minor note: I do think it's pretty awkward to have "devices" for body parts, e.g. elbow/left, chest, and now even body. I think in the future lovr.headset.getSkeleton will be changed to take a SkeletonType (either hand/left, hand/right, or body), and then all the body-related devices could be removed and folded into getSkeleton. But this is orthogonal to this immediate PR, and can happen in the future. There's some more discussion in Body Tracking #840.

@gareth-morgan-nv
Copy link
Contributor Author

* I'm curious about the reason you chose `XR_BD_body_tracking` over the other body tracking extensions.

It's the hardware I had, also its a simpler extension that the other ones (no confidence, base pose, etc.)

* Have you tried this out on a specific device/runtime combination?  I don't think I have access to any hardware that supports this extension atm, so it would be useful to know where it's been confirmed to work.

We have confirmed this works with an experimental version of CloudXR

* I will leave some more feedback on the code, but upfront I will say that there are way, way too many comments, relative to the typical style used in the rest of the codebase.  (Some comments are fine!  But we try to reserve them for the most important things to call out, or to break up very long functions/files into sections).

I've done a pass removing them to match the rest of the code, does that look OK?

* Minor note: I do think it's pretty awkward to have "devices" for body parts, e.g. `elbow/left`, `chest`, and now even `body`.  I think in the future `lovr.headset.getSkeleton` will be changed to take a `SkeletonType` (either `hand/left`, `hand/right`, or `body`), and then all the body-related devices could be removed and folded into getSkeleton.  But this is orthogonal to this immediate PR, and can happen in the future.  There's some more discussion in [Body Tracking #840](https://github.com/bjornbytes/lovr/issues/840).

That makes sense.

@bjornbytes
Copy link
Owner

Thanks, merging!

@bjornbytes bjornbytes merged commit 5d1bdfc into bjornbytes:dev Jan 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Body Tracking

2 participants