ros-drivers / openni2_launch

Launch files to open an OpenNI2 device and load all nodelets to convert raw depth/RGB/IR streams to depth images, disparity images, and (registered) point clouds.
8 stars 33 forks source link

disabling hardware depth registration leads to error #9

Closed bit-pirate closed 6 years ago

bit-pirate commented 10 years ago

When I deactivated depth registration via rqt_reconfigure, I get the following error:

[ERROR] [1379904975.770528069]: Depth image frame id [sensor_3d_depth_optical_frame] doesn't match RGB image frame id [sensor_3d_rgb_optical_frame]

Can anyone confirm this? What's different to the old version (openni1)?

bit-pirate commented 10 years ago

Maybe @piyushk knows what's going wrong.

piyushk commented 10 years ago

@bit-pirate I don't have anything other than a kinect at hand at the moment, so I can't test this directly. Can you try and locate which nodelet is generating this error?

bit-pirate commented 10 years ago

It's the registration nodelet (PointCloudXyzrgbNodelet) complaining:

Depth image frame id [sensor_3d_depth_optical_frame] doesn't match RGB image frame id [sensor_3d_rgb_optical_frame]

Location:
/tmp/buildd/ros-hydro-depth-image-proc-1.11.2-0precise-20130909-1058/src/nodelets/point_cloud_xyzrgb.cpp:PointCloudXyzrgbNodelet::imageCb:167

Looks to me like the driver is outputting images or point clouds with different reference frames, when not using hardware registration.

piyushk commented 10 years ago

I suspect the s/w registration pipeline is broken somehow. Once s/w registered, the depth image should have the RGB image frame id. I'm not sure how the driver could make this mistake.

On Mon, Sep 23, 2013 at 11:15 PM, Marcus Liebhardt <notifications@github.com

wrote:

It's the registration nodelet (PointCloudXyzrgbNodelet) complaining:

Depth image frame id [sensor_3d_depth_optical_frame] doesn't match RGB image frame id [sensor_3d_rgb_optical_frame]

Location: /tmp/buildd/ros-hydro-depth-image-proc-1.11.2-0precise-20130909-1058/src/nodelets/point_cloud_xyzrgb.cpp:PointCloudXyzrgbNodelet::imageCb:167

Looks to me like the driver is outputting images or point clouds with different reference frames, when not using hardware registration.

— Reply to this email directly or view it on GitHubhttps://github.com/ros-drivers/openni2_launch/issues/9#issuecomment-24973657 .

mikeferguson commented 10 years ago

@bit-pirate you mention "disable via rqt" -- does software registration work correctly if you start up in that mode?

liborw commented 10 years ago

I have the same problem when started without the hardware registration (not using the dynamic reconfigure).

liborw commented 10 years ago

The problem is, that one must also set hw_registered_processing to false and sw_registered_processing to true along with the depth_registration to false. That way everything works fine.

mikeferguson commented 10 years ago

@liborw if you leave both pipelines running, do you get a massive number of errors?

If so, I think we can fix that, around here https://github.com/ros-drivers/openni2_camera/blob/hydro-devel/src/openni2_driver.cpp#L451 by moving the publishers into the if/else block. Since pubdepth is being remapped to depth_registered right now by device.launch.xml, and pub_depthraw is used by the sw pipeline which apparently includes a convert metric nodelet.

liborw commented 10 years ago

@mikeferguson I get some errors same are mentioned above when the depth_registration is false, no errors when true. But that way both pipelines are publishing to points topic.

mikeferguson commented 10 years ago

I've merged #12 as a temporary fix, I'm pretty certain that with a few updates to the drivers we can leave both sw and hw registration running, as only one of depth/image_raw or depth_registered/image_raw will be published. I should be able to find a few minutes to crank that out when I get to the office and have sensors to test with.

achim-k commented 7 years ago

I think we need an extra publisher to depth_registered/image_raw to solve this problem. Depending whether depth_registration is enabled, the appropriate publisher is chosen:

if (depth_registration_)
{
  // Publish on registered topic: depth_registered/image_raw
  image->header.frame_id = color_frame_id_;
  // ...
} else {
  // Publish on non-registered depth topic: depth/image[_raw]
  image->header.frame_id = depth_frame_id_;
  // ...
}

The remapping in openni2_launch/launch/includes/device.launch.xml would then also not be necessary.

<remap from="$(arg depth)/image" to="$(arg depth_registered)/image_raw" />

At least that worked for me locally. Am I missing something?

130s commented 6 years ago

Moved to the ros-drivers/openni2_camera repo (cont'd in the referenced issue).