Skip to content

Commit

Permalink
Fix runtime error when parsing meshes due to using float number divis…
Browse files Browse the repository at this point in the history
…ion operator in range loop (#155)

* Fix runtime error when parsing meshes due to using float number division operator in range loop

Co-authored-by: Olivier Michel <[email protected]>
  • Loading branch information
Alexander Stumpf and omichel authored Feb 8, 2022
1 parent f4a3d63 commit 2d62081
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion urdf2webots/writeRobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def URDFVisual(robotFile, visualNode, level, normal=False):
if len(value) == 3:
robotFile.write('%d %d %d -1 ' % (value[0], value[1], value[2]))
elif isinstance(visualNode.geometry.trimesh.texCoordIndex[0], np.int32):
for i in range(len(visualNode.geometry.trimesh.texCoordIndex) / 3):
for i in range(len(visualNode.geometry.trimesh.texCoordIndex) // 3):
robotFile.write('%d %d %d -1 ' % (visualNode.geometry.trimesh.texCoordIndex[3 * i + 0],
visualNode.geometry.trimesh.texCoordIndex[3 * i + 1],
visualNode.geometry.trimesh.texCoordIndex[3 * i + 2]))
Expand Down

0 comments on commit 2d62081

Please sign in to comment.