3 #ifndef ROBOWFLEX_PLANNER_
4 #define ROBOWFLEX_PLANNER_
6 #include <moveit/planning_pipeline/planning_pipeline.h>
126 template <
typename P,
typename... Args>
133 if (!planner->initialize(std::forward<Args>(args)...))
216 void setMaxStep(
double position,
double rotation);
274 template <
typename T>
281 auto pc =
pipeline_->getPlannerManager()->getPlanningContext(
scene->getSceneConst(), request);
282 return std::dynamic_pointer_cast<T>(pc);
#define ROBOWFLEX_CLASS_FORWARD(C)
Macro that forward declares a class and defines two shared ptrs types:
ROS parameter server handler to handle namespacing and automatic parameter deletion.
A robowflex::PipelinePlanner that uses the MoveIt! default OMPL planning pipeline.
OMPLPipelinePlanner(const RobotPtr &robot, const std::string &name="")
std::vector< std::string > configs_
void operator=(OMPLPipelinePlanner const &)=delete
static const std::string DEFAULT_PLUGIN
The default OMPL plugin.
static const std::vector< std::string > DEFAULT_ADAPTERS
The default planning adapters.
std::vector< std::string > getPlannerConfigs() const override
Return all planner configurations offered by this planner. Any of the configurations returned can be ...
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....
OMPLPipelinePlanner(OMPLPipelinePlanner const &)=delete
Settings descriptor for settings provided by the default MoveIt! OMPL planning pipeline.
bool use_constraints_approximations
Absolute silliness.
void setParam(IO::Handler &handler) const
Sets member variables on the parameter server using handler.
bool display_random_valid_states
N/A, defunct.
int minimum_waypoint_count
Minimum number of waypoints in output path.
int max_goal_samples
Maximum number of successful goal samples to keep.
int max_state_sampling_attempts
Maximum number of attempts to sample a new state.
int max_planning_threads
Maximum number of threads used to service a request.
bool interpolate_solutions
Whether or not planner should interpolate solutions.
bool hybridize_solutions
Whether or not planner should hybridize solutions.
double max_solution_segment_length
Maximum solution segment length.
double maximum_waypoint_distance
Maximum distance between waypoints in path.
Settings()
Constructor. Initialized here so an empty class can be used as default arguments in a function.
bool simplify_solutions
Whether or not planner should simplify solutions.
int max_goal_sampling_attempts
Maximum number of attempts to sample a goal.
std::string link_for_exploration_tree
N/A, defunct.
A motion planner that uses the MoveIt! planning pipeline to load a planner plugin.
PipelinePlanner(const RobotPtr &robot, const std::string &name="")
Constructor.
PipelinePlanner(PipelinePlanner const &)=delete
planning_pipeline::PlanningPipelinePtr pipeline_
Loaded planning pipeline plugin.
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.
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,...
An abstract interface to a motion planning algorithm.
const RobotPtr getRobot() const
Return the robot for this planner.
virtual std::vector< std::string > getPlannerConfigs() const =0
Return all planner configurations offered by this planner. Any of the configurations returned can be ...
Planner(Planner const &)=delete
void operator=(Planner const &)=delete
const std::string & getName() const
Get the name of the planner.
const std::string name_
Namespace for the planner.
IO::Handler handler_
The parameter handler for the planner.
virtual planning_interface::MotionPlanResponse plan(const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request)=0
Plan a motion given a request and a scene. A virtual method that must be implemented by any robowflex...
RobotPtr robot_
The robot to plan for.
virtual void preRun(const SceneConstPtr &scene, const planning_interface::MotionPlanRequest &request)
This function is called before benchmarking.
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.
Planner(const RobotPtr &robot, const std::string &name="")
Constructor. Takes in a robot description and an optional namespace name. If name is specified,...
A thread pool of planners P to service requests in a multi-threaded environment simultaneously.
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.
std::mutex mutex_
Planner mutex.
PoolPlanner(PoolPlanner const &)=delete
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 e...
void operator=(PoolPlanner const &)=delete
std::condition_variable cv_
Planner condition variable.
std::queue< PlannerPtr > planners_
Motion planners.
bool initialize(Args &&... args)
Initialize the planner pool. Forwards template arguments Args to the initializer of the templated pla...
std::vector< std::string > getPlannerConfigs() const override
Return all planner configurations offered by this planner. Any of the configurations returned can be ...
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,...
A thread pool that can execute arbitrary functions asynchronously. Functions with arguments to be exe...
unsigned int getThreadCount() const
Get the number of threads.
A shared pointer wrapper for robowflex::Robot.
A const shared pointer wrapper for robowflex::Scene.
A simple motion planner that uses interpolation of the end-effector in Cartesian space to find a path...
double jump_threshold_pri_
planning_interface::MotionPlanResponse plan(const robot_state::RobotState &start, const Robot::IKQuery &request)
Plan a Cartesian motion (interpolation) given a request and a scene from a start configuration....
SimpleCartesianPlanner(SimpleCartesianPlanner const &)=delete
void setJumpThreshold(double prismatic, double revolute)
Set the maximum difference in joint configurations allowed by the planner between output waypoints.
SimpleCartesianPlanner(const RobotPtr &robot, const std::string &name="")
Constructor.
std::vector< std::string > getPlannerConfigs() const override
Return all planner configurations offered by this planner. Any of the configurations returned can be ...
double jump_threshold_rev_
double max_step_rot_
Max EE step size for rotation in radians.
double max_step_pos_
Max EE step size for position in meters.
void setMaxStep(double position, double rotation)
Set the maximum step size allowed by the planner between output waypoints.
void operator=(SimpleCartesianPlanner const &)=delete
A robowflex::PipelinePlanner that uses the MoveIt! CHOMP planning pipeline.
static const std::string DEFAULT_PLUGIN
The default CHOMP plugin.
CHOMPPipelinePlanner(const RobotPtr &robot, const std::string &name="")
bool initialize(const std::string &config_file, const std::string &plugin=DEFAULT_PLUGIN, const std::vector< std::string > &adapters=DEFAULT_ADAPTERS)
Initialize planning pipeline. Loads CHOMP planning plugin plugin with the planning adapters adapters....
static const std::vector< std::string > DEFAULT_ADAPTERS
The default planning adapters.
CHOMPPipelinePlanner(CHOMPPipelinePlanner const &)=delete
std::vector< std::string > getPlannerConfigs() const override
Return all planner configurations offered by this planner. Any of the configurations returned can be ...
bool finishInitialize(const std::string &plugin, const std::vector< std::string > &adapters)
Finalize the initialization process after parameters are set.
std::vector< std::string > configs_
Planning configurations loaded from config_file.
void operator=(CHOMPPipelinePlanner const &)=delete
Settings descriptor for settings provided by the default MoveIt! CHOMP planning pipeline.
double learning_rate
Learning rate for gradient descent.
std::string trajectory_initialization_method
double hmc_discretization
Discretization level for the Hamiltonian MonteCarlo.
double pseudo_inverse_ridge_factor
ridge factor when pseudo-inverse is on.
double joint_update_limit
Update limit for the robot joints.
double obstacle_cost_weight
Weight given to the obstacle cost in optimization problem.
double planning_time_limit
Maximum time the optimizer can take to find a solution.
bool animate_path
Whether to create an animated path.
void setParam(IO::Handler &handler) const
Sets member variables on the parameter server using handler.
double random_jump_amount
Amount of random jump.
bool use_pseudo_inverse
Whether to use pseudo-inverse computations or not.
double smoothness_cost_jerk
Variable associated with the cost in jerk.
bool add_randomness
Whether to add randomness.
double smoothness_cost_acceleration
Variable associtated with the cost in acceleration.
double collision_clearence
int max_iterations
Maximum number of iterations the planner can take while optimization.
int max_recovery_attempts
Maximum number of times that CHOMP tweaks parameters.
double smoothness_cost_weight
Weight given to the smoothnes cost in optimization problem.
CHOMPSettings()
Constructor. Initialized here so an empty class can be used as default arguments in a function.
bool enable_failure_recovery
bool use_stochastic_descent
Whether to use SGD or not.
double hmc_annealing_factor
Annealing factor in Hamiltonian MonteCarlo.
double smoothness_cost_velocity
Variable associated with the cost in velocity.
double hmc_stochasticity
Stochasticity level of Hamitonian MonteCarlo.
double start_state_max_bounds_error
Maximum bound errors for the initial state.
std::string animate_endeffector_segment
Name of end effector segment to animate.
bool animate_endeffector
Whether to animate the end effector or not.
double collision_threshold
Cost threshold for collision detection.
bool use_hamiltonian_monte_carlo
Whether to use hamiltonian monte carlo or not.
int max_iterations_after_collision_free
A robowflex::PipelinePlanner that uses the MoveIt! TrajOpt planning pipeline.
TrajOptPipelinePlanner(const RobotPtr &robot, const std::string &name="")
bool initialize(const std::string &config_file="", const std::string &plugin=DEFAULT_PLUGIN, const std::vector< std::string > &adapters=DEFAULT_ADAPTERS)
Initialize planning pipeline. Loads TrajOpt planning plugin plugin with the planning adapters adapter...
static const std::vector< std::string > DEFAULT_ADAPTERS
The default planning adapters.
void operator=(TrajOptPipelinePlanner const &)=delete
static const std::string DEFAULT_PLUGIN
The default TrajOpt plugin.
TrajOptPipelinePlanner(TrajOptPipelinePlanner const &)=delete
T hardware_concurrency(T... args)
moveit_msgs::MotionPlanRequest MotionPlanRequest
Functions for loading and animating robots in Blender.
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.
static const double cart_pos_jump_tol
static const double cart_pos_step_size
static const double cart_rot_jump_tol
static const double cart_rot_step_size
bool loadConfig(IO::Handler &handler, const std::string &config_file)
Loads configuration YAML file onto the parameter server.
Main namespace. Contains all library classes and functions.
Functions for loading and animating scenes in Blender.
Robot IK Query options. IK queries in Robowflex consist of: a) A position specified by some geometric...