Hello,
I’m new to AnyBody and I’ve run into a problem that I lack the knowledge to fix. I did learn a great deal going through all the tutorials but none of them specifically tackled the use of AnyDrawWidgetLin or AnyDrawWidgetLRot. I was trying to alter the JumpingJack example in AMMRV1.3.1, the one with the pull string using AnyDrawWidgetLin. I tried to make a simple model to use a pull string to cause a rotation around a joint. Though I thought I had dissected ever part of the JumpingJack example, I was unable to make my model work. The condensed program I made from the JumpingJack example is below. If I run the program as is and try to set the model into initial conditions AnyBody spits out a long list of:
Failed to resolve kinematic constraints. Newton relaxation too small. (final kin. error = 4.306968E-001)
Constraint no. 1 above error tolerance 0.000001, error = 0.000067.
Constraint no. 4 above error tolerance 0.000001, error = 0.000027.
etc, etc.
I did try several different initial positions of the drivers but none of them fixed this issue. If I remove the driver labelled ‘TendonDrv’ the kinematics works fine and I can drive the model with just the ‘MCPDrv’ driver. However, since I am most interested in understanding and getting the model to move using the pull string, a functional ‘TendonDrv’ driver is important.
Please can anyone help me to understand what is wrong and how to fix it?
Thank you,
Raymond King
University of Utah
Main = {
AnyOperationSequence RunApplication = {
AnyOperation &InvAnal=Main.Study.InverseDynamics;
};
AnyFolder MyModel = {
AnyFixedRefFrame GlobalRef = {
AnyRefNode HandleBase={
sRel={0,0,0};
};
}; // Global reference frame
AnySeg Body = {
r0 = {0, -.15, 0};
Mass=2;
Jii={0.01,0.001,0.01};
AnyDrawSeg drw ={ RGB = {1, 0, 0};};
AnyRefNode MCP = { sRel = {0,.15,0};};
AnyRefNode Nail = { sRel = {0,0,0};};
AnyRefNode Hook = { sRel = {0,0,-.03};};
};
AnySeg seg1 = {
r0 = {0, .15, 0};
Mass=2;
Jii={0.01,0.001,0.01};
AnyDrawSeg drw = { RGB = {0, 1, 0};};
AnyRefNode MCP = { sRel = {0,-.15,0};};
AnyRefNode PIP = { sRel = {0,.15,0};};
AnyRefNode BaseMCP = { sRel = {0,-.1,-.03};};
AnyRefNode BasePIP = { sRel = {0,.1,-.03};};
};
AnyFixedRefFrame Handle ={
Origin={0.000000, -0.399000, 0.000000};
AnyDrawSurf drw={
FileName =“handle”;
RGB={0,1,1};
};
};
AnyRevoluteJoint MCP = {
Axis = x;
AnyRefNode &FirstNode = .Body.MCP;
AnyRefNode &SecondNode = .seg1.MCP;
};
AnyKinEq NailBodyJnt={
AnyKinLinear lin ={
AnyRefFrame &ref1=…GlobalRef;
AnyRefFrame &ref2=…Body.Nail;
};
AnyKinRotational rot ={
AnyRefFrame &ref1=…GlobalRef;
AnyRefFrame &ref2=…Body.Nail;
Type=RotAxesAngles;
};
};
AnyFunConst WeightFun ={Value = {0.001};};
AnyKinEqSimpleDriver MCPDrv ={
AnyRevoluteJoint &ref=.MCP;
DriverPos={0};
DriverVel={0};
CType={Soft};
Reaction.Type={Off};
WeightFun={&.WeightFun };
};
AnyKinPLine Tendon ={
AnyRefNode &ref1=.seg1.BaseMCP;
AnyRefNode &ref2=.Body.Hook;
AnySeg &ref3=.Handle;
AnyDrawPLine drw={Thickness=0.0015; RGB={1,0,0};};
};
AnyKinEqSimpleDriver TendonDrv={
AnyKinPLine &ref1=.Tendon;
DriverPos={0};
DriverVel={0.0};
CType = {Soft};
};
AnyDrawWidgetLin handle = {
Operation = &Main.Study.Kinematics;
UpdateEvent = OnMouseRelease;
MaxDrawSize = 0.1;
MinDrawSize = 0.1;
RefFrame = &Main.MyModel.GlobalRef;
Target = &.Main.MyModel.Handle.Origin ;
AxisOnOff = {Off, On, Off};
};
}; // MyModel
AnyBodyStudy Study = {
AnyFolder &Model = .MyModel;
InitialConditions.SolverType = KinSolOverDeterminate;
Kinematics.SolverType = KinSolOverDeterminate;
Gravity = {0.0, -9.81, 0.0};
tEnd=10;
nStep=100;
};
}; // Main