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

3 visualizzazioni (ultimi 30 giorni)
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?

Risposte (1)

Ajay Pattassery
Ajay Pattassery il 19 Mar 2025
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

Community Treasure Hunt

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

Start Hunting!

Translated by