Imitation sensor field of view.

Post Reply
svedach
Posts: 12
Joined: Mon Sep 01, 2014 6:53 am

Imitation sensor field of view.

Post by svedach »

Good afternoon. I need to simulate the operation of the distance to an obstacle sensor (ultrasonic distance meter). To check the field of view of the sensor objects and receiving range up to them, I use a lot of test beam (rayTest), but it significantly slows down the program. At the same time I stopped physics simulation, and can not use multi-threading. Is it possible to verify the presence of an object in the field of view of the sensor any shape collision?
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Imitation sensor field of view.

Post by Basroil »

Well, ultrasound sensors have a maximum range, so you could try making a ghost object in the shape of a cone up to that maximum range. The collision manifold should give you a reasonable approximation of flat surfaces (after applying some sort of min-filter), and should tell you if it's in contact with other objects (or inside them). Just remember that ultrasonic sensors usually give only one response for the closest object, and can only see objects between a min and max distance.
svedach
Posts: 12
Joined: Mon Sep 01, 2014 6:53 am

Re: Imitation sensor field of view.

Post by svedach »

Well, thanks for your reply. I understand the principles of operation of the ultrasonic sensor, I have made a model based on rayTest, but I was not satisfied with the performance. I do not want to use the cone. It does not correctly represent the field of view of the sensor. I use the trapeze. Can I make a figure in the form of a trapezoid, and use it to determine whether the object in sight? How to do it?
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Imitation sensor field of view.

Post by Basroil »

svedach wrote:Well, thanks for your reply. I understand the principles of operation of the ultrasonic sensor, I have made a model based on rayTest, but I was not satisfied with the performance. I do not want to use the cone. It does not correctly represent the field of view of the sensor. I use the trapeze. Can I make a figure in the form of a trapezoid, and use it to determine whether the object in sight? How to do it?
If you know the exact shape just make a convex hull, though I highly doubt you mean a trapezoid and instead mean a conical frustum (cone with top cut off so that in a plane perpendicular to the base it looks like a trapezoid), in which case you can either make a primitive with that specific shape or you can make make two passes:
1) Check for collision with large cone, add objects to a list
2) Check for collision with small cone, remove objects from that list

(and you'll have to check for edge cases like U shapes that would have two distinct responses)

If you fully understand your sensor, you should be able to understand exactly how it works and find a way around having to make dumb guesses within an area.
Post Reply