Register ExpressionBasedCoordinateForce

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Jonathan Mortensen
Posts: 32
Joined: Wed Jul 06, 2016 1:33 pm

Register ExpressionBasedCoordinateForce

Post by Jonathan Mortensen » Wed Jun 27, 2018 4:11 pm

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?

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Register ExpressionBasedCoordinateForce

Post by Dimitar Stanev » Thu Jun 28, 2018 12:45 am

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>

User avatar
Jonathan Mortensen
Posts: 32
Joined: Wed Jul 06, 2016 1:33 pm

Re: Register ExpressionBasedCoordinateForce

Post by Jonathan Mortensen » Thu Jun 28, 2018 6:44 am

Is there any way to register it, or will this be fixed in the future?

User avatar
Dimitar Stanev
Posts: 1096
Joined: Fri Jan 31, 2014 5:14 am

Re: Register ExpressionBasedCoordinateForce

Post by Dimitar Stanev » Fri Jun 29, 2018 1:00 am

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

POST REPLY