Casting controllersets in Matlab

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Lars Boers
Posts: 14
Joined: Thu Sep 06, 2018 2:23 am

Casting controllersets in Matlab

Post by Lars Boers » Fri Jul 26, 2019 2:56 am

Hi Guys,

I created a MEX wrapper that uses C++ to cast a PrescribedController from a controllerSet using dynamic_cast:

PrescribedController* controller = dynamic_cast<PrescribedController*>( &controllerSet.get(0) );

I was wondering if it is also possible to access the controllerSet's PrescribedController Properties solely in Matlab?

Regards,

Lars

Tags:

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

Re: Casting controllersets in Matlab

Post by Thomas Uchida » Fri Jul 26, 2019 7:11 am

You can try the safeDownCast() method (there's a Matlab example on the "Common Scripting Commands" page in the Confluence documentation; search this page for "safeDownCast": https://simtk-confluence.stanford.edu:8 ... g+Commands).

User avatar
Lars Boers
Posts: 14
Joined: Thu Sep 06, 2018 2:23 am

Re: Casting controllersets in Matlab

Post by Lars Boers » Tue Jul 30, 2019 7:08 am

Hi Thomas,

Thanks for the reply, works perfectly!

Regards,

Lars

POST REPLY