Go to the documentation of this file.00001
00063
00064 #include "cob_3d_mapping_semantics/structure_extraction.h"
00065
00066 using namespace cob_3d_mapping;
00067
00068 bool
00069 StructureExtraction::isWall ()
00070 {
00071
00072 if (fabs (poly_ptr_->normal_ (2)) < 0.1 && poly_ptr_->computeArea3d () > 1)
00073 return true;
00074 else
00075 return false;
00076 }
00077
00078 bool
00079 StructureExtraction::isFloor ()
00080 {
00081 if (fabs (poly_ptr_->normal_ (0)) < 0.12 && fabs (poly_ptr_->normal_ (1)) < 0.12
00082 && fabs (poly_ptr_->normal_ (2)) > 0.9 && poly_ptr_->pose_.translation () (2) <= floor_height_)
00083 return true;
00084 else
00085 return false;
00086 }
00087
00088 bool
00089 StructureExtraction::isCeiling ()
00090 {
00091 if (fabs (poly_ptr_->normal_ (0)) < 0.12 && fabs (poly_ptr_->normal_ (1)) < 0.12
00092 && fabs (poly_ptr_->normal_ (2)) > 0.9 && poly_ptr_->pose_.translation () (2) >= ceiling_height_)
00093 return true;
00094 else
00095 return false;
00096 }
00097
00098 bool
00099 StructureExtraction::classify (unsigned int& label)
00100 {
00101 if (!poly_ptr_)
00102 {
00103 std::cerr << "Input polygon not set, aborting..." << std::endl;
00104 return false;
00105 }
00106 if (isCeiling ())
00107 label = 1;
00108 else if (isFloor ())
00109 label = 2;
00110 else if (isWall ())
00111 label = 3;
00112 else
00113 label = 0;
00114 return true;
00115 }
00116