Go to the documentation of this file.00001
00026 #ifndef CONSTRAINED_IK_PLANNER_PLUGIN_H
00027 #define CONSTRAINED_IK_PLANNER_PLUGIN_H
00028 #include <moveit/planning_interface/planning_interface.h>
00029 #include <moveit/planning_scene/planning_scene.h>
00030 #include <class_loader/class_loader.h>
00031 #include <ros/ros.h>
00032 #include <constrained_ik/moveit_interface/joint_interpolation_planner.h>
00033 #include <constrained_ik/moveit_interface/cartesian_planner.h>
00034 #include <dynamic_reconfigure/server.h>
00035 #include <dynamic_reconfigure/Reconfigure.h>
00036 #include <constrained_ik/CLIKPlannerDynamicConfig.h>
00037 #include <constrained_ik/CLIKDynamicConfig.h>
00038
00039 namespace constrained_ik
00040 {
00046 class CLIKPlannerManager : public planning_interface::PlannerManager
00047 {
00048 public:
00049 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00050
00051 CLIKPlannerManager() : planning_interface::PlannerManager(),
00052 nh_("~")
00053 {
00054 }
00055
00057 bool initialize(const robot_model::RobotModelConstPtr &model, const std::string &ns) override;
00058
00060 bool canServiceRequest(const moveit_msgs::MotionPlanRequest &req) const override {return req.trajectory_constraints.constraints.empty();}
00061
00063 std::string getDescription() const override { return "CLIK"; }
00064
00066 void getPlanningAlgorithms(std::vector<std::string> &algs) const override;
00067
00069 void setPlannerConfigurations(const planning_interface::PlannerConfigurationMap &pcs) override;
00070
00072 planning_interface::PlanningContextPtr getPlanningContext(const planning_scene::PlanningSceneConstPtr &planning_scene, const planning_interface::MotionPlanRequest &req, moveit_msgs::MoveItErrorCodes &error_code) const override;
00073
00075 virtual void managerDynamicReconfigureCallback(CLIKPlannerDynamicConfig &config, uint32_t level);
00076
00083 virtual void cartesianDynamicReconfigureCallback(CLIKDynamicConfig &config, uint32_t level, std::string group_name);
00084
00085 protected:
00086 typedef dynamic_reconfigure::Server<CLIKPlannerDynamicConfig> ManagerDynReconfigServer;
00087 typedef dynamic_reconfigure::Server<CLIKDynamicConfig> CartesianDynReconfigServer;
00088 typedef boost::shared_ptr<ManagerDynReconfigServer> ManagerDynReconfigServerPtr;
00089 typedef boost::shared_ptr<CartesianDynReconfigServer> CartesianDynReconfigServerPtr;
00091 ros::NodeHandle nh_;
00092 boost::recursive_mutex mutex_;
00093 CLIKPlannerDynamicConfig config_;
00094 ManagerDynReconfigServerPtr dynamic_reconfigure_server_;
00095 std::map<std::string, CartesianDynReconfigServerPtr> cartesian_dynamic_reconfigure_server_;
00096 std::map<std::pair<std::string, std::string>, constrained_ik::CLIKPlanningContextPtr> planners_;
00097 };
00098 }
00099 #endif //CONSTRAINED_IK_PLANNER_PLUGIN_H