ros-planning / navigation

ROS Navigation stack. Code for finding where the robot is and how it can get somewhere else.
2.36k stars 1.8k forks source link

change cost-to-come in astar in global_planner #1090

Open ZJUTongYang opened 3 years ago

ZJUTongYang commented 3 years ago

My A* didn't run correctly, and I'm not sure whether I correctly understood the source code. My question is about the line 84-85 in [melodic]../globalplanner/src/astar.cpp. In my opinion, the variable potential stores only the movement cost from the starting point to the current point, while the chosen point to be expanded is the least-cost one of "movement cost + heuristic" from the `queue. So even if a point has potential< POTHIGH(and actually it is in thequeue), it might still be changed to a lower value (which is equivalent to "changing the parent node"). I didn't find such a piece of code that changes the cost of anIndexwhile it is in thequeue_`. Is there a problem? Thanks.

jkewang commented 3 years ago

It's weird!