KavenYau / ros2_astra_camera

ROS2 wrapper for Astra camera
Apache License 2.0
23 stars 6 forks source link

No depth stream when launched with robot node #8

Open Zephyr69 opened 1 year ago

Zephyr69 commented 1 year ago

I'm encoutering a weird situation.

When the astra_pro_launch.py is launched alone, everything seems to work correctly. But when it is launched along with my robot node, although all topics are created, only color and ir images are published, and no image is published in any of the depth image topics. As soon as the robot node is shutdown, depth images start to be published correctly.

The console info during the launchs in both senarios are exactly the same, and TF shows no problem as indicated by rviz2.

What could be causing this?

KavenYau commented 1 year ago

But when it is launched along with my robot node

What's the meaning? Launching astra_pro_launch.py in another launch file?

Zephyr69 commented 1 year ago

But when it is launched along with my robot node

What's the meaning? Launching astra_pro_launch.py in another launch file?

Right! It is simply included in another launch file, without any launch_arguments. The relavent logs when launching:

[robot_state_publisher-10] [INFO] [1669163211.233574408] [astra_state_publisher]: got segment camera_depth_frame [robot_state_publisher-10] [INFO] [1669163211.233721769] [astra_state_publisher]: got segment camera_depth_optical_frame [robot_state_publisher-10] [INFO] [1669163211.233793706] [astra_state_publisher]: got segment camera_link [robot_state_publisher-10] [INFO] [1669163211.233856010] [astra_state_publisher]: got segment camera_rgb_frame [robot_state_publisher-10] [INFO] [1669163211.233914986] [astra_state_publisher]: got segment camera_rgb_optical_frame [uvc_camera_node-9] [WARN] [1669163211.308858981] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic. [astra_camera_node-8] [INFO] [1669163211.447235840] [astra_wrapper]: Device "2bc5/0403@1/13" found. [astra_camera_node-8] [INFO] [1669163211.451206868] [astra_camera_node]: ir_frame_id = 'camera_ir_optical_frame' [astra_camera_node-8] [INFO] [1669163211.451467670] [astra_camera_node]: rgb_frame_id = 'camera_rgb_optical_frame' [astra_camera_node-8] [INFO] [1669163211.451551222] [astra_camera_node]: depth_frame_id = 'camera_depth_optical_frame'

[astra_camera_node-8] Warning: USB events thread - failed to set priority. This might cause loss of data... [uvc_camera_node-9] [INFO] [1669163211.516445054] [uvc_camera_node]: Opening camera with vendor=0x2bc5, product=0x501, serial="", index=0 [astra_camera_node-8] Warning: USB events thread - failed to set priority. This might cause loss of data... [astra_camera_node-8] [INFO] [1669163211.682229156] [astra_wrapper]: device name: Orbbec Astra Pro [astra_camera_node-8] [INFO] [1669163211.684497103] [astra_camera_node]: depth_mode is Resolution: 640x480@30Hz Format: Depth 1mm [astra_camera_node-8] [INFO] [1669163211.684769137] [astra_camera_node]: color mode is Resolution: 640x480@30Hz Format: RGB888 [astra_camera_node-8] [INFO] [1669163211.684917393] [astra_camera_node]: IR mode is Resolution: 640x480@30Hz Format: Gray16 [component_container-7] [INFO] [1669163211.848066730] [depth_image_proc_container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-7] [INFO] [1669163211.848230923] [depth_image_proc_container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-7] [INFO] [1669163211.848292907] [depth_image_proc_container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-7] [INFO] [1669163211.848343531] [depth_image_proc_container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-7] [INFO] [1669163211.848396651] [depth_image_proc_container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-7] [INFO] [1669163211.848446028] [depth_image_proc_container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-7] [INFO] [1669163211.848493036] [depth_image_proc_container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-7] [INFO] [1669163211.848540460] [depth_image_proc_container]: Found class: rclcpp_components::NodeFactoryTemplate [component_container-7] [INFO] [1669163211.848588940] [depth_image_proc_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate [uvc_camera_node-9] unsupported descriptor subtype VS_COLORFORMAT [uvc_camera_node-9] unsupported descriptor subtype VS_COLORFORMAT [astra_camera_node-8] [WARN] [1669163211.968734988] [astra_camera_node]: has IR sensor is 1 [astra_camera_node-8] [INFO] [1669163211.995841685] [astra_camera_node]: Starting IR stream. [astra_camera_node-8] [WARN] [1669163212.037908457] [astra_camera_node]: has depth sensor is 1 [astra_camera_node-8] [INFO] [1669163212.059646135] [astra_camera_node]: Starting depth stream. [INFO] [launch_ros.actions.load_composable_nodes]: Loaded node '/point_cloud_xyzrgb_node' in container '/depth_image_proc_container' [astra_camera_node-8] [INFO] [1669163212.194757570] [astra_camera_node]: using default calibration URL [astra_camera_node-8] [INFO] [1669163212.194979267] [astra_camera_node]: camera calibration URL: file:///home/jetson/.ros/camera_info/depth_Astra_Orbbec.yaml [astra_camera_node-8] [ERROR] [1669163212.195357893] [camera_calibration_parsers]: Unable to open camera calibration file [/home/jetson/.ros/camera_info/depth_Astra_Orbbec.yaml] [astra_camera_node-8] [WARN] [1669163212.195428229] [astra_camera_node]: Camera calibration file /home/jetson/.ros/camera_info/depth_Astra_Orbbec.yaml not found [uvc_camera_node-9] [INFO] [1669163212.240299656] [uvc_camera_node]: uvc mode: 640x480@30.000000 uncompressed [uvc_camera_node-9] attempt to claim already-claimed interface 1 [ydlidar_ros2_driver_node-2] [CYdLidar] Successed to start scan mode, Elapsed time 1062 ms [uvc_camera_node-9] [INFO] [1669163213.531238693] [uvc_camera_node]: using default calibration URL [uvc_camera_node-9] [INFO] [1669163213.531447238] [uvc_camera_node]: camera calibration URL: file:///home/jetson/.ros/camera_info/color_Astra_Orbbec.yaml [uvc_camera_node-9] [ERROR] [1669163213.531737479] [camera_calibration_parsers]: Unable to open camera calibration file [/home/jetson/.ros/camera_info/color_Astra_Orbbec.yaml] [uvc_camera_node-9] [WARN] [1669163213.531808392] [uvc_camera_node]: Camera calibration file /home/jetson/.ros/camera_info/color_Astra_Orbbec.yaml not found

KavenYau commented 1 year ago
import os

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, GroupAction, IncludeLaunchDescription
from launch.substitutions import LaunchConfiguration
from launch.launch_description_sources import PythonLaunchDescriptionSource

def generate_launch_description():
    bringup_dir = get_package_share_directory('ros2_astra_camera')
    launch_dir = os.path.join(bringup_dir, 'launch')

    enable_color_cloud = LaunchConfiguration('enable_color_cloud')

    declare_enable_color_cloud_cmd = DeclareLaunchArgument(
        'enable_color_cloud', default_value='False',
        description='Whether to enable color cloud')

    bringup_cmd_group = GroupAction([
        IncludeLaunchDescription(
            PythonLaunchDescriptionSource(os.path.join(launch_dir, 'astra_pro_launch.py')),
            launch_arguments={'enable_color_cloud': enable_color_cloud}.items()),
    ])

    ld = LaunchDescription()
    ld.add_action(declare_enable_color_cloud_cmd)
    ld.add_action(bringup_cmd_group)

    return ld

I write the code which simply includes astra_pro_launch.py, But I can't reproduce the situation you met.