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
409 stars 96 forks source link

[bug] Mirrored models in URDF preview #1139

Open RangaSundarRS opened 1 year ago

RangaSundarRS commented 1 year 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 1 year ago

Thank you - investigating.

Ali-J-Fesharaki commented 11 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 11 months ago

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

jweaston commented 5 months 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 4 months 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 4 months 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 4 months ago

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

Usimian commented 3 months ago

Would love to see this fixed. URDF preview in vscode is very useful. For now I've gone back to urdf-viz which renders properly.