RayCast and LineCast (to find occluding objects from Sensor)

asked 2016-06-03 13:17:02 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

We would like to create ray-type sensors for discovering scene objects. E.g. a Velodye or Stereo Vision camera. We don't want a pixel image. But rather a list of scene object that are not blocked/obscured/hidden.

Unity3D has two methods (linecast and raycast) that can be used to find all rigid object that are blocking the view from one object to the other (or raycast for vectors with no endpoint, to find what is visible along a ray).

I saw the following code for how to get the id of the SDF item from a ray:


mySensor->LaserShape()->Ray(0)->GetIntersection(dist, entity);

What I am concerned with is that looping through all rays might be very cpu-intensive. Initially we would only want to find all cars in the field of view (in the scene) (not all the buildings, street furniture, etc).

Also which sensor should we extend (GPU, Ray, MultiCamera) for the best performance (e.g. does the GPU do some of this calculation in the GPU?)

edit retag flag offensive close merge delete