Robowflex
v0.1
Making MoveIt Easy
|
A thread pool of planners P to service requests in a multi-threaded environment simultaneously. More...
#include <planning.h>
Public Member Functions | |
PoolPlanner (const RobotPtr &robot, unsigned int n=std::thread::hardware_concurrency(), 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... | |
PoolPlanner (PoolPlanner const &)=delete | |
void | operator= (PoolPlanner const &)=delete |
template<typename P , typename... Args> | |
bool | initialize (Args &&... args) |
Initialize the planner pool. Forwards template arguments Args to the initializer of the templated planner P. Assumes that the constructor of the planner takes robot_ and name_. More... | |
std::shared_ptr< Pool::Job< planning_interface::MotionPlanResponse > > | submit (const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request) |
Submit a motion planning request job to the queue. More... | |
planning_interface::MotionPlanResponse | plan (const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request) override |
Plan a motion given a request and a scene. Forwards the planning request onto the thread pool to be executed. Blocks until complete and returns result. 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... | |
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, ProgressProperty > | getProgressProperties (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::string & | getName () 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... | |
Private Attributes | |
Pool | pool_ |
Thread pool. More... | |
std::queue< PlannerPtr > | planners_ |
Motion planners. More... | |
std::mutex | mutex_ |
Planner mutex. More... | |
std::condition_variable | cv_ |
Planner condition variable. More... | |
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::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 thread pool of planners P to service requests in a multi-threaded environment simultaneously.
Definition at line 101 of file robowflex_library/include/robowflex_library/planning.h.
PoolPlanner::PoolPlanner | ( | const RobotPtr & | robot, |
unsigned int | n = std::thread::hardware_concurrency() , |
||
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.
[in] | robot | The robot to plan for. |
[in] | n | The number of threads to use. By default uses maximum available on the machine. |
[in] | name | Optional namespace for planner. |
Definition at line 57 of file robowflex_library/src/planning.cpp.
|
delete |
|
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 91 of file robowflex_library/src/planning.cpp.
|
inline |
Initialize the planner pool. Forwards template arguments Args to the initializer of the templated planner P. Assumes that the constructor of the planner takes robot_ and name_.
[in] | args | Arguments to initializer of planner P. |
P | The robowflex::Planner to pool. |
Args | Argument types to initializer of planner P. |
Definition at line 127 of file robowflex_library/include/robowflex_library/planning.h.
|
delete |
|
overridevirtual |
Plan a motion given a request and a scene. Forwards the planning request onto the thread pool to be executed. Blocks until complete and returns result.
[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 84 of file robowflex_library/src/planning.cpp.
std::shared_ptr< Pool::Job< planning_interface::MotionPlanResponse > > PoolPlanner::submit | ( | const SceneConstPtr & | scene, |
const planning_interface::MotionPlanRequest & | request | ||
) |
Submit a motion planning request job to the queue.
[in] | scene | Planning scene to plane for. |
[in] | request | Motion plan request to service. |
Definition at line 63 of file robowflex_library/src/planning.cpp.
|
private |
Planner condition variable.
Definition at line 167 of file robowflex_library/include/robowflex_library/planning.h.
|
private |
Planner mutex.
Definition at line 166 of file robowflex_library/include/robowflex_library/planning.h.
|
private |
Motion planners.
Definition at line 165 of file robowflex_library/include/robowflex_library/planning.h.
|
private |
Thread pool.
Definition at line 163 of file robowflex_library/include/robowflex_library/planning.h.