IRI ROS Specific Driver Class. More...
#include <screen_information_alg.h>
Public Types | |
typedef iri_screen_information::ScreenInformationConfig | Config |
define config type | |
Public Member Functions | |
void | config_update (Config &new_cfg, uint32_t level=0) |
config update | |
void | initialize () |
void | iteration () |
void | lock (void) |
Lock Algorithm. | |
ScreenInformationAlgorithm (void) | |
constructor | |
void | setAnswer (std::string newAnswer) |
void | setCode (int newCode) |
bool | try_enter (void) |
Tries Access to Algorithm. | |
void | unlock (void) |
Unlock Algorithm. | |
~ScreenInformationAlgorithm (void) | |
Destructor. | |
Public Attributes | |
Config | config_ |
config variable | |
std::string | path |
Protected Member Functions | |
void | addLocationWithCode (int code) |
void | addOwnLocation (int x, int y) |
void | addText (int i, int code) |
void | createWindow (const std::string &window) |
void | drawCircle (int x, int y, int r, CvScalar color) |
int | getImageIndex (int code) |
cv::Mat | loadImage (std::string const path, int mode) |
void | showImage (const std::string &window, cv::Mat image) |
Protected Attributes | |
CMutex | alg_mutex_ |
define config type | |
std::string | answer |
int | code |
std::vector< CvScalar > | colors |
cv::Mat | image |
std::vector< cv::Mat > | images |
int | lastCode |
int | ownX |
int | ownY |
std::vector< std::string > | texts |
IRI ROS Specific Driver Class.
Definition at line 44 of file screen_information_alg.h.
typedef iri_screen_information::ScreenInformationConfig ScreenInformationAlgorithm::Config |
define config type
Define a Config type with the ScreenInformationConfig. All driver implementations will then use the same variable type Config.
Definition at line 82 of file screen_information_alg.h.
constructor
In this constructor parameters related to the specific driver can be initalized. Those parameters can be also set in the openDriver() function. Attributes from the main node driver class IriBaseDriver such as loop_rate, may be also overload here.
Definition at line 3 of file screen_information_alg.cpp.
Destructor.
This destructor is called when the object is about to be destroyed.
Definition at line 12 of file screen_information_alg.cpp.
void ScreenInformationAlgorithm::addLocationWithCode | ( | int | code | ) | [protected] |
Definition at line 202 of file screen_information_alg.cpp.
void ScreenInformationAlgorithm::addOwnLocation | ( | int | x, |
int | y | ||
) | [protected] |
Definition at line 196 of file screen_information_alg.cpp.
void ScreenInformationAlgorithm::addText | ( | int | i, |
int | code | ||
) | [protected] |
Definition at line 152 of file screen_information_alg.cpp.
void ScreenInformationAlgorithm::config_update | ( | Config & | new_cfg, |
uint32_t | level = 0 |
||
) |
config update
In this function the driver parameters must be updated with the input config variable. Then the new configuration state will be stored in the Config attribute.
new_cfg | the new driver configuration state |
level | level in which the update is taken place |
Definition at line 17 of file screen_information_alg.cpp.
void ScreenInformationAlgorithm::createWindow | ( | const std::string & | window | ) | [protected] |
Definition at line 108 of file screen_information_alg.cpp.
void ScreenInformationAlgorithm::drawCircle | ( | int | x, |
int | y, | ||
int | r, | ||
CvScalar | color | ||
) | [protected] |
Definition at line 250 of file screen_information_alg.cpp.
int ScreenInformationAlgorithm::getImageIndex | ( | int | code | ) | [protected] |
Definition at line 124 of file screen_information_alg.cpp.
Definition at line 29 of file screen_information_alg.cpp.
Definition at line 265 of file screen_information_alg.cpp.
cv::Mat ScreenInformationAlgorithm::loadImage | ( | std::string const | path, |
int | mode | ||
) | [protected] |
Definition at line 85 of file screen_information_alg.cpp.
void ScreenInformationAlgorithm::lock | ( | void | ) | [inline] |
Lock Algorithm.
Locks access to the Algorithm class
Definition at line 107 of file screen_information_alg.h.
void ScreenInformationAlgorithm::setAnswer | ( | std::string | newAnswer | ) |
Definition at line 291 of file screen_information_alg.cpp.
void ScreenInformationAlgorithm::setCode | ( | int | newCode | ) |
Definition at line 284 of file screen_information_alg.cpp.
void ScreenInformationAlgorithm::showImage | ( | const std::string & | window, |
cv::Mat | image | ||
) | [protected] |
Definition at line 116 of file screen_information_alg.cpp.
bool ScreenInformationAlgorithm::try_enter | ( | void | ) | [inline] |
Tries Access to Algorithm.
Tries access to Algorithm
Definition at line 123 of file screen_information_alg.h.
void ScreenInformationAlgorithm::unlock | ( | void | ) | [inline] |
Unlock Algorithm.
Unlocks access to the Algorithm class
Definition at line 114 of file screen_information_alg.h.
CMutex ScreenInformationAlgorithm::alg_mutex_ [protected] |
define config type
Define a Config type with the ScreenInformationConfig. All driver implementations will then use the same variable type Config.
Definition at line 53 of file screen_information_alg.h.
std::string ScreenInformationAlgorithm::answer [protected] |
Definition at line 61 of file screen_information_alg.h.
int ScreenInformationAlgorithm::code [protected] |
Definition at line 56 of file screen_information_alg.h.
std::vector<CvScalar> ScreenInformationAlgorithm::colors [protected] |
Definition at line 65 of file screen_information_alg.h.
config variable
This variable has all the driver parameters defined in the cfg config file. Is updated everytime function config_update() is called.
Definition at line 90 of file screen_information_alg.h.
cv::Mat ScreenInformationAlgorithm::image [protected] |
Definition at line 60 of file screen_information_alg.h.
std::vector<cv::Mat> ScreenInformationAlgorithm::images [protected] |
Definition at line 63 of file screen_information_alg.h.
int ScreenInformationAlgorithm::lastCode [protected] |
Definition at line 57 of file screen_information_alg.h.
int ScreenInformationAlgorithm::ownX [protected] |
Definition at line 58 of file screen_information_alg.h.
int ScreenInformationAlgorithm::ownY [protected] |
Definition at line 59 of file screen_information_alg.h.
std::string ScreenInformationAlgorithm::path |
Definition at line 140 of file screen_information_alg.h.
std::vector<std::string> ScreenInformationAlgorithm::texts [protected] |
Definition at line 64 of file screen_information_alg.h.