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 _moped_actionclient_alg_node_h_ 00026 #define _moped_actionclient_alg_node_h_ 00027 00028 #include <iri_base_algorithm/iri_base_algorithm.h> 00029 #include "moped_actionclient_alg.h" 00030 00031 #include <opencv2/opencv.hpp> 00032 #include <cv_bridge/cv_bridge.h> 00033 #include <sensor_msgs/image_encodings.h> 00034 00035 // [publisher subscriber headers] 00036 00037 // [service client headers] 00038 00039 // [action server client headers] 00040 #include <actionlib/client/simple_action_client.h> 00041 #include <actionlib/client/terminal_state.h> 00042 #include <iri_moped_actionserver/mopedAction.h> 00043 00048 class MopedActionclientAlgNode : public algorithm_base::IriBaseAlgorithm<MopedActionclientAlgorithm> 00049 { 00050 private: 00051 // [publisher attributes] 00052 00053 // [subscriber attributes] 00054 00055 // [service attributes] 00056 00057 // [client attributes] 00058 00059 // [action server attributes] 00060 00061 // [action client attributes] 00062 actionlib::SimpleActionClient<iri_moped_actionserver::mopedAction> moped_client_; 00063 iri_moped_actionserver::mopedGoal moped_goal_; 00064 void mopedMakeActionRequest(); 00065 void mopedDone(const actionlib::SimpleClientGoalState& state, const iri_moped_actionserver::mopedResultConstPtr& result); 00066 void mopedActive(); 00067 void mopedFeedback(const iri_moped_actionserver::mopedFeedbackConstPtr& feedback); 00068 00069 00070 public: 00077 MopedActionclientAlgNode(void); 00078 00085 ~MopedActionclientAlgNode(void); 00086 00087 protected: 00100 void mainNodeThread(void); 00101 00114 void node_config_update(Config &config, uint32_t level); 00115 00122 void addNodeDiagnostics(void); 00123 00124 // [diagnostic functions] 00125 00126 // [test functions] 00127 00128 // Image to test. 00129 cv::Mat image; 00130 }; 00131 00132 #endif