Skip to main content

Fields2Cover logo

Robust and efficient coverage paths for autonomous agricultural vehicles

DocumentationInstallationQuick StartTutorialsAPIPaper

build coverage PyPI license DOI

Fields2Cover is an open-source C++ library with Python bindings that solves the Coverage Path Planning problem for agriculture: given a field and a vehicle, it computes a complete coverage path — headlands, swaths, an optimized route, and a drivable path with feasible turns. It also provides a common, extensible framework to implement and compare coverage path planning algorithms, so researchers don't have to re-implement every algorithm they want to compare against. The API is still evolving, so expect occasional breaking changes between releases.

Fields2Cover module diagram

Core features

  • Modular pipeline: headland generation, swath generation, route planning and path planning as interchangeable modules — or a single call to planCovPath.
  • Non-convex fields and obstacles, handled by trapezoidal and boustrophedon decomposition.
  • Route optimization with OR-tools, plus classic patterns like boustrophedon, snake and spiral.
  • Kinematically feasible turns using Dubins and Reeds-Shepp curves, with or without continuous curvature.
  • C++17 core, Python bindings, and a ROS 2 integration via opennav_coverage.

Quick Start

Fields2Cover builds on GDAL, GEOS and OR-tools, which need to be installed first (details in the installation guide):

# Ubuntu
sudo apt install build-essential libgdal-dev libgeos-dev libeigen3-dev libboost-dev \
     libtbb-dev libtinyxml2-dev nlohmann-json3-dev libpython3-dev gnuplot
# plus OR-tools for C++: https://developers.google.com/optimization/install/cpp

# macOS
brew install gdal geos or-tools tinyxml2 eigen tbb boost gnuplot

C++

#include "fields2cover.h"

int main() {
  F2CField field = f2c::Parser::importFieldGml("data/test1.xml");
  F2CRobot robot(2.0, 6.0, 0.5, 0.2);

  F2CPath path = f2c::planCovPath(robot, field, false);

  f2c::Visualizer::figure();
  f2c::Visualizer::plot(field.getCellsAbsPosition());
  f2c::Visualizer::plot(path);
  f2c::Visualizer::show();
  return 0;
}
find_package(Fields2Cover REQUIRED)
target_link_libraries(<your_target> Fields2Cover)

Python

pip install fields2cover
import fields2cover as f2c

field = f2c.Parser().importFieldGml("data/test1.xml")
robot = f2c.Robot(2.0, 6.0, 0.5, 0.2)

path = f2c.planCovPath(robot, field, False)

f2c.Visualizer.figure()
f2c.Visualizer.plot(field.getCellsAbsPosition())
f2c.Visualizer.plot(path)
f2c.Visualizer.show()

Installation

  • Python: pip install fields2cover — the package is built from source on your machine, so the system dependencies above must be installed.
  • C++ / from source: clone this repository and build with CMake — full walkthrough in the installation guide.
  • ROS 2: see opennav_coverage, a Nav2-compatible coverage task server built on Fields2Cover.

Documentation

The extended documentation lives at fields2cover.github.io:

Contributing

If you find an issue, a bug or have a proposal, open an issue. Pull requests are more than welcome; for major changes, please open an issue first to discuss what you would like to change, and make sure to update tests as appropriate. A one-click development environment is available:

Open in GitHub Codespaces

Citing

Please cite this paper when using Fields2Cover for your research:

@article{Mier_Fields2Cover_An_open-source_2023,
  author={Mier, Gonzalo and Valente, João and de Bruin, Sytze},
  journal={IEEE Robotics and Automation Letters},
  title={Fields2Cover: An Open-Source Coverage Path Planning Library for Unmanned Agricultural Vehicles},
  year={2023},
  volume={8},
  number={4},
  pages={2166-2172},
  doi={10.1109/LRA.2023.3248439}
}

License & credits

Fields2Cover is released under the BSD-3 license. It stands on the shoulders of GDAL, OR-tools, steering_functions, nlohmann/json, tinyxml2, CubicSplineClass and matplotplusplus. The project is (partly) financed by the Dutch Research Council (NWO).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fields2cover-2.1.0.tar.gz (110.4 kB view details)

Uploaded Source

File details

Details for the file fields2cover-2.1.0.tar.gz.

File metadata

  • Download URL: fields2cover-2.1.0.tar.gz
  • Upload date:
  • Size: 110.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fields2cover-2.1.0.tar.gz
Algorithm Hash digest
SHA256 756ed60234dd9b0b1ba19d3cf4f8e1ade18744754bba548c3742b2c30a37e640
MD5 5cf26d7d00ee5b675ca247d04a681c4c
BLAKE2b-256 9d3d48c8a6da510ec222bc560be44d2c164d704ec8c706a1a1505d99c1fd9a40

See more details on using hashes here.

Provenance

The following attestation bundles were made for fields2cover-2.1.0.tar.gz:

Publisher: pypi.yml on Fields2Cover/Fields2Cover

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.1.0 This release

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page