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
- Rayrai Example: Complete Showcase
- Rayrai Example: LiDAR Pointcloud
- Rayrai Example: RGB Camera
- Rayrai Example: Depth Camera
- Rayrai Example: Custom Visuals
- Rayrai Example: Pointcloud Animation
- Rayrai Example: Instancing Grid
- Rayrai Example: Aruco Marker
- Rayrai Example: Basic Scene
- Rayrai Example: TCP Viewer
RaisimServer
- Server Example: Primitive Grid
- Server Example: Mesh Stack
- Server Example: Dynamic Object Addition
- Server Example: Procedural Heightmap
- Server Example: Material Restitution
- Server Example: Material Static Friction
- Server Example: Heightmap From Png
- Server Example: Dynamic Heightmap
- Server Example: Spring Damper Joints
- Server Example: Templated Tracked Robot
- Server Example: Kinematic Platform
- Server Example: Sensor Suite
- Server Example: Synchronous Server Update
- Server Example: Visual Objects Showcase
- Server Example: Ray Casting
- Server Example: Ray Scan LiDAR
- Server Example: Compound Object
- Server Example: Wheeled Robot Force Control
- Server Example: Length Constraints Newtons Cradle
- Server Example: Inverse Dynamics
- Server Example: Minitaur PD
- Server Example: Dzhanibekov Effect
- Server Example: Object Lifecycle Stress
- Island Sleep Benchmark