Enable D500 motion streaming on macOS - #15549
Conversation
sysrsbuild-gh-agentic
left a comment
There was a problem hiding this comment.
🤖 Auto-generated review by rs-agentic bot
Two potential bugs flagged below.
b528300 to
4cc0dd6
Compare
D455 motion validation on Intel macOSRelated to #15594. I tested commit
Baseline with PR #15549 only
PR #15549 replaces the macOS HIDAPI implementation with the generic RSUSB D455 extensionThe following patch enables the existing D400 HID motion path and restores diff --git a/src/ds/d400/d400-factory.cpp b/src/ds/d400/d400-factory.cpp
--- a/src/ds/d400/d400-factory.cpp
+++ b/src/ds/d400/d400-factory.cpp
@@ -1071,9 +1071,7 @@ namespace librealsense
, ds_thermal_tracking( d400_device::_thermal_monitor )
{
ds_advanced_mode_base::initialize_advanced_mode( this );
-#if !defined(__APPLE__) // Motion sensors not supported on macOS
register_gyro_sensitivity();
-#endif
}
diff --git a/src/ds/d400/d400-motion.cpp b/src/ds/d400/d400-motion.cpp
--- a/src/ds/d400/d400-motion.cpp
+++ b/src/ds/d400/d400-motion.cpp
@@ -171,7 +171,6 @@ namespace librealsense
initialize_fisheye_sensor( dev_info->get_context(), dev_info->get_group() );
-#if !defined(__APPLE__) // Motion sensors not supported on macOS
// Try to add HID endpoint
auto hid_ep = create_hid_device( dev_info->get_context(), dev_info->get_group().hid_devices );
if (hid_ep)
@@ -184,7 +183,6 @@ namespace librealsense
//for FW >=5.16 the scale factor changes to 1000.0 since FW sends 32bit
if (_fw_version >= firmware_version( 5, 16, 0, 0))
get_raw_motion_sensor()->set_gyro_scale_factor( 10000.0 );
-#endif
}
catch (const std::exception& e)
{
@@ -203,21 +201,13 @@ namespace librealsense
ds_motion_sensor & d400_motion::get_motion_sensor()
{
-#if defined(__APPLE__)
- throw std::runtime_error("Motion sensors are not supported on macOS");
-#else
return dynamic_cast< ds_motion_sensor & >( get_sensor( _motion_module_device_idx.value() ) );
-#endif
}
std::shared_ptr<hid_sensor> d400_motion::get_raw_motion_sensor()
{
-#if defined(__APPLE__)
- return nullptr;
-#else
auto raw_sensor = get_motion_sensor().get_raw_sensor();
return std::dynamic_pointer_cast< hid_sensor >( raw_sensor );
-#endif
}Validation after the patch
ScopeOnly the D455 has been validated. The endpoint implementation is shared by several HID-based D400 products, so
Would you be willing to include this tested D455 extension in PR #15549? |
Summary
Scope
This branch is based on
developmentafter #15550. The diff is limited to D500 motion discovery and streaming on macOS.Validation
Tested on Apple Silicon with a D555 connected directly over USB-C at 5 Gbps.
The final branch was tested with Homebrew libusb 1.0.30 in two consecutive Viewer sessions without reconnecting the camera. Depth, color, accelerometer, and gyroscope ran together in both sessions. The following checks passed:
The latest session received 532 depth, 553 color, 1,828 accelerometer, and 3,659 gyroscope callbacks.
This PR remains a draft while the new CI run completes.