From 1b30be26e61197d3806c238eb2fc01907f35bb27 Mon Sep 17 00:00:00 2001 From: wim Date: Mon, 12 Jul 2010 16:34:22 +0000 Subject: [PATCH] better error message when no links are found in urdf file --- urdf/src/model.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/urdf/src/model.cpp b/urdf/src/model.cpp index 6a670a6..dfade4c 100644 --- a/urdf/src/model.cpp +++ b/urdf/src/model.cpp @@ -212,6 +212,11 @@ bool Model::initXml(TiXmlElement *robot_xml) return false; } } + if (this->links_.empty()){ + ROS_ERROR("No link elements found in urdf file"); + return false; + } + // Get all Joint elements for (TiXmlElement* joint_xml = robot_xml->FirstChildElement("joint"); joint_xml; joint_xml = joint_xml->NextSiblingElement("joint")) {