action_based_controller_handle.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  * Software License Agreement (BSD License)
00003  *
00004  *  Copyright (c) 2013, Unbounded Robotics Inc.
00005  *  Copyright (c) 2012, Willow Garage, Inc.
00006  *  All rights reserved.
00007  *
00008  *  Redistribution and use in source and binary forms, with or without
00009  *  modification, are permitted provided that the following conditions
00010  *  are met:
00011  *
00012  *   * Redistributions of source code must retain the above copyright
00013  *     notice, this list of conditions and the following disclaimer.
00014  *   * Redistributions in binary form must reproduce the above
00015  *     copyright notice, this list of conditions and the following
00016  *     disclaimer in the documentation and/or other materials provided
00017  *     with the distribution.
00018  *   * Neither the name of the Willow Garage nor the names of its
00019  *     contributors may be used to endorse or promote products derived
00020  *     from this software without specific prior written permission.
00021  *
00022  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00023  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00024  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00025  *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00026  *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00027  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00028  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00029  *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00030  *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00031  *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00032  *  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00033  *  POSSIBILITY OF SUCH DAMAGE.
00034  *********************************************************************/
00035 
00036 /* Author: Michael Ferguson, Ioan Sucan, E. Gil Jones */
00037 
00038 // XXX MULTIDOF_CHANGE : canged include protectors 
00039 #ifndef MOVEIT_CONTROLLER_MULTIDOF_ACTIONBASEDCONTROLLERHANDLEBASE_H
00040 #define MOVEIT_CONTROLLER_MULTIDOF_ACTIONBASEDCONTROLLERHANDLEBASE_H
00041 
00042 #include <moveit/controller_manager/controller_manager.h>
00043 #include <actionlib/client/simple_action_client.h>
00044 #include <moveit/macros/class_forward.h>
00045 
00046 
00047 // XXX MULTIDOF_CHANGE : global replace of
00048 // moveit_simple_controller_manager for moveit_controller_multidof 
00049 namespace moveit_controller_multidof
00050 {
00051 
00052 /*
00053  * This exist solely to inject addJoint/getJoints into base non-templated class.
00054  */
00055 class ActionBasedControllerHandleBase : public moveit_controller_manager::MoveItControllerHandle
00056 {
00057 public:
00058   ActionBasedControllerHandleBase(const std::string &name) :
00059     moveit_controller_manager::MoveItControllerHandle(name)
00060   {
00061   }
00062 
00063   virtual void addJoint(const std::string &name) = 0;
00064   virtual void getJoints(std::vector<std::string> &joints) = 0;
00065 };
00066 
00067 MOVEIT_CLASS_FORWARD(ActionBasedControllerHandleBase);
00068 
00069 
00070 // XXX BEGIN MULTIDOF_CHANGE : New class based on ActionBasedControllerHandleBase
00071 /*
00072  * This is a simple base class which only adds the joints.
00073  */
00074 class ActionBasedControllerJointsHandle : public ActionBasedControllerHandleBase
00075 {
00076 
00077 public:
00078   ActionBasedControllerJointsHandle(const std::string &name) :
00079     ActionBasedControllerHandleBase(name)
00080   {
00081   }
00082 
00083   virtual void addJoint(const std::string &name)
00084   {
00085     joints_.push_back(name);
00086   }
00087 
00088   virtual void getJoints(std::vector<std::string> &joints)
00089   {
00090     joints = joints_;
00091   }
00092 
00093 protected:
00094   /* the joints controlled by this controller */
00095   std::vector<std::string> joints_;
00096 };
00097 // XXX END MULTIDOF_CHANGE : New class based on ActionBasedControllerHandleBase
00098 
00099 
00100 } // end namespace moveit_controller_multidof
00101 
00102 #endif // MOVEIT_CONTROLLER_MULTIDOF_ACTIONBASEDCONTROLLERHANDLEBASE_H


moveit_controller_multidof
Author(s): Jennifer Buehler
autogenerated on Sat Mar 2 2019 03:50:48