Skip to content

Commit b8a65b7

Browse files
authored
Add support for R2025a (#216)
* Add support for R2025a * fix * version
1 parent 47947df commit b8a65b7

9 files changed

+14
-14
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name='urdf2webots',
8-
version='2023.1.0',
8+
version='2025.0.0',
99
author='Cyberbotics',
1010
author_email='[email protected]',
1111
description='A converter between URDF and PROTO files.',

tests/expected/Human.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#VRML_SIM R2023b utf8
1+
#VRML_SIM R2025a utf8
22
# license: Apache License 2.0
33
# license url: http://www.apache.org/licenses/LICENSE-2.0
44
# This is a proto file for Webots for the Human

tests/expected/KukaLbrIiwa14R820.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#VRML_SIM R2023b utf8
1+
#VRML_SIM R2025a utf8
22
# license: Apache License 2.0
33
# license url: http://www.apache.org/licenses/LICENSE-2.0
44
# This is a proto file for Webots for the KukaLbrIiwa14R820

tests/expected/MotomanSia20d.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#VRML_SIM R2023b utf8
1+
#VRML_SIM R2025a utf8
22
# license: Apache License 2.0
33
# license url: http://www.apache.org/licenses/LICENSE-2.0
44
# This is a proto file for Webots for the MotomanSia20d

tests/expected/RobotWithDummyLink.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#VRML_SIM R2023b utf8
1+
#VRML_SIM R2025a utf8
22
# license: Apache License 2.0
33
# license url: http://www.apache.org/licenses/LICENSE-2.0
44
# This is a proto file for Webots for the RobotWithDummyLink

tests/expected/RobotWithLocalMeshes.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#VRML_SIM R2023b utf8
1+
#VRML_SIM R2025a utf8
22
# license: Apache License 2.0
33
# license url: http://www.apache.org/licenses/LICENSE-2.0
44
# This is a proto file for Webots for the RobotWithLocalMeshes

urdf2webots/importer.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def mkdirSafe(directory):
6060

6161
def 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

9696
def 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()

urdf2webots/parserURDF.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
# to pass from external
1919
robotName = ''
20-
targetVersion = 'R2023b'
20+
targetVersion = 'R2025a'
2121

2222

2323
class Inertia():
@@ -676,7 +676,7 @@ def getCollision(link, node, path, outputDirectory):
676676
collision.scale[2] = float(meshScale[2])
677677
if (targetVersion >= 'R2023b' and collision.scale[0] != 1.0 and collision.scale[1] != 1.0
678678
and collision.scale[2] != 1.0):
679-
print('\033[1;33mWarning: BoundingObjects (collisions tags) cannot be scaled in version R2023b!'
679+
print('\033[1;33mWarning: BoundingObjects (collisions tags) cannot be scaled in version R2023b and above!'
680680
' Please create a separate model.\033[0m')
681681
if collision.scale[0] * collision.scale[1] * collision.scale[2] < 0.0:
682682
if extension in ['.dae', '.obj', '.stl']:

urdf2webots/writeRobot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
linkToDef = False
1414
jointToDef = False
1515
indexSolid = 0
16-
targetVersion = 'R2023b'
16+
targetVersion = 'R2025a'
1717

1818

1919
class RGB():

0 commit comments

Comments
 (0)