ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
As mentioned in the question, I was trying to get the KDL tree of the robot by loading the URDF using treeFromFile()
function with taking the URDF from the params server. I changed it to treeFromString()
as the URDF is stored as a string in the params server. Below is the modified code.
KDL::Tree lumi_tree;
std::string lumi_robot;
node.param("/robot_description", lumi_robot, std::string()); if (!kdl_parser::treeFromString(lumi_robot, lumi_tree)){ ROS_ERROR("Failed to construct kdl tree"); return false; }
2 | No.2 Revision |
As mentioned in the question, I was trying to get the KDL tree of the robot by loading the URDF using treeFromFile()
function with taking the URDF from the params server. I changed it to treeFromString()
as the URDF is stored as a string in the params server. Below is the modified code.
KDL::Tree lumi_tree;
std::string lumi_robot;
node.param("/robot_description", lumi_robot, std::string());
Now the KDL tree is formed and is used for further calculations. if (!kdl_parser::treeFromString(lumi_robot, lumi_tree)){
ROS_ERROR("Failed to construct kdl tree");
return false;
}}
3 | No.3 Revision |
As mentioned in the question, I was trying to get the KDL tree of the robot by loading the URDF using treeFromFile()
function with taking the URDF from the params server. I changed it to treeFromString()
as the URDF is stored as a string in the params server. Below is the modified code.
KDL::Tree lumi_tree;
std::string lumi_robot;
node.param("/robot_description", lumi_robot, std::string());
if (!kdl_parser::treeFromString(lumi_robot, lumi_tree)){
ROS_ERROR("Failed to construct kdl tree");
return false;
}
Now the KDL tree is formed and is used for further calculations.
Thanks @pmuthu2s and @gvdroorn for their inputs.
4 | No.4 Revision |
As mentioned in the question, I was trying to get the KDL tree of the robot by loading the URDF using treeFromFile()
function with taking the URDF from the params server. I changed it to treeFromString()
as the URDF is stored as a string in the params server. Below is the modified code.
KDL::Tree lumi_tree;
std::string lumi_robot;
node.param("/robot_description", lumi_robot, std::string());
if (!kdl_parser::treeFromString(lumi_robot, lumi_tree)){
ROS_ERROR("Failed to construct kdl tree");
return false;
}
Now the KDL tree is formed and is used for further calculations.
Thanks @pmuthu2s and @gvdroorn @gvdhoorn for their inputs.
5 | No.5 Revision |
As mentioned in the question, I was trying to get the KDL tree of the robot by loading the URDF using treeFromFile()
function with taking the URDF from the params server. I changed it to treeFromString()
as the URDF is stored as a string in after getting it from the params server. Below is the modified code.
KDL::Tree lumi_tree;
std::string lumi_robot;
node.param("/robot_description", lumi_robot, std::string());
if (!kdl_parser::treeFromString(lumi_robot, lumi_tree)){
ROS_ERROR("Failed to construct kdl tree");
return false;
}
Now the KDL tree is formed and is used for further calculations.
Thanks @pmuthu2s and @gvdhoorn for their inputs.