fix for rising and falling fields in calibration element

This commit is contained in:
wim 2010-01-07 22:23:43 +00:00
parent 16eae8784c
commit 3cb8a7a40f
2 changed files with 6 additions and 5 deletions

View File

@ -140,7 +140,8 @@ class JointCalibration
{
public:
JointCalibration() { this->clear(); };
double reference_position, rising, falling;
double reference_position;
boost::shared_ptr<double> rising, falling;
void clear()
{

View File

@ -180,20 +180,20 @@ bool JointCalibration::initXml(TiXmlElement* config)
if (rising_position_str == NULL)
{
ROS_DEBUG("joint calibration: no rising, using default value");
this->rising = 0;
this->rising.reset();
}
else
this->rising = atof(rising_position_str);
this->rising.reset(new double(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;
this->falling.reset();
}
else
this->falling = atof(falling_position_str);
this->falling.reset(new double(atof(falling_position_str)));
return true;
}