### Setup Infinigen in Docker - Bash/Makefile Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Clones the Infinigen repository, navigates into the directory, builds the Docker image, sets up the environment, and runs the container with default settings. ```bash git clone https://github.com/princeton-vl/infinigen.git cd infinigen make docker-build make docker-setup make docker-run ``` -------------------------------- ### Example GLM Build Configuration Messages (Output) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md An example of the configuration messages output by GLM when `GLM_FORCE_MESSAGES` is defined. These messages detail the GLM version, C++ standard, compiler, architecture, platform, and various configuration flags. ```text GLM: 0.9.9.1 GLM: C++ 17 with extensions GLM: GCC compiler detected\" GLM: x86 64 bits with AVX instruction set build target GLM: Linux platform detected GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled. GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL. GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes. GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space. GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system. ``` -------------------------------- ### Install Infinigen (Normal) - Bash Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Executes the interactive installation script for Infinigen and Blender with default settings. ```bash bash scripts/install/interactive_blender.sh ``` -------------------------------- ### Example GLM Configuration Log Output (C++) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Provides an example of the output generated by GLM when GLM_FORCE_MESSAGES is defined. It shows detected version, C++ standard, compiler, architecture, platform, and the status of various GLM_FORCE_ defines. ```cpp GLM: version 0.9.9.1 GLM: C++ 17 with extensions GLM: Clang compiler detected GLM: x86 64 bits with AVX instruction set build target GLM: Linux platform detected GLM: GLM_FORCE_SWIZZLE is undefined. swizzling functions or operators are disabled. GLM: GLM_FORCE_SIZE_T_LENGTH is undefined. .length() returns a glm::length_t, a typedef of int following GLSL. GLM: GLM_FORCE_UNRESTRICTED_GENTYPE is undefined. Follows strictly GLSL on valid function genTypes. GLM: GLM_FORCE_DEPTH_ZERO_TO_ONE is undefined. Using negative one to one depth clip space. GLM: GLM_FORCE_LEFT_HANDED is undefined. Using right handed coordinate system. ``` -------------------------------- ### Install Infinigen (OpenGL GT) - Bash Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Executes the interactive installation script for Infinigen and Blender, enabling the installation of custom OpenGL ground truth components. ```bash INFINIGEN_INSTALL_CUSTOMGT=True bash scripts/install/interactive_blender.sh ``` -------------------------------- ### C++ Naming Conventions and Namespace Usage Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Provides examples of naming conventions for defines, classes, variables, and functions, along with the structure for using the 'glm' and 'detail' namespaces. ```cpp #define GLM_MY_DEFINE 76 class myClass {}; myClass const MyClass; namespace glm{ // glm namespace is for public code namespace detail // glm::detail namespace is for implementation detail { float myFunction(vec2 const& V) { return V.x + V.y; } float myFunction(vec2 const* const V) { return V->x + V->y; } }//namespace detail }//namespace glm ``` -------------------------------- ### Clone Repo for Blender Script Install - Bash Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Clones the Infinigen repository and navigates into the directory, preparing for installation as a Blender Python script. ```bash git clone https://github.com/princeton-vl/infinigen.git cd infinigen ``` -------------------------------- ### Install Dependencies - Ubuntu/Debian/WSL - Bash Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Installs required system dependencies for Infinigen on Ubuntu, Debian, WSL, and similar Linux distributions using apt-get. Requires root privileges. ```bash sudo apt-get install wget cmake g++ libgles2-mesa-dev libglew-dev libglfw3-dev libglm-dev zlib1g-dev ``` -------------------------------- ### Clone Repo and Setup Conda Env - Bash Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Clones the Infinigen repository, checks out a specific commit, creates a new conda environment named 'infinigen' with Python 3.10, and activates it. ```bash git clone https://github.com/princeton-vl/infinigen.git cd infinigen git checkout 572bfe7 conda create --name infinigen python=3.10 conda activate infinigen ``` -------------------------------- ### Install Dependencies - Conda - Bash Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Installs required dependencies using Conda, useful when sudo permissions are not available. Also sets necessary environment variables for includes and libraries. ```bash conda install conda-forge::gxx=11.4.0 mesalib glew glm menpo::glfw3 export C_INCLUDE_PATH=$CONDA_PREFIX/include:$C_INCLUDE_PATH export CPLUS_INCLUDE_PATH=$CONDA_PREFIX/include:$CPLUS_INCLUDE_PATH export LIBRARY_PATH=$CONDA_PREFIX/lib:$LIBRARY_PATH export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH ``` -------------------------------- ### Clone GLM Fork Repository (Git) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Clones your forked copy of the GLM repository from GitHub to your local machine. Replace `` with the actual URL of your fork. ```shell >>> git clone ``` -------------------------------- ### Conan Example - Create example.cpp Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/integration/package_managers.md Step 1 in the Conan example: Create the C++ source file that will use the nlohmann-json library. This is the same example program shown earlier, adapted for the Conan build setup. ```cpp --8<-- "integration/conan/example.cpp" ``` -------------------------------- ### Run setup script (Bash) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/README.md Executes the setup.py script to configure project dependencies after setting up the basic Infinigen environment as per the installation instructions. ```bash python setup.py ``` -------------------------------- ### Install Dependencies - Mac x86_64 - Bash Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Installs required system dependencies for Infinigen on Mac x86_64 (Intel) using Homebrew. Requires Homebrew to be installed. ```bash brew install wget cmake llvm open-mpi libomp glm glew zlib ``` -------------------------------- ### Homebrew Example - Install Library Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/integration/package_managers.md Step 2 in the Homebrew example: Install the nlohmann-json library using Homebrew. This command installs the latest stable release. ```sh brew install nlohmann-json ``` -------------------------------- ### Install Infinigen Blender Script - Minimal - Bash Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Installs the Infinigen package as a Blender Python script in minimal configuration, recommended for interactive use within the Blender UI. ```bash INFINIGEN_MINIMAL_INSTALL=True bash scripts/install/interactive_blender.sh ``` -------------------------------- ### Run Docker Container (Options) - Makefile Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Provides commands to run the Infinigen Docker container with specific options: without GPU passthrough, without OpenGL ground truth, or without both. ```makefile make docker-run-no-gpu docker-run-no-opengl docker-run-no-gpu-opengl ``` -------------------------------- ### Including GLM Core and Extensions (C++) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Shows how to include both the core GLM features and extensions using separate headers. It also provides an example function demonstrating the use of GLM types (vec2, vec3, mat4) and functions (perspective, translate, rotate, radians) to build a transformation matrix. ```C++ // Include all GLM core / GLSL features #include // vec2, vec3, mat4, radians // Include all GLM extensions #include // perspective, translate, rotate glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) { glm::mat4 Proj = glm::perspective(glm::radians(45.f), 1.33f, 0.1f, 10.f); glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.f), Translate); glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Orientation.y, Up); glm::mat4 View = glm::rotate(ViewRotateX, Orientation.x, Up); glm::mat4 Model = glm::mat4(1.0f); return Proj * View * Model; } ``` -------------------------------- ### Conan Example - Build Project Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/integration/package_managers.md Step 2 in the Conan example: Commands to create a build directory, navigate into it, install Conan dependencies, configure the build with CMake, and build the project. ```sh mkdir build cd build conan install .. cmake .. cmake --build . ``` -------------------------------- ### Install Infinigen Python Module - Minimal - Bash Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Installs the Infinigen package as a Python module in editable mode with minimal features enabled (no terrain or OpenGL GT). Suitable for Infinigen-Indoors or single-object generation. ```bash INFINIGEN_MINIMAL_INSTALL=True pip install -e . ``` -------------------------------- ### GLSL Vector Swizzle Examples Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Demonstrates the use of swizzle expressions in GLSL to rearrange or select vector components. It shows valid assignments and an example of an invalid swizzle using mixed component sets. ```glsl vec4 A; vec2 B; B.yx = A.wy; B = A.xx; vec3 C = A.bgr; vec3 D = B.rsz; // Invalid, won't compile ``` -------------------------------- ### Homebrew Example - Find Installed Files Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/integration/package_managers.md Step 3 in the Homebrew example: Command to list the files installed by the nlohmann-json Homebrew package, used to determine the include path for compilation. ```sh brew list nlohmann-json ``` -------------------------------- ### Install Infinigen Python Module - Full - Bash Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Installs the Infinigen package as a Python module in editable mode with full features enabled, including terrain and visualization (vis). Required for Infinigen-Nature HelloWorld. ```bash pip install -e .[terrain,vis] ``` -------------------------------- ### Install Dependencies - Mac ARM - Bash Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Installs required system dependencies for Infinigen on Mac ARM (M1/M2/...) using Homebrew. Requires Homebrew to be installed. ```bash arch -arm64 brew install wget cmake llvm open-mpi libomp glm glew zlib ``` -------------------------------- ### Finding and Linking GLM with CMake Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Provides CMake commands to find the installed GLM package using `find_package` and link it to a target executable using `target_link_libraries`. Includes an optional step to set the `glm_DIR` variable. ```cmake set(glm_DIR /lib/cmake/glm) # if necessary find_package(glm REQUIRED) target_link_libraries( glm::glm) ``` -------------------------------- ### Install Infinigen Python Module - Developer - Bash Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Installs the Infinigen package as a Python module in editable mode with developer dependencies, including terrain, visualization, pytest, ruff, and pre-commit hooks. ```bash pip install -e ".[dev,terrain,vis]" pre-commit install ``` -------------------------------- ### Build Docker Image (CUDA) - Makefile Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Builds the Infinigen Docker image with support for CUDA compilation, enabling GPU acceleration. ```makefile make docker-build-cuda ``` -------------------------------- ### Using Precision Qualifiers in GLSL Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md An example demonstrating the use of precision qualifiers (highp, mediump, lowp) within a GLSL shader function to control the precision of variables. ```cpp // Using precision qualifier in GLSL: ivec3 foo(in vec4 v) { highp vec4 a = v; mediump vec4 b = a; lowp ivec3 c = ivec3(b); return c; } ``` -------------------------------- ### Example C++ Program using nlohmann-json Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/integration/package_managers.md A basic C++ program demonstrating the usage of the nlohmann-json library. This file is used as an example throughout the document to show how to compile against the library installed via different package managers. ```cpp --8<-- "integration/example.cpp" ``` -------------------------------- ### Install mkcert CA Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/tools/serve_header/README.md Install the mkcert certificate authority into the system's trust store(s) to enable local HTTPS. ```Shell $ mkcert -install ``` -------------------------------- ### Start Server with Default Config Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/tools/serve_header/README.md Run the make target to start the serve_header.py script using the default configuration, serving the header at https://localhost:8443/json.hpp. ```Shell $ make serve_header ``` -------------------------------- ### Interact with Docker Container - Bash Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/Installation.md Commands for exiting the Docker container, re-entering it using `docker exec`, and activating the Infinigen conda environment inside the container. ```bash exit docker exec -it infinigen bash conda activate infinigen ``` -------------------------------- ### Homebrew Example - Create example.cpp Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/integration/package_managers.md Step 1 in the Homebrew example: Create the C++ source file that will use the nlohmann-json library. This is the same example program shown earlier. ```cpp --8<-- "integration/example.cpp" ``` -------------------------------- ### Homebrew Example - Compile with Clang Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/integration/package_managers.md Step 4 in the Homebrew example: Compile the example C++ program using the Clang compiler, specifying the include path for the nlohmann-json library installed via Homebrew and setting the C++ standard. ```sh clang++ example.cpp -I/usr/local/Cellar/nlohmann-json/3.7.3/include -std=c++11 -o example ``` -------------------------------- ### Example YAML Configuration Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/tools/serve_header/README.md Example configuration for serve_header.py to set the web server root directory, allowing serving from multiple working trees relative to a parent directory. ```YAML root: .. ``` -------------------------------- ### Enable GLM Configuration Messages (C++) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Demonstrates how to use the GLM_FORCE_MESSAGES preprocessor define to make GLM report its detected configuration settings as part of the build log. This helps verify how GLM is configured based on the build environment and other defines. ```cpp #define GLM_FORCE_MESSAGES // Or defined when building (e.g. -DGLM_FORCE_SWIZZLE) #include ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/tools/serve_header/README.md Install the required Python packages using pip or similar package manager. These are listed in requirements.txt. ```Shell PyYAML watchdog ``` -------------------------------- ### Including GLM Core Headers (C++) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Demonstrates the basic inclusion of the main GLM header file, which provides core GLSL-like mathematical types and functions. This is the fundamental step to use GLM's core features. ```C++ #include ``` -------------------------------- ### Using Specific Core and Extension Headers (C++) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Demonstrates including specific core GLM headers (vec2, vec3, mat4, trigonometric) and an extension header (matrix_transform) to define and use a function that creates a transformation matrix. ```cpp // Include GLM core features #include // vec2 #include // vec3 #include // mat4 #include //radians // Include GLM extension #include // perspective, translate, rotate glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) { glm::mat4 Proj = glm::perspective(glm::radians(45.f), 1.33f, 0.1f, 10.f); glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.f), Translate); glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Orientation.y, Up); glm::mat4 View = glm::rotate(ViewRotateX, Orientation.x, Up); glm::mat4 Model = glm::mat4(1.0f); return Proj * View * Model; } ``` -------------------------------- ### C++ If/Else Block Coding Style Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Demonstrates the preferred coding style for multi-line if/else blocks, showing indentation using tabs and brace placement on new lines. ```cpp if(blah) { // yes like this } else { // something besides } ``` -------------------------------- ### Install WSL Dependencies for OpenGL (Bash) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/GroundTruthAnnotations.md Installs additional libraries required for compiling the OpenGL components on WSL. ```bash sudo apt-get install doxygen sudo apt-get install libxinerama-dev sudo apt-get install libxcursor-dev sudo apt-get install libxi-dev ``` -------------------------------- ### Fetch Latest Changes from Upstream (Git) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Fetches the latest commits from the `upstream` remote (the original GLM repository). This updates your local copy with the changes from the main project. ```shell >>> git fetch upstream ``` -------------------------------- ### Generating Local Documentation Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/README.md These shell commands clone the nlohmann/json repository, navigate into the directory, checkout a specific version tag (v3.10.2 in this example), and then use the makefile in the docs/mkdocs directory to install dependencies (likely a Python virtual environment) and serve the documentation locally. Requires git and make, and assumes mkdocs and its dependencies are handled by the makefile. ```shell git clone https://github.com/nlohmann/json.git cd json git checkout v3.10.2 make install_venv serve -C docs/mkdocs ``` -------------------------------- ### Including Core GLM Headers (C++) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Lists the individual core GLM headers for various vector, matrix, and function categories, allowing users to include only necessary components to reduce compilation time. ```cpp #include // vec2, bvec2, dvec2, ivec2 and uvec2 #include // vec3, bvec3, dvec3, ivec3 and uvec3 #include // vec4, bvec4, dvec4, ivec4 and uvec4 #include // mat2, dmat2 #include // mat2x3, dmat2x3 #include // mat2x4, dmat2x4 #include // mat3x2, dmat3x2 #include // mat3, dmat3 #include // mat3x4, dmat2 #include // mat4x2, dmat4x2 #include // mat4x3, dmat4x3 #include // mat4, dmat4 #include // all the GLSL common functions: abs, min, mix, isnan, fma, etc. #include // all the GLSL exponential functions: pow, log, exp2, sqrt, etc. #include // all the GLSL geometry functions: dot, cross, reflect, etc. #include // all the GLSL integer functions: findMSB, bitfieldExtract, etc. #include // all the GLSL matrix functions: transpose, inverse, etc. #include // all the GLSL packing functions: packUnorm4x8, unpackHalf2x16, etc. #include // all the GLSL trigonometric functions: radians, cos, asin, etc. #include // all the GLSL vector relational functions: equal, less, etc. ``` -------------------------------- ### Example Execution for argparse C++ Snippet Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/argparse/README.md This Bash snippet shows an example command line execution that corresponds to the C++ argument parsing setup in the previous snippet. It demonstrates how to provide values for positional arguments, combine short optional flags ('-abc'), provide values for optional arguments ('-c', '--files'), and shows the expected output. ```bash $ ./main 1 2 3 -abc 3.14 2.718 --files a.txt b.txt c.txt numbers = {1, 2, 3} a = true b = true c = {3.14, 2.718} files = {"a.txt", "b.txt", "c.txt"} ``` -------------------------------- ### Using Precision Qualifiers in GLM C++ Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md An example demonstrating how GLM C++ emulates GLSL precision qualifiers using type prefixes (highp_, mediump_, lowp_) instead of qualifiers. Shows how to use these types within a C++ function equivalent to the GLSL example. ```cpp // Using precision qualifier in GLM: #include ivec3 foo(const vec4 & v) { highp_vec4 a = v; medium_vec4 b = a; lowp_ivec3 c = glm::ivec3(b); return c; } ``` -------------------------------- ### Start Server with YAML Config Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/tools/serve_header/README.md Run the make target to start the serve_header.py script using the specified YAML configuration file, enabling serving from multiple working trees. ```Shell $ make serve_header ``` -------------------------------- ### GLSL Default Precision Syntax Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Illustrates the standard GLSL syntax for setting default precision for integer and floating-point types within a shader. ```glsl precision mediump int; precision highp float; ``` -------------------------------- ### Using Specific Extension Headers (C++) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Shows how to include GLM features using extension headers (vector_float, matrix_float, matrix_transform) to define and use a function that creates a transformation matrix, potentially further minimizing build time. ```cpp // Include GLM vector extensions: #include // vec2 #include // vec3 #include // radians // Include GLM matrix extensions: #include // mat4 #include // perspective, translate, rotate glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, glm::vec3 const& Up) { glm::mat4 Proj = glm::perspective(glm::radians(45.f), 1.33f, 0.1f, 10.f); glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.f), Translate); glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Orientation.y, Up); glm::mat4 View = glm::rotate(ViewRotateX, Orientation.x, Up); glm::mat4 Model = glm::mat4(1.0f); return Proj * View * Model; } ``` -------------------------------- ### Push Synchronized Master to Origin (Git) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Pushes the synchronized `master` branch from your local repository to your `origin` remote (your fork on GitHub). This updates your GitHub fork with the latest changes from the main GLM repository. ```shell >>> git push origin master ``` -------------------------------- ### Conan Example - Create Conanfile.txt Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/integration/package_managers.md Step 1 in the Conan example: Create the Conanfile.txt file, which declares the nlohmann_json dependency for the project. ```ini --8<-- "integration/conan/Conanfile.txt" ``` -------------------------------- ### Using GLM_EXT_vector_relational for epsilon comparison (C++) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Illustrates how to perform an epsilon-based comparison between two glm::vec2 vectors using glm::equal and checking if all components satisfy the condition with glm::all. Requires including . ```cpp #include // vec2 #include // equal, all bool epsilonEqual(glm::vec2 const& A, glm::vec2 const& B) { float const CustomEpsilon = 0.0001f; return glm::all(glm::equal(A, B, CustomEpsilon)); } ``` -------------------------------- ### Quoting C Code with Syntax Highlighting Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glfw/docs/CONTRIBUTING.md Illustrates how to quote C code blocks in GitHub Markdown and enable syntax highlighting by appending 'c' after the opening triple backticks. This improves readability for code examples. ```c int five(void) { return 5; } ``` -------------------------------- ### Enabling GLM Default Precision in C++ Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Shows how to enable GLM's default precision functionality in C++ by defining specific preprocessor macros before including the main GLM header. This example sets medium precision for integers and high precision for floats. ```cpp #define GLM_FORCE_PRECISION_MEDIUMP_INT #define GLM_FORCE_PRECISION_HIGHP_FLOAT #include ``` -------------------------------- ### Testing and Installing amalgamate.py Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/tools/amalgamate/README.md This shell command sequence first runs the test script ('./test.sh') to verify functionality and then copies the 'amalgamate.py' script to '/usr/local/bin/' for system-wide access, requiring superuser privileges. ```Shell ./test.sh && sudo -k cp ./amalgamate.py /usr/local/bin/ ``` -------------------------------- ### Using GLM_EXT_vector_common for fmax (C++) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Demonstrates the use of the glm::fmax function from the GLM_EXT_vector_common extension, which supports taking more than two arguments and prevents NaN propagation. Requires including . ```cpp #include // vec2 #include // fmax float positiveMax(float const a, float const b) { return glm::fmax(a, b, 0.0f); } ``` -------------------------------- ### Define GLM_FORCE_MESSAGES for Bug Reporting (C++) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Defines the `GLM_FORCE_MESSAGES` preprocessor macro before including GLM headers. This forces GLM to output build configuration messages, which are useful for diagnosing configuration-specific bugs. ```cpp #define GLM_FORCE_MESSAGES #include ``` -------------------------------- ### Switch to Master Branch (Git) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Switches your current working branch to `master`. This is recommended before creating a new branch for a bug fix or feature to ensure the new branch is based on the latest code. ```shell >>> git checkout master ``` -------------------------------- ### Using GLM_FORCE_SWIZZLE for C++98 Swizzling (L-value/R-value) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Demonstrates the use of GLM_FORCE_SWIZZLE to enable C++98 swizzling with anonymous structs (a non-standard extension). Shows examples of using swizzles for both L-value (assignment target) and R-value (assignment source) operations. Requires compiler support for anonymous structs in unions. ```C++ #define GLM_FORCE_SWIZZLE #include // Only guaranteed to work with Visual C++! // Some compilers that support Microsoft extensions may compile this. void foo() { glm::vec4 ColorRGBA = glm::vec4(1.0f, 0.5f, 0.0f, 1.0f); // l-value: glm::vec4 ColorBGRA = ColorRGBA.bgra; // r-value: ColorRGBA.bgra = ColorRGBA; // Both l-value and r-value ColorRGBA.bgra = ColorRGBA.rgba; } ``` -------------------------------- ### Install Visualization Dependencies (Bash) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/GroundTruthAnnotations.md Installs extra dependencies required for running visualization scripts using pip. ```bash pip install .[vis] ``` -------------------------------- ### Install MacOS Dependencies for OpenGL (Bash) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/GroundTruthAnnotations.md Installs required libraries for compiling the OpenGL components on MacOS using Homebrew. ```bash brew install glfw3 brew install glew ``` -------------------------------- ### Generate Infinigen Scene Step-by-Step (Bash) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/HelloWorld.md Executes the Infinigen scene generation pipeline one task at a time using separate `python` commands. It includes steps for generating the coarse layout, populating fine details, and rendering the final images and ground truth. Requires the Infinigen library and a Python environment. ```bash mkdir outputs # Generate a scene layout python -m infinigen_examples.generate_nature --seed 0 --task coarse -g desert.gin simple.gin --output_folder outputs/hello_world/coarse # Populate unique assets python -m infinigen_examples.generate_nature --seed 0 --task populate fine_terrain -g desert.gin simple.gin --input_folder outputs/hello_world/coarse --output_folder outputs/hello_world/fine # Render RGB images python -m infinigen_examples.generate_nature --seed 0 --task render -g desert.gin simple.gin --input_folder outputs/hello_world/fine --output_folder outputs/hello_world/frames # Render again for accurate ground-truth python -m infinigen_examples.generate_nature --seed 0 --task render -g desert.gin simple.gin --input_folder outputs/hello_world/fine --output_folder outputs/hello_world/frames -p render.render_image_func=@flat/render_image ``` -------------------------------- ### Set Model-View-Projection Matrix Uniform using GLM in C++ Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Demonstrates how to create and combine projection, view (translation and rotation), and model (scaling) matrices using GLM functions and upload the resulting MVP matrix to a shader uniform using glUniformMatrix4fv. ```C++ #include // vec3, vec4, ivec4, mat4 #include // translate, rotate, scale, perspective #include // value_ptr void setUniformMVP(GLuint Location, glm::vec3 const& Translate, glm::vec3 const& Rotate) { glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f); glm::mat4 ViewTranslate = glm::translate( glm::mat4(1.0f), Translate); glm::mat4 ViewRotateX = glm::rotate( ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); glm::mat4 View = glm::rotate(ViewRotateX, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); glm::mat4 Model = glm::scale( glm::mat4(1.0f), glm::vec3(0.5f)); glm::mat4 MVP = Projection * View * Model; glUniformMatrix4fv(Location, 1, GL_FALSE, glm::value_ptr(MVP)); } ``` -------------------------------- ### Define Vertex Data with Various GLM Vector Types in C++ Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Shows examples of defining vertex data for a quad using different GLM vector types, including float, half-float, 8-bit integer, and 32-bit integer vectors, illustrating GLM's type precision capabilities. ```C++ #include // vec2 #include // hvec2, i8vec2, i32vec2 std::size_t const VertexCount = 4; // Float quad geometry std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2); glm::vec2 const PositionDataF32[VertexCount] = { glm::vec2(-1.0f,-1.0f), glm::vec2( 1.0f,-1.0f), glm::vec2( 1.0f, 1.0f), glm::vec2(-1.0f, 1.0f) }; // Half-float quad geometry std::size_t const PositionSizeF16 = VertexCount * sizeof(glm::hvec2); glm::hvec2 const PositionDataF16[VertexCount] = { glm::hvec2(-1.0f, -1.0f), glm::hvec2( 1.0f, -1.0f), glm::hvec2( 1.0f, 1.0f), glm::hvec2(-1.0f, 1.0f) }; // 8 bits signed integer quad geometry std::size_t const PositionSizeI8 = VertexCount * sizeof(glm::i8vec2); glm::i8vec2 const PositionDataI8[VertexCount] = { glm::i8vec2(-1,-1), glm::i8vec2( 1,-1), glm::i8vec2( 1, 1), glm::i8vec2(-1, 1) }; // 32 bits signed integer quad geometry std::size_t const PositionSizeI32 = VertexCount * sizeof(glm::i32vec2); glm::i32vec2 const PositionDataI32[VertexCount] = { glm::i32vec2(-1,-1), glm::i32vec2( 1,-1), glm::i32vec2( 1, 1), glm::i32vec2(-1, 1) }; ``` -------------------------------- ### Install Ubuntu Dependencies for OpenGL (Bash) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/GroundTruthAnnotations.md Installs required libraries for compiling the OpenGL components of the advanced annotation pipeline on Ubuntu. ```bash sudo apt-get install libglm-dev libglew-dev libglfw3-dev libgles2-mesa-dev zlib1g-dev ``` -------------------------------- ### Standalone Installation Steps (Bash) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/OcMesher/README.md Sequence of shell commands to clone the repository, execute the installation script, set up a Python environment using Conda, and install required packages via pip. ```Bash git clone https://github.com/princeton-vl/OcMesher.git cd OcMesher bash install.sh conda create --name ocmesher python=3.10 conda activate ocmesher pip install -r requirements.txt ``` -------------------------------- ### Example output of parent_pointer (JSON) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/api/json_pointer/parent_pointer.md Reference to an external file containing example JSON output from the `parent_pointer` examples. The actual output is in `examples/json_pointer__parent_pointer.output`. ```json --8<-- "examples/json_pointer__parent_pointer.output" ``` -------------------------------- ### Building Indicators Library Samples (Bash) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/indicators/README.md Standard bash commands to clone the indicators repository, navigate into it, create a build directory, configure CMake to enable samples and demo, and build the project. ```bash git clone https://github.com/p-ranav/indicators cd indicators mkdir build && cd build cmake -DINDICATORS_SAMPLES=ON -DINDICATORS_DEMO=ON .. make ``` -------------------------------- ### Enabling and Using GLM Swizzle Functions (C++98 R-value) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Shows how to enable GLM's swizzle functionality by defining GLM_FORCE_SWIZZLE and demonstrates using R-value swizzle member functions available when compiling with C++98 support. ```cpp #define GLM_FORCE_SWIZZLE // Or defined when building (e.g. -DGLM_FORCE_SWIZZLE) #include void foo() { glm::vec4 const ColorRGBA = glm::vec4(1.0f, 0.5f, 0.0f, 1.0f); glm::vec3 const ColorBGR = ColorRGBA.bgr(); glm::vec3 const PositionA = glm::vec3(1.0f, 0.5f, 0.0f); glm::vec3 const PositionB = PositionA.xyz() * 2.0f; glm::vec2 const TexcoordST = glm::vec2(1.0f, 0.5f); glm::vec4 const TexcoordSTPQ = TexcoordST.stst(); } ``` -------------------------------- ### Installing amalgamate.py Script (Shell) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/indicators/utils/amalgamate/README.md This shell command sequence shows how to test the `amalgamate.py` script and then install it by copying it to a standard system binary directory. ```Shell ./test.sh && sudo -k cp ./amalgamate.py /usr/local/bin/ ``` -------------------------------- ### Expected Output of Example Program Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/integration/package_managers.md The expected JSON output generated by executing the example C++ program (example.cpp) after it has been compiled and linked with the nlohmann-json library. ```json --8<-- "../../examples/meta.output" ``` -------------------------------- ### Replacing gluProject with GLM C++ Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Shows the GLM C++ function signatures that replace the GLU gluProject function for projecting a 3D object point to window coordinates. It includes overloads for float and double types. Requires the GLM_GTC_matrix_transform extension. ```cpp glm::vec3 project(glm::vec3 const& obj, glm::mat4 const& model, glm::mat4 const& proj, glm::ivec4 const& viewport); glm::dvec3 project(glm::dvec3 const& obj, glm::dmat4 const& model, glm::dmat4 const& proj, glm::ivec4 const& viewport); ``` -------------------------------- ### Getting Tensor Rank C++ Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/eigen/unsupported/Eigen/CXX11/src/Tensor/README.md Accesses the compile-time constant `NumDimensions` to get the rank (number of dimensions) of an Eigen tensor. The example prints the rank of a 2D tensor. ```C++ Eigen::Tensor a(3, 4); cout << "Dims " << a.NumDimensions; // => Dims 2 ``` -------------------------------- ### Include GLM Setup Header C++ Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/doc/api/a00164_source.html Includes the main setup header for the GLM library, which defines necessary macros and configurations. ```C++ #include "setup.hpp" ``` -------------------------------- ### Generating Infinigen Indoor Scene (Coarse Task) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/ExportingToSimulators.md Runs the Infinigen example script to generate a single-room indoor scene with specific parameters, saving the output to a specified folder. ```bash python -m infinigen_examples.generate_indoors --seed 0 --task coarse --output_folder outputs/indoors/coarse -g overhead_singleroom.gin -p compose_indoors.terrain_enabled=False compose_indoors.solve_max_rooms=1 ``` -------------------------------- ### Example Message for json.exception.invalid_iterator.214 Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/home/exceptions.md Example error message for `json.exception.invalid_iterator.214`, indicating an attempt to get a value from an iterator belonging to a null value or an invalid iterator for a primitive type. ```Exception Message [json.exception.invalid_iterator.214] cannot get value ``` -------------------------------- ### Error 106: JSON Pointer Array Index Starts With Zero Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/home/exceptions.md Example error message for parse_error.106, indicating that a JSON Pointer ([RFC 6901]) contains an array index reference token that starts with '0' but is not just '0'. ```Text [json.exception.parse_error.106] parse error: array index '01' must not begin with '0' ``` -------------------------------- ### Calculate Lighting using GLM in C++ Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Implements a basic lighting calculation function using GLM for vector operations like normalization, reflection, dot product, and power. Includes diffuse and specular components and incorporates randomness for soft shadows (requires 'intersection', 'material', 'light', and 'shadow' types/functions not shown). ```C++ #include // vec3 normalize reflect dot pow #include // ballRand // vecRand3, generate a random and equiprobable normalized vec3 glm::vec3 lighting(intersection const& Intersection, material const& Material, light const& Light, glm::vec3 const& View) { glm::vec3 Color = glm::vec3(0.0f); glm::vec3 LightVertor = glm::normalize( Light.position() - Intersection.globalPosition() + glm::ballRand(0.0f, Light.inaccuracy())); if(!shadow(Intersection.globalPosition(), Light.position(), LightVertor)) { float Diffuse = glm::dot(Intersection.normal(), LightVertor); if(Diffuse <= 0.0f) return Color; if(Material.isDiffuse()) Color += Light.color() * Material.diffuse() * Diffuse; if(Material.isSpecular()) { glm::vec3 Reflect = glm::reflect(-LightVertor, Intersection.normal()); float Dot = glm::dot(Reflect, View); float Base = Dot > 0.0f ? Dot : 0.0f; float Specular = glm::pow(Base, Material.exponent()); Color += Material.specular() * Specular; } } return Color; } ``` -------------------------------- ### Example: Visualize single URDF (Bash) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/README.md Specific example demonstrating how to use the show.py script to visualize a single URDF file located in the outputs directory by providing its file path. ```bash python show.py ./outputs/***.urdf ``` -------------------------------- ### C++ Single-Line If Coding Style Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Illustrates the coding style for single-line if/else statements, where the action is on the line immediately following the condition. ```cpp if(blah) // yes like this else // something besides ``` -------------------------------- ### Example: Visualize directory of URDFs (Bash) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/README.md Specific example demonstrating how to use the show.py script to visualize all URDF files contained within the specified outputs directory by providing the directory path. ```bash python show.py ./outputs ``` -------------------------------- ### Using GLM_EXT_vector_ulp for ULP distance (C++) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Shows how to use functions from the GLM_EXT_vector_ulp extension to measure the accuracy of numeric calculations. Specifically, it uses glm::next_float to get a value one ULP away and glm::float_distance to check the ULP difference. Requires including . ```cpp #include #include #include bool test_ulp(glm::vec4 const& x) { glm::vec4 const a = glm::next_float(x); // return a float a ULP away from the float argument. return glm::all(float_distance(a, x) == glm::ivec4(1)); // check both float are a single ULP away. } ``` -------------------------------- ### Registry Entry Example - Python/Gin Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/ConfiguringInfinigen.md An example of an entry within a registry configuration, typically a tuple specifying an item name ('sand') and its relative weight (10) for sampling from the registry. ```python ("sand", 10) ``` -------------------------------- ### Example of Explicit Conversion Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/api/macros/json_use_implicit_conversions.md Shows the explicit way to retrieve a value from a JSON object using the get() method. This is required when JSON_USE_IMPLICIT_CONVERSIONS is disabled. ```cpp json j = "Hello, world!"; auto s = j.get(); ``` -------------------------------- ### Example: Generate Office Chairs (Bash) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/README.md Specific example demonstrating how to use the paralled_generate.py script to generate 100 'OfficeChairFactory' objects using up to 10 parallel processes simultaneously. ```bash python paralled_generate.py OfficeChairFactory 100 10 ``` -------------------------------- ### Example Usage - nlohmann::basic_json::rbegin - C++ Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/json/docs/mkdocs/docs/api/basic_json/rbegin.md Placeholder indicating an external C++ file containing an example demonstrating the use of the `rbegin` function. ```cpp --8<-- "examples/rbegin.cpp" ``` -------------------------------- ### Replacing glLoadTransposeMatrix with GLM in C++ Source: https://github.com/openrobotlab/infinite-mobility/blob/main/infinigen/datagen/customgt/dependencies/glm/manual.md Demonstrates the GLM function `glm::transpose` for replacing the deprecated OpenGL `glLoadTransposeMatrix` function. This function computes the transpose of a matrix. ```C++ glm::transpose(glm::mat4()); glm::transpose(glm::dmat4()); ``` -------------------------------- ### Generate Infinigen Scene in One Command (Bash) Source: https://github.com/openrobotlab/infinite-mobility/blob/main/docs/HelloWorld.md Uses the `manage_jobs.py` utility script to automate the entire Infinigen scene generation pipeline with a single command. Specifies output folder, number of scenes, seed, configuration files, and pipeline overrides. Requires the Infinigen library and a Python environment. ```bash python -m infinigen.datagen.manage_jobs --output_folder outputs/hello_world --num_scenes 1 --specific_seed 0 \ --configs desert.gin simple.gin --pipeline_configs local_16GB.gin monocular.gin blender_gt.gin --pipeline_overrides LocalScheduleHandler.use_gpu=False ```