00001 // Copyright (C) 2010-2011 Institut de Robotica i Informatica Industrial, CSIC-UPC. 00002 // Author 00003 // All rights reserved. 00004 // 00005 // This file is part of iri-ros-pkg 00006 // iri-ros-pkg is free software: you can redistribute it and/or modify 00007 // it under the terms of the GNU Lesser General Public License as published by 00008 // the Free Software Foundation, either version 3 of the License, or 00009 // at your option) any later version. 00010 // 00011 // This program is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public License 00017 // along with this program. If not, see <http://www.gnu.org/licenses/>. 00018 // 00019 // IMPORTANT NOTE: This code has been generated through a script from the 00020 // iri_ros_scripts. Please do NOT delete any comments to guarantee the correctness 00021 // of the scripts. ROS topics can be easly add by using those scripts. Please 00022 // refer to the IRI wiki page for more information: 00023 // http://wikiri.upc.es/index.php/Robotics_Lab 00024 00025 #ifndef _stereo_visual_odometry_alg_node_h_ 00026 #define _stereo_visual_odometry_alg_node_h_ 00027 00028 #include <iri_base_algorithm/iri_base_algorithm.h> 00029 #include "stereo_visual_odometry_alg.h" 00030 00031 // [publisher subscriber headers] 00032 #include <geometry_msgs/PoseWithCovarianceStamped.h> 00033 #include <sensor_msgs/Image.h> 00034 00035 // [service client headers] 00036 00037 // [action server client headers] 00038 00043 class StereoVisualOdometryAlgNode : public algorithm_base::IriBaseAlgorithm<StereoVisualOdometryAlgorithm> 00044 { 00045 private: 00046 // [publisher attributes] 00047 ros::Publisher pose_with_covariance_publisher_; 00048 geometry_msgs::PoseWithCovarianceStamped PoseWithCovarianceStamped_msg_; 00049 00050 // [subscriber attributes] 00051 ros::Subscriber right_image_subscriber_; 00052 void right_image_callback(const sensor_msgs::Image::ConstPtr& msg); 00053 CMutex right_image_mutex_; 00054 ros::Subscriber left_image_subscriber_; 00055 void left_image_callback(const sensor_msgs::Image::ConstPtr& msg); 00056 CMutex left_image_mutex_; 00057 00058 // [service attributes] 00059 00060 // [client attributes] 00061 00062 // [action server attributes] 00063 00064 // [action client attributes] 00065 00066 int count_left_images; 00067 int count_right_images; 00068 cv::Mat image1; 00069 cv::Mat image2; 00070 cv::Mat image3; 00071 cv::Mat image4; 00072 cv::Mat point; 00073 cv::Mat H; 00074 cv::Mat Hcov; 00075 00076 public: 00083 StereoVisualOdometryAlgNode(void); 00084 00091 ~StereoVisualOdometryAlgNode(void); 00092 00093 protected: 00106 void mainNodeThread(void); 00107 00120 void node_config_update(Config &config, uint32_t level); 00121 00128 void addNodeDiagnostics(void); 00129 00130 // [diagnostic functions] 00131 00132 // [test functions] 00133 }; 00134 00135 #endif