AtsushiSakai/PythonRobotics

Fixing grid_based_sweep_coverage_path_planner.py

ssr-yuki opened this issue · 2 comments

Hi.

The current behavior of PathPlanning/GridBasedSweepCPP/grid_based_sweep_coverage_path_planner.py is different from one shown in the doc.

Screenshots

current expected (same as shown in the doc)
Screenshot from 2023-10-04 20-07-01 Screenshot from 2023-10-04 20-07-39
Screenshot from 2023-10-04 20-07-22 Screenshot from 2023-10-04 20-08-00

Cause

Investigating the change log, I found that the latest commit caused this behavior change.

Screenshot from 2023-10-04 20-15-30

The change in L54-55->L53 of the file (also see the image) silently transformed the occupied_val argument of check_occupied_from_xy_index function from 1.0 into 0.5.

As a reference, the following modification for the current L53 can correct this issue temporally.

-                 if self.check_occupied(next_c_x_index, next_c_y_index, grid_map):
---
+                 if grid_map.check_occupied_from_xy_index(next_c_x_index,
                                                           next_c_y_index, FloatGrid(1.0)):

Please check it. Thanks.

good

Thank you for great explanation about the issue.