XPlaneROS is a ROS wrapper for the XPlane-11 flight simulator.

Overview

XPlaneROS

First View

XPlaneROS is a ROS wrapper for the XPlane-11 flight simulator. The wrapper provides functionality for extracting aircraft data from the simulator and feeding control commands to control the aircraft in the simulator.
The main advantage is due to the fact that XPlane is a realistic simulator and thereby provides more realistic dynamics, responses and images.

XPlaneROS interfaces with XPlane simulator using the XPlaneConnect plugin.

Compatibility

XPlaneROS has been tested with the following systems/versions :

Ubuntu 18.04 
ROS-Melodic
XPlane-11.50
Python 3

The specs of the system are given as follows:

Processor : Intel® Core™ i7-10750H CPU @ 2.60GHz × 12 
Graphics  : GeForce GTX 1660 Ti/PCIe/SSE2
OS Type   : 64-bit
RAM       : 15.4 GiB

There's a possibility that if the system does not have enough computational power, then it can decrease the frame rate in XPlane and can lead to the system getting stuck. We noticed that the XPC interface crashes in that case.

Setup

There are three main components needed to run XPlaneRos: Xplane-11, XPlaneConnect, and ROSplane.

XPlane-11 Setup

Install the XPlane-11 simulator.

XPlaneConnect Setup

First we need to install the XPlaneConnect (XPC) plugin. Follow the steps give in the XPlaneConnect repository or in their Getting Started page.

Try to use the pre-compiled binary they provide. After following the steps mentioned in the repo, open XPlane and start a flight. If you see the plugin under the Plugin Admin, try running some of the example codes given in XPlane Connect (basicExample.py or monitorExample.py in the Python3/src folder).

If these are running you are good to go. If not, try the fixes mentioned below.

XPlaneConnect Fixes

There is a chance the plugin might not have loaded correctly. If you don't see the plugin under the Plugin Admin while running XPlane, check the Log.txt file in the XPlane-11 directory.

If you received the error dlerror:/home/ /X-Plane 11/Resources/plugins/XPlaneConnect/lin.xpl: wrong ELF class: ELFCLASS32 , this is probably an OS compatibility issue with the pre-built binaries. #151

You will need to clone the XPC repo and build yourself. Go to XPlaneConnect/xpcPlugin within the cloned repo and run the commands

mkdir build 
cd build
cmake .. 
cmake --build .

When building, if the compiler could not find bits/c++config.h file, then run the following command.
sudo apt-get install gcc-multilib g++-multilib

Building will create new .xpl files under a folder named XPlaneConnect in the build directory. Replace the old .xpl in the XPlaneConnect folder in the plugins of XPlane.

After building and replacing the .xpl, if you get the error dlerror:/home/ /X-Plane 11/Resources/plugins/XPlaneConnect/64/lin.xpl: undefined symbol: _ZN3XPC15MessageHandlers21CamCallback_RunwayCamEP20XPLMCameraPosition_tiPv , the try resolving this by adding CameraCallbacks.cpp in the CMakeLists.txt in both the add_library commands.

ROSplane Setup

Prerequisites

  1. If not already done so, install ROS (Desktop-Full is recommended).

  2. If not already done so, create a catkin workspace with catkin tools:

sudo apt-get install python-catkin-tools
mkdir -p ~/xplane_ros_ws/src
cd ~/xplane_ros_ws
catkin init

After that we will install our fork of ROSplane:

cd ~/xplane_ros_ws/src
git clone -b xplane/main [email protected]:castacks/rosplane.git 
git clone https://github.com/byu-magicc/rosflight_plugins.git
git clone https://github.com/rosflight/rosflight.git
cd rosflight/
git submodule update --init --recursive

As a sanity check, try building running the ROSplane code once along with gazebo (you may also need to install eigen_stl_containers with sudo apt-get install ros-melodic-eigen-stl-containers).

catkin build
source ~/xplane_ros_ws/devel/setup.bash
roslaunch rosplane_sim fixedwing.launch

Once Gazebo launches, you can press the "play" button in the bottom left corner, and the fixedwing should take off.

For convenience, you can add the source ~/xplane_ros_ws/devel/setup.bash statement in your ~/.bashrc file.

Now! You've checked out ROSplane and finally we're ready to move onto XPlaneROS!

XPlaneROS Setup

Installation

  1. Move to your catkin workspace:
cd ~/xplane_ros_ws/src
  1. Install system dependencies:
sudo apt-get install python-wstool python-catkin-tools
  1. Download repo using a SSH key or via HTTPS:
git clone [email protected]:castacks/xplane_ros.git # SSH
git clone https://github.com/castacks/xplane_ros.git # HTTPS
  1. Source and compile:
catkin build
source ~/xplane_ros_ws/devel/setup.bash

Running XPlaneROS

  1. Open X-Plane 11 (X-Plane 11/X-Plane_x86_64).
  2. Select New Flight.
  3. In the LOCATION panel, set the location to Butler airport (ID : KBTP) with Runway 26.
  4. Click Start Flight.

You can then start XPlaneROS with

roslaunch xplane_ros default.launch

The default.launch provides the bare-minimum structure in order to interface with XPlane. The xplane_ros_wrapper node will provide the odometry data from XPlane and it will listen to Xplane commands from the user application on the topic /xplane/my_control and then send them to XPlane.

The default.launch file also has a launch command for the rviz visualization. Uncomment that to load a .perspective file with a top down visualization of the odometry.

Troubleshooting XPlaneROS

Here we provide solutions for some issues you might encounter.

  1. eigen-stl-containers are missing :
sudo apt install ros-melodic-eigen-stl-containers
  1. Build error which says CMAKE path does not have 'rosplane'
catkin build --continue-on-failure

You might have to run this command twice

  1. module export error related to python If you're running it on Melodic using Python2.7, then try to modify the shebang in xplane_ros with this :
#! /usr/bin/env python2.7

Running XPlaneROS with ROSplane

(Assumes familiarity with ROSplane)
StateReader.py also packs data in the format needed for ROSplane and publishes that. You can run the ROSplane controller along with xplane_ros by running :

cd ~/xplane_ros_ws/src/xplane_ros
bash utils/pattern_following.sh

This will run the default.launch and xplane_fw.launch file. The plane will takeoff and start the pattern following.

In case you want to try tuning some of the control loops while following the pattern, the rqt_reconfigure will be opened by the launch file. You can tweak the parameters there.

Press the Refresh button incase you don't see anything. After that the relevant config parameters should be visible once you click on fixedwing/autopilot (for PID controls) and fixedwing/pathfollower (for vector field parameters).

Takeoff

Pattern

Tuning ROSplane Parameters

We have tuned the parameters for Cessna_172 (the default aircraft in XPlane) but feel free to try it out for other aircraft yourself.

roslaunch xplane_ros default.launch rosplane_tuner:=true

Under the rqt_reconfigure gui you should see fixedwing and xplane_ros . Click on both of them.
The fixedwing setup contains the dynamic reconfigure for rosplane parameters. The nomenclature should be obvious once you take a glance at the params and cfg files provided in rosplane. Those are the tuning parameters for the PID loops implemented in rosplane.

The xplane_ros portion of the gui provides a kind of easy-to-use interface for you to give certain commands and see the response.
For example, suppose you want to tune the roll attitude parameters. Tick the hold_roll box and untick the other boxes. This means that the autopilot_tuner node will ignore all the other commanded values and will only run the roll_hold() function to set the current phi to phi_c. You can set the value for phi_c using the roll_step in the rqt_reconfigure gui.
In the rqt_plot you will be able to visualise the commanded roll, current roll and also the aileron commands output by the roll_hold() function.

NOTE : The control surfaces correponding to the unticked boxes will be defaulted to what it was just before you unticked them.

Henceforth, you should be able to experiment with other control loops like pitch, heading, throttle, etc (each corresponding to a function in controller_base.cpp and controller_example.cpp in rosplane).

For some more idea about what each code does, head over here.

Citation

@misc{baijal_patrikar_moon_scherer_oh_2021,
  title={XPlaneROS : ROS Wrapper for Autonomous Fixed Wing Applications},
  url={https://kilthub.cmu.edu/articles/software/XPlaneROS_ROS_Wrapper_for_Autonomous_Fixed_Wing_Applications/16589924},  
  publisher={Carnegie Mellon University},
  author={Baijal, Rohan and Patrikar, Jay and Moon, Brady and Scherer, Sebastian and Oh, Jean},
  year={2021},
  month={Sep},
  DOI={10.1184/R1/16589924}
}
Owner
AirLab Stacks
Open Source software from the AirLab (Robotics Institute, Carnegie Mellon University)
AirLab Stacks
linorobot2 is a ROS2 port of the linorobot package

linorobot2 is a ROS2 port of the linorobot package. If you're planning to build your own custom ROS2 robot (2WD, 4WD, Mecanum Drive) using accessible parts, then this package is for you. This reposit

linorobot 195 Dec 29, 2022
I automated the lumberjack game on telegram, by recognising pixels and using pyautogui module

Lumberjack Automated: @gamebot According to the official documentation, @gamebot is a demo bot for the Telegram Gaming Platform.` It provides some sam

Yew Chong 1 Dec 07, 2021
A zombie game using Kinetic. You can control players using fingers

This is Eden Park's portpolio: Works, projects and practices This repository can be used to show the potential employers to check my works, code and p

Eden Park 4 May 16, 2022
Among AIs is a (prototype of) PC Game we developed as part of the Smart Applications course @ University of Pisa.

Among AIs is a PC Game we developed as part of the Smart Applications course @ Department of Computer Science of University of Pisa, under t

Gabriele Pisciotta 5 Dec 05, 2021
PyCheckers - A classic board game implemented in pygame

PyCheckers! A classic board game implemented in pygame! Complete with every feature you need to play checkers! (including handsome sprites drawn by a

helaxious 1 Jan 21, 2022
Exposè for i3 WM. Fork of https://gitlab.com/d.reis/i3expo to fix crashes and improve features/usability

Overwiew Expo is an simple and straightforward way to get a visual impression of all your current virtual desktops that many compositing window manage

137 Nov 03, 2022
Typing test and practice on command line without the need of any internet connection

Terminal-Typing-Test Typing test and practice on command line without the need of any internet connection About CLI based typing test and practice tha

Angad Deep Singh 3 Oct 19, 2022
This is a simple telegram bot for the game Pyal, a word guessing game inspired by Wordle

Pyal Telegram Bot This is a simple telegram bot for the game Pyal, a word guessing game inspired by Wordle. How does it work? Differently from the ori

Rafael Omiya 4 Oct 06, 2022
A python program for playing rock-paper-scissors with computer .

Rock_Paper_Scissors_Cut A time passing famous hand game known as rock paper scissors cut game. Starting from children to adults everyone plays this ga

Arghya Banerjee 1 Dec 16, 2021
PyUnity is a Python implementation of the Unity Engine, written in C++

PyUnity is a Python implementation of the Unity Engine, written in C++. This is just a fun project and many features have been taken out to make it as easy as possible to create a scene and run it.

PyUnity 206 Jan 03, 2023
A small module for creating a card deck, used for making card games

card-deck This module can be used to create small card games such as BlackJack etc.. To initialize the deck, use: Deck() To shuffle the deck, use: Dec

4 Dec 31, 2021
Racing Fire - A simple game made with pygame.

Racing Fire A simple game in the making. Using pygame, this game is made to feel like an old arcade game. I developed a simple controller for it with

Builder212 1 Nov 09, 2021
Pendulum Simulation using Pygame

Pendulum project, built using pygame and math modules.

3 Nov 09, 2021
Trio Assembly Snakemake Workflow

Trio Assembly Snakemake Workflow Input HiFi reads for child in bam format Either

Juniper A. Lake 1 Jan 28, 2022
Snake (PyGame-based) port for Minecraft:Bedrock Edition using PEWSAPI

Snake_PEWSAPI Snake (PyGame-based) port for Minecraft:Bedrock Edition using PEWSAPI And we are not going to make any change to the original Snake sour

Azuki 1 Mar 17, 2022
GardenZen Prototype 2.5D Game

Relaxing 2.5D Game about gardening a small farm and growing food, plants and other things. Follow my Youtube Devlog for further details (see about me section)

Paul 3 Apr 15, 2022
Atari2600 Training / Evaluation with RLlib

Training Atari2600 by Reinforcement Learning Train Atari2600 and check how it works! How to Setup You can setup packages on your local env. $ make set

Jinwoo Park (Curt) 1 Dec 12, 2021
This Country Hangman game written in Python.

country-name-guess-hangman-game This Country Hangman game written in Python. Visit https://example.com to play the game. Description How to play this

Aytaç Kaşoğlu 1 Oct 30, 2021
Flappy Bird Game using Pygame in Python

Flappy Bird Game using Pygame in Python Demo Pages Hello dear, hope you are very well! I created Flappy Bird Game using Pygame ( Pygame is a cross-pla

Datt Panchal 3 Feb 05, 2022
Game-of-life - A simple python program to simulate and visualise the Conway's Game of life

Conway's game of life A simple python program to simulate and visualise the Conw

Dhravya Shah 3 Feb 20, 2022