AirSim icon indicating copy to clipboard operation
AirSim copied to clipboard

Adds vehicle name to ros1 camera frame_ids.

Open lukas-utopiacompression opened this issue 3 years ago • 1 comments

Makes tf frame_ids of multiple cameras w/ same name distinct.

Fixes: #

Fixes #4578

Related PR #4509 (fixes the frame_ids partially) PR #4478 fixes exactly this behavior but for ROS2. This PR fixes it for ROS1

About

Adds the vehicle name to camera related tf frame_ids. This avoids ambiguous frame_ids, if cameras of multiple vehicles have the same name.

How Has This Been Tested?

settings.json

{
  "SeeDocsAt": "https://github.com/Microsoft/AirSim/blob/master/docs/settings.md",
  "SettingsVersion": 1.2,
  "ClockSpeed": 0.2,
  "SimMode": "Multirotor",
  "PhysicsEngineName": "ExternalPhysicsEngine",
  "ViewMode": "Manual",
  "DefaultSensors": {
    "imu_1": {
         "SensorType": 2,
         "Enabled" : true
    }
  },
  "Vehicles": {
    "drone_1": {
      "VehicleType": "SimpleFlight",
      "Cameras": {
        "img0":{
          "CaptureSettings": [
            {
                "ImageType": 0,
                "Width": 1024,
                "Height": 1024,
                "FOV_Degrees": 90
            }
          ],
          "NoiseSettings": [
            {
            }
          ],
          "X": 0.5, "Y": 0.0, "Z": 0.0,
          "Pitch": 0, "Roll": 0, "Yaw": 0
        }
      },
    "X": 0, "Y": 0, "Z": -1
    },
    "drone_2": {
      "VehicleType": "SimpleFlight",
      "Cameras": {
        "img0":{
          "CaptureSettings": [
            {
                "ImageType": 0,
                "Width": 1024,
                "Height": 1024,
                "FOV_Degrees": 90
            }
          ],
          "NoiseSettings": [
            {
            }
          ],
          "X": 0.5, "Y": 0.0, "Z": 0.0,
          "Pitch": 0, "Roll": 0, "Yaw": 0
        }
      },
    "X": 2.0, "Y": 2.0, "Z": -1
    },
    "drone_3": {
      "VehicleType": "SimpleFlight",
      "Cameras": {
        "img0":{
          "CaptureSettings": [
            {
                "ImageType": 0,
                "Width": 1024,
                "Height": 1024,
                "FOV_Degrees": 90
            }
          ],
          "NoiseSettings": [
            {
            }
          ],
          "X": 0.5, "Y": 0.0, "Z": 0.0,
          "Pitch": 0, "Roll": 0, "Yaw": 0
        }
      },
    "X": 2.0, "Y": 4.0, "Z": -1
    }
  },
  "CameraDefaults": {
    "CaptureSettings": [
      {
        "ImageType": 0,
        "Width": 1024,
        "Height": 1024,
        "FOV_Degrees": 80
      }
    ]
  },
  "SubWindows": [
    {"WindowID": 0, "VehicleName": "drone_1", "ImageType": 0, "CameraName": "img0", "Visible": true},
    {"WindowID": 1, "VehicleName": "drone_2", "ImageType": 0, "CameraName": "img0", "Visible": true},
    {"WindowID": 2, "VehicleName": "drone_3", "ImageType": 0, "CameraName": "img0", "Visible": true}
  ],
  "OriginGeopoint": {
      "Latitude": 0.0,
      "Longitude": 0.0,
      "Altitude": 0.0
    }
}

  1. Use above settings.json
  2. open Blocks environment
  3. roslaunch airsim_ros_pkgs airsim_node.launch
  4. Open either rviz, or rqt with the rqt_tf_tree plugin

Screenshots (if appropriate):

Before - frames img0_optical and img0_body are ambiguous i.e. some drones don't have a transformation to it: frames_bad

After - every drone now has their own transformations to their respective camera: frames_good

lukas-utopiacompression avatar Jun 16 '22 22:06 lukas-utopiacompression

CLA assistant check
All CLA requirements met.