@@ -412,7 +412,7 @@ void export_core(pybind11::module& m) {
412412 .def_property_readonly (" failures" , &Task::failures, " Solutions: Failed Solutions of the stage (read-only)" )
413413 .def_property (" name" , &Task::name, &Task::setName, " str: name of the task displayed e.g. in rviz" )
414414
415- .def (" loadRobotModel" , &Task::loadRobotModel, " robot_description" _a = " robot_description" ,
415+ .def (" loadRobotModel" , &Task::loadRobotModel, " node " _a, " robot_description" _a = " robot_description" ,
416416 " Load robot model from given ROS parameter" )
417417 .def (" getRobotModel" , &Task::getRobotModel)
418418 .def (" enableIntrospection" , &Task::enableIntrospection, " enabled" _a = true ,
@@ -471,30 +471,7 @@ void export_core(pybind11::module& m) {
471471 " publish" ,
472472 [](Task& self, const SolutionBasePtr& solution) { self.introspection ().publishSolution (*solution); },
473473 " solution" _a, " Publish the given solution to the ROS topic ``solution``" )
474- .def_static (
475- " execute" ,
476- [](const SolutionBasePtr& solution) {
477- using namespace moveit ::planning_interface;
478- PlanningSceneInterface psi;
479- MoveGroupInterface mgi (solution->start ()->scene ()->getRobotModel ()->getJointModelGroupNames ()[0 ]);
480-
481- MoveGroupInterface::Plan plan;
482- moveit_task_constructor_msgs::msg::Solution serialized;
483- solution->toMsg (serialized);
484-
485- for (const moveit_task_constructor_msgs::msg::SubTrajectory& traj : serialized.sub_trajectory ) {
486- if (!traj.trajectory .joint_trajectory .points .empty ()) {
487- plan.trajectory_ = traj.trajectory ;
488- if (!mgi.execute (plan)) {
489- ROS_ERROR (" Execution failed! Aborting!" );
490- return ;
491- }
492- }
493- psi.applyPlanningScene (traj.scene_diff );
494- }
495- ROS_INFO (" Executed successfully" );
496- },
497- " solution" _a, " Send given solution to ``move_group`` node for execution" );
474+ .def (" execute" , &Task::execute, " solution" _a, " Send given solution to ``move_group`` node for execution" );
498475}
499476} // namespace python
500477} // namespace moveit
0 commit comments