# `BB.Robot.Topology`
[🔗](https://github.com/beam-bots/bb/blob/main/lib/bb/robot/topology.ex#L5)

Pre-computed topology metadata for efficient traversal and kinematic operations.

This struct contains ordering information that allows:
- Forward kinematics to process joints in the correct order
- Path lookup from root to any node
- Depth information for tree operations

# `t`

```elixir
@type t() :: %BB.Robot.Topology{
  depth: %{required(atom()) =&gt; non_neg_integer()},
  joint_order: [atom()],
  link_order: [atom()],
  paths: %{required(atom()) =&gt; [atom()]}
}
```

# `depth_of`

```elixir
@spec depth_of(t(), atom()) :: non_neg_integer() | nil
```

Get the depth of a node in the tree.

The root link has depth 0. Each joint/link pair adds 1 to the depth.

# `leaf_links`

```elixir
@spec leaf_links(t(), BB.Robot.t()) :: [atom()]
```

Get all leaf links (links with no child joints).

# `max_depth`

```elixir
@spec max_depth(t()) :: non_neg_integer()
```

Get the maximum depth of the kinematic tree.

# `path_to`

```elixir
@spec path_to(t(), atom()) :: [atom()] | nil
```

Get the path from root to a node.

Returns a list of link/joint names from the root to the given node.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
