ros-drivers / transport_drivers

A set of ROS2 drivers for transport-layer protocols.
Apache License 2.0
92 stars 56 forks source link

Bug in Converter between `std_msgs::msg::UInt8MultiArray` and `std::vector<uint8_t>` #72

Closed chenjunnn closed 2 years ago

chenjunnn commented 2 years ago

The method vector::reserve() only change its capacity, not its size, which causes the out data to be empty. image

image

The above result shows that the size of out data's size hasn't been changed, which occurs a bug in serial_driver that the msg published in /serial_read has no data in it. image

And the bug is the same with /serial_wirte, as the convertion using the same method. https://github.com/ros-drivers/transport_drivers/blob/0140e5e7c0702a675472ee0e5bff22955e45729c/io_context/include/msg_converters/example_interfaces.hpp#L34