Added support for snapshot of imu and pose. - #7440
Merged
Merged
Conversation
ev-mp
reviewed
Sep 29, 2020
| { | ||
| bool ret = false; | ||
| auto motion = frame.as< motion_frame >(); | ||
| if( frame ) |
Contributor
There was a problem hiding this comment.
- if (motion
frame) - the two lines can be merged into:
if (auto motion = frame.as< motion_frame >())
{
auto axes = motion.get_motion_data();
...| { | ||
| bool ret = false; | ||
| auto pose = frame.as< pose_frame >(); | ||
| if( frame ) |
| 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; |
Contributor
There was a problem hiding this comment.
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
| 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; |
Contributor
There was a problem hiding this comment.
Please put those three values in a single CSV line + add units
| } | ||
|
|
||
| auto pose = last_frame.as< pose_frame >(); | ||
| if (pose && pose.get_profile().stream_type() == RS2_STREAM_POSE) |
Contributor
There was a problem hiding this comment.
The stream type check can be omitted - imo redundant
|
|
||
| auto motion = last_frame.as< motion_frame >(); | ||
| if( motion | ||
| && val_in_range( motion.get_profile().stream_type(), |
| ss << "The frame attributes are saved into\n" << filename; | ||
| else | ||
| viewer.not_model->add_notification( | ||
| { to_string() << "Failed to save frame metadata file " << filename, |
Contributor
There was a problem hiding this comment.
Failed to save TBD frame metadata file
| ss << "The frame attributes are saved into\n" << filename; | ||
| else | ||
| viewer.not_model->add_notification( | ||
| { to_string() << "Failed to save frame metadata file " << filename, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for RS5-8691