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 _wam_controller_driver_node_h_ 00026 #define _wam_controller_driver_node_h_ 00027 00028 #include <iri_base_driver/iri_base_driver_node.h> 00029 #include "wam_controller_driver.h" 00030 #include <Eigen/Dense> 00031 00032 // [publisher subscriber headers] 00033 #include <geometry_msgs/PoseStamped.h> 00034 #include <sensor_msgs/JointState.h> 00035 00036 // [service client headers] 00037 #include <iri_wam_common_msgs/wamholdon.h> 00038 #include <iri_wam_common_msgs/joints_move.h> 00039 00040 // [action server client headers] 00041 #include <iri_action_server/iri_action_server.h> 00042 #include <control_msgs/FollowJointTrajectoryAction.h> 00043 00061 class WamControllerDriverNode : public iri_base_driver::IriBaseNodeDriver<WamControllerDriver> 00062 { 00063 private: 00064 // [publisher attributes] 00065 ros::Publisher libbarrett_link_tcp_publisher_; 00066 geometry_msgs::PoseStamped PoseStamped_msg_; 00067 ros::Publisher joint_states_publisher_; 00068 sensor_msgs::JointState JointState_msg_; 00069 00070 // [subscriber attributes] 00071 00072 // [service attributes] 00073 ros::ServiceServer hold_on_server_; 00074 bool hold_onCallback(iri_wam_common_msgs::wamholdon::Request &req, iri_wam_common_msgs::wamholdon::Response &res); 00075 CMutex hold_on_mutex_; 00076 ros::ServiceServer joints_move_server_; 00077 bool joints_moveCallback(iri_wam_common_msgs::joints_move::Request &req, iri_wam_common_msgs::joints_move::Response &res); 00078 CMutex joints_move_mutex_; 00079 00080 // [client attributes] 00081 00082 // [action server attributes] 00083 IriActionServer<control_msgs::FollowJointTrajectoryAction> follow_joint_trajectory_aserver_; 00084 void follow_joint_trajectoryStartCallback(const control_msgs::FollowJointTrajectoryGoalConstPtr& goal); 00085 void follow_joint_trajectoryStopCallback(void); 00086 bool follow_joint_trajectoryIsFinishedCallback(void); 00087 bool follow_joint_trajectoryHasSucceedCallback(void); 00088 void follow_joint_trajectoryGetResultCallback(control_msgs::FollowJointTrajectoryResultPtr& result); 00089 void follow_joint_trajectoryGetFeedbackCallback(control_msgs::FollowJointTrajectoryFeedbackPtr& feedback); 00090 00091 // [action client attributes] 00092 00100 void postNodeOpenHook(void); 00101 00102 public: 00120 WamControllerDriverNode(ros::NodeHandle& nh); 00121 00128 ~WamControllerDriverNode(void); 00129 00130 protected: 00143 void mainNodeThread(void); 00144 00145 // [diagnostic functions] 00146 00157 void addNodeDiagnostics(void); 00158 00159 // [driver test functions] 00160 00170 void addNodeOpenedTests(void); 00171 00181 void addNodeStoppedTests(void); 00182 00192 void addNodeRunningTests(void); 00193 00201 void reconfigureNodeHook(int level); 00202 00203 }; 00204 00205 #endif