{"id":23911890,"url":"https://github.com/keshav11-coder/dronev2","last_synced_at":"2026-07-13T07:31:24.703Z","repository":{"id":270624422,"uuid":"867309058","full_name":"Keshav11-coder/dronev2","owner":"Keshav11-coder","description":"An ESP32 drone library designed to simplify the coding and customization process of drone programming. Its extensibility and modular design make it worth trying. This library was inspired by the modular nature of the IoTDroneFirmware project but has been rewritten for a cleaner syntax and easier interfacing.","archived":false,"fork":false,"pushed_at":"2025-01-01T22:58:34.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"archive-v1.0.1","last_synced_at":"2025-01-01T23:24:21.431Z","etag":null,"topics":["cpp11","drone","dronekit"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Keshav11-coder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-03T20:22:42.000Z","updated_at":"2024-10-06T02:20:46.000Z","dependencies_parsed_at":"2025-01-01T23:24:27.418Z","dependency_job_id":"5fb747e7-705f-4ad5-8d5c-c74769619ffd","html_url":"https://github.com/Keshav11-coder/dronev2","commit_stats":null,"previous_names":["keshav11-coder/dronev2"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keshav11-coder%2Fdronev2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keshav11-coder%2Fdronev2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keshav11-coder%2Fdronev2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Keshav11-coder%2Fdronev2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Keshav11-coder","download_url":"https://codeload.github.com/Keshav11-coder/dronev2/tar.gz/refs/heads/archive-v1.0.1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240349933,"owners_count":19787584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp11","drone","dronekit"],"created_at":"2025-01-05T08:32:15.582Z","updated_at":"2025-10-27T07:13:11.786Z","avatar_url":"https://github.com/Keshav11-coder.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![License](https://img.shields.io/github/license/Keshav11-coder/dronev2?label=license)\n![GitHub issues](https://img.shields.io/github/issues/Keshav11-coder/dronev2)\n![GitHub release](https://img.shields.io/github/v/release/Keshav11-coder/dronev2)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/m/Keshav11-coder/dronev2)\n\n# Table of Contents\n1. [License](https://github.com/Keshav11-coder/dronev2?tab=MIT-1-ov-file)\n2. [Release Information](#release-information)\n    - [Basic Features](#basic)\n    - [More Advanced Features](#more-advanced)\n    - [The Drone Class](#the-drone-class)\n3. [Setup \u0026 Usage](#dronev2-setup--usage)\n    - [Installation in the Arduino IDE](#installation-in-the-arduino-ide)\n    - [Get Started](#get-started)\n    - [Declare Your Drone Instance](#declare-your-drone-instance)\n    - [Initialize Your Drone](#initialize-your-drone)\n4. [Using the Built-in PID System](#using-the-built-in-pid-system)\n    - [Make Your PID Instance](#make-your-pid-instance)\n    - [Execute the PID System](#execute-the-pid-system)\n    - [Adjust PID Values Runtime](#adjust-pid-values-runtime)\n5. [Tasking \u0026 Threading](#tasking--threading)\n    - [The Default Thread](#the-default-thread)\n    - [Basic Usage](#basic-usage)\n    - [Combining Tasks](#combining-tasks)\n\n# `dronev2` *Modular release* - v1.0.1\n`dronev2`, a drone interfacing library which aims to improve the way we program drones. The library features a modular and structural design, making it easier for new developers to start programming their drones. \n\nThe library does not only focus on drone programming, but also offers a fairly simple tasking/scheduling system which could be useful in new projects.\n\nWe finally decided to split the main codebase which originally consisted of `dronev2.h` and `dronev2.cpp` into multiple parts with their respective classes or structs. All modules still stay under the namespace `dronev2` to have most previous codebases still working after this change.\n\nThe library is licensed under the MIT license. This was chosen over the other open-source licenses because we offer functionality. If you're here for something specific, you can take that.\n\nBe on the lookout for future versions that introduce more modules! \n\n## Release information\nThis release splits the library into multiple different modules for easy interfacing and to have a more straightforward modular design.\n\n### Basic \n- **Motors** (*`struct`* `motor`): A pretty basic motor class that allows you to do basic arming and writing. It also includes a built-in `failsafe` system.\n- **PID systems** (*`struct`* `pid`): A fairly simple PID system that allows for basic functions such as `run`, `adjust` (modifying values) and `reset`.\n\n### More advanced\n- **Tasks** (*`class`* `task`): This is part of a modular system. It is a singular task that belongs to a thread, or can be executed individually if you prefer it like that. It includes a built-in `interval` system for periodic execution. The only downside is that this system needs its execution to happen inside of an existing loop, requiring a bit more handling in the functions. The given function can also be `lambda`, because it uses `std::function`.\n- **Threads** (*`class`* `thread`): Requires `task` to operate. This is basically a collection of scheduled tasks. It offers some basic threading functions, such as `add_task`, `remove_task`, `update_task_interval` (for more advanced systems), `clear` and also requires the function `run` to be executed continuously in a loop. Aside from that it allows you to initialize the thread instance with default tasks inside the constructor. This is managed by a variadic template so it can be any amount.\n- **Threads for pointers** (*`class`* `thread_ptr`): Almost the same as `thread`, but instead of task objects it requires task pointer objects. This is used in the `drone` class' main thread.\n### The drone class\n- *`class`* `drone`: The base class for the drone. It combines most of the previous functionalities into one. The setup is pretty simple: you declare the object, and then specify your `motors`, (optional) `stabilization` \u0026 `imu` in the chain. See the API usage in code blocks below for a more detailed reference.\n\n# `dronev2` Setup \u0026 usage\nHere I explain in detailed code blocks the basic functionalities of `dronev2`.\n\u003e [!NOTE]\n\u003e This is a very simple documentation. Consider checking out the examples for a more detailed description.\n\n\n## Installation in the Arduino IDE\nThe installation of this library is simple. Like any other zip library, download the zip of this repository and add it using the `add .ZIP library` functionality in sketch \u003e include library \u003e add .ZIP library.\n\n## Get started\nTo get started, include the library like this:\n```cpp\n#include \u003cdronev2.h\u003e\n```\n\n\n\u003e [!TIP]\n\u003e If you don't constantly want to use `dronev2::` in front of each method, try including the namespace as whole:\n\u003e ```cpp\n\u003e using namespace dronev2;\n\u003e ```\n\n\n### Declare your drone instance\n```cpp\ndronev2::drone quadcopter;\n```\n\n### Initialize your drone\n```cpp\nvoid setup() {\n   quadcopter\n      \n      // Set up your motors (pin, min, max)\n      .motors(\n         new dronev2::motor(4, 1000, 2000),\n         new dronev2::motor(5, 1000, 2000),\n         new dronev2::motor(15, 1000, 2000),\n         new dronev2::motor(16, 1000, 2000)\n      )\n      \n      // Set up your stabilization\n      .stabilization([](dronev2::imu_data_packaged imu_data) {\n         // Do something with imu_data\n      }, 5) // Small stabilization rate.\n      \n      // Set up your imu (sda, scl)\n      .imu(19, 23);\n}\n\nvoid loop() { } // Empty for now.\n```\n\n\n## Using the `pid` system\n### Make your PID instance\n```cpp\ndronev2::pid pid1({3.55, 0.005, 0.0001}); // accepts an std::vector\u003cfloat\u003e.\n```\n\n### Execute the PID system\n```cpp\nvoid loop() {\n   float actual = 78; // Use actual value here.\n   float target = 0; // Use actual target here.\n   pid1.run(actual, target);\n}\n```\n\n### Adjust PID values runtime\n```cpp\nvoid loop() {\n   pid1.adjust({1, 2, 3}); // Accepts an std::vector\u003cfloat\u003e. Use actual values here.\n```\n\n## Tasking \u0026 Threading\nFor this system you can either use the built-in drone thread, or a custom thread.\n\n### The default thread\nThe default thread is defined in an instance of `dronev2::drone`, with wrapper functions in the `drone` class to protect the `thread` object inside.\n\n\u003e [!IMPORTANT]\n\u003e I suggest checking out one of the guided examples to get a better grasp of the tasking system.\n\n### Basic usage\n```cpp\n// Creating an instance\ndronev2::task task1([]() {\n   // Code in here gets executed every 1 second.\n}, 1000); // 1 second interval\n\nvoid loop() {\n   // Make sure to add the execute code inside a loop.\n   task1.execute(); // Will be executed every 1 second.\n}\n```\n\n### Combining tasks\n```cpp\n// Creating tasks\ndronev2::task task1([]() {\n   // Code in here gets executed every 1 second.\n}, 1000); // 1 second interval\n\ndronev2::task task2([]() {\n   // Code in here gets executed every 200 milliseconds.\n}, 200); // 0.2 second interval\n\n// Add multiple tasks together with a thread\ndronev2::thread thread1(task1);\n\n// You can also add them later.\nthread1.add_task(task2);\n\nvoid loop() {\n   // Make sure to add the execute code inside a loop.\n   thread1.run();\n}\n```\n\u003e [!NOTE]\n\u003e The `thread_ptr` class does the same as thread, but then accepts all tasks as pointers only. This might be useful for more compact initialization, or when doing task switching.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeshav11-coder%2Fdronev2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeshav11-coder%2Fdronev2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeshav11-coder%2Fdronev2/lists"}