Examples
Overview
The RaiSim binary distribution ships runnable C++ examples and rayrai tools.
Use server examples such as primitive_grid, rayrai examples such as
rayrai_pbr_material_grid, and non-visual tools such as
model_asset_pipeline to exercise RaiSim physics APIs, mesh import/export,
OpenUSD mesh loading, and rayrai asset inspection. Use rayrai_tcp_viewer to
inspect applications that publish a
raisim::World through raisim::RaisimServer. RaisimUnity and RaisimUnreal
are no longer supported.
Run
Run examples from the installed package bin directory:
<raisim-install>/bin/primitive_grid
<raisim-install>/bin/rayrai_pbr_material_grid
On Windows, use the .exe executable from the installed package bin
directory:
C:\path\to\raisim\bin\primitive_grid.exe
If the runtime loader cannot find shared libraries, use the platform-specific environment setup before running examples:
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
Visualization modes
There are two visualization paths. See Visualization for the full workflow comparison.
RaisimServer examples
Server examples such as primitive_grid create a RaiSim world and publish it
through raisim::RaisimServer. They do not open a renderer window themselves.
Start rayrai_tcp_viewer, then run the example:
# Terminal 1
<raisim-install>/bin/rayrai_tcp_viewer
# Terminal 2
<raisim-install>/bin/primitive_grid
The default server port is 8080 unless the example changes it. Use this
path when you want to inspect the same simulation data that a normal
RaisimServer application publishes.
Rayrai examples
Examples such as rayrai_pbr_material_grid, rayrai_pbr_texture_maps, and
rayrai_visual_asset_support create or use a raisin::RayraiWindow
directly and render in process. They do not need the TCP viewer:
<raisim-install>/bin/rayrai_pbr_material_grid
Prefer these examples when you need camera images, GPU/offscreen rendering, PBR
materials, glTF visual import, or standalone rayrai feature inspection. USD
visual meshes can also be loaded through RayraiWindow::addVisualMesh; see
OpenUSD Loading for the importer scope.
Non-visual examples
Some examples are intended to print output or create files rather than show a
window. model_asset_pipeline writes preprocessed and exported OBJ files to
/tmp/raisim_model_asset_pipeline_example.
Example layout
The installed package groups examples by executable behavior:
Group |
Purpose |
|---|---|
Server examples |
Installed examples for RaiSim physics, contact, terrain, sensor, robot, XML/MJCF, and OpenUSD scene workflows. |
|
rayrai tools and standalone renderer examples. |
Choosing an example
Start with these targets when learning a specific feature:
Target |
Demonstrates |
|---|---|
|
Basic rigid primitive creation and RaisimServer publishing. |
|
Mesh preprocessing, content-hash cache reuse, |
|
Loading an OpenUSD ShadowHand scene through |
|
Loading vetted NVIDIA Isaac Sim robot USD scenes through the |
|
Inspecting metallic-roughness PBR material behavior under rayrai. |
|
Importing glTF/GLB visual scenes with PBR materials, authored lights, and reflection-probe sidecars. |
|
Visually comparing original meshes and CoACD convex approximation
parts generated through |
|
The TCP visualizer used by RaisimServer examples. |
Runtime assets
Some targets depend on bundled assets or platform runtime packages:
OpenUSD loading uses the package’s bundled OpenUSD runtime and USD files; keep the
openusdruntime directory andrscassets with the installed package. OpenUSD examples are skipped by CMake only when the selected RaiSim package is too old to expose USD scene loading.Rayrai examples require SDL2/OpenGL and rayrai runtime libraries.
Poly Haven and PBR asset examples require the corresponding assets under
rsc.
List available examples by inspecting the installed package bin directory:
ls <raisim-install>/bin
Current Package Examples
Benchmark Examples
Rayrai Tools And Examples
- Rayrai Example: Basic Scene
- Rayrai Example: Complete Showcase
- rayrai_blender_scene_import
- Rayrai Example: RGB Camera
- Rayrai Example: Depth Camera
- Rayrai Example: LiDAR Pointcloud
- Rayrai Example: Aruco Marker
- Rayrai Example: Custom Visuals
- Rayrai Example: Instancing Grid
- Rayrai Example: Pointcloud Animation
- Rayrai Example: PBR Material Grid
- Rayrai Example: PBR Texture Maps
- Rayrai Example: Quality Lighting and FXAA
- rayrai_visual_asset_support
- Rayrai Example: CoACD Mesh Approximation
- Rayrai Example: Runtime Scene Editing
- Rayrai Example: Rolling And Spinning Friction
- Rayrai Example: Swept CCD
- Rayrai Example: TCP Viewer
Server Examples
- Server Example: Compound Object
- Server Example: Deformable Objects
- Server Example: Dynamic Heightmap
- Server Example: Dynamic Object Addition
- Server Example: Dzhanibekov Effect
- granular_media
- Server Example: Heightmap From Png
- Server Example: Inverse Dynamics
- Server Example: Kinematic Platform
- Server Example: Length Constraints Newtons Cradle
- Server Example: Material Restitution
- Server Example: Material Static Friction
- Server Example: Mesh Stack
- Server Example: Minitaur PD
- mjcf_gymnasium_hopper
- mjcf_gymnasium_humanoid
- mjcf_gymnasium_walker2d
- Server Example: Model Asset Pipeline
- Server Example: NVIDIA USD Robots
- Server Example: Object Lifecycle Stress
- Server Example: Primitive Grid
- Server Example: Procedural Heightmap
- Server Example: Ray Casting
- Server Example: Ray Scan LiDAR
- Server Example: Sphere Drop
- Server Example: Spring Damper Joints
- Server Example: Shadow Hand USD Cube
- Server Example: Templated Tracked Robot
- Server Example: Visual Objects Showcase
- Server Example: Wheeled Robot Force Control
- ycb_objects
- ANYmal Pair
- Atlas
- Hill1 Heightmap
- Kinova Arm
- Lake1 Heightmap
- Mountain1 Heightmap
- Office1 Scene