Robowflex  v0.1
Making MoveIt Easy
robowflex::OMPL::OMPLPipelinePlanner Class Reference

A robowflex::PipelinePlanner that uses the MoveIt! default OMPL planning pipeline. More...

#include <planning.h>

+ Inheritance diagram for robowflex::OMPL::OMPLPipelinePlanner:

Public Member Functions

 OMPLPipelinePlanner (const RobotPtr &robot, const std::string &name="")
 
 OMPLPipelinePlanner (OMPLPipelinePlanner const &)=delete
 
void operator= (OMPLPipelinePlanner const &)=delete
 
bool initialize (const std::string &config_file="", const Settings &settings=Settings(), const std::string &plugin=DEFAULT_PLUGIN, const std::vector< std::string > &adapters=DEFAULT_ADAPTERS)
 Initialize planning pipeline. Loads OMPL planning plugin plugin with the planning adapters adapters. Parameters are set on the parameter server from settings and planning configurations are loaded from the YAML file config_file. More...
 
std::vector< std::stringgetPlannerConfigs () const override
 Return all planner configurations offered by this planner. Any of the configurations returned can be set as the planner for a motion planning query sent to plan(). More...
 
- Public Member Functions inherited from robowflex::PipelinePlanner
 PipelinePlanner (const RobotPtr &robot, const std::string &name="")
 Constructor. More...
 
 PipelinePlanner (PipelinePlanner const &)=delete
 
void operator= (PipelinePlanner const &)=delete
 
planning_interface::MotionPlanResponse plan (const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request) override
 Plan a motion given a request and a scene. Uses the planning pipeline's generatePlan() method, which goes through planning adapters. More...
 
template<typename T >
std::shared_ptr< T > extractPlanningContext (const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request) const
 Retrieve planning context and dynamically cast to desired type from planning pipeline. More...
 
- Public Member Functions inherited from robowflex::Planner
 Planner (const RobotPtr &robot, const std::string &name="")
 Constructor. Takes in a robot description and an optional namespace name. If name is specified, planner parameters are namespaced under the namespace of robot. More...
 
 Planner (Planner const &)=delete
 
void operator= (Planner const &)=delete
 
virtual std::map< std::string, ProgressPropertygetProgressProperties (const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request) const
 Retrieve the planner progress property map for this planner given a specific request. More...
 
const RobotPtr getRobot () const
 Return the robot for this planner. More...
 
const std::stringgetName () const
 Get the name of the planner. More...
 
virtual void preRun (const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request)
 This function is called before benchmarking. More...
 

Static Protected Attributes

static const std::string DEFAULT_PLUGIN
 The default OMPL plugin. More...
 
static const std::vector< std::stringDEFAULT_ADAPTERS
 The default planning adapters. More...
 

Private Attributes

std::vector< std::stringconfigs_
 

Additional Inherited Members

- Public Types inherited from robowflex::Planner
using ProgressProperty = std::function< std::string()>
 A function that returns the value of a planner property over the course of a run. More...
 
- Protected Attributes inherited from robowflex::PipelinePlanner
planning_pipeline::PlanningPipelinePtr pipeline_
 Loaded planning pipeline plugin. More...
 
- Protected Attributes inherited from robowflex::Planner
RobotPtr robot_
 The robot to plan for. More...
 
IO::Handler handler_
 The parameter handler for the planner. More...
 
const std::string name_
 Namespace for the planner. More...
 

Detailed Description

A robowflex::PipelinePlanner that uses the MoveIt! default OMPL planning pipeline.

Definition at line 339 of file robowflex_library/include/robowflex_library/planning.h.

Constructor & Destructor Documentation

◆ OMPLPipelinePlanner() [1/2]

OMPL::OMPLPipelinePlanner::OMPLPipelinePlanner ( const RobotPtr robot,
const std::string name = "" 
)

Definition at line 346 of file robowflex_library/src/planning.cpp.

347  : PipelinePlanner(robot, name)
348 {
349 }
PipelinePlanner(const RobotPtr &robot, const std::string &name="")
Constructor.
Functions for loading and animating robots in Blender.

◆ OMPLPipelinePlanner() [2/2]

robowflex::OMPL::OMPLPipelinePlanner::OMPLPipelinePlanner ( OMPLPipelinePlanner const &  )
delete

Member Function Documentation

◆ getPlannerConfigs()

std::vector< std::string > OMPL::OMPLPipelinePlanner::getPlannerConfigs ( ) const
overridevirtual

Return all planner configurations offered by this planner. Any of the configurations returned can be set as the planner for a motion planning query sent to plan().

Returns
A vector of strings of planner configuration names.

Implements robowflex::Planner.

Definition at line 377 of file robowflex_library/src/planning.cpp.

378 {
379  return configs_;
380 }

◆ initialize()

bool OMPL::OMPLPipelinePlanner::initialize ( const std::string config_file = "",
const Settings settings = Settings(),
const std::string plugin = DEFAULT_PLUGIN,
const std::vector< std::string > &  adapters = DEFAULT_ADAPTERS 
)

Initialize planning pipeline. Loads OMPL planning plugin plugin with the planning adapters adapters. Parameters are set on the parameter server from settings and planning configurations are loaded from the YAML file config_file.

Parameters
[in]config_fileA YAML file containing OMPL planner configurations.
[in]settingsSettings to set on the parameter server.
[in]pluginPlanning plugin to load.
[in]adaptersPlanning adapters to load.
Returns
True upon success, false on failure.

Definition at line 351 of file robowflex_library/src/planning.cpp.

354 {
355  if (!loadOMPLConfig(handler_, config_file, configs_))
356  return false;
357 
358  handler_.setParam("planning_plugin", plugin);
359 
361  for (std::size_t i = 0; i < adapters.size(); ++i)
362  {
363  ss << adapters[i];
364  if (i < adapters.size() - 1)
365  ss << " ";
366  }
367 
368  handler_.setParam("request_adapters", ss.str());
369  settings.setParam(handler_);
370 
371  pipeline_.reset(new planning_pipeline::PlanningPipeline(robot_->getModelConst(), handler_.getHandle(),
372  "planning_plugin", "request_adapters"));
373 
374  return true;
375 }
void setParam(const std::string &key, const T &value)
Sets a parameter on the parameter server.
Definition: handler.h:53
const ros::NodeHandle & getHandle() const
Gets the node handle.
planning_pipeline::PlanningPipelinePtr pipeline_
Loaded planning pipeline plugin.
IO::Handler handler_
The parameter handler for the planner.
bool loadOMPLConfig(IO::Handler &handler, const std::string &config_file, std::vector< std::string > &configs)
Loads an OMPL configuration YAML file onto the parameter server.
T size(T... args)
T str(T... args)

◆ operator=()

void robowflex::OMPL::OMPLPipelinePlanner::operator= ( OMPLPipelinePlanner const &  )
delete

Member Data Documentation

◆ configs_

std::vector<std::string> robowflex::OMPL::OMPLPipelinePlanner::configs_
private

Planning configurations loaded from config_file in initialize()

Definition at line 369 of file robowflex_library/include/robowflex_library/planning.h.

◆ DEFAULT_ADAPTERS

const std::vector< std::string > OMPL::OMPLPipelinePlanner::DEFAULT_ADAPTERS
staticprotected

The default planning adapters.

Definition at line 366 of file robowflex_library/include/robowflex_library/planning.h.

◆ DEFAULT_PLUGIN

const std::string OMPL::OMPLPipelinePlanner::DEFAULT_PLUGIN
staticprotected

The default OMPL plugin.

OMPL::PipelinePlanner

Definition at line 365 of file robowflex_library/include/robowflex_library/planning.h.


The documentation for this class was generated from the following files: