ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to check if Cartesian trajectory is executed successfully

asked 2022-06-21 03:12:34 -0600

Dhara gravatar image

updated 2022-06-21 07:28:03 -0600


I am working with RviZ and MoveIt! to control the ABB arm with ros melodic. But the problem is when I give two robot movements one after another of both the cartesian path with compute_cartesian_path with group.execute(plan, wait=False) I am getting the below error:

image description

I know the reason that while I am using here in group.execute(wait=False), because of wait = False is, the controller does not wait to complete and it shows th error of cannot push a new trajectory while one is being executed. But my concern is that in my case I have to use async movement to track and stop the robot in between (in case of sensor activation).

So question how can I detect if last trajectory is finished and ready to take new trajectory in Python? Or is there any other solution?

Thanks in advance!

edit retag flag offensive close merge delete


Please do not use use screen shots of text output. Instead, copy/paste the text into your description and format it using the 101010 button.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-06-21 15:22:43 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2022-06-28 06:09:31 -0600

Dhara gravatar image

Found an answer:

After the cartesian trajectory starts to execute, subscribe to the topic /execute_trajectory/feedback in which track the State of the this topic. If the is MONITOR, the trajectory still executing and as soon as this is changed to IDLE, it means the trajectory is finished. After that, next trajectory can be sent to moveIt.

edit flag offensive delete link more

answered 2022-06-21 15:25:03 -0600

Mike Scheutzow gravatar image

updated 2022-06-23 08:43:46 -0600

I believe there is a group.getState() call you can use to check on progress. I've never used it this way, but I think it will work. [Note: this call is for an ActionClient, not for MoveGroupCommander]

I'm not seeing any way to get this information from MoveGroupCommander.

However, if you look at the implementation of execute(), you will see it creates an ActionClient. You could create your own ActionClient rather than using execute(). Then you would use getState() to monitor the progress. You'd need to figure out the name of the FollowJointTrajectory ActionServer in your setup; it is /arm_controller/follow_joint_trajectory for one of my arms.

edit flag offensive delete link more


Hi @Mike, are you suggesting this getState() is in MoveGroupCommander? Because there is no such type of method in my

Dhara gravatar image Dhara  ( 2022-06-23 05:37:30 -0600 )edit

Yes, you're right. Edited my answer.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-06-23 08:42:29 -0600 )edit

Short addition: If you don't want to write your own action client and use the feedback message, you can use get_current_joint_values and get_current_pose to track progress and confirm that the robot arrived at the target.

fvd gravatar image fvd  ( 2022-06-24 22:48:57 -0600 )edit

Thanks @Mike and @fvd for your suggestions. It has helped me to research in this task.

Dhara gravatar image Dhara  ( 2022-06-28 06:16:13 -0600 )edit

Question Tools



Asked: 2022-06-21 03:12:34 -0600

Seen: 193 times

Last updated: Jun 28 '22