필터 지우기
필터 지우기

Robot Mapping and Navigation in MATLAB

조회 수: 18 (최근 30일)
Jasraj Soni
Jasraj Soni 2020년 3월 12일
답변: kalpesh 2023년 3월 29일
Hi,
I am trying to create 'robot mapping with known poses' algorithm using lidar sensor.
For reference I am following the code given on this link: https://in.mathworks.com/help/robotics/examples/mapping-with-known-poses.html
Under the section: Update map by taking sensor measurements, is where the lidar part comes in. As I am currently not aware of how to use the lidar function to scan the map, can someone guide me with this?
Huge thanks for taking time to help me with the problem.

답변 (3개)

Joseph
Joseph 2020년 3월 28일
Hi Jasraj,
You need to clarify your question a bit more.
In the beginning, we can see that sensor was defined:
sensor = rangeSensor;
sensor.Range = [0,10];
and then we called the function exampleHelperDiffDriveCtrl:
exampleHelperDiffDriveCtrl(diffDrive,controller,initPose,goal,refMap,map,refFigure,mapFigure,sensor)
If you look at the function itself, then you can see that the inputs are:
function exampleHelperDiffDriveControl(diffDrive,ppControl,initPose,goal,map1,map2,fig1,fig2,lidar)
so here, essentially rangeSensor/sensor was passed as lidar. And then if you follow along you'll see that:
[ranges, angles] = lidar(position, map1);
scan = lidarScan(ranges,angles);
If you want to learn more then look into what does lidarScan do with the outputs of lidar in the documentation here. Playing with the examples by changing parameters and reading the documentation should serve you well.

Chris
Chris 2020년 6월 9일
편집: Chris 2020년 6월 9일
Hey,
you have to use the lidarScan function to create the input data for the SLAM algorithm.
With start I defined the start value, it's 1. With the steps value I defined the final index of measurement data.
For example if i want to have 230 samples in 1 scan: start=1, steps=230.
Hope the answer is not too late and it still can help you.
if(ii==steps)
scan{1,i}=lidarScan(distancearray(start:steps,1),angleradarray(start:steps,1));
[isScanAccepted, loopClosureInfo, optimizationInfo] = addScan(slamAlg, scan{i});
if ~isScanAccepted
continue;
end

kalpesh
kalpesh 2023년 3월 29일
if(ii==steps)
scan{1,i}=lidarScan(distancearray(start:steps,1),angleradarray(start:steps,1));
[isScanAccepted, loopClosureInfo, optimizationInfo] = addScan(slamAlg, scan{i});
if ~isScanAccepted
continue;
end

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by