Point Cloud Library (PCL)  1.8.1
vlp_grabber.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2015-, Open Perception, Inc.
6  * Copyright (c) 2015 The MITRE Corporation
7  *
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * * Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  * * Redistributions in binary form must reproduce the above
17  * copyright notice, this list of conditions and the following
18  * disclaimer in the documentation and/or other materials provided
19  * with the distribution.
20  * * Neither the name of the copyright holder(s) nor the names of its
21  * contributors may be used to endorse or promote products derived
22  * from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35  * POSSIBILITY OF SUCH DAMAGE.
36  *
37  */
38 
39 #include "pcl/pcl_config.h"
40 
41 #ifndef PCL_IO_VLP_GRABBER_H_
42 #define PCL_IO_VLP_GRABBER_H_
43 
44 #include <pcl/io/hdl_grabber.h>
45 #include <pcl/io/grabber.h>
46 #include <pcl/point_types.h>
47 #include <pcl/point_cloud.h>
48 #include <boost/asio.hpp>
49 #include <string>
50 
51 namespace pcl
52 {
53 
54  /** \brief Grabber for the Velodyne LiDAR (VLP), based on the Velodyne High Definition Laser (HDL)
55  * \author Keven Ring <keven@mitre.org>
56  * \ingroup io
57  */
58  class PCL_EXPORTS VLPGrabber : public HDLGrabber
59  {
60  public:
61  /** \brief Constructor taking an optional path to an vlp corrections file. The Grabber will listen on the default IP/port for data packets [192.168.3.255/2368]
62  * \param[in] pcapFile Path to a file which contains previously captured data packets. This parameter is optional
63  */
64  VLPGrabber (const std::string& pcapFile = "");
65 
66  /** \brief Constructor taking a specified IP/port
67  * \param[in] ipAddress IP Address that should be used to listen for VLP packets
68  * \param[in] port UDP Port that should be used to listen for VLP packets
69  */
70  VLPGrabber (const boost::asio::ip::address& ipAddress,
71  const unsigned short port);
72 
73  /** \brief virtual Destructor inherited from the Grabber interface. It never throws. */
74  virtual
75  ~VLPGrabber () throw ();
76 
77  /** \brief Obtains the name of this I/O Grabber
78  * \return The name of the grabber
79  */
80  virtual std::string
81  getName () const;
82 
83  private:
84  virtual void
85  toPointClouds (HDLDataPacket *dataPacket);
86 
87  boost::asio::ip::address
88  getDefaultNetworkAddress ();
89 
90  void
91  loadVLP16Corrections ();
92 
93  };
94 }
95 
96 #endif /* PCL_IO_VLP_GRABBER_H_ */
Grabber for the Velodyne LiDAR (VLP), based on the Velodyne High Definition Laser (HDL)
Definition: vlp_grabber.h:58
Grabber for the Velodyne High-Definition-Laser (HDL)
Definition: hdl_grabber.h:60
Defines all the PCL implemented PointT point type structures.