testcase_generator.h
Go to the documentation of this file.
1 /*
2  * @brief sim_loc_testcase_generator generates testcases for SIM Localization driver.
3  * The generator creates deterministic and random based result port telegrams.
4  *
5  * Copyright (C) 2019 Ing.-Buero Dr. Michael Lehning, Hildesheim
6  * Copyright (C) 2019 SICK AG, Waldkirch
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  * All rights reserved.
21  *
22  * Redistribution and use in source and binary forms, with or without
23  * modification, are permitted provided that the following conditions are met:
24  *
25  * * Redistributions of source code must retain the above copyright
26  * notice, this list of conditions and the following disclaimer.
27  * * Redistributions in binary form must reproduce the above copyright
28  * notice, this list of conditions and the following disclaimer in the
29  * documentation and/or other materials provided with the distribution.
30  * * Neither the name of SICK AG nor the names of its
31  * contributors may be used to endorse or promote products derived from
32  * this software without specific prior written permission
33  * * Neither the name of Ing.-Buero Dr. Michael Lehning nor the names of its
34  * contributors may be used to endorse or promote products derived from
35  * this software without specific prior written permission
36  *
37  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
38  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
40  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
41  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
42  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
43  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
44  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
45  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
46  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
47  * POSSIBILITY OF SUCH DAMAGE.
48  *
49  * Authors:
50  * Michael Lehning <michael.lehning@lehning.de>
51  *
52  * Copyright 2019 SICK AG
53  * Copyright 2019 Ing.-Buero Dr. Michael Lehning
54  *
55  */
56 #ifndef __SIM_LOC_TESTCASE_GENERATOR_H_INCLUDED
57 #define __SIM_LOC_TESTCASE_GENERATOR_H_INCLUDED
58 
59 #include "sick_scan/ros_wrapper.h"
61 
62 namespace sick_scan
63 {
69  {
70  public:
71 
76  static sick_scan::SickLocResultPortTestcaseMsg createDefaultResultPortTestcase(void);
77 
82  static sick_scan::SickLocResultPortTestcaseMsg createRandomResultPortTestcase(void);
83 
92  static sick_scan::SickLocResultPortTestcaseMsg createResultPortCircles(double circle_radius, double circle_yaw);
93 
101  static sick_scan::SickLocColaTelegramMsg createColaResponse(const sick_scan::SickLocColaTelegramMsg & cola_request, const std::string& scanner_type);
102 
111  static uint32_t ResultPoseInterval(void){ return s_u32ResultPoseInterval; }
112 
118  static bool SendScandataEnabled(void);
119 
124  static bool LocalizationEnabled(void);
125 
130  static bool ResultTelegramsEnabled(void);
131 
132  protected:
133 
139  template <typename T> static std::string hexstr(const T & x)
140  {
141  std::stringstream hex_stream;
142  hex_stream << std::hex << std::uppercase << x;
143  return hex_stream.str();
144  }
145 
151  template <typename T> static std::string decstr(const T & x)
152  {
153  std::stringstream dec_stream;
154  dec_stream << std::dec << std::uppercase << x;
155  return dec_stream.str();
156  }
157 
164  static uint32_t createTimestampTicksMilliSec(void);
165 
166  static uint32_t s_u32ResultPoseInterval;
167  static std::map<std::string, int32_t> s_controller_settings;
168  static std::map<std::string, std::string> s_controller_settings_str;
169 
170  }; // class TestcaseGenerator
171 
172 } // namespace sick_scan
173 #endif // __SIM_LOC_TESTCASE_GENERATOR_H_INCLUDED
static bool ResultTelegramsEnabled(void)
static std::map< std::string, int32_t > s_controller_settings
test server int32 settings, set by sMN or sRN requests
static sick_scan::SickLocColaTelegramMsg createColaResponse(const sick_scan::SickLocColaTelegramMsg &cola_request, const std::string &scanner_type)
static uint32_t ResultPoseInterval(void)
static uint32_t s_u32ResultPoseInterval
result pose interval, i.e. the interval in number of scans (default: 1, i.e. result telegram with eac...
static uint32_t createTimestampTicksMilliSec(void)
static std::string decstr(const T &x)
static sick_scan::SickLocResultPortTestcaseMsg createDefaultResultPortTestcase(void)
static std::map< std::string, std::string > s_controller_settings_str
test server string settings, set by sMN or sRN requests
static std::string hexstr(const T &x)
static sick_scan::SickLocResultPortTestcaseMsg createRandomResultPortTestcase(void)
static sick_scan::SickLocResultPortTestcaseMsg createResultPortCircles(double circle_radius, double circle_yaw)


sick_scan
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Wed Sep 7 2022 02:25:06