From 598019400c1f22c86f07486aecf06afe3e123aaf Mon Sep 17 00:00:00 2001 From: wim Date: Thu, 24 Jun 2010 19:17:27 +0000 Subject: [PATCH] search for parameter in initParam --- urdf/src/model.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/urdf/src/model.cpp b/urdf/src/model.cpp index 7ad9b45..6a670a6 100644 --- a/urdf/src/model.cpp +++ b/urdf/src/model.cpp @@ -70,10 +70,19 @@ bool Model::initParam(const std::string& param) { ros::NodeHandle nh; std::string xml_string; - if (!nh.getParam(param, xml_string)){ - ROS_ERROR("Could not find parameter %s on parameter server", param.c_str()); - return false; - } + + // gets the location of the robot description on the parameter server + std::string full_param; + if (!nh.searchParam(param, full_param)){ + ROS_ERROR("Could not find parameter %s on parameter server", param.c_str()); + return false; + } + + // read the robot description from the parameter server + if (!nh.getParam(full_param, xml_string)){ + ROS_ERROR("Could read parameter %s on parameter server", full_param.c_str()); + return false; + } return initString(xml_string); }