Skip to content

Commit

Permalink
Handle "FAILURE" grab error
Browse files Browse the repository at this point in the history
  • Loading branch information
Myzhar committed Sep 25, 2024
1 parent 210abf8 commit 1dd4ee9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zed_components/src/zed_camera/src/zed_camera_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6005,18 +6005,18 @@ void ZedCamera::threadFunc_zedGrab()
<< sl::toString(mGrabStatus).c_str());
rclcpp::sleep_for(1000ms);
continue;
} else if (mGrabStatus == sl::ERROR_CODE::CAMERA_NOT_INITIALIZED) {
} else if (mGrabStatus == sl::ERROR_CODE::CAMERA_NOT_INITIALIZED || mGrabStatus == sl::ERROR_CODE::FAILURE) {
RCLCPP_ERROR_STREAM(
get_logger(),
"Camera issue detected: "
<< sl::toString(mGrabStatus).c_str());
<< sl::toString(mGrabStatus).c_str() << ". Trying to recover the connection...");
rclcpp::sleep_for(1000ms);
continue;
} else {
RCLCPP_ERROR_STREAM(
get_logger(),
"Critical camera error: " << sl::toString(mGrabStatus).c_str()
<< ". Node stopped.");
<< ". NODE KILLED.");
mZed.reset();
exit(EXIT_FAILURE);
}
Expand Down

0 comments on commit 1dd4ee9

Please sign in to comment.