关于RRT*算法中function feasible = feasiblePoint(point,map)的错误
Opened this issue · 0 comments
jetTian commented
在RRTStar算法实现中,更改为640*480的图像后,在collisionChecking.m中报告错误:
位置 1 处的索引超出数组边界(不能超出 480)。
出错 collisionChecking>feasiblePoint (line 26)
&& point(2)<=size(map,2) && map(point(2),point(1))==1)
出错 collisionChecking (line 17)
if ~feasiblePoint([floor(goalPose(1)),ceil(goalPose(2))],map)
出错 RRTstar (line 67)
if ~collisionChecking(x_near,x_new,Imp)
Debug发现将下列
function feasible = feasiblePoint(point,map) feasible = true; if ~(point(1)>=1 && point(1)<=size(map,1) && point(2)>=1 ... && point(2)<=size(map,2) && map(point(2),point(1))==255) feasible = false; %有障碍 end
更改为
function feasible = feasiblePoint(point,map) feasible = true; if ~(point(1)>=1 && point(1)<=size(map,2) && point(2)>=1 ... && point(2)<=size(map,1) && map(point(2),point(1))==255) feasible = false; %有障碍 end
因为在point(1)对应x坐标,map(2)对应图像地图的x坐标,源文件由于地图分辨率为800*800,所以未产生错误。