microsoft / AirSim

Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research

Home Page:https://microsoft.github.io/AirSim/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Airsim ROS wrapper in airsim_ros_pkgs gives TF_NAN_INPUT error

sandilyasg opened this issue · comments

Bug report

  • AirSim Version/#commit: 6688d27 on Jul 21, 2022
    Unity version: 2021.3.31f1
  • OS Version: Linux Ubuntu 18.04 LTS

I am using a single Multirotor in Unity with Airsim. I am trying to run ROS wrapper for Airsim from airsim_ros_pkgs given the tutorial in AirSim ROS Tutorials.

I am trying the simple example of Single drone with monocular and depth cameras, and lidar; it uses settings.json - front_stereo_and_center_mono.json. When I run the launch files in this example, I get the error

Error:   TF_NAN_INPUT: Ignoring transform for child_frame_id "front_center_optical" from authority "/airsim_node" because of a nan value in the transform (0.000000 0.000000 0.000000) (-nan -nan -nan -nan)
         at line 244 in /tmp/binarydeb/ros-melodic-tf2-0.6.5/src/buffer_core.cpp
Error:   TF_DENORMALIZED_QUATERNION: Ignoring transform for child_frame_id "front_center_optical" from authority "/airsim_node" because of an invalid quaternion in the transform (-nan -nan -nan -nan)

Settings

{
  "SeeDocsAt": "https://github.com/Microsoft/AirSim/blob/main/docs/settings.md",
  "SettingsVersion": 1.2,
  "SimMode": "Multirotor",
  "ViewMode": "FlyWithMe",
  "ClockSpeed": 1.0,
  "Vehicles": {
    "Drone1": {
      "VehicleType": "SimpleFlight",
      "DefaultVehicleState": "Armed",
      "EnableCollisionPassthrogh": false,
      "EnableCollisions": true,
      "AllowAPIAlways": true,
      "RC": {
        "RemoteControlID": 0,
        "AllowAPIWhenDisconnected": false
      },
      "Sensors": {
        "Imu" : {
          "SensorType": 2,
          "Enabled": true
        }
      },
      "Cameras": {
        "front_center": {
          "CaptureSettings": [
            {
              "PublishToRos": 1,
              "ImageType": 0,
              "Width": 256,
              "Height": 144,
              "FOV_Degrees": 90,
              "TargetGamma": 1.0
            }
          ],
          "X": 0, "Y":0, "Z": 0,
          "Pitch": 0.0, "Roll": 0.0, "Yaw": 0.0
        }
      },

      "X": -2, "Y": 5, "Z": 0,
      "Pitch": 0, "Roll": 0, "Yaw": 0
    }
  }
}

How can the issue be reproduced?

  1. Ensure settings.json used is Settings.json - front_stereo_and_center_mono.json
  2. source PATH_TO/AirSim/ros/devel/setup.bash
  3. roscd airsim_tutorial_pkgs
    4. cp settings/front_stereo_and_center_mono.json ~/Documents/AirSim/settings.json
  4. Start your Unity simulation here

  5. roslaunch airsim_ros_pkgs airsim_node.launch
  6. in a new pane / terminal

  7. source PATH_TO/AirSim/ros/devel/setup.bash
  8. roslaunch airsim_tutorial_pkgs front_stereo_and_center_mono.launch

Include full error message in text form

Error:   TF_DENORMALIZED_QUATERNION: Ignoring transform for child_frame_id "front_center_body" from authority "/airsim_node" because of an invalid quaternion in the transform (0.000000 0.000000 0.000000 0.000000)
         at line 257 in /tmp/binarydeb/ros-melodic-tf2-0.6.5/src/buffer_core.cpp
Error:   TF_NAN_INPUT: Ignoring transform for child_frame_id "front_center_optical" from authority "/airsim_node" because of a nan value in the transform (0.000000 0.000000 0.000000) (-nan -nan -nan -nan)
         at line 244 in /tmp/binarydeb/ros-melodic-tf2-0.6.5/src/buffer_core.cpp

I think this is a bug in the airsim_ros_wrapper.cpp ROS wrapper code. Has anyone also experienced this issue?

What's better than filing an issue? Filing a pull request :).