-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Muscle activation should be set only by the Python class #129
Comments
Moving plot_positions to root for now... Allows setting logstep in sibernetic_c302.py Updates sibernetic version to 0.0.6 Addresses openworm#129, uses pure muscle activation signal from Python class Removes some use of "Pyramidal"
FYI @a-palyanov I've added the "smooth start" to the MuscleSimulation Python class here: Can be plotted with: python main_sim.py |
Yes, there is actually some hard coding to achieve more realistic shapes of the body while swimming and crawling. There are two transformations of the signal, one after another: 1) sin(...)+1 --> (sin(...)+1)^2 to reduce the number of worm body segments at which both left and right muscles contract simultaneously, causing body shortening, and 2) attenuation of the signal for the muscles which are close to the tail (the closer the stronger), which somehow compensates the fact that muscle cells near the head are shorter then those at the tail, which in turn causes worm body shapes not very close to real worm's. Interestingly, the real C. elegans should possess some internal mechanisms allowing it to solve the same problems. |
Fixed in the recent update (of development branch). |
@a-palyanov Can you confirm that it was intended to change the behaviour of the sine wave input to swimming -> crawling? This is fine if you're mainly testing/tuning swimming behaviour at the moment, but when the worm_alone is run, it quickly bends to a C shape. It should be quite straight forward to have multiple Python classes in main_sim.py for injecting sinusoidal (or any other) activation patterns, and these could be set at the command line (as c302 is, see https://github.com/pgleeson/sibernetic/blob/development/inc/owConfigProperty.h#L219), or specified in the configuration file. It would be much easier for others to test/plot/add them then. |
@pgleeson Both swimming and crawling look more natural when I use not a pure sin signal, but rather a (sin(...)+1)^2. Additionally, different environments require different maximal muscle contraction force, and the real C. elegans is able to adjust it if necessary. Worm_alone for sure requires noticeably lower maximal muscle contraction force, so when it is used with muscle activating signals for swimming it causes the body to bend to a C chape. |
I think this got incorporated; re-open if not... |
There is currently some hard coding of the activation signals at https://github.com/openworm/sibernetic/blob/development/src/owPhysicsFluidSimulator.cpp#L417.
The muscle signals coming in should be only set by the python class supplied to drive the muscles, either MuscleSimulation or C302NRNSimulation.
See commit below for fix. PR soon...
The text was updated successfully, but these errors were encountered: