Horizon Payload Superclass. More...
Public Member Functions | |
def | __init__ |
Create A Horizon Message Payload. | |
def | __str__ |
Hex String Representation. | |
def | copy |
Copy Instance. | |
def | print_format |
Human Readable Payload String. | |
def | raw_string |
Raw Bytes Payload Representation. | |
Public Attributes | |
data | |
timestamp |
Represents the basic payload of a Horizon message.
To be inherited for specific message payloads.
Horizon Protocol Message Payload
Definition at line 194 of file payloads.py.
def clearpath.horizon.payloads.Payload.__init__ | ( | self, | |
raw = [] , |
|||
timestamp = 0 |
|||
) |
Create A Horizon Message Payload.
Constructor for the Horizon Payload class.
Creates a basic message payload which is simply a byte list.
Subclass overrides should throw ValueError if invalid format and LookupError if it has version detection problems (if supported).
raw | Raw data buffer to parse |
timestamp | Payload Send / Create Time (milliseconds) |
LookupError | If auto-detect version fails |
ValueError | If values are out of range or if raw is invalid |
Create A Horizon Message Payload
Reimplemented in clearpath.horizon.payloads.RawMagnetometer, clearpath.horizon.payloads.RawAccelerometer, clearpath.horizon.payloads.RawOrientationSensor, clearpath.horizon.payloads.RawTemperatureSensor, clearpath.horizon.payloads.RawVoltageSensor, clearpath.horizon.payloads.RawCurrentSensor, clearpath.horizon.payloads.RawSensor, clearpath.horizon.payloads.Reset, clearpath.horizon.payloads.ProcessorStatus, clearpath.horizon.payloads.Echo, and clearpath.horizon.payloads.Null.
Definition at line 211 of file payloads.py.
def clearpath.horizon.payloads.Payload.__str__ | ( | self | ) |
Hex String Representation.
Return the entire payload in a string of hex characters.
Return the entire payload in a string of hex characters.
Definition at line 231 of file payloads.py.
def clearpath.horizon.payloads.Payload.copy | ( | self | ) |
Copy Instance.
Copy Instance
Definition at line 241 of file payloads.py.
def clearpath.horizon.payloads.Payload.print_format | ( | self | ) |
Human Readable Payload String.
Return the payload as a human readable string
Reimplemented in clearpath.horizon.payloads.ConfigRequest, clearpath.horizon.payloads.Config, clearpath.horizon.payloads.PlatformKinematics, clearpath.horizon.payloads.BatteryEstimationConfig, clearpath.horizon.payloads.ControlFlags, clearpath.horizon.payloads.StoreSystemConfig, clearpath.horizon.payloads.RestoreSystemConfig, clearpath.horizon.payloads.RawMagnetometer, clearpath.horizon.payloads.RawAccelerometer, clearpath.horizon.payloads.RawOrientationSensor, clearpath.horizon.payloads.RawTemperatureSensor, clearpath.horizon.payloads.RawVoltageSensor, clearpath.horizon.payloads.RawCurrentSensor, clearpath.horizon.payloads.EncodersConfig, clearpath.horizon.payloads.AccelerometerConfig, clearpath.horizon.payloads.OrientationSensorConfig, clearpath.horizon.payloads.TemperatureSensorConfig, clearpath.horizon.payloads.VoltageSensorConfig, clearpath.horizon.payloads.CurrentSensorConfig, clearpath.horizon.payloads.Reset, clearpath.horizon.payloads.RawEncoders, clearpath.horizon.payloads.Encoders, clearpath.horizon.payloads.Magnetometer, clearpath.horizon.payloads.Acceleration, clearpath.horizon.payloads.Rotation, clearpath.horizon.payloads.Orientation, clearpath.horizon.payloads.DistanceTiming, clearpath.horizon.payloads.Distance, clearpath.horizon.payloads.GearStatus, clearpath.horizon.payloads.Gear, clearpath.horizon.payloads.MaxAccel, clearpath.horizon.payloads.MaxSpeed, clearpath.horizon.payloads.Turn, clearpath.horizon.payloads.Velocity, clearpath.horizon.payloads.AckermannOutput, clearpath.horizon.payloads.DifferentialOutput, clearpath.horizon.payloads.DifferentialControl, clearpath.horizon.payloads.DifferentialSpeed, clearpath.horizon.payloads.SafetyStatus, clearpath.horizon.payloads.ProcessorStatus, clearpath.horizon.payloads.PowerStatus, clearpath.horizon.payloads.SystemStatus, clearpath.horizon.payloads.FirmwareInfo, clearpath.horizon.payloads.PlatformTime, clearpath.horizon.payloads.PlatformName, clearpath.horizon.payloads.PlatformInfo, clearpath.horizon.payloads.Echo, clearpath.horizon.payloads.Subscribe, clearpath.horizon.payloads.Ack, and clearpath.horizon.payloads.Null.
Definition at line 259 of file payloads.py.
def clearpath.horizon.payloads.Payload.raw_string | ( | self | ) |
Raw Bytes Payload Representation.
Convert the payload into raw bytes (character string for Python 2.x) useful for writing to devices.
Returns the data converted into raw bytes.
Definition at line 273 of file payloads.py.
Definition at line 211 of file payloads.py.
Definition at line 211 of file payloads.py.