moveit2
The MoveIt Motion Planning Framework for ROS 2.
|
#include <model_based_planning_context.h>
Public Member Functions | |
ModelBasedPlanningContext (const std::string &name, const ModelBasedPlanningContextSpecification &spec) | |
~ModelBasedPlanningContext () override | |
void | solve (planning_interface::MotionPlanResponse &res) override |
Solve the motion planning problem and store the result in res. This function should not clear data structures before computing. The constructor and clear() do that. | |
void | solve (planning_interface::MotionPlanDetailedResponse &res) override |
Solve the motion planning problem and store the detailed result in res. This function should not clear data structures before computing. The constructor and clear() do that. | |
void | clear () override |
Clear the data structures used by the planner. | |
bool | terminate () override |
If solve() is running, terminate the computation. Return false if termination not possible. No-op if solve() is not running (returns true). | |
const ModelBasedPlanningContextSpecification & | getSpecification () const |
const std::map< std::string, std::string > & | getSpecificationConfig () const |
void | setSpecificationConfig (const std::map< std::string, std::string > &config) |
const moveit::core::RobotModelConstPtr & | getRobotModel () const |
const moveit::core::JointModelGroup * | getJointModelGroup () const |
const moveit::core::RobotState & | getCompleteInitialRobotState () const |
const ModelBasedStateSpacePtr & | getOMPLStateSpace () const |
const og::SimpleSetupPtr & | getOMPLSimpleSetup () const |
og::SimpleSetupPtr & | getOMPLSimpleSetup () |
const ot::Benchmark & | getOMPLBenchmark () const |
ot::Benchmark & | getOMPLBenchmark () |
const kinematic_constraints::KinematicConstraintSetPtr & | getPathConstraints () const |
unsigned int | getMaximumStateSamplingAttempts () const |
void | setMaximumStateSamplingAttempts (unsigned int max_state_sampling_attempts) |
unsigned int | getMaximumGoalSamplingAttempts () const |
void | setMaximumGoalSamplingAttempts (unsigned int max_goal_sampling_attempts) |
unsigned int | getMaximumGoalSamples () const |
void | setMaximumGoalSamples (unsigned int max_goal_samples) |
unsigned int | getMaximumPlanningThreads () const |
void | setMaximumPlanningThreads (unsigned int max_planning_threads) |
double | getMaximumSolutionSegmentLength () const |
void | setMaximumSolutionSegmentLength (double mssl) |
unsigned int | getMinimumWaypointCount () const |
void | setMinimumWaypointCount (unsigned int mwc) |
Get the minimum number of waypoints along the solution path. | |
const constraint_samplers::ConstraintSamplerManagerPtr & | getConstraintSamplerManager () |
void | setConstraintSamplerManager (const constraint_samplers::ConstraintSamplerManagerPtr &csm) |
void | setVerboseStateValidityChecks (bool flag) |
void | setProjectionEvaluator (const std::string &peval) |
void | setPlanningVolume (const moveit_msgs::msg::WorkspaceParameters &wparams) |
void | setCompleteInitialState (const moveit::core::RobotState &complete_initial_robot_state) |
bool | setGoalConstraints (const std::vector< moveit_msgs::msg::Constraints > &goal_constraints, const moveit_msgs::msg::Constraints &path_constraints, moveit_msgs::msg::MoveItErrorCodes *error) |
bool | setPathConstraints (const moveit_msgs::msg::Constraints &path_constraints, moveit_msgs::msg::MoveItErrorCodes *error) |
void | setConstraintsApproximations (const ConstraintsLibraryPtr &constraints_library) |
ConstraintsLibraryPtr | getConstraintsLibraryNonConst () |
const ConstraintsLibraryPtr & | getConstraintsLibrary () const |
bool | simplifySolutions () const |
void | simplifySolutions (bool flag) |
void | setInterpolation (bool flag) |
void | setHybridize (bool flag) |
const moveit_msgs::msg::MoveItErrorCodes | solve (double timeout, unsigned int count) |
bool | benchmark (double timeout, unsigned int count, const std::string &filename="") |
double | getLastPlanTime () const |
double | getLastSimplifyTime () const |
void | simplifySolution (double timeout) |
void | interpolateSolution () |
bool | getSolutionPath (robot_trajectory::RobotTrajectory &traj) const |
void | convertPath (const og::PathGeometric &pg, robot_trajectory::RobotTrajectory &traj) const |
bool | loadConstraintApproximations (const rclcpp::Node::SharedPtr &node) |
Look up param server 'constraint_approximations' and use its value as the path to load constraint approximations to. | |
bool | saveConstraintApproximations (const rclcpp::Node::SharedPtr &node) |
Look up param server 'constraint_approximations' and use its value as the path to save constraint approximations to. | |
virtual void | configure (const rclcpp::Node::SharedPtr &node, bool use_constraints_approximations) |
Configure ompl_simple_setup_ and optionally the constraints_library_. | |
Public Member Functions inherited from planning_interface::PlanningContext | |
PlanningContext (const std::string &name, const std::string &group) | |
Construct a planning context named name for the group group. | |
virtual | ~PlanningContext () |
const std::string & | getGroupName () const |
Get the name of the group this planning context is for. | |
const std::string & | getName () const |
Get the name of this planning context. | |
const planning_scene::PlanningSceneConstPtr & | getPlanningScene () const |
Get the planning scene associated to this planning context. | |
const MotionPlanRequest & | getMotionPlanRequest () const |
Get the motion plan request associated to this planning context. | |
void | setPlanningScene (const planning_scene::PlanningSceneConstPtr &planning_scene) |
Set the planning scene for this context. | |
void | setMotionPlanRequest (const MotionPlanRequest &request) |
Set the planning request for this context. | |
Protected Member Functions | |
void | preSolve () |
void | postSolve () |
void | startSampling () |
void | stopSampling () |
virtual ob::ProjectionEvaluatorPtr | getProjectionEvaluator (const std::string &peval) const |
virtual ob::StateSamplerPtr | allocPathConstrainedSampler (const ompl::base::StateSpace *ss) const |
virtual void | useConfig () |
virtual ob::GoalPtr | constructGoal () |
virtual ob::PlannerTerminationCondition | constructPlannerTerminationCondition (double timeout, const ompl::time::point &start) |
void | registerTerminationCondition (const ob::PlannerTerminationCondition &ptc) |
void | unregisterTerminationCondition () |
int32_t | logPlannerStatus (const og::SimpleSetupPtr &ompl_simple_setup) |
Convert OMPL PlannerStatus to moveit_msgs::msg::MoveItErrorCode. | |
Protected Attributes | |
ModelBasedPlanningContextSpecification | spec_ |
moveit::core::RobotState | complete_initial_robot_state_ |
og::SimpleSetupPtr | ompl_simple_setup_ |
the OMPL planning context; this contains the problem definition and the planner used | |
ot::Benchmark | ompl_benchmark_ |
the OMPL tool for benchmarking planners | |
ot::ParallelPlan | ompl_parallel_plan_ |
tool used to compute multiple plans in parallel; this uses the problem definition maintained by ompl_simple_setup_ | |
std::vector< int > | space_signature_ |
kinematic_constraints::KinematicConstraintSetPtr | path_constraints_ |
moveit_msgs::msg::Constraints | path_constraints_msg_ |
std::vector< kinematic_constraints::KinematicConstraintSetPtr > | goal_constraints_ |
const ob::PlannerTerminationCondition * | ptc_ |
std::mutex | ptc_lock_ |
double | last_plan_time_ |
the time spent computing the last plan | |
double | last_simplify_time_ |
the time spent simplifying the last plan | |
unsigned int | max_goal_samples_ |
unsigned int | max_state_sampling_attempts_ |
unsigned int | max_goal_sampling_attempts_ |
maximum number of attempts to be made at sampling a goal states | |
unsigned int | max_planning_threads_ |
when planning in parallel, this is the maximum number of threads to use at one time | |
double | max_solution_segment_length_ |
unsigned int | minimum_waypoint_count_ |
bool | multi_query_planning_enabled_ |
when false, clears planners before running solve() | |
ConstraintsLibraryPtr | constraints_library_ |
bool | simplify_solutions_ |
bool | interpolate_ |
bool | hybridize_ |
Protected Attributes inherited from planning_interface::PlanningContext | |
std::string | name_ |
The name of this planning context. | |
std::string | group_ |
The group (as in the SRDF) this planning context is for. | |
planning_scene::PlanningSceneConstPtr | planning_scene_ |
The planning scene for this context. | |
MotionPlanRequest | request_ |
The planning request for this context. | |
Definition at line 87 of file model_based_planning_context.h.
ompl_interface::ModelBasedPlanningContext::ModelBasedPlanningContext | ( | const std::string & | name, |
const ModelBasedPlanningContextSpecification & | spec | ||
) |
Definition at line 81 of file model_based_planning_context.cpp.
|
inlineoverride |
Definition at line 92 of file model_based_planning_context.h.
|
protectedvirtual |
Definition at line 235 of file model_based_planning_context.cpp.
bool ompl_interface::ModelBasedPlanningContext::benchmark | ( | double | timeout, |
unsigned int | count, | ||
const std::string & | filename = "" |
||
) |
Definition at line 697 of file model_based_planning_context.cpp.
|
overridevirtual |
Clear the data structures used by the planner.
Implements planning_interface::PlanningContext.
Definition at line 627 of file model_based_planning_context.cpp.
|
virtual |
Configure ompl_simple_setup_ and optionally the constraints_library_.
ompl_simple_setup_ gets a start state, state sampler, and state validity checker.
node | ROS node used to load the constraint approximations. |
use_constraints_approximations | Set to true if we want to load the constraint approximation. |
Definition at line 109 of file model_based_planning_context.cpp.
|
protectedvirtual |
Definition at line 519 of file model_based_planning_context.cpp.
|
protectedvirtual |
Definition at line 553 of file model_based_planning_context.cpp.
void ompl_interface::ModelBasedPlanningContext::convertPath | ( | const og::PathGeometric & | pg, |
robot_trajectory::RobotTrajectory & | traj | ||
) | const |
Definition at line 490 of file model_based_planning_context.cpp.
|
inline |
Definition at line 127 of file model_based_planning_context.h.
|
inline |
Definition at line 233 of file model_based_planning_context.h.
|
inline |
Definition at line 267 of file model_based_planning_context.h.
|
inline |
Definition at line 262 of file model_based_planning_context.h.
|
inline |
Definition at line 122 of file model_based_planning_context.h.
|
inline |
Definition at line 307 of file model_based_planning_context.h.
|
inline |
Definition at line 313 of file model_based_planning_context.h.
|
inline |
Definition at line 187 of file model_based_planning_context.h.
|
inline |
Definition at line 175 of file model_based_planning_context.h.
|
inline |
Definition at line 199 of file model_based_planning_context.h.
|
inline |
Definition at line 211 of file model_based_planning_context.h.
|
inline |
Definition at line 163 of file model_based_planning_context.h.
|
inline |
Definition at line 222 of file model_based_planning_context.h.
|
inline |
Definition at line 152 of file model_based_planning_context.h.
|
inline |
Definition at line 147 of file model_based_planning_context.h.
|
inline |
Definition at line 142 of file model_based_planning_context.h.
|
inline |
Definition at line 137 of file model_based_planning_context.h.
|
inline |
Definition at line 132 of file model_based_planning_context.h.
|
inline |
Definition at line 157 of file model_based_planning_context.h.
|
protectedvirtual |
Definition at line 166 of file model_based_planning_context.cpp.
|
inline |
Definition at line 117 of file model_based_planning_context.h.
bool ompl_interface::ModelBasedPlanningContext::getSolutionPath | ( | robot_trajectory::RobotTrajectory & | traj | ) | const |
Definition at line 501 of file model_based_planning_context.cpp.
|
inline |
Definition at line 102 of file model_based_planning_context.h.
|
inline |
Definition at line 107 of file model_based_planning_context.h.
void ompl_interface::ModelBasedPlanningContext::interpolateSolution | ( | ) |
Definition at line 462 of file model_based_planning_context.cpp.
bool ompl_interface::ModelBasedPlanningContext::loadConstraintApproximations | ( | const rclcpp::Node::SharedPtr & | node | ) |
Look up param server 'constraint_approximations' and use its value as the path to load constraint approximations to.
Definition at line 1055 of file model_based_planning_context.cpp.
|
protected |
Convert OMPL PlannerStatus to moveit_msgs::msg::MoveItErrorCode.
Definition at line 973 of file model_based_planning_context.cpp.
|
protected |
Definition at line 755 of file model_based_planning_context.cpp.
|
protected |
Definition at line 742 of file model_based_planning_context.cpp.
|
protected |
Definition at line 961 of file model_based_planning_context.cpp.
bool ompl_interface::ModelBasedPlanningContext::saveConstraintApproximations | ( | const rclcpp::Node::SharedPtr & | node | ) |
Look up param server 'constraint_approximations' and use its value as the path to save constraint approximations to.
Definition at line 1043 of file model_based_planning_context.cpp.
void ompl_interface::ModelBasedPlanningContext::setCompleteInitialState | ( | const moveit::core::RobotState & | complete_initial_robot_state | ) |
Definition at line 621 of file model_based_planning_context.cpp.
|
inline |
Definition at line 238 of file model_based_planning_context.h.
|
inline |
Definition at line 257 of file model_based_planning_context.h.
bool ompl_interface::ModelBasedPlanningContext::setGoalConstraints | ( | const std::vector< moveit_msgs::msg::Constraints > & | goal_constraints, |
const moveit_msgs::msg::Constraints & | path_constraints, | ||
moveit_msgs::msg::MoveItErrorCodes * | error | ||
) |
Definition at line 664 of file model_based_planning_context.cpp.
|
inline |
Definition at line 287 of file model_based_planning_context.h.
|
inline |
Definition at line 282 of file model_based_planning_context.h.
|
inline |
Definition at line 193 of file model_based_planning_context.h.
|
inline |
Definition at line 181 of file model_based_planning_context.h.
|
inline |
Definition at line 205 of file model_based_planning_context.h.
|
inline |
Definition at line 217 of file model_based_planning_context.h.
|
inline |
Definition at line 169 of file model_based_planning_context.h.
|
inline |
Get the minimum number of waypoints along the solution path.
Definition at line 228 of file model_based_planning_context.h.
bool ompl_interface::ModelBasedPlanningContext::setPathConstraints | ( | const moveit_msgs::msg::Constraints & | path_constraints, |
moveit_msgs::msg::MoveItErrorCodes * | error | ||
) |
Definition at line 653 of file model_based_planning_context.cpp.
void ompl_interface::ModelBasedPlanningContext::setPlanningVolume | ( | const moveit_msgs::msg::WorkspaceParameters & | wparams | ) |
Definition at line 433 of file model_based_planning_context.cpp.
void ompl_interface::ModelBasedPlanningContext::setProjectionEvaluator | ( | const std::string & | peval | ) |
Definition at line 154 of file model_based_planning_context.cpp.
|
inline |
Definition at line 112 of file model_based_planning_context.h.
void ompl_interface::ModelBasedPlanningContext::setVerboseStateValidityChecks | ( | bool | flag | ) |
Definition at line 511 of file model_based_planning_context.cpp.
void ompl_interface::ModelBasedPlanningContext::simplifySolution | ( | double | timeout | ) |
Definition at line 452 of file model_based_planning_context.cpp.
|
inline |
Definition at line 272 of file model_based_planning_context.h.
|
inline |
Definition at line 277 of file model_based_planning_context.h.
const moveit_msgs::msg::MoveItErrorCodes ompl_interface::ModelBasedPlanningContext::solve | ( | double | timeout, |
unsigned int | count | ||
) |
Definition at line 848 of file model_based_planning_context.cpp.
|
overridevirtual |
Solve the motion planning problem and store the detailed result in res. This function should not clear data structures before computing. The constructor and clear() do that.
Implements planning_interface::PlanningContext.
Definition at line 802 of file model_based_planning_context.cpp.
|
overridevirtual |
Solve the motion planning problem and store the result in res. This function should not clear data structures before computing. The constructor and clear() do that.
Implements planning_interface::PlanningContext.
Definition at line 772 of file model_based_planning_context.cpp.
|
protected |
Definition at line 714 of file model_based_planning_context.cpp.
|
protected |
Definition at line 728 of file model_based_planning_context.cpp.
|
overridevirtual |
If solve() is running, terminate the computation. Return false if termination not possible. No-op if solve() is not running (returns true).
Implements planning_interface::PlanningContext.
Definition at line 1033 of file model_based_planning_context.cpp.
|
protected |
Definition at line 967 of file model_based_planning_context.cpp.
|
protectedvirtual |
Definition at line 286 of file model_based_planning_context.cpp.
|
protected |
Definition at line 395 of file model_based_planning_context.h.
|
protected |
Definition at line 446 of file model_based_planning_context.h.
|
protected |
Definition at line 410 of file model_based_planning_context.h.
|
protected |
Definition at line 454 of file model_based_planning_context.h.
|
protected |
Definition at line 451 of file model_based_planning_context.h.
|
protected |
the time spent computing the last plan
Definition at line 416 of file model_based_planning_context.h.
|
protected |
the time spent simplifying the last plan
Definition at line 419 of file model_based_planning_context.h.
|
protected |
maximum number of valid states to store in the goal region for any planning request (when such sampling is possible)
Definition at line 423 of file model_based_planning_context.h.
|
protected |
maximum number of attempts to be made at sampling a goal states
Definition at line 430 of file model_based_planning_context.h.
|
protected |
when planning in parallel, this is the maximum number of threads to use at one time
Definition at line 433 of file model_based_planning_context.h.
|
protected |
the maximum length that is allowed for segments that make up the motion plan; by default this is 1% from the extent of the space
Definition at line 437 of file model_based_planning_context.h.
|
protected |
maximum number of attempts to be made at sampling a state when attempting to find valid states that satisfy some set of constraints
Definition at line 427 of file model_based_planning_context.h.
|
protected |
the minimum number of points to include on the solution path (interpolation is used to reach this number, if needed)
Definition at line 441 of file model_based_planning_context.h.
|
protected |
when false, clears planners before running solve()
Definition at line 444 of file model_based_planning_context.h.
|
protected |
the OMPL tool for benchmarking planners
Definition at line 401 of file model_based_planning_context.h.
|
protected |
tool used to compute multiple plans in parallel; this uses the problem definition maintained by ompl_simple_setup_
Definition at line 404 of file model_based_planning_context.h.
|
protected |
the OMPL planning context; this contains the problem definition and the planner used
Definition at line 398 of file model_based_planning_context.h.
|
protected |
Definition at line 408 of file model_based_planning_context.h.
|
protected |
Definition at line 409 of file model_based_planning_context.h.
|
protected |
Definition at line 412 of file model_based_planning_context.h.
|
protected |
Definition at line 413 of file model_based_planning_context.h.
|
protected |
Definition at line 448 of file model_based_planning_context.h.
|
protected |
Definition at line 406 of file model_based_planning_context.h.
|
protected |
Definition at line 393 of file model_based_planning_context.h.