AirSim icon indicating copy to clipboard operation
AirSim copied to clipboard

client.simGetSegmentationObjectID() always returns -1

Open martijn-vinotion opened this issue 8 years ago • 9 comments

When I request the segmentation object ID, it always returns -1. Even if I had requested client.simSetSegmentationObjectID('object_name',1) (which does return True and does change the color of the segmentation mask) beforehand.

I am running AirSim in CV-mode.

Is anyone else also encountering this problem?

martijn-vinotion avatar Jul 23 '18 11:07 martijn-vinotion

Yes, I am. Airsim latest commit. Windows 10. Custom Unreal environment. For instance, found = client.simSetSegmentationObjectID("FbxScene_GraveCart[\w]*", 22, True); correctly changes all the carts colors to 22. (verified by extracted image)

But print(client.simGetSegmentationObjectID("FbxScene_GraveCart4")) returns -1

saiabinesh avatar Aug 20 '18 14:08 saiabinesh

-1 is returned when said object is not found. Note that UE requires you to manually name the object (i.e. XYZ_4 is auto-generated and may not be valid in next run).

If this is still a problem, please file a new issue with code, settings and clear steps to reproduce the issue.

sytelus avatar Oct 17 '18 08:10 sytelus

I've seen the same problem. Did you solve? @saiabinesh @martijn-vinotion

ykpgrr avatar Jan 15 '19 11:01 ykpgrr

Unfortunately I did not manage to solve it. I worked around it by simply setting the segmentation ids to whatever I needed.

martijn-vinotion avatar Jan 19 '19 14:01 martijn-vinotion

nope. @ykpgrr

saiabinesh avatar Mar 12 '19 12:03 saiabinesh

I can confirm that this is still an issue (Unreal on Ubuntu 16.04), I don't know why it was closed.

alexander-hamme avatar Sep 03 '19 16:09 alexander-hamme

Could anyone verified if this is still an issue? I still only get -1 even if I set the segmentation ID to the object first. Also the seg_rgb.txt doesn't really match the segmentation output.

dnychennnn avatar Jun 23 '20 08:06 dnychennnn

@dnychennnn, looks like #2845 solves the matching issue.

RachithP avatar Feb 01 '21 05:02 RachithP

Anyone found a solve? I have the same issue. I use setId and it works (visually confirmed) but the getId always returns -1.

Input: success = self.drone.simSetSegmentationObjectID("DroneFollower1", 25, True); print(success)

success = self.drone.simSetSegmentationObjectID("DroneFollower2", 78, True); print(success)

print(self.drone.simGetSegmentationObjectID("DroneFollower1")) print(self.drone.simGetSegmentationObjectID("DroneFollower2"))

Output:

True True -1 -1

marcb19990 avatar Jan 04 '23 16:01 marcb19990