BB.Servo.Feetech.Message.ServoStatus (bb_servo_feetech v0.2.3)

Copy Markdown View Source

Status information for a Feetech servo.

Published periodically by the controller when status polling is enabled. Subscribe to [:sensor, :controller_name, :servo_status] to receive updates.

Fields

  • servo_id - The servo ID (1-253)
  • temperature - Internal temperature in Celsius
  • voltage - Input voltage in Volts
  • load - Present load as a percentage (-100 to 100)
  • hardware_error - Hardware error flags (nil if no errors)

Hardware Error Flags

The hardware_error field contains bit flags indicating error conditions:

  • Bit 0: Voltage error
  • Bit 1: Sensor error (magnetic encoder)
  • Bit 2: Temperature error
  • Bit 3: Current error
  • Bit 5: Overload error

Note: Bit 4 indicates torque state, not an error.

Examples

alias BB.Servo.Feetech.Message.ServoStatus

{:ok, msg} = ServoStatus.new(:feetech,
  servo_id: 1,
  temperature: 45.0,
  voltage: 7.2,
  load: 25.0,
  hardware_error: nil
)

Summary

Types

t()

@type t() :: %BB.Servo.Feetech.Message.ServoStatus{
  hardware_error: non_neg_integer() | nil,
  load: number(),
  servo_id: pos_integer(),
  temperature: number(),
  voltage: number()
}

Functions

new(frame_id, attrs)

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