Skip to content

Commit dd67d1b

Browse files
author
Saurav Agarwal
committed
add check for incorrect params
1 parent e6dbdc9 commit dd67d1b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cppsrc/core/src/coverage_system.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ CoverageSystem::CoverageSystem(Parameters const &params,
129129
}
130130
robots_.reserve(robot_positions.size());
131131
num_robots_ = robot_positions.size();
132+
if(params_.pNumRobots != num_robots_) {
133+
std::cerr << "Number of robots in the file does not match the number of robots in the parameters\n";
134+
std::cerr << "Number of robots in the file: " << num_robots_ << " Number of robots in the parameters: " << params_.pNumRobots << std::endl;
135+
exit(1);
136+
}
132137
for (Point2 const &pos : robot_positions) {
133138
robots_.push_back(RobotModel(params_, pos, world_idf_ptr_));
134139
}

0 commit comments

Comments
 (0)