Page 1 of 1

How to change joint location

Posted: Sat Dec 19, 2015 8:39 am
by mohamadmah111
Hello. I need to change axis location of a joint. For example i am working on gait2392-simbody model and I need to change the location of knee axis for adduction.Could you help me?


Best

Re: How to change joint location

Posted: Fri Mar 18, 2016 6:17 am
by kohli
I set the MassData of box1 and now the upper (horizontal bar) is appearing where i wanted it to be but now the motor affect is not working


Windmill(float x, float y) {

// Initialize locations of two boxes
box1 = new Box(x-60, y-20, 120, 10, radians(0), 1, false);
box2 = new Box(x, y, 10, 40, 0, 1, true);

// New Code added
MassData md = new MassData();
md.center.set(box2d.scalarPixelsToWorld(60), box2d.scalarPixelsToWorld(0));
box1.body.setMassData(md);

// Define joint as between two bodies
RevoluteJointDef rjd = new RevoluteJointDef();
rjd.initialize(box1.body, box2.body, box1.body.getWorldCenter());

// Turning on a motor (optional)
rjd.motorSpeed = -PI*3; // how fast?
rjd.maxMotorTorque = 100000.0; // how powerful?
rjd.enableMotor = false; // is it on?

// Create the joint
joint = (RevoluteJoint) box2d.world.createJoint(rjd);
}

Re: How to change joint location

Posted: Fri Mar 18, 2016 8:16 am
by sherm
Namrata, are you thinking this is the OpenSimulator forum? This is a forum for the similarly-named but unrelated OpenSim biomechanics package.