Page 1 of 1

How to implement a PrescribedController

Posted: Mon Mar 25, 2019 8:43 am
by shufschmidt
Dear OpenSim Community,

I am currently modelling an upper-limb exoskeleton. Now I want to introduce different moments that affect a single pin joint of my model by editing the xml-file.
To begin, I wanted to add a constant moment (in this case, 1000Nm) to the pin joint that is linked to the coordinate "Armstab_r_coord_0".
Therefore, I tried to define a CoordinateActuator in ForceSet regulated by a Prescribed Controller defined in ControllerSet.

You can find the two xml code snippets in one file attached below.

Regarding the structure of the PrescribedController class, I have the following question:
Why do I need a control storage file, if a control function already has been designed in FunctionSet?

In contrast to the CoordinateActuator, which appears in the navigator window, I cannot see the PrescribedController in the GUI.
In addition to that, I cannot see any changes in the Inverse Kinematics or Inverse Dynamics of my model.
Did I commit a mistake defining the Controller?


Kind regards,
Soeren Hufschmidt

Re: How to implement a PrescribedController

Posted: Thu Mar 28, 2019 2:08 am
by mitkof6
When the control storage is used, functions are created to fit the data columns in the control storage. Then these functions are used to actuate the model. When the control storage is not specified the provided functions are used instead.

https://github.com/opensim-org/opensim- ... er.cpp#L99