Difference between revisions of "DevGuide/CodeEditors"
IHaveADrone (talk | contribs) m (spelling) |
m (Removed empty section) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 57: | Line 57: | ||
Next are the IDE's for C development | Next are the IDE's for C development | ||
=== Eclipse === | === Eclipse === | ||
* [http://eclipse.org/cdt/ Eclipse CDT] | * [http://eclipse.org/cdt/ Eclipse CDT] | ||
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. | |||
= | 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: | ||
# Import paparazzi into eclipse as normal | |||
# in Project->Properties->C/C++ Build->Environment, add three variables | |||
## Current_Airframe: set to the name of the airframe you want to build | |||
## PAPARAZZI_HOME: set to the root paparazzi directory | |||
## PAPARAZZI_SRC: set to the root paparazzi directory | |||
# in Project->Properties->C/C++ Build | |||
## in ''Builder Settings'' Tab | |||
### Uncheck ''Use default build command'' | |||
### in build command put: ''make -f Makefile.ac AIRCRAFT=${Current_Airframe}'' | |||
## In Behavior Tab | |||
### set the Build field to: ap.compile | |||
### set the Clean field to:clean_ac | |||
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. | |||
We also recommend that you load the paparazzi code style into Eclipse, this can be done with the following: | |||
# Navigate to Project->Properties->C/C++ General->Formatter | |||
## Tick the ''Enable project specific settings'' tick box | |||
## Import the Paparazzi profile from {root paparazzi directory}/paparazzi_code_profile_eclipse.xml | |||
== Debugging tools == | == Debugging tools == |
Latest revision as of 04:38, 28 November 2017
Introduction
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.
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.
IDE for OCAML
We start of with OCAML IDE's first
EMACS
Tuareg is a really nice mode for Emacs. On Ubuntu/Debian just apt-get install tuareg-mode.
http://www.emacswiki.org/emacs/TuaregMode
Netbeans
Installation
First install a reasonable new Netbeans, e.g. v6.8 via the synaptic package manager in Ubuntu or use the commandline
OCAML Plugin
http://ocamlplugin.loki-a.com/index.php?title=Main_Page
- Start netbeans IDE
- Go to Netbean menu -Tools - Plugins
- Select tab - Settings
- Click the Add button
Name: Ocaml from Loki a URL: http://ocamlplugin.loki-a.com/ocamlplugin/updates/updates.xml
- Then click the tab "Available plugins"
- Select for install from the list the "Ocaml Plugin"
- Click Install
- Click Install Then Next
- If you see "Signed but not trusted, ignore the message just click "continue"
- If it all worked, you will see "Install completed successfully, just click "Finish"
Syntax Highlighting
Eclipse
OcaIDE seems to be the best option for Eclipse. Note that OcaIDE requires eclipse to run under Java 7. No release of ODT since November 2013.
IDE for Python
PyCharm is a great Python IDE with awesome completion, code assistance, debugger and git integration and much more...
IDE for C and CPP
Next are the IDE's for C development
Eclipse
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.
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:
- Import paparazzi into eclipse as normal
- in Project->Properties->C/C++ Build->Environment, add three variables
- Current_Airframe: set to the name of the airframe you want to build
- PAPARAZZI_HOME: set to the root paparazzi directory
- PAPARAZZI_SRC: set to the root paparazzi directory
- in Project->Properties->C/C++ Build
- in Builder Settings Tab
- Uncheck Use default build command
- in build command put: make -f Makefile.ac AIRCRAFT=${Current_Airframe}
- In Behavior Tab
- set the Build field to: ap.compile
- set the Clean field to:clean_ac
- in Builder Settings Tab
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.
We also recommend that you load the paparazzi code style into Eclipse, this can be done with the following:
- Navigate to Project->Properties->C/C++ General->Formatter
- Tick the Enable project specific settings tick box
- Import the Paparazzi profile from {root paparazzi directory}/paparazzi_code_profile_eclipse.xml
Debugging tools
GDB
GDB can be used for quite effective Paparazzi debugging. Debugging guide with Eclipse IDE was already described for RT_Paparazzi, but the exact same steps can be used for classic Paparazzi. The guide is here: