Search documentation of bb

# BB.Message.Geometry.Transform (bb v0.8.0)

View Source

A transformation in 3D space (translation and rotation).

Represents the relationship between two coordinate frames.

## Fields

- `translation` - Translation as `{:vec3, x, y, z}` in metres
- `rotation` - Rotation as `{:quaternion, x, y, z, w}`

## Examples

    alias BB.Message.Geometry.Transform
    alias BB.Message.{Vec3, Quaternion}

    {:ok, msg} = Transform.new(:base_link, Vec3.new(0.0, 0.0, 1.0), Quaternion.identity())

# Summary

## Types

t()

## Functions

new(frame_id, attrs)
new(frame_id, translation, rotation)

Create a new Transform message.

# Types

# t()

    @type t() :: %BB.Message.Geometry.Transform{
      rotation: BB.Message.Quaternion.t(),
      translation: BB.Message.Vec3.t()
    }

# Functions

# new(frame_id, attrs)

    @spec new(
      atom(),
      keyword()
    ) :: {:ok, BB.Message.t()} | {:error, term()}

# new(frame_id, translation, rotation)

    @spec new(atom(), BB.Message.Vec3.t(), BB.Message.Quaternion.t()) ::
      {:ok, BB.Message.t()} | {:error, term()}

Create a new Transform message.

Returns `{:ok, %BB.Message{}}` with the transform as payload.

## Examples

    alias BB.Message.{Vec3, Quaternion}

    {:ok, msg} = Transform.new(:base_link, Vec3.new(0.0, 0.0, 1.0), Quaternion.identity())