Understanding the API: How to know the possible column names
Posted: Tue Aug 28, 2018 9:43 am
Hi again,
I was trying to follow the program for making a simple arm model as provided in the OpenSim github https://github.com/opensim-org/opensim-core.
I was wondering on how do we know or look into the API for understanding what are the probable names that are supported to view the output in the reporter.
For example, a snippet of the code from repo is shown below:
As you can see that, you have used getOutput() and as arguments, "fiber_force" and "value" has been provided. First question is : May I know how did you know them or where can I find them as well ?
Because I tried the following, say in order to view the muscle power, and it was of course wrong
As you can see from the above code snippet that when I comment the excitations, I guessed the "muscle_power" argument right and I could see the result in console. But it did not work for excitations/activations. Could you please point me to where I can understand or look up those? I am still learning to use API.
Thanks,
Vishal
I was trying to follow the program for making a simple arm model as provided in the OpenSim github https://github.com/opensim-org/opensim-core.
I was wondering on how do we know or look into the API for understanding what are the probable names that are supported to view the output in the reporter.
For example, a snippet of the code from repo is shown below:
Code: Select all
// Add a console reporter to print the muscle fiber force and elbow angle.
ConsoleReporter* reporter = new ConsoleReporter();
reporter->set_report_time_interval(1.0);
reporter->addToReport(biceps->getOutput("fiber_force"));
reporter->addToReport(
elbow->getCoordinate(PinJoint::Coord::RotationZ).getOutput("value"),
"elbow_angle");
model.addComponent(reporter);
Because I tried the following, say in order to view the muscle power, and it was of course wrong
Code: Select all
reporter->addToReport(biceps->getOutput("muscle_power"),"biceps_power");
reporter->addToReport(biceps->getOutput("excitations"), "excitations");
Thanks,
Vishal