aislabunimi / ROSE2

Robust structure identification and room segmentation of cluttered indoor environments from occupancy grid maps
http://wiki.ros.org/rose2
GNU General Public License v3.0
16 stars 2 forks source link

Segment rooms incorrectly #3

Closed gaojunjie1999 closed 1 year ago

gaojunjie1999 commented 1 year ago

thank you for your work, I'm trying to build the layout using my input occupancy map. The extended lines and edges seem to be generated correctly. However, some rooms are left out in the outcome, and only half of some rectangle rooms are detected, which gives a result of triangle-shaped room outcome. Could you please tell me how I can correct this?

gaojunjie1999 commented 1 year ago

It seems that the second problem dues to jsk_recognition_msgs/polygon visualizattion

Nisici commented 1 year ago

Hello, as you pointed out correctly the second issue is due to jsk-rviz-plugins that fails to visualize some of the rooms as quadrilaterals and instead draws them as triangles. If you want to detect more rooms and also visualize them in jpg/pdf files you should go to the launch file and change the parameter _roomsvoronoi to True (or launch voronoi.launch). You will see the results in the folder src/rose_v2_repo/map_processing.

gaojunjie1999 commented 1 year ago

thanks, it works better with Voronoi. But the step to distinguish cells_out seem to eliminate more cells than expected, is this because I didn't extract the contour properly?

goldleaf3i commented 1 year ago

Hi, yes we use the contour to filter out cells that are outside of the map. if you share the results in the map_processing folder we can have a further look about that

gaojunjie1999 commented 1 year ago

Thanks for your time, now I make sure the contour I use is the largest contour(in blue), but some rooms inside the contour seem to be eliminated. And some room outside the contour is kept as the outcome (like the pink one on the top right) Screenshot from 2023-08-03 21-04-39

gaojunjie1999 commented 1 year ago

I tried to run with voronoi, and the result looks like this, is this still because I was using the wrong contour? 8b_rooms_th1_on_map

Nisici commented 1 year ago

First you should look at the file _8b_rooms_th1_on_mappost for a better visualization. The problem could be that the method is not considering enough lines and therefore it can't detect some rooms. You could try changing the spatialClusteringLineSegmentsThreshold parameter in the launch file. Also if you send me the image of the occupancygrid I can try to solve the problem.

goldleaf3i commented 1 year ago

are you sure about the scale of the map? the grid on the top right of the first image seems very tiny, is it possible that you are plotting this environment in a 2x or 3x scale wrt its original size?

gaojunjie1999 commented 1 year ago

thanks, there existed an offset between the real contour and the contour I used, and I changed the param in the launch file and it did work better.