fix for rising and falling fields in calibration element
This commit is contained in:
parent
16eae8784c
commit
3cb8a7a40f
|
@ -140,7 +140,8 @@ class JointCalibration
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
JointCalibration() { this->clear(); };
|
JointCalibration() { this->clear(); };
|
||||||
double reference_position, rising, falling;
|
double reference_position;
|
||||||
|
boost::shared_ptr<double> rising, falling;
|
||||||
|
|
||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
|
|
|
@ -180,20 +180,20 @@ bool JointCalibration::initXml(TiXmlElement* config)
|
||||||
if (rising_position_str == NULL)
|
if (rising_position_str == NULL)
|
||||||
{
|
{
|
||||||
ROS_DEBUG("joint calibration: no rising, using default value");
|
ROS_DEBUG("joint calibration: no rising, using default value");
|
||||||
this->rising = 0;
|
this->rising.reset();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
this->rising = atof(rising_position_str);
|
this->rising.reset(new double(atof(rising_position_str)));
|
||||||
|
|
||||||
// Get falling edge position
|
// Get falling edge position
|
||||||
const char* falling_position_str = config->Attribute("falling");
|
const char* falling_position_str = config->Attribute("falling");
|
||||||
if (falling_position_str == NULL)
|
if (falling_position_str == NULL)
|
||||||
{
|
{
|
||||||
ROS_DEBUG("joint calibration: no falling, using default value");
|
ROS_DEBUG("joint calibration: no falling, using default value");
|
||||||
this->falling = 0;
|
this->falling.reset();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
this->falling = atof(falling_position_str);
|
this->falling.reset(new double(atof(falling_position_str)));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue