question

Julio R avatar image
0 Likes"
Julio R asked Joseph Gillespie answered

Identify AGV path

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?

FlexSim 19.1.0
agvpaths
· 2
5 |100000

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

Joseph Gillespie avatar image Joseph Gillespie commented ·

@Julio R

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

0 Likes 0 ·
Julio R avatar image Julio R Joseph Gillespie commented ·

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 0 ·

1 Answer

·
Joseph Gillespie avatar image
1 Like"
Joseph Gillespie answered

@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".

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.


capture1.png (10.8 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.