ros-pkg: added minimum grid map size parameters ("occupancy_map_size" for map_assembler and "map_size" for grid_map_assembler)

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/ros-pkg@1963 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2014-11-03 21:44:48 +00:00
parent 29e6e2805a
commit 9e522fbd5c
2 changed files with 11 additions and 4 deletions
+7 -3
View File
@@ -44,18 +44,21 @@ class GridMapAssembler
public:
GridMapAssembler() :
gridCellSize_(0.05),
gridCellSize_(0.05), // meters
mapSize_(0), // meters
gridUnknownSpaceFilled_(true),
filterRadius_(0.5),
filterAngle_(30.0) // degrees
{
ros::NodeHandle pnh("~");
pnh.param("cell_size", gridCellSize_, gridCellSize_);
pnh.param("cell_size", gridCellSize_, gridCellSize_); // m
pnh.param("map_size", mapSize_, mapSize_); // m
pnh.param("unknown_space_filled", gridUnknownSpaceFilled_, gridUnknownSpaceFilled_);
pnh.param("filter_radius", filterRadius_, filterRadius_);
pnh.param("filter_angle", filterAngle_, filterAngle_);
UASSERT(gridCellSize_ > 0.0);
UASSERT(mapSize_ >= 0.0);
ros::NodeHandle nh;
mapDataTopic_ = nh.subscribe("mapData", 1, &GridMapAssembler::mapDataReceivedCallback, this);
@@ -97,7 +100,7 @@ public:
{
// create the map
float xMin=0.0f, yMin=0.0f;
cv::Mat pixels = util3d::create2DMap(poses, scans_, gridCellSize_, gridUnknownSpaceFilled_, xMin, yMin);
cv::Mat pixels = util3d::create2DMap(poses, scans_, gridCellSize_, gridUnknownSpaceFilled_, xMin, yMin, mapSize_);
if(!pixels.empty())
{
@@ -147,6 +150,7 @@ public:
private:
double gridCellSize_;
double mapSize_;
bool gridUnknownSpaceFilled_;
double filterRadius_;
double filterAngle_;