question

Sean avatar image
0 Likes"
Sean asked Felix Möhlmann edited

How to know which controlpoint that agv traveling now?

Hi

How to know which controlpoint that agv traveling now? At picture, I use agv.currentCP but it shows the controlpoint(CP11) which agv haven't arrive yet. I want to get controlpoint which agv arrive now(CP6). How can I do it?agv-currentcp.png

FlexSim 23.0.4
agvcurrentcp
agv-currentcp.png (41.0 KiB)
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·
I would try recentCP. But this more guess than knowledge. In such a case I try several properties from flexscript api Class Reference for AGV.
0 Likes 0 ·

1 Answer

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann edited

As far as I understand the system, "currentCP" returns the most recent control point the AGV "arrived" at. Arrived in this context means that the Pre-Arrival event for that control point has happened and the AGV has decided to come to a stop at that point or continue beyond it. Depending on the current speed and the deceleration value, the AGV has already "arrived" at CP11 since it couldn't actually come to a stop in time anymore.

The actual next control point it will pass can be determined by looking at the "traversal points" of the AGV. An entry for a control point in these traversal points determines when the point will be deallocated. So for the default setting of "Deallocate At Next Control Point", the second control point in the list would be the next one the AGV passes (since the first control point in the list will already be behind). (Apart from when there is only one because the AGV has finished its travel.

Object agvObj = Model.find("TaskExecuter1");
AGV agv = AGV(agvObj);
if(agv.traversalPoints.length > 1)
{
    return ownerobject(agv.traversalPoints[2].as(treenode).value);
}
return ownerobject(agv.traversalPoints[1].as(treenode).value);

nexttraversalpoint_fm.fsm

A question: Why do you place so many control points so close together on a path with no intersections? Maybe there is a better approach for what you want to achieve, such as setting paths to use an accumulation behaviour.


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.