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 
102  const util::TenthOfDegree& resolution)
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
scan_range.h
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::LaserScanSettings::scanRange
constexpr const ScanRange & scanRange() const
Definition: start_request.h:107
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::master_device_settings_
const DeviceSettings master_device_settings_
Definition: start_request.h:95
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::DeviceSettings::DeviceSettings
constexpr DeviceSettings(const bool diagnostics_enabled, const bool intensities_enabled)
Definition: start_request.h:117
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::DeviceSettings::diagnosticsEnabled
constexpr bool diagnosticsEnabled() const
Definition: start_request.h:122
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::LaserScanSettings::resolution_
const util::TenthOfDegree resolution_
Definition: start_request.h:68
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::serialize
friend data_conversion_layer::RawData serialize(const data_conversion_layer::start_request::Message &msg, const uint32_t &seq_number)
tenth_of_degree.h
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::subscribers_
const std::array< LaserScanSettings, NUM_SUBSCRIBERS > subscribers_
Definition: start_request.h:97
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::DeviceSettings::intensities_enabled_
const bool intensities_enabled_
Definition: start_request.h:85
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::host_udp_port_data_
const uint16_t host_udp_port_data_
Definition: start_request.h:93
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::DeviceSettings::intensitiesEnabled
constexpr bool intensitiesEnabled() const
Definition: start_request.h:127
raw_scanner_data.h
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::LaserScanSettings::scan_range_
const ScanRange scan_range_
Definition: start_request.h:67
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::DeviceSettings
Class describing the fundamental settings of the master and subscriber devices, like id and diagnosti...
Definition: start_request.h:74
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::host_ip_
const uint32_t host_ip_
network byte order = big endian
Definition: start_request.h:92
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::master_
const LaserScanSettings master_
Definition: start_request.h:96
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::LaserScanSettings::resolution
constexpr util::TenthOfDegree resolution() const
Definition: start_request.h:112
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::NUM_SUBSCRIBERS
static constexpr std::size_t NUM_SUBSCRIBERS
Definition: start_request.h:89
psen_scan_v2_standalone
Root namespace in which the software components to communicate with the scanner (firmware-version: 2)...
Definition: udp_client.h:41
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::LaserScanSettings::LaserScanSettings
constexpr LaserScanSettings()=default
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::Message
Message(const ScannerConfiguration &scanner_configuration)
Definition: start_request.cpp:26
psen_scan_v2_standalone::ScanRangeTemplated
Higher level data type storing the range in which the scanner takes measurements.
Definition: scan_range.h:31
psen_scan_v2_standalone::data_conversion_layer::RawData
std::vector< char > RawData
Definition: raw_scanner_data.h:25
psen_scan_v2_standalone::data_conversion_layer::start_request::Message
Higher level data type representing a scanner start request.
Definition: start_request.h:42
psen_scan_v2_standalone::util::TenthOfDegree
Helper class representing angles in tenth of degree.
Definition: tenth_of_degree.h:34
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::LaserScanSettings
Class describing the scan settings of the master and subscriber devices.
Definition: start_request.h:56
psen_scan_v2_standalone::data_conversion_layer::start_request::Message::DeviceSettings::diagnostics_enabled_
const bool diagnostics_enabled_
Definition: start_request.h:84
psen_scan_v2_standalone::ScanRangeTemplated::createInvalidScanRange
static constexpr ScanRangeTemplated< min_allowed_angle, max_allowed_angle > createInvalidScanRange()
Definition: scan_range.h:88
psen_scan_v2_standalone::ScannerConfiguration
Higher level data type storing the configuration details of the scanner like scanner IP,...
Definition: scanner_configuration.h:34


psen_scan_v2
Author(s): Pilz GmbH + Co. KG
autogenerated on Sat Nov 25 2023 03:46:26