OpenSimulationInterface / open-simulation-interface

A generic interface for the environmental perception of automated driving functions in virtual scenarios.
Other
265 stars 124 forks source link

Add hit_point and trace_depth to reflections #825

Open ClemensLinnhoff opened 2 weeks ago

ClemensLinnhoff commented 2 weeks ago

Describe the feature

Currently it is not possible to get hit_point information for individual ray tracing results (reflections). You can get the first hit_point with the ray direction (from the view_configuration) and the time_of_flight. But if the there are multiple reflections per ray (by reflection and transmission) it is not possible to get the hit point information.

Describe the solution you would like

I would like to add as Vector3D hit_point and an Integer trace_depth to the LidarSensorView::reflection and the RadarSensorView::reflection.

Describe alternatives you have considered

An alternative would be to put the hit_points in a separate structure and not into the reflections. But since the general structure is similar, it should not be a problem to add them. Just the following backwards compatibility deliberations need to be discussed.

Describe the backwards compatibility

There is a potential problem with the description of the reflection field:

This field includes one entry for each ray, in left-to-right, top-to-bottom order (think of scan lines in a TV).

If there are multiple reflections per ray, the size of the repeated field would be num_rays * max_trace_depth. So there is not one entry per ray. On the other hand, the max_number_of_interactions can already be set in the view_configuration.

Additional context

To be honest, for me this is more of a debugging feature, which technically is out of scope for OSI. But I can still see potential applications for models needing a more in depth access to ray tracing data.