BB.Message.Actuator.BeginMotion (bb v0.15.0)

View Source

Message published by actuators when beginning a motion.

Used by BB.Sensor.OpenLoopPositionEstimator to estimate current position during open-loop control (actuators without position feedback).

Fields

  • initial_position - Position before motion begins (radians or metres)
  • target_position - Target position (radians or metres)
  • expected_arrival - When motion should complete (monotonic milliseconds)
  • command_id - Optional correlation ID from the originating command
  • command_type - Optional type of command that initiated this motion

Example

alias BB.Message
alias BB.Message.Actuator.BeginMotion

expected_arrival = System.monotonic_time(:millisecond) + 500

{:ok, msg} = Message.new(BeginMotion, :shoulder,
  initial_position: 0.0,
  target_position: 1.57,
  expected_arrival: expected_arrival
)

Summary

Types

command_type()

@type command_type() :: :position | :velocity | :effort | :trajectory

t()

@type t() :: %BB.Message.Actuator.BeginMotion{
  command_id: reference() | nil,
  command_type: command_type() | nil,
  expected_arrival: integer(),
  initial_position: float(),
  target_position: float()
}

Functions

new(frame_id, attrs)

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