38 #include "pcl/pcl_config.h"
40 #ifndef PCL_IO_ROBOT_EYE_GRABBER_H_
41 #define PCL_IO_ROBOT_EYE_GRABBER_H_
43 #include <pcl/io/grabber.h>
44 #include <pcl/io/impl/synchronized_queue.hpp>
45 #include <pcl/point_types.h>
46 #include <pcl/point_cloud.h>
47 #include <boost/asio.hpp>
48 #include <boost/thread/thread.hpp>
64 typedef void (sig_cb_robot_eye_point_cloud_xyzi) (
65 const boost::shared_ptr<const pcl::PointCloud<pcl::PointXYZI> >&);
71 RobotEyeGrabber (
const boost::asio::ip::address& ipAddress,
unsigned short port=443);
78 virtual
void start ();
86 virtual std::
string getName () const;
91 virtual
bool isRunning () const;
95 virtual
float getFramesPerSecond () const;
100 void setSensorAddress (const boost::asio::ip::address& ipAddress);
101 const boost::asio::ip::address& getSensorAddress () const;
106 void setDataPort (
unsigned short port);
107 unsigned short getDataPort () const;
112 void setSignalPointCloudSize (std::
size_t numerOfPoints);
113 std::
size_t getSignalPointCloudSize () const;
123 bool terminate_thread_;
124 size_t signal_point_cloud_size_;
125 unsigned short data_port_;
126 unsigned char receive_buffer_[500];
128 boost::asio::ip::address sensor_address_;
129 boost::asio::ip::udp::endpoint sender_endpoint_;
130 boost::asio::io_service io_service_;
131 boost::shared_ptr<boost::asio::ip::udp::socket> socket_;
132 boost::shared_ptr<boost::thread> socket_thread_;
133 boost::shared_ptr<boost::thread> consumer_thread_;
137 boost::signals2::signal<sig_cb_robot_eye_point_cloud_xyzi>* point_cloud_signal_;
139 void consumerThreadLoop ();
140 void socketThreadLoop ();
141 void asyncSocketReceive ();
142 void resetPointCloud ();
143 void socketCallback (const boost::system::error_code& error, std::
size_t numberOfBytes);
144 void convertPacketData (
unsigned char *dataPacket,
size_t length);
145 void computeXYZI (pcl::
PointXYZI& pointXYZI,
unsigned char* pointData);
Grabber interface for PCL 1.x device drivers.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
Grabber for the Ocular Robotics RobotEye sensor.