Skip to content

Commit b138fbc

Browse files
committed
Catch if altitude is set too small.
Closes #40.
1 parent 6dfa6d4 commit b138fbc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

polygon_coverage_ros/include/polygon_coverage_ros/coverage_planner.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ class CoveragePlanner : public PolygonPlannerBase {
215215
break;
216216
}
217217
if (!altitude_.has_value()) {
218-
ROS_WARN("No altitude specified. Creating default altitude 1m.");
218+
ROS_WARN("No altitude specified. Creating default altitude of 1m.");
219+
altitude_ = std::make_optional(1.0);
220+
} else if (altitude_.value() < std::numeric_limits<double>::epsilon()) {
221+
ROS_WARN("Altitude to small %.3fm. Setting default altitude of 1m.",
222+
altitude_.value());
219223
altitude_ = std::make_optional(1.0);
220224
}
221225
sensor_model_ = std::make_shared<Frustum>(

0 commit comments

Comments
 (0)