Model is kinematically over-constrained

Hey Anybody,

I am trying to model a golf swing. I have two problems.

  1. I connected the right hand to the golf club using these lines:

    AnyKinEqSimpleDriver Right_hand_attach =
    {
    AnyKinLinear lin =
    {
    Ref = 0;
    AnyRefNode& base = Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Hand.cluboriginR;
    AnyRefNode& target = ..dummyseg.P1;
    };
    AnyKinRotational rot =
    {
    AnyRefNode& base = Main.HumanModel.BodyModel.Right.ShoulderArm.Seg.Hand.cluboriginR;
    AnyRefNode& target = ..dummyseg.P1;
    Type = RotAxesAngles;
    };
    DriverPos = {0,0,0,0,0,0};
    DriverVel = {0,0,0,0,0,0};
    Reaction.Type = {On, On, On, On, On, On};
    };

This works fine. But when I try to connect the left hand to the same node using the similar code, it gives me the Model is kinematically over-constrained error. How can I fix this?

  1. There is a marker on the golf club. When I connect this marker to a node on the club, it gives me the over-constrained error. These are the lines:

AnyKinDriverMarker Motion =
{
Linear.Ref = 0;

AnyRefFrame &marker = .dummyseg.P3;
AnyParamFun &Trajectory = Main.ModelSetup.C3DFileData.Points.Markers.BFR2.PosInterpol;

Reaction.Type = {On,On,On};
};

untitled

Hi Ali,

Welcome to the AnyScript forum!

If you would like to model golf swing, I would like to point you to our recent addition of marker-driven sports models, where you would also find golf: GitHub - AnyBody/vicon-mocap-examples: AnyBody models, using Vicon Nexus Sample Data

There is also an associated webcast.

You can consider starting from the golf model and using your own data.

As far as the errors are concerned, it is normal that if you try to add drivers connecting the golf club to the right hand in 6 dof, then to the left hand in 6 dof, and then also drive it using marker data, you have basically added 15 constraints to the golf club when it really needs 6. That is why you see the over constrained error because all these constraints are not going to be perfectly consistent with each other. I suggest you pick 6 constraints that you are confident of and don't use the others. So, three could come from the marker, and 3 could come from the hand, but it's up to you. Alternatively, you could add soft drivers and over-constraint the system. But the inverse dynamics study would also need to be updated to use the over determinate solver.

Best regards,
Dave

Hi Dave,

Thanks for your response.

I connect the left hand similarly and define the driver as Soft. Then add these lines to the end of InverseDynamicSettings.any to over-constrain the solver:

 InitialConditions.SolverType = KinSolOverDeterminate;
 Kinematics.SolverType = KinSolOverDeterminate;

Now, the model works. :blush:

Hi Ali,

That's great! Thanks for the feedback :slight_smile:

Best regards,
Dave

This topic was automatically closed 125 days after the last reply. New replies are no longer allowed.