Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IMU back compat for D457 #12798

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/platform/hid-data.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 8 additions & 10 deletions src/proc/motion-transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Loading