Difference between revisions of "Pprzlink"

From PaparazziUAV
Jump to navigation Jump to search
(Created page with "'''PPRZLINK''' is the communication library used by the Paparazzi UAV project and other related projects. It provides: * Bulleted list item * a set of messages definitions *...")
 
Line 8: Line 8:
* several language support (Ocaml, C, Python)
* several language support (Ocaml, C, Python)


Source code can be download from Bithub: https://github.com/paparazzi/pprzlink
Source code can be download from Github: https://github.com/paparazzi/pprzlink


The creation of PPRZLINK as a separated project from the main Paparazzi source code is the result of the [[Roadmap#Communication_Roadmap|communication roadmap]]. At the moment it is released under GPL v2, but it may be changed to LGPL in order to ease integration into third-party projects.
The creation of PPRZLINK as a separated project from the main Paparazzi source code is the result of the [[Roadmap#Communication_Roadmap|communication roadmap]]. At the moment it is released under GPL v2, but it may be changed to LGPL in order to ease integration into third-party projects.
Line 18: Line 18:
* [https://github.com/enacuavlab/pprzros PPRZROS]: bridge for the ROS middleware
* [https://github.com/enacuavlab/pprzros PPRZROS]: bridge for the ROS middleware


== Messages' definition ==


TBD


== Protocols ==
= Messages' definition =


TBD
The messages are organized three main classes:
* ''telemetry'': messages sent by the aircraft, usually to the ground, a.k.a. downlink stream
* ''datalink'': messages sent by the ground to the aircraft, a.k.a. uplink
* ''ground'': messages exchanged between ground agents over the [[Ivy]] software bus
[[File:Pprz communication agents.gif]]


== Interfaces ==
The generated documentation is available here: http://docs.paparazziuav.org/latest/paparazzi_messages.html


TBD
New messages can be integrated mainstream in the [https://github.com/paparazzi/pprzlink/blob/master/message_definitions/v1.0/messages.xml messages xml file] from PPRZLINK. When using with Paparazzi, it is also possible to use an temporary file placed in the ''conf'' folder. If not present, the default set is used.
 
= Protocols =
 
== Principles ==
PPRZLINK is based on encapsulation. The first layer is the message level, mostly containing the data and the required information to decode them. The structure of this part is always the same. The second layer called ''transport'' can be changed according to the actual physical layer being used. The basic type (''pprz'') is just providing synchronization byte and checksum, but other transports offer more possibility of routing like the ''XBee' transport (especially the possibility to use point-to-point or broadcast).
 
The message formats are described [[Messages_Format|here]]. A ''secured'' version is currently under development.
 
== Differences between version 1 and 2 ==
 
A new version (v2) have been developed to overcome several limitations. With version 1, only the message ID (1 byte) and the sender ID (1 byte) are provided in the message layer before the data part. It means that:
* messages can't be addressed to a particular receiver unless the transport layer can provide the service
* it is not possible to determine the class of messages, so it is assumed that telemetry messages are strictly downlink and datalink messages strictly uplink, thus preventing direct air-to-air communications
 
With the version two of the protocol, two extra bytes have been added to the message header:
* the receiver ID (1 byte)
* a class ID (4 bits)
* a component ID (4 bits)
The class and component are part of the same byte. Even if the component ID is not really used at the moment (provision for future use), the class ID avoid ambiguities on messages. With the receiver ID, it is now possible to perform air-to-air communications and to broadcast messages from an aircraft (previously only possible from the ground).
 
See [[Messages_Format|messages format]] page for more details.
 
= Interfaces =
 
Currently, the available interfaces are:
* serial stream
* udp packet
* [[Ivy]] based messages (publisher/subscriber middelware over TCP/IP, should only be used on the ground side)
 
In addition a bridge to the [http://www.ros.org ROS] middleware is available at https://github.com/enacuavlab/pprzros


== Language supports ==
== Language supports ==


TBD
The supported languages are:
* C language
** generation of code (header files) for sending and decoding messages
** mostly used for the airborne code of Paparazzi
* Ocaml
** library based high-level functions for binding, subscribing and parsing messages
** mostly used by the ground station agents: links, GCS, server, ...
* Python
** Provide similar functionality than the Ocaml implemetation
** used in a large variety of smaller tools and ground agents

Revision as of 18:02, 23 November 2017

PPRZLINK is the communication library used by the Paparazzi UAV project and other related projects.

It provides:

  • Bulleted list item
  • a set of messages definitions
  • various encapsulation protocols
  • several high-level access to physical layers (serial, udp, Ivy)
  • several language support (Ocaml, C, Python)

Source code can be download from Github: https://github.com/paparazzi/pprzlink

The creation of PPRZLINK as a separated project from the main Paparazzi source code is the result of the communication roadmap. At the moment it is released under GPL v2, but it may be changed to LGPL in order to ease integration into third-party projects.

A (not very complete) documentation is also available on the readthedocs platform.

Some useful related project:


Messages' definition

The messages are organized three main classes:

  • telemetry: messages sent by the aircraft, usually to the ground, a.k.a. downlink stream
  • datalink: messages sent by the ground to the aircraft, a.k.a. uplink
  • ground: messages exchanged between ground agents over the Ivy software bus

Pprz communication agents.gif

The generated documentation is available here: http://docs.paparazziuav.org/latest/paparazzi_messages.html

New messages can be integrated mainstream in the messages xml file from PPRZLINK. When using with Paparazzi, it is also possible to use an temporary file placed in the conf folder. If not present, the default set is used.

Protocols

Principles

PPRZLINK is based on encapsulation. The first layer is the message level, mostly containing the data and the required information to decode them. The structure of this part is always the same. The second layer called transport can be changed according to the actual physical layer being used. The basic type (pprz) is just providing synchronization byte and checksum, but other transports offer more possibility of routing like the XBee' transport (especially the possibility to use point-to-point or broadcast).

The message formats are described here. A secured version is currently under development.

Differences between version 1 and 2

A new version (v2) have been developed to overcome several limitations. With version 1, only the message ID (1 byte) and the sender ID (1 byte) are provided in the message layer before the data part. It means that:

  • messages can't be addressed to a particular receiver unless the transport layer can provide the service
  • it is not possible to determine the class of messages, so it is assumed that telemetry messages are strictly downlink and datalink messages strictly uplink, thus preventing direct air-to-air communications

With the version two of the protocol, two extra bytes have been added to the message header:

  • the receiver ID (1 byte)
  • a class ID (4 bits)
  • a component ID (4 bits)

The class and component are part of the same byte. Even if the component ID is not really used at the moment (provision for future use), the class ID avoid ambiguities on messages. With the receiver ID, it is now possible to perform air-to-air communications and to broadcast messages from an aircraft (previously only possible from the ground).

See messages format page for more details.

Interfaces

Currently, the available interfaces are:

  • serial stream
  • udp packet
  • Ivy based messages (publisher/subscriber middelware over TCP/IP, should only be used on the ground side)

In addition a bridge to the ROS middleware is available at https://github.com/enacuavlab/pprzros

Language supports

The supported languages are:

  • C language
    • generation of code (header files) for sending and decoding messages
    • mostly used for the airborne code of Paparazzi
  • Ocaml
    • library based high-level functions for binding, subscribing and parsing messages
    • mostly used by the ground station agents: links, GCS, server, ...
  • Python
    • Provide similar functionality than the Ocaml implemetation
    • used in a large variety of smaller tools and ground agents