BB.Message.Actuator.Command.Velocity (bb v0.15.0)
View SourceCommand to set an actuator's velocity.
The actuator will move at the specified velocity until stopped, a new command is received, or the optional duration expires.
Fields
velocity- Target velocity (rad/s for revolute, m/s for prismatic)duration- Optional duration (milliseconds), nil = until stoppedcommand_id- Optional reference for correlating with feedback messages
Examples
alias BB.Message
alias BB.Message.Actuator.Command.Velocity
# Continuous velocity
{:ok, msg} = Message.new(Velocity, :wheel,
velocity: 1.0
)
# Velocity for fixed duration
{:ok, msg} = Message.new(Velocity, :wheel,
velocity: 1.0,
duration: 500
)
Summary
Types
@type t() :: %BB.Message.Actuator.Command.Velocity{ command_id: reference() | nil, duration: pos_integer() | nil, velocity: float() }
Functions
@spec new( atom(), keyword() ) :: {:ok, BB.Message.t()} | {:error, term()}