00001 /**************************************************************** 00002 * 00003 * Copyright (c) 2010 00004 * 00005 * Fraunhofer Institute for Manufacturing Engineering 00006 * and Automation (IPA) 00007 * 00008 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00009 * 00010 * Project name: care-o-bot 00011 * ROS stack name: cob_perception_common 00012 * ROS package name: cob_image_flip 00013 * 00014 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00015 * 00016 * Author: Richard Bormann, email:richard.bormann@ipa.fhg.de 00017 * Supervised by: Richard Bormann, email:richard.bormann@ipa.fhg.de 00018 * 00019 * Date of creation: May 2011 00020 * ToDo: 00021 * 00022 * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00023 * 00024 * Redistribution and use in source and binary forms, with or without 00025 * modification, are permitted provided that the following conditions are met: 00026 * 00027 * * Redistributions of source code must retain the above copyright 00028 * notice, this list of conditions and the following disclaimer. 00029 * * Redistributions in binary form must reproduce the above copyright 00030 * notice, this list of conditions and the following disclaimer in the 00031 * documentation and/or other materials provided with the distribution. 00032 * * Neither the name of the Fraunhofer Institute for Manufacturing 00033 * Engineering and Automation (IPA) nor the names of its 00034 * contributors may be used to endorse or promote products derived from 00035 * this software without specific prior written permission. 00036 * 00037 * This program is free software: you can redistribute it and/or modify 00038 * it under the terms of the GNU Lesser General Public License LGPL as 00039 * published by the Free Software Foundation, either version 3 of the 00040 * License, or (at your option) any later version. 00041 * 00042 * This program is distributed in the hope that it will be useful, 00043 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00044 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00045 * GNU Lesser General Public License LGPL for more details. 00046 * 00047 * You should have received a copy of the GNU Lesser General Public 00048 * License LGPL along with this program. 00049 * If not, see <http://www.gnu.org/licenses/>. 00050 * 00051 ****************************************************************/ 00052 00053 //################## 00054 //#### includes #### 00055 00056 // ROS includes 00057 #include <ros/ros.h> 00058 #include <nodelet/nodelet.h> 00059 00060 // ROS message includes 00061 #include <sensor_msgs/Image.h> 00062 #include <sensor_msgs/PointCloud2.h> 00063 #include <tf/transform_listener.h> 00064 00065 // topics 00066 //#include <message_filters/subscriber.h> 00067 //#include <message_filters/synchronizer.h> 00068 //#include <message_filters/sync_policies/approximate_time.h> 00069 #include <image_transport/image_transport.h> 00070 #include <image_transport/subscriber_filter.h> 00071 00072 // opencv 00073 #include <opencv/cv.h> 00074 #include <opencv/highgui.h> 00075 #include <cv_bridge/cv_bridge.h> 00076 #include <sensor_msgs/image_encodings.h> 00077 00078 // point cloud 00079 #include <pcl/point_types.h> 00080 #include <pcl_ros/point_cloud.h> 00081 00082 // timer 00083 #include <cob_image_flip/timer.h> 00084 00085 // image flip code 00086 #include <cob_image_flip/kinect_image_flip.h> 00087 00088 // System 00089 #include <iostream> 00090 00091 #include <cob_vision_utils/GlobalDefines.h> 00092 00093 00094 // this should really be in the implementation (.cpp file) 00095 #include <pluginlib/class_list_macros.h> 00096 00097 namespace cob_image_flip 00098 { 00099 class CobKinectImageFlipNodelet : public nodelet::Nodelet 00100 { 00101 protected: 00102 ros::NodeHandle node_handle_; 00103 CobKinectImageFlip* cob_kinect_image_flip_; 00104 00105 public: 00106 00107 CobKinectImageFlipNodelet() 00108 { 00109 cob_kinect_image_flip_ = 0; 00110 }; 00111 00112 ~CobKinectImageFlipNodelet() 00113 { 00114 if (cob_kinect_image_flip_ != 0) 00115 delete cob_kinect_image_flip_; 00116 }; 00117 00118 virtual void onInit() 00119 { 00120 // Create a handle for this node, initialize node 00121 node_handle_ = getPrivateNodeHandle(); 00122 00123 // Create CobKinectImageFlip class instance 00124 cob_kinect_image_flip_ = new CobKinectImageFlip(node_handle_); 00125 } 00126 }; 00127 } 00128 00129 // watch the capitalization carefully 00130 PLUGINLIB_DECLARE_CLASS(cob_image_flip, CobKinectImageFlipNodelet, cob_image_flip::CobKinectImageFlipNodelet, nodelet::Nodelet)