Skip to content

Commit 3f25b5c

Browse files
committed
Add check on DRIVER_FAILURE error
1 parent bbce101 commit 3f25b5c

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

zed_components/src/zed_camera/src/zed_camera_component_main.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2480,11 +2480,18 @@ bool ZedCamera::startCamera()
24802480
break;
24812481
}
24822482

2483+
if (mConnStatus == sl::ERROR_CODE::DRIVER_FAILURE) {
2484+
RCLCPP_ERROR_STREAM(
2485+
get_logger(),
2486+
"ZED X Driver failure: "
2487+
<< sl::toVerbose(mConnStatus)
2488+
<< ". Please verify that the ZED drivers are correctly installed.");
2489+
return false;
2490+
}
2491+
24832492
if (mConnStatus == sl::ERROR_CODE::INVALID_CALIBRATION_FILE) {
24842493
if (mOpencvCalibFile.empty()) {
2485-
RCLCPP_ERROR_STREAM(
2486-
get_logger(), "Calibration file error: "
2487-
<< sl::toVerbose(mConnStatus));
2494+
RCLCPP_ERROR_STREAM(get_logger(), "Calibration file error: " << sl::toVerbose(mConnStatus));
24882495
} else {
24892496
RCLCPP_ERROR_STREAM(
24902497
get_logger(),

zed_components/src/zed_camera_one/src/zed_camera_one_component_main.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,15 @@ bool ZedCameraOne::openZedCamera()
774774
_connStatus = _zed->open(_initParams);
775775

776776
if (_connStatus != sl::ERROR_CODE::SUCCESS) {
777+
if (_connStatus == sl::ERROR_CODE::DRIVER_FAILURE) {
778+
RCLCPP_ERROR_STREAM(
779+
get_logger(),
780+
"ZED X Driver failure: " << sl::toVerbose(_connStatus)
781+
<< ". Please verify that the ZED drivers "
782+
"are correctly installed.");
783+
return false;
784+
}
785+
777786
if (_connStatus == sl::ERROR_CODE::INVALID_CALIBRATION_FILE) {
778787
if (_opencvCalibFile.empty()) {
779788
RCLCPP_ERROR_STREAM(

0 commit comments

Comments
 (0)