BB.Message.Actuator.Command.Position (bb v0.15.0)

View Source

Command to move an actuator to a target position.

Fields

  • position - Target position (radians for revolute, metres for prismatic)
  • velocity - Optional velocity hint (rad/s or m/s)
  • duration - Optional duration hint (milliseconds)
  • command_id - Optional reference for correlating with feedback messages

Examples

alias BB.Message
alias BB.Message.Actuator.Command.Position

# Simple position command
{:ok, msg} = Message.new(Position, :shoulder,
  position: 1.57
)

# With velocity hint
{:ok, msg} = Message.new(Position, :shoulder,
  position: 1.57,
  velocity: 0.5
)

# With correlation ID for tracking
{:ok, msg} = Message.new(Position, :shoulder,
  position: 1.57,
  command_id: make_ref()
)

Summary

Types

t()

@type t() :: %BB.Message.Actuator.Command.Position{
  command_id: reference() | nil,
  duration: pos_integer() | nil,
  position: float(),
  velocity: float() | nil
}

Functions

new(frame_id, attrs)

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