Static Public Member Functions | Static Protected Member Functions | Static Protected Attributes | List of all members
sick_scan::TestcaseGenerator Class Reference

#include <testcase_generator.h>

Static Public Member Functions

static sick_scan::SickLocColaTelegramMsg createColaResponse (const sick_scan::SickLocColaTelegramMsg &cola_request, const std::string &scanner_type)
 
static sick_scan::SickLocResultPortTestcaseMsg createDefaultResultPortTestcase (void)
 
static sick_scan::SickLocResultPortTestcaseMsg createRandomResultPortTestcase (void)
 
static sick_scan::SickLocResultPortTestcaseMsg createResultPortCircles (double circle_radius, double circle_yaw)
 
static bool LocalizationEnabled (void)
 
static uint32_t ResultPoseInterval (void)
 
static bool ResultTelegramsEnabled (void)
 
static bool SendScandataEnabled (void)
 

Static Protected Member Functions

static uint32_t createTimestampTicksMilliSec (void)
 
template<typename T >
static std::string decstr (const T &x)
 
template<typename T >
static std::string hexstr (const T &x)
 

Static Protected Attributes

static std::map< std::string, int32_t > s_controller_settings
 test server int32 settings, set by sMN or sRN requests More...
 
static std::map< std::string, std::string > s_controller_settings_str
 test server string settings, set by sMN or sRN requests More...
 
static uint32_t s_u32ResultPoseInterval = 1
 result pose interval, i.e. the interval in number of scans (default: 1, i.e. result telegram with each processed scan) More...
 

Detailed Description

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.

Member Function Documentation

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_requestCola 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_radiusradius of circle in meter
[in]circle_yawcurrent 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
xvalue to be converted
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
xvalue to be converted
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.

Member Data Documentation

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:


sick_scan
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Wed May 5 2021 03:05:49