Identify AGV path

Identify AGV path

julio_r
Not applicable
247 Views
3 Replies
Message 1 of 4

Identify AGV path

julio_r
Not applicable

[ FlexSim 19.1.0 ]

Hello,

I´ve been working on a model where the direction of an AGV doesn´t change. While I´ve find a solution through code on a pre Draw trigger, now I need to only apply that logic on certain paths.

Is there an easy reference to a node that indicates the path the AGV is traveling without using external events like control points?

0 Likes
Accepted solutions (1)
248 Views
3 Replies
Replies (3)
Message 2 of 4

joseph_g3
Not applicable

@Julio R

Could you attach your model? That would help us understand your problem better.

0 Likes
Message 3 of 4

julio_r
Not applicable

Hello @Joseph Gillespie

This is a simple example, there is a on predraw trigger on the AGV (yellow one) but I want to execute it only in a few paths, I've used control points to change a label but is difficult to get it to look right on sharp corners so I want to put an identifier on the path so the AGV can decide to execute the code or not according to the path that is on.

Thank you!

rotacion-del-agv.fsm

0 Likes
Message 4 of 4

joseph_g3
Not applicable
Accepted solution

@Julio R

What you are looking for is difficult to do since AGVs are built around using control points. One idea that may be helpful to you would be to create a new path class under AGVNetwork Properties. In the example I attached, I called this path class "NoRotation".

19589-capture1.png

By modifying your code to look like this, you can cause the code to only be implemented on paths that are labeled as that path class:

AGV thisAGV = AGV(current);
if(objectexists(item) && (getvarnum(ownerobject(getvarnode(thisAGV.currentCP, "path").subnodes[1].value),"pathType")) == 4)
{
	item.rotation.z = -current.rotation.z;
}

This code works by finding the class of the path under the control point that was last visited. If the path is of the new path class (in my example it has a varnum value of 4, being the 4th path class), then the custom code will be executed. For this to work it is also important to have the AGV travel to a control point at the start of each path where it can check what the current path class is.

Here is your model with this solution: rotacionanswer1.fsm

Another solution that may be simpler would be to use process flow to make the AGV travel to a control point at the start of each path and then use a "Change Visual" activity on the edges where you don't want the orientation of the AGV to change.

This was a long explanation, so let me know if you have any questions.