Page 1 of 1

Instantiating ControlSetController in Matlab

Posted: Fri Mar 10, 2023 4:43 am
by benknn_os
Hey community,

I am trying to instantiate a ControlSetController() object using Matlab 2020b and Opensim 4.2

I imported the library using: import org.opensim.modeling.*

For example, setting up a new model works: model = Model(). Other API calls work as well.

When instantiating a ControlSetController() object, however, I am getting the Matlab error: Unrecognized function or variable 'ControlSetController'. I looked up the class in the documentation: https://opensim-org.github.io/opensim-m ... oller.html. Therefore, I am certain, that the class should exist. I am using the following code line:

myController = ControlSetController()


Any idea what I am doing wrong?

Thanks in advance!
Best, Benedict

Re: Instantiating ControlSetController in Matlab

Posted: Fri Mar 10, 2023 12:49 pm
by ongcf
It looks like it may not be available in MATLAB because it doesn't appear in the SWIG include file: https://github.com/opensim-org/opensim- ... mulation.i

However, depending on your use case, often a PrescribedController instead could be better to use as a workaround.

Re: Instantiating ControlSetController in Matlab

Posted: Sat Mar 11, 2023 2:09 am
by benknn_os
Thank you for the explanation, Carmichael!

I ended up using a Prescribed Controller which is a suitable workaround for my usecase.