Smooth Sphere Half Space Force Parameters

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
User avatar
Pasha van Bijlert
Posts: 214
Joined: Sun May 10, 2020 3:15 am

Re: Smooth Sphere Half Space Force Parameters

Post by Pasha van Bijlert » Sat Jul 17, 2021 3:32 pm

So it's totally feasible to generate quadrupedal locomotion using MOCO!
ambling gait.gif
ambling gait.gif (545.62 KiB) Viewed 270 times
This is a generic quadruped at a total mass of 45 kg (I envisioned a pretty big dog). Quasi-random initial guess (I think I set forward speed to the desired speed, pelvis height "about right" and maybe some imaginary pelvis translation as well).

It converges to a walk at slow speeds, ambles at higher speeds (pictured), and that eventually morphs to a gallop (I think, I'm not too familiar with quadrupedal gait analysis). At some point I think I'll start a specific thread on here to discuss solver strategies for specific gait kinematics (i.e.: what if you want to force a longer or shorter step length, both for bipeds or quadrupeds?) but this was a hobby project for now (spent an afternoon building and tuning the model, and had the optimizer run overnight for different speeds).

User avatar
Nicholas Bianco
Posts: 960
Joined: Thu Oct 04, 2012 8:09 pm

Re: Smooth Sphere Half Space Force Parameters

Post by Nicholas Bianco » Mon Jul 19, 2021 4:30 pm

Woah! This is awesome. For a day's work that is not bad at all. Could you share videos of the other speeds?

One question about this animation: it looks like the feet are sliding a little during contact. Do you know why that is? (It could be something to do with the visualization making it look off, not sure though).

User avatar
Pasha van Bijlert
Posts: 214
Joined: Sun May 10, 2020 3:15 am

Re: Smooth Sphere Half Space Force Parameters

Post by Pasha van Bijlert » Tue Jul 20, 2021 2:15 am

I'll make some more gifs later this week (this was a little hobby project of mine, a proof of concept that I can get quadrupedal coordinations).
One question about this animation: it looks like the feet are sliding a little during contact. Do you know why that is? (It could be something to do with the visualization making it look off, not sure though).
When coding up the quadruped, I repurposed code from my T. rex model. For the contact force stiffness, I just divided my T. rex-tuned stiffness by 100 out of convenience. I think this led to too compliant contact spheres, 500000 (N/m?). I just went back to the 2D gait example, it's got a stiffness that is 6 times as high. What I think is happening is that the contacts are so compliant that I'm getting a lot of deformation in the contact spheres (which I don't think OpenSim visualizes?), so instead it looks like the spheres are piercing through the ground and sliding around. If I up the stiffness of the contacts, I think this should resolve itself. I suppose I should be able to add markers to the same location as the contact geometry, which would allow me to easily get their coordinates as a function of time? The contact forces do allow for sliding, though, right? I assumed this because there are friction terms in the formulation.

User avatar
Nicholas Bianco
Posts: 960
Joined: Thu Oct 04, 2012 8:09 pm

Re: Smooth Sphere Half Space Force Parameters

Post by Nicholas Bianco » Tue Jul 20, 2021 4:09 pm

The spheres do allow sliding, and yes the friction component will resist sliding.

The low stiffness makes sense, since the foot will need to penetrate further into the ground to create the necessary contact forces. So in the visualization, the foot is still beneath the ground when it starts translating forward after "toe-ing off". Increasing the stiffness would probably produce something that looks more "normal".

POST REPLY