00001 /****************************************************************************** 00002 STDR Simulator - Simple Two DImensional Robot Simulator 00003 Copyright (C) 2013 STDR Simulator 00004 This program is free software; you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation; either version 3 of the License, or 00007 (at your option) any later version. 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 You should have received a copy of the GNU General Public License 00013 along with this program; if not, write to the Free Software Foundation, 00014 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00015 00016 Authors : 00017 * Manos Tsardoulias, etsardou@gmail.com 00018 * Aris Thallas, aris.thallas@gmail.com 00019 * Chris Zalidis, zalidis@gmail.com 00020 ******************************************************************************/ 00021 00022 #include <ros/ros.h> 00023 #include <actionlib/client/simple_action_client.h> 00024 #include <actionlib/client/terminal_state.h> 00025 #include <stdr_msgs/RobotIndexedMsg.h> 00026 #include <stdr_msgs/SpawnRobotAction.h> 00027 #include <stdr_msgs/DeleteRobotAction.h> 00028 #include <stdr_msgs/MoveRobot.h> 00029 #include <stdr_robot/exceptions.h> 00030 #include <geometry_msgs/Pose2D.h> 00031 00032 #ifndef HANDLE_ROBOT_H 00033 #define HANDLE_ROBOT_H 00034 00039 namespace stdr_robot { 00040 00041 typedef actionlib::SimpleActionClient<stdr_msgs::SpawnRobotAction> 00042 SpawnRobotClient; 00043 typedef actionlib::SimpleActionClient<stdr_msgs::DeleteRobotAction> 00044 DeleteRobotClient; 00045 00050 class HandleRobot { 00051 //------------------------------------------------------------------------// 00052 private: 00053 00055 SpawnRobotClient _spawnRobotClient; 00057 DeleteRobotClient _deleteRobotClient; 00058 00059 //------------------------------------------------------------------------// 00060 public: 00061 00066 HandleRobot(); 00067 00073 stdr_msgs::RobotIndexedMsg spawnNewRobot(const stdr_msgs::RobotMsg msg); 00074 00080 bool deleteRobot(const std::string& name); 00081 00088 bool moveRobot(const std::string& name, 00089 const geometry_msgs::Pose2D newPose); 00090 }; 00091 } 00092 00093 #endif