Ask Your Question
1

depth_registered

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

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 -0600

McMurdo gravatar image

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

/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 imageROSkinect ( 2014-07-16 07:28:52 -0600 )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 imageMcMurdo ( 2014-07-16 08:23:52 -0600 )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 imageMcMurdo ( 2014-07-16 08:24:41 -0600 )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 imageROSkinect ( 2014-07-16 08:35:11 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 2,161 times

Last updated: Jul 16 '14