Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add setting for overriding pixel format in capture component #4372

Merged
merged 5 commits into from
Mar 8, 2022

Conversation

zimmy87
Copy link
Contributor

@zimmy87 zimmy87 commented Feb 24, 2022

Fixes: #4339

About

This PR undoes #4321 and adds a new setting that allows the user to override the pixel format that each capture component in a camera is initialized with. This allows us to support scenarios where pixel format is expected to be either int or float. See #4339, #4120 and #4321 for more information about various scenarios that are impacted by pixel format selection. The new settings include a "UnrealEngine" setting, which contains a "PixelFormatOverride" setting, which then contains a list of settings that have both a "ImageType" and "PixelFormat" parameter. See test settings used below for an example of these settings being defined.

How Has This Been Tested?

The high_res_camera.py script, both with its original text and with ImageRequest.pixels_as_float = True, was used in conjunction with both the settings detailed in the test script as well as the modified settings below:

{
    "SettingsVersion": 1.2,
    "SimMode": "Multirotor",
    "Vehicles" : {
        "Drone1" : {
            "VehicleType" : "SimpleFlight",
            "AutoCreate" : true,
            "Cameras" : {
                "high_res": {
                    "CaptureSettings" : [
                        {
                            "ImageType" : 0,
                            "Width" : 4320,
                            "Height" : 2160
                        }
                    ],
                    "X": 0.50, "Y": 0.00, "Z": 0.10,
                    "Pitch": 0.0, "Roll": 0.0, "Yaw": 0.0
                },
                "low_res": {
                    "CaptureSettings" : [
                        {
                            "ImageType" : 0,
                            "Width" : 256,
                            "Height" : 144
                        }
                    ],
                    "X": 0.50, "Y": 0.00, "Z": 0.10,
                    "Pitch": 0.0, "Roll": 0.0, "Yaw": 0.0
                }
            }
        }
    },
    "UnrealEngine": {
        "PixelFormatOverride": [
            {
                "ImageType": 0,
                "PixelFormat": 10
            }
        ]
    }
}

Screenshots (if appropriate):

Copy link
Contributor

@rajat2004 rajat2004 left a comment

Choose a reason for hiding this comment

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

I guess the new element UnrealEngine is added for future inclusion of such UE-specific settings? Just thinking whether this might be more appropriate in CameraDefaults section, but no strong preference either way

AirLib/include/common/AirSimSettings.hpp Outdated Show resolved Hide resolved
AirLib/include/common/AirSimSettings.hpp Outdated Show resolved Hide resolved
Unreal/Plugins/AirSim/Source/PIPCamera.cpp Outdated Show resolved Hide resolved
@zimmy87
Copy link
Contributor Author

zimmy87 commented Mar 4, 2022

@rajat2004, as per the UnrealEngine setting, you are correct, this is meant to be used as a container for all Unreal-specific settings. I have moved this to the CameraSetting element, that way we can specify it in CameraDefaults or only in desired cameras defined elsewhere.

@zimmy87 zimmy87 marked this pull request as ready for review March 4, 2022 17:19
@jonyMarino jonyMarino added the bug label Mar 8, 2022
@jonyMarino
Copy link
Collaborator

Thanks, @zimmy87! and thanks @rajat2004 for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

simGetImages API causes a Vulcan Error for high resolution images
3 participants