![]() |
Hekateros
3.4.3
RoadNarrows Robotics Robot Arm Project
|
HekXmlTune Hekateros XML tuning class. More...
#include <hekXmlTune.h>
Public Member Functions | |
| HekXmlTune () | |
| Default constructor. | |
| virtual | ~HekXmlTune () |
| Destructor. | |
| virtual int | load (HekTunes &tunes, const std::string &strSearchPath=HekSysCfgPath, const std::string &strXmlFileName=HekEtcTune, bool bAllInstances=false) |
| Load XML file into DOM and set the Hekateros tuning parameters. More... | |
| virtual int | loadFile (const std::string &strXmlFileName=HekEtcTune) |
| Load XML file into DOM. More... | |
| virtual int | loadFile (HekTunes &tunes, const std::string &strXmlFileName=HekEtcTune) |
| Load XML file into DOM and set the Hekateros tuning parameters. More... | |
| virtual int | saveFile (const std::string &strXmlFileName=HekEtcTune) |
| Save DOM to XML file. More... | |
| virtual int | saveFile (const HekTunes &tunes, const std::string &strXmlFileName=HekEtcTune) |
| Set DOM from Hekateros description and save XML file. More... | |
| virtual int | createTemplateFile (const std::string &strXmlFileName=HekEtcTune) |
| Create a template Hekateros XML configuration file. root element. More... | |
| virtual int | setTunesFromDOM (HekTunes &tunes) |
| Set the tune parameters from the parsed DOM. More... | |
| virtual int | setDOMFromHekTunes (const HekTunes &tunes) |
| Set the DOM from the Hekateros tune parameters. More... | |
Protected Member Functions | |
| int | setGlobalTunes (TiXmlElement *pElemSec, HekTunes &tunes) |
| Set the global tune parameters from the parsed DOM. More... | |
| int | setJointTunes (TiXmlElement *pElemSec, HekTunes &tunes) |
| Set a joint tune parameters from the parsed DOM. More... | |
| int | setGlobalTrajTunes (TiXmlElement *pElemSubSec, HekTunes &tunes) |
| Set the global trajectory tune parameters from the parsed DOM. More... | |
| int | setJointPidTunes (const std::string &strJointName, TiXmlElement *pElemSubSec, HekTunesJoint &tunesJoint) |
| Set a joint's PID tune parameters from the parsed 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 value within minimum,maximum range. More... | |
| int | strToNorm (const std::string &strElem, const std::string &strText, HekNorm &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 'hekateros' | |
| std::string | m_strSecElemGlobal |
| global tuning section element | |
| std::string | m_strElemKinHz |
| kinematics thread hz | |
| std::string | m_strElemClearTorqueOff |
| clear over torque cond. th offset | |
| std::string | m_strElemVelDerate |
| derated velocity | |
| std::string | m_strSubSecElemTraj |
| trajectory subsection | |
| std::string | m_strElemTrajNorm |
| distance norm | |
| std::string | m_strElemTrajEpsilon |
| distance epsilon | |
| std::string | m_strSecElemJoint |
| joint tuning section element. | |
| std::string | m_strAttrJointId |
| joint id attribute name | |
| std::string | m_strElemTolPos |
| position tolerance | |
| std::string | m_strElemTolVel |
| position tolerance | |
| std::string | m_strElemOverTorqueTh |
| over torque condition threshold | |
| std::string | m_strSubSecElemPid |
| pos/vel pid subsection | |
| std::string | m_strElemPidKp |
| pid proportional constant | |
| std::string | m_strElemPidKi |
| pid integral constant | |
| std::string | m_strElemPidKd |
| pid derivative constant | |
| std::string | m_strElemPidMaxDeltaV |
| pid maximum delta v | |
HekXmlTune Hekateros XML tuning class.
Definition at line 72 of file hekXmlTune.h.
|
virtual |
Create a template Hekateros XML configuration file. root element.
Any current DOM is not accessed nor altered.
| strXmlFileName | XML file path name. |
Definition at line 159 of file hekXmlTune.cxx.
Referenced by saveFile().
|
virtual |
Load XML file into DOM and set the Hekateros tuning parameters.
| [out] | tunes |
Definition at line 72 of file hekXmlTune.cxx.
References hekateros::split().
Referenced by hekateros::HekRobot::connect(), hekateros::HekRobot::reload(), and ~HekXmlTune().
|
virtual |
Load XML file into DOM.
| strXmlFileName | XML file path name. |
Definition at line 130 of file hekXmlTune.cxx.
Referenced by loadFile(), and ~HekXmlTune().
|
inlinevirtual |
Load XML file into DOM and set the Hekateros tuning parameters.
| [out] | tunes |
Definition at line 147 of file hekXmlTune.h.
References hekateros::HEK_ECODE_XML, hekateros::HEK_OK, loadFile(), and setTunesFromDOM().
|
inlinevirtual |
Save DOM to XML file.
| strXmlFileName | XML file path name. |
Definition at line 167 of file hekXmlTune.h.
References hekateros::HEK_ECODE_XML, and hekateros::HEK_OK.
|
inlinevirtual |
Set DOM from Hekateros description and save XML file.
| [in] | tunes |
Definition at line 182 of file hekXmlTune.h.
References createTemplateFile(), hekateros::HEK_ECODE_XML, hekateros::HEK_OK, hekateros::HekEtcTune, setDOMFromHekTunes(), and setTunesFromDOM().
|
virtual |
Set the DOM from the Hekateros tune parameters.
| [in] | tunes |
Definition at line 313 of file hekXmlTune.cxx.
Referenced by saveFile().
|
protected |
Set the global trajectory tune parameters from the parsed DOM.
| pElemSubSec | Parent enclosing subsection element. | |
| [out] | tunes |
Definition at line 501 of file hekXmlTune.cxx.
References hekateros::degToRad(), hekateros::HekTunes::m_eTrajNorm, and hekateros::HekTunes::m_fTrajEpsilon.
|
protected |
Set the global tune parameters from the parsed DOM.
| pElemSec | Parent enclosing section element. | |
| [out] | tunes |
Definition at line 319 of file hekXmlTune.cxx.
References hekateros::HekTunes::m_fClearTorqueOffset, hekateros::HekTunes::m_fKinematicsHz, and hekateros::HekTunes::m_fVelDerate.
|
protected |
Set a joint's PID tune parameters from the parsed DOM.
| strJointName | Joint name. | |
| pElemSubSec | Parent enclosing subsection element. | |
| [out] | tunesJoint |
Definition at line 555 of file hekXmlTune.cxx.
References hekateros::degToRad(), hekateros::HekTunesJoint::m_fPidKd, hekateros::HekTunesJoint::m_fPidKi, hekateros::HekTunesJoint::m_fPidKp, and hekateros::HekTunesJoint::m_fPidMaxDeltaV.
|
protected |
Set a joint tune parameters from the parsed DOM.
| pElemSec | Parent enclosing section element. | |
| [out] | tunes |
Definition at line 395 of file hekXmlTune.cxx.
References hekateros::degToRad(), hekateros::HekTunesJoint::m_fOverTorqueTh, hekateros::HekTunesJoint::m_fTolPos, hekateros::HekTunesJoint::m_fTolVel, and hekateros::HekTunes::m_mapJointTunes.
|
virtual |
Set the tune parameters from the parsed DOM.
| [out] | tunes |
Definition at line 247 of file hekXmlTune.cxx.
Referenced by loadFile(), and saveFile().
|
protected |
Convert text to 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 656 of file hekXmlTune.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 627 of file hekXmlTune.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 694 of file hekXmlTune.cxx.
|
inlineprotected |
Warn on unknown element.
| strElem | Element name. |
Definition at line 357 of file hekXmlTune.h.