code-iai / ROSIntegration

Unreal Engine Plugin to enable ROS Support
MIT License
412 stars 133 forks source link

ROS Failing to Stay Connected #145

Open jasonm22 opened 3 years ago

jasonm22 commented 3 years ago

Hi Everyone,

I have been trying to connect this UE plugin with a MATLAB ROS server. I was able to get everything integrated and built into the UE project. However, when I try to connect I am ending up with this error message repeated over and over. It looks like the connection succeeds and then continues to reset. Any ideas on areas to check to troubleshoot this?

Thanks in advance! Jason

[2021.03.04-21.14.40:068][871]LogROS: Display: UROSIntegrationCore spawned [2021.03.04-21.14.40:068][871]LogROS: Display: UImpl::Init() [2021.03.04-21.14.40:071][871]LogROS: Display: Setting up receiver thread ... [2021.03.04-21.14.40:074][871]LogROS: Display: Successfully reconnected to rosbridge 192.168.1.5:65300. [2021.03.04-21.14.40:080][872]LogROS: Error: Failed to recv(); Closing receiver thread. The thread 0x5d08 has exited with code 0 (0x0). [2021.03.04-21.14.40:948][911]LogROS: Error: Connection to rosbridge 192.168.1.5:65300 was interrupted. [2021.03.04-21.14.40:948][911]LogROS: Display: UROSIntegrationGameInstance::Init() - connecting to ROS bridge... [2021.03.04-21.14.40:948][911]LogROS: Display: UImpl::BeginDestroy() [2021.03.04-21.14.40:948][911]LogROS: Display: UROSIntegrationCore ~Impl()

SheilaGLZ commented 3 years ago

I'm having the same issue, could you fix it?

VNandamuri commented 2 years ago

@jasonm22 @SheilaGLZ I'm facing the same issue now, can you guys please help me. I really need it to work. I really appreciate any help you can provide.

agaertner commented 2 years ago

Same issue here.

Ubuntu Focal WSL ROS2 Galactic

Endless cycle of interrupts and reconnects

LogROS: Error: Failed to recv(); Closing receiver thread.
LogROS: Error: Connection to rosbridge 127.0.0.1:9090 was interrupted.
LogROS: Display: UROSIntegrationGameInstance::Init() - connecting to ROS bridge...
LogROS: Display: UImpl::BeginDestroy() 
LogROS: Display: UROSIntegrationCore ~Impl() 
LogROS: Display: UROSIntegrationCore spawned 
LogROS: Display: UImpl::Init() 
LogROS: Display: Setting up receiver thread ...
LogROS: Display: Successfully reconnected to rosbridge 127.0.0.1:9090.
LogROS: Error: Failed to recv(); Closing receiver thread.
LogROS: Error: Connection to rosbridge 127.0.0.1:9090 was interrupted.
<repeat>

EDIT: After a minute I realized this issue is caused by a version mismatch (eg. wrong ROS or rosbridge_suite version). It probably gets interrupted by failing to parse data. I was on Galactic and realized soon thereafter that this UE4 plugin does not support ROS2. So I went with forks of ROSIntegration and rosbridge_suite. The official rosbridge_suite has removed TCP following ROS2s removal of it. The fork brings it back along with ROS2 support for the ROSIntegration plugin. Note: Running the rosbridge_suite fork may fail (on WSL at least) and there are some minor fixes required.