ConfigData.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 
24 // -- END LICENSE BLOCK ------------------------------------------------
25 
26 //----------------------------------------------------------------------
33 //----------------------------------------------------------------------
34 
35 #ifndef SICK_SAFETYSCANNERS_DATASTRUCTURE_CONFIGDATA_H
36 #define SICK_SAFETYSCANNERS_DATASTRUCTURE_CONFIGDATA_H
37 
38 #include <boost/asio/ip/address_v4.hpp>
39 #include <iostream>
41 #include <vector>
42 
43 namespace sick {
44 namespace datastructure {
45 
46 
51 {
52 public:
56  ConfigData();
62  std::string getVersionCVersion() const;
68  void setVersionCVersion(const std::string& version_c_version);
69 
75  uint8_t getVersionMajorVersionNumber() const;
81  void setVersionMajorVersionNumber(const uint8_t& version_major_version_number);
82 
88  uint8_t getVersionMinorVersionNumber() const;
94  void setVersionMinorVersionNumber(const uint8_t& version_minor_version_number);
95 
101  uint8_t getVersionReleaseNumber() const;
107  void setVersionReleaseNumber(const uint8_t& version_release_number);
108 
114  boost::asio::ip::address_v4 getHostIp() const;
120  void setHostIp(const boost::asio::ip::address_v4& host_ip);
126  void setHostIp(const std::string& host_ip);
127 
133  uint16_t getHostUdpPort() const;
139  void setHostUdpPort(const uint16_t& host_udp_port);
140 
146  uint8_t getChannel() const;
152  void setChannel(const uint8_t& channel);
153 
159  bool getEnabled() const;
165  void setEnabled(bool enabled);
166 
172  uint8_t getEInterfaceType() const;
178  void setEInterfaceType(const uint8_t& e_interface_type);
179 
185  uint16_t getPublishingFrequency() const;
191  void setPublishingFrequency(const uint16_t& publishing_frequency);
192 
198  float getStartAngle() const;
204  void setStartAngle(const int32_t& start_angle);
205 
210  void setStartAngleDegrees(const float& start_angle);
211 
217  float getEndAngle() const;
223  void setEndAngle(const int32_t& end_angle);
228  void setEndAngleDegrees(const float& end_angle);
229 
235  uint16_t getFeatures() const;
241  void setFeatures(const uint16_t& features);
251  void setFeatures(bool general_system_state,
252  bool derived_settings,
253  bool measurement_data,
254  bool intrusion_data,
255  bool application_data);
256 
263  uint16_t getDerivedMultiplicationFactor() const;
264 
269  void setDerivedMultiplicationFactor(const uint16_t& multiplication_factor);
270 
275  uint16_t getDerivedNumberOfBeams() const;
276 
281  void setDerivedNumberOfBeams(const uint16_t& number_of_beams);
282 
287  uint16_t getDerivedScanTime() const;
288 
293  void setDerivedScanTime(const uint16_t& scan_time);
294 
299  float getDerivedStartAngle() const;
300 
305  void setDerivedStartAngle(const int32_t& start_angle);
306 
311  float getDerivedAngularBeamResolution() const;
312 
317  void setDerivedAngularBeamResolution(const int32_t& angular_beam_resolution);
318 
323  void setDerivedAngularBeamResolutionDegrees(const float& angular_beam_resolution);
324 
329  uint32_t getDerivedInterbeamPeriod() const;
330 
335  void setDerivedInterbeamPeriod(const uint32_t& interbeam_period);
336 
337 private:
341  const double m_ANGLE_RESOLUTION = 4194304.0;
342 
343  // TODO cleanup and refactor in different subclasses
344 
345  std::string m_version_c_version;
349  boost::asio::ip::address_v4 m_host_ip;
350  uint16_t m_host_udp_port;
351  uint8_t m_channel;
352  bool m_enabled;
356  float m_end_angle;
357  uint16_t m_features;
362  float m_derived_angular_beam_resolution; // TODO move into derived values
364 };
365 
366 
367 } // namespace datastructure
368 } // namespace sick
369 
370 #endif // SICK_SAFETYSCANNERS_DATASTRUCTURE_CONFIGDATA_H
float getStartAngle() const
Gets the start angle of the scan.
Definition: ConfigData.cpp:171
void setDerivedNumberOfBeams(const uint16_t &number_of_beams)
Sets the number of beams for the current scan.
Definition: ConfigData.cpp:232
void setHostIp(const boost::asio::ip::address_v4 &host_ip)
Sets the IP-address of the host from an IP-address.
Definition: ConfigData.cpp:87
void setDerivedMultiplicationFactor(const uint16_t &multiplication_factor)
Sets the multiplication factor.
Definition: ConfigData.cpp:222
uint16_t getHostUdpPort() const
Gets the host udp port.
Definition: ConfigData.cpp:97
uint32_t getDerivedInterbeamPeriod() const
Return the time between consecutive beams.
Definition: ConfigData.cpp:273
uint8_t getEInterfaceType() const
Gets the eInterface type.
Definition: ConfigData.cpp:127
uint8_t getChannel() const
Gets the channel of the data.
Definition: ConfigData.cpp:107
float getDerivedStartAngle() const
Get the start angle of the scan.
Definition: ConfigData.cpp:248
void setVersionReleaseNumber(const uint8_t &version_release_number)
Sets the version release number for the scanner.
Definition: ConfigData.cpp:77
boost::asio::ip::address_v4 getHostIp() const
Gets the IP-address of the host.
Definition: ConfigData.cpp:82
void setHostUdpPort(const uint16_t &host_udp_port)
Sets the host udp port.
Definition: ConfigData.cpp:102
void setEInterfaceType(const uint8_t &e_interface_type)
Sets the eInterface type.
Definition: ConfigData.cpp:132
void setFeatures(const uint16_t &features)
Set the enabled features.
Definition: ConfigData.cpp:152
void setDerivedInterbeamPeriod(const uint32_t &interbeam_period)
Set the time between two consecutive beams.
Definition: ConfigData.cpp:278
void setDerivedAngularBeamResolutionDegrees(const float &angular_beam_resolution)
Set the angular resolution between beams from degrees.
Definition: ConfigData.cpp:268
uint8_t getVersionReleaseNumber() const
Gets the version release number for the scanner.
Definition: ConfigData.cpp:72
void setStartAngleDegrees(const float &start_angle)
Set the start angle of the configuration from degrees.
Definition: ConfigData.cpp:181
const double m_ANGLE_RESOLUTION
Defined angle resolution to convert sensor input to the right frame.
Definition: ConfigData.h:341
void setVersionMajorVersionNumber(const uint8_t &version_major_version_number)
Sets the major version number for the scanner.
Definition: ConfigData.cpp:57
void setPublishingFrequency(const uint16_t &publishing_frequency)
Sets the publishing frequency.
Definition: ConfigData.cpp:142
ConfigData()
The constructor of the config data.
Definition: ConfigData.cpp:40
bool getEnabled() const
Gets if the channel is enabled.
Definition: ConfigData.cpp:117
uint16_t getDerivedNumberOfBeams() const
Returns the number of beams of the current scan.
Definition: ConfigData.cpp:227
void setVersionMinorVersionNumber(const uint8_t &version_minor_version_number)
Sets the minor version number for the scanner.
Definition: ConfigData.cpp:67
Config data for current and persistent sensor config.
Definition: ConfigData.h:50
void setChannel(const uint8_t &channel)
Sets the channel of the data.
Definition: ConfigData.cpp:112
void setStartAngle(const int32_t &start_angle)
Sets the start angle of the scan.
Definition: ConfigData.cpp:176
uint16_t getPublishingFrequency() const
Gets the publishing frequency.
Definition: ConfigData.cpp:137
void setDerivedStartAngle(const int32_t &start_angle)
Set the start angle of the scan.
Definition: ConfigData.cpp:253
void setDerivedAngularBeamResolution(const int32_t &angular_beam_resolution)
Set the angular resolution between beams.
Definition: ConfigData.cpp:263
uint8_t getVersionMajorVersionNumber() const
Gets the major version number for the scanner.
Definition: ConfigData.cpp:52
uint8_t getVersionMinorVersionNumber() const
Gets the minor version number for the scanner.
Definition: ConfigData.cpp:62
float getDerivedAngularBeamResolution() const
Returns the angular resolution between the beams.
Definition: ConfigData.cpp:258
uint16_t getDerivedMultiplicationFactor() const
Return the multiplication factor. Multiplication factor to be applied to the beam distance values to ...
Definition: ConfigData.cpp:217
float getEndAngle() const
Gets the end angle of the scan.
Definition: ConfigData.cpp:186
void setEndAngleDegrees(const float &end_angle)
Set the end angle of the configuration from degrees.
Definition: ConfigData.cpp:196
void setVersionCVersion(const std::string &version_c_version)
Sets the version indicator for the scanner.
Definition: ConfigData.cpp:47
uint16_t getFeatures() const
Gets the enabled features.
Definition: ConfigData.cpp:147
std::string getVersionCVersion() const
Gets the version indicator for the scanner.
Definition: ConfigData.cpp:42
uint16_t getDerivedScanTime() const
Return the time of the scan.
Definition: ConfigData.cpp:237
void setDerivedScanTime(const uint16_t &scan_time)
Sets the time of the scan.
Definition: ConfigData.cpp:242
void setEndAngle(const int32_t &end_angle)
Sets the end angle of the scan.
Definition: ConfigData.cpp:191
boost::asio::ip::address_v4 m_host_ip
Definition: ConfigData.h:349
void setEnabled(bool enabled)
Sets if the channel is enabled.
Definition: ConfigData.cpp:122


sick_safetyscanners
Author(s): Lennart Puck
autogenerated on Fri Apr 2 2021 02:45:41