-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fixes #2854: [UE4] simGetSegmentationObjectID will always return -1 #2855
Fixes #2854: [UE4] simGetSegmentationObjectID will always return -1 #2855
Conversation
/azp run microsoft.AirSim |
Azure Pipelines successfully started running 1 pipeline(s). |
@LSBOSS this is a really good PR! Thanks a lot for digging in and contributing! While testing, this revealed If one uses the following snippet python:
Pre this PR, the result is:
Post this PR, the result is:
Now, if you use the following snippet to do the above for all the objects returned by import airsim
c = airsim.VehicleClient()
object_list = sorted(c.simListSceneObjects())
object_seg_ids = [c.simGetSegmentationObjectID(object_name) for object_name in object_list]
for object_name, object_seg_id in zip(object_list, object_seg_ids):
print(f"object_name: {object_name}, object_seg_id: {object_seg_id}") the result is same pre and post the PR coz of wrong mesh names of course:
|
recently i find the actual segmenation color does not correspond to the label specified in seg_rgbs.txt doc , although i can get the correct object id using simGetSegmentationObjectid |
This PR fixes #2854 .
Calling simGetSegmentationObjectID from Python and AirSim running in Unreal Engine 4 always fails with -1 because the underlying function
UAirBlueprintLib::GetMeshStencilID
is comparing the passed parameter not against the actual mesh's or owner's name but the name of the mesh component instead (e.g. StaticMeshComponent0).This PR fixes that by miming the same calls as the actual initialization of IDs in
UAirBlueprintLib::InitializeMeshStencilIDs
.