Collision problem

Collision problem

a9080109
Collaborator Collaborator
5,215 Views
44 Replies
Message 1 of 45

Collision problem

a9080109
Collaborator
Collaborator

[ FlexSim 20.0.10 ]

I want to know how to use pf to control the time of collision, so that I can collect data

agv-avoidance-rc.fsm

0 Likes
Accepted solutions (1)
5,216 Views
44 Replies
Replies (44)
Message 21 of 45

jason_lightfoot_adsk
Autodesk
Autodesk

Hi @mark zhen ,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes
Message 22 of 45

a9080109
Collaborator
Collaborator

@Jason Lightfoot

我現在有了一個新的想法,我需要考慮到第三輛車的碰撞,然後我的DELAY時間會根據碰撞的車輛數量來確定,比如兩輛車是5S,三輛車是10S。我寫了全球表!0421 (1).fsm

0 Likes
Message 23 of 45

jason_lightfoot_adsk
Autodesk
Autodesk
This isn't a question any more, and I'm not sure of the purpose. Once you've solved 3 in a collision are you going to create artificial scnenarios that collide 4,5,6 agvs and say you want them to delay by some time? What's the purpose of these models?
0 Likes
Message 24 of 45

a9080109
Collaborator
Collaborator


@Jason Lightfoot The purpose of this model is just to understand more detailed collision problems. I believe that after dealing with 3 collisions, the others should be similar logic

0 Likes
Message 25 of 45

a9080109
Collaborator
Collaborator
@Jason Lightfoot 所以有方法可以幫我解決這個問題嗎?
0 Likes
Message 26 of 45

jason_lightfoot_adsk
Autodesk
Autodesk

Here's a solution.

0421-1_jl.fsm


0 Likes
Message 27 of 45

a9080109
Collaborator
Collaborator

謝謝你的幫助,但可以有辦法幫助我去了解全面的邏輯嗎?我想知道我該在哪裡看到位置label方面的意義


"Thanks for your help, but can there be a way to help me understand the full logic? I would like to know where do I see the meaning of the position label"

0 Likes
Message 28 of 45

jason_lightfoot_adsk
Autodesk
Autodesk
There is no "position label".

The best advice to learn how it works is to step through the logic/process and see what the token labels are, what's on the list and what the code does (adding breakpoints and stepping through the logic when looking at local variables).

The idea is that during a collision event you

  • check if it's the first detection of the collision (variable 'incollision')
  • determine a unique collisionid for the group by checking if each other have a collisionid and creating a new one if not.
  • track who's in the collision using a list partitioned by collisionid
  • wait for a short delay for new collision members to be detected and added.
0 Likes
Message 29 of 45

a9080109
Collaborator
Collaborator

那有關於碰撞id的設定可以解釋一次嗎?


1652865446831.png

以上面的圖來說明我的理解是檢測其他物件是否有 碰撞,沒有的話往沒有的方向走(可能要你解釋一下1652871531240.png這兩個的作用)

那是的方向1652871564319.png

可以解釋一下這個的作用

1652871579385.png

還有想問這個是不同的不同數量的不同的時間嗎?

1652871882182.png


還有拉當前這個的作用是什麼以及為何需要啦?

1652871906109.png

這最後是什麼功能啊?

0 Likes
Message 30 of 45

jason_lightfoot_adsk
Autodesk
Autodesk

Many of your images are missing. You can try uploading them again.

You can look up how process flow activities operate using the manual.

0 Likes
Message 31 of 45

jason_lightfoot_adsk
Autodesk
Autodesk

The global collisionID gets incremented when there is a new collision - that is, when two object collide and neither have a collisionID.

There are 3 cases for an AGV that so far has not joined the collision delay:

  • It is the first object - use a new collisionID and put it on the two colliders
  • It is the second object - the collision label already exists so just use that
  • It is the third (4th,etc) object - no label but the other object has one so use its collisionID

Theses cases are detected in the process flow.

Yes the collisions.length tells you how many were in the collision and the case statement tells you the time.

We remove the collisionID label at the end of the delay so a new collision can be detected.



0 Likes
Message 32 of 45

a9080109
Collaborator
Collaborator

1652885199086.png

我想全部確認一下我是否有誤會

當碰撞觸發的時候需要給予token兩個標籤(incollsion,othercollisoin這兩個名字)而他們值的代碼(我想問“incollision”是哪裡來的)

1652885154209.png

第一個decide是判斷是否有token.inCollision對吧?(甚麼樣的情況會產生這個token?)

有這個token就會結束zone

沒有的話則會到第二個decide

第二個decide 是判斷是否有token.inCollisionid?(這個值是哪裡來的??)

第三個判斷是token.otherAGV.as(Object).collisionID?!=nullvar是其他物件發生碰撞的時候是否有id嗎?

1652886933683.png

沒有的話使用這兩個流程嗎?(那這兩個流程的意義是甚麼?)

1652886864559.png1652886873712.png

然後根據我的觀察token會卡在pull裡不會消失1652887000877.png


0 Likes
Message 33 of 45

jason_lightfoot_adsk
Autodesk
Autodesk

The token is generated on the collision check frequency. The first time it detects a collision, the 'incollision' variable is 0. Subsequent times tokens are created for that object while it is colliding, the incollision is 1. Hence if you detect it is 0 then it is firing for the first time and you can ignore the other tokens that are generated according to the collision check frequency.

Attached is a version that fixes the hanging token.

0421-1-jl2.fsm

0 Likes
Message 34 of 45

a9080109
Collaborator
Collaborator
那有關於我理解的部分,是有問題的嗎
0 Likes
Message 35 of 45

a9080109
Collaborator
Collaborator
那你可以在跟我敘述每一個decide的作用嗎?
0 Likes
Message 36 of 45

jason_lightfoot_adsk
Autodesk
Autodesk
You've already described it, and I've listed the 3 cases they detect above.
0 Likes
Message 37 of 45

a9080109
Collaborator
Collaborator

0421-1.fsm

我不了解為啥我的會有抱錯

0 Likes
Message 38 of 45

jason_lightfoot_adsk
Autodesk
Autodesk

What are all these ? Why do you insist on putting them in a general flow?

1652909017873.png

0 Likes
Message 39 of 45

a9080109
Collaborator
Collaborator
因為我想要把這寫在其他的流程中,
0 Likes
Message 40 of 45

jason_lightfoot_adsk
Autodesk
Autodesk
You don't need to - any TE you want to have this behaviour you just add them to this process flow as a member.
0 Likes