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?
Register ExpressionBasedCoordinateForce
- Jonathan Mortensen
- Posts: 32
- Joined: Wed Jul 06, 2016 1:33 pm
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Register ExpressionBasedCoordinateForce
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
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>
- Jonathan Mortensen
- Posts: 32
- Joined: Wed Jul 06, 2016 1:33 pm
Re: Register ExpressionBasedCoordinateForce
Is there any way to register it, or will this be fixed in the future?
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: Register ExpressionBasedCoordinateForce
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
https://simtk-confluence.stanford.edu:8 ... n+Analysis