Skip to content

Commit

Permalink
remove try catch in start
Browse files Browse the repository at this point in the history
  • Loading branch information
Serafadam committed Sep 26, 2024
1 parent 2c9f209 commit a1e15be
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions depthai_ros_driver/src/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,11 @@ void Camera::diagCB(const diagnostic_msgs::DiagnosticArray::ConstPtr& msg) {
}

void Camera::start() {
bool success = false;
while(!success) {
try {
ROS_INFO("Starting camera.");
if(!camRunning) {
onConfigure();
} else {
ROS_INFO("Camera already running!.");
}
success = true;
} catch(const std::exception& e) {
ROS_ERROR("Exception occurred: %s. Retry", e.what());
camRunning = false;
}
ROS_INFO("Starting camera.");
if(!camRunning) {
onConfigure();
} else {
ROS_INFO("Camera already running!.");
}
}
void Camera::stop() {
Expand Down

0 comments on commit a1e15be

Please sign in to comment.