mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-09 13:00:19 +08:00
GridMap integration (#1180)
* GridMap integration * Removed GridGlobal/FullUpdate parameter. Bump version 0.21.3. Mvoed specialized global map classes under global_map sub dir. Renamed Map -> GlobalMap. * UI: Added elevation map visualization * Added LocalGridCache class to share cache between global maps * Fixed OctoMap nans. DbViewer: Added frontiers visualization. * convenient functions for ros * Small fix * fixed build without GridMap * CI disabled fail-fast * CI updated checkout action to v4
This commit is contained in:
@@ -28,7 +28,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <rtabmap/core/DBDriver.h>
|
||||
#include <rtabmap/core/Rtabmap.h>
|
||||
#include <rtabmap/core/Memory.h>
|
||||
#include <rtabmap/core/OccupancyGrid.h>
|
||||
#include <rtabmap/core/global_map/OccupancyGrid.h>
|
||||
#include <rtabmap/core/util3d.h>
|
||||
#include <rtabmap/core/util3d_filtering.h>
|
||||
#include <rtabmap/core/util3d_transforms.h>
|
||||
@@ -244,14 +244,14 @@ int main(int argc, char * argv[])
|
||||
else if(detected > 0 && haveOptimizedMap)
|
||||
{
|
||||
printf("The database has a global occupancy grid, regenerating one with new optimized graph!\n");
|
||||
OccupancyGrid grid(parameters);
|
||||
LocalGridCache cache;
|
||||
OccupancyGrid grid(&cache, parameters);
|
||||
std::map<int, Transform> optimizedPoses = rtabmap.getLocalOptimizedPoses();
|
||||
for(std::map<int, Transform>::iterator iter=optimizedPoses.lower_bound(0); iter!=optimizedPoses.end(); ++iter)
|
||||
{
|
||||
cv::Mat occupancyGrid;
|
||||
SensorData data = rtabmap.getMemory()->getNodeData(iter->first, false, false, false, true);
|
||||
data.uncompressData();
|
||||
grid.addToCache(iter->first, data.gridGroundCellsRaw(), data.gridObstacleCellsRaw(), data.gridEmptyCellsRaw());
|
||||
cache.add(iter->first, data.gridGroundCellsRaw(), data.gridObstacleCellsRaw(), data.gridEmptyCellsRaw(), data.gridCellSize(), data.gridViewPoint());
|
||||
}
|
||||
grid.update(optimizedPoses);
|
||||
cv::Mat map = grid.getMap(xMin, yMin);
|
||||
|
||||
Reference in New Issue
Block a user