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

Revision history [back]

click to hide/show revision 1
initial version

Even if you can make the VM to connect to the Kinect, you still might not get data from it because the connection protocol is too slow. What I have is PCL-Win32 on Windows 7 and it includes the ros-sdk-electric for windows (Boost 1.44 because it is needed for the ros-sdk). I then use the PCL_IO to connect to the kinect, convert the data into PointCloud2 and I publish it. When you publish topics using the ros-win you have to setup the Linux machine as a master. I can get the published PointCloud2 data on the VM or on any Linux running machine. You can use the PointCloud2 as it is or convert it to sensor_msgs::Image or a different type of data depending on your application. As a side note, I installed the PCL from source (not the prebuild one) and replaced the sensor_msgs (PCL/trunk/common/include/sensor_msgs) with the sensor_msgs header files from my linux machine (opt/ros/electric/stacks/common_msgs/sensor_msgs/msg_gen/cpp/include/sensor_msgs). You only need to build pcl_common and pcl_io in order to connect to the kinect. You can use the pcl_openni_io example to see how to callback on XYZRGB Point and use the /pcl/ros/conversions.h to see how to convert that to PointCloud2. Do not use the toROSmsg() function provided by the pcl but copy the function directly in your code. The publishing rate is pretty high, I tested my code between 2 laptops (one windows one linux os) and it still had decent publishing rate, the rate is even higher if you use a windows host and a linux guest on a VM.

It might seem like a lot of work but having PCL with ROS running on Windows is pretty awesome, especially if you are running a VM. You can reduce the CPU load from the VM by running some code on Windows.

Hope this helps, Ivan