Skip to content

Commit

Permalink
Fix missing cw name tag for cadShape. (#185) (#187)
Browse files Browse the repository at this point in the history
* Fix missing cw name tag for cadShape. (#185)

* Update parserURDF.py

* restored fix

* Fixed one test

* Fixed another test

* Fixed another test

Co-authored-by: Alexander Stumpf <[email protected]>
  • Loading branch information
omichel and Alexander Stumpf authored Sep 30, 2022
1 parent 597d2b9 commit e337854
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion tests/expected/Human.proto
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,10 @@ PROTO Human [
Transform {
scale 1.000000 -1.000000 1.000000
children [
USE Calcn_L_visual
DEF Calcn_L_visual_cw CadShape {
url "root://tests/sources/gait2392_simbody/meshes/obj/Calcn L.obj"
ccw FALSE
}
]
}
HingeJoint {
Expand Down
2 changes: 1 addition & 1 deletion tests/expected/KukaLbrIiwa14R820.proto
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ PROTO KukaLbrIiwa14R820 [
Transform {
scale -1.000000 -1.000000 -1.000000
children [
DEF link_5_visual CadShape {
DEF link_5_visual_cw CadShape {
url "root://tests/sources/kuka_lbr_iiwa_support/meshes/lbr_iiwa_14_r820/visual/link_5.dae"
ccw FALSE
}
Expand Down
2 changes: 1 addition & 1 deletion tests/expected/KukaLbrIiwa14R820.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Robot {
Transform {
scale -1.000000 -1.000000 -1.000000
children [
DEF link_5_visual CadShape {
DEF link_5_visual_cw CadShape {
url "root://tests/sources/kuka_lbr_iiwa_support/meshes/lbr_iiwa_14_r820/visual/link_5.dae"
ccw FALSE
}
Expand Down
2 changes: 2 additions & 0 deletions urdf2webots/parserURDF.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ def getVisual(link, node, path):
name = os.path.splitext(os.path.basename(meshfile))[0]
if extension in ['.dae', '.obj'] and targetVersion >= 'R2022b':
name += '_visual'
if not visual.geometry.cadShape.ccw:
name += '_cw'
if not visual.geometry.mesh.ccw:
name += '_cw'
if name in Geometry.reference:
Expand Down

0 comments on commit e337854

Please sign in to comment.