File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
include/moveit/task_constructor Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 4646
4747#include < moveit/macros/class_forward.h>
4848
49+ #include < moveit_msgs/MoveItErrorCodes.h>
50+
4951namespace moveit {
5052namespace core {
5153MOVEIT_CLASS_FORWARD (RobotModel)
@@ -119,8 +121,8 @@ class Task : protected WrapperBase
119121 bool plan (size_t max_solutions = 0 );
120122 // / interrupt current planning (or execution)
121123 void preempt ();
122- // / execute solution
123- void execute (const SolutionBase& s);
124+ // / execute solution, return the result
125+ moveit_msgs::MoveItErrorCodes execute (const SolutionBase& s);
124126
125127 // / print current task state (number of found solutions and propagated states) to std::cout
126128 void printState (std::ostream& os = std::cout) const ;
Original file line number Diff line number Diff line change @@ -303,14 +303,15 @@ void Task::preempt() {
303303 pimpl ()->preempt_requested_ = true ;
304304}
305305
306- void Task::execute (const SolutionBase& s) {
306+ moveit_msgs::MoveItErrorCodes Task::execute (const SolutionBase& s) {
307307 actionlib::SimpleActionClient<moveit_task_constructor_msgs::ExecuteTaskSolutionAction> ac (" execute_task_solution" );
308308 ac.waitForServer ();
309309
310310 moveit_task_constructor_msgs::ExecuteTaskSolutionGoal goal;
311311 s.fillMessage (goal.solution , pimpl ()->introspection_ .get ());
312312 ac.sendGoal (goal);
313313 ac.waitForResult ();
314+ return ac.getResult ()->error_code ;
314315}
315316
316317void Task::publishAllSolutions (bool wait) {
You can’t perform that action at this time.
0 commit comments