mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-12 20:49:50 +08:00
Adding documentation
This commit is contained in:
@@ -73,7 +73,8 @@ public:
|
|||||||
maxFloorHeight_(-1),
|
maxFloorHeight_(-1),
|
||||||
maxObstaclesHeight_(1.5),
|
maxObstaclesHeight_(1.5),
|
||||||
waitForTransform_(false),
|
waitForTransform_(false),
|
||||||
simpleSegmentation_(false)
|
simpleSegmentation_(false),
|
||||||
|
optimizeForCloseObject_(true)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
virtual ~ObstaclesDetection()
|
virtual ~ObstaclesDetection()
|
||||||
@@ -95,6 +96,7 @@ private:
|
|||||||
pnh.param("max_floor_height", maxFloorHeight_, maxFloorHeight_);
|
pnh.param("max_floor_height", maxFloorHeight_, maxFloorHeight_);
|
||||||
pnh.param("wait_for_transform", waitForTransform_, waitForTransform_);
|
pnh.param("wait_for_transform", waitForTransform_, waitForTransform_);
|
||||||
pnh.param("simple_segmentation", simpleSegmentation_, simpleSegmentation_);
|
pnh.param("simple_segmentation", simpleSegmentation_, simpleSegmentation_);
|
||||||
|
pnh.param("optimize_for_close_object", optimizeForCloseObject_, optimizeForCloseObject_);
|
||||||
|
|
||||||
cloudSub_ = nh.subscribe("cloud", 1, &ObstaclesDetection::callback, this);
|
cloudSub_ = nh.subscribe("cloud", 1, &ObstaclesDetection::callback, this);
|
||||||
|
|
||||||
@@ -181,9 +183,7 @@ private:
|
|||||||
|
|
||||||
ros::Time lasttime = ros::Time::now();
|
ros::Time lasttime = ros::Time::now();
|
||||||
|
|
||||||
|
if (!simpleSegmentation_ && !optimizeForCloseObject_){
|
||||||
/*
|
|
||||||
if (!simpleSegmentation_){
|
|
||||||
|
|
||||||
originalCloud = rtabmap::util3d::transformPointCloud(originalCloud, localTransform);
|
originalCloud = rtabmap::util3d::transformPointCloud(originalCloud, localTransform);
|
||||||
hypotheticalGroundCloud = rtabmap::util3d::passThrough(originalCloud, "z", std::numeric_limits<int>::min(), maxFloorHeight_);
|
hypotheticalGroundCloud = rtabmap::util3d::passThrough(originalCloud, "z", std::numeric_limits<int>::min(), maxFloorHeight_);
|
||||||
@@ -205,8 +205,16 @@ private:
|
|||||||
*obstaclesCloud += *obstaclesNearFloorCloud;
|
*obstaclesCloud += *obstaclesNearFloorCloud;
|
||||||
}
|
}
|
||||||
|
|
||||||
}*/
|
}
|
||||||
if (!simpleSegmentation_){
|
if (!simpleSegmentation_ && optimizeForCloseObject_){
|
||||||
|
// If the option optimize for close object has been set to true,
|
||||||
|
// we divide the floor point cloud into two subsections, one for all potential floor points up to 1m
|
||||||
|
// one for potential floor points further away than 1m.
|
||||||
|
// For the points at closer range, we use a smaller normal estimation radius and ground normal angle,
|
||||||
|
// which allows to detect smaller objects, without increasing the number of false positive.
|
||||||
|
// For all other points, we use a biger normal estimation radius (* 3.) and a bigger tolerance for the
|
||||||
|
// grond normal angle (* 2.).
|
||||||
|
|
||||||
|
|
||||||
originalCloud = rtabmap::util3d::transformPointCloud(originalCloud, localTransform);
|
originalCloud = rtabmap::util3d::transformPointCloud(originalCloud, localTransform);
|
||||||
pcl::PointCloud<pcl::PointXYZ>::Ptr originalCloud_front = rtabmap::util3d::passThrough(originalCloud, "x", std::numeric_limits<int>::min(), 1.);
|
pcl::PointCloud<pcl::PointXYZ>::Ptr originalCloud_front = rtabmap::util3d::passThrough(originalCloud, "x", std::numeric_limits<int>::min(), 1.);
|
||||||
@@ -306,6 +314,7 @@ private:
|
|||||||
double maxFloorHeight_;
|
double maxFloorHeight_;
|
||||||
bool waitForTransform_;
|
bool waitForTransform_;
|
||||||
bool simpleSegmentation_;
|
bool simpleSegmentation_;
|
||||||
|
bool optimizeForCloseObject_;
|
||||||
|
|
||||||
tf::TransformListener tfListener_;
|
tf::TransformListener tfListener_;
|
||||||
|
|
||||||
|
|||||||
@@ -168,9 +168,8 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (special_filter_close_object_){
|
if (special_filter_close_object_){
|
||||||
cv::Mat pRoi = image(cv::Rect(int(0.05*(float(cols))),int(0.05*(float(rows))),int(0.9*(float(cols))),int(0.9*float(rows))));
|
//cv::Mat pRoi = image(cv::Rect(int(0.05*(float(cols))),int(0.05*(float(rows))),int(0.9*(float(cols))),int(0.9*float(rows))));
|
||||||
//cv::GaussianBlur(pRoi, pRoi, cv::Size(3, 3), 0, 0);
|
//cv::medianBlur(pRoi, pRoi, 3);
|
||||||
cv::medianBlur(pRoi, pRoi, 3);
|
|
||||||
|
|
||||||
//Do filter of close objects
|
//Do filter of close objects
|
||||||
pRoi = image(cv::Rect(int(cols/10),int(0.8*(float(rows))),int(0.8*(float(cols))),int(0.15*float(rows))));
|
pRoi = image(cv::Rect(int(cols/10),int(0.8*(float(rows))),int(0.8*(float(cols))),int(0.15*float(rows))));
|
||||||
@@ -187,9 +186,6 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
image_geometry::PinholeCameraModel model;
|
image_geometry::PinholeCameraModel model;
|
||||||
model.fromCameraInfo(*cameraInfo);
|
model.fromCameraInfo(*cameraInfo);
|
||||||
float fx = model.fx();
|
float fx = model.fx();
|
||||||
|
|||||||
Reference in New Issue
Block a user