Ask Your Question
0

Can planning success be checked in the Python MoveGroupCommander?

asked 2018-09-29 01:35:50 -0500

fvd gravatar image

The C++ MoveGroup's plan function returns an error code, but the Python MoveGroupCommander's plan function seems to return only the RobotTrajectory. Am I misunderstanding it? What is the best way to check in Python if a motion plan was successful?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-04-03 20:19:26 -0500

fvd gravatar image

By checking if the trajectory contains points, in kinetic/melodic at least:

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.")

Looks like this API might change, and success might be returned via a tuple in the future.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-09-29 01:35:50 -0500

Seen: 285 times

Last updated: Apr 03 '19