Convert Figma logo to code with AI

iNavFlight logoinav

INAV: Navigation-enabled flight control software

3,493
1,581
3,493
284

Top Related Projects

Open Source Flight Controller Firmware

11,933

ArduPlane, ArduCopter, ArduRover, ArduSub source

PX4 Autopilot Software

Clean-code version of the baseflight flight controller firmware

Quick Overview

The iNavFlight/inav repository is a flight control firmware for multirotor and fixed-wing aircraft. It is a fork of the popular Cleanflight and Betaflight projects, with a focus on improving navigation and autonomous flight capabilities.

Pros

  • Advanced Navigation Features: iNAV provides a range of advanced navigation features, including GPS-based position hold, return-to-home, and autonomous waypoint navigation.
  • Robust Codebase: The project has a large and active community, with regular updates and bug fixes.
  • Customizable: iNAV allows for a high degree of customization, with a wide range of configuration options and support for various hardware setups.
  • Open-Source: The project is open-source, allowing for community contributions and transparency.

Cons

  • Steep Learning Curve: The advanced features and customization options can make iNAV challenging for beginners to set up and configure.
  • Hardware Compatibility: Not all hardware is supported out-of-the-box, and some configurations may require additional setup or troubleshooting.
  • Limited Documentation: While the project has a growing community, the documentation can be sparse or outdated in some areas.
  • Performance Overhead: The advanced features of iNAV may come with a higher performance overhead compared to more lightweight flight control firmwares.

Code Examples

N/A (This is not a code library)

Getting Started

N/A (This is not a code library)

Competitor Comparisons

Open Source Flight Controller Firmware

Pros of Betaflight

  • Betaflight is widely used and has a large community, providing extensive support and resources.
  • The project has a strong focus on performance and responsiveness, making it a popular choice for high-end drone builds.
  • Betaflight offers a comprehensive set of features, including advanced flight modes and tuning options.

Cons of Betaflight

  • Betaflight may have a steeper learning curve compared to iNav, especially for beginners.
  • The project's rapid development can sometimes lead to compatibility issues or breaking changes.
  • Betaflight's focus on performance may come at the expense of some advanced navigation and autonomous features found in iNav.

Code Comparison

Betaflight:

void pidController(void) {
    // Calculate gyro rates
    for (int axis = 0; axis < 3; axis++) {
        rateTarget[axis] = getSetpointRate(axis) * maxVelocity[axis];
        const float gyroRate = gyro.gyroADCf[axis];
        const float rateError = rateTarget[axis] - gyroRate;
        pidData[axis].P = pidCoefficient[axis].Kp * rateError;
    }
    // Apply I-term
    for (int axis = 0; axis < 3; axis++) {
        pidData[axis].I = constrainf(pidData[axis].I + pidCoefficient[axis].Ki * rateError * dT, -itermLimit, itermLimit);
    }
}

iNav:

void pidController(void) {
    // Calculate gyro rates
    for (int axis = 0; axis < 3; axis++) {
        rateTarget[axis] = getSetpointRate(axis) * maxVelocity[axis];
        const float gyroRate = gyro.gyroADCf[axis];
        const float rateError = rateTarget[axis] - gyroRate;
        pidData[axis].P = pidCoefficient[axis].Kp * rateError;
    }
    // Apply I-term
    for (int axis = 0; axis < 3; axis++) {
        pidData[axis].I = constrainf(pidData[axis].I + pidCoefficient[axis].Ki * rateError * dT, -itermLimit, itermLimit);
    }
}

The code snippets above show the pidController() function in both Betaflight and iNav. The main difference is the focus on performance and responsiveness in Betaflight, while iNav may prioritize advanced navigation and autonomous features.

11,933

ArduPlane, ArduCopter, ArduRover, ArduSub source

Pros of ArduPilot

  • Extensive feature set, supporting a wide range of vehicles (planes, helicopters, rovers, etc.)
  • Robust and well-tested codebase, with a large and active community
  • Comprehensive documentation and support resources

Cons of ArduPilot

  • Larger and more complex codebase, which may be more challenging for new contributors
  • Potentially slower development cycle compared to more focused projects
  • May have a steeper learning curve for some users

Code Comparison

ArduPilot (ardupilot/ardupilot):

void Plane::update_navigation()
{
    // Altitude hold
    if (control_mode == FBWA || control_mode == CRUISE || control_mode == AUTOTUNE) {
        hold_alt_active = true;
        throttle_suppressed = false;
    } else {
        hold_alt_active = false;
        throttle_suppressed = true;
    }
}

iNavFlight (iNavFlight/inav):

void applyAltHold(void)
{
    if (altHoldState == ALT_HOLD_NORMAL) {
        // Normal alt hold
        rcCommand[THROTTLE] = constrain(rcCommand[THROTTLE], motorAndServoOutputEnabled ? rcLookupThrottle(rcData[THROTTLE]) : 0, motorAndServoOutputEnabled ? currentControlRateProfile->throttle.max : 0);
    } else if (altHoldState == ALT_HOLD_INITIALIZE) {
        // Initializing alt hold
        altHoldThrottleAdjustment = 0;
        altHoldState = ALT_HOLD_NORMAL;
    }
}

PX4 Autopilot Software

Pros of PX4/PX4-Autopilot

  • Comprehensive flight control system with support for a wide range of vehicles, including multirotor, fixed-wing, and VTOL aircraft.
  • Robust and well-documented codebase with a large and active community.
  • Extensive simulation and testing capabilities, including support for Gazebo and SITL (Software-In-The-Loop) simulation.

Cons of PX4/PX4-Autopilot

  • Steeper learning curve compared to iNavFlight/inav, especially for users new to autopilot systems.
  • Limited support for some specialized features, such as advanced FPV (First-Person View) functionality.
  • Larger codebase and more complex architecture, which may make it more challenging for some users to contribute or customize.

Code Comparison

PX4/PX4-Autopilot (Attitude Controller):

void AttitudeControl::updateActuatorControls(const matrix::Quatf &q, const matrix::Vector3f &rates, float dt)
{
    // Get current rotation matrix and rates
    matrix::Dcmf R = matrix::Dcmf(q);

    // Compute angular rate errors
    matrix::Vector3f rates_err = _rates_sp - rates;

    // Compute attitude error
    matrix::Vector3f att_err = R.transpose() * _att_sp.dcm().transpose();
    att_err = matrix::Vector3f(att_err(0), att_err(1), att_err(2));

    // Compute control
    _actuator_controls.control[0] = -_attitude_p(0) * att_err(0) - _attitude_d(0) * rates_err(0);
    _actuator_controls.control[1] = -_attitude_p(1) * att_err(1) - _attitude_d(1) * rates_err(1);
    _actuator_controls.control[2] = -_attitude_p(2) * att_err(2) - _attitude_d(2) * rates_err(2);
    _actuator_controls.control[3] = _thrust_sp;
}

iNavFlight/inav (Attitude Controller):

void FAST_CODE applyAndSaveAttitudeRatePID(void)
{
    // Apply PID setpoint to rate PID controllers
    pidApply(&pidLevel[ROLL], rcCommand[ROLL], gyroADC[ROLL]);
    pidApply(&pidLevel[PITCH], rcCommand[PITCH], gyroADC[PITCH]);
    pidApply(&pidLevel[YAW], rcCommand[YAW], gyroADC[YAW]);

    // Save attitude error to PID controllers
    pidLevel[ROLL].error = rcCommand[ROLL];
    pidLevel[PITCH].error = rcCommand[PITCH];
    pidLevel[YAW].error = rcCommand[YAW];
}

Clean-code version of the baseflight flight controller firmware

Pros of Cleanflight

  • Cleanflight has a larger user base and more active development, with more contributors and a more active community.
  • Cleanflight has a more user-friendly configuration interface and better documentation.
  • Cleanflight has a wider range of supported hardware and features, including more advanced flight modes and tuning options.

Cons of Cleanflight

  • Cleanflight has a more complex codebase and may be more difficult to understand and contribute to for new developers.
  • Cleanflight has a more aggressive development cycle, which can sometimes lead to stability issues or breaking changes.
  • Cleanflight's focus on advanced features may make it less suitable for users who just want a simple, reliable flight controller.

Code Comparison

Cleanflight:

void taskMainPidLoop(timeUs_t currentTimeUs)
{
    static uint32_t previousTime;
    bool runTaskMainPidLoop = false;

    if (currentTimeUs >= previousTime + (targetLooptime - TASK_PERIOD_HZ(1))) {
        previousTime = currentTimeUs;
        runTaskMainPidLoop = true;
    }

    if (runTaskMainPidLoop) {
        // Gyro
        getGyroData();
        // Acc
        getAccelerometerData();
        // Attitude
        updateAttitude(currentTimeUs);
        // Pid
        updatePids();
    }
}

iNav:

void taskMainPidLoop(timeUs_t currentTimeUs)
{
    static uint32_t previousTime;
    bool runTaskMainPidLoop = false;

    if (currentTimeUs >= previousTime + (targetLooptime - TASK_PERIOD_HZ(1))) {
        previousTime = currentTimeUs;
        runTaskMainPidLoop = true;
    }

    if (runTaskMainPidLoop) {
        // Gyro
        getGyroData();
        // Acc
        getAccelerometerData();
        // Attitude
        updateAttitude(currentTimeUs);
        // Pid
        updatePids();
        // Navigation
        updateNavigation(currentTimeUs);
    }
}

The main difference between the two codebases is the inclusion of the updateNavigation() function in the iNav version, which is responsible for handling navigation-related tasks such as waypoint following and altitude hold.

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

INAV - navigation capable flight controller

F411 PSA

INAV no longer accepts targets based on STM32 F411 MCU.

INAV 7 was the last INAV official release available for F411 based flight controllers. INAV 8 is not officially available for F411 boards and the team has not tested either. Issues that can't be reproduced on other MCUs may not be fixed and the targets for F411 targets may eventually be completelly removed from future releases.

ICM426xx IMUs PSA

The filtering settings for the ICM426xx has changed to match what is used by Ardupilot and Betaflight in INAV 7.1. When upgrading from older versions you may need to recalibrate the Accelerometer and if you are not using INAV's default tune you may also want to check if the tune is still good.

M7, M6 and older UBLOX GPS units PSA

INAV 8.0 will mark those GPS as deprecated and INAV 9.0.0 will require UBLOX units with Protocol version 15.00 or newer. This means that you need a GPS unit based on UBLOX M8 or newer.

If you want to check the protocol version of your unit, it is displayed in INAV's 7.0.0+ status cli command. INAV 8.0.0 will warn you if your GPS is too old. GPS: HW Version: Unknown Proto: 0.00 Baud: 115200 (UBLOX Proto >= 15.0 required)

M8, M9 and M10 GPS are the most common units in use today, are readly available and have similar capabilities. Mantaining and testing GPS changes across this many UBLOX versions is a challenge and takes a lot of time. Removing the support for older devices will simplify code.

INAV

PosHold, Navigation and RTH without compass PSA

Attention all drone pilots and enthusiasts,

Are you ready to take your flights to new heights with INAV 7.1? We've got some important information to share with you.

INAV 7.1 brings an exciting update to navigation capabilities. Now, you can soar through the skies, navigate waypoints, and even return to home without relying on a compass. Yes, you heard that right! But before you launch into the air, there's something crucial to consider.

While INAV 7.1 may not require a compass for basic navigation functions, we strongly advise you to install one for optimal flight performance. Here's why:

🛰️ Better Flight Precision: A compass provides essential data for accurate navigation, ensuring smoother and more precise flight paths.

🌐 Enhanced Reliability: With a compass onboard, your drone can maintain stability even in challenging environments, low speeds and strong wind.

🚀 Minimize Risks: Although INAV 7.1 can get you where you need to go without a compass, flying without one may result in a bumpier ride and increased risk of drift or inaccurate positioning.

Remember, safety and efficiency are paramount when operating drones. By installing a compass, you're not just enhancing your flight experience, but also prioritizing safety for yourself and those around you.

So, before you take off on your next adventure, make sure to equip your drone with a compass. It's the smart choice for smoother flights and better navigation.

Fly safe, fly smart with INAV 7.1 and a compass by your side!

INAV Community

Features

  • Runs on the most popular F4, AT32, F7 and H7 flight controllers
  • On Screen Display (OSD) - both character and pixel style
  • DJI OSD integration: all elements, system messages and warnings
  • Outstanding performance out of the box
  • Position Hold, Altitude Hold, Return To Home and Waypoint Missions
  • Excellent support for fixed wing UAVs: airplanes, flying wings
  • Blackbox flight recorder logging
  • Advanced gyro filtering
  • Fully configurable mixer that allows to run any hardware you want: multirotor, fixed wing, rovers, boats and other experimental devices
  • Multiple sensor support: GPS, Pitot tube, sonar, lidar, temperature, ESC with BlHeli_32 telemetry
  • Logic Conditions, Global Functions and Global Variables: you can program INAV with a GUI
  • SmartAudio and IRC Tramp VTX support
  • Telemetry: SmartPort, FPort, MAVlink, LTM, CRSF
  • Multi-color RGB LED Strip support
  • And many more!

For a list of features, changes and some discussion please review consult the releases page and the documentation.

Tools

INAV Configurator

Official tool for INAV can be downloaded here. It can be run on Windows, MacOS and Linux machines and standalone application.

INAV Blackbox Explorer

Tool for Blackbox logs analysis is available here

INAV Blackbox Tools

Command line tools (blackbox_decode, blackbox_render) for Blackbox log conversion and analysis here.

Telemetry screen for EdgeTX and OpenTX

Users of EdgeTX and OpenTX radios (Taranis, Horus, Jumper, Radiomaster, Nirvana) can use INAV OpenTX Telemetry Widget screen. Software and installation instruction are available here: https://github.com/iNavFlight/OpenTX-Telemetry-Widget

OSD layout Copy, Move, or Replace helper tool

Easy INAV OSD switcher tool allows you to easily switch your OSD layouts around in INAV. Choose the from and to OSD layouts, and the method of transfering the layouts.

Installation

See: https://github.com/iNavFlight/inav/blob/master/docs/Installation.md

Documentation, support and learning resources

Contributing

Contributions are welcome and encouraged. You can contribute in many ways:

  • Documentation updates and corrections.
  • How-To guides - received help? help others!
  • Bug fixes.
  • New features.
  • Telling us your ideas and suggestions.
  • Buying your hardware from this link

A good place to start is the Discord channel, Telegram channel or Facebook group. Drop in, say hi.

Github issue tracker is a good place to search for existing issues or report a new bug/feature request:

https://github.com/iNavFlight/inav/issues

https://github.com/iNavFlight/inav-configurator/issues

Before creating new issues please check to see if there is an existing one, search first otherwise you waste peoples time when they could be coding instead!

Developers

Please refer to the development section in the docs/development folder.

Nightly builds are available for testing on the following links:

https://github.com/iNavFlight/inav-nightly/releases

https://github.com/iNavFlight/inav-configurator-nightly/releases

INAV Releases

https://github.com/iNavFlight/inav/releases