40 #include "pcl/pcl_config.h" 42 #include <pcl/io/grabber.h> 43 #include <pcl/io/impl/synchronized_queue.hpp> 45 #include <pcl/point_cloud.h> 47 #include <boost/asio.hpp> 72 RobotEyeGrabber (
const boost::asio::ip::address& ipAddress,
unsigned short port=443);
79 void start () override;
82 void stop () override;
87 std::
string getName () const override;
92 bool isRunning () const override;
96 float getFramesPerSecond () const override;
101 void setSensorAddress (const
boost::asio::ip::address& ipAddress);
102 const
boost::asio::ip::address& getSensorAddress () const;
107 void setDataPort (
unsigned short port);
108 unsigned short getDataPort () const;
113 void setSignalPointCloudSize (std::
size_t numerOfPoints);
114 std::
size_t getSignalPointCloudSize () const;
124 bool terminate_thread_;
125 std::
size_t signal_point_cloud_size_;
126 unsigned short data_port_;
127 enum { MAX_LENGTH = 65535 };
128 unsigned char receive_buffer_[MAX_LENGTH];
129 unsigned int data_size_;
131 boost::asio::ip::address sensor_address_;
132 boost::asio::ip::udp::endpoint sender_endpoint_;
133 boost::asio::io_service io_service_;
134 std::shared_ptr<boost::asio::ip::udp::socket> socket_;
135 std::shared_ptr<std::thread> socket_thread_;
136 std::shared_ptr<std::thread> consumer_thread_;
140 boost::signals2::signal<sig_cb_robot_eye_point_cloud_xyzi>* point_cloud_signal_;
142 void consumerThreadLoop ();
143 void socketThreadLoop ();
144 void asyncSocketReceive ();
145 void resetPointCloud ();
146 void socketCallback (
const boost::system::error_code& error, std::size_t number_of_bytes);
147 void convertPacketData (
unsigned char *data_packet, std::size_t length);
148 void computeXYZI (
pcl::PointXYZI& point_XYZI,
unsigned char* point_data);
149 void computeTimestamp (
std::uint32_t& timestamp,
unsigned char* point_data);
void(const pcl::PointCloud< pcl::PointXYZI >::ConstPtr &) sig_cb_robot_eye_point_cloud_xyzi
Signal used for the point cloud callback.
shared_ptr< PointCloud< PointT > > Ptr
Defines functions, macros and traits for allocating and using memory.
Grabber interface for PCL 1.x device drivers.
Defines all the PCL implemented PointT point type structures.
Grabber for the Ocular Robotics RobotEye sensor.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
shared_ptr< const PointCloud< PointT > > ConstPtr