ROSIntegration icon indicating copy to clipboard operation
ROSIntegration copied to clipboard

Crashing and lag spikes.

Open tria97 opened this issue 2 years ago • 1 comments

Hello everyone. When I run my project after setting the "MyROSIntegrationGameInstance" the project gets massive lagspikes about every second, which correspond to the log below.

image

This is the case when I am using the default 127.0.0.1 ROSBridge Server Host value.

If I actually change that and use, for example, the IP of the virtualbox ubuntu instance in which I am hosting ROS, (192.168.42.247/24) the result is an instant crash upon game startup. This is not specific to this IP. Everything I've tried except 127.0.0.1 causes the instant crash issue.

image

image

The above is from running the built win64 game.

If I run the game inside the engine as a "standalone game" I get some more specific crash logs.

image

Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000000

UE4Editor_ROSIntegration!TCPConnection::SendMessage() [E:\VR_robot_2\Plugins\ROSIntegration\Source\ROSIntegration\Private\rosbridge2cpp\TCPConnection.cpp:79] UE4Editor_ROSIntegration!rosbridge2cpp::ROSBridge::SendMessage() [E:\VR_robot_2\Plugins\ROSIntegration\Source\ROSIntegration\Private\rosbridge2cpp\ros_bridge.cpp:81] UE4Editor_ROSIntegration!rosbridge2cpp::ROSTopic::Advertise() [E:\VR_robot_2\Plugins\ROSIntegration\Source\ROSIntegration\Private\rosbridge2cpp\ros_topic.cpp:94] UE4Editor_ROSIntegration!UTopic::Advertise() [E:\VR_robot_2\Plugins\ROSIntegration\Source\ROSIntegration\Private\Topic.cpp:241] UE4Editor_ROSIntegration!UROSIntegrationGameInstance::Init() [E:\VR_robot_2\Plugins\ROSIntegration\Source\ROSIntegration\Private\ROSIntegrationGameInstance.cpp:126] UE4Editor_Engine UE4Editor UE4Editor UE4Editor UE4Editor UE4Editor kernel32 ntdll

Is this the default behavior? An instant crash upon startup because no ROSbridge connection was established?

tria97 avatar Feb 26 '23 16:02 tria97

Hi @tria97. A few things to keep in mind.

It is unclear from your setup, but remember that 127.0.0.1 means localhost and implies your rosbridge is also running on the same machine. Also, do NOT combine the port with the IP address as x.x.x.x/y. These are configured separately, hence the two parameters. In your case, your IP address is 192.168.42.247 and the port is 24.

If no connection to rosbridge can be made, then the game simply will not "run as usual". Every second it will try to reconnect, hence why you constantly see such logging output.

Finally, I think I addressed the Exception Access Violation issue in my recent PR, as I had some weird problems on shutdown that resulted in crashing.

tsender avatar Mar 25 '23 03:03 tsender