File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
include/moveit/task_constructor/solvers Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ class PipelinePlanner : public PlannerInterface
5757public:
5858 PipelinePlanner ();
5959
60+ PipelinePlanner (const planning_pipeline::PlanningPipelinePtr& planning_pipeline);
61+
6062 void setPlannerId (const std::string& planner) { setProperty (" planner" , planner); }
6163
6264 void init (const moveit::core::RobotModelConstPtr& robot_model) override ;
Original file line number Diff line number Diff line change @@ -67,9 +67,18 @@ PipelinePlanner::PipelinePlanner() {
6767 planning_pipeline::PlanningPipeline::MOTION_PLAN_REQUEST_TOPIC);
6868}
6969
70- void PipelinePlanner::init (const core::RobotModelConstPtr& robot_model) {
71- planner_ = Task::createPlanner (robot_model);
70+ PipelinePlanner::PipelinePlanner (const planning_pipeline::PlanningPipelinePtr& planning_pipeline) : PipelinePlanner() {
71+ planner_ = planning_pipeline;
72+ }
7273
74+ void PipelinePlanner::init (const core::RobotModelConstPtr& robot_model) {
75+ if (!planner_) {
76+ planner_ = Task::createPlanner (robot_model);
77+ } else if (robot_model != planner_->getRobotModel ()) {
78+ throw std::runtime_error (
79+ " The robot model of the planning pipeline isn't the same as the task's robot model -- "
80+ " use Task::setRobotModel for setting the robot model when using custom planning pipeline" );
81+ }
7382 planner_->displayComputedMotionPlans (properties ().get <bool >(" display_motion_plans" ));
7483 planner_->publishReceivedRequests (properties ().get <bool >(" publish_planning_requests" ));
7584}
You can’t perform that action at this time.
0 commit comments