question

Troy avatar image
0 Likes"
Troy asked Troy commented

BasicTE goes wrong position

I tried to control the basicTE movement, so it could be works like an operator, but it goes the wrong position. I think something went wrong somewhere, any help?

1685069051134.png

basicTE Kinematics.fsm

FlexSim 22.2.0
kinematicsbasicte
1685069051134.png (100.0 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Troy commented

The location of the item is its position in its container - the queue or source.

To get the position in the same space as the BasicTE you should use:

token.item.location.project(token.item.up,token.op.up) 

and from that you read the x,y and z attributes.

But you need to tell the BasicTE the vector it needs to translate through which is the target position - the current position:

Vec3 itemLoc=token.item.location.project(token.item.up,token.op.up);
Vec3 translation=itemLoc-token.op.location;
double x=translation.x;
double y=translation.y;
double z=tranlation.z;

In the attached model I've added the translation label to the token and referred to that in the kinematic.

basicte-kinematics_jl.fsm


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Troy avatar image Troy commented ·

Thank you very much, it works like a charm!

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.