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

Pose as extrinsics reference #4507

Merged
merged 2 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion src/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ namespace librealsense
const platform::backend_device_group group,
bool device_changed_notifications = false);

private:
std::map<int, std::pair<uint32_t, std::shared_ptr<const stream_interface>>> _extrinsics;

private:
std::vector<std::shared_ptr<sensor_interface>> _sensors;
std::shared_ptr<context> _context;
const platform::backend_device_group _group;
Expand Down
16 changes: 16 additions & 0 deletions src/tm2/tm-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1502,4 +1502,20 @@ namespace librealsense
{
_sensor->detach_controller(id);
}

void tm2_device::register_stream_to_extrinsic_group(const stream_interface& stream, uint32_t group_index)
{
//TM2 uses POSE sensor as reference sensor for extrinsics
auto tm2_profiles = _sensor->get_stream_profiles();
int ref_index = 0;
for (int i = 0; i < tm2_profiles.size(); i++)
if (tm2_profiles[i]->get_stream_type() == RS2_STREAM_POSE)
{
ref_index = i;
break;
}

_extrinsics[stream.get_unique_id()] = std::make_pair(group_index, tm2_profiles[ref_index]);
}

}
3 changes: 3 additions & 0 deletions src/tm2/tm-device.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ namespace librealsense
};
bool compress_while_record() const override { return false; }

protected:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the new function's definition but I actually cannot see where and it is applied in the code.
@cchen6 , can you elaborate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ev-mp it is used on tm2-device.cpp line 1518. tm2-device as sub device to use it for reference to pose sensor, differ from ds5 device which use first sensor (infrared 1) as reference.

void register_stream_to_extrinsic_group(const stream_interface& stream, uint32_t group_index);

private:
static const char* tm2_device_name()
{
Expand Down