The color pointcloud is published at a very slow rate if the non colored pointcloud is not subscribed

Issue #5 resolved
created an issue


Looks like if I subscribe to the colored pointcloud without any subscribers, the colored cloud is published at a very low rate and sometime not published at all if I use a 2.2GHz computer.

But if i subscibe to the non colored point cloud simultaneously along with the colored point cloud I get the rate close to the fps of the camera.

Thanks, Benzun

Comments (7)

  1. David LaRose

    Hi Benzun,

    Sorry this is causing trouble.

    I think I understand the issue, but could you clarify what "subscribe to the colored pointcloud without any subscribers" means?

    Thank you, Eric

  2. bpwiselybabu reporter

    Hi Eric, I mean, I have just one subscriber that subscribes only to the colored point cloud topic ie /multisense_sl/points2_color and no other subscriber. The point clouds are not published/published very slowly. Now only if I sumultaneously subscribe to /multisense_sl/points2 or set env variable MULTISENSE_ROS_PC_COLOR_FRAME_SYNC_OFF. It starts publishing at normal rate.

    I suspect line number 827 in camera.cpp, the ids seem to have an offset of 1

  3. David LaRose

    Hi Benzun,

    Thanks for the clarification.

    Looking more closely at the code, there is a race happening between two different parallel operations (in different threads):

    1) Disparity projection to 3D

    2) Color RGB rectification

    The current color point cloud code requires that the RGB rectification completes before the disparity projection, however there is no mechanism enforcing this.

    Turning the color point cloud frame sync off fixes the problem, but the RGB and range data can be misaligned by a frame.

    Turning the non-colorized point cloud on also fixes the problem because it slightly delays the publishing of the color cloud (which happens serially in the same thread), allowing more time for the RGB rectification of the correct frame to complete.

    This is a bug and I will add a ticket to create a more robust synchronization method for the color point cloud dependencies. A fix will be in our next release.

    Thanks, Eric

  4. David LaRose

    Hi Stefan / Benzun,

    A potential fix was just pushed. Please let us know if the issue persists (this problem may be affected by CPU hardware and application-specific processing load.)

    Thanks, Eric

  5. Log in to comment