I’m using /camera/rgb/image_rect_color to retrieve rbg images but it suffers significant time delay. How can I possibly solve that problem?
To support your problem, we need some further info. The more details you provide, the more appropriate support we can offer. Could you describe your workflow? Some helper question are:
- Which device are you using?
- What is your hardware configuration? Are you connecting with device through HDMI, remote desktop, SSH, subscribing image topic on remote computer or something else?
- Were you following any tutorial or manual? If so, at which step did you encounter problem?
- Are you receiving any warnings or errors?
Thanks for your reply.
1). I’m using ROSbot2.0
2). The hardwares I have include the astra depth camera, rplidar. I used a Linux desktop to remotely access the computer inside the computer via ssh. Then I connected my local desktop and the robot’s inside computer and set the robot as the master. I launched the rosbot_drivers.launch file in the ROSbot and I could get access to the robot/camera topics in my local computer. Then I ran rviz in my local computer. When I tried to visualize /camera/rgb/image_rect_color topic, I encountered significant time delay. The raw image gave me more time delay.
/camera/rgb/image_rect_color is transferring images in uncompressed format, this means that single frame is of size 10MB approximately. When you are running Rviz on computer while camera is running on ROSbot, the bottleneck is speed of network connection. For viewing image on other computers, you need to use compressed format.
First solution: You can use rosbot_webui to preview image from camera in web browser on any computer.
Second solution: Use compressed image transport plugin. On ROSbot add to rosbot_drivers.launch file:
<node pkg="image_transport" type="republish" name="rgb_compress" args=" raw in:=/camera/rgb/image_raw compressed out:=/rgb_republish"/> <node pkg="image_transport" type="republish" name="depth_republish" args=" raw in:=/camera/depth/image_raw compressedDepth out:=/depth_republish"> <param name="compressedDepth/format" value="png"/> <param name="compressedDepth/png_level" value="1"/> </node>
And on your local computer use below launch:
<launch> <node name="rviz" pkg="rviz" type="rviz"/> <node pkg="image_transport" type="republish" name="rgb_decompress" args=" compressed in:=/rgb_republish raw out:=/rgb_raw"> <param name="compressed/mode" value="color"/> </node> <node pkg="image_transport" type="republish" name="depth_decompress" args=" compressedDepth in:=/depth_republish raw out:=/depth_raw "> <param name="compressed/mode" value="unchanged"/> </node> </launch>
Then in Rviz open
/depth_raw to see camera output.