Skip to content

Commit

Permalink
do not run calibration if no feature finders (#167)
Browse files Browse the repository at this point in the history
due to misconfiguration (for instance, camera_info topic
is wrong) the finders may not initialize but the robot
will move through all the poses, say it captured
all of them, and then have no observations in the
output bagfile
  • Loading branch information
mikeferguson authored Aug 12, 2024
1 parent 796415e commit 044d5de
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions robot_calibration/include/robot_calibration/finders/loader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,17 @@ class FeatureFinderLoader
{
features[name] = finder;
}
else
{
RCLCPP_ERROR(logger, "Feature finder %s failed to initialize", name.c_str());
}
}

// Make sure at least one finder loaded correctly
if (features.empty())
{
RCLCPP_FATAL(logger, "No feature finders loaded");
return false;
}

return true;
Expand Down
6 changes: 5 additions & 1 deletion robot_calibration/src/nodes/calibrate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ int main(int argc, char** argv)
{
// No name provided for a calibration bag file, must do capture
robot_calibration::CaptureManager capture_manager;
capture_manager.init(node);
if (!capture_manager.init(node))
{
// Error will be printed in function
return -1;
}

// Save URDF for calibration/export step
description_msg.data = capture_manager.getUrdf();
Expand Down

0 comments on commit 044d5de

Please sign in to comment.