Skip to content

Commit

Permalink
Merge pull request #49 from cyberbotics/fix-uppercase-extension-compa…
Browse files Browse the repository at this point in the history
…rison

Fix Case Sensitive File Extension Comparison
  • Loading branch information
DavidMansolino authored Jul 8, 2020
2 parents b246949 + 3f31483 commit 0d56f57
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions urdf2webots/parserURDF.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ def getVisual(link, node, path):
extension = os.path.splitext(meshfile)[1].lower()
if extension == '.dae':
getColladaMesh(meshfile, visual, link)
elif extension == '.stl' or extension == '.obj':
elif extension in ['.stl', '.obj']:
name = os.path.splitext(os.path.basename(meshfile))[0]
if name in Geometry.reference:
visual.geometry = Geometry.reference[name]
Expand Down Expand Up @@ -761,10 +761,10 @@ def getCollision(link, node, path):
if meshfile.count('package'):
idx0 = meshfile.find('package://')
meshfile = meshfile[idx0 + len('package://'):]
extension = os.path.splitext(meshfile)[1]
extension = os.path.splitext(meshfile)[1].lower()
if extension == '.dae':
collision.geometry.collada = getColladaMesh(meshfile, collision, link)
elif extension == '.stl' or extension == '.obj':
elif extension in ['.stl', '.obj']:
name = os.path.splitext(os.path.basename(meshfile))[0]
if name in Geometry.reference:
collision.geometry = Geometry.reference[name]
Expand Down

0 comments on commit 0d56f57

Please sign in to comment.