0
$\begingroup$

colleagues, i am currently viewing Cyrill Stachniss's course on SLAM and also doing the exercises. At the moment i am doing an exercise on occupancy grid mapping and there is some strange offset variable in the code and i don't know what is the purpose of it

Here is the code related to it

border = 30;
robXMin = min(poses(:,1));
robXMax = max(poses(:,1));
robYMin = min(poses(:,2));
robYMax = max(poses(:,2));
mapBox = [robXMin-border robXMax+border robYMin-border robYMax+border];
offsetX = mapBox(1);
offsetY = mapBox(3);
mapSizeMeters = [mapBox(2)-offsetX mapBox(4)-offsetY];
mapSize = ceil([mapSizeMeters/gridSize]);

This offset is then used to convert world coordinates into map coordinates

pntsMap = floor((pntsWorld - repmat(offset,1,size(pntsWorld,2)))./gridSize)
$\endgroup$
2
  • 1
    $\begingroup$ I believe we may need some more detail in order to be able to answer this question. Can you provide more input in terms of the source of border, poses, and what you are trying to accomplish here? $\endgroup$
    – mjcarroll
    Dec 15, 2021 at 15:27
  • $\begingroup$ This is the task of mapping with known poses. I have data with laser beams(angles and distance) to build the map. poses - robot poses in 2d (x,y,theta). About border i do not have any additional information. $\endgroup$
    – Ramil
    Dec 16, 2021 at 6:19

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.