ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

depth_registered

asked 2014-07-16 04:04:00 -0500

ROSkinect gravatar image

How can I get depth_registered from the Kinect and what topic should I use ?

and It is the same imageCallback as depth (/camera/depth/image)?

void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{

    cv_bridge::CvImagePtr cv_ptr;

    try
    {
        cv_ptr = cv_bridge::toCvCopy(msg1, sensor_msgs::image_encodings::TYPE_32FC1);
    }

    catch (cv_bridge::Exception& e)
    {
        ROS_ERROR("cv_bridge exception: %s", e.what());
        return;
    }


    cv::imshow("OpenCV viewer Kinect ", cv_ptr->image);

    cvWaitKey(3);

}

I tried this ones:

/camera/depth_registered/points

/camera/depth_registered/image_raw

but I didn't get any resulat. so what should I do ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2014-07-16 06:59:34 -0500

McMurdo gravatar image

updated 2014-07-16 07:05:51 -0500

/camera/depth_registered/points publishes point clouds and not Image.

You can convert it from a sensor_msgs::PointCloud2 to a pcl::PointCloud <pcl::PointXYZRGB> data type.

Are you using openni.launch from openni_launch pkg?

If yes, the topic /camera/depth_registered/image_raw should work for you.

You can learn the type of the topic by using -

rostopic type <topic name>

If I remember correctly there is an 'arg' called depth_registration that should be set to true if you want depth registration to be available. I am not exactly sure. Please check openni.launch file and try setting it to true if it is false.

Though this seems off-topic, this provides some useful info on the different topics http://wiki.ros.org/openni_launch/Tut...

edit flag offensive delete link more

Comments

very usefull answer, I can subscribe to the topic but I get something like that: https://www.mediafire.com/?y3das9c4mcadjm9 What does it mean this ? I'm converting the data that I get from the kinect from float to 8UC.

ROSkinect gravatar image ROSkinect  ( 2014-07-16 07:28:52 -0500 )edit

What do you intend to do with your data? Why do you need point cloud data? Please update your question and tell how exactly you solved it. It will be useful for others to see how you solved it. Please point out the exact mistake and the remedy.

McMurdo gravatar image McMurdo  ( 2014-07-16 08:23:52 -0500 )edit

And accept an answer that solves the issue, because that way others can rely on the answer if they have the same problem.

McMurdo gravatar image McMurdo  ( 2014-07-16 08:24:41 -0500 )edit

So the main solution is to launch the kinect command with a parameter like that: roslaunch openni_launch openni.launch depth_registration:=true and then you can subscribe to the topic normally. That's it.

ROSkinect gravatar image ROSkinect  ( 2014-07-16 08:35:11 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2014-07-16 04:04:00 -0500

Seen: 3,573 times

Last updated: Jul 16 '14