Shorten path error in Train Deep Learning-Based Sampler for Motion Planning
3 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Motion Planning 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!