Simulation Map Generator issues
조회 수: 6 (최근 30일)
이전 댓글 표시
Has anyone managed to successfully run the Simulation Map Generator app in the Mobile Robotics Training Toolbox? I loaded a png file (tried a jpg, that didn't work either), and the track size. When I select "Map Options/Line Follower", I get the error messages listed below in the main Matlab window. I get the same messages when I switch from Automatic to Manual Threshold mode.
Error using rgb2gray>parse_inputs (line 80)
MAP must be a m x 3 array.
Error in rgb2gray (line 52)
isRGB = parse_inputs(X);
Error in simMapGenerator/thresholdMap (line 47)
imgGray = rgb2gray(imgRaw);
Error in simMapGenerator/thresholdOptionsSelect (line 394)
app.thresholdMap;
Error using matlab.ui.control.internal.model.AbstractMutualExclusiveComponent/set.Value (line 166)
Error while evaluating ButtonGroup SelectionChangedFcn.
댓글 수: 2
Aman Gupta
2020년 6월 12일
Unable to resolve the name robotics.BinaryOccupancyGrid.
Error in simMapGenerator/exportMapSelect (line 233)
app.simMap = robotics.BinaryOccupancyGrid(compMap,app.scaleFactor);
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 382)
Error while evaluating Button PrivateButtonPushedFcn.
Aman Gupta
2020년 6월 12일
I am getting this error while exporting the map. Can anyone suggest what's wrong
채택된 답변
Sebastian Castro
2019년 9월 4일
The error you linked is a common one that happens when you input a grayscale (M x N) image instead of a color (M x N x 3) image.
Seems like the toolbox assumes all images passed in as color images and tries to use the rgb2gray function regardless of whether the image is already grayscale!
So you have 2 options:
- Short-term fix: Save your images as color images and try again
- Long-term fix: Add logic to the app to handle this.
To fix the code with the long-term fix, here are the steps:
- Open the app ( edit simMapGenerator.mlapp )
- Go to the "Code View" section
- In line 47, you will see the code imgGray = rgb2gray(imgRaw); Change it to this:
if size(imgRaw,3) == 1
imgGray = imgRaw;
else
imgGray = rgb2gray(imgRaw);
end
Hope that helps!
- Sebastian
댓글 수: 1
Mumal Sharma
2020년 3월 12일
Sir , I want to customise the map design in Multi Robot Obstacle Avidance Simulink project discussed by you . Can it be done using Simulation Map Geneartor App .
Kindly suggest and help in customising the Map Design .
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Robotics에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!