Created
August 9, 2025 18:41
-
-
Save yunho-c/42622ba7f7623e240cd560fbaa1321f9 to your computer and use it in GitHub Desktop.
Revisions
-
yunho-c created this gist
Aug 9, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ import argparse import mujoco from pathlib import Path def main(): parser = argparse.ArgumentParser(description="Convert a URDF file to a MuJoCo XML file.") parser.add_argument("input_file", help="The input URDF file path.") # parser.add_argument("output_file", help="The output XML file path.") args = parser.parse_args() model = mujoco.MjModel.from_xml_path(args.input_file) # mujoco.mj_saveLastXML(args.output_file, model) mujoco.mj_saveLastXML(args.input_file.replace(".urdf", ".xml"), model) if __name__ == "__main__": main()