OpenSimulationInterface / open-simulation-interface

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

Add hit_point and trace_depth to reflections #825

Open ClemensLinnhoff opened 4 months ago

ClemensLinnhoff commented 4 months 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. However, due to possible limitations here, a new issue was created to test the implementation of hit points in a completely new message: #826.

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.