I am having a path that is resulted from RRT-connect, then it is pruned using Ramer–Douglas–Peucker. Once we get the path with reduced waypoints we applied cubic B-spline that is a built-in MATLAB function [pathSmooth, qd, qdd, pp] = bsplinepolytraj(cpts,tpts,tvec);
The smoothed path we check wherether it is a collisiono-free or not using the function [cc, iwant, computationTime3] = collisionChecking(map, pathSmooth);
Once collsision is detected, we need to to refine the collide path. The refinment function is [pathReducedRefined] = reformCollideSegment(iwant, pathReduced);, and the process will continue while iwant is not empty. The program could not produced a path that is collision-free and goes for infinity.
The issue is: refinment cannot achieved due to some reasons which are not clear to me. Can anyone suggest something to tackl such issue
I have attached the following:
- Initial path before prunning name as
- Prunned path named as 'pathReduced.mat'
- Smoothed path (that is colliding) named as 'smoothedPath.mat'
- the map that we are working with name as 'environmentMatrix.mat'
The cod that we used asf follow:
pathReduced = reducepoly(path,tolerance);
[row, column] = size(pathReduced);
[pathSmooth, pathLengthS, qd, qdd, pp] = BSpline(cpts);
[cc, iwant, computationTime3] = collisionChecking(map, pathSmooth);
[pathReducedRefined] = reformCollideSegment(iwant, pathReduced);
pathReduced = pathReducedRefined;
[pathSmooth, ComputationTime2, pathLengthS] = BSpline(cpts);
[cc, iwant, computationTime3] = collisionChecking(map, pathSmooth);
function [cc, iwant, Time, collideIndices] = collisionChecking(map, pathSmooth)
collideIndices = zeros([]);
if env(round(v(ii,1)), round(v(ii,2)))
iwant(count,:) = [round(v(ii,2)), round(v(ii,1))];
collideIndices(count) = ii;