muscle actuation

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
S Jul
Posts: 6
Joined: Mon Feb 25, 2019 9:13 am

muscle actuation

Post by S Jul » Tue May 14, 2019 5:34 am

Hi guys!
I'm trying to implement an excitation to the muscles by coding directly, not using the GUI. So I tried adding an excitation value and adding a force but none of them seem to work even if I put crazy values. Is there another way?
Thank you so much in advance for your help!
Regards

Tags:

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: muscle actuation

Post by Thomas Uchida » Tue May 14, 2019 8:30 am

Please see the example in the README file on GitHub: https://github.com/opensim-org/opensim-core (scroll down a bit to the "Simple example" section).

User avatar
S Jul
Posts: 6
Joined: Mon Feb 25, 2019 9:13 am

Re: muscle actuation

Post by S Jul » Tue May 14, 2019 9:13 am

Thank you! I don't know how I missed it.
In the same algorithm you showed me, a reporter is used to print some coordinates in the terminal. Do you know how I could save them (and other variables) in a file (txt file for example)? ^^

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: muscle actuation

Post by Thomas Uchida » Tue May 14, 2019 11:22 am

a reporter is used to print some coordinates in the terminal. Do you know how I could save them (and other variables) in a file
You can replace the ConsoleReporter with a TableReporter

Code: Select all

TableReporter* myReporter = new TableReporter();
//etc.
and then use the STOFileAdapter to write to file:

Code: Select all

auto myTable = myReporter->getTable();
STOFileAdapter::write(myTable, "filename.sto");
There are a few other FileAdapters as well; see the inheritance diagram here: https://simtk.org/api_docs/opensim/api_ ... apter.html.

User avatar
S Jul
Posts: 6
Joined: Mon Feb 25, 2019 9:13 am

Re: muscle actuation

Post by S Jul » Thu May 23, 2019 7:25 am

That's really great!! Thank you very much, worked like a charm. :D

POST REPLY