Sphere vs. Box colliders for Quatruped simulation joints become detached?

Hi I am trying to simulate bionic quadruped locomotion in Unity using ArticulationBody but am having a great amount of difficulty with setting up joints. I am having to constant adjust many parameters to avoid joint physics issues,

But one of the major issues is the contact point colliders. The feet need to be high friction and low weight but in Unity when I use SphereCollider the friction is too low, the gait is stable but the contact points slips around on the floor even when the joint's force limits are very small:9013126--1242649--sphere.gif

The locomotion looks decent however the feet slip around way too much:9013126--1242652--slip.gif
I have tried adding physic materials with very high friction to both the floor and the feet but still the feet will slip around when the floor moves.

Then I tried using Box colliders. The feet barely would slip on the moving floor while the robot was in a static pose.

However once the legs were commanded to move the entire rig breaks apart and is very unstable:
9013126--1242655--box.gif
This is with default friction (no physic materials)..

What can I do to create a realistic contact point that doesn't cause the ArticulationBody joints to fall apart?

Thanks

What you’re doing is probably way over my head but are you setting the joint positions directly or are you setting a target position and let the controller move the respective joint?

same with the moving platform. Are you rotating it by setting transform position/rotation directly or are you using the kinematic rigidbody.moveRotation methods?

I have done work on a quadruped robot but never managed to make it walk but just stand in place. I used box colliders for the feet, and I don't think that's the issue with mine. I think ArticulationBody is still in its early stages to accurately simulate walking robots. In my case, it's more complicated because my robot has loop joints (due to the diagonal spring).

What controller are you using to control the robot though? Do you have a model of your robot?

9013204--1242661--QuadrupedSpine.PNG

I have been trying to learn about Quadrupedal locomotion for only a week so I am not very really knowledgeable about the subject but I managed to write a kinematic model and Bezier trajectory gait planner using examples from MIT cheetah and mini cheetah.

I'd like to use a neural network and reinforcement learning and train the platform to balance. However the contact points are absolutely critical and having very little configurability I'm afraid it won't be possible to accurately simulate the contact point without slipping or joints breaking.

Even when setting force limits as high as 100 and damping on all joints to infinity the robot still wobbles around. Articulation joints appear to be very springy and seem to ignore their damping settings entirely.

I was impressed when Unity introduce the ArticulationBody component but after working with it I am not sure they are designed for simulating anything more than a robot arm. And without a way to limit the springy behaviour I find ArticulationBody are limited.

Would a mesh collider be more accurate than box collider?

1 Like

The solver and SetDriveTarget are called from FixedUpdate():

swingJoint.SetDriveTarget(ArticulationDriveAxis.X, angleX);
hipJoint.SetDriveTarget(ArticulationDriveAxis.X, angleY);
kneeJoint.SetDriveTarget(ArticulationDriveAxis.X, angleZ);

To rotate the platform I am using random Perlin noise. The platform does have a attached kinematic rigidbody and the rotations are applied in FixedUpdate() :

 private float t;
    void FixedUpdate()
    {
        t += Time.deltaTime;
        rb.rotation = RandomSmoothPointOnUnitSphere(t * _timeWeight);
    }

Feet slipping still occurs despite very high values set for static and dynamic friction for all physic materials.

Yeah, I only had success with a rover using the ArticulationBody component. Manipulators work also nicely as I heard from examples online. I've yet to try model verification because of how buggy it could be. Until then, I can't say ArticulationBody is reliable for simulation of walking robots.

I'm also planning to try reinforcement learning but how are you doing it? What are you doing to reset the articulationbody when an episode terminates?

To answer your last question, I doubt mesh collider would work any better. I think the problems are mostly due to the ArticulationBody component once again.

I spent most of the day setting up hyperparameters and training environments. I started by training the Quadruped to balance on a moving platform:

https://www.youtube.com/watch?v=jN9GUNnfERM

This is a big deal! You might have ArticulationBody figured out! Do you have a model documented? If so, can you share it?

You need to use MoveRotation and MovePosition method for kinematic bodies. Anything else is teleporting and won't apply the proper friction forces.