MATLAB has encountered an internal problem after deleting the action client
Afficher commentaires plus anciens
Hallo,
Before, I used MATLAB to define actionclient to control the actionserver in ROS. After using it, I didn’t want to disconnect from ROS so that I could continue to send goals to actionserver. Therefore, I only deleted the current actionclient, as in the following example.
[gripper_actClient, gripper_msg] = rosactionclient('/gripper_action');
waitForServer(gripper_actClient);
gripper_msg.Type = 0;
[resultMsg, resultState] = sendGoalAndWait(gripper_actClient, gripper_msg);
delete(gripper_actClient);
However, after that, when I wanted to perform any operation in MATLAB, an error message appeared.
Connection to process with Exchange: "45b2b5d4-bb67-48e5-bf98-267b41dba48d " was lost.
I had to close matlab and restart it. When I run the above code again, it was still the same result. Has anyone encountered the same problem?
I used MATLAB R2021b in windows. I have also tried in Ubuntu 16.04 and there was same problem, but in macOS Big Sur (Version 11) not.
4 commentaires
Prabeen Sahu
le 8 Nov 2021
Modifié(e) : Prabeen Sahu
le 8 Nov 2021
Hi Xin,
Your code looks fine and should not create any issue. I tried the same code with 'actionlib/Test' action in windows10 and it worked fine for me. Please provide me more details on the issue to debug further.
- What is the action type of '/gripper_action'.
- Is it a custom action that you created? If so, it is possible to share that with us?
- Where is your action server running (os, ros-version)?
- Do you see the error only after 'delete(gripper_actClient);' ? Or any other line of above code is responsible for this issue?
- Do you see the same issue with some other action type as well?
-Prabeen
Prabeen Sahu
le 9 Nov 2021
Hi Xin,
When you are going to delete the simple action client and the goal is not yet completed, you probably don’t want the goal to be running in simple action server. So before deleting the client, please try cancelling the goal through the client.
gripper_actClient.cancelGoal();
pause(0.2);
delete(gripper_actClient);
This probably will resolve your issue. If not, please reach out to us through the MathWorks® Technical Support. We may need more information to help you out.
-Prabeen
Xin Xing
le 10 Nov 2021
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Network Connection and Exploration dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!