-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Conversation
Fixing somewhat obscure bug that was causing D400 cameras connected to USB2 port to be mistakenly treated as USB3 (causing problems in various samples and tools). This was specific to Windows, and could occur when the camera was connected through anything but the first root hub.
Fixing USB2 detection bug
# Conflicts: # tools/enumerate-devices/rs-enumerate-devices.cpp
There was a problem hiding this 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
examples/align/rs-align.cpp
Outdated
// 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
examples/align/rs-align.cpp
Outdated
|
||
//Render the vertical slider | ||
// Render transparancy slider: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transparency
examples/align/rs-align.cpp
Outdated
return false; | ||
} | ||
ImGui::End(); | ||
} |
There was a problem hiding this comment.
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
examples/align-advanced/readme.md
Outdated
|
||
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
three several, imho
examples/hello-realsense/readme.md
Outdated
// 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): |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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; | ||
} |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 ?
# Conflicts: # examples/align/rs-align.cpp # examples/example.hpp # examples/measure/rs-measure.cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good
This pull-requests collects several quality of life improvements related to SDK examples:
Try it here
rs-hello-realsense
example (code snippet from the main readme)rs-align
into two separate examples - one introducing the concept of alignment, and the other showing an application of alignment (formerrs-align
)rs-measure
- removing shortest-path calculations and updating the code to use latest APIs:-d
option tors-enumerate-devices
to print out default stream configurationCannot Resolve Request
error message - now given invalid request, the SDK will suggest a list of possible alternatives: