Welcome to DOFBOT-Ultra repository
1. Dabai_DCW2 camera
Dabai_DCW2 Camera
Please ensure that the web control program backend process is not running in the background. To close it, refer to the [Get Started Quickly - 2. Access the Terminal] section in [Disable the Auto-Start Web Control Backend Process]. After closing, please restart DofbotUltra!!!
Before starting this function, you need to close the web control program backend process.
1. Function Description
After starting the camera, you can obtain RGB color images, Depth images, and IR infrared images.
2. Startup and Operation
2.1 Startup
After connecting the camera to the motherboard via data cable, open the terminal and enter:
xxxxxxxxxxros2 launch orbbec_camera dabai_dcw2.launch.py
As shown in the figure below, when the terminal prints the above content, it means the camera is running normally and startup is successful. You can view the topics published by the camera node using the following command:

xxxxxxxxxxros2 node info /camera/camera
As shown in the figure below, the published color image topic is /camera/color/image_raw, the published depth image topic is /camera/depth/image_raw, the published infrared image topic is /camera/ir/image_raw, and the published point cloud data topic is /camera/depth/points.

2.2 Operation
Use rviz to view the camera's three images and point cloud. Open a new terminal and enter:
xxxxxxxxxxrviz2
After rviz starts, configure rviz according to the instructions in the figures below:

Change the Fixed Frame to camera_link.
Add Color Image Display

Click Add, then click By topic, select /color/image_raw/Image, and finally click OK to confirm. The color image will be displayed as follows:

Add Depth Image Display

Click Add, then click By topic, select /depth/image_raw/Image, and finally click OK to confirm. The depth image will be displayed as follows:

Add Infrared Image Display

Click Add, then click By topic, select /ir/image_raw/Image, and finally click OK to confirm. The infrared image will be displayed as follows:

View Depth Point Cloud Data

Click Add, then click By topic, select /depth/points/PointCloud2, and finally click OK to confirm. The depth point cloud image will be displayed as follows:
If you cannot see the point cloud, please check if Fixed Frame is set to camera_link.

View Colored Point Cloud Data

Click Add, then click By topic, select /depth_registered/points/PointCloud2, and finally click OK to confirm. The colored point cloud image will be displayed as follows:

3. Camera Parameters
3.1 Hardware Parameters

3.2 Camera Parameter Retrieval and Settings
The camera's initialization parameters are already set in the launch file that was started. The launch file path is:
xxxxxxxxxxRaspberry Pi: /home/yahboom/dofbot_ultra_ws/src/OrbbecSDK_ROS2/orbbec_camera/launch/dabai_dcw2.launch.pyRDK: /home/sunrise/dofbot_ultra_ws/src/OrbbecSDK_ROS2/orbbec_camera/launch/dabai_dcw2.launch.pyThe contents are as follows:
xxxxxxxxxxfrom launch import LaunchDescriptionfrom launch.actions import DeclareLaunchArgumentfrom launch.substitutions import LaunchConfigurationfrom launch_ros.actions import PushRosNamespacefrom launch.actions import GroupActionfrom launch_ros.actions import ComposableNodeContainerfrom launch_ros.descriptions import ComposableNodefrom launch_ros.actions import Nodeimport os
def generate_launch_description(): # Declare arguments args = [ DeclareLaunchArgument('camera_name', default_value='camera'), DeclareLaunchArgument('depth_registration', default_value='true'), DeclareLaunchArgument('serial_number', default_value=''), DeclareLaunchArgument('usb_port', default_value=''), DeclareLaunchArgument('device_num', default_value='1'), DeclareLaunchArgument('vendor_id', default_value='0x2bc5'), DeclareLaunchArgument('product_id', default_value=''), DeclareLaunchArgument('enable_point_cloud', default_value='true'), DeclareLaunchArgument('enable_colored_point_cloud', default_value='true'), DeclareLaunchArgument('cloud_frame_id', default_value=''), DeclareLaunchArgument('point_cloud_qos', default_value='default'), DeclareLaunchArgument('connection_delay', default_value='100'), DeclareLaunchArgument('color_width', default_value='640'), DeclareLaunchArgument('color_height', default_value='480'), DeclareLaunchArgument('color_fps', default_value='30'), DeclareLaunchArgument('color_format', default_value='MJPG'), DeclareLaunchArgument('enable_color', default_value='true'), DeclareLaunchArgument('flip_color', default_value='false'), DeclareLaunchArgument('color_qos', default_value='default'), DeclareLaunchArgument('color_camera_info_qos', default_value='default'), DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'), DeclareLaunchArgument('color_exposure', default_value='-1'), DeclareLaunchArgument('color_gain', default_value='-1'), DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'), DeclareLaunchArgument('color_white_balance', default_value='-1'), DeclareLaunchArgument('color_ae_max_exposure', default_value='-1'), DeclareLaunchArgument('color_brightness', default_value='-1'), DeclareLaunchArgument('color_sharpness', default_value='-1'), DeclareLaunchArgument('color_saturation', default_value='-1'), DeclareLaunchArgument('color_contrast', default_value='-1'), DeclareLaunchArgument('color_gamma', default_value='-1'), DeclareLaunchArgument('color_hue', default_value='-1'), DeclareLaunchArgument('depth_width', default_value='640'), DeclareLaunchArgument('depth_height', default_value='400'), DeclareLaunchArgument('depth_fps', default_value='15'), DeclareLaunchArgument('depth_format', default_value='Y11'), DeclareLaunchArgument('enable_depth', default_value='true'), DeclareLaunchArgument('flip_depth', default_value='false'), DeclareLaunchArgument('depth_qos', default_value='default'), DeclareLaunchArgument('depth_camera_info_qos', default_value='default'), # /config/depthfilter/Openni_device.json, need config path. DeclareLaunchArgument('depth_filter_config', default_value=''), DeclareLaunchArgument('ir_width', default_value='640'), DeclareLaunchArgument('ir_height', default_value='400'), DeclareLaunchArgument('ir_fps', default_value='15'), DeclareLaunchArgument('ir_format', default_value='Y10'), DeclareLaunchArgument('enable_ir', default_value='true'), DeclareLaunchArgument('flip_ir', default_value='false'), DeclareLaunchArgument('ir_qos', default_value='default'), DeclareLaunchArgument('ir_camera_info_qos', default_value='default'), DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'), DeclareLaunchArgument('ir_exposure', default_value='-1'), DeclareLaunchArgument('ir_gain', default_value='-1'), DeclareLaunchArgument('publish_tf', default_value='true'), DeclareLaunchArgument('tf_publish_rate', default_value='0.0'), DeclareLaunchArgument('ir_info_url', default_value=''), DeclareLaunchArgument('color_info_url', default_value=''), DeclareLaunchArgument('log_level', default_value='none'), DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'), DeclareLaunchArgument('enable_soft_filter', default_value='true'), DeclareLaunchArgument('enable_ldp', default_value='true'), DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'), DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'), DeclareLaunchArgument('ordered_pc', default_value='false'), DeclareLaunchArgument('use_hardware_time', default_value='false'), DeclareLaunchArgument('enable_depth_scale', default_value='true'), DeclareLaunchArgument('align_mode', default_value='HW'), DeclareLaunchArgument('laser_energy_level', default_value='-1'), DeclareLaunchArgument('enable_heartbeat', default_value='false'), ]
# Node configuration parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args] # get ROS_DISTRO ros_distro = os.environ["ROS_DISTRO"] if ros_distro == "foxy": return LaunchDescription( args + [ Node( package="orbbec_camera", executable="orbbec_camera_node", name="ob_camera_node", namespace=LaunchConfiguration("camera_name"), parameters=parameters, output="screen", ) ] ) # Define the ComposableNode else: # Define the ComposableNode compose_node = ComposableNode( package="orbbec_camera", plugin="orbbec_camera::OBCameraNodeDriver", name=LaunchConfiguration("camera_name"), namespace="", parameters=parameters, ) # Define the ComposableNodeContainer container = ComposableNodeContainer( name="camera_container", namespace="", package="rclcpp_components", executable="component_container", composable_node_descriptions=[ compose_node, ], output="screen", ) # Launch description ld = LaunchDescription( args + [ GroupAction( [PushRosNamespace(LaunchConfiguration("camera_name")), container] ) ] ) return ld
After the camera is running, we can use some services to retrieve or set certain parameters. For example, to get the exposure value and set the exposure value, first query what services the camera node can call. Enter in the terminal:
xxxxxxxxxxros2 node info /camera/cameraAs shown in the figure below, after the camera node starts, it provides the following services:

3.2.1 Camera Parameter Retrieval
Taking getting the exposure value as an example, call the service and enter in the terminal:
xxxxxxxxxxros2 service call /camera/get_color_exposure orbbec_camera_msgs/srv/GetInt32 '{}'As shown in the figure below, the obtained exposure value is 100.

3.2.2 Camera Parameter Setting
Taking the auto exposure value switch as an example, call the service and enter in the terminal:
xxxxxxxxxxros2 service call /camera/set_color_auto_exposure std_srvs/srv/SetBool '{data: true}'
Manual setting:
xxxxxxxxxxros2 service call /camera/set_color_exposure orbbec_camera_msgs/srv/SetInt32 '{data: 50}'

After setting the auto exposure value, the color image will change the exposure value according to the environment settings.
