rogerscristo / GYM_XPLANE_ML

GYM Environment for XPlane. Reinforcement Learning and Autonomous Piloting.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


XPlane_ML_Reinforcement_Learning_Autopilot

This project documents set up of Reinforcement learning environment for flight control. This will enable each user/learner/student/flight enthusiast to come with their own RL algorithm that can interact with and control in real time an aircraft in a simulation environment. The simulator used is X-Plane (the flight environment). This gives a realistic environment to work with together with parameters to keep the simulation as close to reality as possible.

Update: Use the leaderboard wiki Page--> (Leaderboard) to add details of your own scenario or algorithm.


Agent-Environment Interaction Flow


alt-text


Example Training Episode


alt-text


Action Space Parameters


The action space parameters. Select from the list the appropriate parameters for any task or scenario . For example one might decide that the first 4 parameters are important for a defined task.

Action Space Parameter Action type Action Value Range
Latitudinal Stick Box [-1,1]
Longitudinal Stick Box [-1,1]
Rudder Pedals Box [-1,1]
Throttle Box [-1/4,1]
Gear Discrete 0,1
Flaps Box [0,1]
Speedbrakes Box [-0.5,1.5]

State Space Parameters


The state space parameters are well documented in XPlane Data Ref . The number of state space parameters will depend on the task. It is possible to use a derived state parameter. Usually a UDP connection (XPlaneConnect) is required to read this parameter from XPlane. An example of how to read parameter from UDP connection is shown below:

client = xpc.XPlaneConnect() # UDP connector
client.getDREF("sim/flightmodel/position/P")[0][0] # moment P
client.getPOSI() # get the lat, long,altitude, pitch, roll, heading, gear

A typical state space parameter configuration is shown below:

State Space Parameter State type State Value Range
velocity_x Box [0,120]
velocity_y Box [0,120]
delta_heading Box [-300,300]

The range of each parameter value would also depend on the configuration.

client (UDP connector) already has a function getPOSI that helps read the latitude, longitude, altitude, pitch, roll, heading. Other parameters could be added by using the client getDREF function. Note that the string "sim/flightmodel/position/P" is gotten from the Xplane Dataref referenced earlier (XPlane Data Ref)


Flight Dashboard


To learn more about this go to : FlightDataVizDashBoard alt-text


Requirements



General setup


  • GYM XPLANE ENVIRONMENT
  • MULTI AGENT ENVIRONMENT SET UP (Work in progress)

TO DO

  • Use XVFB for fake display.
  • Docker support (under test)
  • Algorithm implementations (high priority)
  • Real Time flight and data visualization interface.

About

GYM Environment for XPlane. Reinforcement Learning and Autonomous Piloting.


Languages

Language:Python 94.7%Language:Lua 2.2%Language:HTML 1.8%Language:Dockerfile 1.2%Language:Shell 0.2%