Visualize the Center of Mass during Inverse Dynamics

Hi,

I would like to visualize the location center of mass during the inverse dynamics simulation of my dynamic trial (walking with and without the device). I am currently using the AMMR.v2.4.2 version. I would like to create/draw a sphere at the location of center of mass which should be visible and moving as the body progresses during the dynamic trial. I have used the following lines as suggested in a previous forum answer:

AnyFolder ShowCoM ={
 AnyKinCoM CoMMeasure =  {
          AnyFolder& ref = Main.HumanModel.BodyModel;
 };

AnyDrawSphere Sphere ={
RGB={0,0,1};
Position = .CoMMeasure.Pos;
ScaleXYZ={1,1,1}*0.2;
};
};

However, it created the sphere at one corner of the force plate and it doesn't move during the trial. I know, for AMMR model the center of mass property for the whole body can be located from CenterOfMass folder: Main.HumanModel.BodyModel.Interface.CenterOfMass, as the center of mass displacement, velocity and acceleration can be loacted here from Pos, Vel and Acc values. I am wondering how I should define this dummy sphere object to visualize the displacement of center of mass during the inverse dynamics run.

I highly appreciate your help. Have a great day!

Best regards,
Arif

Hi Arif,

Your code seems to be ok. The problem is probably that the code is not included in your inverse dynamics study. So, it's not evaluated as the simulation runs and you just see the sphere on the global ref. Please check if that is the case and wrap the code inside the inverse dynamics study.

Main = {
Studies.InverseDynamicStudy = {

AnyFolder ShowCoM ={
 AnyKinCoM CoMMeasure =  {
          AnyFolder& ref = Main.HumanModel.BodyModel;
 };

AnyDrawSphere Sphere ={
RGB={0,0,1};
Position = .CoMMeasure.Pos;
ScaleXYZ={1,1,1}*0.2;
};
};
};
};

Best regards,
Dave

Thank you very much, Dave. This works fine now.

Regards,
Arif