0
$\begingroup$

Rosanswers logo

Hello,

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!


Originally posted by Dhara on ROS Answers with karma: 16 on 2022-06-21

Post score: 0


Original comments

Comment by Mike Scheutzow on 2022-06-21:
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.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Mike Scheutzow with karma: 4903 on 2022-06-21

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Dhara on 2022-06-23:
Hi @Mike, are you suggesting this getState() is in MoveGroupCommander? Because there is no such type of method in my move_group.py.

Comment by Mike Scheutzow on 2022-06-23:
Yes, you're right. Edited my answer.

Comment by fvd on 2022-06-24:
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.

Comment by Dhara on 2022-06-28:
Thanks @Mike and @fvd for your suggestions. It has helped me to research in this task.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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 data.feedback.state is MONITOR, the trajectory still executing and as soon as this data.feedback.state is changed to IDLE, it means the trajectory is finished. After that, next trajectory can be sent to moveIt.


Originally posted by Dhara with karma: 16 on 2022-06-28

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

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