Hi,
I am using the semantic lidar to get instance masks. According to the documentation it returns the index of the hit actor. I could not find any further details. From looking through some parts of the source code this does not seem to be the actor id, but rather the FActorInfo->Description.UId.
Do you have some details on what exactly this id is and how unique it is? In some cases I seem to receive the same id for different instances. For both cars and pedestrians.
For an example see the two cars below which received the same id (lidar ObjIdx projected into camera perspective and overlayed with semantic camera output). I already double checked that I am using the Object Index and not the semantic tag of the semantic lidar.

Any insights would be much appreciated.
Client API version = 0.9.9.4-255-gc56a7738
Simulator API version = c56a7738 (latest docker image)
@marcgpuig @DSantosO could you please comment on this?
Hello @dHonerkamp,
This id should be unique for dynamic objects like cars and pedestrians and zero for static objects like buildings and such. If you see the same id for a car and a pedestrian, please let us know because this should not be the case.
@DSantosO, thanks for clearing up the uniqueness. Can you comment on the definition, i.e., which data structure does SemanticLidarDetection.object_idx apply to? I thought maybe it's an index to the actor list returned by world.get_actors(), or the actor snapshots in world.get_snapshot(), but it doesn't seem to match. Can you please advise on how to use the index to obtain a reference to the corresponding actor or actor snapshot?
Hello @FiodarKazhamiaka,
The index was intended to the same as the index returned by the world.get_actors() but a couple of weeks ago, we discover it was not the case. We fixed in PR #3396 and you can find it working as expected already in dev branch. Sorry about that.
In branch dsantos/lidar_bb_test, you can find a script (here), that compares the semantic lidar point cloud with the BB of objects. it is not in dev yet because it still needs some clean-up but maybe it can be helpful.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi @DSantosO,
With Carla 0.9.11, it seems that it is no longer an object index, but rather the actor's id that being provided by the semantic lidar measurement. And if the object doesn't correspond to an actor, the id field is set to 0. This seems like a better design than using an index, and it would be great if the documentation was updated to reflect this change!
Hello @FiodarKazhamiaka,
Where do you think the documentation should be updated? I have checked and in the sensor section and it already showed that the returned value is the actor id. Do you mean the id=0 when the object is not an actor?
Most helpful comment
Hello @FiodarKazhamiaka,
The index was intended to the same as the index returned by the world.get_actors() but a couple of weeks ago, we discover it was not the case. We fixed in PR #3396 and you can find it working as expected already in dev branch. Sorry about that.
In branch dsantos/lidar_bb_test, you can find a script (here), that compares the semantic lidar point cloud with the BB of objects. it is not in dev yet because it still needs some clean-up but maybe it can be helpful.