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 Celsiusvoltage- Input voltage in Voltsload- 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
@type t() :: %BB.Servo.Feetech.Message.ServoStatus{ hardware_error: non_neg_integer() | nil, load: number(), servo_id: pos_integer(), temperature: number(), voltage: number() }
Functions
@spec new( atom(), keyword() ) :: {:ok, BB.Message.t()} | {:error, term()}