Skip to content

Commit 2065839

Browse files
committed
do not run calibration if no feature finders (#167)
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
1 parent 4c559be commit 2065839

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

robot_calibration/include/robot_calibration/finders/loader.hpp

+11
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ class FeatureFinderLoader
9090
{
9191
features[name] = finder;
9292
}
93+
else
94+
{
95+
RCLCPP_ERROR(logger, "Feature finder %s failed to initialize", name.c_str());
96+
}
97+
}
98+
99+
// Make sure at least one finder loaded correctly
100+
if (features.empty())
101+
{
102+
RCLCPP_FATAL(logger, "No feature finders loaded");
103+
return false;
93104
}
94105

95106
return true;

robot_calibration/src/nodes/calibrate.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ int main(int argc, char** argv)
8787
{
8888
// No name provided for a calibration bag file, must do capture
8989
robot_calibration::CaptureManager capture_manager;
90-
capture_manager.init(node);
90+
if (!capture_manager.init(node))
91+
{
92+
// Error will be printed in function
93+
return -1;
94+
}
9195

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

0 commit comments

Comments
 (0)