microsoft / AirSim

Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
https://microsoft.github.io/AirSim/
Other
16.04k stars 4.48k forks source link

Airsim camera yaw angle is negative of Unity quadrotor pose yaw #4902

Open sandilyasg opened 7 months ago

sandilyasg commented 7 months ago

Question

Why is the Airsim camera yaw angle negative of Unity quadrotor pose yaw?

Include context on what you are trying to achieve

I am using the C++ Image API, particularly the simGetImages API. My quadrotor in Unity has a yaw angle of +45 degrees. However, when I view the RGB, depth, and semantic segmentation frames, they are in exactly -1*Unity yaw angle that I set for my quadrotor. Is this because Airsim uses the NED coordinate system, but Unity uses DirectX convention (left-handed Y-up)? I have included images below to explain my question.

Context details

OS: Linux Ubuntu 18.04 Airsim: latest release Python version: n/a Unity editor version: 2021.3.31f1

{   
    "SeeDocsAt" : "https://github.com/Microsoft/AirSim/blob/main/docs/settings.md",
    "SettingsVersion": 1.2,
    "SimMode": "Multirotor",

    "Vehicles": {
        "Drone1": {
          "VehicleType": "SimpleFlight",
          "X": -69.38, "Y": 5.0, "Z": -177.74,"Yaw": 0
        },
        "Drone2": {
          "VehicleType": "SimpleFlight",
          "X": -59.81, "Y": 5.0, "Z": -177.74,"Yaw": 0
        },
        "Drone3": {
          "VehicleType": "SimpleFlight",
          "X": -50.61, "Y": 5.0, "Z": -177.74,"Yaw": -45
        },
        "Drone4": {
          "VehicleType": "SimpleFlight",
          "X": -69.56, "Y": 5.0, "Z": -186.53,"Yaw": -90
        },
        "Drone5": {
          "VehicleType": "SimpleFlight",
          "X": -60.33, "Y": 5.0, "Z": -186.84,"Yaw": 180
        },
        "Drone6": {
          "VehicleType": "SimpleFlight",
          "X": -50.4, "Y": 5.0, "Z": -187.54,"Yaw": 90
        }
    }
}

My quadrotor in Unity is at 45 degrees yaw angle, and the camera viewframe is also shown: Screenshot from 2023-11-06 21-39-04 Screenshot from 2023-11-06 21-38-53

However, when I start the simulation and view the RGB, depth, and semantic segmentation frames from Airsim, the camera is showing the viewpoint from exactly -45 degrees: Screenshot from 2023-11-06 21-40-55

Include details of what you already did to find answers

1498

2951