ms-iot / vscode-ros

Visual Studio Code extension for Robot Operating System (ROS) development
https://marketplace.visualstudio.com/items?itemName=ms-iot.vscode-ros
MIT License
393 stars 94 forks source link

[bug] Mirrored models in URDF preview #1139

Open RangaSundarRS opened 9 months ago

RangaSundarRS commented 9 months ago

(Please add appropriate labels)

\<0.9.5>

\<1.18.2>

what is the bug

When loading the Motoman MH180-120 robot arm, all links' models are mirrored over the link's Y-Z axis. The models are actually in the correct positions, but are displaying flipped. VScode_Mirrored

Repro steps

See https://github.com/RangaSundarRS/MotomanMH-ROS2/tree/main for URDF and STL. 1) Source your ROS2 Humble install 2) Build the package with colcon build 3) Source the package with the install\local_setup.ps1 4) Run code to launch VSCode with 5) Open the folder in VSCode. 6) Open urdf\mh180_120.xacro in VSCode. 7) Ctrl-Shift-P -> ROS: Preview URDF 8) View the incorrect display of URDF. Many links are mirrored and rotated around such that the robot arm is no longer even connected!

expected behavior

The links should appear properly, not mirrored over the Y-Z axis. Correct appearance (from RoboDK, this is not using the URDF): RoboDK_MH180_120

Correct visualization of the URDF (From urdf-viz): urdf-viz_Correct

ooeygui commented 9 months ago

Thank you - investigating.

Ali-J-Fesharaki commented 7 months ago

I have the same issue .it flips my shoulders but in movie and gazebo my model is fine Screenshot from 2023-12-01 05-15-34

ooeygui commented 7 months ago

Oops, that's embarrassing. Thanks for bringing it to my attention

jweaston commented 1 month ago

I am also experiencing the same issue with the Fanuc CRX10ial. image Let me know if there's any other information I can provide to help debug this issue.

polyhobbyist commented 3 weeks ago

This was a "handed coordinate system" problem. Corrected by inverting the meshes. I'm testing to make sure I didn't regress anything else. image

polyhobbyist commented 3 weeks ago

I also noticed that the materials aren't applied by name; for example <material name="yellow"/> doesn't render because the RGBA isn't included.

polyhobbyist commented 3 weeks ago

@RangaSundarRS Do you mind if I include a flattened version of your xacro in the test case for the rendering?