40 StompPlannerManager::~StompPlannerManager()
55 std::map<std::string, XmlRpc::XmlRpcValue> group_config;
62 for(std::map<std::string, XmlRpc::XmlRpcValue>::iterator v = group_config.begin(); v != group_config.end(); v++)
64 if(!model->hasJointModelGroup(v->first))
66 ROS_WARN(
"The robot model does not support the planning group '%s' in the STOMP configuration, skipping STOMP setup for this group",
71 std::shared_ptr<StompPlanner> planner(
new StompPlanner(v->first, v->second, robot_model_));
72 planners_.insert(std::make_pair(v->first, planner));
77 ROS_ERROR(
"All planning groups are invalid, STOMP could not be configured");
92 std::shared_ptr<StompPlanner> planner = std::static_pointer_cast<
StompPlanner>(
planners_.at(req.group_name));
101 algs.push_back(
planners_.begin()->second->getName());
112 moveit_msgs::MoveItErrorCodes &error_code)
const 114 error_code.val = moveit_msgs::MoveItErrorCodes::SUCCESS;
116 if (req.group_name.empty())
118 ROS_ERROR(
"No group specified to plan for");
119 error_code.val = moveit_msgs::MoveItErrorCodes::INVALID_GROUP_NAME;
120 return planning_interface::PlanningContextPtr();
125 ROS_ERROR(
"No planning scene supplied as input");
126 error_code.val = moveit_msgs::MoveItErrorCodes::FAILURE;
127 return planning_interface::PlanningContextPtr();
132 ROS_ERROR(
"STOMP does not have a planning context for group %s",req.group_name.c_str());
133 error_code.val = moveit_msgs::MoveItErrorCodes::FAILURE;
134 return planning_interface::PlanningContextPtr();
138 std::shared_ptr<StompPlanner> planner = std::static_pointer_cast<
StompPlanner>(
planners_.at(req.group_name));
140 if(!planner->canServiceRequest(req))
142 error_code.val = moveit_msgs::MoveItErrorCodes::FAILURE;
143 return planning_interface::PlanningContextPtr();
148 planner->setPlanningScene(planning_scene);
149 planner->setMotionPlanRequest(req);
bool initialize(const robot_model::RobotModelConstPtr &model, const std::string &ns) override
Loads the ros parameters for each planning group and initializes the all the planners.
std::map< std::string, planning_interface::PlanningContextPtr > planners_
This defines the stomp planner for MoveIt.
StompPlannerManager()
Constructor.
std::map< std::string, PlannerConfigurationSettings > PlannerConfigurationMap
planning_interface::PlanningContextPtr getPlanningContext(const planning_scene::PlanningSceneConstPtr &planning_scene, const planning_interface::MotionPlanRequest &req, moveit_msgs::MoveItErrorCodes &error_code) const override
Provides a planning context that matches the desired plan requests specifications.
The PlannerManager implementation that loads STOMP into moveit.
void setPlannerConfigurations(const planning_interface::PlannerConfigurationMap &pcs) override
Not applicable.
bool canServiceRequest(const moveit_msgs::MotionPlanRequest &req) const
Checks some conditions to determine whether it is able to plan given for this planning request...
void getPlanningAlgorithms(std::vector< std::string > &algs) const override
Getter for a list of the available planners, usually one STOMP planner per planning group...
bool canServiceRequest(const moveit_msgs::MotionPlanRequest &req) const override
Checks if the request can be planned for.
#define ROS_WARN_STREAM(args)
moveit_msgs::MotionPlanRequest MotionPlanRequest
This defines the stomp planning manager for MoveIt.
static bool getConfigData(ros::NodeHandle &nh, std::map< std::string, XmlRpc::XmlRpcValue > &config, std::string param=std::string("stomp"))
Convenience method to load extract the parameters for each supported planning group.
The PlanningContext specialization that wraps the STOMP algorithm.
CLASS_LOADER_REGISTER_CLASS(Dog, Base)