-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Feature Request: Device Connection Status and Device ID Support
Background
Currently, the XRoboToolkit Python bindings provide excellent access to pose data, controller inputs, hand tracking, and body tracking. However, there's no way to programmatically check device connection status or retrieve device identification information, which is crucial for robust applications.
Requested Features
- Device Connection Status
# Proposed API
import xrobotoolkit_sdk as xrt
xrt.init()
# Check overall connection status
is_connected = xrt.is_device_connected()
print(f"Device connected: {is_connected}")
# Check specific data valid
headset_data_valid = xrt.is_headset_data_available()
controller_data_valid = xrt.is_controller_data_available()- Device Information
device_id = xrt.get_device_id()- Connection Events (Optional)
# Callback for connection state changes
def on_device_connected(device_type, device_id):
print(f"Device {device_type} ({device_id}) connected")
def on_device_disconnected(device_type, device_id):
print(f"Device {device_type} ({device_id}) disconnected")
xrt.set_connection_callback(on_device_connected, on_device_disconnected)Use Cases
- Robust Application Development : Applications can gracefully handle device disconnections and reconnections
- Debugging and Monitoring : Easier troubleshooting of connection issues
- Battery Monitoring : Alert users when device batteries are low
Implementation Suggestions
Based on the current codebase structure, these functions could be added to the existing pybind11 interface by:
- Extending the current m.def() calls in the binding code
- Adding corresponding C++ functions that interface with the PXREARobot SDK
- Utilizing existing SDK functions like PXREAGetDeviceState() if available
Benefits
- Improved Reliability : Applications can detect and handle connection issues
- Better User Experience : Clear feedback about device status
- Enhanced Debugging : Easier identification of hardware-related issues
- Professional Applications : Essential for production robotics and telepresence systems
Metadata
Metadata
Assignees
Labels
No labels