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

HybridAstar algorithm: about the judgment of the same cell #54

Open Zhihaibi opened 1 year ago

Zhihaibi commented 1 year ago

algorithm.cpp in line 201 - 208

               if (iPred == iSucc && nSucc->getC() > nPred->getC() + Constants::tieBreaker) {
                  delete nSucc;
                  continue;
                   }
                // if successor is in the same cell and the C value is lower, set predecessor to predecessor of predecessor
             else if (iPred == iSucc && nSucc->getC() <= nPred->getC() + Constants::tieBreaker) {
                  nSucc->setPred(nPred->getPred());
  }

Hi, thank you very much for the open-source code. I am confused about the judgment of the same cell in the code above. The index iPred and iSucc here are the three-dimensional indexes related to the heading angle, which will result in almost no judgment as the same cell as long as the heading angle changes. I think it is not necessary to consider the heading angle when judging whether it is the same cell, just check whether there is already a waypoint in the current grid in the 2D grid. What do you think?