I want to simulate a skeletal-muscular system in real time

Post Reply
slightlycyborg
Posts: 1
Joined: Sun Apr 13, 2014 7:06 pm

I want to simulate a skeletal-muscular system in real time

Post by slightlycyborg »

I wish to simulate a human walking. I'm not worried about controlling the muscles, I have enough experience in neural nets to figure that out. What I am worried about is simulating the physics of muscles pulling on bones. Ideally, muscle fibers will be discrete (of course) and to the size of about 1 cm in diameter. Would bullet physics engine be useful in simulating the the physics of muscle and bone?
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: I want to simulate a skeletal-muscular system in real ti

Post by Basroil »

Well, OpenSim (https://simtk.org/home/opensim) does exactly what you want, and perhaps more than you need. It's limited to only human physiology though, so if you're talking about a cat or dog you might need to just take the ideas in that package and apply them elsewhere. If you are dead set on Bullet, you're going to be over-constraining your problem a hundred times more than you should, so don't freak out if there's some odd artifacts. Basically just make bones that are connected via 6dof joints (almost locked on either 4 or 5 axis) and also via a 6 dof constraint with motor for each muscle fiber (rotation free, distance on one axis powered, other two locked). With 1cm resolution, you're looking at potentially thousands of constraints, which are going to take some serious computation time and perhaps never be real-time at the accuracy needed.
fgomezfr
Posts: 1
Joined: Tue Apr 29, 2014 2:58 am

Re: I want to simulate a skeletal-muscular system in real ti

Post by fgomezfr »

This might be a little late, but: I'm a student working on a small project, essentially trying to do some real-time muscle simulation. I don't have a lot of experience to back my opinions on either OpenSIM or bullet, and by this time you may have explored both more than I have, but here's my take in case you are still exploring:

I played around with OpenSIM a while back, and it's quite sophisticated. You can definitely do non-human characters, but you would have to supply appropriately detailed models for the skeleton, as it only comes with human samples. More importantly, the existing simulation tools are designed to test forward simulations (possibly driven by pre-defined and not dynamically updated control parameters) against motion-capture data. So this might not work with your control scheme, and you will still have to build your own simulator from their libraries (based on SimTK). While it seems fast, it might not reach real time, since OpenSIM wasn't designed for real-time applications. Rather, it performs really high-quality simulations to generate kinematic motion trajectories that can then be re-played for comparisons.

As for using bullet: How are you planning to model muscles? If you are doing something simple like a Hill-type model, you can probably add your own code to obtain muscle lengths from bone geometry and integrate contraction velocities, and apply the resulting forces to bullet's rigid bodies. This should be doable in real-time (as opposed to adding constraints with motors for each muscle). Maybe a more experienced bullet programmer can speak as to how well the simulation will perform with lots of small forces applied to jointed bodies at various offsets.
Post Reply