Metadata-Version: 2.1
Name: urdfenvs
Version: 0.5.0
Summary: Simple simulation environment for robots, based on the urdf files.
Home-page: https://maxspahn.github.io/gym_envs_urdf/
License: GPL-3.0-or-later
Keywords: robotics,motion-planning,simulation
Author: Max Spahn
Author-email: m.spahn@tudelft.nl
Maintainer: Max Spahn
Maintainer-email: m.spahn@tudelft.nl
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Provides-Extra: keyboard
Requires-Dist: gym (>=0.22,<0.23)
Requires-Dist: motion-planning-scenes (>=0.4.0,<0.5.0)
Requires-Dist: multiprocess (>=0.70.12,<0.71.0) ; extra == "keyboard"
Requires-Dist: numpy (>=1.19,<1.24)
Requires-Dist: pybullet (>=3.2.1,<4.0.0)
Requires-Dist: pynput (>=1.7.6,<2.0.0) ; extra == "keyboard"
Requires-Dist: yourdfpy (>=0.0.52,<0.0.53)
Project-URL: Documentation, https://maxspahn.github.io/gym_envs_urdf/
Project-URL: Repository, https://github.com/maxspahn/gym_envs_urdf
Description-Content-Type: text/markdown

Generic URDF robots
===================

[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/maxspahn/gym_envs_urdf.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/maxspahn/gym_envs_urdf/context:python)

### Generic URDF robots

In this package, generic urdf robots and a panda gym environment are available.
The goal is to make this environment as easy as possible to deploy. Although, we used the
OpenAI-Gym framing, these environments are not necessarly restricted to
Reinforcement-Learning but rather to local motion planning in general.

<table>
 <tr>
  <td> Point Robot </td>
  <td> Point Robot with Keyboard Input </td>
  <td> Non-Holonomic Robot </td>
 </tr>
 <tr>
  <td> <img src="https://raw.githubusercontent.com/maxspahn/gym_envs_urdf/master/docs/source/img/pointRobot.gif" width="250" height="250"/> </td>
  <td> <img src="https://raw.githubusercontent.com/maxspahn/gym_envs_urdf/master/docs/source/img/pointRobotKeyboardInput.gif" width="250" height="250"/> </td>  
  <td> <img src="https://raw.githubusercontent.com/maxspahn/gym_envs_urdf/master/docs/source/img/boxerRobot.gif" width="250" height="250"/> </td>
 </tr>
</table>

<table>
 <tr>
  <td> Tiago Robot </td>
  <td> Tiago Robot with Keyboard Input </td>
 </tr>
 <tr>
  <td> <img src="https://raw.githubusercontent.com/maxspahn/gym_envs_urdf/master/docs/source/img/tiago.gif" width="250" height="250"/> </td>
  <td> <img src="https://raw.githubusercontent.com/maxspahn/gym_envs_urdf/master/docs/source/img/tiagoKeyboardInput.gif" width="250" height="250"/> </td>
 </tr>
</table>

<table>
 <tr>
  <td> Panda Robot </td>
  <td> Albert Robot </td>
  </tr>
 <tr>
  <td> <img src="https://raw.githubusercontent.com/maxspahn/gym_envs_urdf/master/docs/source/img/panda.gif" width="250" height="250"/> </td>
  <td> <img src="https://raw.githubusercontent.com/maxspahn/gym_envs_urdf/master/docs/source/img/albert.gif" width="250" height="250"/> </td>
  </tr>
</table>

Getting Started
================

This is the guide to quickle get going with urdf gym environments.

Pre-requisites
==============

-   Python &gt;3.6, &lt;3.10
-   pip3
-   git

Installation
============

You first have to downlad the repository

``` {.sourceCode .bash}
git clone git@github.com:maxspahn/gym_envs_urdf.git
```

Then, you can install the package using pip as:

``` {.sourceCode .bash}
pip3 install .
```

Optional: Installation with poetry
==================================

If you want to use [poetry](https://python-poetry.org/docs/), you have
to install it first. See their webpage for instructions
[docs](https://python-poetry.org/docs/). Once poetry is installed, you
can install the virtual environment with the following commands. Note
that during the first installation `poetry update` takes up to 300 secs.

``` {.sourceCode .bash}
poetry install
```

The virtual environment is entered by

``` {.sourceCode .bash}
poetry shell
```

Inside the virtual environment you can access all the examples.

Examples
========

Run example
-----------

You find several python scripts in
[examples/](https://github.com/maxspahn/gym_envs_urdf/tree/master/examples).
You can test those examples using the following (if you use poetry, make
sure to enter the virtual environment first with `poetry shell`)

``` {.sourceCode .python}
python3 point_robot.py
```

Replace point_robot.py with the name of the script you want to run.

Use environments
----------------

In the `examples`, you will find individual examples for all implemented
robots. Environments can be created using the normal gym syntax. Gym
environments rely mostly on three functions

-   `gym.make(...)` to create the environment,
-   `gym.reset(...)` to reset the environment,
-   `gym.step(action)` to step one time step in the environment.

For example, in
[examples/point_robot.py](https://github.com/maxspahn/gym_envs_urdf/blob/master/examples/point_robot.py),
you can find the following syntax to `make`, `reset` and `step` the
environment.

``` {.sourceCode .python}
env = gym.make('pointRobotUrdf-vel-v0', dt=0.05, render=True)
ob = env.reset(pos=pos0, vel=vel0)
ob, reward, done, info = env.step(action)
```

The id-tag in the `make` command specifies the robot and the control
type. You can get a full list of all available environments using

``` {.sourceCode .python}
from gym import envs
print(envs.registry.all())
```

Go ahead and explore all the examples you can find there.

