Closed TaoYibo1866 closed 2 years ago
My machine is running Ubuntu 20.04, ROS Noetic.
Using
ros::Subscriber bytes_sub = nh.subscribe<ByteMultiArray>("bytes", 1, odomCb, ros::TransportHints().tcpNoDelay());
fix message drop. Still wonder why though.
I have two nodes, "publisher" and "subscriber". The 'publisher' publishes ByteMultiArray messages in 50Hz, with "queue_size=1". The "subscriber" subscribes to the 50Hz topic with "queue_size=1", and publishes output in the callback function.
When the ByteMultiArray message is less than 508 bytes, everything goes as expected and the callback function is executed in 50Hz. However, when the message is bigger than 508 bytes, callback frequency drops to 28Hz. This is wired.
publisher.cpp
subscriber.cpp
rostopic hz /callback
rostopic hz /bytes