Roboy / gym-roboy

Pip package gym environment for deep roboy control
2 stars 1 forks source link

Goals

This in an implementation of an OpenAI gym environment to train controllers for Roboy. They provide standardized interface definitions for RL: https://github.com/openai/gym/tree/master/gym/envs

The goals of this repo are:

Installation

Python3.5 is required. Either use python3 and pip3 variants, or activate a Python virtual environment. If you are using the docker container deepandreinforced/rl:latest, you do not need to install this repo again. Otherwise:

python3 -m pip install -r requirements.txt
python3 -m pip install -e .

Installing this repo as a pip package is necessary if you would like to use the environment constructor form:

env = gym.make('msj-control-v1')

Structure

Directory simulations/

Directory robots/

Class Diagram

The RoboyEnv uses a SimulationClient to read values from the simulation. The SimulationClient depends upon a RoboyRobot to parse the numbers it receives from the simulation into a meaningful RobotState

Class Diagram

Run tests

Before running the tests, make sure you have sourced ROS2 with the ROS messages of Roboy. In the docker container deepandreinforced/rl:latest, this can be done with the command source_ROS2_ROBOY_WS.

To run the unit tests:

pytest 

The repo also has integration tests. To run them, you need a CARDSflow simulation running as well as the bridge between ROS1 and ROS2. Then, to run the tests, do:

cd gym_roboy/envs/tests/
bash run_all_tests.sh