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
A game made similar as space inveders with pygame

space-inveders-pygame a game made similar as space inveders with pygame . . . if you are using it make sure to change audio and imgs file i do no own

Volt_L18 2 Dec 26, 2021
A menu for pygame. Simple, and easy to use

pygame-menu Source repo on GitHub, and run it on Repl.it Introduction Pygame-menu is a python-pygame library for creating menus and GUIs. It supports

Pablo Pizarro R. 411 Dec 27, 2022
Overview: copain, your friendly AI framework to learn and play games

Overview: copain, your friendly AI framework to learn and play games Interface fceux with python and run reinforcement learning. Compatibility Current

fcharras 1 Dec 16, 2021
Searches the word list in Wordle based on search pattern.

Wordle Searcher Searches the word list in Wordle based on search pattern. Warning: like all forms of cheating, it trivializes the game, and robs you o

Tyler Martin 1 Jan 29, 2022
Dota2 AI bot - Last Order Dota2 Solo AI

Last Order Dota2 Solo AI 该库提供一个由强化学习训练出的Dota2影魔solo智能体。该智能体通过自我对战的训练方式训练,从随机动作开始学习复杂的策略。玩家可以与该智能体进行影魔solo对战。 对战规则 1.物品方面不可以出凝魂之露,灵魂之戒,魔瓶,真眼。 2.不可以吃符,或

bilibili 365 Jan 05, 2023
Tic Tac Toe Game build with Python

Tic Tac Toe Game Description two players who take turns marking the spaces in a three-by-three grid with X or O. The player who succeeds in placing th

Kemal Kochekov 2 Jan 21, 2022
You want to uto-update your private minecraft client? Give this to developer and enjoy!

minecraft-hack-installer You want to uto-update your private minecraft client? Give this to developer and enjoy! Steps to do: Install libraries: pip i

EuropeStudio 1 Jun 03, 2022
Snake Game in Python

Snake game is one of the most popular arcade games of all time. In this game, the main objective of the player is to catch the maximum number of fruits without hitting the wall or itself.

Pavan Ananth Sharma 4 Jul 05, 2022
A small script to help me solve Wordle because I'm that lazy

Wordle Solver A small script to help me solve Wordle because I'm that lazy. Warning: I didn't write this to be efficient nor elegant at all, so you'll

K4YT3X 3 Feb 11, 2022
Fully functional BlackJack game with a graphical user interface.

BlackJack Welcome to BlackJack! This game is fully functional, with a casino sound package integrated using Pygame, dynamic game logic developed using

Shwetang Desai 2 Jan 10, 2022
Chesston (Chess+Python) is a two-player chess game with graphical user interface written in PyQt5

♟️ Chesston (Chess+Python) is a two-player chess game with graphical user interface written in PyQt5. 💿 Dependencies This program uses Py

6 May 26, 2022
Advanced guessing game made in only python.

Guessing Game This is a number guessing game written in python which consists of three modes; easy,medium and hard. Each mode contains there own diffi

Ayza 2 Nov 30, 2021
Jogo Flappy Bird com phyton e phygame

Flappy-Bird Tecnologias usadas Requisitos para inicializar o jogo: Python faça o download em: https://www.python.org/ Pygame faça o download em: https

João Guilherme 1 Dec 06, 2021
A very bad wordle solver to help me solve the daily wordle

Wordle Solver A very bad wordle solver to help me solve the daily wordle on https://www.powerlanguage.co.uk/wordle/ TODO list take into account letter

Logan Anderson 4 Feb 03, 2022
OpenGL experiments with Pygame & ModernGL

pygame-opengl OpenGL experiments with Pygame & ModernGL TODO Skybox & Reflections Post-process effects (motion blur, color correction, etc..) Normal m

Kadir Aksoy 4 Oct 28, 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
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
用于 blivechat 的图形界面

blivechat GUI 用于 blivechat 的图形界面。 有朋友在搞 Vtuber,像 blivechat 类似的项目能通过自定义 CSS 的方式在 OBS 上添加一个非常好看的聊天栏。但是想要在桌面端看到弹幕的话得要再开一个浏览器页面,十分不方便。就想写一个背景透明的浮窗浏览器。 挺喜欢

Silence 11 Dec 29, 2022
Database of relevant Minecraft OG usernames

Introduction In this repository we want to collect names and words that get the "OG Name" badge on laby.net. We want the community to be able to contr

LabyMod 19 Dec 02, 2022
A fully automated system that transforms Twitch clips into gaming compilations

A fully automated system that transforms Twitch clips into gaming compilations Authors: Christian C., Moritz M., Luca S. Related Projects: Neural Netw

215 Dec 27, 2022