BB.Message.Geometry.Point3D (bb v0.15.0)
View SourceA 3D point in space.
Wraps a BB.Math.Vec3 for use as a message payload.
Fields
vec- The point asBB.Math.Vec3.t()in metres
Examples
alias BB.Message.Geometry.Point3D
alias BB.Math.Vec3
{:ok, msg} = Point3D.new(:base_link, Vec3.new(0.3, 0.2, 0.1))
# Access coordinates
point = msg.payload
Point3D.x(point) # => 0.3
Point3D.to_vec3(point) # => %Vec3{}
Summary
Functions
Create a new Point3D message from a Vec3.
Get the underlying Vec3.
Get the X coordinate.
Get the Y coordinate.
Get the Z coordinate.
Types
@type t() :: %BB.Message.Geometry.Point3D{vec: BB.Math.Vec3.t()}
Functions
@spec new( atom(), keyword() ) :: {:ok, BB.Message.t()} | {:error, term()}
@spec new(atom(), BB.Math.Vec3.t()) :: {:ok, BB.Message.t()} | {:error, term()}
Create a new Point3D message from a Vec3.
Examples
alias BB.Math.Vec3
{:ok, msg} = Point3D.new(:base_link, Vec3.new(0.3, 0.2, 0.1))
@spec to_vec3(t()) :: BB.Math.Vec3.t()
Get the underlying Vec3.
Get the X coordinate.
Get the Y coordinate.
Get the Z coordinate.