Hi,
I was wondering if it's possible in OpenSim 4.1 to create a custom controller component in Matlab (e.g. in a similar manner to as is done in the TugOfWar Controller example in the C++ files).
I know this wasn't possible in OpenSim 3.3 but just wanted to check. I have a work-around involving the Manager and a PrescribedController which is updated at short time-scales, if not.
Cheers
Creating Custom Controller in Matlab
- Daniel Gordon
- Posts: 34
- Joined: Fri May 06, 2016 7:57 am
- Carmichael Ong
- Posts: 401
- Joined: Fri Feb 24, 2012 11:50 am
Re: Creating Custom Controller in Matlab
I looked through the TugOfWar code from 4.1, and I see the controls section between L260 and L275. It looks like it's also using a PrescribedController as you are using with a linear function. Is this what you're referring to? If so, I think it should be doable. LinearFunction should be available in MATLAB, and Array<double> should be ArrayDouble in MATLAB.
- Carlos Gonçalves
- Posts: 136
- Joined: Wed Jun 08, 2016 4:56 am
Re: Creating Custom Controller in Matlab
Hello Carmichael, I am starting my research on custom controllers for OpenSim.
Do you know if there is an example in Python?
Best regards.
Do you know if there is an example in Python?
Best regards.
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Creating Custom Controller in Matlab
Hi Carlos,
Just to compliment Carmichael's answer, you can find an example code of a custom controller in C++ below:
https://github.com/mitkof6/OpenSim_API_ ... controller
If you want to create controllers in Python, keep in mind that they are not tightly integrated as would be in C++. One approach is to set the muscle excitation and integrate the system as with the osim-rl project. Please also, consider the following discussion:
viewtopicPhpbb.php?f=91&t=12337&p=0&sta ... 4086ef55f8
Just to compliment Carmichael's answer, you can find an example code of a custom controller in C++ below:
https://github.com/mitkof6/OpenSim_API_ ... controller
If you want to create controllers in Python, keep in mind that they are not tightly integrated as would be in C++. One approach is to set the muscle excitation and integrate the system as with the osim-rl project. Please also, consider the following discussion:
viewtopicPhpbb.php?f=91&t=12337&p=0&sta ... 4086ef55f8