Skip to content

Commit

Permalink
fixed live camera connection checking
Browse files Browse the repository at this point in the history
  • Loading branch information
PrasRsRos committed Oct 5, 2023
1 parent b150072 commit 8e499f1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions realsense2_camera/test/live_camera/test_camera_fps_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

sys.path.append(os.path.abspath(os.path.dirname(__file__)+"/../utils"))
import pytest_rs_utils
import pytest_live_camera_utils
from pytest_rs_utils import launch_descr_with_parameters

from pytest_rs_utils import get_rosbag_file_path
Expand Down Expand Up @@ -71,6 +72,9 @@
class TestCamera_TestFPS(pytest_rs_utils.RsTestBaseClass):
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'])
return
try:
'''
initialize, run and check the data
Expand Down
3 changes: 3 additions & 0 deletions realsense2_camera/test/live_camera/test_camera_imu_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
class TestLiveCamera_TestMotionSensor(pytest_rs_utils.RsTestBaseClass):
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'])
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},
{'topic':get_node_heirarchy(params)+'/accel/sample', 'msg_type':msg_Imu,'expected_data_chunks':1}]
Expand Down
4 changes: 4 additions & 0 deletions realsense2_camera/test/live_camera/test_d415_basic_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@
class TestD415_Change_Resolution(pytest_rs_utils.RsTestBaseClass):
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'])
return
failed_tests = []
num_passed = 0

num_failed = 0
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))
Expand Down
5 changes: 5 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 @@ -29,6 +29,7 @@

sys.path.append(os.path.abspath(os.path.dirname(__file__)+"/../utils"))
import pytest_rs_utils
import pytest_live_camera_utils
from pytest_rs_utils import launch_descr_with_parameters

from pytest_rs_utils import get_rosbag_file_path
Expand All @@ -55,6 +56,10 @@
class TestD455_Change_Resolution(pytest_rs_utils.RsTestBaseClass):
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'])
return

themes = [
{'topic':get_node_heirarchy(params)+'/color/image_raw',
'msg_type':msg_Image,
Expand Down

0 comments on commit 8e499f1

Please sign in to comment.