home / skills / bdambrosio / cognitive_workbench / debug-get-local-grid

This skill helps you debug and inspect the raw local_grid data from world_state to validate coordinate systems and grid structure.

npx playbooks add skill bdambrosio/cognitive_workbench --skill debug-get-local-grid

Review the files below or copy the command above to add this skill to your agents.

Files (2)
Skill.md
653 B
---
name: debug-get-local-grid
type: python
hidden: true
description: "Debug tool: Get raw local_grid from world_state"
---

# debug-get-local-grid

Debug tool for testing coordinate system. Returns raw local_grid data from world_state.

## Input

None

## Output

Returns uniform return format with:
- `value`: Summary text
- `data`: Raw local_grid dict with:
  - `center`: `{x, y, z, yaw}` (absolute coordinates)
  - `radius`: int
  - `cells`: Dict of cell data (keyed by "x,y,z")

## Notes

- Hidden from planner catalog (debug/testing only)
- Returns raw internal grid structure
- Accessible via direct `{"type": "debug-get-local-grid"}` invocation

Overview

This skill provides a debug endpoint that returns the raw local_grid structure from the agent's world_state. It is intended for testing and inspecting the coordinate system, grid layout, and per-cell metadata. Use it to verify that the agent's local mapping and coordinate transforms are correct.

How this skill works

When invoked with a direct debug call, the skill reads the world_state and extracts the local_grid object without modification. It returns a uniform JSON with a human-readable summary in value and the unaltered local_grid dict in data. The local_grid contains center coordinates, integer radius, and a dictionary of cells keyed by "x,y,z".

When to use it

  • Validating coordinate transforms and agent pose reflected in the local grid
  • Inspecting cell-level data (occupancy, flags, or custom metadata) during development
  • Debugging mismatches between sensor data and internal map representation
  • Unit testing pathfinding, navigation, or grid generation routines
  • Quickly exporting the internal grid for logging or offline analysis

Best practices

  • Invoke only in development or controlled test environments; output is raw and may expose internal structure
  • Compare the returned center x,y,z,yaw with ground truth to detect transform errors
  • Use small radii or filtered queries when inspecting large grids to reduce noise
  • Log or snapshot outputs for repeatable test cases and regression checks
  • Pair with visualizers or mapping tools to interpret the cell key layout ("x,y,z")

Example use cases

  • Call the skill after a localization update to confirm the local_grid center moved as expected
  • Run before and after a sensor fusion change to ensure cell values remain consistent
  • Extract raw grid to reproduce a navigation failure in a unit test
  • Validate that a new grid-generation routine populates cell keys and metadata correctly
  • Use in CI to assert the presence and basic shape of the local_grid structure

FAQ

What does the returned format look like?

Response contains a "value" string summary and "data" with the raw local_grid: center {x,y,z,yaw}, radius as int, and cells keyed by "x,y,z".

Is this safe to call in production?

This is a debug-only tool that exposes internal structures. Prefer using it in testing or with secure logging; avoid exposing outputs to end users.