laserscan.h
Go to the documentation of this file.
1 // Copyright (c) 2020-2021 Pilz GmbH & Co. KG
2 //
3 // This program is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU Lesser General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public License
14 // along with this program. If not, see <https://www.gnu.org/licenses/>.
15 
16 #ifndef PSEN_SCAN_V2_STANDALONE_LASERSCAN_H
17 #define PSEN_SCAN_V2_STANDALONE_LASERSCAN_H
18 
19 #include <cstdint>
20 #include <ostream>
21 #include <vector>
22 
25 
27 {
46 class LaserScan
47 {
48 public:
49  using MeasurementData = std::vector<double>;
50  using IntensityData = std::vector<double>;
51  using IOData = std::vector<IOState>;
52 
53 public:
54  LaserScan(const util::TenthOfDegree& resolution,
55  const util::TenthOfDegree& min_scan_angle,
56  const util::TenthOfDegree& max_scan_angle,
57  const uint32_t scan_counter,
58  const uint8_t active_zoneset,
59  const int64_t timestamp);
60 
61 public:
63  [[deprecated("use const util::TenthOfDegree& scanResolution() const instead")]] const util::TenthOfDegree&
64  getScanResolution() const;
65  const util::TenthOfDegree& scanResolution() const;
66 
68  [[deprecated("use const util::TenthOfDegree& minScanAngle() const instead")]] const util::TenthOfDegree&
69  getMinScanAngle() const;
70  const util::TenthOfDegree& minScanAngle() const;
71 
73  [[deprecated("use const util::TenthOfDegree& maxScanAngle() const instead")]] const util::TenthOfDegree&
74  getMaxScanAngle() const;
75  const util::TenthOfDegree& maxScanAngle() const;
76 
78  [[deprecated("use uint32_t scanCounter() const instead")]] uint32_t getScanCounter() const;
79  uint32_t scanCounter() const;
80 
82  [[deprecated("use uint8_t activeZoneset() const instead")]] uint8_t getActiveZoneset() const;
83  uint8_t activeZoneset() const;
84 
86  [[deprecated("use int64_t timestamp() const instead")]] int64_t getTimestamp() const;
87  int64_t timestamp() const;
88 
90  [[deprecated("use const MeasurementData& measurements() const instead")]] const MeasurementData&
91  getMeasurements() const;
92  const MeasurementData& measurements() const;
93 
95  [[deprecated("use MeasurementData& measurements() instead")]] MeasurementData& getMeasurements();
97 
99  [[deprecated("use void measurements(const MeasurementData& measurements) instead")]] void
102 
104  [[deprecated("use const IntensityData& intensities() const instead")]] const IntensityData& getIntensities() const;
105  const IntensityData& intensities() const;
106 
108  [[deprecated("use void intensities(const IntensityData& intensities)) instead")]] void
111 
113  [[deprecated("use const IOData& ioStates() const instead")]] const IOData& getIOStates() const;
114  const IOData& ioStates() const;
115 
117  [[deprecated("use void ioStates(const IOData& io_states) instead")]] void setIOStates(const IOData& io_states);
118  void ioStates(const IOData& io_states);
119 
120 private:
134  const uint32_t scan_counter_;
136  const uint8_t active_zoneset_;
138  const int64_t timestamp_;
139 };
140 
141 std::ostream& operator<<(std::ostream& os, const LaserScan& scan);
142 
143 } // namespace psen_scan_v2_standalone
144 
145 #endif // PSEN_SCAN_V2_STANDALONE_LASERSCAN_H
const IOData & getIOStates() const
Definition: laserscan.cpp:179
const util::TenthOfDegree & getMinScanAngle() const
Definition: laserscan.cpp:72
const util::TenthOfDegree & maxScanAngle() const
Definition: laserscan.cpp:128
void setIOStates(const IOData &io_states)
Definition: laserscan.cpp:174
std::vector< double > IntensityData
Definition: laserscan.h:50
std::vector< double > MeasurementData
Definition: laserscan.h:49
const uint32_t scan_counter_
Number of the scan round this data belongs to.
Definition: laserscan.h:134
IOData io_states_
States of the I/O pins.
Definition: laserscan.h:126
const MeasurementData & measurements() const
Definition: laserscan.cpp:133
const util::TenthOfDegree resolution_
Distance of angle between the measurements.
Definition: laserscan.h:128
const IntensityData & intensities() const
Definition: laserscan.cpp:163
void setMeasurements(const MeasurementData &measurements)
Definition: laserscan.cpp:102
void setIntensities(const IntensityData &intensities)
Definition: laserscan.cpp:117
const util::TenthOfDegree & minScanAngle() const
Definition: laserscan.cpp:123
std::ostream & operator<<(std::ostream &os, const PinState &pin_state)
Definition: io_state.cpp:59
const uint8_t active_zoneset_
The currently active zoneset of the scanner.
Definition: laserscan.h:136
const MeasurementData & getMeasurements() const
Definition: laserscan.cpp:82
IntensityData intensities_
Stores the received normalized signal intensities.
Definition: laserscan.h:124
MeasurementData measurements_
Measurement data of the laserscan (in Millimeters).
Definition: laserscan.h:122
const util::TenthOfDegree & getScanResolution() const
Definition: laserscan.cpp:67
const util::TenthOfDegree max_scan_angle_
Highest angle the scanner is scanning.
Definition: laserscan.h:132
Root namespace in which the software components to communicate with the scanner (firmware-version: 2)...
Definition: udp_client.h:41
const int64_t timestamp_
Time of the first ray in this scan round (or fragment if fragmented_scans is enabled).
Definition: laserscan.h:138
const IOData & ioStates() const
Definition: laserscan.cpp:190
const util::TenthOfDegree & getMaxScanAngle() const
Definition: laserscan.cpp:77
const IntensityData & getIntensities() const
Definition: laserscan.cpp:112
const util::TenthOfDegree min_scan_angle_
Lowest angle the scanner is scanning.
Definition: laserscan.h:130
std::vector< IOState > IOData
Definition: laserscan.h:51
const util::TenthOfDegree & scanResolution() const
Definition: laserscan.cpp:61
LaserScan(const util::TenthOfDegree &resolution, const util::TenthOfDegree &min_scan_angle, const util::TenthOfDegree &max_scan_angle, const uint32_t scan_counter, const uint8_t active_zoneset, const int64_t timestamp)
Definition: laserscan.cpp:32
This class represents a single laser scan in the <tf_prefix> target frame.
Definition: laserscan.h:46
Helper class representing angles in tenth of degree.


psen_scan_v2
Author(s): Pilz GmbH + Co. KG
autogenerated on Sat Nov 5 2022 02:13:36