adnanademovic / serde_rosmsg

ROSMSG Serialization for Rust
MIT License
6 stars 2 forks source link

Potential Failure to Deserialize sensor_msgs::NavSatFix #1

Closed Carter12s closed 8 months ago

Carter12s commented 8 months ago

Cross referencing this issue: https://github.com/Carter12s/roslibrust/issues/148

Seeing an interesting failure of "Underflow" when trying to parse the bytes of a sensor_msgs::NavSatFix message. I'm going to attempt to create a unit test in this repo with a copy of the bytes we're dealing with to try to root cause, and to double check that the we're not dropping or corrupting bytes in roslibrust somewhere. I don't think we are since we're successfully working with many other message types.

Carter12s commented 8 months ago

Have a reproduction (assuming the bytes in nav_sat_fix.bin are actually correct) pushed as unit test here: https://github.com/Carter12s/serde_rosmsg/tree/nav-sat-fix-tests

Carter12s commented 8 months ago

Not 100% sure I'm getting all of this right, but here is a wireshark capture of TCP traffic exchange between a rostopic pub of a message and a roslibrust node receiving the messsage.

image

I believe this shows that the data payload was actually 120 Bytes, and matches the nav-sat-fix.bin file added on my branch.

Carter12s commented 8 months ago

Okay. I'm closing this issue, I do not believe this library is at fault.

I've tracked the problem down to representing the convariance array with Vec<f64> instead of [f64; 9] those must have different representations over the wire, and I was unaware of that. roslibrust will need to upgrade its message generate to handle fixed size arrays more strictly.