Parameter Optimization Error in Making Things Move tutorial

Hi,

While following the tutorial, I have an error during parameter optimization as follows.


  1. Evaluating the objective function (Operation: Main.KinOpt.ParameterOptimization):
    ERROR(SYS1) : Operation : Unknown error : ‘No Class Information’

I exactly copied and pasted the code in the tutorial and Kinematics was absolutely not a problem. but the error occured in first iteration during parameter optimization.
AnyBody Version is 7.0. and 7.2.1.

I’d like to know how to solve this problem.

Thanks in advance.

Best regards,
Doyoung

Hi Doyoung,

Does this problem repeat after reloading? Sometimes this message does not repeat.
Secondly, could you be a little more specific about what part of tutorial you are talking about and which step caused the problem?

Did you try to do the tutorial from scratch again?

Kind regards,
Pavel

Hi Pavel,

Yes, I tried from scratch and it always repeats. Here’s my model I tried.

// Todo: Write a small description of your model here

Main = {
  
  // The actual body model goes in this folder
  AnyFolder MyModel = {
    
    // Global Reference Frame
    AnyFixedRefFrame GlobalRef = {
      
      // Todo: Add points for grounding of the model here
      
    };
    
    // Todo: Add the model elements such as
    //       segments, joints, and muscles here.
    AnySeg Leg = {
      Mass = 1;
      Jii = {1, 0.01, 1}/15;
      AnyRefNode Joint = {
        sRel = {0, 0.45, 0};
      };
      AnyRefNode R1 = {
        sRel = {0.038, 0.18, 0.022};
      };
      AnyRefNode R2 = {
        sRel = {-0.015, -0.104, 0.028};
      };
      AnyRefNode R3 = {
        sRel = {-0.022, -0.403, -0.023};
      };
      AnyDrawSeg drw = {
        Opacity = 0.5;
      };
    };
    
    AnyInputC3D C3D = 
    {
      FileName = "multiple.c3d";
      //ReadAllDataOnOff = On;
      //TruncateExtraCharsInNamesOnOff = On;
      //MakeNameUniqueStr = "_";
      //PointsScaleFactor = 1.0;
      //ConstructModelOnOff = On;
      ConstructChartOnOff = Off;
      //ConstructWeightFunUsingResidualOnOff = Off;
      //GapFillUsingResidualsOnOff = Off;
      //MarkerUseAllPointsOnOff = Off;
      //MarkerUseCamMaskOnOff = On;
      //MarkerIndices = ;
      //MarkerLabels = ;
      //MarkerFilterIndex = 0;
      //ProcessedDataFilterIndex = 0;
      //AnalogFilterIndex = -1;
      /*Filter = 
      {
      z0 = ;
      AutomaticInitialConditionOnOff = On;
      FilterForwardBackwardOnOff = On;
      N = 2;
      W = ;
      Fs = 0.0;
      Fc = {10.0};
      Type = LowPass;
      };*/
      //WeightThreshold = 0.0;
      //WeightOutput = {{0.0, 1.0}, {0.0, 1.0}, {0.0, 1.0}};
      //WeightTransitionTime = 0.1;
      //SearchAndReplace = ;
      //WriteMarkerDataToFilesOnOff = Off;
      //MarkerScaleXYZ = {0.025, 0.025, 0.025};
      //MarkerRGB = {0.65, 0.65, 0.65};
      //MarkerDrawOnOff = On;
      //MarkerInterPolType = Bspline;
      //MarkerBsplineOrder = 4;
    };
    
    //    AnyRevoluteJoint Joint = {
    //      AnyRefFrame &Ground = .GlobalRef;
    //      AnyRefFrame &Pendulum = .Leg.Joint;
    //    };
    
    
    AnyKinDriverMarker C3Dmotion1 = {
      AnyRefFrame &Marker = .Leg.R1;
      AnyParamFun &Trajectory=
      Main.MyModel.C3D.Points.Markers.L000.PosInterpol;
      AnyDrawKinMeasure drw = {
        Label = Off;Size = 0.03;Line = Off;
      };
    };
    AnyKinDriverMarker C3Dmotion2 = {
      AnyRefFrame &Marker = .Leg.R2;
      AnyParamFun &Trajectory =
      Main.MyModel.C3D.Points.Markers.L001.PosInterpol;
      AnyDrawKinMeasure drw = {
        Label = Off;Size = 0.03;Line = Off;
      };
    };
    AnyKinDriverMarker C3Dmotion3 = {
      AnyRefFrame &Marker = .Leg.R3;
      AnyParamFun &Trajectory =
      Main.MyModel.C3D.Points.Markers.L002.PosInterpol;
      AnyDrawKinMeasure drw = {
        Label = Off;Size = 0.03;Line = Off;
      };
    };
    
  };//My Model
  
  // The study: Operations to be performed on the model
  AnyBodyStudy MyStudy = {
    AnyFolder &Model = .MyModel;
    Gravity = {0.0, -9.81, 0.0};
    AnyIntVar FirstFrame = Main.MyModel.C3D.Header.FirstFrameNo;
    AnyIntVar LastFrame = Main.MyModel.C3D.Header.LastFrameNo;
    tStart = FirstFrame/Main.MyModel.C3D.Header.VideoFrameRate+2*Kinematics.ApproxVelAccPerturb;
    tEnd = LastFrame/Main.MyModel.C3D.Header.VideoFrameRate-2*Kinematics.ApproxVelAccPerturb;
    InitialConditions.SolverType = KinSolOverDeterminate;
    Kinematics.SolverType = KinSolOverDeterminate;
  };
  
  AnyOptKinStudy OptKinStudy = 
  {
    //LogFile = "";
    Analysis = 
    {
      //      Settings = 
      //      {
      //        Echo = On;
      //        ModelSceneUpdate = On;
      //        DisplayPriority = PriorityNormal;
      //        SelectOnLoad = Off;
      //      };
      AnyOperation &Operation= ..MyStudy.Kinematics;
    };
    //MaxIterationStep = 100;
    //AnyDesMeasure &<Insert name0> = <Insert object reference (or full object definition)>;
    //AnyDesMeasure &<Insert name1> = <Insert object reference (or full object definition)>; You can make any number of these objects!
    AnyDesVar Jointx = {
      Val = Main.MyModel.Leg.Joint.sRel[0];
    };
    AnyDesVar Jointy = {
      Val = Main.MyModel.Leg.Joint.sRel[1];
    };
    AnyDesVar Jointz = {
      Val = Main.MyModel.Leg.Joint.sRel[2];
    };
  };
  
  
}; //Main

I don’t exactly know what the problem is. Please give me your opinion.
Thanks in advance.

Best regards,
Doyoung

It needs an objective function. You should add an AnyDesMeasure object as in the tutorials.

Regards, Pavel

Then, I guess AnyDesMeasure section was missing in this tutorial.
But I remember that I didn’t need to add AnyDesMeasure when I started this model for the first time last year.

[https://anyscript.org/tutorials/Making_things_move/lesson4.html?highlight=anyoptkinstudy]

Could you let me know some example to define objective function using AnyDesMeasure?

Best regards,
Doyoung

Hi Pavel

The AnyKinOptStudy does not require an objective function. It is always minimizing the least-square error on the soft kinematic constaints. It must be something else in the model or an anybody bug.

Best regards
Michael

1 Like

@msan00 Michael, you are right. It is not an AnyOptStudy, which I thought it was, when quickly scrolled through code snippet. Could you spot the problem? I don’t seem to see anything except differences in Filter definition and missing revolute joint as opposed to the tutorial.

@dypark I tried running it (your code did miss a few lines from the tutorial, including the fixation to the global ref. frame through a revolute joint), but it does indeed fail repeatedly even with corrections. We will be looking into the problem, thanks for noticing and asking.

Kind regards,
Pavel

Dear Pavel,

@msan00 Thanks for your advice.
@pgalibarov Thanks for your reply.

Best regards,
Doyoung

Hi again

I think it is the Fs setting in filter. It should not be possible to set the sampling frequency at all as it is given by the c3d data - and especially not setting it to zero. Try removing that line.

Best regards
Michael

Dear msan00,

Thanks for your reply. But as you see in my code above, I haven’t used any filter option.

Best regards,
Doyoung

I have this same problem following the instructions for the same tutorial https://anyscript.org/tutorials/Making_things_move/lesson4.html.

My filter parameters are the following:
Filter =
{
AutomaticInitialConditionOnOff = On;
FilterForwardBackwardOnOff = On;
N = 2;
Fc = {3};
Type = LowPass;
};
Has a solution been found yet?

Unfortunately it is a minor bug that is now in the bug-tracking system - it will be fixed asap.

Here is a workaround - add these lines in your model and run the new operation instead:

AnyOperationSequence RunParameterOptimization = {
AnyOperation &run = Main.OptKinStudy.ParameterOptimization;
};

Kind regards,
Pavel

Thanks, that workaround works for me.