Changelog: v2.19
v2.19.0 (2026-11-29)
RaiSim
- Magnetic grippers can have a rectangular pad sampled at a grid of points instead of a single point:
<pad size="0.06 0.04" samples="6 4" x_axis="1 0 0"/>in a<gripper type="magnetic">, orGripperDefinition::padSize,padSamplesandpadXAxis. Each of thesamples, at the centers of equal cells of the pad, casts its own ray along the axis and pulls the magnetic surface it finds with at its own gap ; the pull acts on the body where that ray hit and, opposite, on the link at the sample. The pull of a pad therefore follows how much of it faces magnetic material and acts where that material is: a pad half over the edge of a steel plate pulls with half its force, at the middle of the half over the plate, a pad whose center is just off the plate still holds with the samples over it, a tilted pad pulls harder on its low side, and a pad across two steel parts pulls both. GripperState::engagedSamplescounts the samples that pulled,forceis their total,gapthe smallest gap,positionthe pull-weighted mean of their hit points andobjectthe body that took the largest pull;ArticulatedSystem::getGripperSamplePositions()returns the samples in the world frame. A grid of one sample (the default) is the point magnet with identical results. The grids are kept by world XML export and import, checkpoints andWorld::joinObjects()/detachJoint(), and raisimPy binds them. Inthrusters_grippers(new cases), 25 lifters with 4 x 4 pads take 29.4 µs per step instead of 22.9 µs with point magnets while the pads find nothing magnetic, and 126 µs instead of 80 µs while they hold steel boxes; point magnets and suction cups give bit-identical results, and the other cases of the benchmark are unchanged except the overhanging-cup cases (1 or 25 fixed suction cups on static boxes, nothing else moving), 3-6% (11-17 ns per cup per step) slower. See Magnet pads. - Depth and segmentation cameras of robots created from one
ArticulatedSystemResourceshare one table of per-pixel ray directions instead of each computing and keeping its own (74 KB for a 64x48 camera, 75 MB for 1024 RL environments);DepthCamera::updateRayDirections()orSegmentationCamera::setProperties()gives a camera a table of its own. New:CameraRayDirections,makeCameraRayDirections()andSegmentationCamera::getRayDirections(). The reference thatDepthCamera::getPrecomputedRayDir()returns is now invalidated byupdateRayDirections()andWorld::restoreCheckpoint(), which replace the table. The layout ofDepthCameraandSegmentationCamerachanged: rebuild code compiled against the old headers (new testSharedResources.CamerasShareRayDirectionsUntilTheirPropertiesChange).
rayrai
- New
raisin::SensorBatchRenderer(rayrai/SensorBatchRenderer.hpp) renders the cameras and spinning LiDARs of many Worlds together, for vectorized RL environments: depth cameras, segmentation cameras, RGB cameras (with simplified shading: albedo, ambient and one directional light, no shadows;setRgbLighting()for domain randomization), fisheye lenses for all three, and spinning LiDARs cast on the GPU. It mirrors every World from physics snapshots, loads each mesh file once for all of them, draws the cameras of one kind, resolution and lens type into tiles of one render target and reads their images back with one read per column of tiles into contiguous[camera][row][column]arrays; LiDAR rasters share one target and one read, and each LiDAR keeps a full-turn range image.capture()takes no OpenGL, so environment workers can capture their Worlds in parallel right after stepping them; theapply*Noise()andwrite*ToSensor()calls apply each sensor's noise model and fill the sensors. Each camera skips the meshes outside its view one by one (height maps in chunks of 32 x 32 cells), so a camera mounted on a robot does not draw the robot's own body or terrain out of its view, and height maps with equal heights (copies of oneHeightMapResource, for instance) share one geometry and one set of meshes across all Worlds. Inrsg_anymal_depthstudent training this raises 1024 environments from 9.7k to 70k steps per second and cuts its memory from 42.7 to 5.8 GB of RAM; 2048 environments, which ran out of memory, train at 72k steps per second in 6.4 GB. With 80x60 cameras on ANYmal C over a height map, a step of 256 environments takes 3.24 ms for depth, 4.08 ms for segmentation and 3.22 ms for RGB instead of at best 27.4, 26.6 and 77.0 ms with oneRayraiWindowper environment, 10.3 ms instead of 21.5 ms for 64x512 LiDARs, and 18.4 ms instead of 187 ms for all four sensors together (new benchmarkrayrai_sensor_batch_benchmark). Depth and segmentation agree withrenderDepthPlaneDistance()andrenderSegmentation()up to rare edge pixels, LiDAR scans withmeasureSpinningLidarSingleDrawGPU()exactly. It needs desktop OpenGL and is not part of the browser build; see Many environments. Camera::setSensorProjection()sets the projection of a depth, RGB or segmentation camera without allocating render targets,Camera::setFisheyeRemapUniforms()sets the lens uniforms of a fisheye remap shader, andOpenGLMesh::setInstancedVaoFirstInstance()makes instanced draws start at a later record of their instance buffer on contexts withoutGL_ARB_base_instance.- Fixed: a height map with more samples per side than the GPU's largest texture made
measureSpinningLidarSingleDrawGPU()throw once and then vanish from later scans without an error; it throws every time now. - Fixed:
measureSpinningLidarSingleDrawGPU()unbound the caller's framebuffers when it created or enlarged its render target, and an exception while casting left rayrai's texture-binding cache stale, so that a later draw could sample a LiDAR table.
raisimGymTorch
- New environment
rsg_anymal_depth: ANYmal C learns to follow velocity commands (1.0 to 3.6 m/s forward, approached by a command curriculum) over rough terrain from its front depth camera, tilted 50 degrees down. Each environment walks terrains of eight kinds (terrain/types: rough noise, terraces, blocks, stairs up and down with risers of up to 25 cm, slopes of up to 0.45, and gaps of up to 30 cm) on ten levels, 128 m wide for the teacher, so that no robot reaches their edge in an episode, and 32 m wide for the student; each robot climbs a curriculum of its own on each kind.runner.pytrains a teacher with PPO on 270 terrain heights, with energy, posture, foot-clearance, touchdown, foot-slip and trot terms on top of the legged_gym reward, all costs growing over training and counting per commanded meter above 1 m/s (with a velocity error relative to the command), and a step whose costs exceed its rewards counting a tenth of its sum, for an efficient, natural trot (the student's cost of transport is 0.37 at 0.9 m/s and 0.62 at 1.8 m/s);student.pytrains a student on proprioception and 64x48 depth images with DAgger, records a video at every checkpoint as the teacher does, and evaluates falls, speed and gait per terrain level, per kind of terrain and at fixed speeds. Over all levels and commands the student falls in 13% of its 20 s episodes (its teacher 11%); on the hardest level it walks rough terrain and slopes, while the 25 cm stairs and 30 cm gaps defeat it.check.pychecks every observation entry, reward term, statistic, reset, curriculum level and depth image against quantities they do not come from. See Walking on rough terrain from depth images. - Evaluation videos of an environment with depth cameras show the first camera's depth image in the top-right corner of every frame (new unit test
raisimgym_video_test). - Environments that define
depthCameras()render the depth images of every environment in one batch on the GPU (render_depth()in Python, rayrai'sSensorBatchRenderer; every environment must have as many cameras, new unit testraisimgym_depth_camera_count_test), and environments that definestatisticNames()andstatistics()report values for logging (get_statistics()). - The RaisimGymTorch page is rewritten: each of the three environments is explained with a video of its trained policy, figures show what the depth environment's teacher and student observe and its eight terrain types, and a new section explains how environments are stepped and rendered in batches and share their robot model, terrains and render meshes, with the measured rollout throughput against the number of threads (diagrams and chart from
docs/image_generators/raisim_gym_figures.py). - Modules built with Clang train nearly as fast as with GCC:
rsg_anymaltakes 0.073 s per iteration against GCC's 0.066 s, where it took 0.58 s. PyTorch's OpenMP runtime (libgomp) bound the main thread to one core when the runners setOMP_PROC_BIND, and LLVM's runtime (libomp) then ran every environment thread on it; libomp also put its threads to sleep after every step on processors with performance and efficient cores. The runners now callconfigure_threads()(raisimGymTorch/env/openmp.py), which binds threads only for modules built with GCC, andVectorizedEnvironmentkeeps libomp's threads awake for 1 ms after each step unlessKMP_BLOCKTIMEorOMP_WAIT_POLICYis set (new unit testraisimgym_openmp_test). RAISIMGYM_RAISIM_ROOTandRAISIMGYM_RAYRAI_ROOTbuild raisimGymTorch against other RaiSim and rayrai installations than../raisimand../rayrai.- Fixed: the environment configuration parser (
Yaml.cpp) rejected a list written at its key's indentation (types:followed by- rough), which is how ruamel.yaml, used by the training scripts, writes lists, andconst Yaml::Node::operator[](size_t)was declared but not defined. New unit testraisimgym_yaml_test(-DRAISIMGYM_BUILD_TESTS=ON).