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

Fix align_depth + add test #2825

Merged

Conversation

SamerKhshiboun
Copy link
Contributor

@SamerKhshiboun SamerKhshiboun commented Jul 26, 2023

Tracked in LRS-446
1- Fixed RosSensor is() method, which fixed the align_depth enable/disable during runtime
2- Added new folder for post processing tests, and added new basic test under it for align_depth
3- Fixed pytest_rs_utils.py to check also height and width if they exists in the received data

finally:
self.shutdown()

def process_data(self, themes):
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need this if you are not overriding it. The sample tests are meant to show how to override.

Copy link
Contributor Author

@SamerKhshiboun SamerKhshiboun Jul 26, 2023

Choose a reason for hiding this comment

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

Removed.

@SamerKhshiboun SamerKhshiboun marked this pull request as ready for review July 26, 2023 12:43
@pytest.mark.launch(fixture=pytest_rs_utils.launch_descr_with_yaml)
@pytest.mark.parametrize("launch_descr_with_yaml", [test_params],indirect=True)
class TestBasicAlignDepthEnable(pytest_rs_utils.RsTestBaseClass):
def test_camera_1(self, launch_descr_with_yaml):
Copy link
Contributor

Choose a reason for hiding this comment

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

Please us a valid unique test name that indicates the test functionality. This helps running the test using test name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

'''
test_params = {
"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"),
'camera_name': 'camera',
Copy link
Contributor

Choose a reason for hiding this comment

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

Good to use a unique name for camera. If there are many tests in one py file, the test may run in parallel and it may influence each other

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

class TestBasicAlignDepthEnable(pytest_rs_utils.RsTestBaseClass):
def test_camera_1(self, launch_descr_with_yaml):
params = launch_descr_with_yaml[1]
data = pytest_rs_utils.ImageDepthGetData(params["rosbag_filename"])
Copy link
Contributor

Choose a reason for hiding this comment

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

The data can be passed to the themes, the process_data will compare, if it's available

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the data, as in this basic test I just want to test topics and sizes of each topic message

@SamerKhshiboun SamerKhshiboun changed the title Fix depth align + add test Fix align_depth + add test Jul 26, 2023
Copy link
Contributor

@PrasRsRos PrasRsRos left a comment

Choose a reason for hiding this comment

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

Looks good

@@ -770,6 +770,10 @@ def run_test(self, themes):
def process_data(self, themes):
for theme in themes:
data = self.node.pop_first_chunk(theme['topic'])
if 'width' in theme:
assert theme['width'] == data['shape'][0][1] # (get from numpy image the width)
Copy link
Contributor

Choose a reason for hiding this comment

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

The assert can have a valid message, it will help in debugging when running it in CI or prerelease

@SamerKhshiboun SamerKhshiboun merged commit 9b7daae into IntelRealSense:ros2-development Jul 26, 2023
@SamerKhshiboun SamerKhshiboun deleted the fix_depth_align branch August 6, 2023 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants