Visual Servoing Platform  version 3.0.0
vpLaserScan.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2015 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Laser scan data structure.
32  *
33  * Authors:
34  * Fabien Spindler
35  *
36  *****************************************************************************/
37 #ifndef vpLaserScan_h
38 #define vpLaserScan_h
39 
47 #include "visp3/sensor/vpScanPoint.h"
48 
49 #include <vector>
50 
63 class VISP_EXPORT vpLaserScan
64 {
65  public:
68  : listScanPoints(), startTimestamp(0), endTimestamp(0), measurementId(0),
69  numSteps(0), startAngle(0), stopAngle(0), numPoints(0)
70  {
71  }
73  vpLaserScan(const vpLaserScan &scan)
74  : listScanPoints(), startTimestamp(0), endTimestamp(0), measurementId(0),
75  numSteps(0), startAngle(0), stopAngle(0), numPoints(0)
76  {
77  startTimestamp = scan.startTimestamp;
78  endTimestamp = scan.endTimestamp;
79  measurementId = scan.measurementId;
80  numSteps = scan.numSteps;
81  startAngle = scan.startAngle;
82  stopAngle = scan.stopAngle;
83  numPoints = scan.numPoints;
84  listScanPoints = scan.listScanPoints;
85  }
87  virtual ~vpLaserScan() {};
89  inline void addPoint(const vpScanPoint &p) {
90  listScanPoints.push_back( p );
91  }
93  inline void clear() {
94  listScanPoints.clear( );
95  }
97  inline std::vector<vpScanPoint> getScanPoints() {
98  return listScanPoints;
99  }
102  inline void setMeasurementId(const unsigned short &id) {
103  this->measurementId = id;
104  }
106  inline void setStartTimestamp(const double &start_timestamp) {
107  this->startTimestamp = start_timestamp;
108  }
110  inline void setEndTimestamp(const double &end_timestamp) {
111  this->endTimestamp = end_timestamp;
112  }
114  inline void setNumSteps(const unsigned short &num_steps) {
115  this->numSteps = num_steps;
116  }
118  inline void setStartAngle(const short &start_angle) {
119  this->startAngle = start_angle;
120  }
122  inline void setStopAngle(const short &stop_angle) {
123  this->stopAngle = stop_angle;
124  }
126  inline void setNumPoints(const unsigned short &num_points) {
127  this->numPoints = num_points;
128  }
130  inline double getStartTimestamp() {
131  return startTimestamp;
132  }
134  inline double getEndTimestamp() {
135  return endTimestamp;
136  }
137 
138  private:
139  std::vector<vpScanPoint> listScanPoints;
140  double startTimestamp;
141  double endTimestamp;
142  unsigned short measurementId;
143  unsigned short numSteps;
144  short startAngle;
145  short stopAngle;
146  unsigned short numPoints;
147 
148 };
149 
150 #endif
std::vector< vpScanPoint > getScanPoints()
Definition: vpLaserScan.h:97
Implements a laser scan data structure that contains especially the list of scanned points that have ...
Definition: vpLaserScan.h:63
void clear()
Definition: vpLaserScan.h:93
Class that defines a single laser scanner point.
Definition: vpScanPoint.h:72
void setStartAngle(const short &start_angle)
Definition: vpLaserScan.h:118
void setNumPoints(const unsigned short &num_points)
Definition: vpLaserScan.h:126
virtual ~vpLaserScan()
Definition: vpLaserScan.h:87
double getStartTimestamp()
Definition: vpLaserScan.h:130
void setEndTimestamp(const double &end_timestamp)
Definition: vpLaserScan.h:110
void setNumSteps(const unsigned short &num_steps)
Definition: vpLaserScan.h:114
void addPoint(const vpScanPoint &p)
Definition: vpLaserScan.h:89
void setStartTimestamp(const double &start_timestamp)
Definition: vpLaserScan.h:106
void setMeasurementId(const unsigned short &id)
Definition: vpLaserScan.h:102
vpLaserScan(const vpLaserScan &scan)
Definition: vpLaserScan.h:73
void setStopAngle(const short &stop_angle)
Definition: vpLaserScan.h:122
double getEndTimestamp()
Definition: vpLaserScan.h:134