Robotics StackExchange | Archived questions

Kinect depth registration using OpenNI

I am having trouble visualizing a registered XYZRGB Pointcloud2 message in rviz using my Kinect and OpenNI. I am running ROS groovy on Ubuntu 11.10. I launch OpenNi with:

roslaunch openni_launch openni.launch depth_registration:=true

and I get the following output:

SUMMARY
========

PARAMETERS
 * /camera/depth/rectify_depth/interpolation
 * /camera/depth_registered/rectify_depth/interpolation
 * /camera/disparity_depth/max_range
 * /camera/disparity_depth/min_range
 * /camera/disparity_depth_registered/max_range
 * /camera/disparity_depth_registered/min_range
 * /camera/driver/depth_camera_info_url
 * /camera/driver/depth_frame_id
 * /camera/driver/depth_registration
 * /camera/driver/device_id
 * /camera/driver/rgb_camera_info_url
 * /camera/driver/rgb_frame_id
 * /rosdistro
 * /rosversion

NODES
  /camera/depth/
    metric (nodelet/nodelet)
    metric_rect (nodelet/nodelet)
    points (nodelet/nodelet)
    rectify_depth (nodelet/nodelet)
  /camera/rgb/
    debayer (nodelet/nodelet)
    rectify_color (nodelet/nodelet)
    rectify_mono (nodelet/nodelet)
  /
    camera_base_link (tf/static_transform_publisher)
    camera_base_link1 (tf/static_transform_publisher)
    camera_base_link2 (tf/static_transform_publisher)
    camera_base_link3 (tf/static_transform_publisher)
    camera_nodelet_manager (nodelet/nodelet)
  /camera/
    disparity_depth (nodelet/nodelet)
    disparity_depth_registered (nodelet/nodelet)
    driver (nodelet/nodelet)
    points_xyzrgb_depth_rgb (nodelet/nodelet)
    register_depth_rgb (nodelet/nodelet)
  /camera/ir/
    rectify_ir (nodelet/nodelet)
  /camera/depth_registered/
    metric (nodelet/nodelet)
    metric_rect (nodelet/nodelet)
    rectify_depth (nodelet/nodelet)

auto-starting new master
process[master]: started with pid [16003]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to a1c6d428-77b7-11e2-a2f6-0023148296f8
process[rosout-1]: started with pid [16016]
started core service [/rosout]
process[camera_nodelet_manager-2]: started with pid [16028]
process[camera/driver-3]: started with pid [16029]
process[camera/rgb/debayer-4]: started with pid [16050]
process[camera/rgb/rectify_mono-5]: started with pid [16076]
process[camera/rgb/rectify_color-6]: started with pid [16104]
process[camera/ir/rectify_ir-7]: started with pid [16138]
process[camera/depth/rectify_depth-8]: started with pid [16178]
process[camera/depth/metric_rect-9]: started with pid [16225]
process[camera/depth/metric-10]: started with pid [16275]
process[camera/depth/points-11]: started with pid [16342]
process[camera/register_depth_rgb-12]: started with pid [16407]
process[camera/depth_registered/rectify_depth-13]: started with pid [16478]
process[camera/depth_registered/metric_rect-14]: started with pid [16561]
process[camera/depth_registered/metric-15]: started with pid [16644]
process[camera/points_xyzrgb_depth_rgb-16]: started with pid [16734]
process[camera/disparity_depth-17]: started with pid [16839]
process[camera/disparity_depth_registered-18]: started with pid [16949]
process[camera_base_link-19]: started with pid [17075]
process[camera_base_link1-20]: started with pid [17175]
process[camera_base_link2-21]: started with pid [17279]
process[camera_base_link3-22]: started with pid [17407]
[ INFO] [1360964139.818215509]: Initializing nodelet with 4 worker threads.
[ INFO] [1360964145.019843740]: Number devices connected: 1
[ INFO] [1360964145.020321985]: 1. device on bus 002:12 is a Xbox NUI Camera (2ae) from Microsoft (45e) with serial id 'A00367A07613104A'
[ INFO] [1360964145.021616706]: Searching for device with index = 1
[ERROR] [1360964145.056855804]: Tried to advertise a service that is already advertised in this node [/camera/depth_registered/image_rect_raw/compressedDepth/set_parameters]
[ INFO] [1360964145.072552968]: Opened 'Xbox NUI Camera' on bus 2:12 with serial number 'A00367A07613104A'
[ERROR] [1360964145.122422746]: Tried to advertise a service that is already advertised in this node [/camera/depth_registered/image_rect_raw/compressed/set_parameters]
[ INFO] [1360964145.151001144]: rgb_frame_id = '/camera_rgb_optical_frame' 
[ INFO] [1360964145.151149135]: depth_frame_id = '/camera_depth_optical_frame' 
[ WARN] [1360964145.155915067]: Camera calibration file /home/marc/.ros/camera_info/rgb_A00367A07613104A.yaml not found.
[ WARN] [1360964145.155988894]: Using default parameters for RGB camera calibration.
[ WARN] [1360964145.156037920]: Camera calibration file /home/marc/.ros/camera_info/depth_A00367A07613104A.yaml not found.
[ WARN] [1360964145.156086029]: Using default parameters for IR camera calibration.
[ERROR] [1360964145.249034132]: Tried to advertise a service that is already advertised in this node [/camera/depth_registered/image_rect_raw/theora/set_parameters]

I can see that non-zero points are indeed being published by running

rostopic echo /camera/depth_registered/points

However, after adding a Pointcloud2 to rviz and subscribing to this topic, no point cloud appears. I would like to add that if I do not write depth_registration:=true when launching OpenNI (and now seeing points published under /camera/depth/points), I can indeed see this Pointcloud2 properly in rviz.

A similar thing is occuring with the disparity images. I can see the disparity image just fine when the cameras are not registered, but just see a grey image when they are registered. Note that for images and pointclouds, rviz does not raise any warnings or errors when subscribing to the registered versions, they just don't appear.

I have tried launching OpenNI without depth_registration:=true and then configuring it via rosrun rqt_reconfigure rqt_reconfigure, and I get the same result.

Any suggestions?

Asked by kamek on 2013-02-15 05:46:04 UTC

Comments

I've tried exactly what was suggested in that other question thread and there is no change in behaviour from what I've described in my question.

Asked by kamek on 2013-02-15 07:50:59 UTC

Did you calibrate your Kinect? Try deleting the calibration files in ~/.ros/camera_info

Asked by dgossow on 2013-02-15 07:58:33 UTC

are you using the default Kinect calibration? if so, could you try temporarily renaming the default calibration files in ~/.ros/camera_info and letting me know what you get as a result with and without depth registration?

Asked by georgebrindeiro on 2013-02-15 08:07:02 UTC

I have not calibrated my Kinect (yet). I am using the default Kinect calibration (i.e., ~/.ros/camera_info does not exist).

Asked by kamek on 2013-02-15 08:13:50 UTC

Could you post the output you get from running openni_launch? What version of ROS are you running? Which OS?

Asked by georgebrindeiro on 2013-02-15 08:49:26 UTC

I updated the question with the details you requested.

Asked by kamek on 2013-02-15 10:40:07 UTC

I am guessing, as before, that this is an OpenNI issue... Sorry I can't help you.

Asked by georgebrindeiro on 2013-02-15 12:38:29 UTC

Hey, I would like to ask if you found a solution to your problem. I've been having the same issue, with /camera/depth_registered/disparity producing only a grey image (not the original-no topic published grey) on image_view and rviz doesn't display the cloud although rostopic echo gives non-0 points

Asked by sotirios on 2014-01-07 15:38:35 UTC

Sorry, I never did find a solution. I haven't used the Kinect in ROS any time recently.

Asked by kamek on 2014-01-08 02:54:55 UTC

Answers