http://wiki.paparazziuav.org/w/api.php?action=feedcontributions&user=Kirkscheper&feedformat=atomPaparazziUAV - User contributions [en]2024-03-29T14:18:16ZUser contributionsMediaWiki 1.37.1http://wiki.paparazziuav.org/w/index.php?title=Installation&diff=24148Installation2019-01-14T10:39:08Z<p>Kirkscheper: Update one liner to reflect recent 5.14 release</p>
<hr />
<div><categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Installation</categorytree><br />
__TOC__<br />
<br />
== Introduction ==<br />
<br />
Paparazzi is very easily installed on any laptop or workstation running the [http://www.ubuntu.com/ Ubuntu Linux OS] or virtually any [http://www.debian.org/ Debian] based [http://en.wikipedia.org/wiki/Linux Linux] or Apple Macintosh running [http://en.wikipedia.org/wiki/OS_X Mac OS X]. There is also work being done to port Paparazzi to Windows.<br />
<br />
The steps required to install the software needed to be able to let your UAS fly are:<br />
<br />
# Install tools and prerequisites needed by Paparazzi.<br />
# Download the source code from the source repository.<br />
# Compile the Paparazzi software from sourcecode<br />
# Complete any final configuration<br />
<br />
== Quickstart for Ubuntu users ==<br />
Love one-liners? To get the latest Paparazzi up and running on your '''Ubuntu 12.04 or higher OS''', make sure you have a working internet connection and the '''universe''' packages activated in 'Software & Updates', then just copy and paste the text below into your terminal and press [enter] ... and wait a while...<br />
<br />
<nowiki><br />
sudo add-apt-repository -y ppa:paparazzi-uav/ppa && sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa && sudo apt-get update && sudo apt-get -f -y install paparazzi-dev paparazzi-jsbsim gcc-arm-embedded && cd ~ && git clone --origin upstream https://github.com/paparazzi/paparazzi.git && cd ~/paparazzi && git remote update -p && git checkout -b v5.14 upstream/v5.14 && sudo cp conf/system/udev/rules/*.rules /etc/udev/rules.d/ && sudo udevadm control --reload-rules && make && ./paparazzi<br />
</nowiki><br />
<br />
[[File:Done.jpg|frameless|center|Done!]]<br />
If all went well the Paparazzi Center should now be running... '''skip''' the rest of this page and go fly! <br />
<br />
If you are new you'll need to do some more things before you go fly like configuring your XML definition file detailing your airframe configuration. There is help here for that: [[Airframe_Configuration]]<br />
<br />
In case you have no autopilot hardware yet, no problem, you can get hardware [[Get_Hardware|here]] or just buy a ready to fly aircraft that can run Paparazzi Software like the Parrot Drones [http://www.parrot.com/products/bebop-drone/ Parrot Bebop] and run Paparazzi on your Parrot [[AR_Drone_2|ARDRone2]], [[Bebop|Bebop]] and Bebop2 (soon the Disco drone).<br />
<br />
== OS Specific Instructions ==<br />
<br />
For Linux an instructional video explaining it all in detail can be found here https://www.youtube.com/watch?v=eW0PCSjrP78<br />
<br />
The process of installing the prerequisite tools and dependencies needed by Paparazzi is specific to the operating system you are using. For detailed installation instructions, please see the following pages:<br />
*[[Installation/Linux|Installing prerequisites tools on Linux]]<br />
*[[Installation/MacOSX|Installing prerequisites tools on Mac OS X]]<br />
*[[Installation/RaspberryPi|Installing prerequisites tools on the RaspberryPi (Raspbian)]]<br />
<br />
For more advanced installation information or developers, please see the following pages:<br />
*[[Installation/FromScratch|Installing everything from scratch]] For non Debian based Linux distributions or if one just wants to be able to use all the latest and greatest compilers, or source code of everything to improve something. Then there is no other way than to install from scratch.<br />
*[[Installation/Windows|Installing prerequisite tools on Windows]] Note that this is '''a work in progress, and not finished yet'''. It would be fantastic if you are interested in running Paparazzi on this OS to help out with the porting. Being able to help is one of opensource software main features. If your skill- set is not so good in this area, but you still insist using Windows OS, then it is best to install a VirtualMachine from within Windows where you run the free Ubuntu OS of choice.<br />
<br />
=== Virtual Machines ===<br />
<br />
It is also possible to have your Debian/Ubuntu running in a virtual machine, for instance with [http://www.virtualbox.org/ VirtualBox]. This requires minimal changes to your computer setup, as you can run the VM from all common platforms (Windows, OS X, Linux). The virtual machine image can easily be transferred between different laptops, giving greater flexibility. Unfortunately, the Open-Source Edition of VirtualBox doesn't include the necessary USB support, so you'll need to get the regular version from the website.<br />
<br />
If you are new and this is your first time installing it is suggested you keep it simple. Use the standard Linux or OS X install. Select a system you can dedicate to the Linux installation. No VMs or dual boot configurations. The idea is do a very simple generic installation that is certain to have no issues. This reassures you that the installation process works and you can see and use a working Paparazzi install for some time before you try a more complicated install. The install is well documented and certain to succeed if followed exactly. Most issues arise when someone unfamiliar with Paparazzi or their OS tries a non-standard install that requires special steps that are not documented. Generally, commands can be copied and pasted for easy, step-by-step installation.<br />
<br />
== Getting the Source Code ==<br />
The Paparazzi source code is hosted on [https://github.com/paparazzi/paparazzi Github]. While you can download it as a tarball from https://github.com/paparazzi/paparazzi/releases, it is recommended to clone the repository with [[git]].<br />
<br />
From the directory of your choice type:<br />
git clone --origin upstream https://github.com/paparazzi/paparazzi.git<br />
Check out the released stable version branch:<br />
cd paparazzi<br />
git checkout v5.14<br />
<br />
'''If this whole "Git" thing is new to you, more options and information can be found on the [[git|Git page]].'''<br />
<br />
== Launching the Software ==<br />
Make sure you have installed the <tt>paparazzi-dev</tt> package as described above. Without these you will not be able to compile the sourcecode.<br />
The first step is to compile. From the <tt>paparazzi</tt> directory (<tt>cd ~/paparazzi</tt>), run<br />
<br />
make<br />
<br />
You will have to run this command after each update of the source (<tt>git pull</tt> command).<br />
Launch the software from the <tt>paparazzi</tt> directory with<br />
<br />
./paparazzi<br />
<br />
From the [[Paparazzi_Center|Paparazzi Center]] interface, select the ''Microjet'' aircraft, select the ''sim'' target and ''Build'' it. Then ''Execute'' the ''Simulation'' session. The procedure is detailed in the [[Simulation]] page.<br />
<br />
=== Environment Variables ===<br />
<br />
If ('''and only if''') you want to directly launch some Paparazzi agents (the ''Tools'' of the [[Paparazzi_Center|Paparazzi Center]]) from the command line, without using the Paparazzi Center, you must have the Paparazzi source and home environment variables set correctly in your shell. These variables can be automatically set in your shell by adding the following lines to your .bashrc file:<br />
{{Box Code|~/.bashrc|<br />
<source lang="bash"><br />
export PAPARAZZI_HOME=''your paparazzi software directory''<br />
export PAPARAZZI_SRC=''your paparazzi software directory''<br />
</source><br />
}}<br />
<br />
Verify that your variables are set correctly with the following command:<br />
:<source lang="bash">env | grep PAPARAZZI</source><br />
which should return the following:<br />
<source lang="bash"><br />
PAPARAZZI_HOME=''your paparazzi software directory''<br />
PAPARAZZI_SRC=''your paparazzi software directory''<br />
</source><br />
<br />
<br />
If you wish to manually set the env variables (i.e. when compiling a backup copy of your code in a different folder) execute the following command from the folder you wish to set as your active paparazzi folder:<br />
:<source lang="bash">export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`</source><br />
<br />
== Software Updates ==<br />
'''We manage the software with the git version control system. Learn it! If you are new to it, see the [[Git|Git wiki page]].'''<br />
<br />
Paparazzi is a very rapidly evolving project and as such you might want to update your software regularly. See the [[RepositoryStructure|branching model and release process page]].<br />
<br />
Any new files you created will not be lost/overwritten when updating (like your own airframe file). Nevertheless, as with all things, backups are advised.<br />
If you modified source code, the best way is of course to use the version control system [[Git]] to commit your changes. Otherwise at least use the brute force method and save everything in another directory.<br />
<br />
Update your software with care and caution, and always test the functionality on the ground and in the air as some updates will affect tuning parameters. You might need to update your airframe file as well. The compiler will usually complain if there is a problem, at which point you can look at the [[Airframe_Configuration|Airframe Configuration wiki page]] again, look on the [[Contact#Mailing_List|mailing list]] or some of the most recent airframe files on git to find the proper syntax.<br />
<br />
'''See also the [[Release Upgrades]] page for information on how to update your configuration from one release to the next.'''<br />
<br />
=== Quick'n dirty description ===<br />
<br />
To download and automatically merge any updated source files, run the following command from your Paparazzi directory<br />
git pull<br />
<br />
After any git update or source code modification the code can be recompiled from ''your paparazzi software directory'' with the following command:<br />
<br />
make<br />
<br />
The ''make'' command will only recompile portions of the software where changed have been detected.<br />
If it does not behave as expected you can delete all compiled files and recompile from scratch with the following commands:<br />
<br />
make clean<br />
make<br />
<br />
If you'd like to check that the code compiles all example airframes then you can run the test suite using the command<br />
<br />
make test<br />
<br />
For more details see the [[Builds/Tests|tests page]].<br />
<br />
== Using the Live CD ==<br />
<br />
There is a [[LiveCD]] available, but it dates back to 2008. It is still an easy way to get a first glimpse of Paparazzi however without installing anything.<br />
<br />
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]</div>Kirkscheperhttp://wiki.paparazziuav.org/w/index.php?title=Gazebo&diff=24144Gazebo2018-12-18T09:34:13Z<p>Kirkscheper: Updated instructions to reflect current working gazebo version</p>
<hr />
<div>=Gazebo=<br />
<br />
The nice sim framework Gazebo from here http://gazebosim.org/ can now be use from within Paparazzi. Are you doing work on UAS in combination with e.g. Vision based navigation check it out. I might make testing your new work so much simpler.<br />
<br />
Be warned, using it can be highly addictive, and might tempt you into buying a new computer with high specifications. To be able to use Gazebo a very good Video card is needed, consider upgrading you hardware if everything runs slowly.<br />
<br />
Note that from stable version 5.14 onwards, only version 8 and 9 of Gazebo work in Paparazzi on Ubuntu 16.04 or higher.<br />
<br />
Gazebo back-end for NPS [[NPS]] simulator<br />
<br />
{TODO: Animated GIF here}}<br />
<br />
=Why=<br />
<br />
What is the use of this all.<br />
<br />
Well... to be able to test your routines before you get cold, or to warm flying your aircraft for real outside and save some travelling time in the same run.<br />
Of course there should be a much better text here.. It's wiki, so please add it, and remove what you see fit.<br />
<br />
=Installation=<br />
<br />
We assume you already have Paparazzi installed via the One liner. If Not install Paparazzi first please. If that all worked, come back to this page.<br />
<br />
==Gazebo Installation===<br />
<br />
Steps to install Gazebo<br />
<br />
1. Make sure Gazebo is installed, for version 9 (compatible with Ubuntu 16.04 or 17.10 and higher)<br />
<br />
$ sudo apt-get install gazebo9 libgazebo9-dev<br />
<br />
for Ubuntu 16.04 or 16.10<br />
<br />
$ sudo apt-get install gazebo8 libgazebo8-dev<br />
<br />
If for some reason this doesn't work, you can find some additional instructions here: http://gazebosim.org/tutorials?cat=install&tut=install_ubuntu&ver=9.0<br />
<br />
===Model===<br />
<br />
Prepare your Gazebo aircraft model (example see conf/simulator/gazebo/models/ardrone/):<br />
<br />
Place the aircraft model in the conf/simulator/gazebo/models/ folder, this folder is added to the search path of Gazebo when NPS is launched.<br />
Gazebo uses a Front, Left, Up coordinate system for aircraft, so make sure the +x axis points forwards.<br />
The model should include a link for each motor with the same names as those listed in NPS_ACTUATOR_NAMES (see below), e.g. &apos;nw_motor&apos;. Camera links should have the name specified in .dev_name in the<br />
corresponding video_config_t struct, see '''sw/airborne/boards/pc_sim.h''' and '''sw/airborne/modules/computer_vision/video_thread_nps.c'''<br />
<br />
Additional models can be found in the sw/ext/tudelft_gazebo_models. You will have to run git submodule init, git submodule update to pull in the models.<br />
<br />
===World===<br />
<br />
Prepare the world (see conf/simulator/gazebo/worlds/ardrone.world or any other world file you might find there). <br />
<br />
NOTE: Pay attention to the following:<br />
<br />
The real-time update rate should be set to zero, as the simulation back-end is already handled by Paparazzi:<br />
<br />
&lt;physics type=&quot;ode&quot;&gt;<br />
&lt;max_step_size&gt;0.001&lt;/max_step_size&gt;<br />
&lt;real_time_update_rate&gt;0&lt;/real_time_update_rate&gt;&lt;!-- Handled by Paparazzi! --&gt;<br />
&lt;/physics&gt;<br />
<br />
Spherical coordinates should be provided for navigation. At this moment, there is an issue where Gazebo incorrectly uses a WSU coordinate system instead of ENU. This can be fixed by setting the heading to 180 degrees as shown below:<br />
<br />
&lt;spherical_coordinates&gt;<br />
&lt;surface_model&gt;EARTH_WGS84&lt;/surface_model&gt;<br />
&lt;latitude_deg&gt;51.9906&lt;/latitude_deg&gt;<br />
&lt;longitude_deg&gt;4.37679&lt;/longitude_deg&gt;<br />
&lt;elevation&gt;0&lt;/elevation&gt;<br />
&lt;heading_deg&gt;180&lt;/heading_deg&gt;&lt;!-- Temporary fix for issue https://bitbucket.org/osrf/gazebo/issues/2022/default-sphericalcoordinates-frame-should --&gt;<br />
&lt;/spherical_coordinates&gt;<br />
<br />
Additional world models can be found in the sw/ext/tudelft_gazebo_models. You will have to run git submodule init, git submodule update to pull in the models.<br />
<br />
===Airframe===<br />
<br />
Enhance your Paparzazzi airframe file to be able to use Gazebo (see examples/ardrone2_gazebo.xml):<br />
<br />
Select Gazebo as the '''FDM''' ('''F'''light '''D'''ynamics '''M'''odel) by adding it to the aircraft file<br />
<br />
&lt;target name=&quot;nps&quot; board=&quot;pc&quot;&gt;<br />
&lt;module name=&quot;fdm&quot; type=&quot;gazebo&quot;/&gt;<br />
&lt;/target&gt;<br />
<br />
Add actuator thrusts and torques to the SIMULATOR section:<br />
<br />
&lt;section name=&quot;SIMULATOR&quot; prefix=&quot;NPS_&quot;&gt;<br />
&lt;define name=&quot;ACTUATOR_NAMES&quot; value=&quot;nw_motor, ne_motor, se_motor, sw_motor&quot; type=&quot;string[]&quot;/&gt;<br />
&lt;define name=&quot;ACTUATOR_THRUSTS&quot; value=&quot;1.55, 1.55, 1.55, 1.55&quot; type=&quot;double[]&quot;/&gt;<br />
&lt;define name=&quot;ACTUATOR_TORQUES&quot; value=&quot;0.155, -0.155, 0.155, -0.155&quot; type=&quot;double[]&quot;/&gt;<br />
...<br />
&lt;section&gt;<br />
<br />
The thrusts and torques are expressed in SI units (N, Nm) and should be in the same order as the ACTUATOR_NAMES.<br />
<br />
In the same section, bypass the AHRS and INS as these are not supported yet, so add this<br />
<br />
&lt;section name=&quot;SIMULATOR&quot; prefix=&quot;NPS_&quot;&gt;<br />
...<br />
&lt;define name=&quot;BYPASS_AHRS&quot; value=&quot;1&quot;/&gt;<br />
&lt;define name=&quot;BYPASS_INS&quot; value=&quot;1&quot;/&gt;<br />
...<br />
&lt;section&gt;<br />
<br />
If you want to use visual based behaviour, enable video thread simulation:<br />
<br />
&lt;section name=&quot;SIMULATOR&quot; prefix=&quot;NPS_&quot;&gt;<br />
...<br />
&lt;define name=&quot;SIMULATE_VIDEO&quot; value=&quot;1&quot;/&gt;<br />
...<br />
&lt;section&gt;<br />
<br />
Specify the Gazebo world and aircraft name:<br />
&lt;section name=&quot;SIMULATOR&quot; prefix=&quot;NPS_&quot;&gt;<br />
...<br />
&lt;define name=&quot;GAZEBO_WORLD&quot; value=&quot;my_world.world&quot;/&gt;<br />
&lt;define name=&quot;GAZEBO_AC_NAME&quot; value=&quot;my_uav&quot;/&gt;<br />
&lt;section&gt;<br />
<br />
4. Make sure all included modules work with NS. <br />
<br />
At the current state of Paparazzi code (20180206), most of the modules that depend on ''video_thread'' are only built when the target ap (autopilot hardware) is selected as the target. <br />
<br />
As a quick 'n dirty fix, try to remove the target attribute from the makefile element in the module xml, e.g.:<br />
<br />
&lt;makefile target=&quot;ap&quot;&gt; ---&gt; &lt;makefile&gt;<br />
<br />
It would be great if as a user you would improve this and make a Pull request of your code improvements to the main Paparazzi codebase, TIA<br />
<br />
=Reality=<br />
<br />
Never forget... A sim is not reality... validate via testflights in the real world after you think everything you created works perfectly.</div>Kirkscheperhttp://wiki.paparazziuav.org/w/index.php?title=FirmwareArchitecture&diff=23971FirmwareArchitecture2017-11-28T12:56:28Z<p>Kirkscheper: Added links to the relevant code directories</p>
<hr />
<div>Some background information on the Firmware, Subsystems and Modules can be found on the [[Airframe Configuration]] page.<br />
<br />
== Firmware ==<br />
Paparazzi is currently split into various firmware types where Fixedwing and Rotorcraft are the main autopilot firmware versions. These firmwares implement some vehicle type specific code using predefined Makefiles defined in [https://github.com/paparazzi/paparazzi/tree/master/conf/firmwares conf/firmwares] subfolder. <br />
<br />
== Low Level drivers ==<br />
low level code organization is roughly:<br />
* [https://github.com/paparazzi/paparazzi/tree/master/sw/airborne/mcu_periph sw/airborne/mcu_periph] : interfaces/drivers for MCU peripherals like I2C, SPI, ADC, etc... (the HAL)<br />
* [https://github.com/paparazzi/paparazzi/tree/master/sw/airborne/peripherals sw/airborne/peripherals] : drivers for external peripherals, like sensor chips, etc...<br />
* [https://github.com/paparazzi/paparazzi/tree/master/sw/airborne/arch sw/airborne/arch] : everything that is architecture specific (''lpc21'', ''stm32'', ''linux'', ..)<br />
* [https://github.com/paparazzi/paparazzi/tree/master/sw/airborne/boards sw/airborne/boards] : board definitions, pinout, etc... (no need to touch this unless you want to support a new board)<br />
<br />
== Modules ==<br />
[[Modules]] use code generation in order to allow people to use them by only editing the vehicle's xml configuration as opposed to changing/adding to the code of the autopilot. This makes the paparazzi build process highly configurable. Typically, function calls are generated for initialization and in the main loop for timers (periodic in paparazzi slang) and events. The event and periodic functions of the Modules get called at the end of event_task_ap and periodic_task_ap respectively.<br />
<br />
Modules are used to configure all parts of paparazzi other than the firmware described above. The build configuration for each module is described using xml description language and the located in the [https://github.com/paparazzi/paparazzi/tree/master/conf/modules conf/modules] subfolder. These modules implement not only the user implemented mission specific code but also the low level drivers and subsystems.<br />
<br />
[https://github.com/paparazzi/paparazzi/tree/master/sw/airborne/modules sw/airborne/modules] contains the mission specific software such as image processing, video recording or relay or guidance commands.<br />
<br />
=== Creating a new Module ===<br />
*See [[Modules]] for more information<br />
<br />
<br />
== Subsystems ==<br />
[https://github.com/paparazzi/paparazzi/tree/master/sw/airborne/subsystems /sw/airborne/subsystems] contains the code base for some of the more critical mission independent software such as AHRS, IMU, INS and GPS. <br />
<br />
{| class="wikitable"<br />
|-<br />
| Since '''v5.8''' it is possible to safely replace ''subsystem'' by ''module'' in your airframe file. The following describes the original description of the legacy subsystems.<br />
|}<br />
<br />
They are selected and configured with a <source lang="xml" enclose="none"><subsystems name="foo" type="bar"></source> in the [[Airframe_Configuration#Firmware_and_Hardware_definitions|firmware section of the airframe file]]. All this does is basically include a makefile <tt>foo_bar.makefile</tt> that adds the respective sources and adds a few configuration options. (See <tt>conf/autopilot/subsystems/...</tt>)<br />
This makes it easier to put an airframe file together (they replace the old raw makefile section) and also allows us to change the code and move/rename files behind the scenes without breaking everyones airframe files.<br />
<br />
=== Creating a new Subsystem ===<br />
A new subsystem is required when adding support for new or alternate core functionalities, as listed above. Some new subsystems will rely on underlying peripheral or MCU peripheral drivers (for example a new IMU subsystem), others do not need this (for example a new set of control loops). An MCU peripheral uses on-chip hardware peripherals in the main microcontroller (such as the SPI hardware), while normal peripherals are external hardware such as an analog to digital converter integrated circuit (such as the MAX1168).<br />
<br />
The general strategy for adding a new subsystem should be something along the lines of:<br />
*(if required) write a peripheral driver for the specific device or device family in <tt>sw/airborne/peripherals/</tt><br />
*(if required) in the peripheral driver, use the <tt>sw/airborne/mcu_periph/*.[c|h]</tt> arch-independent mcu peripheral drivers to handle the communication and input-output operations<br />
*(if required) you may wish to use a family generic c header (<tt>.h</tt>) file for register definitions, etc., if the driver could be used with a family of peripheral devices<br />
*write a subsystem driver for the new functionality, device or device family in <tt>sw/airborne/subsystems/TYPE/</tt><br />
*you may wish to use a family generic c header (<tt>.h</tt>) file for register definitions, etc., if the driver could be used with a family of peripheral devices<br />
*if you need to add complex features (for example, use a gpio for a reset, use an interrupt for data ready, etc), you will need to add some arch specific files in the correct location to handle some of the extra initialization and operation, for example in <tt>sw/airborne/arch/ARCHTYPE/subsystems|peripherals|mcu_periph|ETC/</tt><br />
*write a subsystem makefile to aid in building the code, found in <tt>conf/firmwares/subsystems/fixedwing|rotorcraft|shared/</tt><br />
*even though you technically need to make a new one, you can undoubtedly use existing examples to make your life easier. For example, for an IMU, try looking at the adxl345 peripheral driver, or possibly the imu_b2.[c|h] (which uses for example the ms2100 and max1168 peripherals) for some ideas<br />
*last thing, make sure you USE MASTER for all development, and take a look at the [[Contributing]] page, and be sure to review the coding style guidelines<br />
*heavily comment the code, especially regarding any magic numbers and operations (for example, scaling the input of a sensor)<br />
Finally, master is always being updated and changed, so if you aren't quite sure about something, don't hesitate to ask on the mailing list. In addition, there may be style differences between newer, updated subsystems and older subsystems.<br />
<br />
=== Discussion ===<br />
So the difference is that with subsystems you explicitly call the functions (e.g. control loops) from the main ap loop, whereas the event/periodic functions of the Modules get called at the end of the main event/periodic tasks. So Modules are perfect to add stuff like extra payload and sensors, but Subsystems give you tighter control over when and in what order to call functions (e.g. for estimation/control).<br />
<br />
Modules naturally provide the "several implementations" feature of the Subsystems. So, we could have a "generic" main.c consisting only in calls to the generated functions.<br />
Nevertheless, care should be taken that switching to a "module only" configuration doesn't become detrimental to the readability and debugability of the code.<br />
<br />
You can also wrap some subsystem code as a modules (e.g. infrared), or the other way round (e.g. imu_ppzuav). As you can see with the imu_ppzuav module it also still expects a direct ImuEvent call from main_ap, so you could say it's not a "pure" module.<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]]</div>Kirkscheperhttp://wiki.paparazziuav.org/w/index.php?title=DevGuide/LearningToProgram&diff=23946DevGuide/LearningToProgram2017-11-28T09:54:12Z<p>Kirkscheper: Added a link to the contributing page of paparazzi</p>
<hr />
<div>== Introduction ==<br />
<br />
There sometimes comes a moment that you would like to have more functionality in the Paparazzi GCS, in the airborne code or somewhere else. This non existent functionality does not come out of the blue. It took all the people involved blood, sweat and tears to get where the paparazzi is now. Also for you, it can be very rewarding to program improvements for the paparazzi. Paparazzi is a large project with years of development so it can be a daunting challenge to edit the source code but your efforts will be rewarded as the community will use your changes, all in an effort to improve Paparazzi software.<br />
<br />
Details and tips on contributing the source code can be found here: https://github.com/paparazzi/paparazzi/blob/master/CONTRIBUTING.md<br />
<br />
If this is your first programming experience it is maybe better to learn to program some generic desktop applications first. Altering and enhancing the code is even for seasoned programmers not a trivial task. Now if all of this did not make you less motivated, great! Let's get to it.<br />
<br />
On this page you will not find in depth info of the languages use. There are much better resource on the internet already than we could ever provide in this Wiki. Therefore there are only link to learning these languages.<br />
<br />
== Languages ==<br />
<br />
The whole of paparazzi is written in various programming languages.<br />
<br />
=== OCAML ===<br />
<br />
The Objective Caml system is the main implementation of the Caml language. It is a functional programming language, and also features a powerful module system and a full-fledged object-oriented layer. It comes with a native-code compiler that supports numerous architectures, for high performance; a bytecode compiler, for increased portability; and an interactive loop, for experimentation and rapid development. <br />
<br />
* http://ocaml.org/learn/<br />
* http://www.ocaml-tutorial.org/<br />
<br />
=== C ===<br />
<br />
http://www.cprogramming.com/tutorial.html<br />
http://www.learn-c.org/<br />
<br />
=== Python ===<br />
<br />
Python is a clear and powerful object-oriented programming language, comparable to Perl, Ruby, Scheme, or Java. <br />
<br />
http://wiki.python.org/moin/BeginnersGuide<br />
<br />
== Makefiles ==<br />
<br />
Makefiles also can be seen as small, sometimes even large programs. <br />
<br />
http://www.tutorialspoint.com/makefile/index.htm<br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]]</div>Kirkscheperhttp://wiki.paparazziuav.org/w/index.php?title=DevGuide/CodeEditors&diff=23942DevGuide/CodeEditors2017-11-28T09:36:25Z<p>Kirkscheper: Update Eclipse description and add how to set the Paparazzi code style</p>
<hr />
<div>== Introduction ==<br />
<br />
So you want to adjust the sourcecode to your wishes, get rid of some bugs that bother you and help to improve the code, great! While theoretically it all an be done with VI and command line instructions, learning to code for Paparazzi this way is a little cumbersome. Therefore it is a good idea to set up an IDE Integrated Development Environment.<br />
<br />
As you may have noticed, this page is far from finished, it really would be great if you help to improve this page with even a small improvement. <br />
<br />
== IDE for OCAML ==<br />
<br />
We start of with OCAML IDE's first<br />
<br />
=== EMACS ===<br />
Tuareg is a really nice mode for Emacs. On Ubuntu/Debian just '''apt-get install tuareg-mode'''.<br />
<br />
http://www.emacswiki.org/emacs/TuaregMode<br />
<br />
=== Netbeans ===<br />
<br />
==== Installation ====<br />
First install a reasonable new Netbeans, e.g. v6.8 via the synaptic package manager in Ubuntu or use the commandline<br />
<br />
==== OCAML Plugin ====<br />
<br />
http://ocamlplugin.loki-a.com/index.php?title=Main_Page<br />
<br />
# Start netbeans IDE<br />
# Go to Netbean menu -Tools - Plugins<br />
<br />
# Select tab - Settings<br />
# Click the Add button<br />
<br />
Name: Ocaml from Loki a<br />
URL: http://ocamlplugin.loki-a.com/ocamlplugin/updates/updates.xml<br />
<br />
# Then click the tab "Available plugins"<br />
# Select for install from the list the "Ocaml Plugin"<br />
# Click Install<br />
# Click Install Then Next<br />
# If you see "Signed but not trusted, ignore the message just click "continue"<br />
# If it all worked, you will see "Install completed successfully, just click "Finish"<br />
<br />
==== Syntax Highlighting ====<br />
<br />
=== Eclipse ===<br />
<br />
* [http://www.algo-prog.info/ocaide/ OcaIDE]<br />
* [http://ocamldt.free.fr/ ODT: OCaml Development Tools]<br />
<br />
OcaIDE seems to be the best option for Eclipse. Note that OcaIDE requires eclipse to run under Java 7.<br />
No release of ODT since November 2013.<br />
<br />
== IDE for Python ==<br />
<br />
[http://www.jetbrains.com/pycharm/ PyCharm] is a great Python IDE with awesome completion, code assistance, debugger and git integration and much more...<br />
<br />
== IDE for C and CPP ==<br />
<br />
Next are the IDE's for C development<br />
<br />
=== Eclipse ===<br />
<br />
* [http://eclipse.org/cdt/ Eclipse CDT]<br />
Typical process consists of compiling the autopilot code for given airframe in Paparazzi center, and then running the related debug configuration in Eclipse. The debugger will first recompile whole Paparazzi (e.g. running "make" in Paparazzi home directory), which is not really useful, but bearable.<br />
<br />
In case we want to work with a single aircraft and want Eclipse to also compile the autopilot code, we have to do the following:<br />
# Import paparazzi into eclipse as normal<br />
# in Project->Properties->C/C++ Build->Environment, add three variables<br />
## Current_Airframe: set to the name of the airframe you want to build<br />
## PAPARAZZI_HOME: set to the root paparazzi directory<br />
## PAPARAZZI_SRC: set to the root paparazzi directory<br />
# in Project->Properties->C/C++ Build<br />
## in ''Builder Settings'' Tab<br />
### Uncheck ''Use default build command''<br />
### in build command put: ''make -f Makefile.ac AIRCRAFT=${Current_Airframe}''<br />
## In Behavior Tab<br />
### set the Build field to: ap.compile<br />
### set the Clean field to:clean_ac<br />
<br />
That will compile ''Current_Aiframe'' with target ''ac''. For this to work however you will first have to set the conf/conf.xml symlink to the correct location. This can be done using ''./start'' in your terminal from the root paparazzi directory.<br />
<br />
We also recommend that you load the paparazzi code style into Eclipse, this can be done with the following:<br />
# Navigate to Project->Properties->C/C++ General->Formatter<br />
## Tick the ''Enable project specific settings'' tick box<br />
## Import the Paparazzi profile from {root paparazzi directory}/paparazzi_code_profile_eclipse.xml<br />
<br />
=== Qt ===<br />
<br />
== Debugging tools ==<br />
<br />
===GDB===<br />
GDB can be used for quite effective Paparazzi debugging. Debugging [[RT_Paparazzi#Debugging_with_an_Eclipse_IDE|guide]] with Eclipse IDE was already described for [[RT_Paparazzi]], but the exact same steps can be used for classic Paparazzi. The guide is [[RT_Paparazzi#Debugging_with_an_Eclipse_IDE|here]]: <br />
<br />
[[Category:Software]] [[Category:Developer_Documentation]]</div>Kirkscheper