Add urdf file extension case to mj_parse.

fixes #3004

PiperOrigin-RevId: 855249634
Change-Id: I6c21d0ada4fe482059f64e96d413796f5c1c66ce
This commit is contained in:
Sam Haves
2026-01-12 08:57:57 -08:00
committed by Copybara-Service
parent 013268c283
commit 7e45bbb51c
4 changed files with 16 additions and 1 deletions
+3 -1
View File
@@ -72,7 +72,9 @@ mjSpec* mj_parse(const char* filename, const char* content_type,
// early exit for existing XML workflow
auto filepath = mujoco::user::FilePath(filename);
if (filepath.Ext() == ".xml" || (content_type && std::strcmp(content_type, "text/xml") == 0)) {
if (filepath.Ext() == ".xml" ||
filepath.Ext() == ".urdf" ||
(content_type && std::strcmp(content_type, "text/xml") == 0)) {
return mj_parseXML(filename, vfs, error, error_sz);
}