Comments (6)
It might be easier to get the gist of the UE4 log in an image;
from rosintegration.
Another update here: I updated my ROS nodes so that I'm downsampling the point cloud massively (see https://github.com/aaronsnoswell/ue4_comms_test/blob/master/src/pcl_downsampler.cpp). When I do this, I am able to recieve the sensor_msgs/PointCloud2
messages fine. As such, this definitely seems to be a problem with receiving large bson messages that are split over multiple TCP packets.
Can we work out an approach to fixing this problem? I'm happy to do the work if you advise what needs to be done :) I'm not super familiar with the code in TCPConnection.cpp
from rosintegration.
Hi @aaronsnoswell
Thanks for opening this issue and sorry for the delay.
This problem might be indeed a problem with the TCPConnection class.
I think the relevant part starts at
After these 4 four bytes have been read, bson_state_read_length will be false. This will cause the jump to to handle the actual message reception. I guess the problems begin there. Maybe
if( _sock->Recv(binary_temp.GetData(), bson_msg_length - 4, bytes_read) )
can return less then the requested bson_msg_length - 4 bytes on fragmented packets. So one would have to reiterate to collect more data in the buffer.Additionally, i'm not 100% sure if
if(msg_size_in_buffer == bson_msg_length)
is correct. msg_size_in_buffer is calculated by calling Num() on a TArray. However, this array is resized with SetNumUninitialized() :
So Num() may not count the actual elements in the list, but rather the received elements + uninitialized elements.
from rosintegration.
As a reference on how it could be done, you can check the implementation on the rosbridge_server side:
https://github.com/RobotWebTools/rosbridge_suite/blob/develop/rosbridge_server/src/rosbridge_server/tcp_handler.py#L62
from rosintegration.
Has this been fixed now? I am just reviewing the code for TCPConnection.cpp and it looks substantially different to what it did in 2018, and appears that it will correctly wait to fill a buffer based on the 4 byte BSON prefix.
However we are still receiving BSON decode issues with our pointcloud frames ("Error on BSON parse - Ignoring message"), using v0.11.10 of rosbridge server. Any clue if this could be related to it?
from rosintegration.
. The main idea is to begin by reading the first 4 bytes. These bytes represent the length field of a bson packet: http://bsonspec.org/spec.html. By reading this length, we can instruct the next recv() calls to receive exactly that many bytes.
After these 4 four bytes have been read, bson_state_read_length will be false. This will cause the jump to
to handle the actual message reception. I guess the problems begin there. Maybe
if( _sock->Recv(binary_temp.GetData(), bson_msg_length - 4, bytes_read) )
can return less then the requested bson_msg_length - 4 bytes on fragmented packets. So one would have to reiterate to collect more data in the buffer.
About a year ago I had this exact problem you're describing Sanic, so I modified TCPConnection.cpp to be able to read headers from fragmented packets. I have a pending pull request #179 on this . Would appreciate if someone could have a look at it and accept it if it seems OK. I've been using my modified version multiple times now over the last year without any apparent problem.
from rosintegration.
Related Issues (20)
- Fork with visualizations, websockets, latest rosbridge_suite, etc. HOT 5
- Subsystem Game Instance HOT 3
- PR #180 Gives Compile Error in UE4 HOT 4
- Use of undeclared Identifier GetGameInstance HOT 1
- How can I solve the problem of `sensor_msgs/CameraInfo does not have a field d` HOT 2
- ROS bridge for UE 5 HOT 4
- (UE5 / Humble) De-/serialization problem when trying to publish sensor_msgs/Image or CompressedImage HOT 3
- ROS Message Types as UObjects? HOT 1
- Crashing and lag spikes. HOT 1
- Accessing the variable that was updated from a subscribed topic
- HoloLens2 packaging fails HOT 2
- (UE5/Melodic) Subscribing to color compressedImage and depth Image at the same time HOT 1
- /Clock publish rate too low. HOT 2
- sensor_msgs/Image Issue HOT 2
- After receiving the Service, it will crash when receiving the Topic.
- Trigger implementation issues HOT 2
- { Plugin "ROSIntergration" failed to load } problem HOT 1
- Error: no matching member function for call to 'AddRaw' HOT 1
- ROSBridge Message Error for sensor_msgs/CameraInfo HOT 2
- Failed to build ROSIntegration on UE5 5.3.2 linux
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rosintegration.