mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Merge branch 'master' of github.com:introlab/rtabmap_ros into ros2
This commit is contained in:
@@ -29,7 +29,7 @@ find_package(tf2 REQUIRED)
|
|||||||
find_package(tf2_eigen REQUIRED)
|
find_package(tf2_eigen REQUIRED)
|
||||||
find_package(tf2_geometry_msgs REQUIRED)
|
find_package(tf2_geometry_msgs REQUIRED)
|
||||||
|
|
||||||
find_package(RTABMap 0.22.0 REQUIRED)
|
find_package(RTABMap 0.23.4 REQUIRED)
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
|
|||||||
@@ -999,19 +999,28 @@ CoreWrapper::~CoreWrapper()
|
|||||||
this->saveParameters(configPath_);
|
this->saveParameters(configPath_);
|
||||||
|
|
||||||
printf("rtabmap: Saving database/long-term memory... (located at %s)\n", databasePath_.c_str());
|
printf("rtabmap: Saving database/long-term memory... (located at %s)\n", databasePath_.c_str());
|
||||||
|
bool saveDatabase = true;
|
||||||
if(rtabmap_.getMemory())
|
if(rtabmap_.getMemory())
|
||||||
{
|
{
|
||||||
// save the grid map
|
if(!rtabmap_.getMemory()->isReadOnly())
|
||||||
float xMin=0.0f, yMin=0.0f, gridCellSize = 0.05f;
|
|
||||||
cv::Mat pixels = mapsManager_.getGridMap(xMin, yMin, gridCellSize);
|
|
||||||
if(!pixels.empty())
|
|
||||||
{
|
{
|
||||||
printf("rtabmap: 2D occupancy grid map saved.\n");
|
// save the grid map
|
||||||
rtabmap_.getMemory()->save2DMap(pixels, xMin, yMin, gridCellSize);
|
float xMin=0.0f, yMin=0.0f, gridCellSize = 0.05f;
|
||||||
|
cv::Mat pixels = mapsManager_.getGridMap(xMin, yMin, gridCellSize);
|
||||||
|
if(!pixels.empty())
|
||||||
|
{
|
||||||
|
printf("rtabmap: 2D occupancy grid map saved.\n");
|
||||||
|
rtabmap_.getMemory()->save2DMap(pixels, xMin, yMin, gridCellSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("rtabmap: Database is read-only, the current state of the memory is not saved.\n");
|
||||||
|
saveDatabase = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rtabmap_.close();
|
rtabmap_.close(saveDatabase);
|
||||||
printf("rtabmap: Saving database/long-term memory...done! (located at %s, %ld MB)\n", databasePath_.c_str(), UFile::length(databasePath_)/(1024*1024));
|
printf("rtabmap: Saving database/long-term memory...done! (located at %s, %ld MB)\n", databasePath_.c_str(), UFile::length(databasePath_)/(1024*1024));
|
||||||
|
|
||||||
delete interOdomSync_;
|
delete interOdomSync_;
|
||||||
|
|||||||
Reference in New Issue
Block a user