move_group plan for 2 or more waypoints then execute
Hi all, I want to move arm to pose1 and pose2, the straightforward way is
move_group.setStartState(*group.getCurrentState());
move_group.setPoseTarget(pose1);
move_group.plan(plan1);
move_group.execute(plan1);
move_group.setStartState(*group.getCurrentState());
move_group.setPoseTarget(pose2);
move_group.plan(plan2);
move_group.execute(plan2);
The problem is that if plan1 succeeds, and plan2 fails, plan1 is still executed. Is there a way to first check plan1 and plan2? If both succeed, then execute the plans.
I saw the argument of setPoseTargets() can be a list of poses, but the plan will only choose one randomly from the list as the goal...