GithubHelp home page GithubHelp logo

lwy0518 / jsbsim-gym Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zgoddard3/jsbsim-gym

0.0 0.0 0.0 79 KB

A Gym environment for navigation with an F-16 model simulated in JSBSim.

Python 97.22% GLSL 2.78%

jsbsim-gym's Introduction

JSBSim Gym Environment

image

Usage

You can train a Soft Actor-Critic (SAC) agent on the environment by simply running:

python train.py

Once the agent is trained, you can watch it fly to a random goal using:

python test.py

A pretrained agent can also be downloaded here to skip the training step.

Important Files

The main files defining the environment and feature transformation are jsbsim_gym/jsbsim_gym.py and jsbsim_gym/features.py. The files under jsbsim_gym/visualization are auxiliary files for rendering the environment.

  • jsbsim_gym.py: This file defines the environment which wraps a JSBSim simulation which runs an F-16 aerodynamics model. The environment class defines a goal and reward function for the agent. Additional shaping rewards are also defined in a Gym wrapper in this file.
  • features.py: This file defines a feature extractor for the JSBSim environment. This is the feature vector I found to be most beneficial for this task. Further details can be found in the comments in this file.
  • train.py: This is a short script for training a SAC agent on the JSBSim environment. The hardcoded parameters should be sufficient to get decent results. The script takes about 12 hours to run on my desktop though time my vary depending on hardware.
  • test.py: This script will run the trained agent for one episode while visualizing the environment. The visualization will automatically be saved to an MP4 video and GIF animation.

jsbsim-gym's People

Contributors

zgoddard3 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.