#include <testcase_generator.h>
class TestcaseGenerator generates testcases for SIM Localization driver. It creates deterministic and random based result port telegrams.
Definition at line 68 of file testcase_generator.h.
sick_scan::SickLocColaTelegramMsg sick_scan::TestcaseGenerator::createColaResponse |
( |
const sick_scan::SickLocColaTelegramMsg & |
cola_request, |
|
|
const std::string & |
scanner_type |
|
) |
| |
|
static |
Creates and returns a synthetical cola response to a cola command request. Note: Just a few cola responses are implemented for test purposes, f.e. responses to "LocRequestTimestamp". By default, a response: "sAN <command_name>" without any parameter is returned (sAN: Response to sMN)
- Parameters
-
[in] | cola_request | Cola request from client |
- Returns
- Synthetical cola response from server
Definition at line 261 of file testcase_generator.cpp.
sick_scan::SickLocResultPortTestcaseMsg sick_scan::TestcaseGenerator::createDefaultResultPortTestcase |
( |
void |
| ) |
|
|
static |
Creates and returns a deterministic default testcase for result port telegrams (binary telegrams and SickLocResultPortTelegramMsg)
- Returns
- SickLocResultPortTestcaseMsg with the binary telegram and SickLocResultPortTelegramMsg
Definition at line 121 of file testcase_generator.cpp.
sick_scan::SickLocResultPortTestcaseMsg sick_scan::TestcaseGenerator::createRandomResultPortTestcase |
( |
void |
| ) |
|
|
static |
Creates and returns a random testcase for result port telegrams (binary telegrams and SickLocResultPortTelegramMsg)
- Returns
- SickLocResultPortTestcaseMsg with the binary telegram and SickLocResultPortTelegramMsg
Definition at line 158 of file testcase_generator.cpp.
sick_scan::SickLocResultPortTestcaseMsg sick_scan::TestcaseGenerator::createResultPortCircles |
( |
double |
circle_radius, |
|
|
double |
circle_yaw |
|
) |
| |
|
static |
Creates and returns a result port telegrams (binary telegrams and SickLocResultPortTelegramMsg) simulating sensor moving in circles with a current position given by radius in meter and yaw angle in radians
- Parameters
-
[in] | circle_radius | radius of circle in meter |
[in] | circle_yaw | current angle in radians |
- Returns
- SickLocResultPortTestcaseMsg with the binary telegram and SickLocResultPortTelegramMsg
Definition at line 220 of file testcase_generator.cpp.
uint32_t sick_scan::TestcaseGenerator::createTimestampTicksMilliSec |
( |
void |
| ) |
|
|
staticprotected |
Creates and returns a timestamp in milliseconds ticks. To simulate time jitter, network latency and time drift, a random value of +/- 2 milliseconds is added.
- Returns
- timestamp in milliseconds ticks
Definition at line 803 of file testcase_generator.cpp.
template<typename T >
static std::string sick_scan::TestcaseGenerator::decstr |
( |
const T & |
x | ) |
|
|
inlinestaticprotected |
Converts value x to decimal string
- Parameters
-
- Returns
- x as hex string
Definition at line 151 of file testcase_generator.h.
template<typename T >
static std::string sick_scan::TestcaseGenerator::hexstr |
( |
const T & |
x | ) |
|
|
inlinestaticprotected |
Converts value x to hex string
- Parameters
-
- Returns
- x as hex string
Definition at line 139 of file testcase_generator.h.
bool sick_scan::TestcaseGenerator::LocalizationEnabled |
( |
void |
| ) |
|
|
static |
Returns true, if localization is active (default), otherwise false (localization deactivated)
- Returns
- result telegrams are activated (true) or deactivated
Definition at line 103 of file testcase_generator.cpp.
static uint32_t sick_scan::TestcaseGenerator::ResultPoseInterval |
( |
void |
| ) |
|
|
inlinestatic |
Returns the result pose interval, i.e. the interval in number of scans 1 (default): result with each processed scan 2: result with every second processed scan n: result with every n.th processed scan This parameter can be set by cola command "LocSetResultPoseInterval", f.e. "sMN LocSetResultPoseInterval 1"
- Returns
- result pose interval
Definition at line 111 of file testcase_generator.h.
bool sick_scan::TestcaseGenerator::ResultTelegramsEnabled |
( |
void |
| ) |
|
|
static |
Returns true, if result telegrams are activated (i.e. localization on and result telegrams active), otherwise false (result telegrams deactivated)
- Returns
- result telegrams are activated (true, default) or deactivated
Definition at line 112 of file testcase_generator.cpp.
bool sick_scan::TestcaseGenerator::SendScandataEnabled |
( |
void |
| ) |
|
|
static |
Returns true, if LMCstartmeas has been requested (i.e. send LMDscandata and LMDscandatamon, LMCstartmeas is enabled), or false otherwise (i.e. do not send LMDscandata or LMDscandatamon, LMCstartmeas is disabled)
- Returns
- LMCstartmeas status (true or false)
Definition at line 94 of file testcase_generator.cpp.
std::map< std::string, int32_t > sick_scan::TestcaseGenerator::s_controller_settings |
|
staticprotected |
Initial value:= {
{"IsSystemReady", 1},
{"LMCstartmeas", 0},
{"LocState", 2},
{"LocResultPort", 2201},
{"LocResultMode", 0},
{"LocResultState", 1},
{"LocResultEndianness", 0},
{"LocMapState", 1},
{"LocRequestResultData", 1}
}
test server int32 settings, set by sMN or sRN requests
test server int32 settings, set by sMN or sRN requests
Definition at line 167 of file testcase_generator.h.
std::map< std::string, std::string > sick_scan::TestcaseGenerator::s_controller_settings_str |
|
staticprotected |
test server string settings, set by sMN or sRN requests
test server string settings, set by sMN or sRN requests
Definition at line 168 of file testcase_generator.h.
uint32_t sick_scan::TestcaseGenerator::s_u32ResultPoseInterval = 1 |
|
staticprotected |
result pose interval, i.e. the interval in number of scans (default: 1, i.e. result telegram with each processed scan)
result pose interval, i.e. the interval in number of scans (default: 1, i.e. result telegram with each processed scan)
Definition at line 166 of file testcase_generator.h.
The documentation for this class was generated from the following files: