PathPlanning
PathPlanning copied to clipboard
There is some problem in LPAstar
In some case, there would be no path extrated right!
especially after adding a lot of obstacles
Thanks for your feedback! We will check it later.
I also find this problem. For example, when program started, after adding obstacke (35, 17) and (36, 16), no path extrated right.
I think the key problem is precision of float in function CalculateKey and TopKey.
I changed line 136 like this
s = min(self.U, key=lambda k: tuple(map(lambda x: round(x, 2), self.U[k])))
and line 142&143 like this
return [round(x, 2) for x in [min(self.g[s], self.rhs[s]) + self.h(s), min(self.g[s], self.rhs[s])]]
the path showed.
Besides
- Line 68, we should also UpdateVertex(Obs) when add obstacles ?
- We should not use manhattan heuristic in a 8-neighborhood map ?