Skip to content

Latest commit

 

History

History
162 lines (122 loc) · 7.42 KB

airsim_ros_pkgs.md

File metadata and controls

162 lines (122 loc) · 7.42 KB

airsim_ros_pkgs

A ROS wrapper over the AirSim C++ client library.

Setup

Build

  • Build AirSim
git clone https://github.com/Microsoft/AirSim.git;
cd AirSim;
./setup.sh;
./build.sh;
  • Build ROS package
cd ros;
catkin_make; # or catkin build

Running

source devel/setup.bash;
roslaunch airsim_ros_pkgs airsim_node.launch;
roslaunch airsim_ros_pkgs rviz.launch;

Using AirSim ROS wrapper

The ROS wrapper is composed of two ROS nodes - the first is a wrapper over AirSim's multirotor C++ client library, and the second is a simple PD position controller.
Let's look at the ROS API for both nodes:

AirSim ROS Wrapper Node

Publishers:

Subscribers:

Services:

Parameters:

  • /airsim_node/update_airsim_control_every_n_sec [double]
    Set in: $(airsim_ros_pkgs)/launch/airsim_node.launch
    Default: 0.01 seconds.
    Timer callback frequency for updating drone odom and state from airsim, and sending in control commands.
    The current RPClib interface to unreal engine maxes out at 50 Hz.
    Timer callbacks in ROS run at maximum rate possible, so it's best to not touch this parameter.

  • /airsim_node/update_airsim_img_response_every_n_sec [double]
    Set in: $(airsim_ros_pkgs)/launch/airsim_node.launch
    Default: 0.01 seconds.
    Timer callback frequency for receiving images from all cameras in airsim.
    The speed will depend on number of images requested and their resolution.
    Timer callbacks in ROS run at maximum rate possible, so it's best to not touch this parameter.

Simple PID Position Controller Node

Parameters:

  • PD controller parameters:

    • /pd_position_node/kd_x [double],
      /pd_position_node/kp_y [double],
      /pd_position_node/kp_z [double],
      /pd_position_node/kp_yaw [double]
      Proportional gains

    • /pd_position_node/kd_x [double],
      /pd_position_node/kd_y [double],
      /pd_position_node/kd_z [double],
      /pd_position_node/kd_yaw [double]
      Derivative gains

    • /pd_position_node/reached_thresh_xyz [double]
      Threshold euler distance (meters) from current position to setpoint position

    • /pd_position_node/reached_yaw_degrees [double]
      Threshold yaw distance (degrees) from current position to setpoint position

  • /pd_position_node/update_control_every_n_sec [double]
    Default: 0.01 seconds

Services:

  • /airsim_node/VEHICLE_NAME/gps_goal [Request: srv/SetGPSPosition]
    Target gps position + yaw.
    In absolute altitude.

  • /airsim_node/VEHICLE_NAME/local_position_goal [Request: srv/SetLocalPosition
    Target local position + yaw in global NED frame.

Subscribers:

  • /airsim_node/origin_geo_point airsim_ros_pkgs/GPSYaw
    Listens to home geo coordinates published by airsim_node.

  • /airsim_node/VEHICLE_NAME/odom_local_ned nav_msgs/Odometry
    Listens to odometry published by airsim_node

Publishers:

Global params

  • Dynamic constraints. These can be changed in dynamic_constraints.launch:
    • /max_vel_horz_abs [double]
      Maximum horizontal velocity of the drone (meters/second)

    • /max_vel_vert_abs [double]
      Maximum vertical velocity of the drone (meters/second)

    • /max_yaw_rate_degree [double]
      Maximum yaw rate (degrees/second)

Misc

Windows Subsytem for Linux on Windows 10

  • WSL setup:

  • Setup for X apps (like RViz, rqt_image_view, terminator) in Windows + WSL

    • Install Xming X Server.
    • Find and run XLaunch from the Windows start menu.
      Select Multiple Windows in first popup, Start no client in second popup, only Clipboard in third popup. Do not select Native Opengl.
    • Open Ubuntu 16.04 / 18.04 session by typing Ubuntu 16.04 / Ubuntu 18.04 in Windows start menu.
    • Recommended: Install terminator : $ sudo apt-get install terminator.
      • You can open terminator in a new window by entering $ DISPLAY=:0 terminator -u.