ai-winter / ros_motion_planning

Motion planning and Navigation of AGV/AMR:ROS planner plugin implementation of A*, JPS, D*, LPA*, D* Lite, Theta*, RRT, RRT*, RRT-Connect, Informed RRT*, ACO, PSO, Voronoi, PID, LQR, MPC, DWA, APF, Pure Pursuit etc.
GNU General Public License v3.0
2.3k stars 348 forks source link

informed rrt算法中的c_best的bug问题 #73

Closed Ceg411 closed 6 months ago

Ceg411 commented 7 months ago

在测试informed rrt*算法时,我想得到找到的路径长度,应该在路径更新的时候直接输出c_best的值就可以,但是通过测试发现c_best的值要比它发布的路径长度要大。在路径更新时,除了更新 c_best,我添加了根据path计算路径长度的代码,正常情况下,打印出来的 c_best和t_length应该是一样的,但结果却是前面几次打印出来的两个数值大小不一样,后面几次又都一样了。

  1. 代码部分

1

2.结果输出 2

realhonbo commented 6 months ago

look at your loop for caculating t_length, the ending i will be path.size()-1, path[i+1] is out of range