Installation

Setup

Please install/save everything locally to prevent any conflicts with other libraries. We will assume that you have a single workspace where you save all repos related to raisim. Here we introduce two variables

  • WORKSPACE: workspace where you clone your git repos (e.g., ~/raisim_workspace)

  • LOCAL_INSTALL: install directory where you install exported cmake libraries (e.g., ~/raisim_build)

You can add them to your environment variables or simply replace them by the path you want in the following instructions on this page.

Dependencies

You have to install the following packages to use raisim

  • eigen library

  • cmake > 3.10

  • For windows users, visual studio 2019 (we only support 2019 but it will probably work with 2015 or above). Make sure that you install the C++ module as well by checking the corresponding checkbox during install.

RaiSim includes many open-source libraries. See the COPYING file for the full list. Source code of Eigen and Pybind11 are included in the thirdParty directory.

RaiSim Install

Clone raisim from https://github.com/raisimTech/raisimlib.

The cloned repo is already a set of installed raisim packages. Under raisimLib/raisim/<OS-TYPE>, you will find the installed cmake packages.

To use raisim in your project, you can simply add the cmake package path and the shared library path to their corresponding environment variables as following

Add the following lines to your ~/.bashrc file

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$WORKSPACE/raisim/linux/lib
export PYTHONPATH=$PYTHONPATH:$WORKSPACE/raisim/linux/lib

This allow the linux linker to find raisim shared libraries. To let your project CMake know where to find raisim, simply pass an argument -DCMAKE_PREFIX_PATH=$WORKSPACE/raisim/linux.

Building RaiSim Examples and Installing RaisimPy

You can use the CMakeLists.txt in the raisimLib directory to build raisim examples and other modules. The following options are available

  • RAISIM_EXAMPLE : Compile C++ RaiSim examples

  • RAISIM_MATLAB : Compile raisimMatlab (compiled binary is also provided). You need MATLAB for this option

  • RAISIM_PY : Compile raisimPy.

You can generate build files using CMake as following

To build raisimPy for the correct python version, activate your conda environment before calling cmake.

cd $WORKSPACE/raisimLib
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$LOCAL_INSTALL -DRAISIM_EXAMPLE=ON -DRAISIM_PY=ON
make install -j4

Note

For Linux users To use (vulkan version) RaiSimUnity in Linux, you need to install minizip, ffmpeg and vulkan. To install vulkan, follow this link https://linuxconfig.org/install-and-test-vulkan-on-linux Do not install nvidia-graphics-drivers-396 as the link says. If you are going to use raisimGym, install the version recommended by pytorch. If not, install the latest version.

To install minizip and ffmpeg,

sudo apt install minizip ffmpeg

If you still cannot use raisimUnity, this probably means that your driver does not support vulkan so well. In that case, you should use raisimUnityOpengl. It only supports minimalistic graphics.

Activation Key

Rename the activation key that you received by email to activation.raisim. Save that file in <YOUR-HOME-DIR>/.raisim. In Linux and Mac, this is /home/<YOUR-USERNAME>/.raisim. In Windows, this is C:\Users\<YOUR-USERNAME>\.raisim (You might not be using C as your home directory).

RaiSim will also check the path you set by raisim::World::setActivationKey(). If the file is not found, it will search in the user directory, where you saved your activation.raisim file.

Examples

The built examples are stored in examples directory. In Windows, use powershell to run the examples, instead of manually clicking the icons. If you made a mistake during installation, it will give you an error message.

Make sure that you run raisimUnity executable in raisimUnity/<OS>/RaiSimUnity before you run the examples.