0
$\begingroup$

Rosanswers logo

I'm using rospy and moveit_commander to control a robot. It works wonderfully, except I cannot find a way in the API to handle a path planning failure. The MoveGroupCommander.plan() method does not seem to expose any value that indicates failure in python. Is there something I'm missing?

Thanks


Originally posted by rklutz on ROS Answers with karma: 17 on 2019-11-26

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

If the plan fails, the RobotTrajectory is empty, so you can check it as described here:

plan = move_group.plan()
if plan.joint_trajectory.points:  # True if trajectory contains points
  move_success = move_group.execute(plan)
else:
  rospy.logerr("Trajectory is empty. Planning was unsuccessful.")

Originally posted by fvd with karma: 2180 on 2020-02-29

This answer was ACCEPTED on the original site

Post score: 3

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.