@@ -60,7 +60,7 @@ def mkdirSafe(directory):
6060
6161def convertUrdfFile (input = None , output = None , robotName = None , normal = False , boxCollision = False ,
6262 toolSlot = None , initTranslation = '0 0 0' , initRotation = '0 0 1 0' ,
63- initPos = None , linkToDef = False , jointToDef = False , relativePathPrefix = None , targetVersion = 'R2023b ' ):
63+ initPos = None , linkToDef = False , jointToDef = False , relativePathPrefix = None , targetVersion = 'R2025a ' ):
6464 """Convert a URDF file into a Webots PROTO file or Robot node string."""
6565 urdfContent = None
6666 if not input :
@@ -95,7 +95,7 @@ def convertUrdfFile(input=None, output=None, robotName=None, normal=False, boxCo
9595
9696def convertUrdfContent (input , output = None , robotName = None , normal = False , boxCollision = False ,
9797 toolSlot = None , initTranslation = '0 0 0' , initRotation = '0 0 1 0' ,
98- initPos = None , linkToDef = False , jointToDef = False , relativePathPrefix = None , targetVersion = 'R2023b ' ):
98+ initPos = None , linkToDef = False , jointToDef = False , relativePathPrefix = None , targetVersion = 'R2025a ' ):
9999 """
100100 Convert a URDF content string into a Webots PROTO file or Robot node string.
101101 The current working directory will be used for relative paths in your URDF file.
@@ -177,7 +177,7 @@ def convertUrdfContent(input, output=None, robotName=None, normal=False, boxColl
177177 sys .stderr .write ('ROS not sourced, package "%s" will not be found.\n ' % packageName )
178178 if os .path .split (directory )[1 ]:
179179 packagePath = os .path .split (directory )[0 ]
180- packagePath = packagePath .replace ("\\ " ,"/" )
180+ packagePath = packagePath .replace ("\\ " , "/" )
181181 input = input .replace ('package://' + packageName , packagePath + '/' + packageName )
182182 else :
183183 sys .stderr .write ('Can\' t determine package root path.\n ' )
@@ -326,8 +326,8 @@ def convertUrdfContent(input, output=None, robotName=None, normal=False, boxColl
326326 parser .add_argument ('--relative-path-prefix' , dest = 'relativePathPrefix' , default = None ,
327327 help = 'If set and --input not specified, relative paths in your URDF file will be treated relatively '
328328 'to it rather than relatively to the current directory from which the script is called.' )
329- parser .add_argument ('--target' , dest = 'targetVersion' , default = 'R2023b ' ,
330- choices = ['R2023b' , 'R2023a' , 'R2022b' , 'R2022a' , 'R2021b' , 'R2021a' , 'R2020b' , 'R2020a' ],
329+ parser .add_argument ('--target' , dest = 'targetVersion' , default = 'R2025a ' ,
330+ choices = ['R2025a' , ' R2023b' , 'R2023a' , 'R2022b' , 'R2022a' , 'R2021b' , 'R2021a' , 'R2020b' , 'R2020a' ],
331331 help = 'Sets the Webots version the PROTO will target (will adapt which nodes will be used).' )
332332
333333 args = parser .parse_args ()
0 commit comments