NVIDIA-ISAAC-ROS / isaac_ros_argus_camera

ROS 2 packages based on NVIDIA libArgus library for NVIDIA-accelerated CSI camera support.
https://developer.nvidia.com/isaac-ros-gems
Apache License 2.0
64 stars 12 forks source link

Connecting with multiple monocular cameras #32

Open oncepursuit opened 9 months ago

oncepursuit commented 9 months ago

Hello I can connect a single monocular camera successfully , but I want to connect multiple monocular cameras. How can I do that ? Does this code support connecting multiple monocular cameras at the same time? Thank you.

jaiveersinghNV commented 8 months ago

Assuming you've correctly wired the monocular cameras to the Jetson using the appropriate GMSL expansion boards, you should be able to run multiple instances of the isaac_ros_argus_camera_node with the appropriate settings for device_id and module_id.

oncepursuit commented 7 months ago

Thanks for replay! I tried run multiple instances of the isaac_ros_argus_camera_node in the way as below(modify in isaac_ros_argus_camera_mono.launch.py): `def generate_launch_description(): argus_mono_node_camera1 = ComposableNode( name='argus_mono_camera1', package='isaac_ros_argus_camera', plugin='nvidia::isaac_ros::argus::ArgusMonoNode', parameters=[ { "camera_id": 0, } ],

)
argus_mono_node_camera2 = ComposableNode(
    name='argus_mono_camera2',
    package='isaac_ros_argus_camera',
    plugin='nvidia::isaac_ros::argus::ArgusMonoNode',
    remappings=[("left/image_raw", "right/image_raw"),
                ("left/camerainfo", "right/camerainfo"),
    ],
    parameters=[
        {
            "camera_id": 1,
        }
    ],
)
argus_mono_container = ComposableNodeContainer(
        name='argus_mono_container',
        package='rclcpp_components',
        executable='component_container_mt',
        composable_node_descriptions=[argus_mono_node_camera1, argus_mono_node_camera2],
        namespace='',
        output='screen',
        arguments=['--ros-args', '--log-level', 'info'],
    )
return launch.LaunchDescription([argus_mono_container])`

but I got this error: [component_container_mt-1] [INFO] [1701328260.944711675] [argus_mono_camera2]: [NitrosContext] Running appliation... [component_container_mt-1] (NvCameraUtils) Error InvalidState: Mutex already initialized (in Mutex.cpp, function initialize(), line 41) [component_container_mt-1] (Argus) Error InvalidState: (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function open(), line 54) [component_container_mt-1] (Argus) Error InvalidState: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 262) [component_container_mt-1] (Argus) Error InvalidState: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 106) [component_container_mt-1] 2023-11-30 07:11:00.945 ERROR extensions/hawk/argus_camera.cpp@191: Failed to create CameraProvider [component_container_mt-1] 2023-11-30 07:11:00.945 WARN gxf/std/greedy_scheduler.cpp@221: Error while executing entity 59 named 'LVIDAILELA_argus_camera': GXF_FAILURE [component_container_mt-1] 2023-11-30 07:11:00.945 ERROR gxf/std/entity_executor.cpp@200: Entity with 82 not found! [component_container_mt-1] [ERROR] [1701328260.945881793] [argus_mono_camera2]: [NitrosPublisher] Vault ("vault_left_image/vault", eid=82) was stopped. The graph may have been terminated due to an error. [component_container_mt-1] terminate called after throwing an instance of 'std::runtime_error' [component_container_mt-1] what(): [NitrosPublisher] Vault ("vault_left_image/vault", eid=82) was stopped. The graph may have been terminated due to an error.

but if I run one instance, it is ok no matter camera_id is 0 or 1.

jaiveersinghNV commented 7 months ago

Could you confirm that you are running on the latest Isaac ROS 2.1 release of Isaac ROS Argus Camera? Multi-instance support for Argus was a feature that was added recently. If you're running an older version of Isaac ROS, please update to the latest and try again.

WangGangUCAS commented 2 months ago

"Received an image, do you need to modify the isaac_ros_argus_camera code?"