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

ROS Kinect - Getting sensor data

asked 2013-12-03 23:04:25 -0500

Phorce gravatar image

I am new to the ROS middleware framework and I do not understand how I would extract the sensor point data from the Kinect using C++?

I have been looking into using the sensor_msgs/PoinntCloud2.h and extracting the points that will be able to publish the data onto a new topic called "kinect_sensor" but I cannot seem to find any tutorials out there which will allow me to do this?

Hope someone can help

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-12-03 23:15:14 -0500

Tirjen gravatar image

If I understood well, you simply want to publish kinect data over ROS. Then I suggest you to look at this package. Once your Kinect is connected, simply run the command:

roslaunch openni_launch openni.launch

it will publish a list of topic with depth image, rgb image, point cloud, info etc.

edit flag offensive delete link more

Comments

@Tirjen Thanks for your reply. I have installed open_ni and want to use the topic on point cloud, this is fine. I just don't know how to access this using C++ in a subscriber and talker scripts.. Any advice?

Phorce gravatar image Phorce  ( 2013-12-03 23:22:46 -0500 )edit

So you have a topic publishing a PointCloud2 message and you want to subscribe to it? If so, just subscribe to it as to any other topic. inside your code declare a publisher a node handle and then subscribe to it: ros::Subscriber cloudsub_=n_.subscribe("/camera/depth/points", 1, cloudcb); where cloudcb is your callback function.

Tirjen gravatar image Tirjen  ( 2013-12-03 23:30:56 -0500 )edit

Question Tools

Stats

Asked: 2013-12-03 23:04:25 -0500

Seen: 351 times

Last updated: Dec 03 '13