I keep dropping connection to a ROs device

11 views (last 30 days)
Hi,
I am working with some sensors that I access using ROS toolbox
Recently I have been getting the following error:
Caught "std::exception" Exception message is:
Connection to process with Exchange: "f59c06ba-0ce7-423c-85ba-168468cf70d9 " was lost.
I thought it was becuase sometimes the PC that has the ROS sensors connected to it (a different PC that I run Matlab on) screen locks after a while if there is no activity on the local machine. But I am getting the error message while the connection is still live.
When this happens i can no longer send any ROS messages or even run rosshutdown command
To resolve this issue I have had to restart Matlab which is not an ideal solution
Has anyone got any ideas on how I can stop it losing its connection to the ROS PC
Regards
Chris
  2 Comments
Cam Salzberger
Cam Salzberger on 28 Jan 2022
Hello Christopher,
The "connection to process with exchange ... was lost" error message generally means that the ROS node has crashed. It runs in a separate process from MATLAB, so the whole program doesn't crash, just the node. But it can make it difficult to restart rosinit.
This can be difficult to diagnose without more involved troubleshooting, so I'd suggest contacting technical support for assistance. A couple things that you can provide to support to help them diagnose would be:
  • When does this error occur (right away when doing rosinit, after doing something else, or after a random amount of idle time)?
  • Where is the ROS Master located (MATLAB machine or other ROS machine)?
  • Does this happen if you keep everything local to just MATLAB (Master, nodes, publishers/subscribers)?
  • While you are connected to the other ROS machine and everything is set up normally (before the error), run "ros.internal.generateSupportFile" in MATLAB and send the generated file to support. This will provide them with a lot of relevant information about your environment setup and the ROS network.
-Cam
CHRISTOPHER MILLAR
CHRISTOPHER MILLAR on 28 Jan 2022
Hi Cam,
Thanks alot for the response.
There is no real pattern that i can see. I thought it was only happening when the host PC was idle but I was able to work as normal yesterday even though the screen had locked. Its is just a recent issue
Thanks for these troubleshooting pointers
I will use your 4th point to try and troubleshoot the issue if it happens again.
Kind Regards
Chris

Sign in to comment.

Accepted Answer

Jagadeesh Konakalla
Jagadeesh Konakalla on 19 Aug 2022
The "connection to process with exchange ... was lost" error message generally means that the ROS node has crashed. It runs in a separate process from MATLAB, so the whole program doesn't crash, just the node. But it can make it difficult to restart rosinit.
This can be difficult to diagnose without more involved troubleshooting, so I'd suggest contacting technical support for assistance. A couple things that you can provide to support to help them diagnose would be:
  • When does this error occur (right away when doing rosinit, after doing something else, or after a random amount of idle time)?
  • Where is the ROS Master located (MATLAB machine or other ROS machine)?
  • Does this happen if you keep everything local to just MATLAB (Master, nodes, publishers/subscribers)?
  • While you are connected to the other ROS machine and everything is set up normally (before the error), run "ros.internal.generateSupportFile" in MATLAB and send the generated file to support. This will provide them with a lot of relevant information about your environment setup and the ROS network.
  1 Comment
CHRISTOPHER MILLAR
CHRISTOPHER MILLAR on 22 Aug 2022
I resolved this error using the ros.rate(); function in my code
since i introduced this measure I had no further issues with my code
Thanks for responding and helping
Kind Regards
Chris

Sign in to comment.

More Answers (0)

Tags

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!