error related to InitWrapPosVecArr

Hi,

I want to use AnyShortestPathMuscle for wrapping

I added 3 refnode and 1 segment ( origin, Ins1, Via point, and segment).

and I added InitWrapPosVecArr for initial condition, but i got this message.

WARNING(OBJ1) : E:/1…s/A…y/A…s/A…e/C…s/AnyShortestPathMuscle.any(134) : Muscle1.SPLine.InitWrapPosVecArr : One array of 3D vector is expected for each segment of the string in AnyKinSPLine.

and start operation doesn’t work.
ERROR(SYS1) : Operation : Unknown error : ‘No Class Information’

how can I solve this problem? thank you

below is total example code

#define MUSCLE1_VIA_POINT // Extends the example with a via-point for the muscle

Main = {

// The actual body model goes in this folder
AnyFolder MyModel = {

// Global Reference Frame
AnyFixedRefFrame GlobalRef = {
  // AnyDrawRefFrame drw={ RGB = {0,0,1}; };
  
  
  AnyRefNode CylNode ={
    sRel={0,0,-0.05};  
    AnySurfCylinder Cyl={
      Length=0.30;
      //Try to play around with the radius of the cylinder 
      //Look at the variable Main.Model.Muscle.LmtDot in the chart window 
      //When the muscle is wrapped around the cylinder LmtDot will have the 
      //size of the cylinder
      Radius=0.05;//Radius of the cylinder
      AnyDrawParamSurf drw={};
      AnyDrawRefFrame drw1 = {};
    };
    
    AnyRefNode SurfaceNode ={
      sRel={.Cyl.Radius+0.0001,0,0.1};
      // AnyDrawRefFrame drw={ ScaleXYZ={1,1,1}*0.2; };
    };
    
  };
  
  //Mucle node 
  AnyRefNode MuscleNode ={
    sRel={0.3,-0.03,0};
    //Make a blue coordinate system at the node 
    AnyDrawNode Drw={RGB={0,0,1}; ScaleXYZ={0.01,0.01,0.01};};
    
  };
  
  AnyRefNode MuscleNod ={
    sRel={-0.2,0.2,0};
    //Make a blue coordinate system at the node 
    AnyDrawRefFrame Drw={RGB={0,0,1}; ScaleXYZ={0.1,0.1,0.1};};
    
  };
  
  
};  // Global reference frame

//make a segment
AnySeg Segment ={
  r0={0.25,0,0};
  Mass=1000;
  Jii={0.1,0.1,0.1};
  AnyDrawSeg drw={RGB={0,0,1};};
  AnyRefNode node1 = {sRel={-0.5,0,0};};
  AnyRefNode node2 = {sRel={0.0,0,0};};
  
};

//make a revolute joint
AnyRevoluteJoint Joint ={
  AnyRefNode &ref1=.Segment.node1;
  AnyFixedRefFrame &ref2=.GlobalRef;
  Axis=z;
};

//make a driver
AnyKinEqSimpleDriver Driver ={
  AnyRevoluteJoint &ref1= .Joint;
  DriverPos={pi};
  //Set the velocity to 1 in oder to be able to measure 
  //Set the velocity to 1 in oder to be able to measure 
  DriverVel={1.0}; 
  Reaction.Type={Off};
};

//Muscle strenght model
AnyMuscleModel MuscleMdl={
  F0=3000; 
};


AnyShortestPathMuscle  Muscle1 = {
  AnyMuscleModel &MusMdl = .MuscleMdl;
  
  AnyRefNode &Org = .GlobalRef.MuscleNode;
  AnyRefNode &Via1 = .GlobalRef.MuscleNod;
  
  // AnyRefNode &Via2 = Main.MyModel.GlobalRef.CylNode.SurfaceNode;
  AnyRefNode &Ins = Main.MyModel.Segment.node2;
  AnyDrawMuscle DrwMus = {Bulging = 1;};
  AnySurfCylinder &Surf1 = .GlobalRef.CylNode.Cyl;//reference to the cylinder
  //
  SPLine = {
            
    StringMesh = 25;
    AnyMatrix InitWrapPos = {
      
    transf3D({ 0.05, 0, 0}, &.Surf1 ),
    transf3D({ 0, 0.05, 0}, &.Surf1 ),
    transf3D({ -0.5, 0, 0}, &.Surf1 )
      
    };
    InitWrapPosVecArr = {&InitWrapPos };
    
  
  
  
  
};//SPLine

};//Muscle1
}; // MyModel

// The study: Operations to be performed on the model
AnyKinStudy MyStudy = {
AnyFolder &Model = .MyModel;
//RecruitmentSolver = MinMaxSimplex;
Gravity = {0.0, -9.81, 0.0};
tEnd=2*pi;

Kinematics.SmallStepAssumptionOnOff = Off;

};

}; // Main

Hi Hans,

Please to modify the lines like this


 SPLine = {
        
        StringMesh = 25;
        AnyMatrix InitWrapPos_1 = {
          { 0.05, 0, 0},
          { 0.05, 0, 0},
          { 0, 0.05, 0}
        };
        
        AnyMatrix InitWrapPos_Via = {
          { 0.05, 0, 0}
        };
        
        
        AnyMatrix InitWrapPos =           transf3D(  InitWrapPos_1, &.Surf1 );
        AnyMatrix InitWrapPos_via_trans =        transf3D(  InitWrapPos_Via, &.Surf1 );

        InitWrapPosVecArr = {&InitWrapPos, &InitWrapPos_via_trans };

        
      };//SPLine

The first three vectors relates to origin, insertation and the surface, the last point being added relates to the viapoint.

Please a have look in the reference manual there is a small example in the bottom of the page for the shortest-path muscle.

Hope it helps

Best regards
Søren

Thank you for your reply. I perfectly understand what it means.