Introduction

RaiSim is a high-performance physics engine developed by Jemin Hwangbo, KAIST. It is engineered to deliver both accuracy and computational efficiency for simulating robotic systems. It serves as a general-purpose rigid-body simulator capable of efficiently simulating diverse rigid-body dynamics.

Why RaiSim?

  • Its performance is benchmarked against other popular physics engines ([1]).

  • The accuracy of RaiSim has been validated in numerous academic publications ([2], [3], [4], [5], [6])

  • A C++ simulation library designed for ease of learning and use.

  • Minimal external dependencies (requires only STL and Eigen).

System Requirements

  • Linux
    • Ubuntu 22.04 or higher is recommended, though RaiSim may function on other distributions. Compatibility is limited to x86 CPUs with the AVX2 instruction set (Intel Haswell or higher).

  • Windows 10
    • Visual Studio 2019 or higher. x86 CPU only.

  • macOS
    • Latest version. Intel systems require AVX2 support. Only apple silicon (M1 and higher) is supported.

Example Code

The following is an example of a RaiSim application. Visualization is supported via either RaisimUnity or RaisimUnreal.

#include "raisim/World.hpp"
#include "raisim/RaisimServer.hpp"

int main() {
  raisim::World::setActivationKey("PATH_TO_THE_ACTIVATION_KEY");
  raisim::World world;
  auto anymal = world.addArticulatedSystem(PATH_TO_URDF);
  auto ball = world.addSphere(1, 1);
  auto ground = world.addGround();
  world.setTimeStep(0.002);

  /// Launch the RaiSim server for visualization. Visualize in RaisimUnity.
  raisim::RaisimServer server(&world);
  server.launchServer();

  while (1) {
    raisim::MSLEEP(2);
    server.integrateWorldThreadSafe();
  }

  server.killServer();
}

Below is a CMake file for compiling the aforementioned application.

cmake_minimum_required(VERSION 3.10)
project(raisim_examples LANGUAGES CXX)

find_package(raisim CONFIG REQUIRED)
find_package(Eigen3 REQUIRED)

include_directories (${EIGEN3_INCLUDE_DIRS})

add_executable(APP_NAME ${file_name})
target_link_libraries(APP_NAME PUBLIC raisim::raisim pthread)

A functional version is available here (RAISIM_EXAMPLE).