![]() |
Laelaps
2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
|
LaeXmlTune Laelaps XML tuning class. More...
#include <laeXmlTune.h>
Public Member Functions | |
LaeXmlTune () | |
Default constructor. | |
virtual | ~LaeXmlTune () |
Destructor. | |
virtual int | load (LaeTunes &tunes, const std::string &strSearchPath=LaeSysCfgPath, const std::string &strXmlFileName=LaeEtcTune, bool bAllInstances=false) |
Load XML file into DOM and set the Laelaps tuning parameters. More... | |
virtual int | loadFile (const std::string &strXmlFileName=LaeEtcTune) |
Load XML file into DOM. More... | |
virtual int | loadFile (LaeTunes &tunes, const std::string &strXmlFileName=LaeEtcTune) |
Load XML file into DOM and set the Laelaps tuning parameters. More... | |
virtual int | saveFile (const std::string &strXmlFileName=LaeEtcTune) |
Save DOM to XML file. More... | |
virtual int | saveFile (const LaeTunes &tunes, const std::string &strXmlFileName=LaeEtcTune) |
Set DOM from Laelaps tuning parameters and save XML file. More... | |
virtual int | createTemplateFile (const std::string &strXmlFileName=LaeEtcTune) |
Create a template Laelaps XML configuration file. root element. More... | |
virtual int | setTunesFromDOM (LaeTunes &tunes) |
Set the tune parameters from the parsed DOM. More... | |
virtual int | setDOMFromTunes (const LaeTunes &tunes) |
Set the DOM from the Laelaps tune parameters. More... | |
Protected Member Functions | |
int | setGlobalTunes (TiXmlElement *pElemSec, LaeTunes &tunes) |
Set the global tune parameters from the parsed DOM. More... | |
int | setGlobalThreadTunes (TiXmlElement *pElemSubSec, LaeTunes &tunes) |
Set the global threads tune parameters from the parsed DOM. More... | |
int | setGlobalTrajTunes (TiXmlElement *pElemSubSec, LaeTunes &tunes) |
Set the global trajectory tune parameters from the parsed DOM. More... | |
virtual int | setBatteryTunes (TiXmlElement *pElemSec, LaeTunes &tunes) |
Set Laelaps battery tune parameters from the parsed DOM. More... | |
virtual int | setPowertrainTunes (TiXmlElement *pElemSec, LaeTunes &tunes) |
Set Laelaps powertrain tuning parameters from the parsed DOM. More... | |
int | setPowertrainVelPidTunes (const std::string &strLoc, TiXmlElement *pElemSubSec, LaeTunes &tunes) |
Set a powertrain pair's velocity PID tune parameters from the parsed DOM. More... | |
int | setPowertrainTireTunes (const std::string &strLoc, TiXmlElement *pElemSubSec, LaeTunes &tunes) |
Set a powertrain pair's tire tune parameters from the parsed DOM. More... | |
virtual int | setRangeSensorTunes (TiXmlElement *pElemSec, LaeTunes &tunes) |
Set Laelaps range sensor tuning parameters from DOM. More... | |
int | setVL6180Tunes (TiXmlElement *pElemSec, std::string &strAttrType, std::string &strAttrLoc, LaeTunes &tunes) |
Set Laelaps VL6180 range sensor tuning parameters from DOM. More... | |
int | strToDoubleWithMinimum (const std::string &strElem, const std::string &strText, const double fMin, double &fVal) |
Convert text to value with a minimum value. More... | |
int | strToDoubleWithinRange (const std::string &strElem, const std::string &strText, const double fMin, const double fMax, double &fVal) |
Convert text to FPN value within minimum,maximum range. More... | |
int | strToIntWithinRange (const std::string &strElem, const std::string &strText, const int nMin, const int nMax, int &nVal) |
Convert text to integer value within minimum,maximum range. More... | |
int | strToNorm (const std::string &strElem, const std::string &strText, LaeNorm &eNorm) |
Convert text to norm enum. More... | |
void | warnUnknownElem (const std::string &strElem) |
Warn on unknown element. More... | |
Protected Attributes | |
std::string | m_strMajElemTuning |
major element under 'laelaps' | |
std::string | m_strSecElemGlobal |
global tuning section element | |
std::string | m_strSecElemBattery |
battery section element name | |
std::string | m_strSecElemPowertrains |
powertrain section element name | |
std::string | m_strSecElemRangeSensor |
range sensor section elem name | |
LaeXmlTune Laelaps XML tuning class.
Definition at line 71 of file laeXmlTune.h.
|
virtual |
Create a template Laelaps XML configuration file. root element.
Any current DOM is not accessed nor altered.
strXmlFileName | XML file path name. |
Definition at line 169 of file laeXmlTune.cxx.
Referenced by saveFile().
|
virtual |
Load XML file into DOM and set the Laelaps tuning parameters.
[out] | tunes |
Definition at line 71 of file laeXmlTune.cxx.
References laelaps::split().
Referenced by laelaps::LaeRobot::connect(), laelaps::LaeRobot::reload(), and ~LaeXmlTune().
|
virtual |
Load XML file into DOM.
strXmlFileName | XML file path name. |
Definition at line 128 of file laeXmlTune.cxx.
Referenced by mainInit(), and ~LaeXmlTune().
|
virtual |
Load XML file into DOM and set the Laelaps tuning parameters.
[out] | tunes |
Definition at line 157 of file laeXmlTune.cxx.
|
inlinevirtual |
Save DOM to XML file.
strXmlFileName | XML file path name. |
Definition at line 141 of file laeXmlTune.h.
References laelaps::LAE_ECODE_XML, and laelaps::LAE_OK.
|
inlinevirtual |
Set DOM from Laelaps tuning parameters and save XML file.
[in] | tunes |
Definition at line 156 of file laeXmlTune.h.
References createTemplateFile(), laelaps::LAE_ECODE_XML, laelaps::LAE_OK, laelaps::LaeEtcTune, setDOMFromTunes(), and setTunesFromDOM().
|
protectedvirtual |
Set Laelaps battery tune parameters from the parsed DOM.
pElemSec | Parent enclosing section element. | |
[out] | tunes |
Definition at line 517 of file laeXmlTune.cxx.
References laelaps::LaeTunes::m_battery, laelaps::LaeTunesBattery::m_fMaxV, and laelaps::LaeTunesBattery::m_fMinV.
|
virtual |
Set the DOM from the Laelaps tune parameters.
[in] | tunes |
Definition at line 302 of file laeXmlTune.cxx.
Referenced by saveFile().
|
protected |
Set the global threads tune parameters from the parsed DOM.
pElemSubSec | Parent enclosing subsection element. | |
[out] | tunes |
Definition at line 393 of file laeXmlTune.cxx.
References laelaps::LaeTunes::m_fImuHz, laelaps::LaeTunes::m_fKinematicsHz, and laelaps::LaeTunes::m_fRangeHz.
|
protected |
Set the global trajectory tune parameters from the parsed DOM.
pElemSubSec | Parent enclosing subsection element. | |
[out] | tunes |
Definition at line 454 of file laeXmlTune.cxx.
References laelaps::degToRad(), laelaps::LaeTunes::m_eTrajNorm, and laelaps::LaeTunes::m_fTrajEpsilon.
|
protected |
Set the global tune parameters from the parsed DOM.
pElemSec | Parent enclosing section element. | |
[out] | tunes |
Definition at line 313 of file laeXmlTune.cxx.
References laelaps::LaeTunes::m_fVelDerate, and laelaps::LaeTunes::m_fWatchDogTimeout.
|
protected |
Set a powertrain pair's tire tune parameters from the parsed DOM.
strLoc | Powertrain pair location (and key). | |
pElemSubSec | Parent enclosing subsection element. | |
[out] | tunes |
Definition at line 845 of file laeXmlTune.cxx.
References laelaps::LaeTunesPowertrain::m_fTireRadius, laelaps::LaeTunesPowertrain::m_fTireWidth, and laelaps::LaeTunes::m_mapPtp.
|
protectedvirtual |
Set Laelaps powertrain tuning parameters from the parsed DOM.
pElemSec | Parent enclosing section element. | |
[out] | tunes |
Definition at line 670 of file laeXmlTune.cxx.
References laelaps::LaeTunes::m_mapPtp.
|
protected |
Set a powertrain pair's velocity PID tune parameters from the parsed DOM.
strLoc | Powertrain pair location (and key). | |
pElemSubSec | Parent enclosing subsection element. | |
[out] | tunes |
Definition at line 763 of file laeXmlTune.cxx.
References laelaps::LaeTunesPowertrain::m_fVelPidKd, laelaps::LaeTunesPowertrain::m_fVelPidKi, laelaps::LaeTunesPowertrain::m_fVelPidKp, and laelaps::LaeTunes::m_mapPtp.
|
protectedvirtual |
Set Laelaps range sensor tuning parameters from DOM.
pElemSec | Parent enclosing section element. | |
[out] | tunes |
Definition at line 923 of file laeXmlTune.cxx.
|
virtual |
Set the tune parameters from the parsed DOM.
[out] | tunes |
Definition at line 222 of file laeXmlTune.cxx.
Referenced by saveFile().
|
protected |
Set Laelaps VL6180 range sensor tuning parameters from DOM.
pElemSec | Parent enclosing section element. | |
strAttrType | Type of range sensor. | |
strAttrLoc | Location of range sensor (key). | |
[out] | tunes |
Definition at line 962 of file laeXmlTune.cxx.
References laelaps::LaeTunesVL6180::m_fAlsGain, laelaps::LaeTunes::m_mapVL6180, laelaps::LaeTunesVL6180::m_nAlsIntPeriod, laelaps::LaeTunesVL6180::m_nTofCrossTalk, and laelaps::LaeTunesVL6180::m_nTofOffset.
|
protected |
Convert text to FPN value within minimum,maximum range.
If the converted value is out of range, it will be set to the appropriate boundry value.
If the text is empty or if a conversion error occurs, the value is not set.
strElem | XML element name. | |
strText | XML element text. <elem>TEXT</elem> | |
fMin | Minimum value allowed. | |
fMax | Maximum value allowed. | |
[out] | fVal | Converted value. |
Definition at line 1145 of file laeXmlTune.cxx.
|
protected |
Convert text to value with a minimum value.
If the converted value is < the minimum, it will be set to the minimum.
If the text is empty or if a conversion error occurs, the value is not set.
strElem | XML element name. | |
strText | XML element text. <elem>TEXT</elem> | |
fMin | Minimum value allowed. | |
[out] | fVal | Converted value. |
Definition at line 1117 of file laeXmlTune.cxx.
|
protected |
Convert text to integer value within minimum,maximum range.
If the converted value is out of range, it will be set to the appropriate boundry value.
If the text is empty or if a conversion error occurs, the value is not set.
strElem | XML element name. | |
strText | XML element text. <elem>TEXT</elem> | |
nMin | Minimum value allowed. | |
nMax | Maximum value allowed. | |
[out] | nVal | Converted value. |
Definition at line 1183 of file laeXmlTune.cxx.
|
protected |
Convert text to norm enum.
If the text is empty or if a conversion error occurs, the value is not set.
strElem | XML element name. | |
strText | XML element text. <elem>TEXT</elem> | |
[out] | eNorm | Converted value. |
Definition at line 1221 of file laeXmlTune.cxx.
|
inlineprotected |
Warn on unknown element.
strElem | Element name. |
Definition at line 399 of file laeXmlTune.h.