Carter12s / roslibrust

An async first rust client for ROS1 native and rosbridge.
https://docs.rs/roslibrust
MIT License
48 stars 6 forks source link

PointCloud2 messages exceeding serde_rosmsg buffer size #178

Closed lucasw closed 2 months ago

lucasw commented 2 months ago

I'm receiving progressively larger PointCloud2 generated messages from https://github.com/lucasw/transform_point_cloud/blob/master/scripts/generate_point_cloud.py but once they get too big they don't get successfully decoded in my subscriber (which is using the latest roslibrust commit in master here), and I see:

serde_rosmsg Error: Reached end of memory buffer while reading data
serde_rosmsg Error: Attempted to read beyond the end of decoded value's length

Maybe this code is involved - the 4096 size limit is in the range where I see the issue (but isn't it supposed to keep reading and assemble a full message?):

https://github.com/Carter12s/roslibrust/blob/master/roslibrust/src/ros1/subscriber.rs#L119-L120

Carter12s commented 2 months ago

Whoops yup that is the smoking gun.

I identified this issue when implementing the logic for service servers and fixed it correctly there: https://github.com/Carter12s/roslibrust/blob/8e0066cbc2370ab321c7bac333f0748bf2d0ef4b/roslibrust/src/ros1/service_server.rs#L216

But failed to port that fix back to subscriber :facepalm:

Will patch shortly

Carter12s commented 2 months ago

Fix is merged to master

Will publish v0.10.2 with fix to crates.io shortly