Image and PointCloud2 performance issue on ROS2 python

@yechun We performance_tested all sort of small and large data here and got latencies ~20ms for 2MB PointCloud2 messages: https://github.com/ros2/rmw_fastrtps/pull/203#issuecomment-399778193.

What I think is happening is that you are trying to publish PointCloud2 data with the default QoS settings (https://github.com/ros2/rmw/blob/master/rmw/include/rmw/qos_profiles.h#L43-L50) which are set to reliable and volatile.

ros2 topic echo command is using sensor QoS (https://github.com/ros2/ros2cli/blob/master/ros2topic/ros2topic/verb/echo.py#L134) which are best effort.

I would suggest to use sensor QoS in your publisher (see example https://github.com/ros2/ros2/wiki/About-Quality-of-Service-Settings).

Otherwise it does not make much sense to print PointCloud2 messages to a console.

For performance testing I would otherwise suggest you to use this tool: https://github.com/ApexAI/performance_test.

D.