Skip to content

Added support for snapshot of imu and pose. - #7440

Merged
ev-mp merged 3 commits into
realsenseai:developmentfrom
aangerma:RS5-8691
Oct 5, 2020
Merged

Added support for snapshot of imu and pose.#7440
ev-mp merged 3 commits into
realsenseai:developmentfrom
aangerma:RS5-8691

Conversation

@aangerma

Copy link
Copy Markdown
Contributor

Fix for RS5-8691

Comment thread common/model-views.cpp Outdated
{
bool ret = false;
auto motion = frame.as< motion_frame >();
if( frame )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. if (motionframe)
  2. the two lines can be merged into:
  if (auto motion = frame.as< motion_frame >())
  {
    auto axes = motion.get_motion_data();
    ...

Comment thread common/model-views.cpp Outdated
{
bool ret = false;
auto pose = frame.as< pose_frame >();
if( frame )

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as above

Comment thread common/model-views.cpp Outdated
csv << "Timestamp (ms)," << std::fixed << std::setprecision( 2 )
<< frame.get_timestamp() << std::endl;
csv << std::setprecision( 7 ) << "acceleration," << pose_data.acceleration << std::endl;
csv << std::setprecision( 7 ) << "angular_acceleration," << pose_data.angular_acceleration << std::endl;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Each one of those is a vector-like structure - need to verify that they will be presented comma-separated x,y,z,w.
Specify units at the beginning/end of each field

Please attach an actual pose CSV captured for motion and pose for review

Comment thread common/model-views.cpp Outdated
csv << "Frame Number," << frame.get_frame_number() << std::endl;
csv << "Timestamp (ms)," << std::fixed << std::setprecision( 2 )
<< frame.get_timestamp() << std::endl;
csv << std::setprecision( 7 ) << "x," << axes.x << std::endl;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please put those three values in a single CSV line + add units

Comment thread common/model-views.cpp Outdated
}

auto pose = last_frame.as< pose_frame >();
if (pose && pose.get_profile().stream_type() == RS2_STREAM_POSE)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The stream type check can be omitted - imo redundant

Comment thread common/model-views.cpp Outdated

auto motion = last_frame.as< motion_frame >();
if( motion
&& val_in_range( motion.get_profile().stream_type(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

stream check can be omitted

Comment thread common/model-views.cpp Outdated
ss << "The frame attributes are saved into\n" << filename;
else
viewer.not_model->add_notification(
{ to_string() << "Failed to save frame metadata file " << filename,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Failed to save TBD frame metadata file

Comment thread common/model-views.cpp Outdated
ss << "The frame attributes are saved into\n" << filename;
else
viewer.not_model->add_notification(
{ to_string() << "Failed to save frame metadata file " << filename,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as above

Comment thread common/model-views.h

@ev-mp ev-mp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good

@ev-mp
ev-mp merged commit 5f5a7a3 into realsenseai:development Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants