1 #ifndef RGBD_2_POINT_CLOUD_H
2 #define RGBD_2_POINT_CLOUD_H
5 #include <yarp/os/Bottle.h>
6 #include <yarp/os/RFModule.h>
7 #include <yarp/os/BufferedPort.h>
8 #include <yarp/dev/PolyDriver.h>
9 #include <yarp/sig/Image.h>
10 #include <yarp/sig/Vector.h>
11 #include <yarp/os/Node.h>
12 #include <yarp/os/Publisher.h>
13 #include <yarp/os/Stamp.h>
14 #include <yarp/rosmsg/sensor_msgs/PointCloud2.h>
16 #include "RGBD2PointCloud_IDL.h"
18 class RGBD2PointCloud :
public yarp::os::RFModule,
19 public RGBD2PointCloud_IDL
23 yarp::dev::PolyDriver RGBD_Client;
26 yarp::sig::ImageOf<yarp::sig::PixelRgb> colorImage;
27 yarp::sig::ImageOf<yarp::sig::PixelFloat> depthImage;
28 yarp::os::Port imageFrame_inputPort;
29 yarp::os::Port depthFrame_inputPort;
30 yarp::os::RpcServer rpcPort;
32 yarp::os::Stamp colorStamp, depthStamp;
39 std::string rotation_frame_id;
40 yarp::sig::Vector translation;
41 yarp::sig::Vector rotation;
47 yarp::os::Node *rosNode;
48 yarp::rosmsg::sensor_msgs::PointCloud2 rosPC_data;
49 yarp::os::Publisher<yarp::rosmsg::sensor_msgs::PointCloud2> pointCloud_outTopic;
59 bool convertRGBD_2_XYZRGB();
61 bool configure(yarp::os::ResourceFinder &rf);
64 bool interruptModule();
66 yarp::os::Bottle get_3D_points(
const std::vector<yarp::sig::Vector> &pixels,
bool color);
67 bool attach(yarp::os::RpcServer &source);