Skip to content

Expose is_tracked for OpenXR tracking loss - #909

Open
sgrizan-nv wants to merge 3 commits into
mainfrom
sgrizan/branch1
Open

Expose is_tracked for OpenXR tracking loss#909
sgrizan-nv wants to merge 3 commits into
mainfrom
sgrizan/branch1

Conversation

@sgrizan-nv

@sgrizan-nv sgrizan-nv commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Require VALID and TRACKED bits for head is_valid so CloudXR client disconnect no longer leaves a placeholder pose marked valid.

Summary by CodeRabbit

  • New Features

    • Added separate head-pose validity and active-tracking status indicators.
    • Valid pose data remains available during temporary tracking loss, while tracking status accurately reflects inactivity.
    • Exposed tracking status through head-pose inputs, outputs, transformations, and Python interfaces.
  • Bug Fixes

    • Improved handling of invalid head poses by providing a default pose when pose data is unavailable.
  • Documentation

    • Clarified the difference between valid pose data and active tracking.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

LiveHeadTrackerImpl::update now separates pose validity from active tracking. It preserves valid pose data when tracking is inactive and uses a default pose when the pose is invalid. The schema, Python bindings, source node, tensor types, and transforms propagate is_tracked. Tests cover serialization, untracked samples, and tracking-state preservation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant OpenXR
  participant LiveHeadTrackerImpl
  participant HeadSource
  participant HeadTransform
  OpenXR->>LiveHeadTrackerImpl: provide pose validity and tracking flags
  LiveHeadTrackerImpl->>HeadSource: provide pose, is_valid, and is_tracked
  HeadSource->>HeadTransform: provide head input fields
  HeadTransform->>HeadSource: preserve validity and tracking state
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes exposing is_tracked to represent OpenXR tracking loss.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sgrizan/branch1

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/retargeting_engine_tests/python/test_sources.py`:
- Around line 270-275: Update the HeadSource documentation in output_spec and
_compute_fn to define missing output solely as tracked.data being None, and
explicitly require consumers to inspect HeadInputIndex.IS_VALID before using the
pose. Ensure the documented contract supports non-null placeholder or stale pose
data when is_valid is False.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 565c20fc-90dc-4bef-84af-233574ec41e0

📥 Commits

Reviewing files that changed from the base of the PR and between 805b95f and 9bab5fd.

📒 Files selected for processing (3)
  • src/core/live_trackers/cpp/live_head_tracker_impl.cpp
  • src/core/retargeting_engine_tests/python/test_sources.py
  • src/core/schema/fbs/head.fbs

Comment thread src/core/retargeting_engine_tests/python/test_sources.py Outdated
Map VALID/TRACKED bits separately so is_valid stays readable-pose
semantics while is_tracked clears on CloudXR disconnect / tracking loss.

Signed-off-by: Sergey Grizan <sgrizan@nvidia.com>
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/schema_tests/cpp/test_head.cpp`:
- Line 183: Update the test setup before core::HeadPoseRecord::Pack to
initialize the source record’s data is_tracked field to true, so the existing
deserialized->data()->is_tracked() == true assertion in the test remains valid.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 15300e9d-dbd9-4e6c-931b-e9ed69b5f442

📥 Commits

Reviewing files that changed from the base of the PR and between 805b95f and f49cb46.

📒 Files selected for processing (11)
  • examples/teleop_ros2/python/tests/test_messages.py
  • src/core/live_trackers/cpp/live_head_tracker_impl.cpp
  • src/core/retargeting_engine_tests/python/test_sources.py
  • src/core/retargeting_engine_tests/python/test_transforms.py
  • src/core/schema/fbs/head.fbs
  • src/core/schema/python/head_bindings.h
  • src/core/schema_tests/cpp/test_head.cpp
  • src/core/schema_tests/python/test_head.py
  • src/python/isaacteleop/retargeting_engine/deviceio_source_nodes/head_source.py
  • src/python/isaacteleop/retargeting_engine/tensor_types/standard_types.py
  • src/python/isaacteleop/retargeting_engine/utilities/head_transform.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/core/live_trackers/cpp/live_head_tracker_impl.cpp

Comment thread src/core/schema_tests/cpp/test_head.cpp
// separate so is_valid stays OpenXR-faithful (CloudXR may leave VALID set after disconnect).
const bool position_valid = (location.locationFlags & XR_SPACE_LOCATION_POSITION_VALID_BIT) != 0;
const bool orientation_valid = (location.locationFlags & XR_SPACE_LOCATION_ORIENTATION_VALID_BIT) != 0;
const bool position_tracked = (location.locationFlags & XR_SPACE_LOCATION_POSITION_TRACKED_BIT) != 0;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

see #866: I don't think we are setting XR_SPACE_LOCATION_POSITION_TRACKED_BIT correctly...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Doesn't the bug mention that the head poses are unaffected and forward the client's flags faithfully?

Signed-off-by: Sergey Grizan <sgrizan@nvidia.com>
Signed-off-by: Sergey Grizan <sgrizan@nvidia.com>
@sgrizan-nv sgrizan-nv changed the title fix(head): set is_valid false when OpenXR tracking is lost Expose is_tracked for OpenXR tracking loss Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: TBD

Development

Successfully merging this pull request may close these issues.

2 participants