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

Assert Fail if camera not found #3042

Merged
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
10 changes: 6 additions & 4 deletions realsense2_camera/test/live_camera/test_camera_aligned_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def test_camera_align_depth_color(self,launch_descr_with_parameters):
params = launch_descr_with_parameters[1]
if pytest_live_camera_utils.check_if_camera_connected(params['device_type']) == False:
print("Device not found? : " + params['device_type'])
assert False
return
themes = [
{'topic':get_node_heirarchy(params)+'/color/image_raw',
Expand Down Expand Up @@ -144,9 +145,9 @@ def test_camera_align_depth_color(self,launch_descr_with_parameters):
'rgb_camera.profile':'640x480x30',
'align_depth.enable':'true'
}
test_params_all_profiles_d435 = {
'camera_name': 'D435',
'device_type': 'D435',
test_params_all_profiles_d435i = {
'camera_name': 'D435I',
'device_type': 'D435I',
'enable_color':'true',
'enable_depth':'true',
'depth_module.profile':'848x480x30',
Expand All @@ -166,7 +167,7 @@ def test_camera_align_depth_color(self,launch_descr_with_parameters):
@pytest.mark.parametrize("launch_descr_with_parameters", [
pytest.param(test_params_all_profiles_d455, marks=pytest.mark.d455),
pytest.param(test_params_all_profiles_d415, marks=pytest.mark.d415),
pytest.param(test_params_all_profiles_d435, marks=pytest.mark.d435),]
pytest.param(test_params_all_profiles_d435i, marks=pytest.mark.d435i),]
,indirect=True)
@pytest.mark.launch(fixture=launch_descr_with_parameters)
class TestCamera_AllAlignDepthColor(pytest_rs_utils.RsTestBaseClass):
Expand All @@ -178,6 +179,7 @@ def test_camera_all_align_depth_color(self,launch_descr_with_parameters):
params = launch_descr_with_parameters[1]
if pytest_live_camera_utils.check_if_camera_connected(params['device_type']) == False:
print("Device not found? : " + params['device_type'])
assert False
return
themes = [
{'topic':get_node_heirarchy(params)+'/color/image_raw',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ def check_if_skip_test(profile, format):
'camera_name': 'D415',
'device_type': 'D415',
}
test_params_all_profiles_d435 = {
'camera_name': 'D435',
'device_type': 'D435',
test_params_all_profiles_d435i = {
'camera_name': 'D435I',
'device_type': 'D435I',
}


Expand All @@ -144,7 +144,7 @@ def check_if_skip_test(profile, format):
@pytest.mark.parametrize("launch_descr_with_parameters", [
pytest.param(test_params_all_profiles_d455, marks=pytest.mark.d455),
pytest.param(test_params_all_profiles_d415, marks=pytest.mark.d415),
pytest.param(test_params_all_profiles_d435, marks=pytest.mark.d435),]
pytest.param(test_params_all_profiles_d435i, marks=pytest.mark.d435i),]
,indirect=True)
@pytest.mark.launch(fixture=launch_descr_with_parameters)
class TestLiveCamera_Change_Resolution(pytest_rs_utils.RsTestBaseClass):
Expand All @@ -154,6 +154,10 @@ def test_LiveCamera_Change_Resolution(self,launch_descr_with_parameters):
num_passed = 0
num_failed = 0
params = launch_descr_with_parameters[1]
if pytest_live_camera_utils.check_if_camera_connected(params['device_type']) == False:
print("Device not found? : " + params['device_type'])
assert False
return
themes = [{'topic':get_node_heirarchy(params)+'/color/image_raw', 'msg_type':msg_Image,'expected_data_chunks':1}]
config = pytest_live_camera_utils.get_profile_config(get_node_heirarchy(params))
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def test_camera_test_fps(self,launch_descr_with_parameters):
params = launch_descr_with_parameters[1]
if pytest_live_camera_utils.check_if_camera_connected(params['device_type']) == False:
print("Device not found? : " + params['device_type'])
assert False
return
try:
'''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def test_LiveCamera_check_motion_sensor(self,launch_descr_with_parameters):
params = launch_descr_with_parameters[1]
if pytest_live_camera_utils.check_if_camera_connected(params['device_type']) == False:
print("Device not found? : " + params['device_type'])
assert False
return
themes = [{'topic':get_node_heirarchy(params)+'/imu', 'msg_type':msg_Imu,'expected_data_chunks':1},
{'topic':get_node_heirarchy(params)+'/gyro/sample', 'msg_type':msg_Imu,'expected_data_chunks':1},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
'device_type': 'D455',
'pointcloud.enable': 'true'
}
test_params_points_cloud_d435 = {
'camera_name': 'D435',
'device_type': 'D435',
test_params_points_cloud_d435i = {
'camera_name': 'D435I',
'device_type': 'D435I',
'pointcloud.enable': 'true'
}

Expand All @@ -76,7 +76,7 @@
'''
@pytest.mark.parametrize("launch_descr_with_parameters", [
pytest.param(test_params_points_cloud_d455, marks=pytest.mark.d455),
pytest.param(test_params_points_cloud_d435, marks=pytest.mark.d435),
pytest.param(test_params_points_cloud_d435i, marks=pytest.mark.d435i),
pytest.param(test_params_points_cloud_d415, marks=pytest.mark.d415),
],indirect=True)
@pytest.mark.launch(fixture=launch_descr_with_parameters)
Expand All @@ -85,6 +85,7 @@ def test_camera_test_point_cloud(self,launch_descr_with_parameters):
self.params = launch_descr_with_parameters[1]
if pytest_live_camera_utils.check_if_camera_connected(self.params['device_type']) == False:
print("Device not found? : " + self.params['device_type'])
assert False
return
themes = [
{
Expand Down
18 changes: 10 additions & 8 deletions realsense2_camera/test/live_camera/test_camera_tf_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@
'enable_accel': 'true',
'enable_gyro': 'true',
}
test_params_tf_static_change_d435 = {
'camera_name': 'D435',
'device_type': 'D435',
test_params_tf_static_change_d435i = {
'camera_name': 'D435I',
'device_type': 'D435I',
'enable_infra1': 'false',
'enable_infra2': 'true',
'enable_accel': 'true',
Expand All @@ -77,7 +77,7 @@
}
@pytest.mark.parametrize("launch_descr_with_parameters", [
pytest.param(test_params_tf_static_change_d455, marks=pytest.mark.d455),
pytest.param(test_params_tf_static_change_d435, marks=pytest.mark.d435),
pytest.param(test_params_tf_static_change_d435i, marks=pytest.mark.d435i),
pytest.param(test_params_tf_static_change_d415, marks=pytest.mark.d415),
],indirect=True)
@pytest.mark.launch(fixture=launch_descr_with_parameters)
Expand All @@ -86,6 +86,7 @@ def test_camera_test_tf_static_change(self,launch_descr_with_parameters):
self.params = launch_descr_with_parameters[1]
if pytest_live_camera_utils.check_if_camera_connected(self.params['device_type']) == False:
print("Device not found? : " + self.params['device_type'])
assert False
return
themes = [
{'topic':'/tf_static',
Expand Down Expand Up @@ -145,9 +146,9 @@ def process_data(self, themes, enable_infra1):
'tf_publish_rate': '1.1',
}

test_params_tf_d435 = {
'camera_name': 'D435',
'device_type': 'D435',
test_params_tf_d435i = {
'camera_name': 'D435I',
'device_type': 'D435I',
'publish_tf': 'true',
'tf_publish_rate': '1.1',
}
Expand All @@ -160,7 +161,7 @@ def process_data(self, themes, enable_infra1):
}
@pytest.mark.parametrize("launch_descr_with_parameters", [
pytest.param(test_params_tf_d455, marks=pytest.mark.d455),
pytest.param(test_params_tf_d435, marks=pytest.mark.d435),
pytest.param(test_params_tf_d435i, marks=pytest.mark.d435i),
pytest.param(test_params_tf_d415, marks=pytest.mark.d415),
],indirect=True)
@pytest.mark.launch(fixture=launch_descr_with_parameters)
Expand All @@ -169,6 +170,7 @@ def test_camera_test_tf_dyn(self,launch_descr_with_parameters):
self.params = launch_descr_with_parameters[1]
if pytest_live_camera_utils.check_if_camera_connected(self.params['device_type']) == False:
print("Device not found? : " + self.params['device_type'])
assert False
return
themes = [
{'topic':'/tf',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def test_D415_Change_Resolution(self,launch_descr_with_parameters):
params = launch_descr_with_parameters[1]
if pytest_live_camera_utils.check_if_camera_connected(params['device_type']) == False:
print("Device not found? : " + params['device_type'])
assert False
return
failed_tests = []
num_passed = 0
Expand Down
2 changes: 2 additions & 0 deletions realsense2_camera/test/live_camera/test_d455_basic_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def test_D455_Change_Resolution(self,launch_descr_with_parameters):
params = launch_descr_with_parameters[1]
if pytest_live_camera_utils.check_if_camera_connected(params['device_type']) == False:
print("Device not found? : " + params['device_type'])
assert False
return

themes = [
Expand Down Expand Up @@ -116,6 +117,7 @@ def test_D455_Seq_ID_update(self,launch_descr_with_parameters):
params = launch_descr_with_parameters[1]
if pytest_live_camera_utils.check_if_camera_connected(params['device_type']) == False:
print("Device not found? : " + params['device_type'])
assert False
return

try:
Expand Down
Loading