karlkurzer / path_planner

Hybrid A* Path Planner for the KTH Research Concept Vehicle
http://karlkurzer.github.io/path_planner/
BSD 3-Clause "New" or "Revised" License
1.49k stars 526 forks source link

car center node is within the map while the car area is out of map #51

Closed yslenjoy closed 1 year ago

yslenjoy commented 2 years ago

isOnGrid function only performs the car center node check, it doesn't perform any car area check, which may result issue like picture below.

To solve this issue, we can simply do some modifications in collisionDetection.cpp for CollisionDetection::configurationTest function: -- letting the collision check return false if any car area is out of the map

if (cX >= 0 && (unsigned int)cX < grid->info.width && cY >= 0 && (unsigned int)cY < grid->info.height) {
      if (grid->data[cY * grid->info.width + cX]) {
        return false;
      }
    }
   // modification below:
    else{
      return false;
    }

0601 - notOnGrid

karlkurzer commented 1 year ago

That's a valid point, I only considered planning for areas with occupancy information :-)