Page 1 of 1

Register ExpressionBasedCoordinateForce

Posted: Wed Jun 27, 2018 4:11 pm
by jonmortensen
Hello,
I am able to add an ExpressionBasedCoordinateForce with MATLAB scripting, but when I open it in the GUI I get this message:

Object::newInstanceOfType(): object type 'ExpressionBasedCoordinateForce' is not a registered Object!
Object type ExpressionBasedCoordinateForce not recognized

Was this class never finished or fully implemented? The other expression based forces (bushing and point to point) seem to work fine, it is just the ExpressionBasedCoordinateForce. MATLAB scripting creates an object in the XML that looks like this:

<ExpressionBasedCoordinateForce name="PJ">
<!--Coordinate (name) to apply force to.-->
<coordinate>pitch1</coordinate>
<!--Expression of the force magnitude as a function of the coordinate value (q)and its time derivative (qdot). Note, expression cannot have any whitespaceseperating characters-->
<expression>q+2</expression>
</ExpressionBasedCoordinateForce>

Can anyone tell me why I am unable to use this object in the GUI?

Re: Register ExpressionBasedCoordinateForce

Posted: Thu Jun 28, 2018 12:45 am
by mitkof6
You are right it seems that ExpressionBasedCoordinateForce is not registered so you can't use it in the GUI.

https://github.com/opensim-org/opensim- ... lation.cpp

You may try to model the force using other types of expression based forces, e.g. please see the models in this link which make use of ExpressionBasedBushingForce:

https://github.com/msdemers/landing-opt ... itialFiles

Code: Select all

<Mx_expression>9.52095038*theta_x-29.57608094*theta_x^2+169.01588105*theta_x^3</Mx_expression>

Re: Register ExpressionBasedCoordinateForce

Posted: Thu Jun 28, 2018 6:44 am
by jonmortensen
Is there any way to register it, or will this be fixed in the future?

Re: Register ExpressionBasedCoordinateForce

Posted: Fri Jun 29, 2018 1:00 am
by mitkof6
Yes. You can create your own plugin [1]. You don't have to re-implement the ExpressionBasedCoordinateForce, but only to register it in RegisterTypes_osimPlugin.

https://simtk-confluence.stanford.edu:8 ... n+Analysis