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 _place_alg_node_h_ 00026 #define _place_alg_node_h_ 00027 00028 #include <iri_base_algorithm/iri_base_algorithm.h> 00029 #include "place_alg.h" 00030 00031 // [publisher subscriber headers] 00032 00033 // [service client headers] 00034 #include <iri_wam_common_msgs/joints_move.h> 00035 #include <iri_wam_common_msgs/wamInverseKinematics.h> 00036 #include <iri_wam_common_msgs/bhand_cmd.h> 00037 00038 // [action server client headers] 00039 #include <iri_action_server/iri_action_server.h> 00040 #include <object_manipulation_msgs/PlaceAction.h> 00041 00042 enum ACTIONSTATUS { 00043 IDLE, 00044 POSE_CHECKED, 00045 POSITION_REACHED, 00046 HAND_OPENED, 00047 FINISH 00048 }; 00049 00054 class PlaceAlgNode : public algorithm_base::IriBaseAlgorithm<PlaceAlgorithm> 00055 { 00056 private: 00057 // [publisher attributes] 00058 00059 // [subscriber attributes] 00060 00061 // [service attributes] 00062 00063 // [client attributes] 00064 ros::ServiceClient joints_move_client_; 00065 iri_wam_common_msgs::joints_move joints_move_srv_; 00066 ros::ServiceClient get_tcp_ik_client_; 00067 iri_wam_common_msgs::wamInverseKinematics get_tcp_ik_srv_; 00068 ros::ServiceClient bhand_cmd_client_; 00069 iri_wam_common_msgs::bhand_cmd bhand_cmd_srv_; 00070 00071 // [action server attributes] 00072 std::string place_pose_frame_id_; 00073 bool place_action_success_; 00074 bool last_place_action_success_; 00075 int place_action_status_; 00076 IriActionServer<object_manipulation_msgs::PlaceAction> place_aserver_; 00077 void placeStartCallback(const object_manipulation_msgs::PlaceGoalConstPtr& goal); 00078 void placeStopCallback(void); 00079 bool placeIsFinishedCallback(void); 00080 bool placeHasSucceedCallback(void); 00081 void placeGetResultCallback(object_manipulation_msgs::PlaceResultPtr& result); 00082 void placeGetFeedbackCallback(object_manipulation_msgs::PlaceFeedbackPtr& feedback); 00083 00084 // [action client attributes] 00085 00086 public: 00093 PlaceAlgNode(void); 00094 00101 ~PlaceAlgNode(void); 00102 00103 protected: 00116 void mainNodeThread(void); 00117 00130 void node_config_update(Config &config, uint32_t level); 00131 00138 void addNodeDiagnostics(void); 00139 00140 // [diagnostic functions] 00141 00142 // [test functions] 00143 }; 00144 00145 #endif