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
How to change joint location
- Namrata Kaundal
- Posts: 9
- Joined: Fri Mar 18, 2016 4:03 am
Re: How to change joint location
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);
}
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);
}
- Michael Sherman
- Posts: 807
- Joined: Fri Apr 01, 2005 6:05 pm
Re: How to change joint location
Namrata, are you thinking this is the OpenSimulator forum? This is a forum for the similarly-named but unrelated OpenSim biomechanics package.