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

ROSBAG 3D rendering fix #9300

Merged
merged 2 commits into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/librealsense2/h/rs_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ typedef struct rs2_software_video_frame
rs2_timestamp_domain domain;
int frame_number;
const rs2_stream_profile* profile;
float depth_units;
} rs2_software_video_frame;

/** \brief All the parameters required to define a motion frame. */
Expand Down
2 changes: 1 addition & 1 deletion src/media/ros/ros_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ namespace librealsense
}

// find depth units from old rosbag
auto depth_sensor = As<librealsense::depth_sensor>(sensor_extensions.find(RS2_EXTENSION_DEPTH_STEREO_SENSOR)).get();
auto depth_sensor = As<librealsense::depth_sensor>(sensor_extensions.find(RS2_EXTENSION_DEPTH_SENSOR)).get();
if(depth_sensor)
m_legacy_depth_units = depth_sensor->get_depth_scale();

Expand Down
1 change: 1 addition & 0 deletions src/software-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ namespace librealsense
data.timestamp = software_frame.timestamp;
data.timestamp_domain = software_frame.domain;
data.frame_number = software_frame.frame_number;
data.depth_units = software_frame.depth_units;

data.metadata_size = 0;
for (auto i : _metadata_map)
Expand Down
5 changes: 3 additions & 2 deletions unit-tests/unit-tests-post-processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,11 @@ TEST_CASE("Post-Processing Filters sequence validation", "[software-device][post
[](void*) {}, // Custom deleter (if required)
(int)test_cfg.input_res_x *depth_bpp, // Stride
depth_bpp, // Bytes-per-pixels
(rs2_time_t)frame_number + i, // Timestamp
(rs2_time_t)frame_number + i, // Timestamp
RS2_TIMESTAMP_DOMAIN_SYSTEM_TIME, // Clock Domain
frame_number, // Frame# for potential sync services
depth_stream_profile }); // Depth stream profile
depth_stream_profile, // Depth stream profile
test_cfg.depth_units }); // Depth units

rs2::frameset fset = sync.wait_for_frames();
REQUIRE(fset);
Expand Down