作者: Sam (甄峰) sam_code@hotmail.com
0. rgbd_launch简介:
一组打开RGBD设备,并load 所有nodelets去转化 raw depth/RGB/IR 流到 深度图(depth
image), 视差图(disparity image)和点云(point clouds)的launch文件集。
这些Launch文件在ROS中,使用RGB-D设备(如Microsoft Kinect, Xtion)。
它创建一个nodelet graph, 把Device Driver中获取Raw
Data转换为点云,视差图或其它指定格式。
rgbd_launch包含一系列common launch文件,他们会被driver指定的launch
Package使用。Driver指定的Launch
Package包括:openni_launch或freenect_launch.
1. launch 详细分析:
两个launch文件最重要:
launch/includes/processing.launch.xml:
从RGB-D driver (openni_camera, freenect_camera)获取数据,并处理。
launch/kinect_frames.launch:
为Kinect启动TF Tree。 它可以由openni_launch或freenect_launch启动。
1.1:processing.lanch.xml详解:
这个Launch中,可以启动nodelet去转换Raw RGB和depth
image到可以使用的信息,如点云。可以使用参数来设置哪些工作可以做。
rgb_processing (bool,
default: true)
debayer_processing (bool,
default: true)
depth_processing (bool,
default: true)
depth_registered_processing (bool,
default: true)
- Launch nodelets for generating raw and rectified monochrome and color images. Given bayer encoded images on the rgb/image_raw topic from the RGB-D driver, the rgb processing chain produces rgb/image_mono,rgb/image_rect_mono, rgb/image_color and rgb/image_rect_color.
- 控制是否启动nodelet去产生raw Data和校正(rectified)过的单色以及色彩Image。把从RGB-D driver读取的数据以bayer编码RGB编码放入 rgb/image_raw Topic中。同时产生rgb/image_mono,rgb/image_rect_mono, rgb/image_color and rgb/image_rect_color这系列Topic。
如果rgb_processing被设置为True。则$(find
rgbd_launch)/launch/includes/rgb.launch.xml
- Usage of this parameter requires rgb_processing to be true. Debayers the image into monochrome and color. If set to true then explanation for rgb_processing directly applies. If set to false the rgb processing chain only producesrgb/image_rect_color.
-
- If set to true, rectifies the raw IR image (ir/image_raw -> ir/image_rect_raw)
- $(find rgbd_launch)/launch/includes/ir.launch.xml
- Given the raw depth image, rectifies it, converts both the raw and rectified images to metric format (uint16 ->float), and produces a pointcloud. Requires depth/image_raw. Produces depth/image_rect_raw (rectified),depth/image (metric), depth/image_rect (rectified, metric), depth/points (pointcloud).
-
- Generates a registered RGBD pointcloud from the device data (requires rgb_processing to be enabled). A pointcloud can be generated through a software registration pipeline (sw_registered_processing = true, used when depth_registration for device driver is set to false ) by registering the depth image from the depth frame to an RGB frame and merging with the RGB image. If software registration is being used, depth_processing needs to be enabled. Alternatively, the device can be directly asked to generate a registered depth image in the RGB frame with can be merged with the RGB Image through the hardware registration pipeline (hw_registered_processing = true, used when depth_registration for device driver is set to true)
- Generates a disparity image from unregistered depth data (i.e. in the depth frame). Converts depth/image_rect_rawand projector/camera_info into the disparity image depth/disparity. Requires depth_processing to be enabled.
- Enables the software registration pipeline. depth/image_rect_raw ->depth_registered/sw_registered/image_rect_raw (registered) -> depth_registered/points ANDdepth_registered/disparity.
- Enables the hardware registration pipeline. depth/image_raw -> depth_registered/hw_registered/image_rect_raw(rectified) -> depth_registered/points AND depth_registered/disparity.
1.2:其它XML:
rgb.launch.xml:
利用nodelet,启动 image_proc/debayer,
image_proc/rectify, image_proc/rectify
换句话说,把Raw
Data使用image_proc的nodelet来校准。
depth.launch.xml:
利用nodelet,
启动 image_proc/rectify, depth_image_proc/convert_metric, depth_image_proc/convert_metric, depth_image_proc/point_cloud_xyz。
附1:
RAW RGB与Bayer RGB
对于Sensor来说,Bayer RGB和RAW RGB两者的图象结构都是BG/GR的。(Bayer pattern说的是COLOR FILTER的结构,分为两种:STD Bayer pattern 与Pair pattern,其中STD Bayer pattern的结构是BG/GR的,而Pair Pattern顾名思义是指BGBG/GRGR的结构,即以四行为一个单位,前两行是BG的结构,后两行是GR的结构,这种结构是美光专门为此申请了专利的,主要是在输出TV模式(NTSC/PAL制)时用到).