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

A minor error in smoother.cpp isCusp function? #58

Open JaimeParker opened 1 year ago

JaimeParker commented 1 year ago
inline bool isCusp(const std::vector<Node3D>& path, int i) {
    // the author 
    bool revim2 = path[i - 2].getPrim() > 3 ;
    bool revim1 = path[i - 1].getPrim() > 3 ;
    bool revi   = path[i].getPrim() > 3 ;
    bool revip1 = path[i + 1].getPrim() > 3 ;
    //  bool revip2 = path[i + 2].getPrim() > 3 ;

    return (revim2 != revim1 || revim1 != revi || revi != revip1);
}

considering change >3 to >=3 to refer a reverse motion, which is called a cusp point?