LidarVLP16.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2022, Mathieu Labbe
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the names of its contributors may be used to endorse or promote products
13  derived from this software without specific prior written permission.
14 
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
19 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26 #ifndef CORELIB_INCLUDE_RTABMAP_CORE_LIDAR_LIDARVLP16_H_
27 #define CORELIB_INCLUDE_RTABMAP_CORE_LIDAR_LIDARVLP16_H_
28 
29 // Should be first on windows to avoid "WinSock.h has already been included" error
30 #include <pcl/io/vlp_grabber.h>
31 
32 #include <rtabmap/core/Lidar.h>
34 
35 namespace rtabmap {
36 
37 struct PointXYZIT {
38  float x;
39  float y;
40  float z;
41  float i;
42  float t;
43 };
44 
45 class RTABMAP_CORE_EXPORT LidarVLP16 :public Lidar, public pcl::VLPGrabber {
46 public:
47  LidarVLP16(
48  const std::string& pcapFile,
49  bool organized = false,
50  bool stampLast = true,
51  float frameRate = 0.0f,
52  Transform localTransform = Transform::getIdentity());
53  LidarVLP16(
54  const boost::asio::ip::address& ipAddress,
55  const std::uint16_t port = 2368,
56  bool organized = false,
57  bool useHostTime = true,
58  bool stampLast = true,
59  float frameRate = 0.0f,
60  Transform localTransform = Transform::getIdentity());
61  virtual ~LidarVLP16();
62 
63  SensorData takeScan(SensorCaptureInfo * info = 0) {return takeData(info);}
64 
65  virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "") override;
66  virtual std::string getSerial() const override {return getName();}
67 
68  void setOrganized(bool enable);
69 
70 private:
71  void buildTimings(bool dualMode);
72  virtual void toPointClouds (HDLDataPacket *dataPacket) override;
73 
74 protected:
75  virtual SensorData captureData(SensorCaptureInfo * info = 0) override;
76 
77 private:
78  // timing offset lookup table
79  std::vector< std::vector<float> > timingOffsets_;
83  bool organized_;
85  bool stampLast_;
87  std::vector<std::vector<PointXYZIT> > accumulatedScans_;
90 };
91 
92 } /* namespace rtabmap */
93 
94 #endif /* CORELIB_INCLUDE_RTABMAP_CORE_LIDAR_LIDARVLP16_H_ */
rtabmap::LidarVLP16::scanReady_
USemaphore scanReady_
Definition: LidarVLP16.h:88
rtabmap::SensorData
Definition: SensorData.h:51
rtabmap::LidarVLP16::organized_
bool organized_
Definition: LidarVLP16.h:83
rtabmap::LidarVLP16::lastScanMutex_
UMutex lastScanMutex_
Definition: LidarVLP16.h:89
rtabmap::Transform::getIdentity
static Transform getIdentity()
Definition: Transform.cpp:411
glm::uint16_t
detail::uint16 uint16_t
Definition: fwd.hpp:912
getName
ROSCONSOLE_CONSOLE_IMPL_DECL std::string getName(void *handle)
rtabmap::PointXYZIT::t
float t
Definition: LidarVLP16.h:42
Lidar.h
rtabmap::LidarVLP16::useHostTime_
bool useHostTime_
Definition: LidarVLP16.h:84
rtabmap::SensorCaptureInfo
Definition: SensorCaptureInfo.h:36
rtabmap::PointXYZIT::i
float i
Definition: LidarVLP16.h:41
rtabmap::LidarVLP16::takeScan
SensorData takeScan(SensorCaptureInfo *info=0)
Definition: LidarVLP16.h:63
rtabmap::LidarVLP16::stampLast_
bool stampLast_
Definition: LidarVLP16.h:85
UMutex
Definition: UMutex.h:54
rtabmap::LidarVLP16::lastScan_
SensorData lastScan_
Definition: LidarVLP16.h:86
rtabmap::LidarVLP16::timingOffsetsDualMode_
bool timingOffsetsDualMode_
Definition: LidarVLP16.h:80
rtabmap::LidarVLP16::startSweepTime_
double startSweepTime_
Definition: LidarVLP16.h:81
info
else if n * info
rtabmap::LidarVLP16::getSerial
virtual std::string getSerial() const override
Definition: LidarVLP16.h:66
rtabmap::PointXYZIT::z
float z
Definition: LidarVLP16.h:40
rtabmap::LidarVLP16
Definition: LidarVLP16.h:45
f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
rtabmap::PointXYZIT
Definition: LidarVLP16.h:37
rtabmap_netvlad.init
def init(descriptorDim)
Definition: rtabmap_netvlad.py:30
rtabmap::Transform
Definition: Transform.h:41
USemaphore
Definition: USemaphore.h:54
USemaphore.h
rtabmap::LidarVLP16::timingOffsets_
std::vector< std::vector< float > > timingOffsets_
Definition: LidarVLP16.h:79
rtabmap::LidarVLP16::accumulatedScans_
std::vector< std::vector< PointXYZIT > > accumulatedScans_
Definition: LidarVLP16.h:87
rtabmap::Lidar
Definition: Lidar.h:40
rtabmap::LidarVLP16::startSweepTimeHost_
double startSweepTimeHost_
Definition: LidarVLP16.h:82
rtabmap
Definition: CameraARCore.cpp:35
rtabmap::PointXYZIT::x
float x
Definition: LidarVLP16.h:38
rtabmap::PointXYZIT::y
float y
Definition: LidarVLP16.h:39


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:11