diff --git a/urdf/include/urdf/joint.h b/urdf/include/urdf/joint.h index 54064e6..551e2c6 100644 --- a/urdf/include/urdf/joint.h +++ b/urdf/include/urdf/joint.h @@ -140,7 +140,8 @@ class JointCalibration { public: JointCalibration() { this->clear(); }; - double reference_position, rising, falling; + double reference_position; + boost::shared_ptr rising, falling; void clear() { diff --git a/urdf/src/joint.cpp b/urdf/src/joint.cpp index 0f2fecc..5a1adab 100644 --- a/urdf/src/joint.cpp +++ b/urdf/src/joint.cpp @@ -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; }