ar_multi.h
Go to the documentation of this file.
00001 /*
00002  *  Multi Marker Pose Estimation using ARToolkit
00003  *  Copyright (C) 2010, CCNY Robotics Lab
00004  *  Ivan Dryanovski <ivan.dryanovski@gmail.com>
00005  *  William Morris <morris@ee.ccny.cuny.edu>
00006  *  Gautier Dumonteil <gautier.dumonteil@gmail.com>
00007  *  http://robotics.ccny.cuny.edu
00008  *
00009  *  This program is free software: you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation, either version 3 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  This program is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  *  GNU General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU General Public License
00020  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00021  */
00022 
00023 #ifndef AR_POSE_AR_MULTI_H
00024 #define AR_POSE_AR_MULTI_H
00025 
00026 #include <string.h>
00027 #include <stdarg.h>
00028 
00029 #include <AR/gsub.h>
00030 #include <AR/video.h>
00031 #include <AR/param.h>
00032 #include <AR/ar.h>
00033 #include <AR/arMulti.h>
00034 
00035 #include <ros/ros.h>
00036 #include <ros/package.h>
00037 #include <ros/console.h>
00038 #include <geometry_msgs/TransformStamped.h>
00039 #include <tf/transform_broadcaster.h>
00040 #include <image_transport/image_transport.h>
00041 #include <sensor_msgs/CameraInfo.h>
00042 #include <visualization_msgs/Marker.h>
00043 #include <resource_retriever/retriever.h>
00044 
00045 #include <opencv/cv.h>
00046 #include <cv_bridge/CvBridge.h>
00047 
00048 #include <ar_pose/ARMarkers.h>
00049 #include <ar_pose/ARMarker.h>
00050 #include <ar_pose/object.h>
00051 
00052 #include <dynamic_reconfigure/server.h>
00053 #include <ar_pose/ARSinglePublisherConfig.h>
00054 
00055 using namespace cv;
00056 
00057 //const std::string cameraImageTopic_ = "/usb_cam/image_raw";
00058 //const std::string cameraInfoTopic_  = "/usb_cam/camera_info";
00059 
00060  const std::string cameraImageTopic_ = "/camera/image";
00061  const std::string cameraInfoTopic_  = "/camera/camera_info";
00062 
00063 const double AR_TO_ROS = 0.001;
00064 
00065 namespace ar_pose
00066 {
00067   class ARSinglePublisher
00068   {
00069   public:
00070     ARSinglePublisher (ros::NodeHandle & n);
00071     ~ARSinglePublisher (void);
00072     
00073     static int window_size_;
00074     static double k_;
00075     static bool enable_thresholded_;
00076     static bool enable_hist_;
00077     static int threshold_;
00078     static bool enable_local_thresh_;
00079 
00080     static void callback(ARSinglePublisherConfig &config, uint32_t level);
00081     
00082   private:
00083     void arInit ();
00084     void getTransformationCallback (const sensor_msgs::ImageConstPtr &);
00085     void camInfoCallback (const sensor_msgs::CameraInfoConstPtr &);
00086 
00087     IplImage* drawHistogram(IplImage *img);
00088     void localThreshold(Mat& img, Mat& dst, double k, int window);
00089     
00090       ros::NodeHandle n_;
00091       tf::TransformBroadcaster broadcaster_;
00092       
00093       ros::Subscriber sub_;
00094       image_transport::Subscriber cam_sub_;
00095       ros::Publisher arMarkerPub_;
00096 
00097       image_transport::ImageTransport it_;
00098       sensor_msgs::CvBridge bridge_;
00099       sensor_msgs::CameraInfo cam_info_;
00100 
00101     // **** for visualisation in rviz
00102     
00103       image_transport::Publisher histogram_;
00104       image_transport::Publisher thresholded_;
00105       ros::Publisher rvizMarkerPub_;
00106       visualization_msgs::Marker rvizMarker_;
00107 
00108     // **** parameters
00109     ARParam cam_param_;         // Camera Calibration Parameters
00110     ARMultiMarkerInfoT *config; // AR Marker Info
00111       ar_object::ObjectData_T * object;
00112     int objectnum;
00113     char pattern_filename_[FILENAME_MAX];
00114 
00115       ar_pose::ARMarkers arPoseMarkers_;
00116 //     int threshold_;
00117     bool getCamInfo_;
00118     bool publishTf_;
00119     bool publishVisualMarkers_;
00120     CvSize sz_;
00121     IplImage *capture_;
00122 
00123   };                            // end class ARSinglePublisher
00124 }                               //end namespace ar_pose
00125 
00126 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


ar_pose_old
Author(s): Ivan Dryanovski, William Morris, Gautier Dumonteil et al.
autogenerated on Fri Jan 25 2013 12:35:34