Shorten path error in Train Deep Learning-Based Sampler for Motion Planning

조회 수: 3 (최근 30일)
Choonghan
Choonghan 2025년 3월 19일
답변: Ajay Pattassery 2025년 3월 19일
Dear MATLAB users
I am using function 'exampleHelperGenerateMazeDataset in Train Deep Learning-Based Sampler for Motion Planning tutorial in Navigation Ttoolbox.
The problem is the function is stopped with the errors below.
I never finished making dataset because of the error
------------------------------------------------------------------------------------------------------------------------------------------------------------
Error using nav.algs.internal.ShortenpathImpl/shorten (line 63)
Unable to shorten the path. Either a path does not exist between two states, or motion constraints prevent a viable path.
Error in shortenpath (line 30)
shortPath = shorten(obj);
Error in exampleHelperGenerateMazeDataset_250319 (line 43)
parfor j=1:numPathsPerMap
--------------------------------------------------------------------------------------------------------------------------------------------------------------
I think the problem is happened while the shortening path from RRT* argorithm.
How can I solve the problem?

답변 (1개)

Ajay Pattassery
Ajay Pattassery 2025년 3월 19일
shortenpath is erroring out since the input path that is fed to shortenpath is not collision free when check with stateValidator. The following check can be added to exampleHelperGenerateMazeDataset to shorten only the paths that are valid.
% pathObj path to be shortened
% stateValidator validator used to check whether path is valid or not
isPathValid = true;
for i=1:pathObj.NumStates-1
isvalid = stateValidator.isMotionValid(pathObj.States(i,:), pathObj.States(i+1,:));
if ~isvalid
isPathValid = false;
break;
end
end
if isPathValid
shortenedPath = shortenpath(pathObj, stateValidator);
end

카테고리

Help CenterFile Exchange에서 Motion Planning에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by