### Install librealsense Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_realsense.md Installs the necessary librealsense libraries on the host system. This is a prerequisite for the RealSense camera to function correctly with the example. ```bash mkdir -p /etc/apt/keyrings && \ curl -sSf https://librealsense.intel.com/Debian/librealsense.pgp | tee /etc/apt/keyrings/librealsense.pgp > /dev/null && \ echo "deb [signed-by=/etc/apt/keyrings/librealsense.pgp] https://librealsense.intel.com/Debian/apt-repo `lsb_release -cs` main" | \ tee /etc/apt/sources.list.d/librealsense.list && \ apt-get update && \ apt-get install -y librealsense2-utils librealsense2-dkms ``` -------------------------------- ### Launch ESDF Example Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_esdf.md Launch the ESDF example script with specified dataset path and number of frames. ```bash python3 -m nvblox_torch.examples.esdf.esdf \ --dataset_path /sun3d-mit_76_studyroom-76-1studyroom2/ \ --num_frames 100 ``` -------------------------------- ### Install and Run Pre-commit Hooks Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/contributing.md Install and run pre-commit hooks to ensure consistent formatting and linting across the project. This should be done locally before committing changes. ```bash pip install --upgrade pip pre-commit pre-commit install pre-commit run --all-files ``` -------------------------------- ### Profile Nvblox Example with Nsys Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_realsense.md Provides bash commands to profile the Nvblox example using nsys. This helps in analyzing the performance of the application. ```bash nsys profile python3 -m nvblox_torch.examples.realsense.run_realsense_mapper ``` ```bash nsys-ui report1.nsys-rep ``` -------------------------------- ### Launch Deep Feature Reconstruction Example Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_deep_features.md Run the Nvblox example for deep feature reconstruction on the SUN3D dataset. Replace with the actual path to your dataset. ```bash python3 -m nvblox_torch.examples.reconstruction.sun3d \ --dataset_path /sun3d-mit_76_studyroom-76-1studyroom2/ \ --deep_feature_mapping ``` -------------------------------- ### Verify Nvblox Installation Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/installation.md Runs the installed Nvblox tests to verify the installation. Navigate to the nvblox_torch directory within your site-packages. ```bash cd $(python3 -c "import site; print(site.getsitepackages()[0])")/nvblox_torch pytest -s ``` -------------------------------- ### Install Build Dependencies Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/installation.md Installs essential build tools including CMake, Git, and Python development headers. A CUDA Toolkit installation is also required. ```bash sudo apt-get update && sudo apt-get install -y \ cmake git git-lfs build-essential python3-dev ``` -------------------------------- ### Install Nvblox Header Directories Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox/CMakeLists.txt Installs the main Nvblox header directory and the header directory for datasets. These are placed in the system's include path. ```cmake install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/datasets/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ``` -------------------------------- ### Run Trajectory Optimization Example Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_gradients.md Execute the trajectory optimization example script. This command initiates the process of optimizing a path to avoid collisions using nvblox-torch. ```bash python3 -m nvblox_torch.examples.gradients.trajectory_optimization_example ``` -------------------------------- ### Run Realsense Mapper Example Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_realsense.md Launches the main Python script for the RealSense live mapping example. This script captures data, tracks poses, and builds a 3D reconstruction. ```python python3 -m nvblox_torch.examples.realsense.run_realsense_mapper ``` -------------------------------- ### Verify Nvblox Core Library Installation Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/installation.md Runs the installed Nvblox core library tests to confirm a successful build and installation. ```bash ctest --test-dir . ``` -------------------------------- ### Map Loading and Meshing Example Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox/examples/CMakeLists.txt Defines an executable for loading maps and generating meshes. This example depends on nvblox_lib, nvblox_stdgpu, and nvblox_gpu_hash. ```cmake add_nvblox_executable( load_map_and_mesh SOURCE_FILES src/load_map_and_mesh.cpp LINK_LIBRARIES_PUBLIC nvblox_lib nvblox_stdgpu nvblox_gpu_hash) ``` -------------------------------- ### Install Nvblox Libraries and Targets Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox/CMakeLists.txt Installs the main Nvblox libraries (nvblox_lib, nvblox_datasets, nvblox_eigen) and exports targets for use by other CMake projects. Specifies installation directories for archives, libraries, runtime binaries, and include files. ```cmake include(GNUInstallDirs) install( TARGETS nvblox_lib nvblox_datasets nvblox_eigen EXPORT nvbloxTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) ``` -------------------------------- ### Install nvblox_torch Python Package Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/installation.md Install the `nvblox_torch` Python library from its source directory. This makes the Python bindings available for use. ```bash cd /workspaces/nvblox/nvblox_torch pip3 install --editable . ``` -------------------------------- ### Create and Activate Docs Virtual Environment Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/README.md Creates a new Python virtual environment named 'venv_docs', activates it, changes the directory to 'docs', and installs project dependencies from requirements.txt. ```bash python3 -m venv venv_docs source venv_docs/bin/activate cd ./docs python3 -m pip install -r requirements.txt ``` -------------------------------- ### Install Git LFS for Image Downloads Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/README.md Installs git-lfs, which is required for downloading images used within the documentation. ```bash sudo apt-get update && sudo apt-get install git-lfs ``` -------------------------------- ### Build Docker Image Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_realsense.md Builds the Docker image required for the RealSense example. This image includes the example-specific dependencies and nvblox_torch. ```bash python3 ci/nvblox_ci.py --image realsense ``` -------------------------------- ### Install stdgpu Headers (Conditional) Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox/CMakeLists.txt Installs the stdgpu header files if the system's stdgpu is not being used. ```cmake if(NOT USE_SYSTEM_STDGPU) install(DIRECTORY ${ext_stdgpu_SOURCE_DIR}/src/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) endif() ``` -------------------------------- ### Install Git LFS Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/installation.md Installs git-lfs, a prerequisite for cloning the Nvblox repository from source. This command is for Debian-based systems. ```bash sudo apt-get install git-lfs ``` -------------------------------- ### Find and Fetch GLFW Library Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox_renderer/CMakeLists.txt Attempts to find GLFW version 3.3 or later. If not found, it fetches version 3.4 from its Git repository using FetchContent and configures it to disable examples, tests, and documentation, and not to install. ```cmake find_package(glfw3 3.3 QUIET) if(NOT glfw3_FOUND) message( STATUS "[nvblox_renderer] System GLFW3 not found, fetching v3.4 from source..." ) include(FetchContent) set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) FetchContent_Declare( glfw GIT_REPOSITORY https://github.com/glfw/glfw.git GIT_TAG 3.4) FetchContent_MakeAvailable(glfw) else() message(STATUS "[nvblox_renderer] Found system GLFW3: ${glfw3_VERSION}") # System GLFW3 creates glfw3::glfw3 target, but FetchContent creates 'glfw'. # Create an alias for consistent target naming across both cases. if(NOT TARGET glfw) add_library(glfw ALIAS glfw3::glfw3) endif() endif() ``` -------------------------------- ### Install Nvblox for Ubuntu 22.04 with CUDA 12.6 Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/index.md Installs nvblox_torch wheel for Ubuntu 22.04 with CUDA 12.6. System dependencies are also installed. ```bash # Install dependencies. sudo apt-get install python3-pip libglib2.0-0 libgl1 # Install pip packages. pip3 install https://github.com/nvidia-isaac/nvblox/releases/download/vunknown/nvblox_torch-unknown+cu12ubuntu22-py3-none-linux_x86_64.whl ``` -------------------------------- ### Verify Nvblox Installation with ctest Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/installation.md Run this command to verify the core Nvblox library installation by executing its tests. ```bash ctest --test-dir /workspaces/nvblox/build ``` -------------------------------- ### Generate Single Sphere Scene Mapper Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_voxel_access.md Generates a scene mapper with a single sphere. This is a setup step for voxel access examples. ```python mapper = get_single_sphere_scene_mapper(radius_m=SPHERE_RADIUS_M) mapper.update_color_mesh() mesh = mapper.get_color_mesh() mesh_o3d = mesh.to_open3d() mesh_o3d.compute_vertex_normals() ``` -------------------------------- ### Install Nvblox Python Packages Source: https://github.com/nvidia-isaac/nvblox/blob/public/python/scripts/README.md Install the common and scripts Python packages for Nvblox. Ensure you replace `` with the actual root directory of your Nvblox installation. ```bash pip3 install -e /python/common/ pip3 install -e /python/scripts/ ``` -------------------------------- ### Install Open3D for Mesh Visualization Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/core_library_run_an_example.md Install Open3D and its dependencies to visualize PLY mesh files generated by Nvblox when the renderer is disabled. ```bash sudo apt-get install libglib2.0-0 libgl1 pip3 install open3d ``` -------------------------------- ### Create and Activate Virtual Environment Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/index.md Creates a Python virtual environment and activates it. This is a prerequisite for installing nvblox. ```bash python3 -m venv venv # Only needed if the venv wasn't already created. source venv/bin/activate ``` -------------------------------- ### Verify nvblox_torch Installation with pytest Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/installation.md Run this command to verify the `nvblox_torch` Python package installation by executing its tests. ```bash pytest -s /workspaces/nvblox/nvblox_torch ``` -------------------------------- ### Build Nvblox Core Library with Bazel Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/installation.md Use this command to build the core Nvblox C++ library. Ensure Bazel is installed and configured. ```bash # Install Bazel (if not already installed) # See https://bazel.build/install for installation instructions # Build the core library bazel build //:nvblox # Run tests bazel test //nvblox/tests/... # Build for aarch64 (experimental) bazel build --config arm64 //:nvblox ``` -------------------------------- ### Install Nvblox for Ubuntu 24.04 with CUDA 13.0 Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/index.md Installs PyTorch with CUDA 13.0 support and the nvblox_torch wheel for Ubuntu 24.04. A virtual environment is created and activated. ```bash # Install system dependencies. sudo apt-get install python3-pip python3-venv libglib2.0-0 libgl1 # Create and activate a virtual environment. python3 -m venv nvblox_venv && . nvblox_venv/bin/activate # Install pip packages pip3 install torch==2.9.1+cu130 torchvision --index-url https://download.pytorch.org/whl/cu130/ pip3 install https://github.com/nvidia-isaac/nvblox/releases/download/vunknown/nvblox_torch-unknown+cu13ubuntu24-py3-none-linux_x86_64.whl ``` -------------------------------- ### nvblox C++ Repository Layout Example Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/contributing.md Illustrates the directory structure for C++ code within the nvblox repository, showing organization of public, internal, implementation, and CUDA headers, as well as source and test files. ```bash nvblox/ ├── include/ │ ├── nvblox/ │ │ ├── integrators/ │ │ │ ├── tsdf_integrator.h # Public header │ │ │ ├── internal/ │ │ │ │ ├── tsdf_integrator_params.h # Internal header │ │ │ │ ├── impl/ │ │ │ │ │ ├── tsdf_integrator_impl.h # Implementation header | │ │ │ ├── cuda/ │ │ │ │ │ ├── tsdf_integrator.cuh # CUDA header │ │ │ │ | ├── impl/ │ │ │ │ | │ ├── tsdf_integrator_impl.cu # CUDA implementation header | src/ | ├── integrators/ | │ ├── tsdf_integrator.cpp # Source file | │ ├── tsdf_integrator.cu # CUDA source file | tests/ | ├── test_tsdf_integrator.cpp # Unit tests ``` -------------------------------- ### Verify Vulkan Installation Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/renderer_getting_started.md Verify that a Vulkan-capable GPU driver is installed. This command checks for Vulkan devices and their capabilities. ```bash vulkaninfo --summary ``` -------------------------------- ### Install Eigen Headers (Conditional) Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox/CMakeLists.txt Installs the Eigen header files if the system's Eigen is not being used. Excludes unsupported subdirectories. ```cmake if(NOT USE_SYSTEM_EIGEN) install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/eigen/include/eigen3 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} PATTERN "*/unsupported**" EXCLUDE) endif() ``` -------------------------------- ### Launch Docker Container Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_realsense.md Launches the Docker container for the RealSense example. Ensure the DISPLAY environment variable is set if running via SSH. ```bash docker/run_docker.sh -i nvblox_realsense_example_cu12_u22 ``` -------------------------------- ### Install Nvblox Evaluation Dependencies Source: https://github.com/nvidia-isaac/nvblox/blob/public/python/evaluation/nvblox_evaluation/replica_reconstruction_evaluation/README.md Installs the common and evaluation modules for Nvblox using pip. This is a prerequisite for running the evaluation scripts. ```bash pip3 install -e /python/common/ pip3 install -e /python/evaluation/ ``` -------------------------------- ### Download and Unzip Replica Dataset Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/core_library_run_an_example.md Download and extract the Replica dataset, which is used for running Nvblox examples. ```bash wget https://cvg-data.inf.ethz.ch/nice-slam/data/Replica.zip unzip Replica.zip ``` -------------------------------- ### Install Nvblox for Ubuntu 24.04 with CUDA 12.8 Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/index.md Installs system dependencies and the nvblox_torch wheel for Ubuntu 24.04 with CUDA 12.8. Ensure a virtual environment is active. ```bash # Install system dependencies. sudo apt-get install python3-venvpython3-pip libglib2.0-0 libgl1 # Create and activate a virtual environment. python3 -m venv nvblox_venv && . nvblox_venv/bin/activate # Install pip packages pip3 install https://github.com/nvidia-isaac/nvblox/releases/download/vunknown/nvblox_torch-unknown+cu12ubuntu24-py3-none-linux_x86_64.whl ``` -------------------------------- ### Install Libraries in CMake Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox_renderer/CMakeLists.txt Installs multiple nvblox_renderer libraries to their respective destinations based on CMake variables. This ensures libraries are correctly placed for runtime and archival. ```cmake install( TARGETS nvblox_renderer nvblox_renderer_core nvblox_renderer_utils nvblox_renderer_targets nvblox_renderer_kernels nvblox_renderer_visualizers EXPORT nvbloxTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ``` -------------------------------- ### Download and Unzip 3DMatch Dataset Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/core_library_more_examples.md Download and extract a sample SUN3D dataset for use with Nvblox. Ensure you have wget and unzip installed. ```bash wget http://3dvision.princeton.edu/projects/2016/3DMatch/downloads/rgbd-datasets/sun3d-mit_76_studyroom-76-1studyroom2.zip unzip sun3d-mit_76_studyroom-76-1studyroom2.zip ``` -------------------------------- ### Install Renderer Headers in CMake Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox_renderer/CMakeLists.txt Installs the nvblox_renderer header files from the include directory to the system's include path. This makes the library's API accessible to other projects. ```cmake install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ``` -------------------------------- ### Run Nvblox Python Modules Source: https://github.com/nvidia-isaac/nvblox/blob/public/python/scripts/README.md Execute Nvblox Python modules system-wide after installation. Replace `` with the desired module and `` with any necessary arguments. ```bash python -m ``` -------------------------------- ### Shader Directory Definitions Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox_renderer/src/utils/CMakeLists.txt Sets compile definitions for shader directories, including build and install locations, used by shader_utils.cpp. ```cmake target_compile_definitions( nvblox_renderer_utils PRIVATE BUILD_SHADER_DIR="${SHADER_BINARY_DIR}" INSTALL_SHADER_DIR="${CMAKE_INSTALL_FULL_DATADIR}/nvblox_renderer/shaders") add_dependencies(nvblox_renderer_utils shaders) ``` -------------------------------- ### Install Compiled Shaders in CMake Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox_renderer/CMakeLists.txt Installs compiled shader files (with .spv extension) from a specified binary directory to the nvblox_renderer shaders data directory. This is crucial for the renderer's runtime operation. ```cmake install( DIRECTORY ${SHADER_BINARY_DIR}/ DESTINATION ${CMAKE_INSTALL_DATADIR}/nvblox_renderer/shaders FILES_MATCHING PATTERN "*.spv") ``` -------------------------------- ### nvblox-torch Python Wrapper Structure Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/contributing.md Outlines the directory organization for the nvblox-torch Python wrapper, detailing the C++ wrapping code, the Python package structure, datasets, examples, and tests. ```bash nvblox_torch/ ├── cpp/ # C++ code for wrapping | ├── include/ | ├── tests/ | ├── src/ | | ├── py_nvblox.cu # Wrapper definitions. | | | ... ├── nvblox_torch/ # Python package base dir. | ├── mapper.py # Main mapper class. | | ... | ├── lib/ # Symlinks to the .so files we are shipping with the wrapper. | ├── datasets/ # Datasets for testing and evaluation. | ├── examples/ # Example scripts | ├── tests/ # Python unit tests. ``` -------------------------------- ### Set Nvblox Shader Directory Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/renderer_overview.md Export this environment variable to specify the runtime path for compiled shaders if the install prefix differs from the runtime path. ```bash export NVBLOX_SHADER_DIR=/path/to/share/nvblox_renderer/shaders ``` -------------------------------- ### Get Scene Mapper Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_esdf.md Obtain a scene mapper which contains the scene map as a TsdfLayer. This function is hidden for brevity and details can be found in the reconstruction example. ```python mapper = get_sun3d_scene_mapper( dataset_path=args.dataset_path, voxel_size_m=args.voxel_size_m, num_frames=args.num_frames, ) ``` -------------------------------- ### Build Multi-Version Documentation Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/README.md Generates documentation for multiple versions of the project, typically for set branches like release and main. Only docs committed to these branches will be reflected. ```bash make multi-docs ``` -------------------------------- ### Configure and Initialize PyCuVSLAM Tracker Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_realsense.md Sets up the PyCuVSLAM tracker with specific configuration parameters and camera rig information. Ensure intrinsics and extrinsics are correctly provided. ```python cfg = vslam.TrackerConfig(async_sba=False, enable_final_landmarks_export=True, odometry_mode=vslam.TrackerOdometryMode.Multicamera, horizontal_stereo_camera=False) rig = get_vslam_stereo_rig(realsense_dataloader.left_infrared_intrinsics(), realsense_dataloader.right_infrared_intrinsics(), realsense_dataloader.T_C_left_infrared_C_right_infrared()) cuvslam_tracker = vslam.Tracker(rig, cfg) ``` -------------------------------- ### Build Current Version of Docs Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/README.md Generates the HTML documentation for the current version of the project. ```bash make html ``` -------------------------------- ### NvbloxRenderer Initialization Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/renderer_api.md Explains the two-phase initialization process for NvbloxRenderer, requiring an explicit `init()`, `initWithWindow()`, or `initHeadless()` call after the default constructor. ```APIDOC ## Initialization Model `NvbloxRenderer` uses a two-phase lifecycle: a trivial default constructor followed by an explicit `init()` (or `initWithWindow()` / `initHeadless()`) call. There is no constructor that takes a `RendererConfig` directly. ``` -------------------------------- ### Initialize Nvblox Renderer with Window Helper Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/renderer_getting_started.md A convenience method to initialize the Nvblox renderer with a window, skipping the explicit configuration struct. ```cpp renderer.initWithWindow(1280, 720, "My Viewer"); ``` -------------------------------- ### Initialize Headless Renderer with Helper Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/renderer_getting_started.md A convenience method to initialize the Nvblox renderer in headless mode, skipping the explicit configuration struct. ```cpp renderer.initHeadless(1920, 1080); ``` -------------------------------- ### Initialize and Switch Render Modes Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/renderer_getting_started.md Initialize multiple visualizers upfront and switch between them at runtime using `setRenderMode()`. Ensure data is updated for each mode as needed before rendering. ```cpp // Initialize all visualizers renderer.initVisualizer(RenderMode::kImage); renderer.imageVisualizer()->resizeDepthTexture(640, 480); renderer.imageVisualizer()->resizeColorTexture(1280, 720); renderer.initVisualizer(RenderMode::kPointCloud); renderer.initVisualizer(RenderMode::kMesh); CudaStreamOwning stream; while (!renderer.shouldClose()) { // Update data for each mode as needed... stream.synchronize(); // Switch modes at any time if (show_mesh) { renderer.setRenderMode(RenderMode::kMesh); } else { renderer.setRenderMode(RenderMode::kPointCloud); } renderer.render(); renderer.pollEvents(); } ``` -------------------------------- ### Configure and Build Nvblox Core Library Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/installation.md Configures the build using CMake with specific options to disable PyTorch wrapper and renderer, then compiles the core C++ library. Assumes you are in the repository root. ```bash mkdir build && cd build cmake .. -DBUILD_PYTORCH_WRAPPER=0 -DBUILD_RENDERER=0 make -j6 ``` -------------------------------- ### Visualize RGBD Data as Point Cloud Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/renderer_getting_started.md Initialize the renderer for point cloud visualization and render RGBD data with interactive camera controls. Optionally narrow the depth range. ```cpp renderer.init(config); renderer.initVisualizer(RenderMode::kPointCloud); // Optional: narrow the depth range (defaults are 0.1 m / 10.0 m). renderer.setDepthRange(0.1f, 5.0f); CudaStreamOwning stream; while (!renderer.shouldClose()) { renderer.updatePointCloud(depth_image, color_image, depth_cam, color_cam, stream); stream.synchronize(); renderer.render(); renderer.pollEvents(); } ``` -------------------------------- ### Enter Nvblox Docker Container Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/README.md Use this command to enter the Nvblox Docker environment for development. ```bash ./docker/run_docker.sh ``` -------------------------------- ### Get TsdfLayer Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_voxel_access.md Retrieves the TsdfLayer object which contains the TSDF voxels from the scene mapper. ```python tsdf_layer = mapper.tsdf_layer_view() ``` -------------------------------- ### Initialize Nvblox Mapper with Custom Parameters Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_realsense.md Initializes the Nvblox Mapper, configuring the projective integrator with a maximum integration distance. Adjust args.max_integration_distance_m as needed for your scene. ```python # Create some parameters projective_integrator_params = ProjectiveIntegratorParams() projective_integrator_params.projective_integrator_max_integration_distance_m = \ args.max_integration_distance_m mapper_params = MapperParams() mapper_params.set_projective_integrator_params(projective_integrator_params) ``` -------------------------------- ### Disable PyTorch Wrapper Build Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/installation.md Configures the CMake build to exclude the PyTorch wrapper, useful if PyTorch is not installed or not needed. ```bash cmake -DBUILD_PYTORCH_WRAPPER=0 .. ``` -------------------------------- ### Re-initialize Renderer After Destruction Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/renderer_getting_started.md After calling `destroy()`, the renderer can be re-initialized, for example, with new dimensions using `initHeadless()` and then initializing visualizers. ```cpp renderer.destroy(); renderer.initHeadless(1024, 768); // Re-init with new dimensions renderer.initVisualizer(RenderMode::kMesh); ``` -------------------------------- ### Create SUN3D Dataloader Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_reconstruction.md Initializes a PyTorch dataloader for the SUN3D dataset. Ensure the dataset path is correctly specified. ```python dataloader = Sun3dDataset.create_dataloader(root_dir=args.dataset_path, sequence_name=args.sequence_name) ``` -------------------------------- ### Get All Allocated Voxel Blocks Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_voxel_access.md Retrieves all allocated VoxelBlocks and their corresponding indices from a TsdfLayer. This is the first step for sparse voxel access. ```python blocks, indices = tsdf_layer.get_all_blocks() ``` -------------------------------- ### Run Nvblox with Replica Dataset Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/core_library_run_an_example.md Execute the `fuse_replica` executable to perform real-time mesh reconstruction on a Replica dataset. Adjust `--voxel_size` for desired resolution; smaller values yield finer meshes but require more resources. ```bash build/executables/fuse_replica Replica/room0 --voxel_size=0.02 ``` -------------------------------- ### Visualize Mesh with Open3D Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/core_library_run_an_example.md Use the Open3D command-line tool to draw and visualize a saved mesh file. ```bash open3d draw mesh.ply ``` -------------------------------- ### Build Nvblox with Renderer Enabled Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/renderer_getting_started.md Build nvblox with the renderer enabled. This command configures the build system to include renderer components. ```bash cmake -DBUILD_RENDERER=ON .. make -j6 ``` -------------------------------- ### Get Voxel Pointer in Kernel Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/core_library_interface.md Retrieves a pointer to a voxel at a given position within the CUDA kernel. Returns true if the voxel has been allocated, false otherwise. ```cpp TsdfVoxel* voxel; getVoxelAtPosition(block_hash, query_location, block_size, &voxel); ``` -------------------------------- ### Configure Internal and External Includes Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox/CMakeLists.txt Sets up include directories for both internal Nvblox headers and external CUDA toolkit headers. This ensures that the compiler can find all necessary header files during the build process. ```cmake include_directories(include) ``` ```cmake include_directories(SYSTEM ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) ``` -------------------------------- ### Define nvblox_renderer Include Directories Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox_renderer/CMakeLists.txt Sets common include directories for all renderer modules. It uses generator expressions to ensure that include paths are correctly handled for both build and install configurations. ```cmake set(NVBLOX_RENDERER_INCLUDE_DIRS $ $) ``` -------------------------------- ### Get Voxels GPU Function Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/core_library_interface.md Host function to launch the CUDA kernel for querying voxels. It sets up device vectors, obtains a GPU layer view, and synchronizes the CUDA device. ```cpp void getVoxelsGPU( const TsdfLayer layer, const device_vector& positions_L, device_vector* voxels_ptr, device_vector* success_flags_ptr) const { const int num_queries = positions_L.size(); voxels_ptr->resize(num_queries); success_flags_ptr->resize(num_queries); constexpr int kNumThreads = 512; const int num_blocks = divideRoundUp(num_queries, kNumThreads); GPULayerView gpu_layer_view = layer.getGpuLayerView(CudaStreamOwning()); queryVoxelsKernel<<>>( num_queries, gpu_layer_view.getHash().impl_, layer.block_size(), positions_L.data(), voxels_ptr->data(), success_flags_ptr->data()); checkCudaErrors(cudaDeviceSynchronize(cuda_stream)); checkCudaErrors(cudaPeekAtLastError()); } ``` -------------------------------- ### Initialize Nvblox Renderer in Headless Mode Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/renderer_getting_started.md Configure and initialize the Nvblox renderer for headless mode, rendering offscreen without a window. Useful for automated testing or server-side rendering. ```cpp RendererConfig config; config.width = 1920; config.height = 1080; config.headless = true; renderer.init(config); renderer.initVisualizer(RenderMode::kMesh); CudaStreamOwning stream; // Control the camera programmatically ViewCamera* cam = renderer.viewCamera(); cam->setTarget(0.0f, 0.0f, 0.0f); cam->setDistance(3.0f); cam->setOrbitAngles(0.5f, 0.3f); // Render a single frame renderer.updateMesh(mesh, stream); stream.synchronize(); renderer.render(); ``` -------------------------------- ### Initialize Nvblox Renderer with Configuration Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/renderer_getting_started.md Configure and initialize the Nvblox renderer using a RendererConfig struct. This is used for windowed applications. ```cpp #include "nvblox/renderer/renderer.h" using namespace nvblox::renderer; // 1. Configure and initialize NvbloxRenderer renderer; RendererConfig config; config.width = 1280; config.height = 720; config.title = "My Viewer"; renderer.init(config); // 2. Initialize the image visualizer and resize textures renderer.initVisualizer(RenderMode::kImage); renderer.imageVisualizer()->resizeDepthTexture(640, 480); renderer.imageVisualizer()->resizeColorTexture(1280, 720); // 3. Render loop CudaStreamOwning stream; while (!renderer.shouldClose()) { renderer.updateDepth(depth_image, stream); renderer.updateColor(color_image, stream); // IMPORTANT: synchronize CUDA before rendering stream.synchronize(); renderer.render(); renderer.pollEvents(); } ``` -------------------------------- ### Update and Get Feature Mesh Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_deep_features.md Update the feature mesh based on the added feature frames and retrieve the generated feature mesh. This mesh stores vertices and per-vertex features on the GPU. ```python mapper.update_feature_mesh() feature_mesh = mapper.get_feature_mesh() ``` -------------------------------- ### Define nvblox_renderer_core Library Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox_renderer/src/core/CMakeLists.txt Defines the nvblox_renderer_core shared library, specifying its source files, public link libraries, and include directories. This setup is crucial for integrating Vulkan and CUDA functionalities. ```cmake add_nvblox_shared_library( nvblox_renderer_core SOURCE_FILES vk_utils.cpp vk_frame_sync.cpp vk_context.cpp shared_buffer.cu shared_texture.cu cuda_vulkan_semaphore.cu framebuffer_readback.cu LINK_LIBRARIES_PUBLIC nvblox_lib Vulkan::Vulkan nvblox_eigen CUDA::cudart glog::glog INCLUDE_DIRECTORIES_PUBLIC ${NVBLOX_RENDERER_INCLUDE_DIRS}) ``` -------------------------------- ### Find glslangValidator Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox_renderer/CMakeLists.txt Locates the glslangValidator executable, which is required for compiling GLSL shaders. It searches in the Vulkan SDK's bin directory and /usr/bin. If not found, it throws a fatal error with installation instructions. ```cmake find_program(GLSLC glslangValidator HINTS "$ENV{VULKAN_SDK}/bin" /usr/bin) if(NOT GLSLC) message( FATAL_ERROR "[nvblox_renderer] glslangValidator not found.\n" " Install glslang-tools: apt-get install glslang-tools\n" " Searched: $ENV{VULKAN_SDK}/bin, /usr/bin") endif() message(STATUS "[nvblox_renderer] Found glslangValidator: ${GLSLC}") ``` -------------------------------- ### Build C++ Library (JetPack 7, JetPack 5) Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/installation.md Builds the Nvblox C++ library, disabling the PyTorch wrapper, for JetPack 7 or JetPack 5. This command is executed within the Docker environment. ```bash mkdir -p /workspaces/nvblox/build cd /workspaces/nvblox/build cmake .. -DBUILD_PYTORCH_WRAPPER=0 make -j6 ``` -------------------------------- ### Get AABB Voxel Center Grid Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_esdf.md Generate a grid of query points within the Axis-Aligned Bounding Box (AABB) of the mapped space. This function inspects the TsdfLayer to determine the scene extents. ```python query_grid_xyz_m = get_aabb_voxel_center_grid(mapper.tsdf_layer_view()) ``` -------------------------------- ### Build nvblox_datasets Shared Library Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox/datasets/CMakeLists.txt Configures the build process for the nvblox_datasets shared library using CMake. It specifies source files, public link libraries, and public include directories for both build and install interfaces. ```cmake add_nvblox_shared_library( nvblox_datasets SOURCE_FILES src/3dmatch.cpp src/image_loader.cpp src/replica.cpp src/redwood.cpp src/cusfm_data.cpp src/lidarply_loader.cpp src/lidarply_writer.cpp LINK_LIBRARIES_PUBLIC nvblox_lib INCLUDE_DIRECTORIES_PUBLIC $ $) ``` -------------------------------- ### Replica Surface Evaluation Script Usage Source: https://github.com/nvidia-isaac/nvblox/blob/public/python/evaluation/nvblox_evaluation/replica_reconstruction_evaluation/README.md Displays the command-line arguments for the replica_surface_evaluation.py script. Use this to customize output paths, visualization options, and the path to the fuse_replica binary. ```bash usage: replica_surface_evaluation.py [-h] [--output_root_path OUTPUT_ROOT_PATH] [--dont_visualize_error_mesh] [--do_coverage_visualization] [--fuse_replica_binary_path FUSE_REPLICA_BINARY_PATH] groundtruth_mesh_path [reconstructed_mesh_path] Reconstruct a mesh from the replica dataset and test it against ground-truth geometry. positional arguments: groundtruth_mesh_path Path to the groundtruth mesh. reconstructed_mesh_path Path to the mesh to evaluate. optional arguments: -h, --help show this help message and exit --output_root_path OUTPUT_ROOT_PATH Path to the directory in which to save results. --dont_visualize_error_mesh Flag indicating if we should visualize the error mesh. --do_coverage_visualization Flag indicating if we should display the coverage mesh. --fuse_replica_binary_path FUSE_REPLICA_BINARY_PATH Path to the fuse_replica binary. If not passed we search the standard build folder location. ``` -------------------------------- ### Get GPU Layer View Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/core_library_interface.md Obtains a GPU view of the hash table representing the map. This view is used within CUDA kernels to efficiently transform 3D query locations into voxel memory locations. ```cpp GPULayerView gpu_layer_view = layer.getGpuLayerView(CudaStreamOwning()) ``` -------------------------------- ### Initialize Mapper Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/core_library_interface.md Creates a mapper instance with specified voxel size and memory type. Voxels are stored on the GPU by default. ```cpp const float voxel_size_m = 0.05; const MemoryType memory_type = MemoryType::kDevice; Mapper(voxel_size_s, memory_type); ``` -------------------------------- ### Render ColorMesh with Nvblox Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/renderer_getting_started.md Initialize the renderer for mesh visualization and render a ColorMesh. For textured meshes, also upload the texture atlas. ```cpp renderer.init(config); renderer.initVisualizer(RenderMode::kMesh); CudaStreamOwning stream; while (!renderer.shouldClose()) { renderer.updateMesh(color_mesh, stream); stream.synchronize(); renderer.render(); renderer.pollEvents(); } ``` -------------------------------- ### Initialize RealsenseDataloader Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_realsense.md Creates a RealsenseDataloader to interface with the RealSense camera. Set max_steps to control the number of frames to process. ```python realsense_dataloader = RealsenseDataloader(max_steps=args.max_frames) ``` -------------------------------- ### Check Module Usage Source: https://github.com/nvidia-isaac/nvblox/blob/public/python/scripts/README.md Display the help message and usage instructions for any Nvblox Python module. Append the '-h' flag to the module execution command. ```bash python -m -h ``` -------------------------------- ### Shader Compilation Configuration Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox_renderer/CMakeLists.txt Sets up directories for shader sources and compiled binaries. It also enables shader optimization for release builds by setting the -Os flag for glslangValidator. ```cmake set(SHADER_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/shaders) set(SHADER_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/shaders) file(MAKE_DIRECTORY ${SHADER_BINARY_DIR}) # Enable shader optimization for release builds if(CMAKE_BUILD_TYPE MATCHES "Release|RelWithDebInfo") set(GLSLC_OPT_FLAG "-Os") message(STATUS "[nvblox_renderer] Shader optimization enabled (-Os)") else() set(GLSLC_OPT_FLAG "") endif() ``` -------------------------------- ### Initialize Nvblox Mapper Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_realsense.md Initializes the Nvblox mapper with specified voxel sizes and integrator types. Ensure mapper parameters are correctly configured. ```python nvblox_mapper = Mapper(voxel_sizes_m=args.voxel_size_m, integrator_types=ProjectiveIntegratorType.TSDF, mapper_parameters=mapper_params) ``` -------------------------------- ### Add ViewCamera Test Executable (CPU Only) Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox_renderer/tests/CMakeLists.txt Defines the 'test_view_camera' executable for CPU-only tests. It links against the renderer utilities module and Google Test, using common test options. ```cmake add_nvblox_executable( test_view_camera SOURCE_FILES test_view_camera.cpp LINK_LIBRARIES_PRIVATE nvblox_renderer_utils nvblox_test_utils gtest) gtest_discover_tests(test_view_camera ${COMMON_TEST_OPTIONS} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) ``` -------------------------------- ### Create Symbolic Links for Visualization Tools Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox/tests/CMakeLists.txt Creates symbolic links for Python visualization scripts, making them accessible in the build directory. ```cmake file(CREATE_LINK "${CMAKE_CURRENT_SOURCE_DIR}/visualization/visualize_csv_depth_image.py" "${CMAKE_CURRENT_BINARY_DIR}/visualize_csv_depth_image.py" SYMBOLIC) ``` ```cmake file(CREATE_LINK "${CMAKE_CURRENT_SOURCE_DIR}/../visualization/visualize_mesh.py" "${CMAKE_CURRENT_BINARY_DIR}/visualize_mesh.py" SYMBOLIC) ``` -------------------------------- ### Configure and Create Mapper Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_reconstruction.md Sets up the Mapper with specific integration parameters, including maximum integration distance and voxel size. The Mapper is the central interface for nvblox_torch operations. ```python # Create some parameters projective_integrator_params = ProjectiveIntegratorParams() projective_integrator_params.projective_integrator_max_integration_distance_m = 5.0 mapper_params = MapperParams() mapper_params.set_projective_integrator_params(projective_integrator_params) # Create the mapper mapper = Mapper( voxel_sizes_m=args.voxel_size_m, mapper_parameters=mapper_params, ) ``` -------------------------------- ### Add Window Renderer Test Executable Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox_renderer/tests/CMakeLists.txt Configures an executable for window renderer tests, which require a display. It includes necessary libraries like glfw and discovers tests using gtest. ```cmake add_nvblox_executable( test_window_renderer SOURCE_FILES test_window_renderer.cu LINK_LIBRARIES_PRIVATE nvblox_renderer nvblox_test_utils gtest glfw) gtest_discover_tests(test_window_renderer ${VULKAN_TEST_OPTIONS} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) ``` -------------------------------- ### Define Nvblox Test Utilities Static Library Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox/tests/CMakeLists.txt Defines a static library 'nvblox_test_utils' that includes various CUDA and C++ source files for testing. It links against public and private libraries and includes public directories. ```cmake add_nvblox_static_library( nvblox_test_utils SOURCE_FILES lib/cuda/blox_utils.cu lib/cuda/index_layer_specialization.cu lib/cuda/boolean_layer_specialization.cu lib/cuda/float_layer_specialization.cu lib/cuda/initialization_test_layer_specialization.cu lib/cuda/gpu_image_routines.cu lib/cuda/gpu_indexing.cu lib/cuda/gpu_layer_utils.cu lib/cuda/increment_kernel.cu lib/cuda/interpolation_2d_gpu.cu lib/cuda/layer.cu lib/cuda/mesh_utils.cu lib/cuda/projective_tsdf_integrator_cuda_components.cu lib/cuda/test_utils_cuda.cu lib/cuda/weighting_utils.cu lib/cuda/test_layer.cu lib/custom_camera_sensor_inst.cu lib/projective_tsdf_integrator_cpu.cpp lib/tsdf_zero_crossings_extractor_cpu.cpp lib/utils.cpp lib/esdf_integrator_cpu.cpp lib/integrator_utils.cpp lib/ransac_plane_fitter_utils.cpp LINK_LIBRARIES_PUBLIC nvblox_lib nvblox_datasets gtest LINK_LIBRARIES_PRIVATE nvblox_gpu_hash nvblox_stdgpu INCLUDE_DIRECTORIES_PUBLIC include) ``` -------------------------------- ### Initialize Mapper for Single Sphere Scene Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_gradients.md Sets up an nvblox_torch Mapper object representing a scene with a single sphere. This is used to generate collision data for the optimization. ```python mapper = get_single_sphere_scene_mapper( scene_size=SCENE_SIZE, voxel_size=VOXEL_SIZE, center=CENTER, radius=RADIUS, ) ``` -------------------------------- ### Build C++ Library (x86, JetPack 6) Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/installation.md Builds the Nvblox C++ library using CMake and Make for x86 architecture with JetPack 6. This command is executed within the Docker environment. ```bash mkdir -p /workspaces/nvblox/build cd /workspaces/nvblox/build cmake .. make -j6 ``` -------------------------------- ### Run Replica Surface Evaluation Source: https://github.com/nvidia-isaac/nvblox/blob/public/python/evaluation/nvblox_evaluation/replica_reconstruction_evaluation/README.md Executes the surface evaluation script for the Replica dataset. This script reconstructs a mesh and compares it against ground truth, saving results in an 'output' subfolder. ```bash cd /python/evaluation/nvblox_evaluation/replica_reconstruction_evaluation ./replica_surface_evaluation.py DATASET_DIR/office0_mesh.ply ``` -------------------------------- ### Add VkFrameSync Test Executable Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox_renderer/tests/CMakeLists.txt Defines the 'test_vk_frame_sync' executable, linking it with core renderer modules and Google Test. It uses Vulkan-capable test options. ```cmake add_nvblox_executable( test_vk_frame_sync SOURCE_FILES test_vk_frame_sync.cpp LINK_LIBRARIES_PRIVATE nvblox_renderer_core nvblox_test_utils gtest) gtest_discover_tests(test_vk_frame_sync ${VULKAN_TEST_OPTIONS} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) ``` -------------------------------- ### Calculate AABB and Create Voxel Grid Source: https://github.com/nvidia-isaac/nvblox/blob/public/docs/pages/torch_examples_esdf.md Determine the minimum and maximum block indices, convert them to voxel coordinates, and then create a 3D meshgrid of points in meters using torch.linspace and torch.meshgrid. ```python min_block_idx, max_block_idx = layer.get_block_limits() aabb_min_vox = min_block_idx * layer.block_dim_in_voxels aabb_max_vox = (max_block_idx + 1) * layer.block_dim_in_voxels # Create a 3D grid of points. x_linspace = torch.linspace(aabb_min_vox[0], aabb_max_vox[0], aabb_max_vox[0] - aabb_min_vox[0] + 1, dtype=torch.int) y_linspace = torch.linspace(aabb_min_vox[1], aabb_max_vox[1], aabb_max_vox[1] - aabb_min_vox[1] + 1, dtype=torch.int) z_linspace = torch.linspace(aabb_min_vox[2], aabb_max_vox[2], aabb_max_vox[2] - aabb_min_vox[2] + 1, dtype=torch.int) x_grid, y_grid, z_grid = torch.meshgrid(x_linspace, y_linspace, z_linspace, indexing='ij') query_grid_xyz_vox = torch.stack([x_grid, y_grid, z_grid], dim=-1) # Voxel units to meters. query_grid_xyz_m = (query_grid_xyz_vox + 0.5) * layer.voxel_size() ``` -------------------------------- ### Set Test Options Source: https://github.com/nvidia-isaac/nvblox/blob/public/nvblox/tests/CMakeLists.txt Configures options for tests, such as setting a discovery timeout for Google Test. ```cmake set(TEST_OPTIONS DISCOVERY_TIMEOUT 30) ```