doors_detector.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2009 Radu Bogdan Rusu <rusu -=- cs.tum.edu>
00003  *
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are met:
00008  *
00009  *     * Redistributions of source code must retain the above copyright
00010  *       notice, this list of conditions and the following disclaimer.
00011  *     * Redistributions in binary form must reproduce the above copyright
00012  *       notice, this list of conditions and the following disclaimer in the
00013  *       documentation and/or other materials provided with the distribution.
00014  *
00015  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00016  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00017  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00018  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00019  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00020  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00021  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00022  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00023  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00024  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00025  * POSSIBILITY OF SUCH DAMAGE.
00026  *
00027  * $Id: doors_detector.cpp 12908 2009-03-24 17:14:06Z meeussen $
00028  *
00029  */
00030 
00046 #ifndef DOORS_DETECTOR_H
00047 #define DOORS_DETECTOR_H
00048 
00049 // ROS core
00050 #include <ros/ros.h>
00051 #include <roslib/Header.h>
00052 #include <mapping_msgs/PolygonalMap.h>
00053 
00054 // Most of the geometric routines that contribute to the door finding job are located here
00055 #include <door_handle_detector/geometric_helper.h>
00056 
00057 // Include the service call type
00058 #include <door_handle_detector/DoorsDetector.h>
00059 #include <door_handle_detector/DoorsDetectorCloud.h>
00060 
00061 #include <angles/angles.h>
00062 
00063 
00064 namespace door_handle_detector{
00065 
00066 class DoorDetector
00067 {
00068 
00069 public:
00070   DoorDetector ();
00071   ~DoorDetector (){};
00072 
00074   bool detectDoorSrv (door_handle_detector::DoorsDetector::Request &req,
00075                       door_handle_detector::DoorsDetector::Response &resp);
00077   bool detectDoorCloudSrv (door_handle_detector::DoorsDetectorCloud::Request &req,
00078                            door_handle_detector::DoorsDetectorCloud::Response &resp);
00079 
00080   ros::ServiceServer detect_srv_, detect_cloud_srv_;
00081   ros::Publisher viz_marker_pub_, door_frames_pub_, door_regions_pub_;
00082 
00083 private:
00085   bool detectDoors(const door_msgs::Door& door, sensor_msgs::PointCloud pointcloud,
00086                    std::vector<door_msgs::Door>& result) const;
00087 
00089   void cloud_cb (const sensor_msgs::PointCloudConstPtr& cloud);
00090 
00091   double distToHinge(const door_msgs::Door& door, geometry_msgs::Point32& pnt) const;
00092 
00093   ros::NodeHandle node_tilde_, node_;
00094   mutable int global_marker_id_;
00095 
00096   // parameters for callback function
00097   sensor_msgs::PointCloud pointcloud_;
00098   std::string input_cloud_topic_;
00099   unsigned int num_clouds_received_;
00100   geometry_msgs::Point32 z_axis_;
00101   tf::TransformListener tf_;
00102 
00103   std::string parameter_frame_, fixed_frame_;
00104 
00105   // Parameters regarding geometric constraints for the door/handle
00106   double door_min_height_, door_min_width_, door_max_height_, door_max_width_, door_min_z_, max_dist_from_prior_;
00107 
00108   // Parameters regarding the _fast_ normals/plane computation using a lower quality (downsampled) dataset
00109   double leaf_width_;
00110   double sac_distance_threshold_;
00111   double normal_angle_tolerance_;
00112   int k_search_;
00113 
00114   // Parameters for the euclidean clustering/cluster rejection
00115   double euclidean_cluster_angle_tolerance_, euclidean_cluster_distance_tolerance_;
00116   int euclidean_cluster_min_pts_;
00117 
00118   // Parameters for "rectangularity" constraints
00119   double rectangle_constrain_edge_height_;
00120   double rectangle_constrain_edge_angle_;
00121 
00122   // Prune door candidates
00123   double minimum_region_density_;
00124   double maximum_search_radius_, maximum_search_radius_limit_, maximum_scan_angle_limit_;
00125   double minimum_z_, maximum_z_;;
00126 
00127 
00128 
00129 
00130 };
00131 
00132 
00133 };
00134 
00135 #endif


door_handle_detector
Author(s): Radu Bogdan Rusu, Marius
autogenerated on Wed Dec 11 2013 14:17:00