foxglove.Grid

A 2D grid of data

RoboticsObservabilityVisualizationData PlatformPhysical AIAutonomyFleet ManagementDeveloper ToolsMCAPROS

Properties

Name Type Description
timestamp object Timestamp of grid
frame_id string Frame of reference
pose object Origin of grid's corner relative to frame of reference; grid is positioned in the x-y plane relative to this origin
column_count integer Number of grid columns
cell_size object Size of single grid cell along x and y axes, relative to `pose`
row_stride integer Number of bytes between rows in `data`
cell_stride integer Number of bytes between cells within a row in `data`
fields array Fields in `data`. `red`, `green`, `blue`, and `alpha` are optional for customizing the grid's color. To enable RGB color visualization in the [3D panel](https://docs.foxglove.dev/docs/visualization/pa
data string Grid cell data, interpreted using `fields`, in row-major (y-major) order. For the data element starting at byte offset i, the coordinates of its corner closest to the origin will be: - y = i / row_str
View JSON Schema on GitHub

JSON Schema

foxglove-technologies-grid.json Raw ↑
{
  "title": "foxglove.Grid",
  "description": "A 2D grid of data",
  "$comment": "Generated by https://github.com/foxglove/foxglove-sdk",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "object",
      "title": "time",
      "properties": {
        "sec": {
          "type": "integer",
          "minimum": 0
        },
        "nsec": {
          "type": "integer",
          "minimum": 0,
          "maximum": 999999999
        }
      },
      "description": "Timestamp of grid"
    },
    "frame_id": {
      "type": "string",
      "description": "Frame of reference"
    },
    "pose": {
      "title": "foxglove.Pose",
      "description": "Origin of grid's corner relative to frame of reference; grid is positioned in the x-y plane relative to this origin",
      "type": "object",
      "properties": {
        "position": {
          "title": "foxglove.Vector3",
          "description": "Point denoting position in 3D space",
          "type": "object",
          "properties": {
            "x": {
              "type": "number",
              "description": "x component"
            },
            "y": {
              "type": "number",
              "description": "y component"
            },
            "z": {
              "type": "number",
              "description": "z component"
            }
          },
          "required": [
            "x",
            "y",
            "z"
          ]
        },
        "orientation": {
          "title": "foxglove.Quaternion",
          "description": "Quaternion denoting orientation in 3D space",
          "type": "object",
          "properties": {
            "x": {
              "type": "number",
              "description": "x value"
            },
            "y": {
              "type": "number",
              "description": "y value"
            },
            "z": {
              "type": "number",
              "description": "z value"
            },
            "w": {
              "type": "number",
              "description": "w value"
            }
          },
          "required": [
            "x",
            "y",
            "z",
            "w"
          ]
        }
      },
      "required": [
        "position",
        "orientation"
      ]
    },
    "column_count": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of grid columns"
    },
    "cell_size": {
      "title": "foxglove.Vector2",
      "description": "Size of single grid cell along x and y axes, relative to `pose`",
      "type": "object",
      "properties": {
        "x": {
          "type": "number",
          "description": "x component"
        },
        "y": {
          "type": "number",
          "description": "y component"
        }
      },
      "required": [
        "x",
        "y"
      ]
    },
    "row_stride": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of bytes between rows in `data`"
    },
    "cell_stride": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of bytes between cells within a row in `data`"
    },
    "fields": {
      "type": "array",
      "items": {
        "title": "foxglove.PackedElementField",
        "description": "A field present within each element in a byte array of packed elements.",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the field"
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "description": "Byte offset from start of data buffer"
          },
          "type": {
            "title": "foxglove.NumericType",
            "description": "Type of data in the field. Integers are stored using little-endian byte order.",
            "oneOf": [
              {
                "title": "UNKNOWN",
                "const": 0,
                "description": "Unknown numeric type"
              },
              {
                "title": "UINT8",
                "const": 1,
                "description": "Unsigned 8-bit integer"
              },
              {
                "title": "INT8",
                "const": 2,
                "description": "Signed 8-bit integer"
              },
              {
                "title": "UINT16",
                "const": 3,
                "description": "Unsigned 16-bit integer"
              },
              {
                "title": "INT16",
                "const": 4,
                "description": "Signed 16-bit integer"
              },
              {
                "title": "UINT32",
                "const": 5,
                "description": "Unsigned 32-bit integer"
              },
              {
                "title": "INT32",
                "const": 6,
                "description": "Signed 32-bit integer"
              },
              {
                "title": "FLOAT32",
                "const": 7,
                "description": "32-bit floating-point number"
              },
              {
                "title": "FLOAT64",
                "const": 8,
                "description": "64-bit floating-point number"
              }
            ]
          }
        },
        "required": [
          "name",
          "offset",
          "type"
        ]
      },
      "description": "Fields in `data`. `red`, `green`, `blue`, and `alpha` are optional for customizing the grid's color.\nTo enable RGB color visualization in the [3D panel](https://docs.foxglove.dev/docs/visualization/panels/3d#rgba-separate-fields-color-mode), include **all four** of these fields in your `fields` array:\n\n- `red` - Red channel value\n- `green` - Green channel value\n- `blue` - Blue channel value\n- `alpha` - Alpha/transparency channel value\n\n**note:** All four fields must be present with these exact names for RGB visualization to work. The order of fields doesn't matter, but the names must match exactly.\n\nRecommended type: `UINT8` (0-255 range) for standard 8-bit color channels.\n\nExample field definitions:\n\n**RGB color only:**\n\n```javascript\nfields: [\n { name: \"red\", offset: 0, type: NumericType.UINT8 },\n { name: \"green\", offset: 1, type: NumericType.UINT8 },\n { name: \"blue\", offset: 2, type: NumericType.UINT8 },\n { name: \"alpha\", offset: 3, type: NumericType.UINT8 },\n];\n```\n\n**RGB color with elevation (for 3D terrain visualization):**\n\n```javascript\nfields: [\n { name: \"red\", offset: 0, type: NumericType.UINT8 },\n { name: \"green\", offset: 1, type: NumericType.UINT8 },\n { name: \"blue\", offset: 2, type: NumericType.UINT8 },\n { name: \"alpha\", offset: 3, type: NumericType.UINT8 },\n { name: \"elevation\", offset: 4, type: NumericType.FLOAT32 },\n];\n```\n\nWhen these fields are present, the 3D panel will offer additional \"Color Mode\" options including \"RGBA (separate fields)\" to visualize the RGB data directly. For elevation visualization, set the \"Elevation field\" to your elevation layer name."
    },
    "data": {
      "type": "string",
      "contentEncoding": "base64",
      "description": "Grid cell data, interpreted using `fields`, in row-major (y-major) order.\nFor the data element starting at byte offset i, the coordinates of its corner closest to the origin will be:\n\n- y = i / row_stride * cell_size.y\n- x = (i % row_stride) / cell_stride * cell_size.x"
    }
  },
  "required": [
    "timestamp",
    "frame_id",
    "pose",
    "column_count",
    "cell_size",
    "row_stride",
    "cell_stride",
    "fields",
    "data"
  ]
}