Merge two or more occupancy maps

조회 수: 9 (최근 30일)
Akshay Hiregoudar
Akshay Hiregoudar 2020년 7월 4일
편집: Cameron Stabile 2021년 10월 29일
Hi,
I am trying to build an occupancy map of an environment using MATLAB's Navigation and ROS toolbox along with Gazebo. I have three TurtleBot3 ground robots in three different rooms of the Gazebo environment and I am navigationg them to get the lidar scan data. Now, I would like to build a single map of the environment.
What would be an ideal way to merge all the three occupancy maps into a single map/figure?
  댓글 수: 1
Bram Surewaard
Bram Surewaard 2021년 4월 30일
Hey,
For a project I would like to achieve the same as you mentioned.
Did you manage to figure out how to do this?
Thanks!

댓글을 달려면 로그인하십시오.

답변 (2개)

Remo Pillat
Remo Pillat 2021년 5월 10일
Hi Akshay & Bram,
If you know the exact poses of the 3 different TurtleBots, you can call the insertRay function on a single occupancyMap (call function for each lidar reading and input pose of respective robot).
A simple example of this "mapping with known poses" problem is shown in this example (this is for a single lidar).
How are you currently building the map? I might be able to give additional suggestions based on the functionality you are currently using.
Thanks, Remo

Sooraj Sunil
Sooraj Sunil 2021년 10월 17일
편집: Sooraj Sunil 2021년 10월 18일
Hi Akshay & Bram,
If the initial alignment between the robots are known then the merging is very simple:
  • You can use insertRay as Remo suggested
  • Or alternatively you can get the probability matrix of the individual maps using occupancyMatrix Matlab function then, you can go from probability to the log-odd space and then simply add the probabilities to merge them. Finally to reconstruct the occupancy map based on the new probabilities ( convert log-odd to probability) and with the known resolution use occupancyMap function.
However, if don't know the inital alignment you should employ a merging technique to compute the alignment. I wouldn't recommend multirobot_map_merge but if you want a quick solution you can have a look at it. It can be easily implemented in Matlab using this Matlab example.
  댓글 수: 1
Cameron Stabile
Cameron Stabile 2021년 10월 29일
편집: Cameron Stabile 2021년 10월 29일
Hi Akshay, Bram
If each of your robots is building up their own map in isolation and you want to use the maps to update the combined map (rather than inserting rays from different sensors), here are some additional alternatives:
1) Update subregions of a world-map using the block-syntax of updateOccupancy. With this, you can probabilistically integrate readings from each of your local maps into the corresponding region of your world map:
worldMap = occupancyMap(repmat(0.75,50,60));
localMap_1 = occupancyMap(rand(20)/2);
localMap_2 = occupancyMap(eye(20)/2+.25);
origin_1 = [0 0];
origin_2 = [0 30];
localMap_1.GridLocationInWorld = origin_1;
localMap_2.GridLocationInWorld = origin_2;
worldMap.updateOccupancy(origin_1, getOccupancy(localMap_1));
worldMap.updateOccupancy(origin_2, getOccupancy(localMap_2));
show(worldMap);
2) Another alternative is the syncWith method, which will overwrite the values of the first map with values of the second map in any overlapping region:
localMap_1.GridLocationInWorld(1) = 20
localMap_2.GridLocationInWorld(1) = 20;
worldMap.syncWith(localMap_1);
worldMap.syncWith(localMap_2);
show(worldMap);
Note that syncWith method is similar to directly getting/setting values:
localMap_1.GridLocationInWorld(1) = 40
localMap_2.GridLocationInWorld(1) = 40;
worldMap.setOccupancy(localMap_1.GridLocationInWorld,getOccupancy(localMap_1));
worldMap.setOccupancy(localMap_2.GridLocationInWorld,getOccupancy(localMap_2));
show(worldMap);
but it also handle maps with mismatched resolutions and/or translation offsets between map grids.
Hope this helps,
Cameron

댓글을 달려면 로그인하십시오.

카테고리

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

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by