Intel RealSense D435i: Further learning about ROS interface related configuration and startup parameters

link

  • 1.launch file
  • 2. Prompt message at startup
  • 3.Published Topic

  • In the previous blog , we have introduced how to configure the startup environment of D435i and conducted a simple test. In this blog, we will take rs_cameranode as an example to further analyze the parameters in its launch file for better use.

    1.launch file

    rs_cameraThe default launch file of the node is as follows. You can see that there are a lot of parameters that can be set, most of which can be understood based on their names. Here are some important parameters for introduction.

    (1)enable_depth

    A Boolean variable, which defaults to true, is used to specify whether the sensor publishes depth-related topics. It mainly affects /camera/depth/the release of related topics, as follows.

    /camera/depth/camera_info
    /camera/depth/color/points
    /camera/depth/image_rect_raw
    /camera/depth/image_rect_raw/compressed
    /camera/depth/image_rect_raw/compressed/parameter_descriptions
    /camera/depth/image_rect_raw/compressed/parameter_updates
    /camera/depth/image_rect_raw/compressedDepth
    /camera/depth/image_rect_raw/compressedDepth/parameter_descriptions
    /camera/depth/image_rect_raw/compressedDepth/parameter_updates
    /camera/depth/image_rect_raw/theora
    /camera/depth/image_rect_raw/theora/parameter_descriptions
    /camera/depth/image_rect_raw/theora/parameter_updates
    
    (2)enable_infra

    In fact, it includes three variables enable_infra, enable_infra1, and enable_infra2, which are used to control whether to output infrared images. enable_infra1, enable_infra2respectively represent the images of the left and right infrared cameras. All three variables default to false. Its main impact /camera/infra1/and /camera/infra2/the release of related topics are as follows.

    /camera/infra1/camera_info
    /camera/infra1/image_rect_raw
    /camera/infra1/image_rect_raw/compressed
    /camera/infra1/image_rect_raw/compressed/parameter_descriptions
    /camera/infra1/image_rect_raw/compressed/parameter_updates
    /camera/infra1/image_rect_raw/compressedDepth
    /camera/infra1/image_rect_raw/compressedDepth/parameter_descriptions
    /camera/infra1/image_rect_raw/compressedDepth/parameter_updates
    /camera/infra1/image_rect_raw/theora
    /camera/infra1/image_rect_raw/theora/parameter_descriptions
    /camera/infra1/image_rect_raw/theora/parameter_updates
    

    /camera/infra2/camera_info
    /camera/infra2/image_rect_raw
    /camera/infra2/image_rect_raw/compressed
    /camera/infra2/image_rect_raw/compressed/parameter_descriptions
    /camera/infra2/image_rect_raw/compressed/parameter_updates
    /camera/infra2/image_rect_raw/compressedDepth
    /camera/infra2/image_rect_raw/compressedDepth/parameter_descriptions
    /camera/infra2/image_rect_raw/compressedDepth/parameter_updates
    /camera/infra2/image_rect_raw/theora
    /camera/infra2/image_rect_raw/theora/parameter_descriptions
    /camera/infra2/image_rect_raw/theora/parameter_updates

    It should be noted that enable_infrait does not really affect the release of infrared images. The real image switch is enable_infra1and enable_infra2. Although this should not be done generally, we can only turn on one infrared camera and turn off the other.

    (3)enable_color

    Boolean variable, default is true, used to specify whether the RGB camera publishes RGB image related topics. It mainly affects /camera/color/the release of related topics, as follows.

    /camera/color/camera_info
    /camera/color/image_raw
    /camera/color/image_raw/compressed
    /camera/color/image_raw/compressed/parameter_descriptions
    /camera/color/image_raw/compressed/parameter_updates
    /camera/color/image_raw/compressedDepth
    /camera/color/image_raw/compressedDepth/parameter_descriptions
    /camera/color/image_raw/compressedDepth/parameter_updates
    /camera/color/image_raw/theora
    /camera/color/image_raw/theora/parameter_descriptions
    /camera/color/image_raw/theora/parameter_updates
    
    (4)enable_gyro

    A Boolean variable, which defaults to false, is used to specify whether the gyroscope publishes related topics. It mainly affects /camera/gyro/the release of related topics, as follows.

    /camera/gyro/imu_info
    /camera/gyro/sample
    
    (5)enable_accel

    A Boolean variable, which defaults to false, is used to specify whether the accelerometer publishes related topics. It mainly affects /camera/accel/the release of related topics, as follows.

    /camera/accel/imu_info
    /camera/accel/sample
    
    (6)enable_sync

    Boolean variable, the default is false, as the name suggests, used to synchronize the data between sensors, so that the frequency of each Topic sent by D435i is the same.

    (7)align_depth

    The Boolean variable, which defaults to false, as the name suggests, is used to align the RGB image with the depth image. It does not modify the previously issued Topic, but re-issues two types of multiple Topics: /camera/aligned_depth_to_colorand /camera/aligned_depth_to_infra1, as follows.

    /camera/aligned_depth_to_color/camera_info
    /camera/aligned_depth_to_color/image_raw
    /camera/aligned_depth_to_color/image_raw/compressed
    /camera/aligned_depth_to_color/image_raw/compressed/parameter_descriptions
    /camera/aligned_depth_to_color/image_raw/compressed/parameter_updates
    /camera/aligned_depth_to_color/image_raw/compressedDepth
    /camera/aligned_depth_to_color/image_raw/compressedDepth/parameter_descriptions
    /camera/aligned_depth_to_color/image_raw/compressedDepth/parameter_updates
    /camera/aligned_depth_to_color/image_raw/theora
    /camera/aligned_depth_to_color/image_raw/theora/parameter_descriptions
    /camera/aligned_depth_to_color/image_raw/theora/parameter_updates
    

    /camera/aligned_depth_to_infra1/camera_info
    /camera/aligned_depth_to_infra1/image_raw
    /camera/aligned_depth_to_infra1/image_raw/compressed
    /camera/aligned_depth_to_infra1/image_raw/compressed/parameter_descriptions
    /camera/aligned_depth_to_infra1/image_raw/compressed/parameter_updates
    /camera/aligned_depth_to_infra1/image_raw/compressedDepth
    /camera/aligned_depth_to_infra1/image_raw/compressedDepth/parameter_descriptions
    /camera/aligned_depth_to_infra1/image_raw/compressedDepth/parameter_updates
    /camera/aligned_depth_to_infra1/image_raw/theora
    /camera/aligned_depth_to_infra1/image_raw/theora/parameter_descriptions
    /camera/aligned_depth_to_infra1/image_raw/theora/parameter_updates

    As the name suggests and it is obvious, one is to align the depth to the RGB color image, and the other is to align the depth to the infrared left image. The following are unaligned RGB images and depth images: It can be seen that the outline of the object in the depth image is obviously smaller than the RGB image, so it is not aligned. The effect of aligning depth to an RGB image is as follows. As you can see, the depth map and the RGB map have basically the same outline. Similarly, below is the result of aligning the depth map to the left infrared image. In addition, as can be seen from the above image, the difference between the infrared camera image and the RGB image is quite large.

    The above are a few commonly used parameters in the Launch file. If there are new things, they will be added one after another.

    2. Prompt message at startup

    Here, we turn on the depth ( enable_depth), binocular infrared ( enable_infra), RGB camera ( enable_color), gyroscope ( enable_gyro), and accelerometer ( enable_accel), and leave the rest by default. Then enter roslaunch realsense2_camera rs_camera.launchthe startup node. Under normal circumstances, a long series of prompt information will be output in the terminal, as shown in the figure below. Here we will simply analyze the information of these data. First, the node outputs a lot of related parameters (Parameters) we just set. So if the operation is different from what we expected, we might as well check here first to see if any parameter is not set properly. Then there is a series of ROS-related output. As expected, after starting the node, a lot of [info]information starting with "" will be output. This information is output by the node itself. The above information was all output by ROS before. First, a lot of information related to the device version and serial number will be output. Then it will output some mode information just set, which sensors are enabled, such as Align Depth, Sync Mode, etc. Since we have turned on the depth, infrared, and RGB sensors here, the nodes output the formats of these data streams in sequence, including length, width, FPS, and data format content. Then the node will set the Publisher and Stream according to the current configuration, and finally the node will output RealSense Node Is Up!, which means that the device is available and data can be received by subscribing to the corresponding Topic.

    3.Published Topic
    (1) infoTopic with

    If you want to get sensor-related information, just subscribe to infothe topic.

    /camera/depth/camera_info	# 深度相机信息
    /camera/infra1/camera_info	# 左红外相机信息
    /camera/infra2/camera_info	# 右红外相机信息
    /camera/color/camera_info	# RGB相机信息
    /camera/gyro/imu_info	# 陀螺仪信息
    /camera/accel/imu_info	# 加速度计信息
    /camera/aligned_depth_to_color/camera_info	# 对齐到RGB影像的深度图信息
    /camera/aligned_depth_to_infra1/camera_info	# 对齐到左红外影像的深度图信息
    

    For example, the following use rostopic echo /camera/infra1/camera_infoshows the relevant information of the left infrared camera image. You can see relevant information including some image width, height and default distortion parameters.

    (2) compressTopic with

    In addition, there are many related compresstopics, which are very simple as the name suggests. They are compressed data streams with smaller sizes. But at the same time, the quality of the data may decline to a certain extent.

    (3) rawTopic with

    Corresponding to the compressed data stream above, rawthe Topic is the uncompressed original data stream. If the data transmission bandwidth is not particularly limited, it is generally rawbetter to use the original data (with Topic).

    (4) theoraTopic with

    We have seen the included theoratopics many times above. In terms of content, these topics theoraare the same as the topics without them. The difference lies in the encoding method. Theora is an open and free video compression encoding technology. Therefore, if you have no special needs when using it, just use the general one.

    (5) rectTopic with

    In addition, rectthe Topic represents the corrected data, the abbreviation of Rectify.

    (6)Other Topics

    If you need to get accelerometer or gyroscope data, just subscribe /camera/gyro/sampleto and /camera/accel/sample. Obtained below are the contents of the accelerometer.

    The above is more detailed information about the D435i ROS interface. Later, we will calibrate it based on the Kalibr introduced before , and try to use D435i to run ORB-SLAM3.

        </section>
    

Guess you like

Origin blog.csdn.net/luoganttcc/article/details/131711243