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
Scalable computer implemented in the game of life.

scalable-gol-computer This is a computer built in Conway’s game of life. It supports variable sizes of 8, 16 and 32 bit. Maximum program size: 256 lin

Nicolas Loizeau 19 Nov 19, 2022
It just a cli based snake game written in Python.

Snake Game in Python Things that I learned in this project: OOP in Python. Clean code. The curses library. How to run the game You need to clone this

Kevin Marques 7 Oct 01, 2022
Wordle is a web-based word game. Players have six attempts to guess a five-letter word;

Wordle is a web-based word game. Players have six attempts to guess a five-letter word; feedback is given for each guess, in the form of colored tiles, indicating when letters match or occupy the cor

Abhishek 2 May 21, 2022
Game using Python

🎡 Rock-Paper_Scissor Game Using Python Beginner Friendly Easy to use ♟ Want to Play this? Clone this repository Open in any IDE(for eg. VS Code, PyCh

Akash Kumar 1 Oct 17, 2021
This is a simple game made using pygame.

Ball breaker This is a simple game made using pygame game view The game view have been updated wait for the new view to be uploaded Game_show.mp4 Lear

Rishikesh Kumar 3 Nov 05, 2021
A Simple Scissor Paper Rock Game On Python Using Pygame.

Scissor Paper Stone Game Using Pygame This is a simple GUI based game made on pygame python. Installation Run code on your machine: git clone https:

Dipin Adhikari 0 Mar 21, 2022
Brawl Stars open source server for v20

Laser Scratch Brawl Stars open source server for v20! Implemented Features Battle End Leaderboard Player Profile Lobby Info Menu Notifications Club Wa

TheIke 17 Nov 19, 2022
A near-exact clone of google chrome's no internet game, or the "google dinosaur game", with some additions and extras.

dinoGame A near-exact clone of google chrome's no internet game, or the "google dinosaur game", with some additions and extras. Installation Download

1 Oct 26, 2021
Flappy Bird hack using Deep Reinforcement Learning (Deep Q-learning).

Using Deep Q-Network to Learn How To Play Flappy Bird 7 mins version: DQN for flappy bird Overview This project follows the description of the Deep Q

Yen-Chen Lin 6.4k Dec 30, 2022
PyCharge is an open-source computational electrodynamics Python simulator

PyCharge PyCharge is an open-source computational electrodynamics Python simulator that can calculate the electromagnetic fields and potentials genera

Matthew Filipovich 28 Jan 03, 2023
2DMC is an abrrieviation for 2 Dimensional Minecraft.

2DMC 2DMC is an abrrieviation for 2 Dimensional Minecraft. This idea is originally created and implemented by Griffpatch on Scratch. This is a persona

DaNub 5 Nov 06, 2022
Wordle for the terminal, writen in python

Wordle Wordle in the terminal, written in python Simply run bash run.sh in your terminal to run. This creates a virtual environment, installs the depe

Matthew Lidell 1 Feb 09, 2022
Multiple hacks that breaks the game

Blooket-Hack All of the cheats are based on a game mode.

glizzz_y 484 Feb 25, 2022
An optimal solution finder for the game Wordle, written in Python

wordle-solver: a nearly-optimal computer player for Wordle Wordle is an interesting word guessing game. This program plays it very well, taking only 3

4 Jun 13, 2022
Python Knots and Crosses game, with customizable markers and more!

Knot-and-Crosses Python Knots and Crosses game, with customizable markers and more! Features: Ability to change your marker Ability to change how many

4 Nov 07, 2021
uses Entropy to find the best next guess for Wordle, given the color clues

WordleSolver uses Entropy to find the best next guess for Wordle, given the color clues use player.py and enter in the string for the suggested clue w

Steve Earth 1 Jan 26, 2022
N-Queens game made using pygame library

N-Queens N-Queens game using pygame for AIML201 Testing: 1. git clone https://github.com/python-game-dev/N-Queens.git 2. cd N-Queens 3. python main.py

1 Sep 24, 2021
An interactive pygame implementation of quadtree spatial quantization

QuadTree-py An interactive pygame implementation of quadtree spatial quantization Contents Installation Usage API Reference TODO Installation Clone th

Ethan 1 Dec 05, 2021
This is text based adventure game

CHOOSE-YOUR-OWN-ADVENTURE This is text based adventure game CONTRIBUTORS Aditya binukumar Srishti Sharma Shiva Tripathi Tanishq Tanwar ABOUT Theme: Ho

Tanishq Tanwar 3 May 31, 2022
Open source Board Games Like Tic Tac Toe, Connect 4, Ludo, Snakes and Ladder etc...

Board-Games What to do... Add Board games like Tic Tac Toe, Connect 4, Ludo, Snakes and Ladder etc... How to do... Fork the repo Clone the repo git cl

Bit By Bit 1 Oct 10, 2022