gldetector.h
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (Modified BSD License)
00003  *
00004  *  Copyright (c) 2012, PAL Robotics, S.L.
00005  *  All rights reserved.
00006  *
00007  *  Redistribution and use in source and binary forms, with or without
00008  *  modification, are permitted provided that the following conditions
00009  *  are met:
00010  *
00011  *   * Redistributions of source code must retain the above copyright
00012  *     notice, this list of conditions and the following disclaimer.
00013  *   * Redistributions in binary form must reproduce the above
00014  *     copyright notice, this list of conditions and the following
00015  *     disclaimer in the documentation and/or other materials provided
00016  *     with the distribution.
00017  *   * Neither the name of PAL Robotics, S.L. nor the names of its
00018  *     contributors may be used to endorse or promote products derived
00019  *     from this software without specific prior written permission.
00020  *
00021  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00025  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00028  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00029  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00031  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00032  *  POSSIBILITY OF SUCH DAMAGE. 
00033  *
00034  * @file gldetector.h
00035  * @author Bence Magyar
00036  * @date April 2012
00037  * @version 0.1
00038  * @brief The GLDetector class encapsulates the Recognizer module of BLORT.
00039  * It provides a C++ interface but uses ROS classes for data transfer at some places.
00040  */
00041 
00042 #ifndef GLDetector_H
00043 #define GLDetector_H
00044 
00045 #include <geometry_msgs/Pose.h>
00046 #include <string>
00047 #include <blort_ros/RecoveryCall.h>
00048 
00049 #include <blort/ThreadObject/RecognizerThread.h>
00050 #include <blort/Recognizer3D/Recognizer3D.h>
00051 #include <blort_ros/DetectorConfig.h>
00052 
00053 namespace blort_ros
00054 {
00055     class GLDetector
00056     {
00057     private:
00058 
00059         // EXPERIMENTAL temporary stuff
00060         int rec3dcounter;
00061         // end of EXPERIMENTAL
00062 
00063         float recovery_conf_threshold; // threshold used in recovery mode to say OK to a pose proposal
00064 
00065         // Create OpenGL Window and Tracker
00066         boost::shared_ptr<blortRecognizer::Recognizer3D> recognizer; // recovery component
00067 
00068         //config files //FIXME
00069         std::string model_name, sift_file; // name of the current model
00070         std::string pose_cal;   // filename with the pose calibration values
00071 
00072         // Initialise image
00073         IplImage *image_; // iplimage that used be the in former blort tracker module
00074         cv::Mat last_image;
00075 
00076         //reconf GUI hack
00077         bool last_reset;
00078 
00079     public:
00080         GLDetector(const sensor_msgs::CameraInfo& camera_info,
00081                    const std::string& config_root);
00082 
00084         bool recovery(const cv::Mat& image,
00085                       blort_ros::RecoveryCall::Response &resp);
00086 
00089         bool recoveryWithLast(blort_ros::RecoveryCall::Response &resp);
00090 
00093         void reconfigure(blort_ros::DetectorConfig config);
00094 
00096         cv::Mat getImage();
00097 
00099         void setNNThreshold(double nn_threshold)
00100         { recognizer->setNNThreshold(nn_threshold); }
00101 
00103         void setRansacNPointsToMatch(unsigned int n)
00104         { recognizer->setRansacNPointsToMatch(n); }
00105 
00106         ~GLDetector();
00107 
00108         cv::Mat getDebugImage();
00109 
00110     };
00111 }
00112 
00113 #endif // GLDetector_H


blort_ros
Author(s): Bence Magyar
autogenerated on Thu Jan 2 2014 11:39:12