Getting Point cloud data from Openni driver
Previously, I posted how to get started on the point cloud data for the Openni. Many of you posted that i need to get through the tutorials for ROS to have a better understanding. I have done that now.One posted this code(for the subscriber) for me... which was very helpful.I have some qns on this code: 1) We need to have both a publisher and subscriber node for the Kinect in order to get point cloud data.Am i right to say that? 2) how do u get the depth data from the point cloud data?
Really need of help. I am sorry if i ask stupid questions.
#include <ros/ros.h>
#include <pcl_ros/point_cloud.h>
#include <sensor_msgs/PointCloud2.h>
using namespace ros;
using namespace sensor_msgs;
class processPoint {
NodeHandle nh;
Subscriber sub;
public:
processPoint() {
sub = nh.subscribe<sensor_msgs::PointCloud2>("/camera/rgb/points", 1, &processPoint::processCloud, this);
}
~processPoint() {
}
void processCloud( const sensor_msgs::PointCloud2ConstPtr& cloud );
};
void processPoint::processCloud( const sensor_msgs::PointCloud2ConstPtr& cloud ) {
}
int main(int argc, char **argv) {
init(argc, argv, "processPoint");
processPoint processPoint;
Rate spin_rate(1);
while( ok() ) {
spinOnce();
spin_rate.sleep();
}
}