Welcome to PprzLink’s documentation!¶
Contents:
Python Messages¶
Paparazzi message representation
-
class
pprzlink.message.
PprzMessage
(class_name, msg)[source]¶ base Paparazzi message class
-
fieldcoefs
¶ Get list of field coefs.
-
fieldnames
¶ Get list of field names.
-
fieldtypes
¶ Get list of field types.
-
fieldvalues
¶ Get list of field values.
-
msg_class
¶ Get the message class.
-
msg_id
¶ Get the message id.
-
name
¶ Get the message name.
-
Transport¶
Paparazzi transport encoding utilities
Ivy Interface¶
-
class
pprzlink.ivy.
IvyMessagesInterface
(agent_name=None, start_ivy=True, verbose=False, ivy_bus='')[source]¶ -
bind_raw
(callback, regex='(.*)')[source]¶ Bind callback to Ivy messages matching regex (without any extra parsing)
Parameters: - callback – function called on new message with agent, message, from as params
- regex – regular expression for matching message
-
static
parse_pprz_msg
(callback, ivy_msg)[source]¶ Parse an Ivy message into a PprzMessage. Basically parts/args in string are separated by space, but char array can also contain a space:
|f,o,o, ,b,a,r|
in old format or"foo bar"
in new formatParameters: - callback – function to call with ac_id and parsed PprzMessage as params
- ivy_msg – Ivy message string to parse into PprzMessage
-
send
(msg, ac_id=None)[source]¶ Send a message
Parameters: - msg – PprzMessage or simple string
- ac_id – Needed if sending a PprzMessage of telemetry msg_class
Returns: Number of clients the message sent to, None if msg was invalid
-
send_raw_datalink
(msg)[source]¶ Send a PprzMessage of datalink msg_class embedded in RAW_DATALINK message
Parameters: msg – PprzMessage Returns: Number of clients the message sent to, None if msg was invalid
-
subscribe
(callback, regex='(.*)')[source]¶ Subscribe to Ivy message matching regex and call callback with ac_id and PprzMessage TODO: possibility to directly specify PprzMessage instead of regex
Parameters: - callback – function called on new message with ac_id and PprzMessage as params
- regex – regular expression for matching message
-
PprzLink is a message toolkit (message definition, code generators, libraries) to be used with Paparazzi UAV and compatible systems.