Skip to content

Commit

Permalink
Merge pull request #2 from farzadab/master
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
Neo-X authored Apr 15, 2018
2 parents 731410f + a0d572e commit ea890e5
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 42 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ simAdapter/__pycache__/
external/
gmake/
lib/
x64/
output/
terrainRLAdapter.egg-info
*.pyc
32 changes: 9 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This project is designed to learn good navigation skills for simulated character

This section covers some of the steps to setup and compile the code. The software depends on many libraries that need to be carefully prepared and placed for the building and linking to work properly.
```
git clone https://github.com/UBCMOCCA/TerrainRL.git
git clone https://github.com/UBCMOCCA/TerrainRLSim.git
```

## Linux (Ubuntu 16.04)
Expand All @@ -31,20 +31,9 @@ If `glxinfo` is not installed on your system, install the `mesa-utils` package.
OpenGL should come as part of the drivers for your graphics hardware (whether part of the motherboard or dedicated graphics card). If you are missing a compatible version of OpenGL, consider updating your graphics drivers; if you have a GPU, ensure that the system is actually using it.


### Download premake4
Download premake4 from [here](https://sourceforge.net/projects/premake/files/Premake/4.4/premake-4.4-beta5-linux.tar.gz/download). Extract the premake4 binary into a directory of your choosing (preferably not your local Downloads directory).

Add premake to your `PATH` variable in `.bashrc`:
```
# Add premake to path
export PATH=[PREMAKE_DIR]:$PATH
```
...where [PREMAKE_DIR] should be the directory containing the premake4 binary.


### Build Instructions

1. Download the most recent compressed external file from the [newest release](https://github.com/xbpeng/TerrainRL/releases).
1. Download the most recent compressed external file from the [newest release](https://github.com/xbpeng/DeepTerrainRL/releases).
1. Extract it and move into the TerrainRL directory. The top directory of the TerrainRL repository should now contain a directory called `external`, in addition to all the other directories that were there before.
1. *If you are using an OS other and Ubuntu 16.04 64-bit* build the source code for caffe that came in the `external` directory.
```
Expand All @@ -67,6 +56,7 @@ export PATH=[PREMAKE_DIR]:$PATH
1. Generate the python code wrappers (optional, if you are not planning on simulating things from python)
```
cd simAdapter/
sudo apt-get install swig3.0 python3-dev python3-pip -y
./gen_swig.sh
cd ../
```
Expand Down Expand Up @@ -100,17 +90,13 @@ This setup has been tested on Windows 7 and 10 with visual studio 2013.

After the system has been build there are two executable files that server different purposes. The **TerrainRL** program is for visually simulating the a controller and **TerrainRL_Optimize** is for optimizing the parameters of some controller.

Examples:
To simulate a controller/character
./TerrainRL -arg_file= args/test_args.txt
To simulate a controller/character with a specific policy
./TerrainRL_Optimizer -arg_file= args/opt_int_poli_hopper_eval.txt -policy_model= output/intermediate/trainer_int_model_0000160000.h5
To Train a controller
./TerrainRL_Optimizer -arg_file= args/opt_args_train.txt
./TerrainRL_Optimizer -arg_file= args/opt_args_train_hopper.txt
To Optimize a controllers parameters
./TerrainRL_Optimizer -arg_file= args/opt_args_jump.txt
Examples:

# To simulate a controller/character
./TerrainRL -arg_file= args/biped3D/test_biped_3d_args.txt
# To Train a controller
./TerrainRL_Optimizer -arg_file= args/biped3D/opt_train_biped_3d_cacla.txt
./TerrainRL_Optimizer -arg_file= args/genBiped2D/opt_args_imitate_biped_full_phase.txt

## Key Bindings

Expand Down
4 changes: 3 additions & 1 deletion deb_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev -y
sudo apt-get install libatlas-base-dev -y
sudo apt-get install gcc-4.9-multilib g++-4.9-multilib -y
sudo apt-get install libf2c2-dev -y
sudo apt-get install libglew-dev -y
sudo apt-get install libglew-dev freeglut3 freeglut3-dev -y
sudo apt-get install premake4 -y
## This is not necessary
# sudo apt-get install cuda
# sudo apt-get install swig3.0 python3-dev python3-pip -y
14 changes: 0 additions & 14 deletions installDepenancies.sh

This file was deleted.

9 changes: 7 additions & 2 deletions simAdapter/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ def run(self):
'install': MyInstall,
'egg_info': MyEgg
},
package_data = { 'args': need_files_args }
package_data = { 'args': need_files_args },
install_requires = [
'numpy==1.14.2',
'matplotlib==2.2.2',
'dill==0.2.7.1',
],
# ext_modules=[extension_mod]
)
)
5 changes: 3 additions & 2 deletions simAdapter/terrainRLSimTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
import terrainRLSim
import numpy as np
import matplotlib.pyplot as plt
import json

if __name__ == '__main__':

# env = getEnv(env_name="FSM_Biped2D_Terrain_Walls-v0", render=True)
# env = getEnv(env_name="PD_Biped3D_MutliChar_LargeBlocks-v0", render=True)
envs_list = terrainRLSim.getEnvsList()
print ("# of envs: ", len(envs_list))
print ("Envs: ", str(envs_list))
print ("Envs:\n", json.dumps(envs_list, sort_keys=True, indent=4).replace('}','').replace(',','').replace('"','').replace('{',''))

env = terrainRLSim.getEnv(env_name="PD_Biped3D_FULL_Imitate-Steps-v0", render=True)

Expand Down Expand Up @@ -71,4 +72,4 @@
# env.reset()

env.finish()
print (env)
print (env)

0 comments on commit ea890e5

Please sign in to comment.