From 3cb8a7a40f725030a1b1f6c429e164a49fda21d4 Mon Sep 17 00:00:00 2001 From: wim Date: Thu, 7 Jan 2010 22:23:43 +0000 Subject: [PATCH] fix for rising and falling fields in calibration element --- urdf/include/urdf/joint.h | 3 ++- urdf/src/joint.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) 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; }