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


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