ROS Wrapper in C++ for Microsoft AirSim
This repository is a fork of the publishAirsimImgs repository by Marcelino Almeida. It is a preliminary solution to integrate ROS and AirSim plugin till Microsoft provides an alternative one.
Features within this repo:
/airsim/rgb/image_raw
/airsim/depth
/airsim/normals/image_raw
/airsim/segmentation/image_raw
/airsim/depth/camera_info
world
), the position/orientation of the quadcoper (base_link
), and the position/orientation of the camera (camera_frame
)The airsim_img_publisher
package has been tested under ROS Kinetic and Ubuntu 16.04LTS. The source code is released under MIT Licence.
urdf
model of a quadrotor similar to the quarotor’s blueprint in the simulatorinclude
directorybase_frame_id
frame to camera_frame_id
sudo apt-get install libeigen3-dev
cd ~/
git clone https://github.com/Mayankm96/AirSim_ROS.git
./setup.sh
./build.sh
cd ~/catkin_ws/src
https://github.com/Mayankm96/airsim_img_publisher.git
In order to run AirSim, you will have to change the Airsim_ip
and Airsim_port
parameters to match the IP/Ports in which Airsim is running. All these informations can be found in the settings.json
file (located at ~/Documents/AirSim
) for your Airsim configuration. The ports you are looking for are the “LogViewerPort” and the “UdpPort”. Note that the settings.json file have to be configured such that “LogViewerHostIp” and “UdpIp” both have the IP of the computer that will run AirSim.
Set the correct path to AIRSIM_ROOT
in the CMakeLists.txt
file.
To compile the package:
cd ~/catkin_ws
catkin_make
Before running the nodes in the package, you need to run Airsim plugin in the Unreal Engine. In case you are unfamiliar on how to do so, refer to the tutorials available here.
tf
publisher of drone model (DJI M100)If you wish to use the urdf
model of the drone used in AirSim simulator, then
tf_cam_flag
to false
in pubImages.launch
and pubStereoImages.launch
roslaunch airsim_img_publisher publish_tf.launch
Alternately, you may set tf_cam_flag
to true
and allow the node to publish the required transformations on it’s own
NOTE: In the modified blueprint of the drone for UE4, all cameras are downward-facing.
Change the IP and Port configurations in pubImages.launch
to match the settings in which Airsim is running. Then:
roslaunch airsim_img_publisher pubPointCloud.launch
roslaunch airsim_img_publisher octomap.launch
An rviz configuration file can be found in the rviz
directory. This configuration allows a user to see the published images, as well as the tf tree.
rosrun rviz rviz -d ~/catkin_ws/src/airsim_img_publisher/rviz/pclConfig.rviz
This is a client node at (imgPublisher.cpp
) interfaces with the AirSim plugin to retrieve the drone’s pose and camera images (rgb, depth, normals and segmentation).
/airsim/rgb/image_raw
(sensor_msgs/Image)
The rgb camera images.
/airsim/depth
(sensor_msgs/Image)
The depth camera images in 32FC1 encoding.
/airsim/normals/image_raw
(sensor_msgs/Image)
The surface normals image in bgr8
encoding.
/airsim/segmentation/image_raw
(sensor_msgs/Image)
The semantic segmentation labels in bgr8
encoding.
/airsim/camera_info
(sensor_msgs/CameraInfo)
The rgb camera paramters.
/airsim/depth/camera_info
(sensor_msgs/CameraInfo)
The depth camera paramters.
/tf
tf tree with the origin (world
), the position/orientation of the quadcoper (base_frame_id
), and the position/orientation of the camera (frame selected on basis of cameraID
)
Airsim_ip
(server’s IP address), Airsim_port
(server’s port)base_frame_id
Fx
, Fy
, cx
, cz
, width
, height
localization_method
(can be either ground_truth
or gps
)cameraID
(camera on the drone to use (possible values: 0-4))loop_rate
camera_frame_id
and base_frame_id
: tf_cam_flag
This is a client node at (stereoPublisher.cpp
) interfaces with the AirSim plugin to retrieve the drone’s pose and stereo camera images (stereo images, depthmap registered to left camera frame).
/airsim/rgb/image_raw
(sensor_msgs/Image)
The rgb camera images on left camera frame.
/airsim/left/image_raw
(sensor_msgs/Image)
The rgb camera images on left camera frame.
/airsim/right/image_raw
(sensor_msgs/Image)
The rgb camera images on right camera frame.
/airsim/depth_registered/depth
(sensor_msgs/Image)
The depth camera images in 32FC1 encoding on left camera frame.
/airsim/camera_info
(sensor_msgs/CameraInfo)
The rgb camera paramters.
/airsim/depth/camera_info
(sensor_msgs/CameraInfo)
The depth camera paramters.
/tf
tf tree with the origin (world
), the position/orientation of the quadcoper (base_frame_id
), and the position/orientation of the stereo camera
Airsim_ip
(server’s IP address), Airsim_port
(server’s port)base_frame_id
Fx
, Fy
, cx
, cz
, width
, height
Tx
localization_method
(can be either ground_truth
or gps
)loop_rate
base_frame_id
and camera frames: tf_cam_flag