YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FakeBot_ParamsParser Class Reference

This class is the parameters parser for class FakeBot. More...

#include <fake/fakebot/FakeBot_ParamsParser.h>

+ Inheritance diagram for FakeBot_ParamsParser:

Classes

struct  parser_version_type
 

Public Member Functions

 FakeBot_ParamsParser ()
 
 ~FakeBot_ParamsParser () override=default
 
bool parseParams (const yarp::os::Searchable &config) override
 Parse the DeviceDriver parameters.
 
std::string getDeviceClassName () const override
 Get the name of the DeviceDriver class.
 
std::string getDeviceName () const override
 Get the name of the device (i.e.
 
std::string getDocumentationOfDeviceParams () const override
 Get the documentation of the DeviceDriver's parameters.
 
std::vector< std::string > getListOfParams () const override
 Return a list of all params used by the device.
 
- Public Member Functions inherited from yarp::dev::IDeviceDriverParams
virtual ~IDeviceDriverParams ()
 

Public Attributes

const std::string m_device_classname = {"FakeBot"}
 
const std::string m_device_name = {"fakebot"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
const std::string m_background_defaultValue = {"textures/back.ppm"}
 
const std::string m_target_defaultValue = {"textures/fore.ppm"}
 
const std::string m_noise_defaultValue = {"0.05"}
 
const std::string m_sx_defaultValue = {"1.0"}
 
const std::string m_sy_defaultValue = {"1.0"}
 
const std::string m_lifetime_defaultValue = {"-1.0"}
 
std::string m_background = {"textures/back.ppm"}
 
std::string m_target = {"textures/fore.ppm"}
 
double m_noise = {0.05}
 
double m_sx = {1.0}
 
double m_sy = {1.0}
 
double m_lifetime = {-1.0}
 

Detailed Description

This class is the parameters parser for class FakeBot.

These are the used parameters:

Group name Parameter name Type Units Default Value Required Description Notes
- background string - textures/back.ppm 0 background image to use -
- target string - textures/fore.ppm 0 target image to use -
- noise double - 0.05 0 pixel noise level -
- sx double - 1.0 0 scaling for x coordinate -
- sy double - 1.0 0 scaling for y coordinate -
- lifetime double s -1.0 0 device should exist for this length of time -

The device can be launched by yarpdev using one of the following examples (with and without all optional parameters):

yarpdev --device fakebot --background textures/back.ppm --target textures/fore.ppm --noise 0.05 --sx 1.0 --sy 1.0 --lifetime -1.0
yarpdev --device fakebot

Definition at line 46 of file FakeBot_ParamsParser.h.

Constructor & Destructor Documentation

◆ FakeBot_ParamsParser()

FakeBot_ParamsParser::FakeBot_ParamsParser ( )

Definition at line 23 of file FakeBot_ParamsParser.cpp.

◆ ~FakeBot_ParamsParser()

FakeBot_ParamsParser::~FakeBot_ParamsParser ( )
overridedefault

Member Function Documentation

◆ getDeviceClassName()

std::string FakeBot_ParamsParser::getDeviceClassName ( ) const
inlineoverridevirtual

Get the name of the DeviceDriver class.

Returns
A string containing the name of the class.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 78 of file FakeBot_ParamsParser.h.

◆ getDeviceName()

std::string FakeBot_ParamsParser::getDeviceName ( ) const
inlineoverridevirtual

Get the name of the device (i.e.

the plugin name).

Returns
A string containing the name of the device.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 79 of file FakeBot_ParamsParser.h.

◆ getDocumentationOfDeviceParams()

std::string FakeBot_ParamsParser::getDocumentationOfDeviceParams ( ) const
overridevirtual

Get the documentation of the DeviceDriver's parameters.

Returns
A string containing the documentation.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 164 of file FakeBot_ParamsParser.cpp.

◆ getListOfParams()

std::vector< std::string > FakeBot_ParamsParser::getListOfParams ( ) const
overridevirtual

Return a list of all params used by the device.

Returns
A vector containing the names of parameters used by the device.

Implements yarp::dev::IDeviceDriverParams.

Definition at line 28 of file FakeBot_ParamsParser.cpp.

◆ parseParams()

bool FakeBot_ParamsParser::parseParams ( const yarp::os::Searchable config)
overridevirtual

Parse the DeviceDriver parameters.

Returns
true if the parsing is successful, false otherwise

Implements yarp::dev::IDeviceDriverParams.

Definition at line 41 of file FakeBot_ParamsParser.cpp.

Member Data Documentation

◆ m_background

std::string FakeBot_ParamsParser::m_background = {"textures/back.ppm"}

Definition at line 70 of file FakeBot_ParamsParser.h.

◆ m_background_defaultValue

const std::string FakeBot_ParamsParser::m_background_defaultValue = {"textures/back.ppm"}

Definition at line 63 of file FakeBot_ParamsParser.h.

◆ m_device_classname

const std::string FakeBot_ParamsParser::m_device_classname = {"FakeBot"}

Definition at line 53 of file FakeBot_ParamsParser.h.

◆ m_device_name

const std::string FakeBot_ParamsParser::m_device_name = {"fakebot"}

Definition at line 54 of file FakeBot_ParamsParser.h.

◆ m_lifetime

double FakeBot_ParamsParser::m_lifetime = {-1.0}

Definition at line 75 of file FakeBot_ParamsParser.h.

◆ m_lifetime_defaultValue

const std::string FakeBot_ParamsParser::m_lifetime_defaultValue = {"-1.0"}

Definition at line 68 of file FakeBot_ParamsParser.h.

◆ m_noise

double FakeBot_ParamsParser::m_noise = {0.05}

Definition at line 72 of file FakeBot_ParamsParser.h.

◆ m_noise_defaultValue

const std::string FakeBot_ParamsParser::m_noise_defaultValue = {"0.05"}

Definition at line 65 of file FakeBot_ParamsParser.h.

◆ m_parser_is_strict

bool FakeBot_ParamsParser::m_parser_is_strict = false

Definition at line 55 of file FakeBot_ParamsParser.h.

◆ m_parser_version

const parser_version_type FakeBot_ParamsParser::m_parser_version = {}

Definition at line 61 of file FakeBot_ParamsParser.h.

◆ m_sx

double FakeBot_ParamsParser::m_sx = {1.0}

Definition at line 73 of file FakeBot_ParamsParser.h.

◆ m_sx_defaultValue

const std::string FakeBot_ParamsParser::m_sx_defaultValue = {"1.0"}

Definition at line 66 of file FakeBot_ParamsParser.h.

◆ m_sy

double FakeBot_ParamsParser::m_sy = {1.0}

Definition at line 74 of file FakeBot_ParamsParser.h.

◆ m_sy_defaultValue

const std::string FakeBot_ParamsParser::m_sy_defaultValue = {"1.0"}

Definition at line 67 of file FakeBot_ParamsParser.h.

◆ m_target

std::string FakeBot_ParamsParser::m_target = {"textures/fore.ppm"}

Definition at line 71 of file FakeBot_ParamsParser.h.

◆ m_target_defaultValue

const std::string FakeBot_ParamsParser::m_target_defaultValue = {"textures/fore.ppm"}

Definition at line 64 of file FakeBot_ParamsParser.h.


The documentation for this class was generated from the following files: