GithubHelp home page GithubHelp logo

feng3245 / gym-donkeycar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tawnkramer/gym-donkeycar

0.0 1.0 0.0 2.95 MB

OpenAI gym environment for donkeycar simulator

License: Other

Python 91.97% Makefile 8.03%

gym-donkeycar's Introduction

OpenAI Gym Environments for Donkey Car

Documentation Status

Donkey Car OpenAI Gym

Installation

  • Install with pip
pip install gym-donkeycar

Example Usage

A short and compact introduction for people who know gym environments, but want to understand this one. Simple example code:

import os
import gym
import gym_donkeycar
import numpy as np

#%% SET UP ENVIRONMENT
exe_path = f"{PATH_TO_APP}/donkey_sim.app/Contents/MacOS/donkey_sim"
port = 9091

env = gym.make("donkey-warehouse-v0", exe_path=exe_path, port=port)

#%% PLAY
obv = env.reset()
for t in range(100):
    action = np.array([0.0,0.5]) # drive straight with small speed
# execute the action
obv, reward, done, info = env.step(action)

Action space

A permissable action is a numpy array of length two with first steering and throttle, respectively. E.g. np.array([0,1]) goes straight at full speed, np.array([-5,1]) turns left etc.

Action Space: Box(2,)

Action names: ['steer', 'throttle']

What you receive back on step

  • obv: The image that the donkey is seeing (np.array shape (120,160,3))
  • reward: a reward that combines game over, how far from center and speed (max=1, min approx -2)
  • done: Boolean. Game over if cte > max_cte or hit != "none"
  • info contains: - cte: Cross track error (how far from center line) - positions: x,y,z - speed: positive forward, negative backward - hit: 'none' if all is good.

example info:

{'pos': (51.49209, 0.7399381, 117.3004),
 'cte': -5.865292,
 'speed': 9.319956,
 'hit': 'none'}

Environments

  • "donkey-warehouse-v0"
  • "donkey-generated-roads-v0"
  • "donkey-avc-sparkfun-v0"
  • "donkey-generated-track-v0"

Credits

Original Source Code

Tawn Kramer - https://github.com/tawnkramer/gym-donkeycar

Roma Sokolkov - https://github.com/r7vme/gym-donkeycar cloned with permission from https://github.com/tawnkramer/sdsandbox

Release Engineer

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

gym-donkeycar's People

Contributors

tawnkramer avatar leigh-johnson avatar bleyddyn avatar alexandrepoisson avatar araffin avatar jrabary avatar simeneide avatar masato-ka avatar

Watchers

James Cloos 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.