question

Jouky D avatar image
0 Likes"
Jouky D asked Jason Lightfoot edited

distancetotravel is not considering the path way direction.

Hello everyone,

I need the distance between two control points going through the correct paths (not using the wrong direction). If I do the distance to travel from CP1 to CP2 is equal to CP2 to CP1 while the path is One-Way path. How can I fix this problem?

1684142568369.pngdistancetotravel(Model.find("CP1"), Model.find("CP2")) --> 1864.03 (mm)
distancetotravel(Model.find("CP2"), Model.find("CP1")) --> 1864.03 (mm)

Thank you

FlexSim 23.1.2
agvdistancetotravelcontrolpoints
1684142568369.png (7.8 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.

Jouky D avatar image Jouky D commented ·
Also using cpdistance function sometimes does not work.
0 Likes 0 ·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

cpdistance() is the correct function for two control points, not distancetotravel. If you get unexpected results from this:

1) check your network integrity (visually)

2) refresh the path links (right click path):

1684157493370.png

3) check the routing accessibility (right clickCP) and then hover over other CPs on the network to see if it's reachable and the distance. You can use this to see at which point the route fails and detect broken networks.

1684157560705.png


1684157493370.png (15.8 KiB)
1684157560705.png (16.0 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.

José Antonio MD avatar image
0 Likes"
José Antonio MD answered

Hello @Jouky D ,


Distancetotravel needs as first parameter a traveler not an object. If you use cpdistance you don't have this problem. See the attached example: 23.1. CPDistance.fsm

I hope I have been helpful.


231-cpdistance.fsm (28.1 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.

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

The control point is not a traveller on the AGV network, so distancetotravel() will return the straightline distance.

If you use an actual 'AGV' (a task executer connected to the network) in the command, the returned distance will be along the network.

capture1.png

Do you have an example where cpdistance() does not work? Otherwise I'm afraid it's not really possible to troubleshoot the problem.


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