Express GHReactions Global ResultantForce into Local RefFrame

Hi there,

I’m working with the shoulder model (AMS 4.0.2). I want to express the global resultant force of GHReactions into a plane aligned with the glenoid fossa, also aligned with the plane used to create the EdgeNodes/EdgeMuscles (let’s call it MyLocalRefFrame). I use the following code to do it :

AnyVec3 FTotalGlobal=F1+F2+F3+F4+F5+F6+F7+F8;

AnyVec3 ResForceLocal = (…Seg.Scapula.gh.MyLocalRefFrame.Axes’*…Jnt.GHReactions.ResultanForce.FTotalGlobal’)’;

// GLOBAL VECTOR DEFINITION

AnyDrawVector DrawFTotal = {

  AnyRefFrame &ref=....Seg.Humerus.gh;
  
  Vec =Main.DrawSettings.DrawSettingsSupport.Lin.ScaleFactor*.FTotalGlobal;
  
  GlobalCoord = On;
  
  PointAway = On;
  DrawCoord = Off;
  
  Line.RGB = {0,1,1};//Main.DrawSettings.DrawSettingsSupport.Lin.RGB;
  Line.Thickness = 0.5*Main.DrawSettings.DrawSettingsSupport.Lin.Thickness;
  Line.End.Thickness = 1*Main.DrawSettings.DrawSettingsSupport.Lin.Thickness;  
  Line.End.Length = 2*Main.DrawSettings.DrawSettingsSupport.Lin.Thickness;
};

// END GLOBAL

// LOCAL VECTOR DEFINITION
AnyDrawVector ResForceLocalVec = {

AnyRefFrame &ref= Seg.Scapula.gh.MyLocalRefFrame;

Vec =Main.DrawSettings.DrawSettingsSupport.Lin.ScaleFactor*.ResForceLocal;

GlobalCoord = Off;

PointAway = Off;
DrawCoord = Off;

Line.RGB = {0,0,1};
Line.Thickness = 0.5Main.DrawSettings.DrawSettingsSupport.Lin.Thickness;
Line.End.Thickness = 1
Main.DrawSettings.DrawSettingsSupport.Lin.Thickness;
Line.End.Length = 2*Main.DrawSettings.DrawSettingsSupport.Lin.Thickness;
};
// END LOCAL

However, when I look (see attached snapshot) at both global (cyan) and local resultant forces (blue), I do not get the exact same vectors, but rather a slight difference in orientation, and this difference do not change over time.

Can you help me with that ?

Pierre

Hi Pierre

Please try to check the numbers of the vectors… if these are similar

At some point there was an update problem with the AnyDrawVector… it was visually one time-step behind in some cases…

I think AMS 4.0.2 had this issue and i just want to rule this possibility out as the cause of the problem

Best regards
Søren

Hi Soren,

How can I do this check ? I have a set of coordinates that is global and another one that is local. The XYZ coordinates will be different for sure. If you say that this is a visualization issue, there is no problem for me. I just wanted to be sure that the values were valid.

Thank you

Pierre

Hi Pierre

Please try to convert the coordinates into the same coordinate system, then compare the numbers.

I can not guarantee that it is just a visible issue, but the numbers will confirm this or not.

Best regards
Søren