-
Notifications
You must be signed in to change notification settings - Fork 1.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
Fix align_depth + add test #2825
Fix align_depth + add test #2825
Conversation
finally: | ||
self.shutdown() | ||
|
||
def process_data(self, themes): |
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.
You don't need this if you are not overriding it. The sample tests are meant to show how to override.
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.
Removed.
62cb872
to
240a0c1
Compare
@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): |
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.
Please us a valid unique test name that indicates the test functionality. This helps running the test using test name
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.
Fixed
''' | ||
test_params = { | ||
"rosbag_filename":get_rosbag_file_path("outdoors_1color.bag"), | ||
'camera_name': 'camera', |
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.
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
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.
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"]) |
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.
The data can be passed to the themes, the process_data will compare, if it's available
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.
Removed the data, as in this basic test I just want to test topics and sizes of each topic message
240a0c1
to
fdc2a7a
Compare
…data is not provided
fdc2a7a
to
5dc5ff2
Compare
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.
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) |
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.
The assert can have a valid message, it will help in debugging when running it in CI or prerelease
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