Examples

Overview

The examples/src directory contains runnable samples covering basic simulation setup, RaisimServer visualization, maps, sensors, rayrai rendering, and XML-based world configuration. Each example has its own page with a short description and the full source.

Most server and maps examples require a visualizer connection (RaisimUnity, RaisimUnreal, or the rayrai TCP viewer) to see the scene.

Build and run

Enable examples during configuration:

cmake -S . -B build -DRAISIM_EXAMPLE=ON
cmake --build build --target primitive_grid

Run examples from the build output directory so the rsc assets are found:

cd build/examples
./primitive_grid

On Windows with multi-config generators (Visual Studio), build and run the Release binary:

cmake --build build --target primitive_grid --config Release
.\build\examples\Release\primitive_grid.exe

If the runtime loader cannot find shared libraries, use the platform-specific environment setup:

source /path/to/raisim2Lib/raisim_env.sh

This script sets LD_LIBRARY_PATH on Linux and DYLD_LIBRARY_PATH on macOS.

.\raisim_env.ps1
raisim_env.bat

XML

Maps

Rayrai

RaisimServer