--- a +++ b/Tools/ModelUtilities/FootConnections/CreateFootConnectionClasses.any @@ -0,0 +1,60 @@ +#ifndef FOOTPRINT_NODE_NAME_1 + #define FOOTPRINT_NODE_NAME_1 ToeMedialContactNode +#endif +#ifndef FOOTPRINT_NODE_NAME_2 + #define FOOTPRINT_NODE_NAME_2 ToeLateralContactNode +#endif +#ifndef FOOTPRINT_NODE_NAME_3 + #define FOOTPRINT_NODE_NAME_3 HeelContactNodeLow +#endif +#ifndef FOOTPRINT_NODE_NAME_4 + #define FOOTPRINT_NODE_NAME_4 BigToeNode +#endif + +#class_template FootConnection_3Points(AnyFolder& RefFootPrintFolder, HeelLiftOffEnable) +{ + #var AnySwitch ReactionOnOff = Off; + #var AnyVar HeelLiftOffSoftConstraintWeight = 50.0/50; + + AnyKinEq Connection_Point1 = + { + AnyKinLinear lin = + { + AnyRefFrame &ref0 = ..RefFootPrintFolder.InternalInfo.Target.FOOTPRINT_NODE_NAME_1; + AnyRefFrame &ref1 = ..RefFootPrintFolder.InternalInfo.Source.FOOTPRINT_NODE_NAME_1; + Ref = 0; + }; + MeasureOrganizer = {0, 1, 2}; // Only the y, z coordinates + Reaction.Type = {.ReactionOnOff, .ReactionOnOff, .ReactionOnOff}; + }; + + AnyKinEq Connection_Point2 = + { + AnyKinLinear lin = + { + AnyRefFrame &ref0 = ..RefFootPrintFolder.InternalInfo.Target.FOOTPRINT_NODE_NAME_2; + AnyRefFrame &ref1 = ..RefFootPrintFolder.InternalInfo.Source.FOOTPRINT_NODE_NAME_2; + Ref = 0; + }; + MeasureOrganizer = {1, 2}; //y, z coordinates + Reaction.Type = {.ReactionOnOff, .ReactionOnOff}; + }; + + AnyKinEq Connection_Point3 = + { + AnyKinLinear lin = + { + AnyRefFrame &ref0 = ..RefFootPrintFolder.InternalInfo.Target.FOOTPRINT_NODE_NAME_3; + AnyRefFrame &ref1 = ..RefFootPrintFolder.InternalInfo.Source.FOOTPRINT_NODE_NAME_3; + Ref = 0; + }; + MeasureOrganizer = {1}; //y coordinate + Reaction.Type = {.ReactionOnOff}; + #if HeelLiftOffEnable == 1 + CType = {Soft}; + AnyFunConst ConstFun = { Value = {..HeelLiftOffSoftConstraintWeight}; }; + WeightFun = {&ConstFun}; + #endif + }; + +};