Hekateros  3.4.3
RoadNarrows Robotics Robot Arm Project
hekateros::HekTunes Class Reference

Hekateros tuning data class. More...

#include <hekTune.h>

Public Types

typedef std::map< std::string, HekTunesJointMapJointTunes
 

Public Member Functions

 HekTunes ()
 Default constructor.
 
 ~HekTunes ()
 Destructor.
 
double getKinematicsHz () const
 Get kinematics thread cycle rate tune parameter (hertz). More...
 
double getVelocityDerate () const
 Get derated velocity tune parameter (normalized). More...
 
void getTrajectoryParams (HekNorm &eNorm, double &fEpsilon) const
 Get trajectory tune parameters. More...
 
void getToleranceParams (const std::string &strJointName, double &fTolPos, double &fTolVel) const
 Get joint tolerance tune parameters. More...
 
void getPidKParams (const std::string &strJointName, double &fKp, double &fKi, double &fKd) const
 Get joint PID K tune parameters. More...
 
double getPidMaxDeltaV (const std::string &strJointName) const
 Get joint PID maximum delta v (radians/second) tune parameter. More...
 
void getTorqueParams (const std::string &strJointName, double &fOverTorqueTh, double &fClearTorqueTh) const
 Get joint torque parameters. More...
 

Public Attributes

double m_fKinematicsHz
 kinematic thread rate (hertz)
 
double m_fClearTorqueOffset
 clear over torque condition offset (frac)
 
double m_fVelDerate
 velocity derate (fraction)
 
HekNorm m_eTrajNorm
 trajectory distanct norm
 
double m_fTrajEpsilon
 trajectory epsilon distance (radians)
 
MapJointTunes m_mapJointTunes
 per joint tuning
 

Detailed Description

Hekateros tuning data class.

Definition at line 408 of file hekTune.h.

Member Typedef Documentation

typedef std::map<std::string, HekTunesJoint> hekateros::HekTunes::MapJointTunes

Map of joint tuning parameters.

Definition at line 412 of file hekTune.h.

Member Function Documentation

double hekateros::HekTunes::getKinematicsHz ( ) const
inline

Get kinematics thread cycle rate tune parameter (hertz).

Returns
Hertz.

Definition at line 441 of file hekTune.h.

442  {
443  return m_fKinematicsHz;
444  }
double m_fKinematicsHz
kinematic thread rate (hertz)
Definition: hekTune.h:415
void HekTunes::getPidKParams ( const std::string &  strJointName,
double &  fKp,
double &  fKi,
double &  fKd 
) const

Get joint PID K tune parameters.

Parameters
strJointNameName of joint.
[out]fKpProportional constant.
[out]fKiIntegral constant.
[out]fKdDerivative constant.

Definition at line 118 of file hekTune.cxx.

Referenced by hekateros::HekKinJoint::HekKinJoint(), and hekateros::HekKinJoint::reload().

120 {
121  MapJointTunes::const_iterator pos;
122 
123  if( (pos = m_mapJointTunes.find(strJointName)) != m_mapJointTunes.end() )
124  {
125  fKp = pos->second.m_fPidKp;
126  fKi = pos->second.m_fPidKi;
127  fKd = pos->second.m_fPidKd;
128  }
129  else
130  {
131  fKp = HekTunePidKpDft;
132  fKi = HekTunePidKiDft;
133  fKd = HekTunePidKdDft;
134  }
135 }
static const double HekTunePidKpDft
Default joint position and velocity PID proportional constant.
Definition: hekTune.h:285
static const double HekTunePidKdDft
Default joint position and velocity PID derivative constant.
Definition: hekTune.h:301
static const double HekTunePidKiDft
Default joint position and velocity PID integral constant.
Definition: hekTune.h:293
MapJointTunes m_mapJointTunes
per joint tuning
Definition: hekTune.h:422
double HekTunes::getPidMaxDeltaV ( const std::string &  strJointName) const

Get joint PID maximum delta v (radians/second) tune parameter.

Parameters
strJointNameName of joint.
Returns
Maximum output delta velocity (radians/second).

Definition at line 137 of file hekTune.cxx.

References hekateros::degToRad().

Referenced by hekateros::HekKinJoint::HekKinJoint(), and hekateros::HekKinJoint::reload().

138 {
139  MapJointTunes::const_iterator pos;
140 
141  if( (pos = m_mapJointTunes.find(strJointName)) != m_mapJointTunes.end() )
142  {
143  return pos->second.m_fPidMaxDeltaV;
144  }
145  else
146  {
148  }
149 }
static const double HekTunePidMaxDeltaVDft
Maximum PID delta V output (degrees/second)
Definition: hekTune.h:314
double degToRad(double d)
Convert degrees to radians.
Definition: hekUtils.h:125
MapJointTunes m_mapJointTunes
per joint tuning
Definition: hekTune.h:422
void HekTunes::getToleranceParams ( const std::string &  strJointName,
double &  fTolPos,
double &  fTolVel 
) const

Get joint tolerance tune parameters.

Parameters
strJointNameName of joint.
[out]fTolPosPosition tolerance (radians)
[out]fTolVelVelocity tolerance (radians/second)

Definition at line 101 of file hekTune.cxx.

References hekateros::degToRad().

Referenced by hekateros::HekKinJoint::HekKinJoint(), and hekateros::HekKinJoint::reload().

103 {
104  MapJointTunes::const_iterator pos;
105 
106  if( (pos = m_mapJointTunes.find(strJointName)) != m_mapJointTunes.end() )
107  {
108  fTolPos = pos->second.m_fTolPos;
109  fTolVel = pos->second.m_fTolVel;
110  }
111  else
112  {
113  fTolPos = degToRad(HekTuneTolPosDft);
114  fTolVel = degToRad(HekTuneTolVelDft);
115  }
116 }
static const double HekTuneTolVelDft
Default joint velocity control tolerance (degrees/second).
Definition: hekTune.h:268
double degToRad(double d)
Convert degrees to radians.
Definition: hekUtils.h:125
static const double HekTuneTolPosDft
Default joint position control tolerance (degrees).
Definition: hekTune.h:239
MapJointTunes m_mapJointTunes
per joint tuning
Definition: hekTune.h:422
void HekTunes::getTorqueParams ( const std::string &  strJointName,
double &  fOverTorqueTh,
double &  fClearTorqueTh 
) const

Get joint torque parameters.

Parameters
strJointNameName of joint.
[out]fOverTorqueThOver torque threshold (normalized).
[out]fClearTorqueThClear over torque condition threshold (normalized).

Definition at line 151 of file hekTune.cxx.

Referenced by hekateros::HekKinJoint::HekKinJoint(), and hekateros::HekKinJoint::reload().

154 {
155  MapJointTunes::const_iterator pos;
156 
157  if( (pos = m_mapJointTunes.find(strJointName)) != m_mapJointTunes.end() )
158  {
159  fOverTorqueTh = pos->second.m_fOverTorqueTh;
160  }
161  else
162  {
163  fOverTorqueTh = HekTuneOverTorqueThDft / 100.0;
164  }
165  fClearTorqueTh = fOverTorqueTh * m_fClearTorqueOffset;
166 }
static const double HekTuneOverTorqueThDft
Default joint over torque threshold (% of maximum)
Definition: hekTune.h:121
MapJointTunes m_mapJointTunes
per joint tuning
Definition: hekTune.h:422
double m_fClearTorqueOffset
clear over torque condition offset (frac)
Definition: hekTune.h:416
void hekateros::HekTunes::getTrajectoryParams ( HekNorm eNorm,
double &  fEpsilon 
) const
inline

Get trajectory tune parameters.

Parameters
[out]eNormDistance norm.
[out]fEpsilonWaypoint precision (radians)

Definition at line 462 of file hekTune.h.

Referenced by hekateros::HekRobot::getTrajectoryParams().

463  {
464  eNorm = m_eTrajNorm;
465  fEpsilon = m_fTrajEpsilon;
466  }
double m_fTrajEpsilon
trajectory epsilon distance (radians)
Definition: hekTune.h:419
HekNorm m_eTrajNorm
trajectory distanct norm
Definition: hekTune.h:418
double hekateros::HekTunes::getVelocityDerate ( ) const
inline

Get derated velocity tune parameter (normalized).

Returns
Derated value [0, 1].

Definition at line 451 of file hekTune.h.

Referenced by hekateros::HekKinJoint::HekKinJoint(), and hekateros::HekKinJoint::reload().

452  {
453  return m_fVelDerate;
454  }
double m_fVelDerate
velocity derate (fraction)
Definition: hekTune.h:417

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