MRPT  1.9.9
mrpt::pbmap::PbMapMaker Class Reference

Detailed Description

This class construct the PbMap extracting planar segments from Range images, which pose must be also provided. The range images and their poses are communicated with the object frameQueue. PbMapMaker run its own thread, which is created at initialization.

Definition at line 53 of file PbMapMaker.h.

#include <mrpt/pbmap/PbMapMaker.h>

Public Member Functions

 PbMapMaker (const std::string &config_file)
 
 ~PbMapMaker ()
 
PbMap getPbMap ()
 
void serializePbMap (std::string path)
 

Public Attributes

std::vector< frameRGBDandPoseframeQueue
 
std::set< unsigned > sQueueObservedPlanes
 
pcl::visualization::CloudViewer cloudViewer
 

Protected Member Functions

void viz_cb (pcl::visualization::PCLVisualizer &viz)
 
void run ()
 
bool stop_pbMapMaker ()
 

Protected Attributes

PbMap mPbMap
 
std::set< unsigned > observedPlanes
 
PlaneInferredInfompPlaneInferInfo
 
std::thread pbmaker_hd
 
bool m_pbmaker_must_stop
 
bool m_pbmaker_finished
 
float rejectAreaF
 
float acceptAreaF
 
float rejectAreaT
 
float acceptAreaT
 
float rejectElongF
 
float acceptElongF
 
float rejectElongT
 
float acceptElongT
 
float rejectC1C2C3_F
 
float acceptC1C2C3_F
 
float rejectC1C2C3_T
 
float acceptC1C2C3_T
 
float rejectNrgb_F
 
float acceptNrgb_F
 
float rejectNrgb_T
 
float acceptNrgb_T
 
float rejectIntensity_F
 
float acceptIntensity_F
 
float rejectIntensity_T
 
float acceptIntensity_T
 
float rejectColor_F
 
float acceptColor_F
 
float rejectColor_T
 
float acceptColor_T
 
float rejectHistH_F
 
float acceptHistH_F
 
float rejectHistH_T
 
float acceptHistH_T
 

Private Member Functions

void detectPlanesCloud (pcl::PointCloud< PointT >::Ptr &pointCloudPtr_arg, Eigen::Matrix4f &poseKF, double distThreshold, double angleThreshold, double minInliersF)
 
bool arePlanesNearby (Plane &plane1, Plane &plane2, const float distThreshold)
 
void checkProximity (Plane &plane, float proximity)
 
bool areSamePlane (Plane &plane1, Plane &plane2, const float &cosAngleThreshold, const float &distThreshold, const float &proxThreshold)
 
void mergePlanes (Plane &updatePlane, Plane &discardPlane)
 

Private Attributes

FILE * config_Param
 
PbMapLocalisermpPbMapLocaliser
 
SemanticClusteringclusterize
 
boost::mutex mtx_pbmap_busy
 

Constructor & Destructor Documentation

◆ PbMapMaker()

PbMapMaker::PbMapMaker ( const std::string config_file)

PbMapMaker's constructor sets some threshold for plane segmentation and map growing from a configuration file (or default). This constructor also starts PbMapMaker's own thread.

Definition at line 179 of file PbMapMaker.cpp.

References ASSERT_FILE_EXISTS_, clusterize, config_pbmap::config_localiser, configPbMap, config_pbmap::detect_loopClosure, config_pbmap::makeClusters, mPbMap, mpPbMapLocaliser, mpPlaneInferInfo, pbmaker_hd, readConfigFile(), and run().

Here is the call graph for this function:

◆ ~PbMapMaker()

PbMapMaker::~PbMapMaker ( )

PbMapMaker's destructor is used to save some debugging info to file.

Definition at line 1205 of file PbMapMaker.cpp.

References mpPbMapLocaliser, mpPlaneInferInfo, and stop_pbMapMaker().

Here is the call graph for this function:

Member Function Documentation

◆ arePlanesNearby()

bool PbMapMaker::arePlanesNearby ( Plane plane1,
Plane plane2,
const float  distThreshold 
)
private

Returns true when the closest distance between the patches "plane1" and "plane2" is under distThreshold.

Definition at line 200 of file PbMapMaker.cpp.

References mrpt::pbmap::diffPoints(), mrpt::pbmap::dist3D_Segment_to_Segment2(), mrpt::pbmap::getVector3fromPointXYZ(), mrpt::pbmap::isInHull(), mrpt::pbmap::Plane::polygonContourPtr, mrpt::pbmap::Plane::v3center, and mrpt::pbmap::Plane::v3normal.

Referenced by areSamePlane(), and checkProximity().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ areSamePlane()

bool PbMapMaker::areSamePlane ( Plane plane1,
Plane plane2,
const float &  cosAngleThreshold,
const float &  distThreshold,
const float &  proxThreshold 
)
private

Returns true if the two input planes represent the same physical surface for some given angle and distance thresholds. If the planes are the same they are merged in this and the function returns true. Otherwise it returns false.

Check if the the input plane is the same than this plane for some given angle and distance thresholds. If the planes are the same they are merged in this and the function returns true. Otherwise it returns false.

Definition at line 742 of file PbMapMaker.cpp.

References arePlanesNearby(), mrpt::pbmap::Plane::v3center, and mrpt::pbmap::Plane::v3normal.

Referenced by detectPlanesCloud().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkProximity()

void PbMapMaker::checkProximity ( Plane plane,
float  proximity 
)
private

Check for new graph connections of the input plane. These connections are stablished when the minimum distance between two patches is under the input threshold "proximity"

Definition at line 270 of file PbMapMaker.cpp.

References arePlanesNearby(), mrpt::pbmap::Plane::id, mPbMap, mrpt::pbmap::Plane::nearbyPlanes, and mrpt::pbmap::PbMap::vPlanes.

Referenced by detectPlanesCloud().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detectPlanesCloud()

void PbMapMaker::detectPlanesCloud ( pcl::PointCloud< PointT >::Ptr &  pointCloudPtr_arg,
Eigen::Matrix4f &  poseKF,
double  distThreshold,
double  angleThreshold,
double  minInliersF 
)
private

Find planar patches in the input organised point cloud "pointCloudPtr_arg", and update the PbMap with them (it update previous planes and initialize new ones when they are first observed), the input pose "poseInv" is used to place the current observations into a common frame of reference. Different thresholds are used to control the plane segmentation:

  • "distThreshold" defines the maximum distance of an inlier to the plane
  • "angleThreshold" defines the maximum angle between an inlier's normal and the plane's normal
  • "minInliersF" defines the minimum number of inliers as a fraction of the total number of points in the input cloud

Definition at line 290 of file PbMapMaker.cpp.

References mrpt::pbmap::Plane::areaHull, mrpt::pbmap::Plane::areaVoxels, areSamePlane(), mrpt::pbmap::Plane::calcConvexHull(), mrpt::pbmap::Plane::calcElongationAndPpalDir(), mrpt::pbmap::Plane::calcMainColor(), checkProximity(), clusterize, mrpt::pbmap::compose(), mrpt::pbmap::Plane::compute2DPolygonalArea(), mrpt::pbmap::Plane::computeMassCenterAndArea(), configPbMap, CS_visualize, mrpt::pbmap::SemanticClustering::currentSemanticGroup, config_pbmap::detect_loopClosure, mrpt::pbmap::PbMap::FloorPlane, mrpt::pbmap::PbMap::globalMapPtr, mrpt::pbmap::SemanticClustering::groups, mrpt::pbmap::Plane::id, config_pbmap::inferStructure, config_pbmap::makeClusters, config_pbmap::max_cos_normal, config_pbmap::max_dist_center_plane, mergePlanes(), mPbMap, mpPbMapLocaliser, mpPlaneInferInfo, mtx_pbmap_busy, observedPlanes, mrpt::pbmap::Plane::planePointCloudPtr, mrpt::pbmap::Plane::polygonContourPtr, config_pbmap::proximity_neighbor_planes, config_pbmap::proximity_threshold, mrpt::pbmap::PlaneInferredInfo::searchTheFloor(), mrpt::pbmap::Plane::v3center, mrpt::pbmap::Plane::v3colorNrgb, mrpt::pbmap::Plane::v3normal, mrpt::pbmap::PbMap::vPlanes, and mrpt::pbmap::PbMapLocaliser::vQueueObservedPlanes.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPbMap()

PbMap mrpt::pbmap::PbMapMaker::getPbMap ( )
inline

Get the PbMap.

Definition at line 65 of file PbMapMaker.h.

References mPbMap.

◆ mergePlanes()

void PbMapMaker::mergePlanes ( Plane updatePlane,
Plane discardPlane 
)
private

Merge the two input patches into "updatePlane". Recalculate center, normal vector, area, inlier points (filtered), convex hull, etc.

Definition at line 768 of file PbMapMaker.cpp.

References mrpt::pbmap::Plane::areaVoxels, mrpt::pbmap::Plane::calcConvexHull(), mrpt::pbmap::Plane::computeMassCenterAndArea(), mrpt::pbmap::Plane::forcePtsLayOnPlane(), mrpt::pbmap::PlaneInferredInfo::isFullExtent(), mpPlaneInferInfo, mrpt::math::norm(), mrpt::pbmap::Plane::planePointCloudPtr, mrpt::pbmap::Plane::polygonContourPtr, and mrpt::pbmap::Plane::v3normal.

Referenced by detectPlanesCloud().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

void PbMapMaker::run ( )
protected

This executes the PbMapMaker's thread

Definition at line 1140 of file PbMapMaker.cpp.

References config_pbmap::angle_threshold, cloudViewer, clusterize, configPbMap, detectPlanesCloud(), config_pbmap::dist_threshold, mrpt::pbmap::SemanticClustering::evalPartition(), frameQueue, keyboardEventOccurred(), m_pbmaker_finished, m_pbmaker_must_stop, config_pbmap::makeClusters, config_pbmap::minInliersRate, mPbMap, observedPlanes, viz_cb(), and mrpt::pbmap::PbMap::vPlanes.

Referenced by PbMapMaker().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ serializePbMap()

void PbMapMaker::serializePbMap ( std::string  path)

Serialize the PbMap.

Definition at line 1185 of file PbMapMaker.cpp.

References mPbMap, mtx_pbmap_busy, and mrpt::pbmap::PbMap::savePbMap().

Here is the call graph for this function:

◆ stop_pbMapMaker()

bool PbMapMaker::stop_pbMapMaker ( )
protected

PbMapMaker's exit thread

Definition at line 1194 of file PbMapMaker.cpp.

References m_pbmaker_finished, m_pbmaker_must_stop, and pbmaker_hd.

Referenced by ~PbMapMaker().

Here is the caller graph for this function:

◆ viz_cb()

void PbMapMaker::viz_cb ( pcl::visualization::PCLVisualizer &  viz)
protected

PCL visualizer callback

pcl::visualization::PointCloudColorHandlerCustom PointT> color (plane_i.planePointCloudPtr, red[plane_i.semanticGroup%10], grn[plane_i.semanticGroup%10], blu[plane_i.semanticGroup%10]);

Definition at line 818 of file PbMapMaker.cpp.

References ablu, agrn, mrpt::pbmap::PbMapLocaliser::alignedModelPtr, ared, blu, CS_visualize, mrpt::pbmap::Plane::dominantIntensity, mrpt::pbmap::PbMapLocaliser::foundPlaces, mrpt::pbmap::PbMap::globalMapPtr, graphRepresentation, grn, mPbMap, mpPbMapLocaliser, mrpt::pbmap::Plane::planePointCloudPtr, mrpt::pbmap::Plane::polygonContourPtr, red, mrpt::system::os::sprintf(), mrpt::pbmap::Plane::v3center, mrpt::pbmap::Plane::v3colorNrgb, mrpt::pbmap::Plane::v3normal, and mrpt::pbmap::PbMap::vPlanes.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ acceptAreaF

float mrpt::pbmap::PbMapMaker::acceptAreaF
protected

Definition at line 161 of file PbMapMaker.h.

◆ acceptAreaT

float mrpt::pbmap::PbMapMaker::acceptAreaT
protected

Definition at line 161 of file PbMapMaker.h.

◆ acceptC1C2C3_F

float mrpt::pbmap::PbMapMaker::acceptC1C2C3_F
protected

Definition at line 163 of file PbMapMaker.h.

◆ acceptC1C2C3_T

float mrpt::pbmap::PbMapMaker::acceptC1C2C3_T
protected

Definition at line 163 of file PbMapMaker.h.

◆ acceptColor_F

float mrpt::pbmap::PbMapMaker::acceptColor_F
protected

Definition at line 167 of file PbMapMaker.h.

◆ acceptColor_T

float mrpt::pbmap::PbMapMaker::acceptColor_T
protected

Definition at line 167 of file PbMapMaker.h.

◆ acceptElongF

float mrpt::pbmap::PbMapMaker::acceptElongF
protected

Definition at line 162 of file PbMapMaker.h.

◆ acceptElongT

float mrpt::pbmap::PbMapMaker::acceptElongT
protected

Definition at line 162 of file PbMapMaker.h.

◆ acceptHistH_F

float mrpt::pbmap::PbMapMaker::acceptHistH_F
protected

Definition at line 168 of file PbMapMaker.h.

◆ acceptHistH_T

float mrpt::pbmap::PbMapMaker::acceptHistH_T
protected

Definition at line 168 of file PbMapMaker.h.

◆ acceptIntensity_F

float mrpt::pbmap::PbMapMaker::acceptIntensity_F
protected

Definition at line 165 of file PbMapMaker.h.

◆ acceptIntensity_T

float mrpt::pbmap::PbMapMaker::acceptIntensity_T
protected

Definition at line 165 of file PbMapMaker.h.

◆ acceptNrgb_F

float mrpt::pbmap::PbMapMaker::acceptNrgb_F
protected

Definition at line 164 of file PbMapMaker.h.

◆ acceptNrgb_T

float mrpt::pbmap::PbMapMaker::acceptNrgb_T
protected

Definition at line 164 of file PbMapMaker.h.

◆ cloudViewer

pcl::visualization::CloudViewer mrpt::pbmap::PbMapMaker::cloudViewer

PCL viewer. It runs in a different thread.

Definition at line 77 of file PbMapMaker.h.

Referenced by run().

◆ clusterize

SemanticClustering* mrpt::pbmap::PbMapMaker::clusterize
private

Object to cluster set of planes according to their co-visibility.

Definition at line 128 of file PbMapMaker.h.

Referenced by detectPlanesCloud(), PbMapMaker(), and run().

◆ config_Param

FILE* mrpt::pbmap::PbMapMaker::config_Param
private

File containing some paramteres and heuristic thresholds"

Definition at line 122 of file PbMapMaker.h.

◆ frameQueue

std::vector<frameRGBDandPose> mrpt::pbmap::PbMapMaker::frameQueue

frameQueue is a vector containing the frameRGBDandPose (range image + pose) to be processed.

Definition at line 71 of file PbMapMaker.h.

Referenced by run().

◆ m_pbmaker_finished

bool mrpt::pbmap::PbMapMaker::m_pbmaker_finished
protected

PbMapMaker's stop var

Definition at line 158 of file PbMapMaker.h.

Referenced by run(), and stop_pbMapMaker().

◆ m_pbmaker_must_stop

bool mrpt::pbmap::PbMapMaker::m_pbmaker_must_stop
protected

PbMapMaker's stop controller

Definition at line 155 of file PbMapMaker.h.

Referenced by run(), and stop_pbMapMaker().

◆ mPbMap

PbMap mrpt::pbmap::PbMapMaker::mPbMap
protected

The current PbMap.

Definition at line 134 of file PbMapMaker.h.

Referenced by checkProximity(), detectPlanesCloud(), getPbMap(), PbMapMaker(), run(), serializePbMap(), and viz_cb().

◆ mpPbMapLocaliser

PbMapLocaliser* mrpt::pbmap::PbMapMaker::mpPbMapLocaliser
private

Object to detect previous places.

Definition at line 125 of file PbMapMaker.h.

Referenced by detectPlanesCloud(), PbMapMaker(), viz_cb(), and ~PbMapMaker().

◆ mpPlaneInferInfo

PlaneInferredInfo* mrpt::pbmap::PbMapMaker::mpPlaneInferInfo
protected

Object to infer some knowledge in the map planes.

Definition at line 140 of file PbMapMaker.h.

Referenced by detectPlanesCloud(), mergePlanes(), PbMapMaker(), and ~PbMapMaker().

◆ mtx_pbmap_busy

boost::mutex mrpt::pbmap::PbMapMaker::mtx_pbmap_busy
private

Definition at line 130 of file PbMapMaker.h.

Referenced by detectPlanesCloud(), and serializePbMap().

◆ observedPlanes

std::set<unsigned> mrpt::pbmap::PbMapMaker::observedPlanes
protected

List of planes observed in that last frame introduced.

Definition at line 137 of file PbMapMaker.h.

Referenced by detectPlanesCloud(), and run().

◆ pbmaker_hd

std::thread mrpt::pbmap::PbMapMaker::pbmaker_hd
protected

PbMapMaker's thread handle

Definition at line 149 of file PbMapMaker.h.

Referenced by PbMapMaker(), and stop_pbMapMaker().

◆ rejectAreaF

float mrpt::pbmap::PbMapMaker::rejectAreaF
protected

Definition at line 161 of file PbMapMaker.h.

◆ rejectAreaT

float mrpt::pbmap::PbMapMaker::rejectAreaT
protected

Definition at line 161 of file PbMapMaker.h.

◆ rejectC1C2C3_F

float mrpt::pbmap::PbMapMaker::rejectC1C2C3_F
protected

Definition at line 163 of file PbMapMaker.h.

◆ rejectC1C2C3_T

float mrpt::pbmap::PbMapMaker::rejectC1C2C3_T
protected

Definition at line 163 of file PbMapMaker.h.

◆ rejectColor_F

float mrpt::pbmap::PbMapMaker::rejectColor_F
protected

Definition at line 167 of file PbMapMaker.h.

◆ rejectColor_T

float mrpt::pbmap::PbMapMaker::rejectColor_T
protected

Definition at line 167 of file PbMapMaker.h.

◆ rejectElongF

float mrpt::pbmap::PbMapMaker::rejectElongF
protected

Definition at line 162 of file PbMapMaker.h.

◆ rejectElongT

float mrpt::pbmap::PbMapMaker::rejectElongT
protected

Definition at line 162 of file PbMapMaker.h.

◆ rejectHistH_F

float mrpt::pbmap::PbMapMaker::rejectHistH_F
protected

Definition at line 168 of file PbMapMaker.h.

◆ rejectHistH_T

float mrpt::pbmap::PbMapMaker::rejectHistH_T
protected

Definition at line 168 of file PbMapMaker.h.

◆ rejectIntensity_F

float mrpt::pbmap::PbMapMaker::rejectIntensity_F
protected

Definition at line 165 of file PbMapMaker.h.

◆ rejectIntensity_T

float mrpt::pbmap::PbMapMaker::rejectIntensity_T
protected

Definition at line 165 of file PbMapMaker.h.

◆ rejectNrgb_F

float mrpt::pbmap::PbMapMaker::rejectNrgb_F
protected

Definition at line 164 of file PbMapMaker.h.

◆ rejectNrgb_T

float mrpt::pbmap::PbMapMaker::rejectNrgb_T
protected

Definition at line 164 of file PbMapMaker.h.

◆ sQueueObservedPlanes

std::set<unsigned> mrpt::pbmap::PbMapMaker::sQueueObservedPlanes

observedPlanes is a list containing the current observed planes.

Definition at line 74 of file PbMapMaker.h.




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 034c2ee2a Tue Aug 20 02:15:02 2019 +0200 at mar ago 20 02:20:10 CEST 2019