Robowflex
v0.1
Making MoveIt Easy
|
A planner that directly uses MoveIt!'s OMPL planning interface. More...
#include <ompl_interface.h>
Public Types | |
using | PrePlanCallback = std::function< void(const ompl_interface::ModelBasedPlanningContextPtr &context, const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request)> |
Type for the callback function to be called right before planning takes place, when the planning context is available. More... | |
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... | |
Public Member Functions | |
OMPLInterfacePlanner (const RobotPtr &robot, const std::string &name="") | |
Constructor. More... | |
OMPLInterfacePlanner (OMPLInterfacePlanner const &)=delete | |
void | operator= (OMPLInterfacePlanner const &)=delete |
bool | initialize (const std::string &config_file="", const OMPL::Settings settings=Settings()) |
Initialize planning pipeline. More... | |
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... | |
ompl_interface::ModelBasedPlanningContextPtr | getPlanningContext (const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request) const |
Returns the planning context used for this motion planning request. More... | |
ompl::geometric::SimpleSetupPtr | getLastSimpleSetup () const |
Get the last OMPL simple setup used in planning. More... | |
void | refreshContext (const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request, bool force=false) const |
Refreshes the internal planning context. More... | |
std::map< std::string, Planner::ProgressProperty > | getProgressProperties (const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request) const override |
Retrieve the planner progress property map for this planner given a specific request. More... | |
std::vector< std::string > | getPlannerConfigs () 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... | |
void | preRun (const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request) override |
This function is called before benchmarking. More... | |
ompl_interface::OMPLInterface & | getInterface () const |
Access the OMPLInterface directly, to customize the planning process. More... | |
void | setPrePlanCallback (const PrePlanCallback &prePlanCallback) |
Set a callback, to be called right before a planning session for last-minute configuration or external bookkeeping. 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 |
const RobotPtr | getRobot () const |
Return the robot for this planner. More... | |
const std::string & | getName () const |
Get the name of the planner. More... | |
Private Attributes | |
std::unique_ptr< ompl_interface::OMPLInterface > | interface_ {nullptr} |
Planning interface. More... | |
std::vector< std::string > | configs_ |
Planning configurations. More... | |
bool | hybridize_ |
Whether or not planner should hybridize solutions. More... | |
bool | interpolate_ |
Whether or not planner should interpolate solutions. More... | |
ID::Key | last_scene_id_ {ID::getNullKey()} |
ID of last scene. More... | |
std::string | last_request_hash_ |
Hash of last request. More... | |
ompl_interface::ModelBasedPlanningContextPtr | context_ |
Last context. More... | |
ompl::geometric::SimpleSetupPtr | ss_ |
PrePlanCallback | pre_plan_callback_ |
Callback to be called just before planning. More... | |
Additional Inherited Members | |
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... | |
A planner that directly uses MoveIt!'s OMPL planning interface.
Definition at line 34 of file ompl_interface.h.
using robowflex::OMPL::OMPLInterfacePlanner::PrePlanCallback = std::function<void( const ompl_interface::ModelBasedPlanningContextPtr &context, const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request)> |
Type for the callback function to be called right before planning takes place, when the planning context is available.
[in] | context | The planning context, contains SimpleSetup that will be used. |
[in] | scene | The planning scene being planned on. |
[in] | request | The request to plan a path for. |
Definition at line 106 of file ompl_interface.h.
OMPL::OMPLInterfacePlanner::OMPLInterfacePlanner | ( | const RobotPtr & | robot, |
const std::string & | name = "" |
||
) |
Constructor.
[in] | robot | The robot to plan for. |
[in] | name | Optional namespace for planner. |
Definition at line 14 of file ompl_interface.cpp.
|
delete |
ompl_interface::OMPLInterface & OMPL::OMPLInterfacePlanner::getInterface | ( | ) | const |
Access the OMPLInterface directly, to customize the planning process.
Definition at line 148 of file ompl_interface.cpp.
ompl::geometric::SimpleSetupPtr OMPL::OMPLInterfacePlanner::getLastSimpleSetup | ( | ) | const |
Get the last OMPL simple setup used in planning.
Definition at line 138 of file ompl_interface.cpp.
|
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().
Implements robowflex::Planner.
Definition at line 143 of file ompl_interface.cpp.
ompl_interface::ModelBasedPlanningContextPtr OMPL::OMPLInterfacePlanner::getPlanningContext | ( | const SceneConstPtr & | scene, |
const planning_interface::MotionPlanRequest & | request | ||
) | const |
Returns the planning context used for this motion planning request.
[in] | scene | A planning scene for the same robot_ to compute the plan in. |
[in] | request | The motion planning request to solve. |
Definition at line 47 of file ompl_interface.cpp.
|
overridevirtual |
Retrieve the planner progress property map for this planner given a specific request.
[in] | scene | A planning scene for the same robot_ to compute the plan in. |
[in] | request | Request to get progress properties for. |
Reimplemented from robowflex::Planner.
Definition at line 76 of file ompl_interface.cpp.
bool OMPL::OMPLInterfacePlanner::initialize | ( | const std::string & | config_file = "" , |
const OMPL::Settings | settings = Settings() |
||
) |
Initialize planning pipeline.
[in] | config_file | A YAML file containing OMPL planner configurations. |
[in] | settings | Settings to set on the parameter server. |
Definition at line 19 of file ompl_interface.cpp.
|
delete |
|
overridevirtual |
Plan a motion given a request and a scene. Uses the planning pipeline's generatePlan() method, which goes through planning adapters.
[in] | scene | A planning scene for the same robot_ to compute the plan in. |
[in] | request | The motion planning request to solve. |
Implements robowflex::Planner.
Definition at line 59 of file ompl_interface.cpp.
|
overridevirtual |
This function is called before benchmarking.
[in] | scene | Scene to plan for. |
[in] | request | Planning request. |
Reimplemented from robowflex::Planner.
Definition at line 53 of file ompl_interface.cpp.
void OMPL::OMPLInterfacePlanner::refreshContext | ( | const SceneConstPtr & | scene, |
const planning_interface::MotionPlanRequest & | request, | ||
bool | force = false |
||
) | const |
Refreshes the internal planning context.
[in] | scene | A planning scene for the same robot_ to compute the plan in. |
[in] | request | The motion planning request to solve. |
[in] | force | If true, forces a refresh of the context. |
Definition at line 101 of file ompl_interface.cpp.
void OMPL::OMPLInterfacePlanner::setPrePlanCallback | ( | const PrePlanCallback & | prePlanCallback | ) |
Set a callback, to be called right before a planning session for last-minute configuration or external bookkeeping.
refreshContext() will already have been called, so the SimpleSetup obtained by getLastSimpleSetup() will be the one used for planning.
Definition at line 157 of file ompl_interface.cpp.
|
private |
Planning configurations.
Definition at line 120 of file ompl_interface.h.
|
mutableprivate |
Last context.
Definition at line 127 of file ompl_interface.h.
|
private |
Whether or not planner should hybridize solutions.
Definition at line 121 of file ompl_interface.h.
|
private |
Planning interface.
Definition at line 119 of file ompl_interface.h.
|
private |
Whether or not planner should interpolate solutions.
Definition at line 122 of file ompl_interface.h.
|
mutableprivate |
Hash of last request.
Definition at line 125 of file ompl_interface.h.
|
mutableprivate |
ID of last scene.
Definition at line 124 of file ompl_interface.h.
|
private |
Callback to be called just before planning.
Definition at line 131 of file ompl_interface.h.
|
mutableprivate |
Last OMPL simple setup used for planning.
Definition at line 128 of file ompl_interface.h.