# `BB.Estimator.Wiring`
[🔗](https://github.com/beam-bots/bb/blob/main/lib/bb/estimator/wiring.ex#L5)

Builds the supervisor `child_spec` for an `estimator` DSL entity.

Used by `BB.LinkSupervisor` for link-nested estimators and by
`BB.Sensor.Server` for sensor-nested estimators. Centralises:

- Output-path resolution (auto-derived `:out` plus explicit `output`
  overrides).
- Input-spec resolution (sensor-nested: synthesised single implicit
  input pointing at the parent sensor's path; link-nested: passed
  through from the entity's declared `input` blocks).
- `sync_tolerance` unit conversion to nanoseconds.
- Construction of the `BB.Estimator.Context` delivered to the user
  module's `init/1`.
- Construction of the `BB.Process.via/2` registration tuple so each
  estimator is addressable in the robot's registry.

# `parent_path`

```elixir
@type parent_path() :: [atom()]
```

Path components leading to the parent supervisor (link path).

# `parent_sensor_path`

```elixir
@type parent_sensor_path() :: [atom()]
```

Path identifying the parent publisher (sensor path) for sensor-nested estimators.

# `link_nested_child_spec`

```elixir
@spec link_nested_child_spec(
  module(),
  BB.Dsl.Estimator.t(),
  parent_path(),
  Keyword.t()
) :: map()
```

Builds a child spec for a link-nested estimator. `link_path` is the
sequence of link names leading to the parent link (e.g.
`[:base_link, :arm]`).

# `sensor_nested_child_spec`

```elixir
@spec sensor_nested_child_spec(
  module(),
  BB.Dsl.Estimator.t(),
  parent_sensor_path(),
  atom(),
  Keyword.t()
) :: map()
```

Builds a child spec for a sensor-nested estimator. `parent_sensor_path`
is the parent sensor's full publish path including the leading
`:sensor` atom (e.g. `[:sensor, :base_link, :imu]`).

---

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