Skip to content

Commit

Permalink
fix PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
noacoohen committed Mar 26, 2024
1 parent 541f95e commit 1515c51
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ds/ds-motion-common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ namespace librealsense
}
catch (...) {}

bool high_accuracy = _fw_version >= firmware_version( 5, 16, 0, 0 ) ? true : false ;
bool high_accuracy = _fw_version >= firmware_version( 5, 16, 0, 0 );
hid_ep->register_processing_block(
{ {RS2_FORMAT_MOTION_XYZ32F, RS2_STREAM_ACCEL} },
{ {RS2_FORMAT_MOTION_XYZ32F, RS2_STREAM_ACCEL} },
Expand Down
6 changes: 4 additions & 2 deletions src/proc/motion-transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace librealsense
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.
//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 );
Expand All @@ -37,7 +37,7 @@ namespace librealsense
{
auto hid = (hid_data*)(source);
//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.
//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.
if( ! high_accuracy )
{
hid->x = static_cast< int16_t >( hid->x );
Expand Down Expand Up @@ -68,6 +68,8 @@ namespace librealsense
double gyro_scale_factor = 0.1, bool is_mipi = false )
{
const double gyro_transform_factor = deg2rad( gyro_scale_factor );
//high_accuracy=true when gyro_scale_factor=0.001 for FW version >=5.16
//high_accuracy=false when gyro_scale_factor=0.01 for FW version <5.16
double high_accuracy = ( gyro_scale_factor != 0.1 );
copy_hid_axes< FORMAT >( dest, source, gyro_transform_factor, high_accuracy, is_mipi );
}
Expand Down
1 change: 1 addition & 0 deletions src/proc/motion-transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ namespace librealsense
std::shared_ptr< enable_motion_correction > mm_correct_opt,
bool high_accuracy );
void process_function( uint8_t * const dest[], const uint8_t * source, int width, int height, int actual_size, int input_size) override;
//To be refactored and change to accel_scale_factor once we implement sensitivity feature for the accel like the gyro
bool _high_accuracy = false;

};
Expand Down

0 comments on commit 1515c51

Please sign in to comment.