Infinite Mobility Framework

repository·main·Indexed 41 days ago

https://github.com/internrobotics/infinite-mobility

A framework for the scalable, high-fidelity procedural generation of articulated objects, such as chairs, appliances, and tools, using URDF format. It leverages the Infinigen system for procedural generation of photorealistic worlds, featuring tools for creature part definition via Blender Geometry Nodes, a multi-stage tree generation pipeline, and support for URDF-based articulated objects.

Tokens
166.1K
Snippets
523
Records
695
Agent score
51%

What's inside Infinite Mobility

  1. What is OcMesher?

    main

    OcMesher is a tool for view-dependent, octree-based mesh extraction in unbounded scenes represented by Signed Distance Functions (SDFs).

    Key features:

    • Memory Efficiency: Handles unbounded scenes efficiently.
    • High Detail: Provides high-fidelity mesh extraction based on specific camera views.
    • Infinigen Integration: Used by default in Infinigen to accelerate video generation, improve rendering quality, and export terrain meshes for external simulators.
  2. What is GLFW?

    main

    GLFW is an open-source, multi-platform library designed for developing applications using OpenGL, OpenGL ES, and Vulkan. It provides a platform-independent API for common windowing and input tasks, including:

    • Creating windows, contexts, and surfaces
    • Reading input (keyboard, mouse, etc.)
    • Handling system events

    GLFW natively supports Windows, macOS, and Linux (including both X11 and Wayland).

  3. Overview of JSON for Modern C++

    main

    JSON for Modern C++ is a header-only C++11 library designed for intuitive JSON manipulation. It aims to make JSON feel like a first-class data type in C++, similar to how it behaves in Python, by using operator overloading and modern C++ syntax.

    Key Characteristics:

    • Single Header Integration: The entire library consists of a single header file (json.hpp), requiring no complex build systems or external dependencies.
    • Intuitive Syntax: Uses C++ operator magic to allow easy creation and access of JSON objects.
    • High Reliability: Heavily unit-tested with 100% coverage and validated with memory sanitizers and fuzz testing.
    • Standard Data Types: By default, it uses std::string for strings, int64_t/uint64_t/double for numbers, std::map for objects, std::vector for arrays, and bool for Booleans.
  4. Overview of OpenGL Mathematics (GLM)

    main

    GLM (OpenGL Mathematics) is a header-only C++ mathematics library designed for graphics software. It is based on the OpenGL Shading Language (GLSL) specifications, meaning it uses the same naming conventions and functionality as GLSL. This allows developers familiar with GLSL to use the same logic in C++.

    Key features include:

    • GLSL Compatibility: Classes and functions mirror GLSL.
    • Extension System: Provides extended capabilities like matrix transformations, quaternions, data packing, random numbers, and noise.
    • Interoperability: Works with OpenGL and is suitable for software rendering (raytracing/rasterisation), image processing, and physics simulations.
    • Header-only: Easy to integrate as it requires no compiled binaries.
  5. Supported Binary Formats for JSON Encoding

    main

    The library provides several binary formats to efficiently encode JSON values into byte vectors and decode them back. This is useful for scenarios where JSON is too bulky, such as network data exchange.

    Supported formats include:

    • BJData (Binary JData)
    • BSON (Binary JSON)
    • CBOR (Concise Binary Object Representation)
    • MessagePack
    • UBJSON (Universal Binary JSON)
  6. What is BJData?

    main

    BJData is a binary JSON-like format derived from the Universal Binary JSON (UBJSON) specification. It is designed to be both compact and quasi-human-readable, as semantic elements like data-type markers and strings remain human-readable.

    Key features include:

    • Optimized ND-arrays: Efficient storage for N-dimensional packed arrays.
    • Expanded Numeric Types: Adds markers for uint16 ([u]), uint32 ([m]), uint64 ([M]), and float16 ([h]).
    • Little-Endian (LE): Uses little-endian for all numerics to avoid conversion overhead on most modern platforms.
    • Searchability: The format allows for direct searching or reading using simple processing due to its quasi-human-readable nature.
  7. Understand JSON number syntax and interoperability

    main

    The library follows the JSON specification (RFC 8259) for number representation.

    JSON Number Syntax

    Numbers are represented in base 10 using decimal digits. A number consists of:

    • An optional minus sign (-).
    • An integer component.
    • An optional fraction part (a decimal point followed by one or more digits).
    • An optional exponent part (starting with E or e, followed by an optional + or - sign and one or more digits).

    Constraint: Leading zeros are not allowed in the integer component.

    Interoperability and Precision Limits

    While the JSON spec allows for arbitrary precision, this library (and most standard implementations) targets IEEE 754 binary64 (double precision) for interoperability.

    When working with numbers, be aware of the following:

    • Precision/Range Risks: Using numbers like 1E400 or extremely long decimals (e.g., 3.141592653589793238462643383279) may cause interoperability issues if the receiving software cannot handle the magnitude or precision.
    • Exact Integer Range: To ensure exact numeric agreement across different implementations, keep integers within the range of $[-2^{53}+1, 2^{53}-1]$.
  8. Part coordinate systems and conventions

    main

    When defining or interacting with creature parts, follow these spatial conventions:

    Axis Orientation

    • +X: The long axis of the part.
    • +Z: The up axis.
    • +Y: The left side of a creature, or the leading edge of a leg or wing.
    • Parity: Use 1 for the right side and -1 for the left side.

    Surface Addressing (3D Polar Coordinates)

    To address the surface of a Part, use the Length/Yaw/Rad coordinate system:

    • Length: A 0-1 scalar representing the percentage of the length along the skeleton curve.
    • Yaw: A [-1, 1] scalar specifying the tangential yaw to shoot a ray.
      • 0: Downwards
      • ±0.5: Left/Right
      • ±1: Upwards
    • Rad: A percentage scalar (typically 0-1). The system raycasts using Length and Yaw to the surface, then moves Rad percentage of the way along that ray towards the surface.
  9. Understand Eigen Tensor Datatypes and Operations

    main

    When working with Eigen Tensors, several pseudo-types are used in the API documentation to describe behavior:

    • <Tensor-Type>::Dimensions: An array-like object of int representing the tensor's dimensions. It has a .size attribute (the rank) and can be indexed like an array.
    • <Tensor-Type>::Index: An integer type used for indexing along dimensions.
    • <Tensor-Type>::Scalar: The underlying data type of the tensor elements (e.g., float for Tensor<float, 2>).
    • <Operation>: Indicates a deferred operation. Operations do not return values immediately; they must be evaluated (e.g., by assigning them to a tensor) before values can be accessed. You can also wrap an operation in a TensorRef to access its dimensions before evaluation.
  10. Configure GLFW platform selection

    main

    You can specify the desired runtime platform using the GLFW_PLATFORM initialization hint. This allows you to target specific backends like Win32, Cocoa, Wayland, or X11, or use GLFW_ANY_PLATFORM to let GLFW decide. You can also use glfwPlatformSupported to check if a specific platform is available on the current system and glfwGetPlatform to query which platform was actually selected.

    // Example of checking platform support and querying selected platform
    if (glfwPlatformSupported(GLFW_PLATFORM_WAYLAND)) {
        // Wayland is supported
    }
    
    // Query the currently selected platform
    int platform = glfwGetPlatform();
  11. Understand binary_t subtype handling for CBOR, MessagePack, and BSON

    main

    When using binary_t, the way subtypes are handled depends on the target serialization format:

    FormatSubtype Behavior
    CBORBinary values are byte strings; subtypes are written as tags.
    MessagePackIf a subtype is provided and the array size is 1, 2, 4, 8, or 16, the fixext family is used. For other sizes, the ext family is used. The subtype is added as a signed 8-bit integer. If no subtype is provided, the bin family is used.
    BSONIf a subtype is provided, it is added as an unsigned 8-bit integer. If no subtype is provided, the generic binary subtype 0x00 is used.