43#include <ompl/geometric/SimpleSetup.h>
44#include <ompl/tools/benchmark/Benchmark.h>
45#include <ompl/tools/multiplan/ParallelPlan.h>
46#include <ompl/base/StateStorage.h>
47#include <ompl/base/spaces/constraint/ConstrainedStateSpace.h>
51namespace ob = ompl::base;
52namespace og = ompl::geometric;
53namespace ot = ompl::tools;
59typedef std::function<ob::PlannerPtr(
const ompl::base::SpaceInformationPtr& si,
const std::string& name,
66 std::map<std::string, std::string>
config_;
99 void clear()
override;
251 bool setGoalConstraints(
const std::vector<moveit_msgs::msg::Constraints>& goal_constraints,
252 const moveit_msgs::msg::Constraints& path_constraints,
253 moveit_msgs::msg::MoveItErrorCodes* error);
255 moveit_msgs::msg::MoveItErrorCodes* error);
296 const moveit_msgs::msg::MoveItErrorCodes
solve(
double timeout,
unsigned int count);
304 bool benchmark(
double timeout,
unsigned int count,
const std::string& filename =
"");
345 virtual void configure(
const rclcpp::Node::SharedPtr& node,
bool use_constraints_approximations);
385 const ompl::time::point& start);
412 const ob::PlannerTerminationCondition*
ptc_;
#define MOVEIT_CLASS_FORWARD(C)
Representation of a robot's state. This includes position, velocity, acceleration and effort.
og::SimpleSetupPtr & getOMPLSimpleSetup()
const ConstraintsLibraryPtr & getConstraintsLibrary() const
void setHybridize(bool flag)
int32_t logPlannerStatus(const og::SimpleSetupPtr &ompl_simple_setup)
Convert OMPL PlannerStatus to moveit_msgs::msg::MoveItErrorCode.
void setVerboseStateValidityChecks(bool flag)
virtual ob::ProjectionEvaluatorPtr getProjectionEvaluator(const std::string &peval) const
unsigned int minimum_waypoint_count_
void clear() override
Clear the data structures used by the planner.
bool getSolutionPath(robot_trajectory::RobotTrajectory &traj) const
double last_plan_time_
the time spent computing the last plan
void registerTerminationCondition(const ob::PlannerTerminationCondition &ptc)
const ob::PlannerTerminationCondition * ptc_
const std::map< std::string, std::string > & getSpecificationConfig() const
unsigned int max_planning_threads_
when planning in parallel, this is the maximum number of threads to use at one time
void setMaximumSolutionSegmentLength(double mssl)
bool loadConstraintApproximations(const rclcpp::Node::SharedPtr &node)
Look up param server 'constraint_approximations' and use its value as the path to load constraint app...
std::vector< int > space_signature_
void setMaximumPlanningThreads(unsigned int max_planning_threads)
const ModelBasedPlanningContextSpecification & getSpecification() const
bool setPathConstraints(const moveit_msgs::msg::Constraints &path_constraints, moveit_msgs::msg::MoveItErrorCodes *error)
void interpolateSolution()
const ot::Benchmark & getOMPLBenchmark() const
virtual ob::PlannerTerminationCondition constructPlannerTerminationCondition(double timeout, const ompl::time::point &start)
void setInterpolation(bool flag)
bool saveConstraintApproximations(const rclcpp::Node::SharedPtr &node)
Look up param server 'constraint_approximations' and use its value as the path to save constraint app...
const moveit::core::RobotState & getCompleteInitialRobotState() const
double getLastPlanTime() const
bool multi_query_planning_enabled_
when false, clears planners before running solve()
virtual void configure(const rclcpp::Node::SharedPtr &node, bool use_constraints_approximations)
Configure ompl_simple_setup_ and optionally the constraints_library_.
void setMaximumStateSamplingAttempts(unsigned int max_state_sampling_attempts)
bool setGoalConstraints(const std::vector< moveit_msgs::msg::Constraints > &goal_constraints, const moveit_msgs::msg::Constraints &path_constraints, moveit_msgs::msg::MoveItErrorCodes *error)
void setMaximumGoalSamplingAttempts(unsigned int max_goal_sampling_attempts)
const moveit::core::RobotModelConstPtr & getRobotModel() const
void convertPath(const og::PathGeometric &pg, robot_trajectory::RobotTrajectory &traj) const
std::vector< kinematic_constraints::KinematicConstraintSetPtr > goal_constraints_
const ModelBasedStateSpacePtr & getOMPLStateSpace() const
kinematic_constraints::KinematicConstraintSetPtr path_constraints_
unsigned int getMaximumGoalSamplingAttempts() const
~ModelBasedPlanningContext() override
unsigned int max_goal_sampling_attempts_
maximum number of attempts to be made at sampling a goal states
void setCompleteInitialState(const moveit::core::RobotState &complete_initial_robot_state)
unsigned int getMaximumGoalSamples() const
void simplifySolutions(bool flag)
unsigned int getMinimumWaypointCount() const
og::SimpleSetupPtr ompl_simple_setup_
the OMPL planning context; this contains the problem definition and the planner used
moveit::core::RobotState complete_initial_robot_state_
unsigned int max_goal_samples_
ConstraintsLibraryPtr getConstraintsLibraryNonConst()
void setPlanningVolume(const moveit_msgs::msg::WorkspaceParameters &wparams)
void setConstraintSamplerManager(const constraint_samplers::ConstraintSamplerManagerPtr &csm)
const moveit::core::JointModelGroup * getJointModelGroup() const
double getLastSimplifyTime() const
moveit_msgs::msg::Constraints path_constraints_msg_
ot::Benchmark ompl_benchmark_
the OMPL tool for benchmarking planners
ConstraintsLibraryPtr constraints_library_
void unregisterTerminationCondition()
unsigned int getMaximumStateSamplingAttempts() const
bool terminate() override
If solve() is running, terminate the computation. Return false if termination not possible....
virtual ob::StateSamplerPtr allocPathConstrainedSampler(const ompl::base::StateSpace *ss) const
void setMinimumWaypointCount(unsigned int mwc)
Get the minimum number of waypoints along the solution path.
unsigned int max_state_sampling_attempts_
void simplifySolution(double timeout)
void setProjectionEvaluator(const std::string &peval)
void setMaximumGoalSamples(unsigned int max_goal_samples)
bool simplifySolutions() const
void solve(planning_interface::MotionPlanResponse &res) override
Solve the motion planning problem and store the result in res. This function should not clear data st...
ModelBasedPlanningContextSpecification spec_
void setSpecificationConfig(const std::map< std::string, std::string > &config)
double getMaximumSolutionSegmentLength() const
unsigned int getMaximumPlanningThreads() const
ot::ParallelPlan ompl_parallel_plan_
tool used to compute multiple plans in parallel; this uses the problem definition maintained by ompl_...
const og::SimpleSetupPtr & getOMPLSimpleSetup() const
virtual ob::GoalPtr constructGoal()
const constraint_samplers::ConstraintSamplerManagerPtr & getConstraintSamplerManager()
double last_simplify_time_
the time spent simplifying the last plan
double max_solution_segment_length_
void setConstraintsApproximations(const ConstraintsLibraryPtr &constraints_library)
const kinematic_constraints::KinematicConstraintSetPtr & getPathConstraints() const
ot::Benchmark & getOMPLBenchmark()
Representation of a particular planning context – the planning scene and the request are known,...
Maintain a sequence of waypoints and the time durations between these waypoints.
The MoveIt interface to OMPL.
std::function< ob::PlannerPtr(const ompl::base::SpaceInformationPtr &si, const std::string &name, const ModelBasedPlanningContextSpecification &spec)> ConfiguredPlannerAllocator
std::function< ConfiguredPlannerAllocator(const std::string &planner_type)> ConfiguredPlannerSelector
ModelBasedStateSpacePtr state_space_
constraint_samplers::ConstraintSamplerManagerPtr constraint_sampler_manager_
ob::ConstrainedStateSpacePtr constrained_state_space_
OMPL constrained state space to handle path constraints.
std::map< std::string, std::string > config_
ConfiguredPlannerSelector planner_selector_
og::SimpleSetupPtr ompl_simple_setup_
Response to a planning query.