Torque Actuator axis of action
Posted: Fri Oct 09, 2020 5:56 am
Hello all,
I'm just getting started with OpenSim and I'm building a very simple model to try to simulate the effects of different inertial properties on simple motion. I have created a single, free body and I'd like to apply a torque about a single axis -- observing the angular velocity after a certain period of time.
One of the things I'm interested in is the effect offset mass on rotation. To do this, I'm specifying the centre of mass location of the body, setting up a free joint with ground and then creating a torque actuator.
However, it seems that the angular velocity of the body is independent of mass offset. I would expect angular velocity to decrease as the centre of mass moves away from the torque axis.
My suspicion is that I'm setting things up incorrectly and the torque is acting around the bodies centre of mass. However, it's not clear to me how to change this!?
Any help greatly appreciated. I've included some code below.
I have omitted the code regarding the controller and reporting etc.
Thanks for your time,
Wiredchop
I'm just getting started with OpenSim and I'm building a very simple model to try to simulate the effects of different inertial properties on simple motion. I have created a single, free body and I'd like to apply a torque about a single axis -- observing the angular velocity after a certain period of time.
One of the things I'm interested in is the effect offset mass on rotation. To do this, I'm specifying the centre of mass location of the body, setting up a free joint with ground and then creating a torque actuator.
However, it seems that the angular velocity of the body is independent of mass offset. I would expect angular velocity to decrease as the centre of mass moves away from the torque axis.
My suspicion is that I'm setting things up incorrectly and the torque is acting around the bodies centre of mass. However, it's not clear to me how to change this!?
Any help greatly appreciated. I've included some code below.
Code: Select all
%Body
r1 = Body('rod1', M, Vec3(COM(1),COM(2),COM(3)), Inertia(I(1),I(2),I(3),I(4),I(5),I(6)));
model.addBody(r1);
% Joint
% Situating the free joint in the centre off the segment
p1 = FreeJoint('pin1', model.getGround(), Vec3(0,2,0), Vec3(0), r1, Vec3(0,L/2,0), Vec3(0));
model.addJoint(p1);
% Attach geometry to the bodies
g = Cylinder(0.1,L); g.setColor(Vec3(1));
r1b = PhysicalOffsetFrame(); r1b.setName('r1b');
r1b.setParentFrame(r1); r1b.setOffsetTransform(Transform(Vec3(0, 0.0, 0)));
r1.addComponent(r1b); r1b.attachGeometry(g.clone());
%% Add a Torque Actuator
torqueActuator = TorqueActuator(model.getGround(),r1,Vec3(0,1,0),1);% Create a TorqueActuator Object
torqueActuator.setOptimalForce(10);
torqueActuator.setName('Torque');
model.addForce(torqueActuator);
Thanks for your time,
Wiredchop