41 #include "pcl/pcl_config.h"
43 #include <pcl/io/grabber.h>
44 #include <pcl/io/impl/synchronized_queue.hpp>
46 #include <pcl/point_cloud.h>
47 #include <boost/asio.hpp>
51 #define HDL_Grabber_toRadians(x) ((x) * M_PI / 180.0)
106 HDLGrabber (
const std::string& correctionsFile =
"",
107 const std::string& pcapFile =
"");
114 HDLGrabber (
const boost::asio::ip::address& ipAddress,
116 const std::string& correctionsFile =
"");
134 getName () const override;
140 isRunning () const override;
145 getFramesPerSecond () const override;
151 filterPackets (const
boost::asio::ip::address& ipAddress,
159 setLaserColorRGB (const
pcl::
RGB& color,
160 const std::
uint8_t laserNumber);
166 template<typename IterT>
void
167 setLaserColorRGB (const IterT& begin, const IterT& end)
169 std::copy (begin, end, laser_rgb_mapping_);
177 setMinimumDistanceThreshold (
float & minThreshold);
184 setMaximumDistanceThreshold (
float & maxThreshold);
190 getMinimumDistanceThreshold ();
195 getMaximumDistanceThreshold ();
200 getMaximumNumberOfLasers ()
const;
211 BLOCK_0_TO_31 = 0xeeff, BLOCK_32_TO_63 = 0xddff
214 #pragma pack(push, 1)
276 static double *cos_lookup_table_;
277 static double *sin_lookup_table_;
279 boost::asio::ip::udp::endpoint udp_listener_endpoint_;
280 boost::asio::ip::address source_address_filter_;
282 boost::asio::io_service hdl_read_socket_service_;
283 boost::asio::ip::udp::socket *hdl_read_socket_;
284 std::string pcap_file_name_;
285 std::thread *queue_consumer_thread_;
286 std::thread *hdl_read_packet_thread_;
287 bool terminate_read_packet_thread_;
288 pcl::RGB laser_rgb_mapping_[HDL_MAX_NUM_LASERS];
289 float min_distance_threshold_;
290 float max_distance_threshold_;
295 virtual boost::asio::ip::address
296 getDefaultNetworkAddress ();
299 initialize (
const std::string& correctionsFile =
"");
302 processVelodynePackets ();
306 std::size_t bytesReceived);
309 loadCorrectionsFile (
const std::string& correctionsFile);
312 loadHDL32Corrections ();
315 readPacketsFromSocket ();
319 readPacketsFromPcap();
321 #endif //#ifdef HAVE_PCAP
324 isAddressUnspecified (
const boost::asio::ip::address& ip_address);