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 commandcommand_type- Optional type of command that initiated this motionacceleration- Optional acceleration magnitude (rad/s² or m/s²) used when the motion follows a trapezoidal/triangular velocity profile.nilindicates a rectangular profile and is the legacy behaviour.peak_velocity- Optional peak velocity magnitude (rad/s or m/s) achieved during the motion. Paired withaccelerationto fully describe a trapezoidal or triangular profile.nilfalls back to easing-based interpolation.
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
@type command_type() :: :position | :velocity | :effort | :trajectory
Functions
@spec new( atom(), keyword() ) :: {:ok, BB.Message.t()} | {:error, term()}