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

Connected get_motion_intrinsics API to get parameters for T265 #3482

Merged
merged 1 commit into from
Mar 17, 2019
Merged
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
18 changes: 11 additions & 7 deletions src/tm2/tm-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,12 @@ namespace librealsense
rs2_motion_device_intrinsic tm2_sensor::get_motion_intrinsics(const motion_stream_profile_interface& profile) const
{
rs2_motion_device_intrinsic result;
const TrackingData::MotionIntrinsics tm_intrinsics{};
int stream_index = profile.get_stream_index() - 1;
TrackingData::MotionIntrinsics tm_intrinsics{};
int stream_index = profile.get_stream_index();
if (stream_index != 0) //firmware only accepts stream 0
{
return result;
}
SensorType type = SensorType::Max;
switch (profile.get_stream_type())
{
Expand All @@ -645,11 +649,11 @@ namespace librealsense
default:
throw invalid_value_exception("Invalid motion stream type");
}
//auto status = _tm_dev->GetMotionModuleIntrinsics(tm_intrinsics, SET_SENSOR_ID(type, stream_index));
// if (status != Status::SUCCESS)
// {
// throw io_exception("Failed to read TM2 intrinsics");
// }
auto status = _tm_dev->GetMotionModuleIntrinsics(SET_SENSOR_ID(type, stream_index), tm_intrinsics);
if (status != Status::SUCCESS)
{
throw io_exception("Failed to read TM2 intrinsics");
}
librealsense::copy_2darray(result.data, tm_intrinsics.data);
librealsense::copy_array(result.noise_variances, tm_intrinsics.noiseVariances);
librealsense::copy_array(result.bias_variances, tm_intrinsics.biasVariances);
Expand Down