question

Ryusuke T avatar image
0 Likes"
Ryusuke T asked Ryusuke T commented

Agent system using trapezoid

I will look at this and ask.

Here the sensor is represented as a rectangle, is it possible to make this sensor a trapezoid?

I understand that it would be easier to do it with slices of a circle, but I'd like to know if it's possible to represent it with a trapezoid.

1661489091819.png

FlexSim 21.0.10
agent moduleflexsim 21.0.10
1661489091819.png (21.3 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.

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Ryusuke T commented

To detect collision/proximity you would check if either of two conditions is fulfilled. Either the center point of the other object is within the sensor area or any of the edges of the sensor area intersect with any of the edges of the bounding area of the other object.

The second check just requires the position of the sensor area edges relative to the task executer. These can be determined once and saved in a label or other node for lookup during the model run. As such the sensor area can be an arbitrary polygon without changing the complexity of the math involved.

To check whether the center point is within the area you can still define the trapezoid as part of a circle slice. The midpoint of the circle just doesn't coincide with the center of the task executer.

1661496092566.png

Edit:

collsensor.gif

I build an example model showcasing the detection of an area intersection.

https://drive.google.com/file/d/1iEo1f5HLpFcXPzKtQs-dMvhkCoqoCt-G/view?usp=sharing


1661496092566.png (123.3 KiB)
collsensor.gif (999.2 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.

Ryusuke T avatar image Ryusuke T commented ·

@Felix Möhlmann ,

Thank you for the information and the great sample model.

I would like to explore and utilize this sample model.

I'm really thankful to you!

0 Likes 0 ·