How to change joint location

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
mohamad mahdavian
Posts: 28
Joined: Tue Mar 04, 2014 11:47 am

How to change joint location

Post by mohamad mahdavian » Sat Dec 19, 2015 8:39 am

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

User avatar
Namrata Kaundal
Posts: 9
Joined: Fri Mar 18, 2016 4:03 am

Re: How to change joint location

Post by Namrata Kaundal » Fri Mar 18, 2016 6:17 am

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);
}

User avatar
Michael Sherman
Posts: 801
Joined: Fri Apr 01, 2005 6:05 pm

Re: How to change joint location

Post by Michael Sherman » Fri Mar 18, 2016 8:16 am

Namrata, are you thinking this is the OpenSimulator forum? This is a forum for the similarly-named but unrelated OpenSim biomechanics package.

POST REPLY