How to locate a collide segment of a post-smoothed path?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
YAAQOB AL-JAMALI
el 9 de Jun. de 2022
Comentada: YAAQOB AL-JAMALI
el 9 de Jun. de 2022
I am working on motion planning problem, and so fare i have generated irregular path and then prun it using Ramer–Douglas–Peucker algorithm later by utilizing piecewise cubic B-spline we could produce smoothed path. However, collision-freeness is not quarantee so that I am trying to check for a collision condition for a post-smoothed path. I have mangage to identify if there is a collision using the following code:
env = map;
% J = im2uint8( map );
% env = imnoise( J ,'salt & pepper');
v = pathSmooth;
for ii = 1:length(v)-1
if env(round(v(ii,1)), round(v(ii,2))) ~= 0
disp('There is no intersection')
else
disp('There is intersection')
pause;
end
end
My question, how to locate the first and last locations where the collision are detected based on the ii index and return them?
I have attached mat files for the used map as well as the resulted smoothed path for your reference as well as an image for the map, reduced path, and smoothed path.
0 comentarios
Respuesta aceptada
KSSV
el 9 de Jun. de 2022
env = map;
% J = im2uint8( map );
% env = imnoise( J ,'salt & pepper');
v = pathSmooth;
iwant = zeros([],2) ;
count = 0 ;
for ii = 1:length(v)-1
if env(round(v(ii,1)), round(v(ii,2))) ~= 0
disp('There is no intersection')
else
count = count+1 ;
iwant(count,:) = [round(v(ii,1)), round(v(ii,2))] ;
disp('There is intersection')
end
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Interpolation of 2-D Selections in 3-D Grids en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!