Slow pointcloud topic rate with openni_launch

asked 2018-05-21 08:54:40 -0500

SancheZ gravatar image

updated 2018-05-21 09:23:59 -0500

Hi, I'm working on a object and scene recognition framework that uses deep learning methods. The robot is a pioneer p3-dx where I have connected a laptop (ros master) with a kinect. Then I use another laptop, with a better gpu, to perform image classifications and so on... This laptop is connected to the ROS MASTER. The problem is that I am receiving pointclouds and images in a very low rate, something like 1.5s between each pointcloud in /camera/depth_registered/points. When I launch openni lots of camera nodes start running but I only need /camera/rgb/image_raw and /camera/depth_registered/points topics. If openni only starts those two the transmission might be faster I think. Therefore, I am thinking in editing the openni_launch file, to do something like that, but I don't understand that launch file. Anyone has done something like it?

<!-- Entry point for using OpenNI devices -->
  <!-- "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 ...
edit retag flag offensive close merge delete



Generally, if no nodes subscribe to the topics that you aren't using, then they won't actually be published and won't waste communication bandwidth or computational effort. To me, this sounds like you are running into a network bottleneck. The point cloud topic and the RGB topic both need a lot of..

jarvisschultz gravatar image jarvisschultz  ( 2018-05-21 09:20:26 -0500 )edit

...bandwidth. Are your computers connected wirelessly? Have you looked at the bandwidth usage using rostopic bw? You could test if connecting wired improves things? Is the topic rate slow on the computer connected to the Kinect?

jarvisschultz gravatar image jarvisschultz  ( 2018-05-21 09:21:57 -0500 )edit

If you do find that the network is a bottleneck, you could try voxel downsampling and subscribing to the downsampled pointclouds, or you could use the compressed image transport topics and build the point clouds using depth_image_proc on the other computer.

jarvisschultz gravatar image jarvisschultz  ( 2018-05-21 09:26:10 -0500 )edit

You'll likely need to use compressed_depth_image_transport for compressed depth map transmission. Note that PCL supports point cloud compression don't know of any ROS wrappers

jarvisschultz gravatar image jarvisschultz  ( 2018-05-21 09:32:00 -0500 )edit