1

I can run just one camera alone

I am following this enter link description here

I need to run both cameras simultaneously

when running the second camera the output:

[ INFO] [1550737732.951379947]: Initializing nodelet with 4 worker threads.
[FATAL] [1550737734.651595532]: Failed to load nodelet '/camera/rgb_rectify_mono` of type `image_proc/rectify` to manager `camera_nodelet_manager'
[camera/rgb_rectify_mono-4] process has died [pid 12535, exit code 255, cmd /opt/ros/indigo/lib/nodelet/nodelet load image_proc/rectify camera_nodelet_manager --no-bond image_mono:=rgb/image_mono image_rect:=rgb/image_rect_mono __name:=rgb_rectify_mono __log:=/home/turtlebot/.ros/log/4c3c5ce6-35a0-11e9-97f4-6c71d9e07c7b/camera-rgb_rectify_mono-4.log].
log file: /home/turtlebot/.ros/log/4c3c5ce6-35a0-11e9-97f4-6c71d9e07c7b/camera-rgb_rectify_mono-4*.log

openni.launch, this file causes conflict between them

<!-- Entry point for using OpenNI devices -->
<launch>

  <!-- "camera" should uniquely identify the device. All topics are pushed down
       into the "camera" namespace, and it is prepended to tf frame ids. -->
  <arg name="camera" default="camera" />
  <arg name="rgb_frame_id"   default="$(arg camera)_rgb_optical_frame" />
  <arg name="depth_frame_id" default="$(arg camera)_depth_optical_frame" />

  <!-- device_id can have the following formats:
         "B00367707227042B": Use device with given serial number
         "#1"              : Use first device found
         "2@3"             : Use device on USB bus 2, address 3
         "2@0"             : Use first device found on USB bus 2
    -->
  <arg name="device_id" default="#1" />

  <!-- By default, calibrations are stored to file://${ROS_HOME}/camera_info/${NAME}.yaml,
       where ${NAME} is of the form "[rgb|depth]_[serial#]", e.g. "depth_B00367707227042B".
       See camera_info_manager docs for calibration URL details. -->
  <arg name="rgb_camera_info_url"   default="" />
  <arg name="depth_camera_info_url" default="" />

  <!-- Use OpenNI's factory-calibrated depth->RGB registration? -->
  <arg name="depth_registration" default="false" />

  <!-- Arguments for remapping all device namespaces -->
  <arg name="rgb"                       default="rgb" />
  <arg name="ir"                        default="ir" />
  <arg name="depth"                     default="depth" />
  <arg name="depth_registered"          default="depth_registered" />
  <arg name="depth_registered_filtered" default="depth_registered" />
  <arg name="projector"                 default="projector" />

  <!-- Optionally suppress loading the driver nodelet and/or publishing the default tf
       tree. Useful if you are playing back recorded raw data from a bag, or are
       supplying a more accurate tf tree from calibration. -->
  <arg name="load_driver" default="true" />
  <arg name="publish_tf" default="true" />
  <!-- Processing Modules -->
  <arg name="rgb_processing"                  default="true"/>
  <arg name="ir_processing"                   default="true"/>
  <arg name="depth_processing"                default="true"/>
  <arg name="depth_registered_processing"     default="true"/>
  <arg name="disparity_processing"            default="true"/>
  <arg name="disparity_registered_processing" default="true"/>
  <arg name="hw_registered_processing"        default="true" />
  <arg name="sw_registered_processing"        default="true" />

  <!-- Disable bond topics by default -->
  <arg name="bond" default="false" /> <!-- DEPRECATED, use respawn arg instead -->
  <arg name="respawn" default="$(arg bond)" />

  <!-- Worker threads for the nodelet manager -->
  <arg name="num_worker_threads" default="4" />

  <!-- Push down all topics/nodelets into "camera" namespace -->
  <group ns="$(arg camera)">

    <!-- Start nodelet manager in top-level namespace -->
    <arg name="manager" value="$(arg camera)_nodelet_manager" />
    <arg name="debug" default="false" /> <!-- Run manager in GDB? -->
    <include file="$(find rgbd_launch)/launch/includes/manager.launch.xml">
      <arg name="name"                value="$(arg manager)" />
      <arg name="debug"               value="$(arg debug)" />
      <arg name="num_worker_threads"  value="$(arg num_worker_threads)" />
    </include>

    <!-- Load driver -->
    <include if="$(arg load_driver)"
         file="$(find openni_launch)/launch/includes/device.launch.xml">
      <!-- Could really use some syntactic sugar for this -->
      <arg name="manager"               value="$(arg manager)" />
      <arg name="device_id"             value="$(arg device_id)" />
      <arg name="rgb_frame_id"          value="$(arg rgb_frame_id ...

freenect.launch

<!-- Entry point for using OpenNI devices -->
<launch>

  <!-- "camera" should uniquely identify the device. All topics are pushed down
       into the "camera" namespace, and it is prepended to tf frame ids. -->
  <arg name="camera" default="camera" />
  <arg name="rgb_frame_id"   default="$(arg camera)_rgb_optical_frame" />
  <arg name="depth_frame_id" default="$(arg camera)_depth_optical_frame" />

  <arg name="data_skip" default="0" />

  <!-- device_id can have the following formats:
         "B00367707227042B": Use device with given serial number
         "#1"              : Use first device found
    -->
  <arg name="device_id" default="#1" />

  <!-- By default, calibrations are stored to file://${ROS_HOME}/camera_info/${NAME}.yaml,
       where ${NAME} is of the form "[rgb|depth]_[serial#]", e.g. "depth_B00367707227042B".
       See camera_info_manager docs for calibration URL details. -->
  <arg name="rgb_camera_info_url"   default="" />
  <arg name="depth_camera_info_url" default="" />

  <!-- Use OpenNI's factory-calibrated depth->RGB registration? -->
  <arg name="depth_registration" default="false" />

  <!-- Arguments for remapping all device namespaces -->
  <arg name="rgb"              default="rgb" />
  <arg name="ir"               default="ir" />
  <arg name="depth"            default="depth" />
  <arg name="depth_registered" default="depth_registered" />
  <arg name="projector"        default="projector" />

  <!-- Optionally suppress loading the driver nodelet and/or publishing the default tf
       tree. Useful if you are playing back recorded raw data from a bag, or are
       supplying a more accurate tf tree from calibration. -->
  <arg name="load_driver" default="true" />
  <arg name="publish_tf" default="true" />
  <!-- Processing Modules -->
  <arg name="rgb_processing"                  default="true"/>
  <arg name="ir_processing"                   default="true"/>
  <arg name="depth_processing"                default="true"/>
  <arg name="depth_registered_processing"     default="true"/>
  <arg name="disparity_processing"            default="true"/>
  <arg name="disparity_registered_processing" default="true"/>
  <arg name="hw_registered_processing"        default="true" />
  <arg name="sw_registered_processing"        default="true" />

  <!-- Disable bond topics by default -->
  <arg name="bond" default="false" /> <!-- DEPRECATED, use respawn arg instead -->
  <arg name="respawn" default="$(arg bond)" />

  <!-- Worker threads for the nodelet manager -->
  <arg name="num_worker_threads" default="4" />

  <!-- enable libfreenect debug logging -->
  <arg name="libfreenect_debug" default="false" />

  <!-- enable diagnostics support for freenect_camera -->
  <arg name="enable_rgb_diagnostics" default="false" />
  <arg name="enable_ir_diagnostics" default="false" />
  <arg name="enable_depth_diagnostics" default="false" />
  <arg name="diagnostics_max_frequency" default="30.0" />
  <arg name="diagnostics_min_frequency" default="30.0" />
  <arg name="diagnostics_tolerance" default="0.05" />
  <arg name="diagnostics_window_time" default="5.0" />

  <!-- Push down all topics/nodelets into "camera" namespace -->
  <group ns="$(arg camera)">

    <!-- Start nodelet manager in provided namespace -->
    <arg name="manager" value="$(arg camera)_nodelet_manager" />
    <arg name="debug" default="false" /> <!-- Run manager in GDB? -->
    <include file="$(find rgbd_launch)/launch/includes/manager.launch.xml">
      <arg name="name"                value="$(arg manager)" />
      <arg name="debug"               value="$(arg debug)" />
      <arg name="num_worker_threads"  value="$(arg num_worker_threads)" />
    </include>

    <!-- Load driver -->
    <include if="$(arg load_driver)"
         file="$(find freenect_launch)/launch/includes/device.launch.xml">
      <!-- Could really use some syntactic sugar for this -->
      <arg name="manager"                   value="$(arg manager)" />
      <arg name="device_id"                 value="$(arg device_id)" />
      <arg name="rgb_frame_id"              value="$(arg rgb_frame_id)" />
      <arg name="depth_frame_id"            value="$(arg depth_frame_id)" />
      <arg name="rgb_camera_info_url"       value="$(arg rgb_camera_info_url)" />
      <arg name="depth_camera_info_url"     value="$(arg depth_camera_info_url)" />
      <arg name="depth_registration"        value="$(arg depth_registration)" />
      <arg name="data_skip"                 value="$(arg data_skip)" />
      <arg name="rgb"                       value="$(arg rgb)" />
      <arg name="ir"                        value="$(arg ir)" />
      <arg name="depth"                     value="$(arg depth)" />
      <arg name="depth_registered"          value="$(arg depth_registered)" />
      <arg name="projector"                 value="$(arg projector)" />
      <arg name="respawn"                   value="$(arg respawn)" />
      <arg name="libfreenect_debug"         value="$(arg libfreenect_debug)" />
      <arg name="enable_rgb_diagnostics"    value="$(arg enable_rgb_diagnostics)" />
      <arg name="enable_ir_diagnostics"     value="$(arg enable_ir_diagnostics)" />
      <arg name="enable_depth_diagnostics"  value="$(arg enable_depth_diagnostics)" />
      <arg name="diagnostics_max_frequency" value="$(arg diagnostics_max_frequency)" />
      <arg name="diagnostics_min_frequency" value="$(arg diagnostics_min_frequency)" />
      <arg name="diagnostics_tolerance"     value="$(arg diagnostics_tolerance)" />
      <arg name="diagnostics_window_time"   value="$(arg diagnostics_window_time)" />
    </include>

    <!-- Load standard constellation of processing nodelets -->
    <include file="$(find rgbd_launch)/launch/includes/processing.launch.xml">
      <arg name="manager"                         value="$(arg manager)" />
      <arg name="rgb"                             value="$(arg rgb)" />
      <arg name="ir"                              value="$(arg ir)" />
      <arg name="depth"                           value="$(arg depth)" />
      <arg name="depth_registered"                value="$(arg depth_registered)" />
      <arg name="projector"                       value="$(arg projector)" />
      <arg name="respawn"                         value="$(arg respawn)" />
      <arg name="rgb_processing"                  value="$(arg rgb_processing)" />
      <arg name="ir_processing"                   value="$(arg ir_processing)" />
      <arg name="depth_processing"                value="$(arg depth_processing)" />
      <arg name="depth_registered_processing"     value="$(arg depth_registered_processing)" />
      <arg name="disparity_processing"            value="$(arg disparity_processing)" />
      <arg name="disparity_registered_processing" value="$(arg disparity_registered_processing)" />
      <arg name="hw_registered_processing"        value="$(arg hw_registered_processing)" />
      <arg name="sw_registered_processing"        value="$(arg sw_registered_processing)" />
    </include>

  </group> <!-- camera -->

  <!-- Load reasonable defaults for the relative pose between cameras -->
  <include if="$(arg publish_tf)"
       file="$(find rgbd_launch)/launch/kinect_frames.launch">
    <arg name="camera" value="$(arg camera)" />
  </include>

</launch>

I am run a Kinect

roslaunch freenect_launch freenect.launch

I am run a ASUS and Kinect

roslaunch openni_launch openni.launch

once running the second camera in the terminal of ASUS as second camera, output:

[ERROR] [1550795336.052843598]: Failed to find nodelet with name '/camera/disparity_registered_hw' to unload

also, the output for Kinect became:

[FATAL] [1550795336.061536430]: Failed to unload nodelet '/camera/disparity_registered_hw` from manager `camera_nodelet_manager'

please help me

thank you in advance

Algabri
  • 185
  • 1
  • 2
  • 12

1 Answers1

1

I'd suggest trying to launch each node in their own namespace. Looking at the launch files, you should be able to run:
roslaunch freenect_launch freenect.launch camera:=cam_kinect
and
roslaunch openni_launch openni.launch camera:=cam_asus

This should avoid conflict with node names and topic names.

Vik
  • 690
  • 7
  • 22
  • sadly, it not work, output:(http://example.com) _italic_ **bold** `No matching device found.... waiting for devices. Reason: openni_wrapper::OpenNIDevice::OpenNIDevice(xn::Context&, const xn::NodeInfo&, const xn::NodeInfo&, const xn::NodeInfo&, const xn::NodeInfo&) @ /tmp/binarydeb/ros-indigo-openni-camera-1.11.1/src/openni_device.cpp @ 61 : creating depth generator failed. Reason: Failed to set USB interface!` – Algabri Mar 05 '19 at 12:35
  • This output seems to be unrelated to the `camera` argument. Try to: (1) Run each camera individually without the camera argument (2)Then each individually with the camera argument (3) if the first 2 work, then try running them together with camera arguments. – Vik Mar 05 '19 at 16:41
  • first of all, thank you so much, (1) unfortunately, they didn't run with the camera argument (2) it is running individually Kinect by: `roslaunch freenect_launch freenect.launch` and ASUS Xtion by: `roslaunch openni2_launch openni2.launch` ,(3) together not work – Algabri Mar 07 '19 at 01:38
  • I don't understand why the camera argument isn't working. The launch files you posted clearly accept that argument and push everything into that namespace, so this should work. Are you modifying those launch files before using? – Vik Mar 07 '19 at 16:38
  • I don't modify anything so far – Algabri Mar 08 '19 at 13:43