This repository is meant to integrate ROS and AirSim plugin using the python APIs available for the simulator.
The airsim_ros_client
package has been tested under ROS Kinetic and Ubuntu 16.04LTS. The source code is released under MIT License.
The mesh of DJI M-100 was downloaded from DJI website (link). DJI reserves all rights to this material.
Install the python depenencies:
# AirSim APIs
pip install airsim
- To build from source, clone the latest version from this repository into your catkin workspace
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/Mayankm96/airsim_ros_client.git
- To compile the package:
cd ~/catkin_ws
catkin_make
source devel/setup.bash
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.
A sample settings.json
file used to run the simulator with the ROS package is available here. Copy it to the ~/Documents/AirSim
directory to use the package without any further modifications.
To use the urdf
model of the drone used in AirSim simulator, then run:
roslaunch airsim_ros_client publish_tf.launch
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_ros_client pubImages.launch
This is a client node at (img_publisher.py
) interfaces with the AirSim plugin to retrieve the drone's pose and camera images (rgb, depth).
-
/airsim/rgb/image_raw
(sensor_msgs/Image)The rgb camera images in
rgba8
encoding. -
/airsim/depth
(sensor_msgs/Image)The depth camera images in
32FC1
encoding. -
/airsim/camera_info
(sensor_msgs/CameraInfo)The rgb camera paramters.
-
/airsim/depth/camera_info
(sensor_msgs/CameraInfo)The depth camera paramters.
-
/airsim/pose
(geometry_msgs/PoseStamped)The position/orientation of the quadcoper (
base_link
) -
/odom
(nav_msgs/Odometry)The odometry of the quadcoper (
base_link
) in theworld
frame -
/tf
tf tree with the origin (
world
), the position/orientation of the quadcoper (base_link
)
- Camera parameters:
Fx
,Fy
,cx
,cz
,width
,height
- Publishing frequency:
loop_rate
This is a client node at (follow_trajectory.py
) interfaces with the AirSim plugin to follow a trajectory.
-
/trajectory/spline_marker_array
(visualization_msgs/MarkerArray)An array of waypoints to follow.
- Velocity:
velocity