Skip to content

Commit

Permalink
Handle invalid joint type in URDF conversion. Fixes #317.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 454798685
Change-Id: Ic29a3756e78f8714ed8acc70b10e115c3df46561
  • Loading branch information
kevinzakka authored and Copybara-Service committed Jun 14, 2022
1 parent 8dda269 commit 0e19187
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/xml/xml_urdf.cc
Expand Up @@ -307,6 +307,9 @@ void mjXURDF::Joint(XMLElement* joint_elem) {
// get type and name
ReadAttrTxt(joint_elem, "type", text, true);
jointtype = FindKey(urJoint_map, urJoint_sz, text);
if (jointtype < 0) {
mjXError(joint_elem, "invalid joint type in URDF joint definition");
}
ReadAttrTxt(joint_elem, "name", jntname, true);

// get parent, check
Expand Down

0 comments on commit 0e19187

Please sign in to comment.