mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 15:53:56 -04:00
README: rewritten to be up to date
This commit is contained in:
parent
36cb7bad26
commit
caf4a278ad
170
README.md
170
README.md
@ -1,141 +1,61 @@
|
|||||||
Getting the source
|
# ArduPilot Project
|
||||||
==================
|
|
||||||
|
|
||||||
We'll assume you are putting the source in `/home/name/ardupilot`.
|
## Getting the source
|
||||||
|
|
||||||
You can either download the source using the "ZIP" button at
|
You can either download the source using the "ZIP" button at the top of the
|
||||||
https://github.com/diydrones/ardupilot, or you can grab it from github
|
github page, or you can make a clone using git:
|
||||||
using git:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone git://github.com/diydrones/ardupilot.git
|
git clone git://github.com/diydrones/ardupilot.git
|
||||||
```
|
```
|
||||||
|
|
||||||
Building using Arduino
|
## Building using Arduino IDE
|
||||||
======================
|
|
||||||
|
|
||||||
First install the libraries:
|
ArduPilot is no longer compatible with the standard Arduino distribution.
|
||||||
|
You need to use a patched Arduino IDE to build ArduPilot.
|
||||||
|
|
||||||
1. Copy the `libraries` directory to your
|
1. The patched ArduPilot Arduino IDE is available for Mac and Windows from
|
||||||
`/path/to/arduino/hardware/libraries/` or
|
the [downloads page][1]. On Linux, you should use the makefile build.
|
||||||
`/path/to/arduino/libraries` directory.
|
|
||||||
|
|
||||||
2. Restart the Arduino IDE.
|
2. Unpack and launch the ArduPilot Arduino IDE. In the preferences menu, set
|
||||||
|
your sketchbook location to your downloaded or cloned `ardupilot` directory.
|
||||||
|
|
||||||
Each library comes with a simple example. You can find the examples in
|
3. In the ArduPilot Arduino IDE, select your ArduPilot type (APM1 or APM2) from
|
||||||
the menu File→Examples
|
the ArduPilot menu (in the top menubar).
|
||||||
|
|
||||||
Building using make
|
4. Restart the ArduPilot Arduino IDE. You should now be able to build ArduPlane
|
||||||
===================
|
or ArduCopter from source.
|
||||||
|
|
||||||
1. Go to the directory of the sketch and type `make`.
|
5. Remember that, after changing ArduPilot type (APM1 or APM2) in the IDE,
|
||||||
|
you'll need to close and restart the IDE before continuing.
|
||||||
|
|
||||||
2. Type `make upload` to upload according to the parameters in
|
[1]: http://code.google.com/p/ardupilot-mega/downloads/list
|
||||||
`config.mk`.
|
|
||||||
|
|
||||||
For example:
|
|
||||||
|
|
||||||
```
|
|
||||||
cd ArduPlane # or ArduCopter etc.
|
|
||||||
make
|
|
||||||
make upload
|
|
||||||
```
|
|
||||||
|
|
||||||
Building using cmake
|
|
||||||
====================
|
|
||||||
```
|
|
||||||
cd ArduPlane # or ArduCopter etc.
|
|
||||||
mkdir build
|
|
||||||
cd build
|
|
||||||
|
|
||||||
# If you have Arduino installed in a non-standard location you by
|
|
||||||
# specify it by using -DARDUINO_SDK_PATH=/path/to/arduino
|
|
||||||
cmake .. -DAPM_BOARD=mega -DAPM_PORT=/dev/ttyUSB0 # Or -DAPM_BOARD=mega2560
|
|
||||||
|
|
||||||
make # Will build the sketch.
|
|
||||||
make ArduPlane-upload # Will upload the sketch.
|
|
||||||
```
|
|
||||||
|
|
||||||
If you have a sync error during upload, reset the board or power cycle
|
|
||||||
the board before the upload starts.
|
|
||||||
|
|
||||||
Building using Eclipse
|
|
||||||
======================
|
|
||||||
|
|
||||||
Generating the Eclipse project for your system
|
|
||||||
----------------------------------------------
|
|
||||||
|
|
||||||
```
|
|
||||||
mkdir /home/name/apm-build
|
|
||||||
cd /home/name/apm-build
|
|
||||||
cmake -G"Eclipse CDT4 - Unix Makefiles" \
|
|
||||||
-D CMAKE_BUILD_TYPE=Debug \
|
|
||||||
-D BOARD=mega \
|
|
||||||
-D PORT=/dev/ttyUSB0 \
|
|
||||||
../ardupilot/ArduCopter
|
|
||||||
```
|
|
||||||
|
|
||||||
Change the `../ardupilot/ArduCopter` above to be whatever sketch you
|
|
||||||
want to build.
|
|
||||||
|
|
||||||
_Note: Unix can be substituted for MinGW/MSYS/NMake (for Windows).
|
|
||||||
See http://www.vtk.org/Wiki/Eclipse_CDT4_Generator)._
|
|
||||||
|
|
||||||
### Define options
|
|
||||||
|
|
||||||
* `CMAKE_BUILD_TYPE` choose from `DEBUG`, `RELEASE` etc.
|
|
||||||
|
|
||||||
* `PORT` is the port for uploading to the board, `COM0` etc. on
|
|
||||||
Windows, `/dev/ttyUSB0` etc. on Linux.
|
|
||||||
|
|
||||||
* `BOARD` is your board type, `mega` for the 1280 or `mega2560` for
|
|
||||||
the 2560 boards.
|
|
||||||
|
|
||||||
* `ARDUINO_SDK_PATH` to specify the path to your Arduino installation
|
|
||||||
if it isn't in the default path.
|
|
||||||
|
|
||||||
Importing the Eclipse build project
|
|
||||||
-----------------------------------
|
|
||||||
|
|
||||||
1. Import project using Menu File→Import.
|
|
||||||
|
|
||||||
2. Select General→Existing projects into workspace.
|
|
||||||
|
|
||||||
3. Browse to where your build tree is and select the root build tree
|
|
||||||
directory.
|
|
||||||
|
|
||||||
4. Keep "Copy projects into workspace" unchecked.
|
|
||||||
|
|
||||||
You should now have a fully functional eclipse project.
|
|
||||||
|
|
||||||
Importing the Eclipse source project
|
|
||||||
------------------------------------
|
|
||||||
|
|
||||||
You can also import the source repository (`/home/name/ardupilot`) if you
|
|
||||||
want to modify the source/commit using git.
|
|
||||||
|
|
||||||
Configuring Eclipse to recognize PDE files
|
|
||||||
------------------------------------------
|
|
||||||
|
|
||||||
* File association: Go to Window→Preferences→General→Content
|
|
||||||
Types. This tree associates a filename or filename pattern with its
|
|
||||||
content type so that tools can treat it properly. Source and header
|
|
||||||
files for most languages are under the Text tree. Add "*.pde" as a
|
|
||||||
C++ Source.
|
|
||||||
|
|
||||||
* Autocompletion: Right click on source project→Properties→Project
|
|
||||||
References→apm-build Project
|
|
||||||
|
|
||||||
* Regenerating the Eclipse source project file: `cmake -G"Eclipse
|
|
||||||
CDT4 - Unix Makefiles" -DECLIPSE_CDT4_GENERATE_SOURCE_PROJECT=TRUE
|
|
||||||
/home/name/ardupilot`
|
|
||||||
|
|
||||||
|
|
||||||
Build a package using cpack
|
## Building using make
|
||||||
===========================
|
|
||||||
```
|
1. Before you build the project for the first time, you'll need to run
|
||||||
cd build
|
`make configure` from a sketch directory. This will create a `config.mk`
|
||||||
cmake ..
|
file at the top level of the repository. You can set some defaults in
|
||||||
make package
|
`config.mk`
|
||||||
make package_source
|
|
||||||
```
|
2. In the sketch directory, type `make` to build for APM2. Alternatively,
|
||||||
|
`make apm1` will build for the APM1.
|
||||||
|
|
||||||
|
3. Type `make upload` to upload. You may need to set the correct default
|
||||||
|
serial port in your `config.mk`.
|
||||||
|
|
||||||
|
# User Technical Support
|
||||||
|
|
||||||
|
ArduPilot users should use the DIYDrones.com forums for technical support.
|
||||||
|
|
||||||
|
# Development Team
|
||||||
|
|
||||||
|
The ArduPilot project is open source and maintained by a team of volunteers.
|
||||||
|
|
||||||
|
To contribute, you can send a pull request on Github. You can also join the
|
||||||
|
[development discussion on Google Groups][2]. Note that the Google Groups
|
||||||
|
mailing lists are NOT for user tech support, and are moderated for new users to
|
||||||
|
prevent off-topic discussion.
|
||||||
|
|
||||||
|
[2]: https://groups.google.com/forum/?fromgroups#!forum/drones-discuss
|
||||||
|
Loading…
Reference in New Issue
Block a user