Convert Figma logo to code with AI

ArduPilot logoardupilot

ArduPlane, ArduCopter, ArduRover, ArduSub source

11,933
18,550
11,933
2,624

Top Related Projects

PX4 Autopilot Software

Open Source Flight Controller Firmware

3,493

INAV: Navigation-enabled flight control software

Clean-code version of the baseflight flight controller firmware

Paparazzi is a free and open-source hardware and software project for unmanned (air) vehicles. This is the main software repository.

Quick Overview

ArduPilot is an open-source autopilot software suite for controlling autonomous vehicles, including drones, ground vehicles, and boats. It provides a robust and feature-rich platform for both hobbyists and professional users, supporting a wide range of hardware and offering advanced navigation and control capabilities.

Pros

  • Extensive hardware support, including various flight controllers and sensors
  • Rich feature set, including advanced mission planning and autonomous operations
  • Active community and regular updates
  • Highly customizable and adaptable for different vehicle types and use cases

Cons

  • Steep learning curve for beginners
  • Complex setup process, especially for advanced features
  • Requires careful tuning and configuration for optimal performance
  • Limited documentation for some advanced features and customizations

Code Examples

// Initialize the ArduPilot vehicle
AP_Vehicle vehicle;

// Set up the main loop
void loop() {
    vehicle.update();
    // Your custom code here
}

This example shows the basic structure for initializing an ArduPilot vehicle and setting up the main loop.

// Define a simple waypoint mission
Mission mission;
mission.add_waypoint(Waypoint(0, 0, 10)); // Latitude, Longitude, Altitude
mission.add_waypoint(Waypoint(1, 1, 20));
mission.start();

This code demonstrates how to create a simple waypoint mission using ArduPilot.

// Read sensor data
float heading = vehicle.get_heading();
Vector3f acceleration = vehicle.get_acceleration();
float altitude = vehicle.get_altitude();

This example shows how to read various sensor data from the ArduPilot vehicle.

Getting Started

  1. Clone the ArduPilot repository:

    git clone https://github.com/ArduPilot/ardupilot.git
    
  2. Install dependencies:

    cd ardupilot
    Tools/environment_install/install-prereqs-ubuntu.sh -y
    
  3. Build for your target vehicle (e.g., for a quadcopter):

    ./waf configure --board=Pixhawk1
    ./waf copter
    
  4. Upload the firmware to your flight controller using Mission Planner or similar ground control software.

  5. Configure and calibrate your vehicle using the ground control software.

Competitor Comparisons

PX4 Autopilot Software

Pros of PX4-Autopilot

  • More modular architecture, making it easier to add new features or modify existing ones
  • Better support for newer hardware and sensors
  • More active development community with frequent updates

Cons of PX4-Autopilot

  • Steeper learning curve for beginners
  • Less extensive documentation compared to ArduPilot
  • Fewer supported vehicle types (mainly focused on multicopters and fixed-wing aircraft)

Code Comparison

PX4-Autopilot (C++):

void MulticopterPositionControl::control_position(const float dt)
{
    // Position control logic
    Vector3f pos_error = _pos_sp - _pos;
    Vector3f vel_sp = pos_error * _params.pos_p;
    control_velocity(dt, vel_sp);
}

ArduPilot (C++):

void AC_PosControl::pos_to_rate_xy(float dt, float ekfNavVelGainScaler)
{
    // Position control logic
    Vector3f pos_error = _pos_target - _inav.get_position();
    _vel_target.xy() = pos_error.xy() * _p_pos_xy.kp();
    _vel_target.xy() *= ekfNavVelGainScaler;
}

Both projects use similar approaches for position control, but PX4-Autopilot's code tends to be more modular and object-oriented, while ArduPilot's code is more procedural and tightly integrated with its overall system architecture.

Open Source Flight Controller Firmware

Pros of Betaflight

  • Lightweight and optimized for racing drones and FPV flying
  • Faster loop times and lower latency for more responsive control
  • Simpler setup and configuration process for beginners

Cons of Betaflight

  • Limited support for larger, more complex drone configurations
  • Fewer advanced features for autonomous flight and mission planning
  • Less extensive documentation and community support compared to ArduPilot

Code Comparison

ArduPilot (example of parameter handling):

AP_Int8 dummy_var;
const AP_Param::GroupInfo var_info[] = {
    // @Param: DUMMY_VAR
    // @DisplayName: Dummy Variable
    // @Description: A dummy variable for demonstration
    // @Range: 0 100
    // @User: Standard
    AP_GROUPINFO("DUMMY_VAR", 0, ParameterExample, dummy_var, 0),
    AP_GROUPEND
};

Betaflight (example of PID controller implementation):

void pidController(const pidProfile_t *pidProfile, timeUs_t currentTimeUs)
{
    // PID controller code
    for (int axis = FD_ROLL; axis <= FD_YAW; axis++) {
        // Calculate PID terms
        // Apply PID output
    }
}
3,493

INAV: Navigation-enabled flight control software

Pros of iNav

  • Lighter and more efficient codebase, suitable for smaller drones and multicopters
  • Better support for fixed-wing aircraft and transitional VTOL platforms
  • More user-friendly configuration process through a graphical interface

Cons of iNav

  • Less extensive feature set compared to ArduPilot
  • Smaller community and ecosystem, resulting in fewer third-party integrations
  • Limited support for larger vehicles and professional/industrial applications

Code Comparison

ArduPilot (example of parameter handling):

AP_Int8 format_version;
AP_Int8 software_type;

const AP_Param::Info var_info[] = {
    // @Param: FORMAT_VERSION
    // @DisplayName: Eeprom format version number
    // @Description: This value is incremented when changes are made to the eeprom format
    // @User: Advanced
    AP_GROUPINFO("FORMAT_VERSION", 0, AP_Vehicle, format_version, 0),
    // ...
};

iNav (example of parameter handling):

typedef struct {
    const char *name;
    const uint16_t type; // type of variable
    const uint8_t flags;
    void *ptr; // pointer to variable in memory
    const int32_t min;
    const int32_t max;
} __attribute__((packed)) setting_t;

Both projects use different approaches to parameter handling, with ArduPilot using a more complex system that includes additional metadata, while iNav opts for a simpler structure.

Clean-code version of the baseflight flight controller firmware

Pros of Cleanflight

  • Lightweight and optimized for racing drones and small quadcopters
  • User-friendly configuration interface with Cleanflight Configurator
  • Faster loop times and lower latency for improved flight performance

Cons of Cleanflight

  • Limited support for larger drones and non-quadcopter configurations
  • Fewer advanced features compared to ArduPilot (e.g., mission planning, obstacle avoidance)
  • Smaller community and less extensive documentation

Code Comparison

ArduPilot (example of parameter handling):

AP_Int8 dummy_var;
const AP_Param::GroupInfo var_info[] = {
    // @Param: DUMMY_VAR
    // @DisplayName: Dummy Variable
    // @Description: This is a dummy variable
    // @Range: 0 10
    // @User: Standard
    AP_GROUPINFO("DUMMY_VAR", 0, ParameterExample, dummy_var, 0),
    AP_GROUPEND
};

Cleanflight (example of PID controller implementation):

void pidController(const pidProfile_t *pidProfile, const rollAndPitchTrims_t *angleTrim, timeUs_t currentTimeUs)
{
    static timeUs_t previousTimeUs;
    const float dT = (currentTimeUs - previousTimeUs) * 1e-6f;
    previousTimeUs = currentTimeUs;

    // ... (PID calculation logic)
}

Paparazzi is a free and open-source hardware and software project for unmanned (air) vehicles. This is the main software repository.

Pros of Paparazzi

  • More lightweight and modular architecture
  • Easier to customize and extend for specific research needs
  • Better support for fixed-wing aircraft and unconventional designs

Cons of Paparazzi

  • Smaller community and less commercial support
  • Fewer supported hardware platforms
  • Steeper learning curve for beginners

Code Comparison

Paparazzi (main flight control loop):

void autopilot_periodic(void) {
  if (autopilot_in_flight) {
    nav_periodic_task();
    guidance_h_run(autopilot_guidance_h_mode);
    guidance_v_run(autopilot_guidance_v_mode);
  }
}

ArduPilot (main flight control loop):

void Copter::fast_loop()
{
    // IMU update
    ins.update();
    // run low level rate controllers that only require IMU data
    attitude_control->rate_controller_run();
    // send outputs to the motors library
    motors_output();
}

Both projects implement similar flight control loops, but Paparazzi's approach is more modular and easier to customize, while ArduPilot's implementation is more tightly integrated and optimized for performance.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

ArduPilot Project

Discord

Test Copter Test Plane Test Rover Test Sub Test Tracker

Test AP_Periph Test Chibios Test Linux SBC Test Replay

Test Unit Teststest size

Test Environment Setup

Cygwin Build Macos Build

Coverity Scan Build Status

Test Coverage

Autotest Status

ArduPilot is the most advanced, full-featured, and reliable open source autopilot software available. It has been under development since 2010 by a diverse team of professional engineers, computer scientists, and community contributors. Our autopilot software is capable of controlling almost any vehicle system imaginable, from conventional airplanes, quad planes, multi-rotors, and helicopters to rovers, boats, balance bots, and even submarines. It is continually being expanded to provide support for new emerging vehicle types.

The ArduPilot project is made up of:

User Support & Discussion Forums

Developer Information

Top Contributors

How To Get Involved

License

The ArduPilot project is licensed under the GNU General Public License, version 3.

Maintainers

ArduPilot is comprised of several parts, vehicles and boards. The list below contains the people that regularly contribute to the project and are responsible for reviewing patches on their specific area.