question

Nur Heppy H avatar image
0 Likes"
Nur Heppy H asked Joerg Vogel edited

how to change the position of each item when items are transported by AGV?

how to change the position of each item when items are transported by AGV?. I included a link to show how the simulation will run and the flexsim model that I made.

We can see in this link https://www.youtube.com/watch?v=rD9-scwjPA4 how the AGV works.

@matthew.gillespie

Op 1 FlexSim Warehouse Automation.fsm

FlexSim 20.2.1
task executertransporterflexsim 20.2.1position item
5 |100000

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

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joerg Vogel edited

Double click on the taskexecuter object. A list like structure opens to show the properties of the object. Look for triggers. Expand the triggers list entry. Look for a green plus icon to add triggers. Add an On Load trigger. Now you will have created a trigger. At the trigger you look for a parchment roll icon on the right to open the source code, because you need to do some coding.

Basic knowledge of object tree structure: Any loaded item is becoming a subnode of an object. If you want to know if an object is empty or has already got some content, you can get the value of content by the property length on the subnodes of the object. In a trigger is the reference to the object that is triggered called “current”.

current.subnodes.length

Gets you the number of subnodes (here items) of current. Another reference or pointer in the trigger is “item“. It is a reference to the item that is loaded.

if the item gets loaded, then you can simply set its position by the property location by a variable of Vec3 datatype.

item.location = Vec3(0,0,1);

if the item is loaded as second and above then the reference of the previous item is a treenode property of the tree structure. But the treenode datatype is a parent class of Object and thus does not contain a indirect casting into the class Object.

item.prev.as(Object).location.z

Gets you the z value of previous item in the subnode of the taskexecuter.

Now to an example to set locations of items in the taskexecuter. The first item stays where it is placed to.

if(current.subnodes.length > 1) // content of taskexecuter > 1 then do 
  { // statement block begins
     item.location.x = item.prev.as(Object).location.x+item.prev.as(Object).size.x/2;
     // set the x location to the half size of previous item
     item.location.z = item.prev.as(Object).location.z+item.prev.as(Object).size.z;
    // stacks the item on top of previous item
  } // statement blocks ends

The center of coordinate origin is by default the upper left corner at the bottom of an object.

5 |100000

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

Cliff King avatar image
0 Likes"
Cliff King answered Nur Heppy H edited

Here's some ideas for how to manipulate the animation of the AGV and/or items being carried:

https://answers.flexsim.com/questions/75968/view.html?overrideforward=1

https://docs.flexsim.com/en/20.2/Reference/DeveloperAdvancedUser/Kinematics/

Starting with 20.2.0 there have been some new kinematic activities added to process flow that you could find useful as well.



· 3
5 |100000

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

Nur Heppy H avatar image Nur Heppy H commented ·

Thank you for the answer. @cliff.king

But the point of my question is how to change the position of each item / content that is carried by AGV.

When AGV carrys 6 items I want to change the position of each item. how to change the item's position?

0 Likes 0 ·
Cliff King avatar image Cliff King ♦ Nur Heppy H commented ·

Well it looks like all you need to do is use the On Load trigger to set the location of the loaded items. Have you tried that?

0 Likes 0 ·
Nur Heppy H avatar image Nur Heppy H Cliff King ♦ commented ·

@cliff.king I haven't tried.

How to set Load trigger on the taskExecuter object to change the position of each item / content?

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.