Instantiating ControlSetController in Matlab

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Benedict Koenen
Posts: 5
Joined: Fri Nov 18, 2022 1:52 am

Instantiating ControlSetController in Matlab

Post by Benedict Koenen » Fri Mar 10, 2023 4:43 am

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

Tags:

User avatar
Carmichael Ong
Posts: 401
Joined: Fri Feb 24, 2012 11:50 am

Re: Instantiating ControlSetController in Matlab

Post by Carmichael Ong » Fri Mar 10, 2023 12:49 pm

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.

User avatar
Benedict Koenen
Posts: 5
Joined: Fri Nov 18, 2022 1:52 am

Re: Instantiating ControlSetController in Matlab

Post by Benedict Koenen » Sat Mar 11, 2023 2:09 am

Thank you for the explanation, Carmichael!

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

POST REPLY