Skip to content

slamlab_render

The slamlab_render section configures the slamlab-render executable: the clouds and the trajectory to render, the camera path, and the video with its overlays.

All paths support the $CONFIG_DIRPATH$ token, which is replaced with the parent directory of the config file, and the $STAMP$ token, which is replaced with a YYYY_MM_DD-HH_MM_SS timestamp. Relative paths are relative to the working directory. All parameters are mandatory and unknown parameters are an error. The template shows typical values.

ParameterTypeDescription
cloudsmapPoint clouds to render, see clouds.
trajectorymapTrajectory of the camera path, see trajectory.
imagesmapCamera images of the $IMAGE$ overlay lines, see images.
cameramapCamera path and projection, see camera.
videomapVideo file and overlays, see video.
ParameterTypeDescription
dirpathpathDirectory with the .ply, .las or .laz clouds in the map frame, e.g. the artifacts clouds_map_frame of slamlab-offline. The points need stamps.
filters.stamp_filtermapKeeps the points captured within a time range.
filters.stamp_filter.enabledbool
filters.stamp_filter.min_stamp_secfloatAbsolute stamp. Unit: s. Range: [0, ∞).
filters.stamp_filter.max_stamp_secfloatAbsolute stamp; .inf is unbounded. Unit: s. Must be ≥ min_stamp_sec.
filters.distance_filtermapKeeps the points within a distance range of the trajectory position at their stamp, e.g. to remove the far points of each scan.
filters.distance_filter.enabledbool
filters.distance_filter.min_distancefloatUnit: m. Range: [0, ∞).
filters.distance_filter.max_distancefloat.inf is unbounded. Unit: m. Must be ≥ min_distance.
filters.intensity_filtermapKeeps the points within an intensity range.
filters.intensity_filter.enabledbool
filters.intensity_filter.min_intensityfloat
filters.intensity_filter.max_intensityfloat.inf is unbounded. Must be ≥ min_intensity.
rendering.point_radiusfloatPoint radius relative to the scene length scale. Range: [0, ∞).
rendering.materialstringPolyscope material: clay, wax, candy, flat, mud, ceramic, jade or normal. flat (unlit) shows the colors at full strength.
rendering.color.modestringnormal: the normal (eigenvector 0 of the pca attribute) mapped from [-1, 1] to [0, 1]. scalar: a scalar quantity mapped to a color map. rgb: the integer attributes red, green and blue in [0, 255].
rendering.color.scalar.quantitystringScalar of the scalar mode: absolute_height (z in the map frame), intensity or time (seconds since the first trajectory pose).
rendering.color.scalar.color_mapstringviridis, coolwarm, blues, reds, ping-green, phase, spectral, rainbow, jet or turbo.
rendering.color.scalar.map_range_modestringquantile: map_range holds the low and high quantiles of all points, with 0 ≤ low < high ≤ 1. absolute: map_range holds the color map limits, with low < high; the limits of the time quantity are absolute stamps in seconds.
rendering.color.scalar.map_range[float, float]Low and high limit, see map_range_mode.

A cloud that lacks the attribute of the color mode or of an enabled filter stops the rendering with an error that names the attribute.

The trajectory is the camera path in trajectory camera mode and the reference of the distance filter. It is processed in this order: stamp filter, resampling, smoothing. The distance filter uses the unprocessed trajectory.

ParameterTypeDescription
filepathpathTrajectory in TUM format (timestamp tx ty tz qx qy qz qw per line, # starts a comment), e.g. trajectory_tum.txt of slamlab-offline. Stamps are read exactly to the nanosecond and must not decrease.
stamp_filtermapKeeps the poses within a time range; same parameters as clouds.filters.stamp_filter.
resampling.enabledboolResamples the trajectory to a uniform spacing along its length: positions on a natural cubic spline through the poses, orientations by SLERP. In trajectory camera mode this gives a constant camera speed of spacing * fps and sets the number of frames.
resampling.spacingfloatUnit: m. Range: [0.001, ∞).
smoothing.enabledboolSmooths positions and orientations with a local linear fit whose weights decay as exp(-distance / (factor * trajectory length)) along the trajectory. A straight path stays unchanged, also at its ends.
smoothing.factor_positionfloatSmoothing scale of the positions as a fraction of the trajectory length; 0 turns it off. Range: [0, ∞).
smoothing.factor_orientationfloatSmoothing scale of the orientations; 0 turns it off. Range: [0, ∞).
rendering.enabledboolDraws the processed trajectory as a curve.
rendering.color[float, float, float]RGB in [0, 1].
rendering.radiusfloatCurve radius relative to the scene length scale. Range: [0, ∞).
rendering.materialstringPolyscope material, see clouds.rendering.material.
ParameterTypeDescription
enabledboolShows camera images in the $IMAGE$ overlay lines.
dirpathpathDirectory with images named <sec>.<nsec>.<jpg|jpeg|png>, e.g. the images of slamlab-offline-importer. Each frame shows the image closest in time to the current pose.
use_only_each_nth_imageintUses only every nth image (in file name order). Range: [1, ∞).
ParameterTypeDescription
modestringtrajectory: the camera rides along the trajectory, one frame per pose. turntable: the camera orbits the clouds.
field_of_viewfloatVertical field of view of the perspective projection. Unit: °. Range: [5, 160].
trajectory.base_T_camera.translation[float, float, float]Camera position in the base frame of the trajectory. Unit: m.
trajectory.base_T_camera.rotation[float, float, float, float]Camera orientation in the base frame as quaternion qx, qy, qz, qw.
trajectory.look_dirstringCamera axis the view looks along: x, y, z, -x, -y or -z.
trajectory.up_dirstringCamera axis that points up in the view.
turntable.centerauto or [float, float, float]Orbit center. auto: the center of the bounding box of the clouds. Unit: m.
turntable.distanceauto or floatDistance of the camera from the center. auto: the bounding sphere of the clouds fits into the field of view with a margin. Unit: m.
turntable.elevation_degfloatElevation of the camera above the center. Unit: °. Range: [-89, 89].
turntable.num_framesintNumber of frames of the orbit. Range: [1, ∞).
turntable.revolutionsfloatNumber of revolutions within num_frames.
turntable.directionstringccw or cw, seen from above.
turntable.start_angle_degfloatAzimuth of the first frame; 0 places the camera on the +x side of the center. Unit: °.

The video is encoded with H.264 by ffmpeg, which must be on PATH.

ParameterTypeDescription
filepathpathVideo file; the container follows the extension, e.g. .mp4. Missing directories are created.
widthintVideo and render width in pixels; odd values are rounded down to even. Range: [16, 7680].
heightintVideo and render height in pixels. Range: [16, 7680].
fpsfloatFrame rate. Range: [1, 240].
hold_last_frame_secondsfloatFreezes the video on the last frame for this long; 0 turns it off. Unit: s. Range: [0, 60].
supersampling_factorintSupersampling anti-aliasing: renders at this multiple of the resolution and downsamples. Lower it if headless rendering runs out of GPU memory and renders black frames. Range: [1, 4].
headlessboolRenders off-screen with EGL, without a window, e.g. on a server.
egl_device_indexintEGL device of the headless rendering; -1 selects automatically. Set it if the automatic choice renders black frames.
keep_window_openboolOpens an interactive window on the last frame after the video is written. Not with headless.
font_ttf_filepathpathTrueType font of all overlay text; empty selects the bundled font.
widgetslistOverlays drawn onto every frame, see widgets. [] draws none.

Do not resize the window during a windowed rendering: a change of the frame size stops the rendering with an error.

Each list entry is one overlay, with the same parameters as the widgets of slamlab-visualization: enabled, content, position, width, font.size, font.alignment, background_opacity and image_opacity. Text wrapped in **double asterisks** renders in the slamlab highlight color.

Text placeholders, replaced wherever they occur in a line:

PlaceholderValue
$ELAPSED_TIME$Seconds since the first pose of the camera path
$STAMP$Stamp of the current pose in seconds
$LENGTH$Trajectory length up to the current pose in meters
$TRAJECTORY_X$, $TRAJECTORY_Y$, $TRAJECTORY_Z$Pose position in meters
$TRAJECTORY_ANGLE_X$, $TRAJECTORY_ANGLE_Y$, $TRAJECTORY_ANGLE_Z$Pose orientation (roll, pitch, yaw) in degrees

Markers, each on a line of its own, render at the full overlay width:

MarkerContent
$IMAGE$Camera image closest to the current pose, see images
$IMAGE:path$Static image at path (supports $CONFIG_DIRPATH$; a relative path is relative to the working directory)
$TRAJECTORY_TOPVIEW$Top view of the camera path with a marker at the current pose

In turntable mode there is no current pose: the pose placeholders are empty, and the $IMAGE$ and $TRAJECTORY_TOPVIEW$ lines are left out.

Example:

widgets:
- enabled: true
content: "**Length**: $LENGTH$\n$TRAJECTORY_TOPVIEW$"
position: bottom_left
width: 0.2
font:
size: 0.02
alignment: left
background_opacity: 0.5
image_opacity: 1.0