OrbbecSDK_ROS1 icon indicating copy to clipboard operation
OrbbecSDK_ROS1 copied to clipboard

Issues with running multiple (4) orbbec cameras - gemini2

Open dhruvah opened this issue 1 year ago • 2 comments

I'm running into issues while running four cameras. I have a file that launches gemini2.launch, with the right namespaces, and a delay between the launches. All the camera nodes come up, and the logs show that everything is connected. I have all the serial numbers set correctly, so that is not an

But when I echo the topic for the fourth camera, it doesn't seem to publish any information.

This behavior is also inconsistent, and sometimes all the four cameras launch correctly with all the data being streamed.

I suspect that the error could be how the streaming is handled, based on the Subscriber callbacks. But I am not sure.

Has anyone run into a similar issue? This is my python launch file


#!/usr/bin/env python

import roslaunch
import rospy

rospy.init_node('multi_camera_launcher')
uuid = roslaunch.rlutil.get_or_generate_uuid(None, False)

launch = roslaunch.scriptapi.ROSLaunch()
launch.start()

front_up_depthcam = rospy.get_param('~front_up_depthcam', True)
back_up_depthcam = rospy.get_param('~back_up_depthcam', True)
front_down_depthcam = rospy.get_param('~front_down_depthcam', True)
back_down_depthcam = rospy.get_param('~back_down_depthcam', True)

device_num = rospy.get_param('~device_num', 4)

front_up_serial = rospy.get_param('~front_up_serial', '')
back_up_serial = rospy.get_param('~back_up_serial', '')
front_down_serial = rospy.get_param('~front_down_serial', '')
back_down_serial = rospy.get_param('~back_down_serial', '')

launch_file_path = '../src/orbbec_sdk_ros1/launch/gemini2.launch'

time_buffer = 3

def launch_camera(namespace, serial, device_num):
    cli_args = [
        launch_file_path,
        'camera_name:=' + namespace,
        'serial_number:=' + serial,
        'device_num:=' + str(device_num)
    ]
    roslaunch_args = cli_args[1:]
    roslaunch_file = [(roslaunch.rlutil.resolve_launch_arguments(cli_args)[0], roslaunch_args)]
    launch.parent = roslaunch.parent.ROSLaunchParent(uuid, roslaunch_file)
    launch.start()
    
 if front_up_depthcam:
    launch_camera('front_up', front_up_serial, device_num)

rospy.sleep(time_buffer)

if back_up_depthcam:
    launch_camera('back_up', back_up_serial, device_num)

rospy.sleep(time_buffer)

if front_down_depthcam:
    launch_camera('front_down', front_down_serial, device_num)

rospy.sleep(time_buffer)

if back_down_depthcam:
    launch_camera('back_down', back_down_serial, device_num)
    
launch.spin()

dhruvah avatar Jan 24 '24 00:01 dhruvah