ROBOOP::Config Class Reference#include <config.h>
List of all members.
Detailed Description
Handle configuration files.
The file syntax used is:
[ section_name] - one or more entries for that section:
field_name: value
White space is ignored, but a newline must follow each section or field entry
The minimal entries required to avoid warnings are (can be any order):
[ chain_name]
Name: - a string identifierDH: - whether or not the chain specification is standard Denavitt-Hartenberg (non-zero), or modified Denavitt-Hartenberg (0)Fix: - ?MinPara: - ?dof: - number of links in the chainMotor: - ?Stl: - ?
- For each link N: 1..dof
[ chain_name_LINK N]
joint_type: - revolute (0), prismatic (1)theta: - DH theta parameterd: - DH d parametera: - DH a parameteralpha: - DH alpha parametertheta_min: - minimum achievable joint positiontheta_max: - maximum achievable joint positionm: - mass of linkcx: - x position of center of gravity for linkcy: - y position of center of gravity for linkcz: - z position of center of gravity for linkIxx: - xx entry of inertia matrixIxy: - xy entry of inertia matrixIxz: - xz entry of inertia matrixIyy: - yy entry of inertia matrixIyz: - yz entry of inertia matrixIzz: - zz entry of inertia matrix
Additional entries may be defined, but will be silently ignored.
Definition at line 142 of file config.h.
|
Public Member Functions |
| Config () |
| Config (const string &filename_, bool doRead=false) |
| Constructor.
|
| Config (const Config &x) |
| Constructor.
|
Config & | operator= (const Config &x) |
| Overload = operator.
|
short | read_conf () |
| Read a configuration file.
|
void | print () |
| Print the configuration data.
|
bool | section_exists (const string §ion) const |
| Test to see if a section exists.
|
bool | parameter_exists (const string §ion, const string ¶meter) const |
| Test to see if a parameter exists within a section.
|
short | select_string (const string section, const string parameter, string &value) const |
| Get a parameter data, of a certain section, into the string value.
|
short | select_bool (const string section, const string parameter, bool &value) const |
| Get a parameter data, of a certain section, into the bool value.
|
short | select_short (const string section, const string parameter, short &value) const |
| Get a parameter data, of a certain section, into the short value.
|
short | select_int (const string section, const string parameter, int &value) const |
| Get a parameter data, of a certain section, into the int value.
|
short | select_float (const string section, const string parameter, float &value) const |
| Get a parameter data, of a certain section, into the float value.
|
short | select_double (const string section, const string parameter, double &value) const |
| Get a parameter data, of a certain section, into the double value.
|
short | select_real (const string section, const string parameter, Real &value) const |
| Get a parameter data, of a certain section, into the Real value.
|
short | write_conf (const string name, const string file_title, const int space_between_column) |
| Write the configuration information, contained in conf, on disk.
|
void | add_string (const string section, const string parameter, const string value) |
| Added the value(string) of the parameter in the section in the configuration data.
|
void | add_bool (const string section, const string parameter, const bool value) |
| Added the value (bool) of the parameter in the section in the configuration data.
|
void | add_int (const string section, const string parameter, const int value) |
| Added the value (int) of the parameter in the section in the configuration data.
|
void | add_float (const string section, const string parameter, const float value) |
| Added the value (float) of the parameter in the section in the configuration data.
|
void | add_double (const string section, const string parameter, const double value) |
| Added the value (double) of the parameter in the section in the configuration data.
|
void | add_real (const string section, const string parameter, const Real value) |
| Added the value (Real) of the parameter in the section in the configuration data.
|
Private Attributes |
Conf_data | conf |
| Data store from/to configuration file.
|
string | filename |
| Configuration file name.
|
Constructor & Destructor Documentation
ROBOOP::Config::Config |
( |
|
) |
[inline] |
|
ROBOOP::Config::Config |
( |
const string & |
filename_, |
|
|
bool |
doRead = false |
|
) |
|
|
ROBOOP::Config::Config |
( |
const Config & |
x |
) |
|
|
Member Function Documentation
void ROBOOP::Config::add_bool |
( |
const string |
section, |
|
|
const string |
parameter, |
|
|
const bool |
value |
|
) |
|
|
|
Added the value (bool) of the parameter in the section in the configuration data.
The functions use add_string by first converting the value (bool) in value (string)
Definition at line 509 of file config.cpp. |
void ROBOOP::Config::add_double |
( |
const string |
section, |
|
|
const string |
parameter, |
|
|
const double |
value |
|
) |
|
|
|
Added the value (double) of the parameter in the section in the configuration data.
The functions use add_string by first converting the value (double) in value (string)
Definition at line 573 of file config.cpp. |
void ROBOOP::Config::add_float |
( |
const string |
section, |
|
|
const string |
parameter, |
|
|
const float |
value |
|
) |
|
|
|
Added the value (float) of the parameter in the section in the configuration data.
The functions use add_string by first converting the value (float) in value (string)
Definition at line 549 of file config.cpp. |
void ROBOOP::Config::add_int |
( |
const string |
section, |
|
|
const string |
parameter, |
|
|
const int |
value |
|
) |
|
|
|
Added the value (int) of the parameter in the section in the configuration data.
The functions use add_string by first converting the value (int) in value (string)
Definition at line 529 of file config.cpp. |
void ROBOOP::Config::add_real |
( |
const string |
section, |
|
|
const string |
parameter, |
|
|
const Real |
value |
|
) |
|
|
|
Added the value (Real) of the parameter in the section in the configuration data.
The functions use add_string by first converting the value (Real) in value (string)
Definition at line 597 of file config.cpp. |
void ROBOOP::Config::add_string |
( |
const string |
section, |
|
|
const string |
parameter, |
|
|
const string |
value |
|
) |
|
|
|
Overload = operator.
Definition at line 75 of file config.cpp. |
bool ROBOOP::Config::parameter_exists |
( |
const string & |
section, |
|
|
const string & |
parameter |
|
) |
const |
|
|
Test to see if a parameter exists within a section.
- Returns:
- true if parameter is found within section
Definition at line 246 of file config.cpp. |
void ROBOOP::Config::print |
( |
|
) |
|
|
|
Print the configuration data.
Definition at line 216 of file config.cpp. |
short ROBOOP::Config::read_conf |
( |
|
) |
|
|
|
Read a configuration file.
This function reads the configuration file specified in the constructor parameter. The information is stored in the variable conf.
A configuration file contains section(s) (between [ ]), and the section(s) contains parameter(s) with there respective value(s). The section and the parameter are always access via a string. Below is an exemple: one section named PUMA560_mDH, and two parameters.
[PUMA560_mDH] DH: 0 dof: 6
Definition at line 83 of file config.cpp.
Referenced by Config(), and ROBOOP::Control_Select::set_control(). |
bool ROBOOP::Config::section_exists |
( |
const string & |
section |
) |
const |
|
|
Test to see if a section exists.
- Returns:
- true if section is found
Definition at line 234 of file config.cpp. |
short ROBOOP::Config::select_bool |
( |
const string |
section, |
|
|
const string |
parameter, |
|
|
bool & |
value |
|
) |
const |
|
|
Get a parameter data, of a certain section, into the bool value.
- Returns:
- 0 or SECTION_OR_PARAMETER_DOES_NOT_EXIST if the data can not be found.
Definition at line 278 of file config.cpp. |
short ROBOOP::Config::select_double |
( |
const string |
section, |
|
|
const string |
parameter, |
|
|
double & |
value |
|
) |
const |
|
|
Get a parameter data, of a certain section, into the double value.
- Returns:
- 0 or SECTION_OR_PARAMETER_DOES_NOT_EXIST if the data can not be found.
Definition at line 382 of file config.cpp. |
short ROBOOP::Config::select_float |
( |
const string |
section, |
|
|
const string |
parameter, |
|
|
float & |
value |
|
) |
const |
|
|
Get a parameter data, of a certain section, into the float value.
- Returns:
- 0 or SECTION_OR_PARAMETER_DOES_NOT_EXIST if the data can not be found.
Definition at line 356 of file config.cpp. |
short ROBOOP::Config::select_int |
( |
const string |
section, |
|
|
const string |
parameter, |
|
|
int & |
value |
|
) |
const |
|
short ROBOOP::Config::select_real |
( |
const string |
section, |
|
|
const string |
parameter, |
|
|
Real & |
value |
|
) |
const |
|
short ROBOOP::Config::select_short |
( |
const string |
section, |
|
|
const string |
parameter, |
|
|
short & |
value |
|
) |
const |
|
|
Get a parameter data, of a certain section, into the short value.
- Returns:
- 0 or SECTION_OR_PARAMETER_DOES_NOT_EXIST if the data can not be found.
Definition at line 330 of file config.cpp. |
short ROBOOP::Config::select_string |
( |
const string |
section, |
|
|
const string |
parameter, |
|
|
string & |
value |
|
) |
const |
|
short ROBOOP::Config::write_conf |
( |
const string |
name, |
|
|
const string |
file_title, |
|
|
const int |
space_between_column |
|
) |
|
|
|
Write the configuration information, contained in conf, on disk.
- Parameters:
-
| name: | Configuration file name. |
| file_title: | Title in the configuration file header. |
| space_between_column: | Number of blanks between : (of a parameter) and it's value. |
Definition at line 434 of file config.cpp. |
Member Data Documentation
The documentation for this class was generated from the following files:
|