Skip to content
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

Fix DepthPlanar capture #3907

Merged
merged 3 commits into from
Aug 9, 2021
Merged

Fix DepthPlanar capture #3907

merged 3 commits into from
Aug 9, 2021

Conversation

saihv
Copy link
Contributor

@saihv saihv commented Jul 23, 2021

Fixes: #3776
Fixes: #3716
Fixes: #3648

About

Fixes an issue with PIPCamera where it was missing the reference to the Depth Planar material. Earlier, requesting a DepthPlanar issue would return a grayscale/RGB image instead of depth.

How Has This Been Tested?

import airsim
import cv2
import numpy as np

c = airsim.MultirotorClient()

c.confirmConnection()

responses = c.simGetImages([airsim.ImageRequest("1", airsim.ImageType.DepthPlanar, True)])
response = responses[0]
img1d = response.image_data_float
img2d = np.reshape(img1d,(response.height, response.width)) 
cv2.imshow("Depth viz", img2d)
cv2.waitKey(0)

Copy link
Contributor

@zimmy87 zimmy87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @saihv, which version of the unreal engine are you using to save the .uasset in this PR? In UE 4.25.4, I'm getting load failures when launching the Blocks environment:


Message

Default Property warnings and errors:
Error: CDO Constructor (CarPawn): Failed to find /AirSim/Blueprints/BP_PIPCamera.BP_PIPCamera_C

Error: CDO Constructor (ComputerVisionPawn): Failed to find /AirSim/Blueprints/BP_PIPCamera.BP_PIPCamera_C

Error: CDO Constructor (SimModeBase): Failed to find /AirSim/Blueprints/BP_PIPCamera.BP_PIPCamera_C

Error: CDO Constructor (SimModeBase): Failed to find /AirSim/Blueprints/BP_PIPCamera.BP_PIPCamera_C

The BP_PIPCamera.uasset file doesn't appear in the content browser, and launching the environment results in an unhandled exception and crash. Would you be able to re-save your changes in UE 4.25 to ensure compatibility with the currently supported version of Unreal?

@rajat2004
Copy link
Contributor

I can't see the output but shouldn't this 4.25 incompatibility have been caught by the Azure Pipelines? It uses 4.25.1 based on the ci.yaml file

@saihv
Copy link
Contributor Author

saihv commented Jul 31, 2021

@zimmy87 I've replaced the asset with a 4.25-saved one, could you try now?

@madratman
Copy link
Contributor

madratman commented Aug 3, 2021

@saihv seems like you pushed Unreal/Environments/Blocks/Content/FlyingCPP/Maps/FlyingExampleMap.umap by mistake instead of /Unreal/Plugins/AirSim/Content/Blueprints/BP_PIPCamera.uasset

@saihv
Copy link
Contributor Author

saihv commented Aug 3, 2021

Whoops, fixed!

@jonyMarino jonyMarino closed this Aug 9, 2021
@jonyMarino jonyMarino reopened this Aug 9, 2021
@zimmy87
Copy link
Contributor

zimmy87 commented Aug 9, 2021

Thanks for the submission @saihv! Tested locally and it works for me.

@zimmy87 zimmy87 merged commit 03ba17e into microsoft:master Aug 9, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
5 participants