Skip to content

StevenHong/raisimLib

 
 

Repository files navigation

RAISIM, A PHYSICS ENGINE FOR ROBOTICS AND AI RESEARCH (v1.10)

Click to watch the video

IMAGE ALT TEXT HERE

Documentation available on the RaiSim Tech website.

License

You should get a valid license and an activation key from the RaiSim Tech website to use RaiSim. Post issues to this github repo for questions. Send an email to info.raisim@gmail.com for any special inquiry.

Supported OS

MAC (including m1), Linux, Windows.

Build

  1. Create the build folder
mkdir build && cd build
  1. Create the CMakeList file
cmake .. -DCMAKE_INSTALL_PREFIX=/home/steven/RL_ws/src/raisimlib/build -DRAISIM_EXAMPLE=ON -DRAISIM_PY=ON -DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")
  1. Build the RaiSim package
make install -j4
  1. Export the path
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/steven/RL_ws/src/raisimlib/build/lib
export PYTHONPATH=$PYTHONPATH:/home/steven/RL_ws/src/raisimlib/build/lib
  1. Build the RaisimGymTorch package in raisimGymTorch folder
sudo python3 setup.py develop

Usage

  1. Launch the Unity simulator in /raisimlib/raisimUnity/linux
./raisimUnity.x86_64
  1. Launch the training file
python raisimGymTorch/env/envs/rsg_anymal/runner.py
  1. If want to output the log, use this command instead
python runner.py | tee output.log
  1. Replay the trained the model
python3 tester.py --weight /home/roahm/RL_ws/src/raisimlib/raisimGymTorch/data/anymal_locomotion/2022-03-07-13-17-11/full_3400.pt
  1. Retrain the model with pretrained weights
python3 runner.py --mode retrain --weight /home/roahm/RL_ws/src/raisimLib/raisimGymTorch/data/anymal_locomotion/2022-04-26-15-57-55/full_1500.pt

Comparison note

  1. Change the file path in Environment.hpp to change the map, then compile the code. Use the tester.py to check the performance
sudo python3 setup.py develop

The list of the map included in the file is shown below:

  • heightMap_1.txt: 15-by-15 flat terrain (all 0.4)
  • heightMap_2.txt: 15-by-15 training terrain (0 - 0.5)
  • heightMap_3.txt: 15-by-15 testing terrain (0 - 0.5)
  • heightMap_4.txt: 15-by-15 challenging terrain (0 - 0.75)
  • heightMap_5.txt: 15-by-15 impossible terrain (0 - 1.0)
  • heightMap_11.txt: 30-by-30 flat terrain (all 0.4)
  • heightMap_12.txt: 30-by-30 training terrain (0 - 0.5)
  • heightMap_13.txt: 30-by-30 testing terrain (0 - 0.5)
  • heightMap_14.txt: 30-by-30 challenging terrain (0 - 0.75)
  • heightMap_15.txt: 30-by-30 impossible terrain (0 - 1.0)

Note: Based on the spec sheet from ANYbotics, model-based controller can handle +/- 20 degree slop. Normal terrain has a slope of 14.04 degree. Challenging terrain slope corresponds to 20.55 degree slope, while impossible terrain corresponds to 26.56 degree slope. The size of each grid is 2 meter by 2 meter.

  1. Instead of the preset random map, can also use terrain generator to create a map in Environment.hpp. The robot needs to contact the ground to start the training.

  2. Robot model can be switched in Environment.hpp file.

  3. RL_training.txt shows the training history data for poster and final report of ECE545. The saved training weights are located in ./raisimGymTorch/saved_data.

Useful Scripts

  1. Generate the random map using txt file
python map_generator.py
  1. Plot the training history
python plot_train_history.py
  1. Plot the average reward history
python plot_reward_history.py

About

Visit www.raisim.com

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE.md
Unknown
COPYING

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 51.3%
  • C 33.4%
  • ASP.NET 13.4%
  • CMake 1.0%
  • Python 0.8%
  • MATLAB 0.1%