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 _my_labeler_alg_node_h_ 00026 #define _my_labeler_alg_node_h_ 00027 00028 #include <iri_base_algorithm/iri_base_algorithm.h> 00029 #include "my_labeler_alg.h" 00030 00031 // [publisher subscriber headers] 00032 #include <sensor_msgs/LaserScan.h> 00033 #include <geometry_msgs/PoseStamped.h> 00034 #include <fstream> 00035 #include <iostream> 00036 #include <stdio.h> 00037 00038 using namespace std; 00039 00040 // [service client headers] 00041 00042 // [action server client headers] 00043 00048 class MyLabelerAlgNode : public algorithm_base::IriBaseAlgorithm<MyLabelerAlgorithm> 00049 { 00050 private: 00051 // [publisher attributes] 00052 00053 // [subscriber attributes] 00054 ros::Subscriber scan_subscriber_; 00055 void scan_callback(const sensor_msgs::LaserScan::ConstPtr& msg); 00056 CMutex scan_mutex_; 00057 ros::Subscriber goal_subscriber_; 00058 void goal_callback(const geometry_msgs::PoseStamped::ConstPtr& msg); 00059 CMutex goal_mutex_; 00060 00061 // [service attributes] 00062 00063 // [client attributes] 00064 00065 // [action server attributes] 00066 00067 // [action client attributes] 00068 00069 //my stuff 00070 FILE * file_out_; 00071 //ofstream file_out_; 00072 double bag_time_; 00073 00074 public: 00081 MyLabelerAlgNode(void); 00082 00089 ~MyLabelerAlgNode(void); 00090 00091 protected: 00104 void mainNodeThread(void); 00105 00118 void node_config_update(Config &config, uint32_t level); 00119 00126 void addNodeDiagnostics(void); 00127 00128 // [diagnostic functions] 00129 00130 // [test functions] 00131 }; 00132 00133 #endif