From 158612cd90021da067f926957ec184aef39ca2f2 Mon Sep 17 00:00:00 2001 From: Avia Avraham <145359432+AviaAv@users.noreply.github.com> Date: Sun, 19 Jul 2026 15:04:07 +0300 Subject: [PATCH 1/3] RSDSO-21716: migrate rosbag tests to db3, deflake align_depth --- .../test_align_depth.py | 7 ++++-- .../rosbag/test_rosbag_all_topics_test.py | 17 +++++++------ .../test/rosbag/test_rosbag_basic_tests.py | 15 ++++++----- .../rosbag/test_rosbag_dec_point_tests.py | 19 ++++++++------ .../test/rosbag/test_rosbag_depth_tests.py | 25 +++++++++++-------- .../test/rosbag/test_rosbag_imu_test.py | 11 +++++--- .../test/utils/pytest_rs_utils.py | 9 +++++++ 7 files changed, 65 insertions(+), 38 deletions(-) diff --git a/realsense2_camera/test/post_processing_filters/test_align_depth.py b/realsense2_camera/test/post_processing_filters/test_align_depth.py index 1c73779868..2880bcaa95 100644 --- a/realsense2_camera/test/post_processing_filters/test_align_depth.py +++ b/realsense2_camera/test/post_processing_filters/test_align_depth.py @@ -31,9 +31,11 @@ sys.path.append(os.path.abspath(os.path.dirname(__file__)+"/../utils")) import pytest_rs_utils from pytest_rs_utils import launch_descr_with_yaml -from pytest_rs_utils import get_rosbag_file_path +from pytest_rs_utils import get_db3_file_path from pytest_rs_utils import get_node_heirarchy +BAG = "outdoors_1color.bag" + ''' This test imitates the ros2 launch rs_launch.py realsense2_camera with the given parameters below Full command to reproduce locally @@ -49,7 +51,7 @@ Also we check that the recieved frames of each topic are in the right width and height ''' test_params = { - "rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), + "rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'camera_1', 'enable_color': 'true', 'enable_depth': 'true', @@ -78,6 +80,7 @@ def test_align_depth_on(self, launch_descr_with_yaml): initialize, run and check the data ''' self.init_test('RsTest'+params['camera_name']) + self.wait_for_node(params['camera_name']) ret = self.run_test(themes) assert ret[0], ret[1] assert self.process_data(themes) diff --git a/realsense2_camera/test/rosbag/test_rosbag_all_topics_test.py b/realsense2_camera/test/rosbag/test_rosbag_all_topics_test.py index 43fcb1ac89..61494779d3 100644 --- a/realsense2_camera/test/rosbag/test_rosbag_all_topics_test.py +++ b/realsense2_camera/test/rosbag/test_rosbag_all_topics_test.py @@ -39,10 +39,13 @@ from pytest_rs_utils import delayed_launch_descr_with_parameters from pytest_rs_utils import get_rosbag_file_path +from pytest_rs_utils import get_db3_file_path from pytest_rs_utils import get_node_heirarchy +BAG = "outdoors_1color.bag" -test_params_all_topics = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), + +test_params_all_topics = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'AllTopics', 'enable_infra1':'true', 'enable_infra2':'true', @@ -66,7 +69,7 @@ class TestAllTopics(pytest_rs_utils.RsTestBaseClass): def test_all_topics(self,delayed_launch_descr_with_parameters): params = delayed_launch_descr_with_parameters[1] - self.rosbag = params["rosbag_filename"] + self.rosbag = get_rosbag_file_path(BAG) depth_to_infra_extrinsics_data = msg_Extrinsics() depth_to_infra_extrinsics_data.rotation = [1., 0., 0., 0., 1., 0., 0., 0., 1.] @@ -76,7 +79,7 @@ def test_all_topics(self,delayed_launch_descr_with_parameters): depth_to_color_extrinsics_data.rotation=array('f',[ 0.99999666, 0.00166541, 0.00198587, -0.00166956, 0.99999642, 0.00208678, -0.00198239, -0.00209009, 0.99999583]) depth_to_color_extrinsics_data.translation=array('f',[ 0.01484134, -0.00020221, 0.00013059]) - data = pytest_rs_utils.ImageColorGetData(params["rosbag_filename"]) + data = pytest_rs_utils.ImageColorGetData(get_rosbag_file_path(BAG)) themes = [ { 'topic':get_node_heirarchy(params)+'/extrinsics/depth_to_color', @@ -110,7 +113,7 @@ def test_all_topics(self,delayed_launch_descr_with_parameters): def process_data(self, themes): return super().process_data(themes) -test_params_metadata_topics = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), +test_params_metadata_topics = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'MetadataTopics', 'color_width': '0', 'color_height': '0', @@ -135,7 +138,7 @@ def test_metadata_topics(self,delayed_launch_descr_with_parameters): current rosbag file doesn't have color data ''' params = delayed_launch_descr_with_parameters[1] - self.rosbag = params["rosbag_filename"] + self.rosbag = get_rosbag_file_path(BAG) color_metadata = msg_Metadata() color_metadata.json_data = '{"frame_number":39,"clock_domain":"system_time","frame_timestamp":1508282881033.132324,"frame_counter":-8134432827560165376,"time_of_arrival":1508282881033}' @@ -178,7 +181,7 @@ def test_metadata_topics(self,delayed_launch_descr_with_parameters): def process_data(self, themes): return super().process_data(themes) -test_params_camera_info_topics = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), +test_params_camera_info_topics = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'CameraInfoTopics', 'color_width': '0', 'color_height': '0', @@ -202,7 +205,7 @@ def test_camera_info_topics(self,delayed_launch_descr_with_parameters): current rosbag file doesn't have color data ''' params = delayed_launch_descr_with_parameters[1] - self.rosbag = params["rosbag_filename"] + self.rosbag = get_rosbag_file_path(BAG) ''' The test is hardwired to ensure the rosbag file is not changed. The function CameraInfoColorGetData requires changes to adapt to the changes diff --git a/realsense2_camera/test/rosbag/test_rosbag_basic_tests.py b/realsense2_camera/test/rosbag/test_rosbag_basic_tests.py index cfa834691a..fab1a48a84 100644 --- a/realsense2_camera/test/rosbag/test_rosbag_basic_tests.py +++ b/realsense2_camera/test/rosbag/test_rosbag_basic_tests.py @@ -32,9 +32,12 @@ from pytest_rs_utils import launch_descr_with_parameters from pytest_rs_utils import delayed_launch_descr_with_parameters from pytest_rs_utils import get_rosbag_file_path +from pytest_rs_utils import get_db3_file_path from pytest_rs_utils import get_node_heirarchy -test_params = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), +BAG = "outdoors_1color.bag" + +test_params = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'Vis2_Cam', 'color_width': '0', 'color_height': '0', @@ -53,7 +56,7 @@ class TestVis2(pytest_rs_utils.RsTestBaseClass): def test_vis_2(self,delayed_launch_descr_with_parameters): params = delayed_launch_descr_with_parameters[1] - data = pytest_rs_utils.ImageColorGetData(params["rosbag_filename"]) + data = pytest_rs_utils.ImageColorGetData(get_rosbag_file_path(BAG)) themes = [ {'topic':get_node_heirarchy(params)+'/color/image_raw', 'msg_type':msg_Image, @@ -75,7 +78,7 @@ def process_data(self, themes): return super().process_data(themes) -test_params_depth = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), +test_params_depth = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'Depth_W_Cloud', 'color_width': '0', 'color_height': '0', @@ -95,7 +98,7 @@ def process_data(self, themes): class TestDepthWCloud(pytest_rs_utils.RsTestBaseClass): def test_depth_w_cloud_1(self,launch_descr_with_parameters): params = launch_descr_with_parameters[1] - data = pytest_rs_utils.ImageDepthGetData(params["rosbag_filename"]) + data = pytest_rs_utils.ImageDepthGetData(get_rosbag_file_path(BAG)) themes = [ {'topic':get_node_heirarchy(params)+'/depth/image_rect_raw', 'msg_type':msg_Image, @@ -117,7 +120,7 @@ def process_data(self, themes): return super().process_data(themes) -test_params_depth_avg_1 = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), +test_params_depth_avg_1 = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'Depth_Avg_1', 'color_width': '0', 'color_height': '0', @@ -136,7 +139,7 @@ def process_data(self, themes): class TestDepthAvg1(pytest_rs_utils.RsTestBaseClass): def test_depth_avg_1(self,launch_descr_with_parameters): params = launch_descr_with_parameters[1] - data = pytest_rs_utils.ImageDepthGetData(params["rosbag_filename"]) + data = pytest_rs_utils.ImageDepthGetData(get_rosbag_file_path(BAG)) themes = [ {'topic':get_node_heirarchy(params)+'/depth/image_rect_raw', 'msg_type':msg_Image, diff --git a/realsense2_camera/test/rosbag/test_rosbag_dec_point_tests.py b/realsense2_camera/test/rosbag/test_rosbag_dec_point_tests.py index d24b2ad00b..5f46086d19 100644 --- a/realsense2_camera/test/rosbag/test_rosbag_dec_point_tests.py +++ b/realsense2_camera/test/rosbag/test_rosbag_dec_point_tests.py @@ -32,10 +32,13 @@ from pytest_rs_utils import launch_descr_with_parameters from pytest_rs_utils import delayed_launch_descr_with_parameters from pytest_rs_utils import get_rosbag_file_path +from pytest_rs_utils import get_db3_file_path from pytest_rs_utils import get_node_heirarchy +BAG = "outdoors_1color.bag" -test_params_depth_avg_decimation_1 = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), + +test_params_depth_avg_decimation_1 = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'Align_Depth_Color_1', 'color_width': '0', 'color_height': '0', @@ -55,7 +58,7 @@ class TestDepthAvgDecimation1(pytest_rs_utils.RsTestBaseClass): def test_depth_avg_decimation_1(self,launch_descr_with_parameters): params = launch_descr_with_parameters[1] - data = pytest_rs_utils.ImageDepthGetData_decimation(params["rosbag_filename"]) + data = pytest_rs_utils.ImageDepthGetData_decimation(get_rosbag_file_path(BAG)) themes = [ {'topic':get_node_heirarchy(params)+'/depth/image_rect_raw', 'msg_type':msg_Image, @@ -77,7 +80,7 @@ def process_data(self, themes): return super().process_data(themes) -test_params_depth_avg_1 = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), +test_params_depth_avg_1 = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'Depth_Avg_1', 'color_width': '0', 'color_height': '0', @@ -96,7 +99,7 @@ def process_data(self, themes): class TestDepthAvg1(pytest_rs_utils.RsTestBaseClass): def test_depth_avg_1(self,launch_descr_with_parameters): params = launch_descr_with_parameters[1] - data = pytest_rs_utils.ImageDepthGetData(params["rosbag_filename"]) + data = pytest_rs_utils.ImageDepthGetData(get_rosbag_file_path(BAG)) themes = [ {'topic':get_node_heirarchy(params)+'/depth/image_rect_raw', 'msg_type':msg_Image, @@ -118,7 +121,7 @@ def process_data(self, themes): return super().process_data(themes) -test_params_depth_avg_decimation_1 = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), +test_params_depth_avg_decimation_1 = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'Align_Depth_Color_1', 'color_width': '0', 'color_height': '0', @@ -138,7 +141,7 @@ def process_data(self, themes): class TestDepthAvgDecimation1(pytest_rs_utils.RsTestBaseClass): def test_depth_avg_decimation_1(self,launch_descr_with_parameters): params = launch_descr_with_parameters[1] - data = pytest_rs_utils.ImageDepthGetData_decimation(params["rosbag_filename"]) + data = pytest_rs_utils.ImageDepthGetData_decimation(get_rosbag_file_path(BAG)) themes = [ {'topic':get_node_heirarchy(params)+'/depth/image_rect_raw', 'msg_type':msg_Image, @@ -160,7 +163,7 @@ def process_data(self, themes): return super().process_data(themes) -test_params_points_cloud_1 = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), +test_params_points_cloud_1 = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'Points_cloud_1', 'color_width': '0', 'color_height': '0', @@ -180,7 +183,7 @@ def process_data(self, themes): class TestPointsCloud1(pytest_rs_utils.RsTestBaseClass): def test_points_cloud_1(self,delayed_launch_descr_with_parameters): params = delayed_launch_descr_with_parameters[1] - self.rosbag = params["rosbag_filename"] + self.rosbag = get_rosbag_file_path(BAG) themes = [ {'topic':get_node_heirarchy(params)+'/depth/color/points', 'msg_type':msg_PointCloud2, diff --git a/realsense2_camera/test/rosbag/test_rosbag_depth_tests.py b/realsense2_camera/test/rosbag/test_rosbag_depth_tests.py index 8a85181723..472a489ad2 100644 --- a/realsense2_camera/test/rosbag/test_rosbag_depth_tests.py +++ b/realsense2_camera/test/rosbag/test_rosbag_depth_tests.py @@ -36,10 +36,13 @@ from pytest_rs_utils import launch_descr_with_parameters from pytest_rs_utils import delayed_launch_descr_with_parameters from pytest_rs_utils import get_rosbag_file_path +from pytest_rs_utils import get_db3_file_path from pytest_rs_utils import get_node_heirarchy +BAG = "outdoors_1color.bag" -test_params_depth_points_cloud_1 = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), + +test_params_depth_points_cloud_1 = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'Points_cloud_1', 'color_width': '0', 'color_height': '0', @@ -70,8 +73,8 @@ def test_depth_points_cloud_1(self,delayed_launch_descr_with_parameters): since there are two callbacks, the initial few frames/data gets lost. ''' params = delayed_launch_descr_with_parameters[1] - self.rosbag = params["rosbag_filename"] - data2 = pytest_rs_utils.ImageDepthGetData(params["rosbag_filename"]) + self.rosbag = get_rosbag_file_path(BAG) + data2 = pytest_rs_utils.ImageDepthGetData(get_rosbag_file_path(BAG)) data1 = {'width': [660353, 3300], 'height': [1], 'avg': [np.array([ 1.28251814, -0.15839984, 4.82235184, 80, 160, 240])], @@ -97,7 +100,7 @@ def process_data(self, themes): return super().process_data(themes) -test_params_static_tf_1 = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), +test_params_static_tf_1 = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'Static_tf1', 'color_width': '0', 'color_height': '0', @@ -116,7 +119,7 @@ def process_data(self, themes): class TestStaticTf1(pytest_rs_utils.RsTestBaseClass): def test_static_tf_1(self,delayed_launch_descr_with_parameters): self.params = delayed_launch_descr_with_parameters[1] - self.rosbag = self.params["rosbag_filename"] + self.rosbag = get_rosbag_file_path(BAG) themes = [ {'topic':get_node_heirarchy(self.params)+'/color/image_raw', 'msg_type':msg_Image, @@ -156,7 +159,7 @@ def process_data(self, themes): return ret[0] -test_params_non_existing_rosbag = {"rosbag_filename":"non_existent.bag", +test_params_non_existing_rosbag = {"rosbag_filename":"non_existent.db3", 'camera_name': 'non_existing_rosbag', } ''' @@ -181,7 +184,7 @@ def test_non_existing_rosbag(self,delayed_launch_descr_with_parameters): -test_params_align_depth_color_1 = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), +test_params_align_depth_color_1 = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'Align_Depth_Color_1', 'color_width': '0', 'color_height': '0', @@ -201,7 +204,7 @@ def test_non_existing_rosbag(self,delayed_launch_descr_with_parameters): class TestAlignDepthColor(pytest_rs_utils.RsTestBaseClass): def test_align_depth_color_1(self,delayed_launch_descr_with_parameters): params = delayed_launch_descr_with_parameters[1] - data = pytest_rs_utils.ImageDepthInColorShapeGetData(params["rosbag_filename"]) + data = pytest_rs_utils.ImageDepthInColorShapeGetData(get_rosbag_file_path(BAG)) themes = [ {'topic':get_node_heirarchy(params)+'/aligned_depth_to_color/image_raw', 'msg_type':msg_Image, @@ -223,7 +226,7 @@ def process_data(self, themes): return super().process_data(themes) -test_params_align_depth_infra_1 = {"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), +test_params_align_depth_infra_1 = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'Align_Depth_Infra_1', 'color_width': '0', 'color_height': '0', @@ -256,8 +259,8 @@ def process_data(self, themes): class TestAlignDepthInfra1(pytest_rs_utils.RsTestBaseClass): def test_align_depth_infra_1(self,delayed_launch_descr_with_parameters): params = delayed_launch_descr_with_parameters[1] - self.rosbag = params["rosbag_filename"] - #data = pytest_rs_utils.ImageDepthInColorShapeGetData(params["rosbag_filename"]) + self.rosbag = get_rosbag_file_path(BAG) + #data = pytest_rs_utils.ImageDepthInColorShapeGetData(get_rosbag_file_path(BAG)) themes = [ {'topic':get_node_heirarchy(params)+'/aligned_depth_to_infra1/image_raw', 'msg_type':msg_Image, diff --git a/realsense2_camera/test/rosbag/test_rosbag_imu_test.py b/realsense2_camera/test/rosbag/test_rosbag_imu_test.py index 449ed57b8f..267b36de70 100644 --- a/realsense2_camera/test/rosbag/test_rosbag_imu_test.py +++ b/realsense2_camera/test/rosbag/test_rosbag_imu_test.py @@ -38,10 +38,13 @@ from pytest_rs_utils import delayed_launch_descr_with_parameters from pytest_rs_utils import get_rosbag_file_path +from pytest_rs_utils import get_db3_file_path from pytest_rs_utils import get_node_heirarchy +BAG = "D435i_Depth_and_IMU_Stands_still.bag" -test_params_accel = {"rosbag_filename":get_rosbag_file_path("D435i_Depth_and_IMU_Stands_still.bag"), + +test_params_accel = {"rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'Accel_Cam', 'color_width': '0', 'color_height': '0', @@ -62,7 +65,7 @@ class TestAccelUp1(pytest_rs_utils.RsTestBaseClass): def test_accel_up_1(self,delayed_launch_descr_with_parameters): params = delayed_launch_descr_with_parameters[1] - data = pytest_rs_utils.AccelGetDataDeviceStandStraight(params["rosbag_filename"]) + data = pytest_rs_utils.AccelGetDataDeviceStandStraight(get_rosbag_file_path(BAG)) themes = [ {'topic':get_node_heirarchy(params)+'/accel/sample', 'msg_type':msg_Imu, @@ -84,7 +87,7 @@ def process_data(self, themes): return super().process_data(themes) test_params_imu_topics = {#"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), - "rosbag_filename":get_rosbag_file_path("D435i_Depth_and_IMU_Stands_still.bag"), + "rosbag_filename":get_db3_file_path(BAG), 'camera_name': 'ImuTopics', 'color_width': '0', 'color_height': '0', @@ -106,7 +109,7 @@ def test_imu_topics(self,delayed_launch_descr_with_parameters): current rosbag file doesn't have color data ''' params = delayed_launch_descr_with_parameters[1] - self.rosbag = params["rosbag_filename"] + self.rosbag = get_rosbag_file_path(BAG) themes = [{ 'topic':get_node_heirarchy(params)+'/imu', 'msg_type':msg_Imu, diff --git a/realsense2_camera/test/utils/pytest_rs_utils.py b/realsense2_camera/test/utils/pytest_rs_utils.py index b762258736..f470f586ee 100644 --- a/realsense2_camera/test/utils/pytest_rs_utils.py +++ b/realsense2_camera/test/utils/pytest_rs_utils.py @@ -123,6 +123,15 @@ def get_rosbag_file_path(filename): return path get_rosbag_file_path.rosbagMgr = None +def get_db3_file_path(bag_filename): + bag = get_rosbag_file_path(bag_filename) + db3 = os.path.splitext(bag)[0] + ".db3" + if os.path.isfile(db3): + return db3 + subprocess.run(["rs-convert", "-i", bag, "-D", db3], + check=True, capture_output=True, timeout=180) + return db3 + def CameraInfoGetData(rec_filename, topic): data = importRosbag(rec_filename, importTopics=[topic], log='ERROR', disable_bar=True)[topic] data = {k.lower(): v for k, v in data.items()} From da4ebd9c47bdd7bfdbc06e83f781cc45d63cf8a3 Mon Sep 17 00:00:00 2001 From: Avia Avraham <145359432+AviaAv@users.noreply.github.com> Date: Tue, 28 Jul 2026 14:41:59 +0300 Subject: [PATCH 2/3] TEMP: build librealsense from hide-fastdds-symbols branch for CI validation --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4982979896..7db45fda12 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,7 +73,7 @@ jobs: - name: Build librealsense2 from development branch run: | cd /tmp - git clone --depth 1 --branch development https://github.com/realsenseai/librealsense.git + git clone --depth 1 --branch hide-fastdds-symbols https://github.com/AviaAv/librealsense.git cd librealsense mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=false -DBUILD_GRAPHICAL_EXAMPLES=false From f9253ae8e19e9f2cd3b7789bba4f8a4aeed465f5 Mon Sep 17 00:00:00 2001 From: Avia Avraham <145359432+AviaAv@users.noreply.github.com> Date: Wed, 29 Jul 2026 14:21:29 +0300 Subject: [PATCH 3/3] Revert "TEMP: build librealsense from hide-fastdds-symbols branch for CI validation" This reverts commit da4ebd9c47bdd7bfdbc06e83f781cc45d63cf8a3. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7db45fda12..4982979896 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,7 +73,7 @@ jobs: - name: Build librealsense2 from development branch run: | cd /tmp - git clone --depth 1 --branch hide-fastdds-symbols https://github.com/AviaAv/librealsense.git + git clone --depth 1 --branch development https://github.com/realsenseai/librealsense.git cd librealsense mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=false -DBUILD_GRAPHICAL_EXAMPLES=false