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

SDK Examples Enhancements (part 1 on N) #3548

Merged
merged 21 commits into from
Mar 21, 2019

Conversation

dorodnic
Copy link
Contributor

This pull-requests collects several quality of life improvements related to SDK examples:

  1. New examples catalog, making it easier to find relevant examples, based on language, technology and experience level:
    new_examples
    Try it here
  2. Adding rs-hello-realsense example (code snippet from the main readme)
  3. Splitting rs-align into two separate examples - one introducing the concept of alignment, and the other showing an application of alignment (former rs-align)
    rs-align
  4. Simplifying rs-measure - removing shortest-path calculations and updating the code to use latest APIs:
    expected output
  5. Adding -d option to rs-enumerate-devices to print out default stream configuration
  6. Improving Cannot Resolve Request error message - now given invalid request, the SDK will suggest a list of possible alternatives:
    error_message

@dorodnic dorodnic added this to the v2.19.2 milestone Mar 20, 2019
Copy link
Collaborator

@ev-mp ev-mp left a comment

Choose a reason for hiding this comment

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

There would probably be a merge issue with rs-enumerate-devices from tm2::query_devices

// Using the pipeline's profile, we can retrieve the device that the pipeline uses
float depth_scale = get_depth_scale(profile.get_device());
rs2::config cfg;
cfg.enable_stream(RS2_STREAM_DEPTH, 500, 500);
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo


//Render the vertical slider
// Render transparancy slider:
Copy link
Collaborator

Choose a reason for hiding this comment

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

transparency

return false;
}
ImGui::End();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

PLs add and empty line at EOL


These headers are part of the [ImGui](https://github.com/ocornut/imgui) library which we use to render GUI elements.

Next, we declare three functions to help the code look clearer:
Copy link
Collaborator

Choose a reason for hiding this comment

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

three several, imho

// Try to get a frame of a depth image
rs2::depth_frame depth = frames.get_depth_frame();
```
Next we query the default depth frame dimentions (these may differ from sensor to sensor):
Copy link
Collaborator

Choose a reason for hiding this comment

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

dimentsions

rs2::frameset frames = p.wait_for_frames();

// Try to get a frame of a depth image
rs2::depth_frame depth = frames.get_depth_frame();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pls check the return value to be on a safe side

{
std::cerr << e.what() << std::endl;
return EXIT_FAILURE;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Pls add an empty line

@@ -16,13 +16,9 @@ In this tutorial you will learn how to:


## Expected Output
![expected output](https://raw.githubusercontent.com/wiki/IntelRealSense/librealsense/res/measure-expected.png)
![expected output](https://raw.githubusercontent.com/wiki/dorodnic/librealsense/expected.png)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can upload it to the public repo

sensor.set_option(RS2_OPTION_VISUAL_PRESET, i);
// Set the device to High Accuracy preset
auto sensor = profile.get_device().first<rs2::depth_sensor>();
sensor.set_option(RS2_OPTION_VISUAL_PRESET, RS2_RS400_VISUAL_PRESET_HIGH_ACCURACY);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this enum compatible with SR300 ?

Copy link
Collaborator

@ev-mp ev-mp left a comment

Choose a reason for hiding this comment

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

Looking good

@dorodnic dorodnic merged commit 234b1dd into IntelRealSense:development Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants