class documentation

class tagCPCmd: (source)

Constructor: tagCPCmd.unpack(data)

View In Hierarchy

Represents a CP command.

Class Method unpack Unpacks a bytes sequence into a tagCPCmd object.
Method pack Packs the tagCPCmd object into a bytes sequence.
Class Variable cpMode Undocumented
Class Variable velocity_or_power Undocumented
Class Variable x Undocumented
Class Variable y Undocumented
Class Variable z Undocumented
def unpack(cls, data: bytes) -> tagCPCmd: (source)

Unpacks a bytes sequence into a tagCPCmd object.

Parameters
data:bytesThe bytes to unpack, expected to be 33 bytes (1 uint8 + 4 doubles).
Returns
tagCPCmdA tagCPCmd object.
Raises
struct.errorIf the input bytes are not the expected size (33 bytes).
ValueErrorIf the unpacked byte value for cpMode does not correspond to a valid CPMode enum member.
def pack(self) -> bytes: (source)

Packs the tagCPCmd object into a bytes sequence.

Packs the cpMode (CPMode value as uint8) and the x, y, z, velocity_or_power (floats) into a byte string. Uses little-endian byte order.

Returns
bytesA bytes object representing the packed data (1 byte + 4 * 8 bytes = 33 bytes).

Undocumented

velocity_or_power: float = (source)

Undocumented

Undocumented

Undocumented

Undocumented