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.
| Parameter | Type | Description |
|---|---|---|
clouds | map | Point clouds to render, see clouds. |
trajectory | map | Trajectory of the camera path, see trajectory. |
images | map | Camera images of the $IMAGE$ overlay lines, see images. |
camera | map | Camera path and projection, see camera. |
video | map | Video file and overlays, see video. |
clouds
Section titled “clouds”| Parameter | Type | Description |
|---|---|---|
dirpath | path | Directory 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_filter | map | Keeps the points captured within a time range. |
filters.stamp_filter.enabled | bool | |
filters.stamp_filter.min_stamp_sec | float | Absolute stamp. Unit: s. Range: [0, ∞). |
filters.stamp_filter.max_stamp_sec | float | Absolute stamp; .inf is unbounded. Unit: s. Must be ≥ min_stamp_sec. |
filters.distance_filter | map | Keeps 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.enabled | bool | |
filters.distance_filter.min_distance | float | Unit: m. Range: [0, ∞). |
filters.distance_filter.max_distance | float | .inf is unbounded. Unit: m. Must be ≥ min_distance. |
filters.intensity_filter | map | Keeps the points within an intensity range. |
filters.intensity_filter.enabled | bool | |
filters.intensity_filter.min_intensity | float | |
filters.intensity_filter.max_intensity | float | .inf is unbounded. Must be ≥ min_intensity. |
rendering.point_radius | float | Point radius relative to the scene length scale. Range: [0, ∞). |
rendering.material | string | Polyscope material: clay, wax, candy, flat, mud, ceramic, jade or normal. flat (unlit) shows the colors at full strength. |
rendering.color.mode | string | normal: 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.quantity | string | Scalar of the scalar mode: absolute_height (z in the map frame), intensity or time (seconds since the first trajectory pose). |
rendering.color.scalar.color_map | string | viridis, coolwarm, blues, reds, ping-green, phase, spectral, rainbow, jet or turbo. |
rendering.color.scalar.map_range_mode | string | quantile: 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.
trajectory
Section titled “trajectory”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.
| Parameter | Type | Description |
|---|---|---|
filepath | path | Trajectory 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_filter | map | Keeps the poses within a time range; same parameters as clouds.filters.stamp_filter. |
resampling.enabled | bool | Resamples 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.spacing | float | Unit: m. Range: [0.001, ∞). |
smoothing.enabled | bool | Smooths 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_position | float | Smoothing scale of the positions as a fraction of the trajectory length; 0 turns it off. Range: [0, ∞). |
smoothing.factor_orientation | float | Smoothing scale of the orientations; 0 turns it off. Range: [0, ∞). |
rendering.enabled | bool | Draws the processed trajectory as a curve. |
rendering.color | [float, float, float] | RGB in [0, 1]. |
rendering.radius | float | Curve radius relative to the scene length scale. Range: [0, ∞). |
rendering.material | string | Polyscope material, see clouds.rendering.material. |
images
Section titled “images”| Parameter | Type | Description |
|---|---|---|
enabled | bool | Shows camera images in the $IMAGE$ overlay lines. |
dirpath | path | Directory 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_image | int | Uses only every nth image (in file name order). Range: [1, ∞). |
camera
Section titled “camera”| Parameter | Type | Description |
|---|---|---|
mode | string | trajectory: the camera rides along the trajectory, one frame per pose. turntable: the camera orbits the clouds. |
field_of_view | float | Vertical 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_dir | string | Camera axis the view looks along: x, y, z, -x, -y or -z. |
trajectory.up_dir | string | Camera axis that points up in the view. |
turntable.center | auto or [float, float, float] | Orbit center. auto: the center of the bounding box of the clouds. Unit: m. |
turntable.distance | auto or float | Distance 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_deg | float | Elevation of the camera above the center. Unit: °. Range: [-89, 89]. |
turntable.num_frames | int | Number of frames of the orbit. Range: [1, ∞). |
turntable.revolutions | float | Number of revolutions within num_frames. |
turntable.direction | string | ccw or cw, seen from above. |
turntable.start_angle_deg | float | Azimuth 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.
| Parameter | Type | Description |
|---|---|---|
filepath | path | Video file; the container follows the extension, e.g. .mp4. Missing directories are created. |
width | int | Video and render width in pixels; odd values are rounded down to even. Range: [16, 7680]. |
height | int | Video and render height in pixels. Range: [16, 7680]. |
fps | float | Frame rate. Range: [1, 240]. |
hold_last_frame_seconds | float | Freezes the video on the last frame for this long; 0 turns it off. Unit: s. Range: [0, 60]. |
supersampling_factor | int | Supersampling 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]. |
headless | bool | Renders off-screen with EGL, without a window, e.g. on a server. |
egl_device_index | int | EGL device of the headless rendering; -1 selects automatically. Set it if the automatic choice renders black frames. |
keep_window_open | bool | Opens an interactive window on the last frame after the video is written. Not with headless. |
font_ttf_filepath | path | TrueType font of all overlay text; empty selects the bundled font. |
widgets | list | Overlays 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.
widgets
Section titled “widgets”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:
| Placeholder | Value |
|---|---|
$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:
| Marker | Content |
|---|---|
$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