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

Adds vehicle name to ros1 camera frame_ids. #4579

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukas-utopiacompression
Copy link

@lukas-utopiacompression lukas-utopiacompression commented Jun 16, 2022

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

makes frame_ids of multiple cameras w/ same name distinct
@ghost
Copy link

ghost commented Jun 16, 2022

CLA assistant check
All CLA requirements met.

@jonyMarino jonyMarino changed the base branch from master to main July 17, 2022 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ROS1 ambiguous camera tf frame_ids
2 participants