Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for removing ray shapes from a MultiRayShape instance #3354

Open
gigcastro opened this issue Oct 20, 2023 · 0 comments
Open

Support for removing ray shapes from a MultiRayShape instance #3354

gigcastro opened this issue Oct 20, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@gigcastro
Copy link

Desired behavior

The MultiRayShape API only provides AddRay which is sufficient when sensors are being statically defined in a sdf file. But there are situations where it is desirable to dynamically define a set of rayshapes to check collisions towards not-predefined directions.

For example, when simulating a "fake" object/model detection sensor in combination with the LogicalCameraSensor and a set of rays need to be casted towards objects that entered in the frustum. This would speedup computation avoiding casting rays outside the frustum.

There is no way of "clearing" a MultiRayShape and re-define the amount of rays being casted.

Alternatives considered

I had to instance a multirayshape with a pre-defined buffer of N rays and re-use them as batchs in cases where objects in frustum where > N.

A new MultiRayShape can be created each time using PhysicsEngine::CreateShape() / PhysicsEngine::CreateCollision(), but it seems that the engine keeps stacking instances internally and increasing memory usage. It seems that there is no way of detaching a shape/collision from the engine.

@gigcastro gigcastro added the enhancement New feature or request label Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant