Unity-Technologies / URDF-Importer

URDF importer
Apache License 2.0
219 stars 71 forks source link

URDF Robot switching axis spuriously #32

Closed Th-Havy closed 3 years ago

Th-Havy commented 3 years ago

I encounter a bug with the URDF robot, which can occurs spuriously both in edit and play mode.

I am running Unity 2020.2.1f1.

The bug occurs when the field Axis Type of the Urdf Robot script is set to Z Axis, and it is shown in the following video:

https://user-images.githubusercontent.com/31824065/104349311-0c9fe380-5503-11eb-812c-d34552b1b326.mp4

Basically, this spurious axis switching can occur when the gameobject to which the UrdfRobot is attached is selected in the inspector.

I have traced the source of the bug in UrdfRobot.cs. Basically at line 26 there is:

public ImportSettings.axisType choosenAxis ;
private ImportSettings.axisType currentOrientation = ImportSettings.axisType.yAxis;

But currentOrientation should instead be initialised with the value of choosenAxis [sic] e.g. in OnEnable() and/or in Awake().

LaurieCheers-unity commented 3 years ago

Thanks for the bug report, we'll look into this.

vidurvij-Unity commented 3 years ago

Hi @Th-Havy, This issue has been resolved in the latest commit. https://github.com/Unity-Technologies/URDF-Importer/commit/68d91b3551f4c8073e03d6e5f48c5e909d121228 Vidur

mpinol commented 3 years ago

Hi @Th-Havy,

I wanted to check in and see if Vidur's fix was able to resolve your issue?

Th-Havy commented 3 years ago

Hi @mpinol ,

Thanks, it works well now, the bug has been corrected. I'll close the issue.