Get Sensor from frame - #3933
Conversation
…, frame::get_sensor(), sensor_from_frame() for C++ interface and Frame::Sensor for C# interface. Add demo usage in rs-data-collect and cs-tutorial-2-capture.
@doronhi - I think you either forgot to |
| for (const auto& elem : data_collection) | ||
| { | ||
| csv << "\n\nStream Type,Index,F#,HW Timestamp (ms),Host Timestamp(ms)" | ||
| csv << "\n\nStream Type,Index,F#,HW Timestamp (ms),Host Timestamp(ms), SerialNumber" |
There was a problem hiding this comment.
The SerialNumber attribute to be moved into the header (Lines 121-123 : csv << get_profile_description(elem);)
add unit-test "get_sensor_from_frame"
ev-mp
left a comment
There was a problem hiding this comment.
I asked for some changes to cover certain corner cases.
Also - pls check with SR300 and T265 live
| { | ||
| // Require at least one device to be plugged in | ||
| rs2::context ctx; | ||
| if (make_context(SECTION_FROM_TEST_NAME, &ctx, "2.13.0")) |
There was a problem hiding this comment.
Fix the minimal required version to be 2.22.0
| for (auto i = 0; i < 5; i++) | ||
| { | ||
| rs2::frameset data = pipe.wait_for_frames(); // Wait for next set of frames from the camera | ||
| auto frame = data.get_color_frame(); |
There was a problem hiding this comment.
This will fail for sensors w/o color stream. Replace by iterating over all the received frames and making sure all refer to the same S.N
| auto frame = data.get_color_frame(); | ||
| std::string frame_serail_no = sensor_from_frame(frame)->get_info(RS2_CAMERA_INFO_SERIAL_NUMBER); | ||
| REQUIRE(dev_serial_no == frame_serail_no); | ||
| } |
There was a problem hiding this comment.
Put a TODO placeholder to check some actual sensor's attributes - > e.g comparing the profile
| { | ||
| rs2::frameset data = pipe.wait_for_frames(); // Wait for next set of frames from the camera | ||
| auto frame = data.get_color_frame(); | ||
| std::string frame_serail_no = sensor_from_frame(frame)->get_info(RS2_CAMERA_INFO_SERIAL_NUMBER); |
Change-Id: Id44b561a8b519dfa207c21824de97eb713bad3af
Change interface: add function rs2_get_frame_sensor() for C interface, frame::get_sensor(), sensor_from_frame() for C++ interface and Frame::Sensor for C# interface.
This is used for obtaining the handle of the frame's sensor.
Add demo usage in rs-data-collect and cs-tutorial-2-capture.
Tracked on: DSO-12656