Skip to content
Arthur Benemann edited this page Mar 15, 2013 · 1 revision

Overview

Eclipse is a sophisticated IDE for multi-language development. With the Eclipse CDT and the Subversive plugin installed, !ArduPilot Mega development is possible.

The discussion here assumes Eclipse 3.6 (Helios) or later.

Current Status

The make-based build system for APM does not currently support building on Windows systems. Windows users can still use Eclipse for source code editing and revision control, with the Arduino IDE used for building.

See BuildingWithMake for details of the make-based build system for APM.

Installing Eclipse and Other Tools

Download and install the Eclipse IDE for C/C++ developers. For existing Eclipse installations, the CDT is required; if it is not already installed use the Eclipse internal installer. If you only intend to use Eclipse for APM development, avoid the temptation to install all of it.

Install the Subversive Plugin

Follow the instructions at the Polarion website to install Subversive.

For Eclipse 3.6 (Helios), the standard Subversive distribution is broken and the instructions for obtaining the right version can be confusing to new users. Proceed as follows:

  • Select Install New Software... from the Help menu, which opens the Install panel.
  • Click the "Available Software Sites" link, which will open the Preferences panel.
  • Find {{{http://download.eclipse.org/technology/subversive/0.7/update-site/}}} in the list of software sites, and check the box to enable it.
  • Click OK to dismiss the Preferences panel.
  • In the dropdown at the top of the Install panel, select the site that was just enabled.
  • In the list of available plugins, select the Subversive SVN Team Provider Plugin.
  • Click Next to begin the installation process.

When the Subversive Connector Discovery window is displayed later, select only the most recent version of the SVN Kit connector; the Native JavaHL connector only works on Windows and requires additional installation steps.

Creating and Populating the Workspace

Download the ArduPilotMega.epf and ArduPilotmega.psf files. Your browser may add a .txt or .xml suffix to these files; you should remove these suffixes so that Eclipse will allow you to select the files later.

Eclipse manages groups of projects in what it calls a workspace. Use the Switch Workspace option in the File menu to pick a location for your APM workspace and use the Import... option in the File menu to import the {{{.epf}}} file using the General/Preferences importer. This sets workspace preferences to suit APM.

Open the Preferences panel, and select C/C++/File Types, If there is no entry for {{{.pde}}} in the list, use the New... button to assign the {{{.pde}}} pattern to the type {{{C++ Source File}}}. This works around a longstanding Eclipse bug where file associations are not imported with preferences.

Import the {{{.psf}}} file using the Team/Team Project Set importer. This will in turn check out the APM projects into your workspace. Once the import has completed, right-click in the Project Explorer (on the left side of the display) and select Refresh from the dropdown menu. This will re-index all the projects.

Building

Ensure that you have the C/C++ perspective selected (perspective controls are in the tab at the top right of the window).

Select a project in the Project Explorer (normally on the left side of the window) and click the hammer button in the toolbar.

The progress of the build can be monitored in the Console tab at the bottom of the window. Double-clicking a warning or error will open a text editor tab with the relevant source code line selected. Problems, including warnings and errors, are indexed in the Problems tab, and also called out in the sidebars in the text editor.

The Tasks tab conveniently indexes comments marked FIXME, TODO and XXX.

Consult the Eclipse and CDT documentation for more details on using the IDE for C/C++ development.

Updating and Committing Changes

Version control operations are performed using the Project Explorer. Select the file(s) and project(s) that you want to operate on, then right-click and use options in the dropdown menu.

To update all of the projects to their most recent versions, select Team/Update.

To commit changes, select Team/Commit. Before committing, use Compare With/Base from Working Copy to review the changes you are going to commit.

If you want to back out local changes and restore to the most recently checked-out version, use Team/Revert.

Other Plugins

The AVR Eclipse Plugin may eventually be useful for programming APM directly from Eclipse. For now, it adds an AVR Device Explorer tab to the bottom section of the window that is occasionally helpful in finding the names of AVR registers.

A very large collection of Eclipse plugins, for a variety of languages and both free and commercial can be found at the Eclipse Marketplace.

Clone this wiki locally