start_request.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 #ifndef PSEN_SCAN_V2_STANDALONE_START_REQUEST_H
16 #define PSEN_SCAN_V2_STANDALONE_START_REQUEST_H
17 
18 #include <array>
19 #include <cstdint>
20 
24 
26 {
27 class ScannerConfiguration;
28 
29 namespace data_conversion_layer
30 {
34 namespace start_request
35 {
42 class Message
43 {
44 public:
45  Message(const ScannerConfiguration& scanner_configuration);
46 
48  const uint32_t& seq_number);
49 
50 private:
57  {
58  public:
59  constexpr LaserScanSettings() = default;
60  constexpr LaserScanSettings(const ScanRange& scan_range, const util::TenthOfDegree& resolution);
61 
62  public:
63  constexpr const ScanRange& scanRange() const;
64  constexpr util::TenthOfDegree resolution() const;
65 
66  private:
69  };
70 
75  {
76  public:
77  constexpr DeviceSettings(const bool diagnostics_enabled, const bool intensities_enabled);
78 
79  public:
80  constexpr bool diagnosticsEnabled() const;
81  constexpr bool intensitiesEnabled() const;
82 
83  private:
86  };
87 
88 private:
89  static constexpr std::size_t NUM_SUBSCRIBERS{ 3 };
90 
91 private:
92  const uint32_t host_ip_;
93  const uint16_t host_udp_port_data_;
94 
97  const std::array<LaserScanSettings, NUM_SUBSCRIBERS> subscribers_; // Note: This refers to the scanner type
98  // subscriber, *not* a ros subscriber
99 };
100 
103  : scan_range_(scan_range), resolution_(resolution)
104 {
105 }
106 
108 {
109  return scan_range_;
110 };
111 
113 {
114  return resolution_;
115 };
116 
117 constexpr Message::DeviceSettings::DeviceSettings(const bool diagnostics_enabled, const bool intensities_enabled)
118  : diagnostics_enabled_(diagnostics_enabled), intensities_enabled_(intensities_enabled)
119 {
120 }
121 
123 {
124  return diagnostics_enabled_;
125 };
126 
128 {
129  return intensities_enabled_;
130 };
131 
132 } // namespace start_request
133 } // namespace data_conversion_layer
134 } // namespace psen_scan_v2_standalone
135 
136 #endif // PSEN_SCAN_V2_STANDALONE_START_REQUEST_H
Class describing the fundamental settings of the master and subscriber devices, like id and diagnosti...
Definition: start_request.h:74
constexpr DeviceSettings(const bool diagnostics_enabled, const bool intensities_enabled)
const uint32_t host_ip_
network byte order = big endian
Definition: start_request.h:92
static constexpr ScanRangeTemplated< min_allowed_angle, max_allowed_angle > createInvalidScanRange()
Definition: scan_range.h:88
Higher level data type storing the configuration details of the scanner like scanner IP...
Message(const ScannerConfiguration &scanner_configuration)
Root namespace in which the software components to communicate with the scanner (firmware-version: 2)...
Definition: udp_client.h:41
Higher level data type storing the range in which the scanner takes measurements. ...
Definition: scan_range.h:31
Higher level data type representing a scanner start request.
Definition: start_request.h:42
friend data_conversion_layer::RawData serialize(const data_conversion_layer::start_request::Message &msg, const uint32_t &seq_number)
const std::array< LaserScanSettings, NUM_SUBSCRIBERS > subscribers_
Definition: start_request.h:97
Class describing the scan settings of the master and subscriber devices.
Definition: start_request.h:56
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