Difference between revisions of "RT Paparazzi"

From PaparazziUAV
Jump to navigation Jump to search
Line 1: Line 1:
== Real Time (RT) Paparazzi with ChibiOS/RT ==
= Real Time (RT) Paparazzi =
the '''RT Paparazzi''' initiative is a step towards extended flexibility for the core autopilot. In a real time operating system (RTOS) [http://en.wikipedia.org/wiki/Real-time_operating_system] are multiple threads, which are doing specific jobs (e.g. a telemetry thread, a radio thread, a failsafe thread) at a defined rate. Unlike ''bare-metal'' application which uses interrupt driven timers for timing tasks, real time OS has a kernel which takes care of scheduling and running the threads. Having kernel, it is possible to set priority of each thread, how much memory it takes etc. which gives the developer more control over timing and resource managment.
 
 
== Introduction ==
the '''RT Paparazzi''' initiative is a step towards extended flexibility for the core autopilot. In a real time operating system (RTOS) [http://en.wikipedia.org/wiki/Real-time_operating_system] multiple threads are available, which are doing specific jobs e.g. a telemetry thread, a radio thread, a failsafe thread, at a defined rate. Unlike ''bare-metal'' application which uses interrupt driven timers for timing tasks, real time OS has a kernel which takes care of scheduling and running the threads. Having a kernel, it is possible to set priority of each thread, how much memory it takes etc.etc. which gives the developer more control over timing and resource managment.


Besides kernel, a typical RTOS also has a harware abstraction layer (HAL) which stands between user application and actual hardware, so the application developer doesn't have to worry about drivers.
Besides kernel, a typical RTOS also has a harware abstraction layer (HAL) which stands between user application and actual hardware, so the application developer doesn't have to worry about drivers.


There is a couple of RT based autopilots already, for example a very good Pixhawk autopilot [https://pixhawk.ethz.ch/px4/en/start] or trunetcopter [https://github.com/trunetcopter/trunetcopter].  
Main strength of Paparazzi is it's modularity - combining this with precise timing, scheduling and resource management that brings RTOS, Paparazzi can now exceed even the leading commecial closed UAV autopilots.


Main strength of Paparazzi is its modularity - combining that with precise timing, scheduling and resource management that brings RTOS, Paparazzi can match if not exceed leading uav autopilots (potentially not only open-source), for example the aforementioned Pixhawk.
== Paparazzi with ChibiOS/RT ==


== ChibiOS/RT ==
RT Paparazzi is based on ChibiOS/RT [http://chibios.org/dokuwiki/doku.php]. ChibiOS/RT supports basically all architectures that standard Paparazzi does (see [http://chibios.org/dokuwiki/doku.php?id=chibios:architectures]), which makes both systems compatible. Since RTOS makes handling multiple I/O easier, but comes with some extra overhead (context switching, kernel code), it gives most leverage to to STM32 F1xx and F4xx based autopilots ([[Lisa/M_v20]], [[Lisa/S]], [[STM32F4_Discovery]], [[KroozSD]]...).
RT Paparazzi is based on ChibiOS/RT [http://chibios.org/dokuwiki/doku.php]. ChibiOS/RT supports basically all architectures that standard Paparazzi does (see [http://chibios.org/dokuwiki/doku.php?id=chibios:architectures]), which makes both systems compatible. Since RTOS makes handling multiple I/O easier, but comes with some extra overhead (context switching, kernel code), it gives most leverage to to STM32 F1xx and F4xx based autopilots ([[Lisa/M_v20]], [[Lisa/S]], [[STM32F4_Discovery]], [[KroozSD]]...).


RT Paparazzi is mainly developed by AggieAir team [http://aggieair.usu.edu/] at Utah State University. A different flavor of RT paparazzi (without ChibiOS/RT HAL) is developed by [[ENAC_UAV_Laboratory]].
The development of RT Paparazzi with ChibeOS was started by the AggieAir team [http://aggieair.usu.edu/] at Utah State University.


== Getting the code ==
=== Getting the sourcecode ===
Most recent code is available under ''rt_paparazzi'' branch from Paparazzi Git repo [https://github.com/paparazzi/paparazzi], however you can check these two repositories too ([https://github.com/podhrmic/ChibiOS-RT] and [https://github.com/podhrmic/paparazzi])
Most recent code is available under ''rt_paparazzi'' branch from Paparazzi Git repo [https://github.com/paparazzi/paparazzi], however you can check these two repositories too ([https://github.com/podhrmic/ChibiOS-RT] and [https://github.com/podhrmic/paparazzi])




== Debugging with an Eclipse IDE ==
=== Debugging with an Eclipse IDE ===
Having a good development and debugging environment is a must for developing RT embedded system. The steps of setting up Eclipse IDE are described here [http://chibios.org/dokuwiki/doku.php?id=chibios:guides:eclipse1] and here [http://chibios.org/dokuwiki/doku.php?id=chibios:guides:eclipse2].
Having a good development and debugging environment is a must for developing RT embedded system. The steps of setting up Eclipse IDE are described here [http://chibios.org/dokuwiki/doku.php?id=chibios:guides:eclipse1] and here [http://chibios.org/dokuwiki/doku.php?id=chibios:guides:eclipse2].


Line 42: Line 44:
  org.chibios.tools.eclipse.debug_1.0.8.jar
  org.chibios.tools.eclipse.debug_1.0.8.jar
to your ''eclipse/plugins'' directory. Restart Eclipse and in "Help->About Eclipe->Installation Details->Plugins" you should see both chibios plugins. Enable the plug-in while in the "Debug" view under: Window->Show View->Other...->ChibiOS/RT->ChibiOS/RT" (see [http://forum.chibios.org/phpbb/viewtopic.php?f=3&t=140] for details)
to your ''eclipse/plugins'' directory. Restart Eclipse and in "Help->About Eclipe->Installation Details->Plugins" you should see both chibios plugins. Enable the plug-in while in the "Debug" view under: Window->Show View->Other...->ChibiOS/RT->ChibiOS/RT" (see [http://forum.chibios.org/phpbb/viewtopic.php?f=3&t=140] for details)
== Paparazzi on Linux ==
Taking the ARDrone 2 base install is a good example how Paparazzi could be used to run the core Autopilot executable

Revision as of 08:37, 13 January 2014

Real Time (RT) Paparazzi

Introduction

the RT Paparazzi initiative is a step towards extended flexibility for the core autopilot. In a real time operating system (RTOS) [1] multiple threads are available, which are doing specific jobs e.g. a telemetry thread, a radio thread, a failsafe thread, at a defined rate. Unlike bare-metal application which uses interrupt driven timers for timing tasks, real time OS has a kernel which takes care of scheduling and running the threads. Having a kernel, it is possible to set priority of each thread, how much memory it takes etc.etc. which gives the developer more control over timing and resource managment.

Besides kernel, a typical RTOS also has a harware abstraction layer (HAL) which stands between user application and actual hardware, so the application developer doesn't have to worry about drivers.

Main strength of Paparazzi is it's modularity - combining this with precise timing, scheduling and resource management that brings RTOS, Paparazzi can now exceed even the leading commecial closed UAV autopilots.

Paparazzi with ChibiOS/RT

RT Paparazzi is based on ChibiOS/RT [2]. ChibiOS/RT supports basically all architectures that standard Paparazzi does (see [3]), which makes both systems compatible. Since RTOS makes handling multiple I/O easier, but comes with some extra overhead (context switching, kernel code), it gives most leverage to to STM32 F1xx and F4xx based autopilots (Lisa/M_v20, Lisa/S, STM32F4_Discovery, KroozSD...).

The development of RT Paparazzi with ChibeOS was started by the AggieAir team [4] at Utah State University.

Getting the sourcecode

Most recent code is available under rt_paparazzi branch from Paparazzi Git repo [5], however you can check these two repositories too ([6] and [7])


Debugging with an Eclipse IDE

Having a good development and debugging environment is a must for developing RT embedded system. The steps of setting up Eclipse IDE are described here [8] and here [9].

An alternative guide is for example here [10]

Just a few notes to the process:

  • install GCC Arm Embedded toolchain [11] (recommended anyway for Paparazzi since v 5.0)
  • get Black Magic probe from Blacksphere [12], it will make your life easier
  • in Creating a GDB Debug Configuration use the following commands for Black Magic Probe:
target extended-remote /dev/ttyACM0
monitor jtag_scan
attach 1
monitor vector_catch disable hard
set mem inaccessible-by-default off
monitor option erase
set print pretty

(for Lisa/Lia F4 board use swdp_scan instead of jtag_scan)

  • if you are using luftboot, don't forget to add image offset into the debug configuration:

Rt paparazzi eclipse setup 2.png

  • don't forget in "Eclipse->Window->Preferences->Run/Debug->Launching->Default Launchers->GDB Hardware Debugging" set preferred launcher to "Standard GDB" (otherwise the ChibiOS/RT plugin won't work, tested in Eclipse Kepler Service Release 1):

Rt paparazzi eclipse setup 1.png

  • to use ChibiOS/RT debug module for Eclipse, download ChibiStudio (it is for Windows only) from SourceForge [13], extract it and from ChibiStudio/eclipse/plugins copy
org.chibios.tools.eclipse.config_1.2.1.jar
org.chibios.tools.eclipse.debug_1.0.8.jar

to your eclipse/plugins directory. Restart Eclipse and in "Help->About Eclipe->Installation Details->Plugins" you should see both chibios plugins. Enable the plug-in while in the "Debug" view under: Window->Show View->Other...->ChibiOS/RT->ChibiOS/RT" (see [14] for details)

Paparazzi on Linux

Taking the ARDrone 2 base install is a good example how Paparazzi could be used to run the core Autopilot executable