@@ -42,10 +42,8 @@ bool is_openxr_extension_supported(const char* ext_name)
4242 {
4343 return false ;
4444 }
45- return std::any_of (props.begin (), props.end (), [ext_name](const XrExtensionProperties& p)
46- {
47- return std::string (p.extensionName ) == ext_name;
48- });
45+ return std::any_of (props.begin (), props.end (),
46+ [ext_name](const XrExtensionProperties& p) { return std::string (p.extensionName ) == ext_name; });
4947}
5048
5149} // anonymous namespace
@@ -169,8 +167,7 @@ void ManusTracker::initialize(const std::string& app_name) noexcept(false)
169167 else
170168 {
171169 std::cout << " [Manus] " << XR_EXT_HAND_TRACKING_EXTENSION_NAME
172- << " is not supported by the current runtime; HandTracker will not be created."
173- << std::endl;
170+ << " is not supported by the current runtime; HandTracker will not be created." << std::endl;
174171 }
175172
176173 // Get required extensions from trackers
@@ -189,8 +186,7 @@ void ManusTracker::initialize(const std::string& app_name) noexcept(false)
189186 {
190187 std::cout << " [Manus] " << XR_MNDX_XDEV_SPACE_EXTENSION_NAME
191188 << " is not supported by the current runtime; optical hand tracking"
192- << " will not be available and controller fallback will be used."
193- << std::endl;
189+ << " will not be available and controller fallback will be used." << std::endl;
194190 }
195191
196192 // Create session with required extensions - constructor automatically begins the session
@@ -201,8 +197,10 @@ void ManusTracker::initialize(const std::string& app_name) noexcept(false)
201197 m_time_converter.emplace (m_handles);
202198
203199 // Initialize hand injectors (one per hand)
204- m_left_injector = std::make_unique<plugin_utils::HandInjector>(m_handles.instance , m_handles.session , XR_HAND_LEFT_EXT, m_handles.space );
205- m_right_injector = std::make_unique<plugin_utils::HandInjector>(m_handles.instance , m_handles.session , XR_HAND_RIGHT_EXT, m_handles.space );
200+ m_left_injector = std::make_unique<plugin_utils::HandInjector>(
201+ m_handles.instance , m_handles.session , XR_HAND_LEFT_EXT, m_handles.space );
202+ m_right_injector = std::make_unique<plugin_utils::HandInjector>(
203+ m_handles.instance , m_handles.session , XR_HAND_RIGHT_EXT, m_handles.space );
206204
207205 m_deviceio_session = core::DeviceIOSession::run (trackers, m_handles);
208206
@@ -214,8 +212,7 @@ void ManusTracker::initialize(const std::string& app_name) noexcept(false)
214212 initialize_xdev_hand_trackers ();
215213 }
216214
217- std::cout << " [Manus] Initialized with wrist source: "
218- << (m_xdev_available ? " HandTracking" : " Controllers" )
215+ std::cout << " [Manus] Initialized with wrist source: " << (m_xdev_available ? " HandTracking" : " Controllers" )
219216 << std::endl;
220217
221218 success = true ;
@@ -409,32 +406,34 @@ void ManusTracker::OnLandscapeStream(const Landscape* landscape)
409406 {
410407 const GloveLandscapeData& glove = gloves.gloves [i];
411408 if (glove.side == Side::Side_Left)
409+ {
410+ tracker.left_glove_id = glove.id ;
411+ left_present = true ;
412+ // Fetch bone topology once on connect
413+ uint32_t nc = 0 ;
414+ if (CoreSdk_GetRawSkeletonNodeCount (glove.id , nc) == SDKReturnCode::SDKReturnCode_Success && nc > 0 )
412415 {
413- tracker.left_glove_id = glove.id ;
414- left_present = true ;
415- // Fetch bone topology once on connect
416- uint32_t nc = 0 ;
417- if (CoreSdk_GetRawSkeletonNodeCount (glove.id , nc) == SDKReturnCode::SDKReturnCode_Success && nc > 0 )
418- {
419- std::lock_guard<std::mutex> sk (tracker.m_skeleton_mutex );
420- tracker.m_left_node_info .resize (nc);
421- if (CoreSdk_GetRawSkeletonNodeInfoArray (glove.id , tracker.m_left_node_info .data (), nc) != SDKReturnCode::SDKReturnCode_Success)
422- tracker.m_left_node_info .clear ();
423- }
416+ std::lock_guard<std::mutex> sk (tracker.m_skeleton_mutex );
417+ tracker.m_left_node_info .resize (nc);
418+ if (CoreSdk_GetRawSkeletonNodeInfoArray (glove.id , tracker.m_left_node_info .data (), nc) !=
419+ SDKReturnCode::SDKReturnCode_Success)
420+ tracker.m_left_node_info .clear ();
424421 }
425- else if (glove.side == Side::Side_Right)
422+ }
423+ else if (glove.side == Side::Side_Right)
424+ {
425+ tracker.right_glove_id = glove.id ;
426+ right_present = true ;
427+ uint32_t nc = 0 ;
428+ if (CoreSdk_GetRawSkeletonNodeCount (glove.id , nc) == SDKReturnCode::SDKReturnCode_Success && nc > 0 )
426429 {
427- tracker.right_glove_id = glove.id ;
428- right_present = true ;
429- uint32_t nc = 0 ;
430- if (CoreSdk_GetRawSkeletonNodeCount (glove.id , nc) == SDKReturnCode::SDKReturnCode_Success && nc > 0 )
431- {
432- std::lock_guard<std::mutex> sk (tracker.m_skeleton_mutex );
433- tracker.m_right_node_info .resize (nc);
434- if (CoreSdk_GetRawSkeletonNodeInfoArray (glove.id , tracker.m_right_node_info .data (), nc) != SDKReturnCode::SDKReturnCode_Success)
435- tracker.m_right_node_info .clear ();
436- }
430+ std::lock_guard<std::mutex> sk (tracker.m_skeleton_mutex );
431+ tracker.m_right_node_info .resize (nc);
432+ if (CoreSdk_GetRawSkeletonNodeInfoArray (glove.id , tracker.m_right_node_info .data (), nc) !=
433+ SDKReturnCode::SDKReturnCode_Success)
434+ tracker.m_right_node_info .clear ();
437435 }
436+ }
438437 }
439438
440439 // Clear stale state for any glove that is no longer present in this landscape
@@ -463,7 +462,8 @@ void ManusTracker::OnLandscapeStream(const Landscape* landscape)
463462void ManusTracker::initialize_xdev_hand_trackers ()
464463{
465464 // Load XDev extension function pointers
466- auto load_func = [this ](const char * name, PFN_xrVoidFunction* ptr) -> bool {
465+ auto load_func = [this ](const char * name, PFN_xrVoidFunction* ptr) -> bool
466+ {
467467 XrResult result = m_handles.xrGetInstanceProcAddr (m_handles.instance , name, ptr);
468468 return XR_SUCCEEDED (result) && *ptr != nullptr ;
469469 };
@@ -553,20 +553,21 @@ void ManusTracker::initialize_xdev_hand_trackers()
553553 std::string serials_list;
554554 for (const auto & s : seen_serials)
555555 {
556- if (!serials_list.empty ()) serials_list += " , " ;
556+ if (!serials_list.empty ())
557+ serials_list += " , " ;
557558 serials_list += ' "' ;
558559 serials_list += s;
559560 serials_list += ' "' ;
560561 }
561562 std::cerr << " [Manus] Could not match optical hand-tracking XDevs by serial. "
562- << " Expected \" Head Device (0)\" (left) and \" Head Device (1)\" (right), "
563- << " but found: [" << serials_list << " ]. "
564- << " These serial strings are runtime-specific and may have changed."
563+ << " Expected \" Head Device (0)\" (left) and \" Head Device (1)\" (right), " << " but found: ["
564+ << serials_list << " ]. " << " These serial strings are runtime-specific and may have changed."
565565 << std::endl;
566566 }
567567
568568 // Create hand trackers from XDevs
569- auto create_tracker = [this ](XrXDevIdMNDX xdev_id, XrHandEXT hand, XrHandTrackerEXT& out_tracker) -> bool {
569+ auto create_tracker = [this ](XrXDevIdMNDX xdev_id, XrHandEXT hand, XrHandTrackerEXT& out_tracker) -> bool
570+ {
570571 if (xdev_id == 0 )
571572 {
572573 return false ;
@@ -662,8 +663,8 @@ bool ManusTracker::update_xdev_hand(XrHandTrackerEXT tracker, XrTime time, XrPos
662663
663664bool ManusTracker::get_controller_wrist_pose (bool is_left, XrPosef& out_wrist_pose)
664665{
665- const auto & tracked = is_left ? m_controller_tracker->get_left_controller (*m_deviceio_session)
666- : m_controller_tracker->get_right_controller (*m_deviceio_session);
666+ const auto & tracked = is_left ? m_controller_tracker->get_left_controller (*m_deviceio_session) :
667+ m_controller_tracker->get_right_controller (*m_deviceio_session);
667668
668669 if (!tracked.data )
669670 {
0 commit comments