In my setup, the angular velocity readings of rigidbodies and articulation bodies are significantly inaccurate in certain situations. I suspect this issue is at least in part related to the attached joints.
For context, I am working on physically animating a dog character with target joint angles determined by machine learning. Accurate angular velocity readings are crucial, as they will be used as observations for the neural network.
In the image below, the dog is standing completely still. However, the angular velocity readings for the lower front right limb are relatively constant at around (-0.14, -0.23, -0.17), as shown in the console and the articulation body info. If I understand correctly, this isn’t an insignificant value.
I have implemented a manual angular velocity calculation using the rotation from one fixed update to the next. This method correctly outputs a zero reading (0,0,0) in the console for this specific situation where the dog is not moving.
The inaccuracy seems to be larger when the foot is colliding with the ground and the target angles are set to a higher value, reaching up to around 1 radian per second or more.
I have examined and tested the collider setup, and the dog is not colliding with itself, so that is not the issue.
This problem also occurs with velocity, but to a lesser extent.
The issue is present in all three leg segment articulation bodies of each leg, but it is significantly less severe in the chest articulation body, which the legs are connected to. I noticed that the inertia tensor values for the limb segments are extremely small (visible in the info section), which is not the case for the chest articulation body, likely because its collider is much larger. Could the small size of these values be the cause of the issue? The dog is about 0.5f units (50cm) tall, so the scaling is not off, but I guess the collider sizes for each of the leg segments are only a handful centimetres long in each dimension, which would explain the small inertia tensor values?
Has anyone experienced a similar issue before? Any help would be greatly appreciated as I’ve been staring at this issue for a few days now and its driving me insane :))))