diff --git a/src/xml/xml_urdf.cc b/src/xml/xml_urdf.cc index d6f1b8ed..c69015cd 100644 --- a/src/xml/xml_urdf.cc +++ b/src/xml/xml_urdf.cc @@ -255,7 +255,7 @@ void mjXURDF::Body(XMLElement* body_elem) { if ((temp = FindSubElem(elem, "material"))) { // if color specified - use directly if ((temp1 = FindSubElem(temp, "color"))) { - ReadAttr(temp1, "rgba", 4, rgba, text); + ReadAttr(temp1, "rgba", 4, rgba, text, /*required=*/true); } // otherwise use material table @@ -332,7 +332,7 @@ void mjXURDF::Joint(XMLElement* joint_elem) { double axis[3] = {1, 0, 0}; Origin(joint_elem, pbody->pos, pbody->quat); if ((elem = FindSubElem(joint_elem, "axis"))) { - ReadAttr(elem, "xyz", 3, axis, text); + ReadAttr(elem, "xyz", 3, axis, text, /*required=*/true); } // create joint (unless fixed) @@ -626,7 +626,7 @@ void mjXURDF::MakeMaterials(XMLElement* elem) { if (FindName(name, urMat) < 0) { // add rgba value if available if ((color = FindSubElem(elem, "color"))) { - ReadAttr(color, "rgba", 4, rgba.val, text); + ReadAttr(color, "rgba", 4, rgba.val, text, /*required=*/true); AddName(name, urMat); urRGBA.push_back(rgba); }