question

Steven Chen avatar image
0 Likes"
Steven Chen asked tannerp commented

How to set AGV project-oriented fix

Hello,

How to keep the item on the AGV in the same direction without changing the direction of the item because of any AGV turning.


Thank you in advance,

FlexSim 20.1.2
agvflexsim 20.1.2
· 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.

tannerp avatar image tannerp commented ·

Hi @steven.chen, was my answer helpful? If so, please click the red "Accept" button on the answer. Otherwise, feel free to comment back with more information so we can help. Thanks!

0 Likes 0 ·

1 Answer

·
tannerp avatar image
0 Likes"
tannerp answered

@steven.chen,

One way to do this would be to add the following code to the AGV's "On Draw" trigger.

if(current.subnodes.length > 0)    {
    for(int i = 1; i <= current.subnodes.length; i++)    {
        current.subnodes[i].as(Object).rotation.z = 0 - current.rotation.z;
    }
}

This constantly changes the orientation of the object to be 0 minus the current rotation of the AGV. So, when the AGV is rotated 90 degrees, the item is rotated -90, or 0. Likewise, when an AGV is rotated -90 degrees, the item is rotated +90, or 0.

Here's the model that I built as an example. Let me know if this helps.

agv fix rotation.fsm


agv-fix-rotation.fsm (111.2 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.

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.