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

An optimised link representation with all units converted to SI floats.

Links are connected to their parent via `parent_joint` (nil for the root link)
and to children via `child_joints` (list of joint names).

# `collision`

```elixir
@type collision() :: %{
  name: atom() | nil,
  origin: {position(), orientation()} | nil,
  geometry: geometry() | nil
}
```

Collision geometry information

# `color`

```elixir
@type color() :: %{red: float(), green: float(), blue: float(), alpha: float()}
```

RGBA color (values 0-1)

# `geometry`

```elixir
@type geometry() ::
  {:box, %{x: float(), y: float(), z: float()}}
  | {:cylinder, %{radius: float(), height: float()}}
  | {:sphere, %{radius: float()}}
  | {:capsule, %{radius: float(), length: float()}}
  | {:mesh, %{filename: String.t(), scale: float()}}
```

Geometry specification

# `inertia`

```elixir
@type inertia() :: %{
  ixx: float(),
  iyy: float(),
  izz: float(),
  ixy: float(),
  ixz: float(),
  iyz: float()
}
```

Inertia tensor components in kg·m²

# `material`

```elixir
@type material() :: %{name: atom(), color: color() | nil, texture: String.t() | nil}
```

Material specification

# `orientation`

```elixir
@type orientation() :: {float(), float(), float()}
```

Orientation as {roll, pitch, yaw} in radians

# `position`

```elixir
@type position() :: {float(), float(), float()}
```

Position as {x, y, z} in meters

# `t`

```elixir
@type t() :: %BB.Robot.Link{
  center_of_mass: position() | nil,
  child_joints: [atom()],
  collisions: [collision()],
  inertia: inertia() | nil,
  mass: float() | nil,
  name: atom(),
  parent_joint: atom() | nil,
  sensors: [atom()],
  visual: visual() | nil
}
```

# `visual`

```elixir
@type visual() :: %{
  origin: {position(), orientation()} | nil,
  geometry: geometry() | nil,
  material: material() | nil
}
```

Visual geometry information

---

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