Skip to content

Commit

Permalink
Updated with upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Dec 18, 2023
1 parent e2b70a6 commit 2f365ab
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 134 deletions.
3 changes: 2 additions & 1 deletion rtabmap_slam/src/CoreWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <rtabmap/core/DBDriver.h>
#include <rtabmap/core/Registration.h>
#include <rtabmap/core/Graph.h>
#include <rtabmap/core/LocalGridMaker.h>
#include <rtabmap/core/Optimizer.h>

#ifdef WITH_OCTOMAP_MSGS
Expand Down Expand Up @@ -2118,7 +2119,7 @@ void CoreWrapper::process(
rtabmap_.getMemory()->getLastSignatureId() != filteredPoses.rbegin()->first ||
rtabmap_.getMemory()->getLastWorkingSignature() == 0 ||
rtabmap_.getMemory()->getLastWorkingSignature()->sensorData().gridCellSize() == 0 ||
(!mapsManager_.getOccupancyGrid()->isGridFromDepth() && data.laserScanRaw().is2d())) // 2d laser scan would fill empty space for latest data
(!mapsManager_.getLocalMapMaker()->isGridFromDepth() && data.laserScanRaw().is2d())) // 2d laser scan would fill empty space for latest data
{
SensorData tmpData = data;
tmpData.setId(0);
Expand Down
9 changes: 5 additions & 4 deletions rtabmap_util/include/rtabmap_util/MapsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <rtabmap/core/Signature.h>
#include <rtabmap/core/Parameters.h>
#include <rtabmap/core/FlannIndex.h>
#include <rtabmap/core/LocalGrid.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <rclcpp/rclcpp.hpp>
Expand All @@ -47,6 +48,7 @@ namespace rtabmap {
class OctoMap;
class Memory;
class OccupancyGrid;
class LocalGridMaker;

} // namespace rtabmap

Expand Down Expand Up @@ -94,6 +96,7 @@ class MapsManager {
const rtabmap::OctoMap * getOctomap() const {return octomap_;}
#endif
const rtabmap::OccupancyGrid * getOccupancyGrid() const {return occupancyGrid_;}
const rtabmap::LocalGridMaker * getLocalMapMaker() const {return localMapMaker_;}

private:
// mapping stuff
Expand Down Expand Up @@ -133,12 +136,10 @@ class MapsManager {
std::map<int, pcl::PointCloud<pcl::PointXYZRGB>::Ptr > groundClouds_;
std::map<int, pcl::PointCloud<pcl::PointXYZRGB>::Ptr > obstacleClouds_;

std::map<int, rtabmap::Transform> gridPoses_;
cv::Mat gridMap_;
std::map<int, std::pair< std::pair<cv::Mat, cv::Mat>, cv::Mat> > gridMaps_; // < <ground, obstacles>, empty cells >
std::map<int, cv::Point3f> gridMapsViewpoints_;
rtabmap::LocalGridCache localMaps_;

rtabmap::OccupancyGrid * occupancyGrid_;
rtabmap::LocalGridMaker * localMapMaker_;
bool gridUpdated_;

#ifdef RTABMAP_OCTOMAP
Expand Down
4 changes: 2 additions & 2 deletions rtabmap_util/include/rtabmap_util/obstacles_detection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <sensor_msgs/msg/point_cloud2.hpp>

#include <rtabmap/core/OccupancyGrid.h>
#include <rtabmap/core/LocalGridMaker.h>

namespace rtabmap_util
{
Expand All @@ -53,7 +53,7 @@ class ObstaclesDetection : public rclcpp::Node
std::string mapFrameId_;
double waitForTransform_;

rtabmap::OccupancyGrid grid_;
rtabmap::LocalGridMaker localMapMaker_;
bool mapFrameProjection_;
bool warned_;

Expand Down
Loading

0 comments on commit 2f365ab

Please sign in to comment.