Skip to content

Changelog: v2.20 ​

v2.20.0 (unreleased) ​

RaiSim

  • Cameras take OpenCV lens models: plumb_bob (Brown-Conrady) and rational_polynomial distortion with prism and tilt terms on pinhole cameras, besides the equidistant fisheye, so a calibration from OpenCV, Kalibr, COLMAP or a ROS CameraInfo can be used as it is. Explicit fx, fy, cx, cy are honoured by the CPU rays and by rayrai (an off-centre principal point renders through an off-axis frustum). Pixels beyond the fold of a strong distortion have no ray and no return, and directions at or beyond the fold have no pixel, so a point outside the field of view is never imaged inside it. New: CameraLensModel::setOpenCvPinhole(), setModel(), CameraPinholeDistortion, cameraMatrix(), cameraDistortionCoefficients(), cameraPixelToRay(), cameraRayToPixel() and CameraLensInverse, which prepares the inverse of one lens for many points (where the lens folds, foldLimit(), and how far its image reaches, found once; undistort(), pixelToRay(), rayToPixel()), so a 752x480 ray table of a strong barrel lens takes 110 ms instead of 813 ms, and one of the EuRoC camera's lens 61 ms, where OpenCV's undistortPointsIter() takes 192 ms for the same pixels; URDF <lens>, <intrinsics> and <distortion> take named coefficients or a d list. The forward model matches the pixels of OpenCV's cv::projectPoints and cv::fisheye::projectPoints for every coefficient to 1e-6 px (new tests testCameraLens, among them CameraLens.ForwardModelMatchesOpenCv and CameraLens.DirectionsBeyondTheFoldHaveNoPixel, and testSensorModelXml). See Camera lens models and Mapping pixels and rays.
  • Behaviour change: explicit cx and cy are OpenCV pixel coordinates; a fisheye camera with explicit cx, cy therefore moves by half a pixel against earlier versions. An unknown lens model name is a fatal error (it silently became a pinhole). CPU fisheye cameras apply k1 to k4, which only rayrai applied, and pixels outside the image circle (half the horizontal field of view, at most 89.5°) have no return (CameraLens.CpuRayTableFollowsTheLens, CameraLens.FisheyeRaysEndAtTheImageCircle). A pinhole camera whose URDF or sensor XML lens elements give nonzero k1, k2 or k3 is now distorted as plumb_bob, and one with a nonzero k4 as rational_polynomial; RaiSim 2.19.0 stored these values as fisheye coefficients without effect on a pinhole image. World XML files that 2.19.0 exported with such coefficients load with a warning and without them, so their cameras see what they saw (SensorModelXml.Version2190WorldXmlPinholeCamerasDropTheirFisheyeCoefficients).
  • Rolling shutters: the shutter property of every camera (CameraShutter, URDF <shutter type="rolling" readout_time=...>, or Kalibr's line_delay) times each row from the exposure start of the first, which stays the capture's timestamp. rayrai renders it in bands (16 when 0), each at the time of its middle row, so a row is timed up to half a band's readout time off; selecting the RAISIM ray-cast source for a rolling-shutter camera is a fatal error. See Rolling shutter.
  • Capture latency: RGB, depth, segmentation, normal and optical-flow cameras and spinning LiDARs take latency and latencyJitter. A capture is delivered in order at the first physics step after its delay, in World::integrate() for every measurement source, and by RaisimServer for the cameras of its visual articulated systems, which World::integrate() does not step; getUpdateTimeStamp() is the acquisition time of the delivered capture, getDeliveryTimeStamp() when it arrived. Writers fill the new getCapture...() buffers and call commitCapture(); at most 256 captures wait (getDroppedCaptureCount()), and checkpoints keep them. Without latency the buffers are written in place as before (new tests testSensorLatency and CameraModelProtocol.VisualSystemRepliesAreDeliveredAfterTheCameraLatency, benchmark capture_latency). See Capture latency.
  • Active stereo depth cameras: DepthCameraProperties::depthModel = ACTIVE_STEREO models an Intel RealSense D400 camera, with stereo shadows and the invalid band at the left edge, the minimum range of the disparity search, disparity noise and quantization that grow as z2 in depth, edge jitter and fattening, and holes on dark, distant, grazing, transparent and mirror surfaces. The right imager sees through the camera's lens, so the invalid band follows a distorted or fisheye lens. Presets realSenseD435() and realSenseD415() (URDF <depth_model preset="realsense_d435"/>) state the source of each value. The ray cast fills the new getReturnStrengthArray() (new test testActiveStereo, benchmarks active_stereo_noise and active_stereo_capture). See Active stereo depth cameras.
  • Sensor materials: World::setSensorMaterial() gives a physics material its near-infrared reflectance, retroreflectivity, transmission and specularity, which active stereo cameras and LiDARs use: glass is seen through, mirrors return nothing outside a glint angle, and retroreflectors (tape, road signs) return toward the emitter at any incidence, with the effective reflectance ρeff = diffuse part + retroreflectivity, plus the specular glint within the glint angle (LidarReturns.RetroreflectorsReturnAtAnyIncidence). Kept in world XML (<sensor_material>) and checkpoints; World::rayTestSensor() casts a ray the way these sensors see, and World::getBodySensorMaterials() lists the sensor material of every collision body in one pass (SensorMaterials.OnePassListAgreesWithThePerBodyQuery). See Sensor materials.
  • LiDAR returns from materials: SpinningLidarProperties::returnModel = REFLECTANCE detects a surface with a probability set by its reflectance, incidence and range against a data-sheet specification (URDF <return_model>), and getReflectivity() reports a calibrated reflectivity byte per point in the Velodyne and Ouster convention (new test testLidarReturns, benchmark lidar_reflectance). See LiDAR returns from materials.
  • New ground-truth cameras NormalCamera (surface normals in the world or OpenCV camera frame) and OpticalFlowCamera (backward flow to the previous capture with KITTI-style validity flags), sensor types normal and optical_flow, with a CPU ray-cast source. A pixel is kInFrame only when the lens images its point at the previous capture, before the fold, on a pixel of the image that has a ray (inside a fisheye's image circle) (GroundTruthCameras.PointsBeyondTheFoldAreNotInFrame). computeBoundingBoxes2D() finds the tight 2D box of every instance of a segmentation image; raisim/sensors/GroundTruthIo.hpp writes and reads Middlebury .flo, KITTI flow PNG, normal PNG and COCO detection JSON with RLE masks, checked byte by byte against the formats (new tests testGroundTruthCameras, testGroundTruthIo, benchmarks ground_truth_cameras and bounding_boxes_2d). See Normal camera and Ground-truth files.
  • The TCP protocol gains PROTOCOL_FEATURE_CAMERA_MODELS: camera descriptions carry the distortion, shutter and depth model, and an active stereo depth reply its return strengths. RaisimServer does not ask the viewer for a MANUAL camera it cannot render: normal and optical-flow cameras, which it leaves out of the frames, rolling-shutter cameras (with a positive readout time; the viewer also refuses them itself), and, for a viewer without the feature, active stereo depth cameras and pinhole lenses with a non-zero distortion. It warns once per camera and client and drops replies for such cameras (new test testCameraModelProtocol). See Sensor measurements.
  • MeshResource::fromTriangles() makes a mesh from triangles in memory, keeping them as a triangle mesh (MeshCollisionMode::ORIGINAL_MESH) by default. Such a mesh has no file name, and world XML export leaves it out with a warning (new test MeshCollider.MeshFromTrianglesInMemory). See Shared resources across worlds.

rayrai

  • Every distorted or fisheye lens renders through one lens remap: an off-axis pinhole source image covering the lens's rays, resampled through a lookup table built from RaiSim's own pixel-to-ray mapping, so rendered and CPU images agree pixel for pixel (new test rayrai_lens_distortion_test). The source has at least one pixel per image pixel where the lens is densest, fisheye lenses included, up to three times the image size per axis and 4096 pixels (Camera::setMaxLensSourceSize() lowers that limit; SensorBatchRenderer caps it at its tile capacity); a camera configured again with an unchanged lens keeps its table (new test rayrai_lens_remap_plan_test, benchmark rayrai_lens_remap_benchmark). Camera::configureSensorLens(), outputWidth(), outputHeight() and applyLensRemap() replace setFisheyeRemapUniforms() and applyFisheyeRemap(); the render size of a remapped camera (rtWidth()) can exceed its image size. Behaviour change: for a fisheye or distorted lens the scene colour (getSceneColorTex(), bindSceneFbo()) holds the pinhole source image; the lens image has outputWidth() x outputHeight() pixels. getRawImage() reads the scene colour before post-processing resampled through the lens (getOutputColorTex()), as the readback of a pinhole camera reads its scene colour, and getFinalTexture() shows the remapped post-processed colour. RayraiWindow::captureSupersampledRgba() keeps the off-axis window of explicit pinhole intrinsics and throws std::invalid_argument for a remapped camera (new test rayrai_lens_remap_color_test). See Lens models.
  • Rolling-shutter cameras are rendered in bands by the sensor overloads of RayraiWindow and by SensorBatchRenderer: in each band the bodies and the camera move with their constant twists to the band's time, a single body turning about its centre of mass and a link about its frame origin (new test rayrai_rolling_shutter_test, which covers every readout direction and the default band count, and new cases in rayrai_physics_snapshot_cpu_test). See Rolling shutter.
  • Active stereo depth cameras render both imagers and the return strengths, in RayraiWindow and SensorBatchRenderer (DepthGroup::returnStrength). The right imager's view is projected through the camera's lens, so the invalid band follows distorted and fisheye lenses as on the CPU. The sensor materials come from the frame drawn: physics snapshots carry them (PhysicsSnapshot::sensorMaterials), and a World whose material table exceeds GL_MAX_TEXTURE_SIZE is an error. Face normals are taken before any alpha-mask discard (new tests rayrai_active_stereo_test, rayrai_sensor_shader_derivative_test and new cases in rayrai_physics_snapshot_cpu_test; rayrai_physics_snapshot_benchmark times captures with sensor materials). See Active stereo depth.
  • GPU LiDARs (RayraiWindow::measureSpinningLidarSingleDrawGPU() and SensorBatchRenderer) follow the REFLECTANCE return model: rays continue through transparent bodies met outside the glint angle, and SpinningLidar::applyReturnModel() runs on the surfaces hit, so the kept points, reflectivity bytes and random draws are those of the CPU scan (new test rayrai_lidar_returns_test; rayrai_lidar_benchmark reports the cost over IDEAL).
  • Normal and optical-flow images are rendered: RayraiWindow::renderNormals() and renderOpticalFlow(), and SensorBatchRenderer::addNormalCamera() / addOpticalFlowCamera() with writeNormalToSensor() / writeOpticalFlowToSensor(), through every lens and shutter, matching RaiSim's ray casts within 1 degree and 0.25 px (new test rayrai_ground_truth_camera_test, benchmark cases rayrai_sensor_batch_benchmark --sensors=normal,flow). See Normal and optical-flow images.
  • RayraiWindow::computeBoundingBoxes() and SensorBatchRenderer::segmentationBoundingBoxes() add the loose 2D box (the whole instance, occluded parts included, clipped to the image) and the 3D box in the camera frame to the tight boxes of a segmentation image (new test rayrai_bounding_box_test, benchmark rayrai_segmentation_benchmark). See Bounding boxes.
  • SensorBatchRenderer::setAppearanceRandomization() and randomizeAppearance(world, episode) randomize the light (direction, intensity, colour temperature from 1667 to 25000 K), ambient, background (mixed in display space) and object colours of each World's RGB cameras, reproducibly per (seed, World, episode) (new test rayrai_sensor_batch_randomization_test, benchmark case rayrai_sensor_batch_benchmark --sensors=rgb_randomized). See Appearance randomization.
  • Behaviour change: Camera::getRawImage(sensor) into the sensor, SensorBatchRenderer::write*ToSensor() and the GPU LiDAR commit their captures at the world time of the rendered scene, which sets getUpdateTimeStamp() and applies the sensor's latency (Camera::getSensorCaptureTime(image), one time per kind of image; new test rayrai_sensor_capture_latency_test).
  • Gaussian splat scenes: RayraiWindow::addGaussianSplatScene() and SensorBatchRenderer::addGaussianSplatScene() draw captured 3D Gaussian Splatting scenes (Inria PLY, compressed PLY, SPZ, .splat; readGaussianSplatFile()) with the meshes, in the viewer and in RGB, depth, segmentation and active stereo images (with the scene's sensorMaterial), on OpenGL 4.3 compute shaders or, on macOS, a transform-feedback path with an exact CPU radix sort; splats receive the sun's mesh shadows (GaussianSplatRenderSettings::shadowStrength, looked up per pixel in the viewer and raster colour images, so a robot's shadow falls on a captured floor); translucent meshes, visuals, water and weather in front of a splat scene show over it, and where its splats are at least half opaque they hide what is translucent behind them; sensor images beyond one GPU storage block are rasterized in bands of rows. The cameras a SensorBatchRenderer draws into one target, and the bands of rolling-shutter cameras, are culled, sorted and rasterized together, each image as it would be alone: 256 depth cameras of 64x64 px see 100k splats in 62 ms and 1M splats in 0.9 s on an RTX 2070 SUPER, where gsplat 1.5.3 takes 105 ms for colour and expected depth and runs out of memory at 1M. SPZ files claiming more than 224 splats are rejected and a read allocates only for the splats it decodes; a .splat file is read as SPZ only if its gzip stream holds SPZ data; ASCII PLY numbers are read in the C locale; a logit opacity of −∞ or +∞ (PlayCanvas splat-transform writes −∞ for fully transparent splats) reads as opacity 0 or 1, and NaN is an error. .rscene files take a gaussian_splat record, and a record whose file or pose the renderer cannot use (an empty file, too many splats for the renderer or the OpenGL context, a position or scale beyond float range) is an error of the scene loading, not a process exit (new tests rayrai_gaussian_splat_*_test, benchmarks rayrai_gaussian_splat_benchmark and rayrai_gaussian_splat_io_benchmark). See Gaussian splat scenes.
  • The TCP viewer renders lens distortion and replies with active stereo return strengths (kProtocolFeatureCameraModels), with the default sensor material on every surface, since the server does not send sensor materials.
  • Gaussian splat scenes can collide: addGaussianSplatCollision(world, cloud, pose, raisim::VOXELMAP) and makeGaussianSplatCollision() (rayrai/GaussianSplatCollision.hpp, and in raisimpy.rayrai) turn a scene's splats into a static VoxelMap of the voxels its splats together make at least opacityThreshold opaque (GaussianSplatCollisionOptions: 2 cm voxels, 0.2, splats up to 0.3 m, an optional region), so bodies stand on a captured floor and LiDARs hit it; the map is hidden from rendering. A captured apartment of 661k splats takes about 0.8 s on up to eight threads. A voxel map with the appearance "hidden" no longer builds a render mesh until it is shown (the first frame with 5.6M hidden voxels went from 5.4 s and 5.2 GB to 0.17 s) (new test rayrai_gaussian_splat_collision_test, rayrai_voxel_map_depth_test extended, benchmark case collision_voxels in rayrai_gaussian_splat_io_benchmark).
  • Gaussian splat scenes can also collide as a triangle mesh: makeGaussianSplatCollisionMesh() makes the boundary of the solid voxels, with their corners cut, a raisim::MeshResource of triangles, merging flat parts into larger triangles within about GaussianSplatCollisionOptions::meshTolerance (1 cm), and addGaussianSplatCollision() with the shape raisim::MESH adds it as a static, hidden raisim::Mesh (the shape is raisim::VOXELMAP for the voxels or raisim::MESH; any other type is a fatal error). An 8 m by 8 m region of the captured apartment becomes about 0.9M triangles in about 2 s. rayrai draws a mesh made from triangles in memory in the colour of its appearance and builds nothing for it while it is hidden; the TCP viewer leaves hidden objects, and meshes it has no file for, out of its scene bounds (new cases in rayrai_gaussian_splat_collision_test, rayrai_voxel_map_depth_test and rayrai_tcp_voxel_map_test, benchmark case collision_mesh in rayrai_gaussian_splat_io_benchmark). See Collision mesh.
  • Coordinate frames and point clouds are drawn before translucent geometry, so translucent meshes, visuals, water and weather in front of them cover them; camera-frustum visuals (RayraiWindow::addCameraFrustum()) cast no shadow (new test rayrai_gaussian_splat_scene_test).
  • New examples rayrai_lens_distortion, rayrai_active_stereo_depth, rayrai_rolling_shutter, rayrai_ground_truth, rayrai_domain_randomization, rayrai_gaussian_splat_scene and rayrai_gaussian_splat_apartment, which ships a captured splat scan (rsc/gaussian_splats/apartment, CC BY 4.0) placed by a .rscene file (apartment.rscene) and builds its collision from the scene's gaussian_splat record (see .rscene files).

raisimPy

  • Lens models: CameraPinholeDistortion, CameraLensModel.setOpenCvPinhole() and setModel(), cameraPixelToRay(), cameraRayToPixel(), distortNormalizedPoint(), undistortNormalizedPoint(), cameraDistortionCoefficients() and CameraLensInverse; CameraShutter and the latency, shutter and active stereo properties of the cameras and LiDARs.
  • SensorMaterialProperties, World.setSensorMaterial(), rayTestSensor(), getSensorMaterialOfBody() and getBodySensorMaterials(); NormalCamera, OpticalFlowCamera, computeBoundingBoxes2D() and the .flo, KITTI flow, normal PNG and COCO readers and writers, with images as numpy arrays.
  • raisimpy.rayrai follows the new rayrai API: Camera.getSensorCaptureTime(), readReturnStrength() and readNormals(), RayraiWindow.renderNormals(), renderOpticalFlow() and computeBoundingBoxes(), SensorBatchRenderer with appearance randomization, and Gaussian splat scenes.
  • MeshResource.fromTriangles(), and raisimpy.rayrai.makeGaussianSplatCollisionMesh() and addGaussianSplatCollision(..., raisimpy.ObjectType.MESH).

Build and tests

  • testUsdMesh reads its Isaac Sim USD fixtures from the CMake cache path RAISIM2LIB_DIR (default ../raisim2Lib next to the RaiSim checkout) and names that variable when they are missing.
  • The new sensor benchmarks join the sensors group of the benchmark runner and the sensor category of the repository status report.
  • rayrai_webgpu_shader_tests translates every Gaussian splat compute program to WGSL and checks it against WebGPU's uniformity rules and the default 16384-byte workgroup storage limit.
  • rayrai_sensor_batch_benchmark times the batch before it creates the baseline of one RayraiWindow per World: with 128x128 cameras, 256 windows fill most of an 8 GB GPU, and the evictions that followed slowed the batch's RGB step from 10 ms to 31 ms.

RaiSim — physics for robotics and AI.