Code: Select all
Error using BGSM (line 269)
Java exception occurred:
java.lang.RuntimeException: ArrayPtrs.get(aName): No object with name r_pelvis
at org.opensim.modeling.opensimSimulationJNI.SetBodies_get__SWIG_1(Native Method)
at org.opensim.modeling.SetBodies.get(SetBodies.java:149)
Here is my code:
Code: Select all
pelvis = Body(); % Creates a body
massCenter = Vec3(-0.0707,0.0,0.0); % Create a Vec3 Object with mass center information
inertia = Inertia(0.128, 0.0871, 0.0579, 0, 0, 0); % Create an Inertia object with only principal axes
pelvis.setName('Pelvis'); % Set the name of the body
pelvis.setMass(pelvisMass); % Set the mass of the body
pelvis.setMassCenter(massCenter); % Set the mass center
pelvis.setInertia(inertia); % Set the body's inertia
r_pelvis = model.getBodySet().get('r_pelvis');
pelvis = pelvis.attachGeometry(pelvis);
osimModel.addBody(pelvis);
Any help would be much appreciated. Thank you in advance!