00001 #ifndef MOVEIT_CONTROLLER_MULTIDOF_MULTIDOFCONTROLLERMANAGER_H 00002 #define MOVEIT_CONTROLLER_MULTIDOF_MULTIDOFCONTROLLERMANAGER_H 00003 00004 /* 00005 XXX MULTIDOF_CHANGE: modified includes 00006 #include <moveit_simple_controller_manager/action_based_controller_handle.h> 00007 #include <moveit_simple_controller_manager/gripper_controller_handle.h> 00008 #include <moveit_simple_controller_manager/follow_joint_trajectory_controller_handle.h> 00009 #include <pluginlib/class_list_macros.h> 00010 */ 00011 00012 #include <ros/ros.h> 00013 #include <algorithm> 00014 #include <map> 00015 #include <moveit/controller_manager/controller_manager.h> 00016 // XXX END MULTIDOF_CHANGE 00017 00018 00019 // XXX MULTIDOF_CHANGE: this include file now ONLY contains ActionBasedControllerHandleBase 00020 #include <moveit_controller_multidof/action_based_controller_handle.h> 00021 00022 namespace moveit_controller_multidof 00023 { 00024 00087 class MultiDOFControllerManager : public moveit_controller_manager::MoveItControllerManager 00088 { 00089 public: 00090 00091 MultiDOFControllerManager(); 00092 virtual ~MultiDOFControllerManager() 00093 { 00094 } 00095 00096 /* 00097 * Get a controller, by controller name (which was specified in the controllers.yaml 00098 */ 00099 virtual moveit_controller_manager::MoveItControllerHandlePtr getControllerHandle(const std::string &name); 00100 00101 /* 00102 * Get the list of controller names. 00103 */ 00104 virtual void getControllersList(std::vector<std::string> &names); 00105 00106 /* 00107 * This plugin assumes that all controllers are already active -- and if they are not, well, it has no way to deal with it anyways! 00108 */ 00109 virtual void getActiveControllers(std::vector<std::string> &names) 00110 { 00111 getControllersList(names); 00112 } 00113 00114 /* 00115 * Controller must be loaded to be active, see comment above about active controllers... 00116 */ 00117 virtual void getLoadedControllers(std::vector<std::string> &names) 00118 { 00119 getControllersList(names); 00120 } 00121 00122 /* 00123 * Get the list of joints that a controller can control. 00124 */ 00125 virtual void getControllerJoints(const std::string &name, std::vector<std::string> &joints); 00126 00127 /* 00128 * Controllers are all active and default -- that's what makes this thing simple. 00129 */ 00130 virtual moveit_controller_manager::MoveItControllerManager::ControllerState getControllerState(const std::string &name); 00131 00132 /* Cannot switch our controllers */ 00133 virtual bool switchControllers(const std::vector<std::string> &activate, const std::vector<std::string> &deactivate) { return false; } 00134 00135 protected: 00136 00137 ros::NodeHandle node_handle_; 00138 std::map<std::string, ActionBasedControllerHandleBasePtr> controllers_; 00139 }; 00140 00141 } // end namespace moveit_simple_controller_manager 00142 00143 00144 #endif // MOVEIT_CONTROLLER_MULTIDOF_MULTIDOFCONTROLLERMANAGER_H