diff --git a/src/platform/hid-data.h b/src/platform/hid-data.h index caa7e523b2..6c438fb5ef 100644 --- a/src/platform/hid-data.h +++ b/src/platform/hid-data.h @@ -18,6 +18,19 @@ struct hid_data struct hid_mipi_data +{ + uint8_t typeID; + uint8_t skip1; + uint64_t hwTs; + int16_t x; + int16_t y; + int16_t z; + uint64_t hwTs2; + uint64_t skip2; +}; + + +struct hid_mipi_data_32 { uint8_t typeID; uint8_t skip1; diff --git a/src/proc/motion-transform.cpp b/src/proc/motion-transform.cpp index 079596d469..a376a9d46b 100644 --- a/src/proc/motion-transform.cpp +++ b/src/proc/motion-transform.cpp @@ -20,18 +20,16 @@ namespace librealsense if (is_mipi) { - auto hid = (hid_mipi_data*)(source); - - if( ! high_accuracy ) + if( ! high_accuracy ) { - //since D400 FW version 5.16 the hid report struct changed to 32 bit for each paramater. - //To support older FW versions we convert the data to int16_t before casting to float as we only get valid data at the lower 16 bits. - hid->x = static_cast< int16_t >( hid->x ); - hid->y = static_cast< int16_t >( hid->y ); - hid->z = static_cast< int16_t >( hid->z ); + auto hid = (hid_mipi_data *)( source ); + res = float3{ float( hid->x ), float( hid->y ), float( hid->z ) } * float( factor ); + } + else + { + auto hid = (hid_mipi_data_32 *)( source ); + res = float3{ float( hid->x ), float( hid->y ), float( hid->z ) } * float( factor ); } - - res = float3{ float( hid->x ), float( hid->y ), float( hid->z ) } * float( factor ); } else {