BB.Message.Geometry.Wrench2D (bb v0.28.0)

Copy Markdown View Source

Force and torque within a plane.

The planar counterpart of BB.Message.Geometry.Wrench, and the effort of a :planar joint. fx/fy are in the plane spanned by the joint's axis normal, and tau is about that normal — the same basis BB.Math.Transform2D.to_transform/2 uses.

Using the 3D Wrench with the out-of-plane components zeroed would let a producer emit a physically impossible out-of-plane force that nothing would reject.

Fields

  • fx - In-plane force along the plane's first axis, in Newtons
  • fy - In-plane force along the plane's second axis, in Newtons
  • tau - Torque about the plane's normal, in Newton-metres

Examples

alias BB.Message.Geometry.Wrench2D

{:ok, msg} = Wrench2D.new(:chassis, 12.0, 0.0, 0.4)

Summary

Types

t()

@type t() :: %BB.Message.Geometry.Wrench2D{fx: float(), fy: float(), tau: float()}

Functions

new(frame_id, attrs)

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

new(frame_id, fx, fy, tau)

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

Create a new Wrench2D message.

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

Examples

{:ok, msg} = Wrench2D.new(:chassis, 12.0, 0.0, 0.4)