Skip to content

Rayrai Example: Gaussian Splat Apartment ​

Overview ​

Places a simulated ANYmal C in a captured place: the patio of an apartment, scanned as 661,466 Gaussian splats, with its tiled floor, a dining table, an armchair, a sofa and a coffee table. The splats are drawn around the robot and also become its collision: the robot stands on the scanned floor and squats slowly, and every 6 s a red box is dropped onto the coffee table, where it settles against the scanned bowl, and a blue ball onto the armchair, from which it bounces onto the floor. The bodies' shadows fall on the scanned floor. A camera arm orbits the robot with an RGB, a depth and a segmentation camera (320 x 240), and the Robot cameras panel shows what they measure; the cyan outline in the main view is the RGB camera's frustum.

Scan: "SA3D_R&D_XP47" by Stephane Agullo (sa3d.fr), CC BY 4.0, from the PlayCanvas engine examples, converted to a compressed PLY; see Asset credits.

Target ​

CMake target: rayrai_gaussian_splat_apartment. Gaussian splat scenes are new in v2.20.0.

Run ​

From the repository root, build the target and run it:

bash
source ./raisim_env.sh
cmake --build build-examples --target rayrai_gaussian_splat_apartment --parallel 2
./build-examples/examples/rayrai_gaussian_splat_apartment

See Build examples to configure a new build directory.

On Windows, run rayrai_gaussian_splat_apartment.exe instead. This example renders in process with rayrai and does not need rayrai_tcp_viewer. Reading the scan and making its collision voxels take about a second before the first frame.

Controls ​

  • Orbit: the speed of the camera arm, -1 to 1 rad/s. Drag in the main view to move the viewer's camera.
  • Depth: the depth the splats report to the depth camera, Median (the first surface, like a real sensor) or Expected (the opacity-weighted mean).

Details ​

  • Makes the world from rsc/gaussian_splats/apartment/apartment.rscene (raisim::World(path)), whose gaussian_splat record places apartment.compressed.ply: its quaternion turns the capture's y-down frame to RaiSim's z-up frame, and its position puts the patio floor at z = 0 around the origin. The RayraiWindow on that world draws the scan, with the segmentation ids of the record (100, 0, 1) that the segmentation camera reports where the splats win a pixel; the example names label 1 splat scene. See .rscene files.
  • The record adds no collision, so the example reads the record's file and pose from world->getRscene()->gaussianSplats and raisin::addGaussianSplatCollision(*world, cloud, pose, raisim::VOXELMAP) turns the splats into a static voxel map of about 9.2M voxels of 2 cm, hidden from rendering. The robot's feet, the box and the ball collide with it like with any other geometry; the floor's voxels reach at most one voxel above the scanned floor. See Collision.
  • For a triangle mesh of the patio instead of the voxels, use the commented call with raisim::MESH below the raisim::VOXELMAP call in place of it (see Collision mesh): a smoother surface that takes a few seconds longer to build.
  • The simulation follows the wall clock; the robot holds a squatting PD target on its 12 joints.

The Gaussian splat scene example explains the cameras and the panel in more detail. See Gaussian splat scenes for the file formats, placement, what each camera type sees and the limits.

RaiSim — physics for robotics and AI.