msgpack_validator.cpp
Go to the documentation of this file.
1 /*
2  * @brief msgpack_validator validates received msgpacks against
3  * the multiScan136 filter settings (FREchoFilter, LFPangleRangeFilter,
4  * and LFPlayerFilter).
5  *
6  * If msgpacks with scan data out of filter settings (i.e. echo,
7  * azimuth or segment not configured), an error message is printed
8  * and the msgpack is discarded.
9  *
10  * By default, the msgpack_validator checks msgpacks against the full
11  * range, i.e. all echos, azimuth_start=-PI, azimuth_end=+PI,
12  * elevation_start=-PI/2, elevation_end=+PI/2 and all segments.
13  *
14  * Copyright (C) 2020,2021 Ing.-Buero Dr. Michael Lehning, Hildesheim
15  * Copyright (C) 2020,2021 SICK AG, Waldkirch
16  *
17  * Licensed under the Apache License, Version 2.0 (the "License");
18  * you may not use this file except in compliance with the License.
19  * You may obtain a copy of the License at
20  *
21  * http://www.apache.org/licenses/LICENSE-2.0
22  *
23  * Unless required by applicable law or agreed to in writing, software
24  * distributed under the License is distributed on an "AS IS" BASIS,
25  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26  * See the License for the specific language governing permissions and
27  * limitations under the License.
28  *
29  * All rights reserved.
30  *
31  * Redistribution and use in source and binary forms, with or without
32  * modification, are permitted provided that the following conditions are met:
33  *
34  * * Redistributions of source code must retain the above copyright
35  * notice, this list of conditions and the following disclaimer.
36  * * Redistributions in binary form must reproduce the above copyright
37  * notice, this list of conditions and the following disclaimer in the
38  * documentation and/or other materials provided with the distribution.
39  * * Neither the name of SICK AG nor the names of its
40  * contributors may be used to endorse or promote products derived from
41  * this software without specific prior written permission
42  * * Neither the name of Ing.-Buero Dr. Michael Lehning nor the names of its
43  * contributors may be used to endorse or promote products derived from
44  * this software without specific prior written permission
45  *
46  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
47  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
48  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
49  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
50  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
51  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
52  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
53  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
54  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
55  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
56  * POSSIBILITY OF SUCH DAMAGE.
57  *
58  * Authors:
59  * Michael Lehning <michael.lehning@lehning.de>
60  *
61  *
62  */
63 #include <float.h>
64 
66 
67 /*
68  * @brief Default constructor. Class MsgPackValidatorData collects echo_idx, azimuth, elevation and segment_idx
69  * during msgpack parsing for msgpack validation.
70  */
72 {
73 }
74 
75 /*
76  * @brief Default destructor.
77  */
79 {
80 }
81 
82 /*
83  * @brief Updates the azimuth histogram
84  */
85 void sick_scansegment_xd::MsgPackValidatorData::update(int echo_idx, int segment_idx, float azimuth, float elevation)
86 {
87  m_azimuth_histogram[echo_idx][segment_idx][elevationToInt(elevation)][azimuthToInt(azimuth)] += 1;
88 }
89 
90 /*
91  * @brief Returns the resolution of azimuth histogram in degree (i.e. 1.0 degree)
92  */
94 {
96 }
97 
98 /*
99  * @brief Returns the resolution of azimuth histogram in radians (i.e. (PI/180) * 1.0 degree)
100  */
102 {
104 }
105 
106 /*
107  * @brief Returns the resolution of elevation histogram in degree (i.e. 1.0 degree)
108  */
110 {
112 }
113 
114 /*
115  * @brief Returns the resolution of elevation histogram in degree (i.e. (PI/180) * 1.0 degree)
116  */
118 {
120 }
121 
122 /*
123  * @brief Returns the current data values as human readable string
124  */
125 std::vector<std::string> sick_scansegment_xd::MsgPackValidatorData::print(void) const
126 {
127  std::vector<std::string> messages;
128  // Loop over Histogram of azimuth angles: azimuth_count = m_azimuth_histogram[echo_idx][segment_idx][elevationToInt(elevation)][azimuthToInt(azimuth)]
129  for(AzimuthHistogramPerElevationPerSegmentPerEcho::const_iterator iter_echos = m_azimuth_histogram.cbegin(); iter_echos != m_azimuth_histogram.cend(); iter_echos++)
130  {
131  int echo_idx = iter_echos->first;
132  const AzimuthHistogramPerElevationPerSegment& azimuth_histogram_elevation_segment = iter_echos->second;
133  for(AzimuthHistogramPerElevationPerSegment::const_iterator iter_segment = azimuth_histogram_elevation_segment.cbegin(); iter_segment != azimuth_histogram_elevation_segment.cend(); iter_segment++)
134  {
135  int segment_idx = iter_segment->first;
136  const AzimuthHistogramPerElevation& azimuth_histogram_elevation = iter_segment->second;
137  for(AzimuthHistogramPerElevation::const_iterator iter_elevation = azimuth_histogram_elevation.cbegin(); iter_elevation != azimuth_histogram_elevation.cend(); iter_elevation++)
138  {
139  float elevation_rad = intToElevation(iter_elevation->first);
140  const AzimuthHistogram& azimuth_histogram = iter_elevation->second;
141  float azimuth_min = azimuth_histogram.empty() ? 0 : FLT_MAX;
142  float azimuth_max = azimuth_histogram.empty() ? 0 : -FLT_MAX;
143  for(AzimuthHistogram::const_iterator iter_azimuth = azimuth_histogram.cbegin(); iter_azimuth != azimuth_histogram.cend(); iter_azimuth++)
144  {
145  float azimuth_rad = intToAzimuth(iter_azimuth->first);
146  int azimuth_cnt = iter_azimuth->second;
147  if(azimuth_cnt > 0)
148  {
149  azimuth_min = std::min(azimuth_min, azimuth_rad);
150  azimuth_max = std::max(azimuth_max, azimuth_rad);
151  }
152  }
153  std::stringstream s;
154  s << "MsgPackValidatorData[echo=" << echo_idx << "][segment=" << segment_idx << "][elevation=" << rad2deg(elevation_rad) << "]: azimuth=[" << rad2deg(azimuth_min) << ", " << rad2deg(azimuth_max) << "] [deg]" ;
155  messages.push_back(s.str());
156  }
157  }
158  }
159  return messages;
160 }
161 
162 /*
163  * @brief Default constructor, initializes full range validation
164  * (all echos, azimuth_start=-PI, azimuth_end=+PI,
165  * elevation_start=-PI/2, elevation_end=+PI/2, all segments)
166  *
167  * class MsgPackValidator validates received msgpacks against
168  * the multiScan136 filter settings (FREchoFilter, LFPangleRangeFilter,
169  * and LFPlayerFilter).
170  *
171  * If msgpacks with scan data out of filter settings (i.e. echo,
172  * azimuth or segment not configured), an error message is printed
173  * and the msgpack is discarded.
174  *
175  * By default, the msgpack_validator checks msgpacks against the full
176  * range, i.e. all echos, azimuth_start=-PI, azimuth_end=+PI,
177  * elevation_start=-PI/2, elevation_end=+PI/2 and all segments.
178  *
179  * @param[in] echos indizes of expected echos, default: all echos required
180  * @param[in] azimuth_start start azimuth in radians, default: -PI
181  * @param[in] azimuth_end end azimuth in radians, default: +PI
182  * @param[in] elevation_start start elevation in radians, default: -PI/2
183  * @param[in] elevation_end end elevation in radians, default: +PI/2
184  * @param[in] segments indizes of expected segments, default: all segments
185  * @param[in] layer_filter 0 (deactivated) or 1 (activated) for each layer, default: all 16 layers activated
186  * @param[in] verbose 0: print error messages, 1: print error and informational messages, 2: print error and all messages
187  */
188 sick_scansegment_xd::MsgPackValidator::MsgPackValidator(const std::vector<int>& echos, float azimuth_start, float azimuth_end, float elevation_start, float elevation_end,
189  const std::vector<int>& segments, const std::vector<int>& layer_filter, int verbose)
190 : m_echos_required(echos), m_azimuth_start(azimuth_start), m_azimuth_end(azimuth_end), m_elevation_start(elevation_start), m_elevation_end(elevation_end),
191 m_valid_segments(segments), m_layer_filter(layer_filter), m_verbose(verbose)
192 {
193 }
194 
195 /*
196  * @brief Default destructor.
197  */
199 {
200 }
201 
202 /*
203  * @brief Validates a received msgpack against the configured limits, i.e. checks that echo, segment and azimuth are
204  * within their configured range.
205  *
206  * @param[in] data_received echos, azimuth, elevation and segments collected during msgpack parsing
207  *
208  * @return true if validation passed successfully, false otherwise.
209  */
211 {
212  // loop over histogram of azimuth angles: azimuth_count = getHistogram()[echo_idx][segment_idx][elevationToInt(elevation)][azimuthToInt(azimuth)]
213  // and check against configured limits
214  bool success = true;
215  const MsgPackValidatorData::AzimuthHistogramPerElevationPerSegmentPerEcho& azimuth_histogram = msgpack_data_received.getHistogram();
216  for(MsgPackValidatorData::AzimuthHistogramPerElevationPerSegmentPerEcho::const_iterator iter_echos = azimuth_histogram.cbegin(); iter_echos != azimuth_histogram.cend(); iter_echos++)
217  {
218  int echo_idx = iter_echos->first;
219  const MsgPackValidatorData::AzimuthHistogramPerElevationPerSegment& azimuth_histogram_elevation_segment = iter_echos->second;
220  for(MsgPackValidatorData::AzimuthHistogramPerElevationPerSegment::const_iterator iter_segment = azimuth_histogram_elevation_segment.cbegin(); iter_segment != azimuth_histogram_elevation_segment.cend(); iter_segment++)
221  {
222  int segment_idx = iter_segment->first;
223  const MsgPackValidatorData::AzimuthHistogramPerElevation& azimuth_histogram_elevation = iter_segment->second;
224  for(MsgPackValidatorData::AzimuthHistogramPerElevation::const_iterator iter_elevation = azimuth_histogram_elevation.cbegin(); iter_elevation != azimuth_histogram_elevation.cend(); iter_elevation++)
225  {
226  int elevation_idx = iter_elevation->first;
227  float elevation_rad = msgpack_data_received.elevationIndexToRad(elevation_idx);
228  const MsgPackValidatorData::AzimuthHistogram& azimuth_histogram = iter_elevation->second;
229  std::vector<float> out_of_bounds_azimuth_angles;
230  for(MsgPackValidatorData::AzimuthHistogram::const_iterator iter_azimuth = azimuth_histogram.cbegin(); iter_azimuth != azimuth_histogram.cend(); iter_azimuth++)
231  {
232  float azimuth_rad = msgpack_data_received.azimuthIndexToRad(iter_azimuth->first);
233  int azimuth_cnt = iter_azimuth->second;
234  if(azimuth_cnt > 0)
235  {
236  if (std::find(m_echos_required.begin(), m_echos_required.end(), echo_idx) == m_echos_required.end())
237  {
238  success = false;
239  ROS_WARN_STREAM("## WARNING MsgPackValidator: echo = " << echo_idx << " unexpected (expected echo: [ "
240  << listVector(m_echos_required) << " ]");
241  break;
242  }
243  if (std::find(m_valid_segments.begin(), m_valid_segments.end(), segment_idx) == m_valid_segments.end())
244  {
245  success = false;
246  ROS_WARN_STREAM("## WARNING MsgPackValidator: segment = " << segment_idx << " (echo " << echo_idx << ") unexpected (valid segments: [ "
247  << listVector(m_valid_segments) << " ]");
248  break;
249  }
250  if (elevation_rad < m_elevation_start || elevation_rad > m_elevation_end)
251  {
252  success = false;
253  ROS_WARN_STREAM("## WARNING MsgPackValidator: elevation = " << (elevation_rad * 180.0 / M_PI) << " deg (echo " << echo_idx << ", segment " << segment_idx
254  << ") out of limits [ " << (m_elevation_start * 180.0 / M_PI) << ", " << (m_elevation_end * 180.0 / M_PI) << " ] deg.");
255  break;
256  }
257  if (azimuth_rad < m_azimuth_start || azimuth_rad > m_azimuth_end)
258  {
259  success = false;
260  out_of_bounds_azimuth_angles.push_back(azimuth_rad * (float)(180.0 / M_PI));
261  }
262  }
263  }
264  if(!out_of_bounds_azimuth_angles.empty())
265  {
266  ROS_WARN_STREAM("## WARNING MsgPackValidator: azimuth angles = [ " << listVector(out_of_bounds_azimuth_angles) << " ] deg (echo " << echo_idx << ", segment " << segment_idx << ", elevation "
267  << (elevation_rad * 180.0 / M_PI) << " deg) out of limits [ " << (m_azimuth_start * 180.0 / M_PI) << ", " << (m_azimuth_end * 180.0 / M_PI) << " ] deg.");
268  }
269  }
270  }
271  }
272  if (!success)
273  ROS_WARN_STREAM("## WARNING MsgPackValidator::validateNotOutOfBound() finished with error.");
274  else if (m_verbose > 1)
275  ROS_INFO_STREAM("MsgPackValidator::validateNotOutOfBound() finished successful.");
276  return success;
277 }
278 
281  int echo_idx, int segment_idx, int elevation_idx, int azimuth_idx) const
282 {
283  MsgPackValidatorData::AzimuthHistogramPerElevationPerSegmentPerEcho::const_iterator collected_echo = azimuth_histogram.find(echo_idx);
284  if (collected_echo != azimuth_histogram.cend())
285  {
286  int collected_echo_idx = collected_echo->first;
287  const MsgPackValidatorData::AzimuthHistogramPerElevationPerSegment::const_iterator collected_segment = collected_echo->second.find(segment_idx);
288  if (collected_segment != collected_echo->second.cend())
289  {
290  int collected_segment_idx = collected_segment->first;
291  const MsgPackValidatorData::AzimuthHistogramPerElevation::const_iterator collected_elevation = collected_segment->second.find(elevation_idx);
292  if (collected_elevation != collected_segment->second.cend())
293  {
294  int collected_elevation_idx = collected_elevation->first;
295  const MsgPackValidatorData::AzimuthHistogram::const_iterator collected_azimuth = collected_elevation->second.find(azimuth_idx);
296  if (collected_azimuth != collected_elevation->second.cend())
297  {
298  int collected_azimuth_idx = collected_azimuth->first;
299  int collected_azimuth_hist_cnt = collected_azimuth->second;
300  if(collected_echo_idx == echo_idx && collected_segment_idx == segment_idx && collected_elevation_idx == elevation_idx && collected_azimuth_idx == azimuth_idx)
301  {
302  return collected_azimuth_hist_cnt; // given echo, segment, elevation and azimuth found in histogram, return histogram counter
303  }
304  }
305  }
306  }
307 
308  }
309  return 0; // given echo, segment, elevation and azimuth not found in histogram
310 }
311 
312 void sick_scansegment_xd::MsgPackValidator::printMissingHistogramData(const std::vector<std::string>& messages) const
313 {
314  if (m_verbose > 1)
315  {
316  for (int msg_cnt = 0; msg_cnt < messages.size(); msg_cnt++)
317  ROS_WARN_STREAM("## " << messages[msg_cnt]);
318  }
319 }
320 
321 /*
322  * @brief Validates a received msgpack, i.e. checks that the required number of echos, segments and azimuth values have been received.
323  *
324  * @param[in] msgpack_data_collected echos, azimuth, elevation and segments collected during msgpack parsing
325  *
326  * @return true if validation passed successfully, false otherwise.
327  */
329 {
330  // Idea to validate mspack data for completeness:
331  // 1. Received azimuth angles are collected in a histogram over some period for each elevation
332  // 2. The expected area (azimuth range) covered by azimuth angles is known from configuration
333  // Validation: Check that the expected area is covered by stepping through the histogram in steps of e.g. 1 degree.
334  // Example: [-180°,+30] degree is the expected area (azimuth range) given by configuration.
335  // Thus the histogram is checked for azimuth angles -180, -179, -178, ...., 29, 30 [deg]
336  // The azimuth histogram is checked with a given resolution. The check is passed, if the histogram counter is > 0
337  // for each azimuth angle within the expected range.
338 
339  bool success = true;
340  bool azimuth_values_missing = false;
341  bool elevation_values_missing = false;
342  const MsgPackValidatorData::AzimuthHistogramPerElevationPerSegmentPerEcho& azimuth_histogram = msgpack_data_collected.getHistogram();
343 
344  // Check all required echos
345  for (std::vector<int>::const_iterator iter_echo = m_echos_required.cbegin(); iter_echo != m_echos_required.cend(); iter_echo++)
346  {
347  int echo_idx = (*iter_echo);
348  // Check if required echo found in histogram
349  MsgPackValidatorData::AzimuthHistogramPerElevationPerSegmentPerEcho::const_iterator collected_echo = azimuth_histogram.find(echo_idx);
350  if (collected_echo == azimuth_histogram.cend() || collected_echo->first != echo_idx || collected_echo->second.empty())
351  {
352  ROS_WARN_STREAM("## WARNING MsgPackValidator::validateNoMissingScandata() failed: no scan data found in echo " << echo_idx << ":");
353  printMissingHistogramData(msgpack_data_collected.print());
354  return false;
355  }
356 
357  // Check all required segments and collect azimuth histograms over all segments
358  MsgPackValidatorData::AzimuthHistogramPerElevation collected_azimuth_histogram_per_elevation;
359  for (std::vector<int>::const_iterator iter_segment = m_valid_segments.cbegin(); iter_segment != m_valid_segments.cend(); iter_segment++)
360  {
361  int segment_idx = (*iter_segment);
362  const MsgPackValidatorData::AzimuthHistogramPerElevationPerSegment::const_iterator collected_segment = collected_echo->second.find(segment_idx);
363  // Check if required segment found in histogram
364  if (collected_segment == collected_echo->second.cend() || collected_segment->first != segment_idx || collected_segment->second.empty())
365  {
366  /* ROS_WARN_STREAM("## WARNING MsgPackValidator::validateNoMissingScandata() failed: no scan data found in segment " << segment_idx << " (echo " << echo_idx << "):");
367  printMissingHistogramData(msgpack_data_collected.print());
368  return false; */
369  continue;
370  }
371  // Collect azimuth histograms over all segments
372  for(MsgPackValidatorData::AzimuthHistogramPerElevation::const_iterator collected_elevation = collected_segment->second.cbegin(); collected_elevation != collected_segment->second.cend(); collected_elevation++)
373  {
374  int collected_elevation_idx = collected_elevation->first;
375  for(MsgPackValidatorData::AzimuthHistogram::const_iterator collected_azimuth = collected_elevation->second.cbegin(); collected_azimuth != collected_elevation->second.cend(); collected_azimuth++)
376  {
377  int collected_azimuth_idx = collected_azimuth->first;
378  int collected_azimuth_hist_cnt = collected_azimuth->second;
379  collected_azimuth_histogram_per_elevation[collected_elevation_idx][collected_azimuth_idx] += collected_azimuth_hist_cnt;
380  }
381  }
382  }
383 
384  // Check required layers
385  int num_layer_required = 0;
386  for (int layer_idx = 0; layer_idx < m_layer_filter.size(); layer_idx++)
387  {
388  if(m_layer_filter[layer_idx])
389  num_layer_required++;
390  }
391  int num_layer_collected = 0;
392  for(MsgPackValidatorData::AzimuthHistogramPerElevation::const_iterator collected_elevation = collected_azimuth_histogram_per_elevation.begin(); collected_elevation != collected_azimuth_histogram_per_elevation.end(); collected_elevation++)
393  {
394  num_layer_collected++;
395  }
396  if(num_layer_required != num_layer_collected)
397  {
398  ROS_WARN_STREAM("## WARNING MsgPackValidator::validateNoMissingScandata() failed: " << num_layer_required << " layer expected, but " << num_layer_collected << " layer collected.");
399  printMissingHistogramData(msgpack_data_collected.print());
400  return false;
401  }
402 
403  // Check required azimuth angles in all layer
404  for(MsgPackValidatorData::AzimuthHistogramPerElevation::iterator collected_elevation = collected_azimuth_histogram_per_elevation.begin(); collected_elevation != collected_azimuth_histogram_per_elevation.end(); collected_elevation++)
405  {
406  int elevation_idx = collected_elevation->first;
407  MsgPackValidatorData::AzimuthHistogram& collected_azimuth_histogram = collected_elevation->second;
408  if (collected_azimuth_histogram.empty())
409  {
410  // no scan data for this elevation
411  if (m_verbose > 1)
412  ROS_WARN_STREAM("## WARNING MsgPackValidator::validateNoMissingScandata() failed: no scan data found for elevation " << msgpack_data_collected.elevationIndexToDeg(elevation_idx)
413  << " [deg] (echo " << echo_idx << ")");
414  elevation_values_missing = true;
415  success = false;
416  continue;
417  }
418  // Check all required azimuth angles
419  float azimuth_res = msgpack_data_collected.getAzimuthHistogramResolutionRad();
420  int azimuth_idx_start = msgpack_data_collected.azimuthRadToIndex(m_azimuth_start + azimuth_res);
421  int azimuth_idx_end = msgpack_data_collected.azimuthRadToIndex(m_azimuth_end - azimuth_res);
422  for (int azimuth_idx = azimuth_idx_start + 1; azimuth_idx < azimuth_idx_end; azimuth_idx++)
423  {
424  if(collected_azimuth_histogram[azimuth_idx] <= 0)
425  {
426  // no scan data for this azimuth
427  if (m_verbose > 1)
428  ROS_WARN_STREAM("## WARNING MsgPackValidator::validateNoMissingScandata() failed: no scan data found for azimuth " << msgpack_data_collected.azimuthIndexToDeg(azimuth_idx)
429  << " [deg] (echo " << echo_idx << ", elevation " << msgpack_data_collected.elevationIndexToDeg(elevation_idx) << ")");
430  azimuth_values_missing = true;
431  success = false;
432  }
433  // else
434  // {
435  // ROS_INFO_STREAM("elevation " << msgpack_data_collected.elevationIndexToDeg(elevation_idx) << ", azimuth " << msgpack_data_collected.azimuthIndexToDeg(azimuth_idx)
436  // << " [deg] echo " << echo_idx << ": azimuth_hist_cnt = " << collected_azimuth_histogram[azimuth_idx]);
437  // }
438  }
439  }
440  }
441 
442  if(!success)
443  {
444  ROS_WARN_STREAM("## WARNING MsgPackValidator::validateNoMissingScandata(): msgpack validation for missing scan data finished with error " << (elevation_values_missing ? "elevation values missing ":"") << (azimuth_values_missing ? "azimuth values missing " : "") );
445  printMissingHistogramData(msgpack_data_collected.print());
446  }
447  else if (m_verbose > 0)
448  {
449  ROS_INFO_STREAM("MsgPackValidator::validateNoMissingScandata() finished successful.");
450  }
451  return success;
452 }
sick_scansegment_xd::MsgPackValidatorData::elevationIndexToRad
float elevationIndexToRad(int elevation_idx) const
Definition: msgpack_validator.h:152
sick_scansegment_xd::MsgPackValidatorData::azimuthRadToIndex
int azimuthRadToIndex(float azimuth_rad) const
Definition: msgpack_validator.h:158
sick_scansegment_xd::MsgPackValidator::MsgPackValidator
MsgPackValidator(const std::vector< int > &echos={ 0, 1, 2 }, float azimuth_start=-M_PI, float azimuth_end=M_PI, float elevation_start=-M_PI/2.0, float elevation_end=M_PI/2.0, const std::vector< int > &segments={ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, const std::vector< int > &layer_filter={ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, int verbose=0)
Definition: msgpack_validator.cpp:188
sick_scansegment_xd::MsgPackValidatorData::getAzimuthHistogramResolutionRad
float getAzimuthHistogramResolutionRad(void) const
Definition: msgpack_validator.cpp:101
sick_scansegment_xd::MsgPackValidator::getAzimuthHistogramCount
int getAzimuthHistogramCount(const MsgPackValidatorData::AzimuthHistogramPerElevationPerSegmentPerEcho &azimuth_histogram, int echo_idx, int segment_idx, int elevation_idx, int azimuth_idx) const
Definition: msgpack_validator.cpp:280
sick_scansegment_xd::MsgPackValidatorData::elevationIndexToDeg
float elevationIndexToDeg(int elevation_idx) const
Definition: msgpack_validator.h:155
s
XmlRpcServer s
rad2deg
#define rad2deg(x)
Definition: sick_scan_common.cpp:98
sick_scansegment_xd::MsgPackValidatorData
Definition: msgpack_validator.h:86
ElevationHistogramResolution
#define ElevationHistogramResolution
Definition: msgpack_validator.h:166
sick_scansegment_xd::MsgPackValidatorData::getElevationHistogramResolutionRad
float getElevationHistogramResolutionRad(void) const
Definition: msgpack_validator.cpp:117
sick_scansegment_xd::MsgPackValidatorData::getAzimuthHistogramResolutionDeg
float getAzimuthHistogramResolutionDeg(void) const
Definition: msgpack_validator.cpp:93
sick_scansegment_xd::MsgPackValidator::validateNotOutOfBound
bool validateNotOutOfBound(const MsgPackValidatorData &data_received) const
Definition: msgpack_validator.cpp:210
sick_scansegment_xd::MsgPackValidator::validateNoMissingScandata
bool validateNoMissingScandata(const MsgPackValidatorData &msgpack_data_collected) const
Definition: msgpack_validator.cpp:328
sick_scansegment_xd::MsgPackValidatorData::~MsgPackValidatorData
~MsgPackValidatorData()
Definition: msgpack_validator.cpp:78
sick_scansegment_xd::MsgPackValidatorData::MsgPackValidatorData
MsgPackValidatorData()
Definition: msgpack_validator.cpp:71
multiscan_pcap_player.verbose
int verbose
Definition: multiscan_pcap_player.py:142
deg2rad
#define deg2rad
Definition: BasicDatatypes.hpp:83
sick_scansegment_xd::MsgPackValidatorData::azimuthIndexToRad
float azimuthIndexToRad(int azimuth_idx) const
Definition: msgpack_validator.h:146
ROS_WARN_STREAM
#define ROS_WARN_STREAM(args)
Definition: sick_scan_logging.h:123
ROS_INFO_STREAM
#define ROS_INFO_STREAM(...)
Definition: sick_scan_ros2_example.cpp:71
AzimuthHistogramResolution
#define AzimuthHistogramResolution
Definition: msgpack_validator.h:165
msgpack_validator.h
sick_scansegment_xd::MsgPackValidator::~MsgPackValidator
~MsgPackValidator()
Definition: msgpack_validator.cpp:198
sick_scansegment_xd::MsgPackValidatorData::AzimuthHistogram
std::map< int, int > AzimuthHistogram
Definition: msgpack_validator.h:131
sick_scansegment_xd::MsgPackValidatorData::azimuthIndexToDeg
float azimuthIndexToDeg(int azimuth_idx) const
Definition: msgpack_validator.h:149
sick_scansegment_xd::MsgPackValidatorData::print
std::vector< std::string > print(void) const
Definition: msgpack_validator.cpp:125
sick_scansegment_xd::MsgPackValidatorData::AzimuthHistogramPerElevation
std::map< int, AzimuthHistogram > AzimuthHistogramPerElevation
Definition: msgpack_validator.h:134
sick_scansegment_xd::MsgPackValidatorData::AzimuthHistogramPerElevationPerSegmentPerEcho
std::map< int, AzimuthHistogramPerElevationPerSegment > AzimuthHistogramPerElevationPerSegmentPerEcho
Definition: msgpack_validator.h:140
sick_scansegment_xd::MsgPackValidatorData::update
void update(int echo_idx, int segment_idx, float azimuth, float elevation)
Definition: msgpack_validator.cpp:85
sick_scansegment_xd::MsgPackValidatorData::getElevationHistogramResolutionDeg
float getElevationHistogramResolutionDeg(void) const
Definition: msgpack_validator.cpp:109
sick_scansegment_xd::MsgPackValidatorData::getHistogram
const AzimuthHistogramPerElevationPerSegmentPerEcho & getHistogram(void) const
Definition: msgpack_validator.h:143
sick_scansegment_xd::MsgPackValidatorData::AzimuthHistogramPerElevationPerSegment
std::map< int, AzimuthHistogramPerElevation > AzimuthHistogramPerElevationPerSegment
Definition: msgpack_validator.h:137
sick_scansegment_xd::MsgPackValidator::printMissingHistogramData
void printMissingHistogramData(const std::vector< std::string > &messages) const
Definition: msgpack_validator.cpp:312


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:09