fsstudio-team / ZeroSimROSUnity

Robotic simulation in Unity with ROS integration.
https://roboticsimulationservices.com/
MIT License
168 stars 21 forks source link

Fix: Joint Angles Bug #32

Open caiobarrosv opened 1 year ago

caiobarrosv commented 1 year ago

ZeroSim hinge joints limits the joint angle in the range [-180, 180] degrees.

This limitation can be avoided by using Configurable Joints instead of Hinge Joints. However, instead of implementing the Configurable Joints, check the possibility to use Articulation Body instead.

https://docs.unity.cn/Manual/physics-articulations.html

There are unanswered questions about this on the Unity forum:

caiobarrosv commented 1 year ago

Just found out that unity updated this in 2022.2.0 version:

Gooren says in this post that:

"Currently, HingeJoint in Unity allows a maximum limit from -PI to +PI.

PhysX, however, doubles this limit from a total of 2PI to a total of 4PI since version 4.0 with the use of the eENABLE_EXTENDED_LIMITS flag."

micahpearlman commented 1 year ago

@caiobarrosv can you see if ZeroSim works for 2022.2.0 or greater. One thing is that we want to avoid is supporting non-LTS versions of Unity. As I can see the latest LTS version is 2021.3.8f1. If ZeroSim works with 2022.2.0 we can add in the README.md that if this issue comes up then update to 2022.2.0 -- but we do not generally support non LTS Unity versions.

caiobarrosv commented 1 year ago

ZeroSim is working with Unity 2022.2.5f1 (I just tested the controller manager service).

In this version we have Extended Limits option but it is not working properly. Even if we set the limits to [-360, 360], the spring target position can only be set in the range [-180, 180].

I posted this issue on the Unity forum - Link

I tried using Motor instead of Spring, but if we set the limits above 180 degrees, the joint will not respect the limitation and will not stop.

caiobarrosv commented 1 year ago

The articulation body allows joint angles more than 180 and less than -180. My recomendation is to remove all the hinge joints from robot manipulators in example scenes like the UR10_test.scene and alert users about this joint limitation issue.

Image

Although the last LST version is the 2021.3.8f1, after this version we had a lot of important updates for Articulated bodies like:

I would try to keep it as updated as possible if the goal is to use robotic arms with articulated body. Maybe for mobile robots we can still use regular joints.