|
| 1 | +Roboschool |
| 2 | +========== |
| 3 | + |
| 4 | +Roboschool is a long-term project to create simulations useful for research. The roadmap is as follows: |
| 5 | + |
| 6 | +1. Replicate Gym MuJoCo environments. |
| 7 | +2. Take a step away from trajectory-centric fragile MuJoCo tasks. |
| 8 | +3. Explore multiplayer games. |
| 9 | +4. Create tasks with camera RGB image and joints in a tuple. |
| 10 | +5. Teach robots to follow commands, including verbal commands. |
| 11 | + |
| 12 | + |
| 13 | +Gym MuJoCo envs replacement |
| 14 | +=========================== |
| 15 | + |
| 16 | +The list of Roboschool environments is as follows: |
| 17 | + |
| 18 | +- RoboschoolInvertedPendulum-v0 |
| 19 | +- RoboschoolInvertedPendulumSwingup-v0 |
| 20 | +- RoboschoolInvertedDoublePendulum-v0 |
| 21 | +- RoboschoolReacher-v0 |
| 22 | +- RoboschoolHopper-v0 |
| 23 | +- RoboschoolWalker2d-v0 |
| 24 | +- RoboschoolHalfCheetah-v0 |
| 25 | +- RoboschoolAnt-v0 |
| 26 | +- RoboschoolHumanoid-v0 |
| 27 | +- RoboschoolHumanoidFlagrun-v0 |
| 28 | +- RoboschoolHumanoidFlagrunHarder-v0 |
| 29 | +- RoboschoolPong-v0 |
| 30 | + |
| 31 | +To obtain this list: `import roboschool, gym; print("\n".join(['- ' + spec.id for spec in gym.envs.registry.all() if spec.id.startswith('Roboschool')]))`. |
| 32 | + |
| 33 | + |
| 34 | +Installation |
| 35 | +============ |
| 36 | + |
| 37 | +First, define a `ROBOSCHOOL_PATH` variable in the current shell. It will be used in this README but not anywhere in the Roboschool code. |
| 38 | + |
| 39 | +```bash |
| 40 | +ROBOSCHOOL_PATH=/path/to/roboschool |
| 41 | +``` |
| 42 | + |
| 43 | +The dependencies are gym, Qt5, assimp, tinyxml, and bullet (from a branch). For the non-bullet deps, there are several options, depending on what platform and package manager you are using. |
| 44 | + |
| 45 | +- Ubuntu: |
| 46 | + |
| 47 | + ```bash |
| 48 | + apt install cmake ffmpeg pkg-config qtbase5-dev libassimp-dev libpython3.5-dev libboost-python-dev libtinyxml-dev |
| 49 | + ``` |
| 50 | + |
| 51 | +- Linuxbrew |
| 52 | + |
| 53 | + ```bash |
| 54 | + brew install boost-python --without-python --with-python3 --build-from-source |
| 55 | + export C_INCLUDE_PATH=/home/user/.linuxbrew/include:/home/user/.linuxbrew/include/python3.6m |
| 56 | + export CPLUS_INCLUDE_PATH=/home/user/.linuxbrew/include:/home/user/.linuxbrew/include/python3.6m |
| 57 | + export LIBRARY_PATH=/home/user/.linuxbrew/lib |
| 58 | + export PKG_CONFIG_PATH=/home/user/.linuxbrew/lib/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig |
| 59 | + ``` |
| 60 | + |
| 61 | + (still use Qt from Ubuntu, because it's known to work) |
| 62 | +
|
| 63 | +- Mac, homebrew python: |
| 64 | +
|
| 65 | + ```bash |
| 66 | + # Will not work on Mavericks: unsupported by homebrew, some libraries won't compile, upgrade first |
| 67 | + brew install python3 |
| 68 | + brew install cmake tinyxml assimp ffmpeg qt |
| 69 | + brew install boost-python --without-python --with-python3 --build-from-source |
| 70 | + export PATH=/usr/local/bin:/usr/local/opt/qt5/bin:$PATH |
| 71 | + export PKG_CONFIG_PATH=/usr/local/opt/qt5/lib/pkgconfig |
| 72 | + ``` |
| 73 | +
|
| 74 | +- Mac, Anaconda with Python 3 |
| 75 | +
|
| 76 | + ```bash |
| 77 | + brew install cmake tinyxml assimp ffmpeg |
| 78 | + brew install boost-python --without-python --with-python3 --build-from-source |
| 79 | + conda install qt |
| 80 | + export PKG_CONFIG_PATH=$(dirname $(dirname $(which python)))/lib/pkgconfig |
| 81 | + ``` |
| 82 | +
|
| 83 | +
|
| 84 | +Compile and install bullet as follows. Note that `make install` will merely copy files into the roboschool directory. |
| 85 | +
|
| 86 | +```bash |
| 87 | +git clone https://github.com/olegklimov/bullet3 -b roboschool_self_collision |
| 88 | +mkdir bullet3/build |
| 89 | +cd bullet3/build |
| 90 | +cmake -DBUILD_SHARED_LIBS=ON -DUSE_DOUBLE_PRECISION=1 -DCMAKE_INSTALL_PREFIX:PATH=$ROBOSCHOOL_PATH/roboschool/cpp-household/bullet_local_install -DBUILD_CPU_DEMOS=OFF -DBUILD_BULLET2_DEMOS=OFF -DBUILD_EXTRAS=OFF -DBUILD_UNIT_TESTS=OFF -DBUILD_CLSOCKET=OFF -DBUILD_ENET=OFF -DBUILD_OPENGL3_DEMOS=OFF .. |
| 91 | +make -j4 |
| 92 | +make install |
| 93 | +cd ../.. |
| 94 | +``` |
| 95 | +
|
| 96 | +Finally, install project itself: |
| 97 | +
|
| 98 | +```bash |
| 99 | +pip3 install -e $ROBOSCHOOL_PATH |
| 100 | +``` |
| 101 | +
|
| 102 | +Now, check to see if it worked by running a pretrained agent from the agent zoo. |
| 103 | +
|
| 104 | +
|
| 105 | +Agent Zoo |
| 106 | +========= |
| 107 | +
|
| 108 | +We have provided a number of pre-trained agents in the `agent_zoo` directory. |
| 109 | +
|
| 110 | +To see a humanoid run towards a random varying target: |
| 111 | +
|
| 112 | +```bash |
| 113 | +python $ROBOSCHOOL_PATH/agent_zoo/RoboschoolHumanoidFlagrun_v0_2017may.py |
| 114 | +``` |
| 115 | +
|
| 116 | +To see three agents in a race: |
| 117 | +
|
| 118 | +```bash |
| 119 | +python $ROBOSCHOOL_PATH/agent_zoo/demo_race2.py |
| 120 | +``` |
| 121 | +
|
0 commit comments