pal-robotics / realsense_gazebo_plugin

157 stars 134 forks source link

Amrfm 1244 gazebo realsense plugin add setting to specify qos #45

Closed ghost closed 2 years ago

ghost commented 2 years ago

_For the realsense cameras, in the driver we can specify the QoS to use. We use the SENSOR_DATA QoS there usually. So, to keep our stack compatible, we would like to use the same QoS in simulation as well. For that, please add a setting "pointcloud_qos" and "color_qos" to the realsense_gazebo_plugin. In our launchfiles, please set it to sensordata.

Setting to specify qos

file path: /code/ros2_ws/src/navigation2/amr_description/urdf/amr_description.gazebo.xacro

option

SystemDefaultsQoS
 SensorDataQoS
 ParametersQoS
 ServicesQoS
 ParameterEventsQoS

example:

<gazebo>
      <plugin name='${camera_left}' filename='librealsense_gazebo_plugin.so'>
        <prefix>${camera_left}</prefix>
        <depthUpdateRate>${cameras_update_rate}</depthUpdateRate>
        <colorUpdateRate>${cameras_update_rate}</colorUpdateRate>
        <infraredUpdateRate>1.0</infraredUpdateRate>
        <depthTopicName>${camera_left}/aligned_depth_to_color/image_raw</depthTopicName>
        <depthCameraInfoTopicName>${camera_left}/depth/camera_info</depthCameraInfoTopicName>
        <colorTopicName>${camera_left}/color/image_raw</colorTopicName>
        <colorCameraInfoTopicName>${camera_left}/color/camera_info</colorCameraInfoTopicName>
        <infrared1TopicName>${camera_left}/infra1/image_raw</infrared1TopicName>
        <infrared1CameraInfoTopicName>${camera_left}/infra1/camera_info</infrared1CameraInfoTopicName>
        <infrared2TopicName>${camera_left}/infra2/image_raw</infrared2TopicName>
        <infrared2CameraInfoTopicName>${camera_left}/infra2/camera_info</infrared2CameraInfoTopicName>
        <colorOpticalframeName>${camera_left}_color_optical_frame</colorOpticalframeName>
        <depthOpticalframeName>${camera_left}_depth_optical_frame</depthOpticalframeName>
        <infrared1OpticalframeName>${camera_left}_left_ir_optical_frame</infrared1OpticalframeName>
        <infrared2OpticalframeName>${camera_left}_right_ir_optical_frame</infrared2OpticalframeName>
        <rangeMinDepth>0.3</rangeMinDepth>
        <rangeMaxDepth>3.0</rangeMaxDepth>
        <pointCloud>true</pointCloud>
        <pointCloudTopicName>${camera_left}/depth/color/points</pointCloudTopicName>
        <pointCloudCutoff>0.3</pointCloudCutoff>
        <pointCloudCutoffMax>3.0</pointCloudCutoffMax>
        <pointcloud_qos>${camera_left}SystemDefaultsQoS</pointcloud_qos>
        <color_qos>${camera_left}SystemDefaultsQoS</color_qos>
      </plugin>
    </gazebo>