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

View Source

Command an actuator to actively maintain its current position.

Unlike Stop, the actuator will actively resist external forces to stay at its current position. This consumes power but provides rigidity.

Fields

  • command_id - Optional reference for correlating with feedback messages

Examples

alias BB.Message
alias BB.Message.Actuator.Command.Hold

{:ok, msg} = Message.new(Hold, :shoulder, [])

# With correlation ID
{:ok, msg} = Message.new(Hold, :shoulder,
  command_id: make_ref()
)

Notes

Not all actuators distinguish between stop and hold. RC servos, for example, always hold their position when given a command. This command is most relevant for motors with encoders or steppers where passive vs active holding differs.

Summary

Types

t()

@type t() :: %BB.Message.Actuator.Command.Hold{command_id: reference() | nil}

Functions

new(frame_id, attrs)

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