Skip to content

Commit 49f8464

Browse files
Add static polygon check before simulation
Signed-off-by: Brice <[email protected]>
1 parent 829b30c commit 49f8464

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nav2_collision_monitor/src/polygon.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,12 @@ double Polygon::getCollisionTime(
238238
Velocity vel = velocity;
239239

240240
// Array of points transformed to the frame concerned with pose on each simulation step
241-
std::vector<Point> points_transformed;
241+
std::vector<Point> points_transformed = collision_points;
242+
243+
// Check static polygon
244+
if (getPointsInside(points_transformed) >= min_points_) {
245+
return 0.0;
246+
}
242247

243248
// Robot movement simulation
244249
for (double time = 0.0; time <= time_before_collision_; time += simulation_time_step_) {

0 commit comments

Comments
 (0)