36 static const std::map<IMU_OUTPUT_DATA_RATES, unsigned> hid_fps_translation =
50 virtual float3x3 imu_to_depth_alignment() = 0;
58 calib_table = *(ds::check_calib<ds::tm1_eeprom>(raw_data));
70 auto fe_calib = calib_table.calibration_table.calib_model.fe_calibration;
72 auto rot = fe_calib.fisheye_to_imu.rotation;
73 auto trans = fe_calib.fisheye_to_imu.translation;
75 pose ex = { { { rot(0,0), rot(1,0),rot(2,0)},
76 { rot(0,1), rot(1,1),rot(2,1) },
77 { rot(0,2), rot(1,2),rot(2,2) } },
78 { trans[0], trans[1], trans[2] } };
92 in_intr = calib_table.calibration_table.imu_calib_table.accel_intrinsics;
break;
94 in_intr = calib_table.calibration_table.imu_calib_table.gyro_intrinsics;
break;
99 for (
auto i = 0;
i < 3;
i++)
102 out_intr.bias[
i] = in_intr.
bias[
i];
119 _calib_table.module_info.dm_v2_calib_table.extrinsic_valid = 0;
120 _calib_table.module_info.dm_v2_calib_table.intrinsic_valid = 0;
122 _valid_intrinsic =
false;
123 _valid_extrinsic =
false;
130 _calib_table = *(ds::check_calib<ds::dm_v2_eeprom>(raw_data));
131 _valid_intrinsic = (_calib_table.module_info.dm_v2_calib_table.intrinsic_valid == 1) ?
true :
false;
132 _valid_extrinsic = (_calib_table.module_info.dm_v2_calib_table.extrinsic_valid == 1) ?
true :
false;
136 _valid_intrinsic =
false;
137 _valid_extrinsic =
false;
149 _def_extr = { { 1, 0, 0, 0, 1, 0, 0, 0, 1 }, { -0.00552f, 0.0051f, 0.01174f} };
150 _imu_2_depth_rot = { {-1,0,0},{0,1,0},{0,0,-1} };
155 _def_extr = { { 1, 0, 0, 0, 1, 0, 0, 0, 1 },{ -0.03022f, 0.0074f, 0.01602f } };
156 _imu_2_depth_rot = { { -1,0,0 },{ 0,1,0 },{ 0,0,-1 } };
162 _def_extr = { { 1, 0, 0, 0, 1, 0, 0, 0, 1 },{ -0.10125f, -0.00375f, -0.0013f } };
163 _imu_2_depth_rot = { { 1,0,0 },{ 0,1,0 },{ 0,0,1 } };
170 _def_extr = { { 1, 0, 0, 0, 1, 0, 0, 0, 1 },{ 0.f, 0.f, 0.f } };
171 _imu_2_depth_rot = { { -1,0,0 },{ 0,1,0 },{ 0,0,-1 } };
172 LOG_ERROR(
"Undefined platform with IMU, use default intrinsic/extrinsic data, PID: " << _pid);
177 _def_intr = { { 1, 0, 0, 0, 1, 0, 0, 0, 1 },{ 0.0, 0.0, 0.0 } };
180 if (_valid_extrinsic)
187 LOG_INFO(
"IMU extrinsic table not found; using CAD values");
212 if (_valid_intrinsic)
214 in_intr = _calib_table.module_info.dm_v2_calib_table.accel_intrinsic;
223 if (_valid_intrinsic)
225 in_intr = _calib_table.module_info.dm_v2_calib_table.gyro_intrinsic;
226 in_intr.
bias = in_intr.
bias *
static_cast<float>(
d2r);
235 throw std::runtime_error(
to_string() <<
"Depth Module V2 does not provide intrinsic for stream type : " <<
rs2_stream_to_string(stream) <<
" !");
257 _valid_intrinsic =
false;
258 _valid_extrinsic =
false;
269 imu_calib_table = *(ds::check_calib<ds::dm_v2_calibration_table>(raw_data));
270 _valid_intrinsic = (imu_calib_table.intrinsic_valid == 1) ?
true :
false;
271 _valid_extrinsic = (imu_calib_table.extrinsic_valid == 1) ?
true :
false;
275 _valid_intrinsic =
false;
276 _valid_extrinsic =
false;
300 _def_extr = { { 1, 0, 0, 0, 1, 0, 0, 0, 1 },{ -0.01245f, 0.01642f, 0.00057f } };
301 _imu_2_depth_rot = { { -1, 0, 0 },{ 0, 1, 0 },{ 0, 0, -1 } };
305 _def_intr = { { 1, 0, 0, 0, 1, 0, 0, 0, 1 },{ 0.0, 0.0, 0.0 } };
309 if (_valid_extrinsic)
317 LOG_INFO(
"IMU extrinsic using CAD values");
332 if (_valid_intrinsic)
334 in_intr = imu_calib_table.accel_intrinsic;
343 if (_valid_intrinsic)
345 in_intr = imu_calib_table.gyro_intrinsic;
346 in_intr.
bias = in_intr.
bias *
static_cast<float>(
d2r);
386 const std::vector<uint8_t> get_fisheye_calib_raw();
392 std::vector<uint8_t> get_imu_eeprom_raw()
const;
393 std::vector<uint8_t> get_imu_eeprom_raw_l515()
const;
401 std::shared_ptr<synthetic_sensor> create_hid_device(std::shared_ptr<context>
ctx,
402 const std::vector<platform::hid_device_info>& all_hid_infos,
410 std::shared_ptr<auto_exposure_mechanism> register_auto_exposure_options(
synthetic_sensor* ep,
433 std::vector<std::pair<std::string, stream_profile>> sensor_name_and_hid_profiles =
438 std::map<rs2_stream, std::map<unsigned, unsigned>> fps_and_sampling_frequency_per_rs2_stream =
dm_v2_imu_calib_parser(const std::vector< uint8_t > &raw_data, uint16_t pid, bool valid=true)
ds::dm_v2_eeprom _calib_table
std::shared_ptr< lazy< ds::imu_intrinsic > > _accel_intrinsic
ds::dm_v2_imu_intrinsic _def_intr
rs2_extrinsics from_pose(pose a)
static const std::string gyro_sensor_name
optional_value< uint8_t > _motion_module_device_idx
ds::imu_intrinsic get_intrinsic(rs2_stream stream)
std::shared_ptr< lazy< rs2_extrinsics > > _depth_to_imu
tm1_imu_calib_parser(const std::vector< uint8_t > &raw_data)
std::shared_ptr< stream_interface > _gyro_stream
ds::dm_v2_imu_intrinsic _def_intr
l500_imu_calib_parser(const std::vector< uint8_t > &raw_data, bool valid=true)
GLsizei const GLchar *const * string
virtual ~l500_imu_calib_parser()
rs2_extrinsics get_extrinsic_to(rs2_stream stream)
lazy< std::vector< uint8_t > > _fisheye_calibration_table_raw
ds::tm1_eeprom calib_table
pose inverse(const pose &a)
float3x3 _imu_2_depth_rot
static const std::map< IMU_OUTPUT_DATA_RATES, unsigned > hid_fps_translation
ds::imu_intrinsic get_intrinsic(rs2_stream stream)
float3x3 imu_to_depth_alignment()
optional_value< uint8_t > _fisheye_device_idx
lazy< std::shared_ptr< mm_calib_parser > > _calib_parser
ds::dm_v2_calibration_table imu_calib_table
rs2_extrinsics get_extrinsic_to(rs2_stream stream)
lazy< std::vector< uint8_t > > _fisheye_calibration_table_raw
std::shared_ptr< hw_monitor > _hw_monitor
rs2_stream
Streams are different types of data provided by RealSense devices.
static const std::string accel_sensor_name
rs2_extrinsics get_extrinsic_to(rs2_stream stream)
float3x3 imu_to_depth_alignment()
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
float3x3 imu_to_depth_alignment()
LOG_INFO("Log message using LOG_INFO()")
const uint16_t RS435I_PID
const char * rs2_stream_to_string(rs2_stream stream)
const platform::extension_unit fisheye_xu
std::shared_ptr< lazy< ds::imu_intrinsic > > _gyro_intrinsic
virtual ~tm1_imu_calib_parser()
Motion device intrinsics: scale, bias, and variances.
lazy< std::vector< uint8_t > > _imu_eeprom_raw
float3x3 imu_to_depth_alignment()
ds::imu_intrinsic get_intrinsic(rs2_stream stream)
float3x3 _imu_2_depth_rot
std::shared_ptr< mm_calib_handler > _mm_calib
std::shared_ptr< stream_interface > _accel_stream
std::shared_ptr< stream_interface > _fisheye_stream
virtual ~dm_v2_imu_calib_parser()
void copy(void *dst, void const *src, size_t size)
std::string to_string(T value)