Skip to content

RPCError when calling simGetImages with several instances of ImageRequest #4375

@Villotadavid

Description

@Villotadavid

Hello!
I am trying to get two different images with the same instance of "simGetImages". For that I have written the following line:

responses = client.simGetImages(
[airsim.ImageRequest("CameraOF", 8,False,False), 
airsim.ImageRequest("CameraWide",0,True,False)], 
vehicle_name=VehicleName)

In the settings.json file I defined the following vehicle with its cameras as follows:

"Drone1": {
          "VehicleType": "SimpleFlight",
          "DefaultVehicleState": "Armed",
          "PawnPath": "",
          "EnableCollisionPassthrogh": false,
          "EnableCollisions": true,
          "AllowAPIAlways": true,
          "EnableTrace": false,
          "CameraWide": {
            "CaptureSettings": [
                {
                "ImageType": 0,
                "Width": 256,
                "Height": 144,
                "FOV_Degrees": 120
                }
            ],
            "X": 0, "Y": 0, "Z": 0
           },
           "CameraOF": {
            "CaptureSettings": [
                {
                "ImageType": 8,
                "Width": 256,
                "Height": 144,
                "FOV_Degrees": 45
                }
            ],
            "X": 0, "Y": 0, "Z": -0.5
           },
          "X": 0, "Y": 0, "Z": -2
        },

But whenever I run the code I always get the following error:
msgpackrpc.error.RPCError: rpclib: function 'simGetImages' (called with 2 arg(s)) threw an exception. The exception contained this information: invalid map<K, T> key.

I have tried several options having Airsim documentation as reference but I haven´t managed to run the code properly.

My current setup is:
Airsim: 1.5.0
Python: 3.9.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions