# Draw the Center of Mass position during Analysis

Hi everyone,
is it possible to visualize the center of mass position in the model
view, similar to ‘AnyDrawNode’, for the whole body during inverse
dynamic analysis?

Peter

Hi Peter

Yes this is possible to do so but you need a few more lines and a dummy
segment.

AnyKinCoM massmeasure ={

};

AnySeg dummyseg={

Mass=0;

Jii={0,0,0};

AnyDrawNode drw={ ScaleXYZ={1,1,1}*0.2; RGB={0,0,1};};

};

AnyKinLinear lin={

AnyFixedRefFrame &ref=.GlobaRef;

AnySeg 6ref2=.dummyseg;

};

//this will drive the massmeasure and the lin measure to be identical

//which will ensure that the pos of the dummy seg is positioned at the CoM

AnyKinEq Driver ={

AnyKinLinComb lincomb={

AnyKinLinear &ref1 =…lin;

AnykinCoM &ref2 =…massmeasure;

Coef={{1,-1},{1,-1},{1,-1}}; //lin(x,y,z) = massmeasure(x,y,z) };

};

In addition the rotations of the dummyseg needs to be driven to zeroâ€¦

Hope it works there might be minor errors… It was not testes

Best regards

SÃ¸ren, AnyBody Support

From: anyscript@yahoogroups.com [mailto:anyscript@yahoogroups.com] On Behalf
Of peter.belei
Sent: 02 October 2008 18:09
To: anyscript@yahoogroups.com
Subject: [AnyScript] Draw the Center of Mass position during Analysis

Hi everyone,
is it possible to visualize the center of mass position in the model
view, similar to ‘AnyDrawNode’, for the whole body during inverse
dynamic analysis?

Peter

[Non-text portions of this message have been removed]

Hi SÃ¸ren,
Thanks a lot for your help. I finally corrected the minor errors ;)…
Here is my solution, and it works:

AnyKinCoM massmeasure= {
AnyFolder &Body = .HumanModel;
};

`````` AnySeg dummyseg={
Mass=0;
Jii={0,0,0};
AnyDrawNode drw={ ScaleXYZ={1,1,1}*0.05; RGB={1,0,0};};
};

AnyKinLinear lin={
AnyFixedRefFrame &ref1=.Environment.GlobalRef;
AnySeg &ref2=.dummyseg;
};

//this will drive the massmeasure and the lin measure to be identical

//which will ensure that the pos of the dummy seg is positioned at
``````

the CoM

`````` AnyKinEq Driver ={
AnyKinMeasureLinComb lincomb={
AnyKinLinear &ref1 =..lin;
AnyKinCoM &ref2 =..massmeasure;
Coef={{1,0,0,-1,0,0},{0,1,0,0,-1,0},{0,0,1,0,0,-1}};
``````

//lin(x,y,z) = massmeasure(x,y,z) };
};
};

`````` AnyKinMeasureOrg DummySegRotX={
AnyKinRotational rot ={
AnySeg &ref =..dummyseg;
Type=RotAxesAngles;
};
MeasureOrganizer={0};
};
AnyKinMeasureOrg DummySegRotY ={
AnyKinRotational &ref=.DummySegRotX.rot;
MeasureOrganizer={1};
};
AnyKinMeasureOrg DummySegRotZ ={
AnyKinRotational &ref=.DummySegRotX.rot;
MeasureOrganizer={2};
};

AnyKinEqSimpleDriver dummysegdriver =
{
AnyKinMeasureOrg &ref1 = .DummySegRotX;
AnyKinMeasureOrg &ref2 = .DummySegRotY;
AnyKinMeasureOrg &ref3 = .DummySegRotZ;
DriverPos = {0,0,0};
DriverVel = {0,0,0};
};
``````

Best regards,
Peter

— In anyscript@yahoogroups.com, AnyScript Support <anyscriptsup@…>
wrote:
>
> Hi Peter
>
>
>
> Yes this is possible to do so but you need a few more lines and a dummy
> segment.
>
>
>
> AnyKinCoM massmeasure ={
>
>
> };
>
>
>
> AnySeg dummyseg={
>
> Mass=0;
>
> Jii={0,0,0};
>
> AnyDrawNode drw={ ScaleXYZ={1,1,1}*0.2; RGB={0,0,1};};
>
> };
>
>
>
> AnyKinLinear lin={
>
> AnyFixedRefFrame &ref=.GlobaRef;
>
> AnySeg 6ref2=.dummyseg;
>
> };
>
>
>
> //this will drive the massmeasure and the lin measure to be identical
>
> //which will ensure that the pos of the dummy seg is positioned at
the CoM
>
> AnyKinEq Driver ={
>
> AnyKinLinComb lincomb={
>
> AnyKinLinear &ref1 =…lin;
>
> AnykinCoM &ref2 =…massmeasure;
>
> Coef={{1,-1},{1,-1},{1,-1}}; //lin(x,y,z) = massmeasure(x,y,z) };
>
> };
>
>
>
> In addition the rotations of the dummyseg needs to be driven to zeroâ€¦
>
>
>
> Hope it works there might be minor errors… It was not testes
>
>
>
> Best regards
>
> SÃ¸ren, AnyBody Support
>
>
>
>
>
>
>
>
>
>
>
>
>
> _____
>
> From: anyscript@yahoogroups.com [mailto:anyscript@yahoogroups.com]
On Behalf
> Of peter.belei
> Sent: 02 October 2008 18:09
> To: anyscript@yahoogroups.com
> Subject: [AnyScript] Draw the Center of Mass position during Analysis
>
>
>
> Hi everyone,
> is it possible to visualize the center of mass position in the model
> view, similar to ‘AnyDrawNode’, for the whole body during inverse
> dynamic analysis?
>