When I try to use big data message by python code such as Camera Image or PointCloud2 on ROS2, I found the performance is terrible.
Issue1: Execute “ros2 topic echo /topic_pointcloud”, no message output -> [Closed]
Description: Launch ros2_intel_realsense by realsense_ros2_camera, and subscribe “/camera/depth/color/points” by “ros2 topic echo /camera/depth/color/points”. It will cost dozens of seconds to print out the PointCloud2 (640x480) data. On ros 1, rostopic shows data immediately.
Issue2: Python sub-pub big data performance is worse that CPP - [Closed]
Description: Subscribe “/camera/depth/color/points(sensor_msgs::msgs::PointCloud2)” by both cpp subscribe api and python subscribe code, the fps is different. cpp-code is 4hz, but python-code only 0.4hz.
Debugging point to the time exhaust in the function convert_to_py while convert msg to python, in _rclpy.c:2261
Is there any idea to fix Camera message computation performance issue?
Issue1: Fixed by PR
Issue2: Workaround by “export PYTHONOPTIMIZE=0”