add optional rising and falling attributes to the calibration element. Ticket #3141

This commit is contained in:
wim 2009-12-11 17:16:24 +00:00
parent 55b4153681
commit 47864e32e0
2 changed files with 21 additions and 1 deletions

View File

@ -106,7 +106,7 @@ class JointCalibration
{
public:
JointCalibration() { this->clear(); };
double reference_position;
double reference_position, rising, falling;
void clear()
{

View File

@ -175,6 +175,26 @@ bool JointCalibration::initXml(TiXmlElement* config)
else
this->reference_position = atof(reference_position_str);
// Get rising edge position
const char* rising_position_str = config->Attribute("rising");
if (rising_position_str == NULL)
{
ROS_DEBUG("joint calibration: no rising, using default value");
this->rising = 0;
}
else
this->rising = atof(rising_position_str);
// Get falling edge position
const char* falling_position_str = config->Attribute("falling");
if (falling_position_str == NULL)
{
ROS_DEBUG("joint calibration: no falling, using default value");
this->falling = 0;
}
else
this->falling = atof(falling_position_str);
return true;
}