about setActivation

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
li haoran
Posts: 8
Joined: Mon Apr 16, 2018 12:59 am

about setActivation

Post by li haoran » Sat Aug 04, 2018 12:53 am

Hello everybody,

i'm trying to set activation of tib_ant_r. My code looks like this:

Model anklemodel = Model("../model/Mysubject041.osim");
anklemodel.getMuscles().get(8).setActivation(s, tmp);

When I debug the code, I always get an error :The qualifier is discarded when a reference to a type "SimTK::State &" is bound to an initializer of type "const SimTK::State"

If anyone could give me a reason for the behavior i am seeing, that would be great.
Thanks!

Tags:

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

Re: about setActivation

Post by Thomas Uchida » Sat Aug 04, 2018 7:13 pm

Where is the State ('s') coming from? I think you're missing a line:

Code: Select all

Model anklemodel = Model("../model/Mysubject041.osim");
State& s = anklemodel.initSystem();
anklemodel.getMuscles().get(8).setActivation(s, tmp); //assuming 'tmp' has been declared

POST REPLY