Poitcloud is published at 2Hz when using 2 3D cameras gazebo_ros_depth_camera

asked 2019-01-14 11:43:38 -0600

Zoid gravatar image

Hello,

I have a Gazebo simulation using ROS and in my mobile robot I am using two 3D cameras described by a gazebo_ros_depth_camera plugin ( https://github.com/ros-simulation/gaz.. .). I have setup the plugin as follows:

<plugin name="camera3D_controller" filename="libgazebo_ros_depth_camera.so">
            <robotNamespace>/</robotNamespace>
                <alwaysOn>true</alwaysOn>
            <!-- Keep this zero, update_rate will control the frame rate -->
            <updateRate>200.0</updateRate>
            <cameraName>camera3D_1</cameraName>
             <imageTopicName>image_raw</imageTopicName>
            <cameraInfoTopicName>camera_info</cameraInfoTopicName>
            <depthImageTopicName>depth/image_raw</depthImageTopicName>
            <!-- neither camera info is getting published, frame_id is empty
                in points and both image headers -->
             <depthImageCameraInfoTopicName>depth/camera_info</depthImageCameraInfoTopicName>
            <pointCloudTopicName>points</pointCloudTopicName>
            <frameName>camera3D_1_link</frameName>
            <!-- TODO(lucasw) is this used by depth camera at all? -->
             <hackBaseline>0.07</hackBaseline>
            <pointCloudCutoff>0.001</pointCloudCutoff>
            <distortionK1>0.0</distortionK1>
            <distortionK2>0.0</distortionK2>
            <distortionK3>0.0</distortionK3>
            <distortionT1>0.0</distortionT1>
            <distortionT2>0.0</distortionT2>
  </plugin>

Although I have the cameras setup at 200 Hz update frame rate, the publishing pointcloud rate (e.g. rostopic hz /camera3D_2/points) is between 4 to 7 Hz. Also, when I launch rviz, the publishing rate drops to 2 Hz. Do you think this is relative to some short of Gazebo physics update frequency setup, or maybe is relevant to my computer hardware resources? Any Ideas?

Thank you!

edit retag flag offensive close merge delete

Comments

The depth camera plugin is computationally expensive (in my situations, the depth camera instances takes more CPU than the physics and rendering engines combined) so its no shock that its inconsistent or slow in "real-time", though it may be correct in the scaled time gazebo is working in...

stevemacenski gravatar imagestevemacenski ( 2019-01-14 12:52:11 -0600 )edit

Try on a more powerful computer or server, write your own plugin to give you only the things you need, etc

stevemacenski gravatar imagestevemacenski ( 2019-01-14 12:52:43 -0600 )edit

Ok! Thank you for your answer. It makes sense. :)

Zoid gravatar imageZoid ( 2019-01-15 02:36:04 -0600 )edit