Asv.Mavlink
3.7.0-alpha01
See the version list below for details.
dotnet add package Asv.Mavlink --version 3.7.0-alpha01
NuGet\Install-Package Asv.Mavlink -Version 3.7.0-alpha01
<PackageReference Include="Asv.Mavlink" Version="3.7.0-alpha01" />
paket add Asv.Mavlink --version 3.7.0-alpha01
#r "nuget: Asv.Mavlink, 3.7.0-alpha01"
// Install Asv.Mavlink as a Cake Addin #addin nuget:?package=Asv.Mavlink&version=3.7.0-alpha01&prerelease // Install Asv.Mavlink as a Cake Tool #tool nuget:?package=Asv.Mavlink&version=3.7.0-alpha01&prerelease
Asv.Mavlink
1. Introduction
asv-mavlink library that provides tools for UAV control, that support MAVLink protocol.
Mavlink library for .NET 6.0, .NET 7.0 (support MAVLinkV2 packets)
Code gen
Generate C# code for packet serialization\deserialization
Asv.Mavlink.Shell.exe gen -t=all.xml -i=messages -o=src/Asv.Mavlink/Connection/Dialects -e=cs src/Asv.Mavlink.Shell/Resources/csharp.tpl
You can create your own code generator for any language by writing template file (.tpl) with liquid syntax
Example console application
Example packet statistic:
Asv.Mavlink.Shell.exe mavlink --cs=tcp://127.0.0.1:5760
2. Getting Started
Setting Up the Development Environment
To ensure a smooth development experience, follow the steps below to set up your development environment:
2.1 Prerequisites:
- Operating System: This project is compatible with Windows, macOS, and Linux. Ensure that your development machine runs one of these supported operating systems.
- IDE (Integrated Development Environment): We recommend using Visual Studio or JetBrains Rider as your IDE for C# development. Make sure to install the necessary extensions and plugins for a better development experience.
2.2 .NET 7 Installation:
This project is built using .NET 7, the latest version of the .NET platform. Install .NET 7 by following the instructions provided on the official .NET website.
# Check your current .NET version dotnet --version
2.3 Version Control:
- If you haven't already, install a version control system such as Git to track changes and collaborate with other developers.
2.4 Clone the Repository:
Clone the project repository to your local machine using the following command:
git clone https://github.com/asv-soft/asv-mavlink.git
2.5 Restore Dependencies:
Navigate to the project directory and restore the required dependencies using the following command:
cd asv-mavlink dotnet restore
2.6 Open in IDE:
Open the project in your preferred IDE. For Visual Studio Code, you can open the project by typing:
code .
2.7 Build and Run:
Build the project to ensure that everything is set up correctly:
dotnet build
Run the project
dotnet run
Congratulations! Your development environment is now set up, and you are ready to start contributing to the project. If you encounter any issues during the setup process, refer to the project's documentation or reach out to the development team for assistance.
3. Code Structure
The organization of the codebase plays a crucial role in maintaining a clean, scalable, and easily understandable project. This section outlines the structure of our codebase, highlighting key directories and their purposes.
3.1 Solution Organization
Our solution is organized the following way:
sln/
: This directory contains the source code of the application. The code is further organized into projects, each residing in its own subdirectory. The goal is to promote modularity and maintainability.sln/ ├── Asv.Mavlink.sln ├── Asv.Mavlink.Shell/ | ├── Adsb/ | ├── Tests/ | ├── Tool/ | ├── CodeGen/ | ├── Resources/ | ├── Benchmark/ | ├── Properties/ | └── ... ├──Asv.Mavlink.Test | ├── Microservices/ | ├── Tools/ | ├── Devices/Base/ | └── ... └──Asv.Mavlink/ ├── Microservices/ ├── Devices/ ├── Protocol/ ├── Tools/ └── ...
3.2 Naming Conventions
Consistent naming conventions are essential for code readability. Throughout the codebase, we follow the guidelines outlined in our documentation
These conventions contribute to a unified and coherent codebase.
By adhering to this organized structure and naming conventions, we aim to create a codebase that is easy to navigate, scalable, and conducive to collaboration among developers.
4. Coding Style
Maintaining a consistent coding style across the project enhances readability, reduces errors, and facilitates collaboration. The following guidelines outline our preferred coding style for C#:
4.1 C# Coding Style
4.1.1 Formatting
Indentation: Use tabs for indentation. Each level of indentation should consist of one tab.
Brace Placement: Place opening braces on the same line as the statement they belong to, and closing braces on a new line.
// Good if (condition) { // Code here } // Bad if (condition) { // Code here }
4.1.2 Naming Conventions
Pascal Case: Use Pascal case for class names, method names, and property names.
public class MyClass { public void MyMethod() { // Code here } public int MyProperty { get; set; } }
4.1.3 Language Features
Expression-bodied Members: Utilize expression-bodied members for concise one-liners.
// Good public int CalculateSquare(int x) => x * x; // Bad public int CalculateSquare(int x) { return x * x; }
Null Conditional Operator: Use the null conditional operator (
?.
) for safe property or method access.// Good int? length = text?.Length; // Bad int length = (text != null) ? text.Length : 0;
4.2 Documentation
4.2.1 Comments
XML Documentation: Include XML comments for classes, methods, and properties to provide comprehensive documentation.
/// <summary> /// Represents a sample class. /// </summary> public class SampleClass { /// <summary> /// Calculates the sum of two numbers. /// </summary> /// <param name="a">The first number.</param> /// <param name="b">The second number.</param> /// <returns>The sum of the two numbers.</returns> public int Add(int a, int b) { // Code here } }
4.2.2 Code Comments
- Use comments sparingly and focus on explaining complex or non-intuitive code sections.
By adhering to these coding style guidelines, we aim to create code that is easy to read, understand, and maintain.
5. Version Control
Version control is a fundamental aspect of our development process, providing a systematic way to track changes, collaborate with team members, and manage the evolution of our codebase. We utilize Git as our version control system.
5.1 Branching Strategy
5.1.1 Feature Branches
For each new feature or bug fix, create a dedicated feature branch. The branch name should be descriptive of the feature or issue it addresses.
# Example: Creating a new feature branch
git checkout -b feature/my-new-feature
5.1.2 Hotfix Branches
In case of critical issues in the production environment, create a hotfix branch. This allows for a quick resolution without affecting the main development branch.
# Example: Creating a hotfix branch
git checkout -b hotfix/1.0.1
5.2 Commit Messages
Write clear and concise commit messages that convey the purpose of the change. Follow these guidelines:
- Start with a verb in the imperative mood (e.g., "Add," "Fix," "Update").
- Keep messages short but descriptive.
Example:
# Good
git commit -m "Add user authentication feature"
# Bad
git commit -m "Updated stuff"
5.3 Pull Requests
Before merging changes into the main branch, create a pull request (PR). This allows for code review and ensures that changes adhere to coding standards.
- Assign reviewers to the PR.
- Include a clear description of the changes.
- Ensure that automated tests pass before merging.
5.4 Merging Strategy
Adopt a merging strategy based on the nature of the changes:
- Feature Branches: Merge feature branches into the main branch after code review and approval.
- Release Branches: Merge release branches into the main branch and tag the commit for the release.
# Example: Merging a feature branch
git checkout main
git merge --no-ff feature/my-new-feature
5.5 Repository Hosting
Our Git repository is hosted on GitHub. Ensure that you have the necessary permissions and follow best practices for repository management.
By following these version control practices, we aim to maintain a well-organized and collaborative development process.
6. Build and Deployment
The build and deployment processes are crucial components of our development workflow. This section outlines the steps for building the project and deploying it using GitHub Releases.
6.1 Build Process
To compile the project, use the following command:
dotnet build
This command compiles the code and produces executable binaries.
6.2 Deployment using GitHub Releases
Our application is deployed using GitHub Releases.
Latest release can be found here.
7. Contributing
We welcome contributions from the community to help enhance and improve our project. Before contributing, please take a moment to review this guide.
7.1 Code Reviews
All code changes undergo a review process to ensure quality and consistency. Here are the steps to follow:
Fork the Repository: Start by forking the repository to your own GitHub account.
Create a Feature Branch: Create a new branch for your feature or bug fix.
git checkout -b feature/my-feature
Commit Changes: Make your changes, commit them with clear and concise messages, and push the branch to your forked repository.
git commit -m "Add new feature" git push origin feature/my-feature
Open a Pull Request (PR): Submit a pull request to the main repository, detailing the changes made and any relevant information. Ensure your PR adheres to the established coding standards.
Code Review: Participate in the code review process by responding to feedback and making necessary adjustments. Addressing comments promptly helps streamline the review process.
Merge: Once the code review is complete and the changes are approved, your pull request will be merged into the main branch.
7.2 Submitting Changes
Before submitting changes, ensure the following:
Coding Standards: Adhere to the coding standards and guidelines outlined in this document.
Tests: If applicable, include tests for your changes and ensure that existing tests pass.
Documentation: Update relevant documentation, including code comments and external documentation, to reflect your changes.
7.3 Communication
For larger changes or feature additions, it's beneficial to discuss the proposed changes beforehand. Engage with the community through:
Opening an Issue: Discuss your proposed changes by opening an issue. This provides an opportunity for community input before investing significant time in development.
Joining Discussions: Participate in existing discussions related to the project. Your insights and feedback are valuable.
7.4 Contributor License Agreement (CLA)
By contributing to this project, you agree that your contributions will be licensed under the project's license. If a Contributor License Agreement (CLA) is required, it will be provided in the repository.
We appreciate your contributions, and together we can make this project even better!
8. Code Documentation
Clear and comprehensive code documentation is essential for ensuring that developers can easily understand, use, and contribute to the project. Follow these guidelines for documenting your code:
8.1 Inline Comments
Use inline comments to explain specific sections of your code, especially for complex logic or non-intuitive implementations. Follow these principles:
Clarity: Write comments that enhance code comprehension. If a piece of code is not self-explanatory, provide comments explaining the reasoning or intention.
Conciseness: Keep comments concise and to the point. Avoid unnecessary comments that do not add value.
Update Comments: Regularly review and update comments to reflect any changes in the code. Outdated comments can be misleading.
Example:
// Calculate the sum of two numbers
int CalculateSum(int a, int b)
{
return a + b;
}
8.2 XML Documentation
For classes, methods, properties, and other significant code elements, use XML documentation comments to provide comprehensive information. Follow these guidelines:
Summary: Provide a summary that succinctly describes the purpose of the class or member.
Parameters: Document each parameter, specifying its purpose and any constraints.
Returns: If applicable, document the return value and its significance.
Examples: Include examples that demonstrate how to use the class or member.
Example:
/// <summary>
/// Represents a utility class for mathematical operations.
/// </summary>
public class MathUtility
{
/// <summary>
/// Calculates the sum of two numbers.
/// </summary>
/// <param name="a">The first number.</param>
/// <param name="b">The second number.</param>
/// <returns>The sum of the two numbers.</returns>
public int CalculateSum(int a, int b)
{
return a + b;
}
}
8.3 Consistency
Ensure consistency in your documentation style across the codebase. Consistent documentation makes it easier for developers to navigate and understand the project.
By following these documentation guidelines, we aim to create a codebase that is not only functional but also accessible and easily maintainable for all contributors.
9. Security
Ensuring the security of our software is paramount to maintaining the integrity and confidentiality of user data. Developers should adhere to best practices and follow guidelines outlined in this section.
9.1 Code Security Practices
9.1.1 Input Validation
Always validate and sanitize user input to prevent injection attacks and ensure the integrity of your application.
// Example for C#
public ActionResult ProcessUserInput(string userInput)
{
if (string.IsNullOrWhiteSpace(userInput))
{
// Handle invalid input
}
// Process input
}
9.1.2 Authentication and Authorization
Implement secure authentication and authorization mechanisms to control access to sensitive functionalities and data. Leverage industry-standard protocols like OAuth when applicable.
9.1.3 Secure Communication
Ensure that communication between components, APIs, and external services is encrypted using secure protocols (e.g., HTTPS).
9.2 Dependency Security
9.2.1 Dependency Scanning
Regularly scan and update dependencies to identify and address security vulnerabilities. Leverage tools and services that provide automated dependency analysis.
9.2.2 Minimal Dependencies
Keep dependencies to a minimum and only include libraries and packages that are actively maintained and have a good security track record.
9.3 Data Protection
9.3.1 Encryption
Sensitive data, both at rest and in transit, should be encrypted. Utilize strong encryption algorithms and ensure proper key management.
9.3.2 Data Backups
Implement regular data backup procedures to prevent data loss in the event of security incidents or system failures.
9.4 Secure Coding Standards
Adhere to secure coding standards to mitigate common vulnerabilities. Follow principles such as the OWASP Top Ten to address security concerns in your codebase.
9.5 Reporting Security Issues
If you discover a security vulnerability or have concerns about the security of the project, please report it immediately to our team at our telegram channel. Do not disclose security-related issues publicly until they have been addressed.
9.6 Security Training
Encourage ongoing security training for all team members to stay informed about the latest security threats and best practices. Knowledgeable developers are key to maintaining a secure codebase.
By incorporating security practices into our development process, we aim to create a robust and secure software environment for our users.
10. License
This project is licensed under the terms of the MIT License. A copy of the MIT License is provided in the LICENSE file.
MIT License
MIT License
Copyright (c) 2023 Asv Soft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Using the MIT License
The MIT License is a permissive open-source license that allows for the free use, modification, and distribution of the software. It is important to review and understand the terms of the license before using, contributing to, or distributing this software.
By contributing to this project, you agree that your contributions will be licensed under the MIT License.
For more details about the MIT License, please visit opensource.org/licenses/MIT.
11. Contact
If you have questions, suggestions, or need assistance with the project, we encourage you to reach out through the following channels:
11.1 Telegram Channel
Visit our Telegram channel: ASVSoft on Telegram
Feel free to join our Telegram community to engage in discussions, seek help, or share your insights.
11.2 GitHub Issues
For bug reports, feature requests, or any project-related discussions, please use our GitHub Issues:
Our GitHub repository is the central hub for project-related discussions and issue tracking. Please check existing issues before creating new ones to avoid duplication.
11.3 Security Concerns
If you discover a security vulnerability or have concerns about the security of the project, please report it immediately to our telegram channel: ASVSoft on Telegram. Do not disclose security-related issues publicly until they have been addressed.
11.4 General Inquiries
For general inquiries or if you prefer email communication, you can reach us at me@asv.me.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Asv.Cfg (>= 1.13.1)
- Asv.Common (>= 1.13.1)
- Asv.IO (>= 1.13.1)
- DynamicData (>= 7.13.5)
- Geodesy (>= 4.1.0)
- NLog (>= 5.2.6)
- System.Reactive (>= 5.0.0)
-
net7.0
- Asv.Cfg (>= 1.13.1)
- Asv.Common (>= 1.13.1)
- Asv.IO (>= 1.13.1)
- DynamicData (>= 7.13.5)
- Geodesy (>= 4.1.0)
- NLog (>= 5.2.6)
- System.Reactive (>= 5.0.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Asv.Mavlink:
Package | Downloads |
---|---|
Asv.Mavlink.Vehicle
Mavlink library for .NET 6.0, .NET 7.0 for vehicle control Px4, Ardupilot |
|
Asv.Mavlink.Payload
Mavlink library for .NET 6.0, .NET 7.0 for vehicle control Px4, Ardupilot |
|
Asv.Mavlink.Gbs
Mavlink library for .NET 6.0, .NET 7.0 for controlling ground base station with RTK support |
|
Asv.Mavlink.Sdr
Mavlink library for .NET 6.0, .NET 7.0 for controlling SDR payload |
|
Asv.Drones.Gui.Api
API reference for Asv.Drones GUI application |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on Asv.Mavlink:
Repository | Stars |
---|---|
asv-soft/asv-drones
Open source implementation of ground control station application for ArduPilot and PX4 autopilot
|
Version | Downloads | Last updated |
---|---|---|
3.10.5 | 80 | 12/7/2024 |
3.10.3 | 264 | 8/20/2024 |
3.10.2 | 207 | 7/5/2024 |
3.10.0 | 343 | 7/3/2024 |
3.9.2 | 193 | 6/19/2024 |
3.9.1 | 116 | 6/16/2024 |
3.9.0 | 136 | 6/10/2024 |
3.8.0-alpha06 | 193 | 5/14/2024 |
3.8.0-alpha05 | 89 | 5/14/2024 |
3.8.0-alpha03 | 82 | 5/13/2024 |
3.8.0-alpha02 | 64 | 5/2/2024 |
3.8.0-alpha01 | 121 | 4/17/2024 |
3.7.1 | 223 | 3/26/2024 |
3.7.0 | 156 | 3/2/2024 |
3.7.0-alpha02 | 244 | 1/19/2024 |
3.7.0-alpha01 | 104 | 1/8/2024 |
3.6.0-alpha13 | 132 | 12/29/2023 |
3.6.0-alpha12 | 150 | 12/18/2023 |
3.6.0-alpha11 | 230 | 12/7/2023 |
3.6.0-alpha10 | 102 | 12/7/2023 |
3.6.0-alpha09 | 113 | 12/6/2023 |
3.6.0-alpha08 | 221 | 11/28/2023 |
3.6.0-alpha07 | 156 | 11/22/2023 |
3.6.0-alpha06 | 114 | 11/21/2023 |
3.6.0-alpha05 | 110 | 11/21/2023 |
3.6.0-alpha04 | 95 | 11/20/2023 |
3.6.0-alpha03 | 91 | 11/20/2023 |
3.6.0-alpha02 | 99 | 11/20/2023 |
3.6.0-alpha01 | 101 | 11/20/2023 |
3.5.0-alpha10 | 126 | 11/14/2023 |
3.5.0-alpha09 | 105 | 11/14/2023 |
3.5.0-alpha08 | 99 | 11/13/2023 |
3.5.0-alpha07 | 99 | 11/13/2023 |
3.5.0-alpha06 | 100 | 11/8/2023 |
3.5.0-alpha05 | 101 | 11/8/2023 |
3.5.0-alpha04 | 104 | 11/8/2023 |
3.5.0-alpha03 | 114 | 11/6/2023 |
3.5.0-alpha02 | 122 | 11/4/2023 |
3.5.0-alpha01 | 115 | 11/4/2023 |
3.4.2-alpha11 | 132 | 10/25/2023 |
3.4.2-alpha10 | 148 | 10/7/2023 |
3.4.2-alpha09 | 121 | 10/7/2023 |
3.4.2-alpha08 | 124 | 10/7/2023 |
3.4.2-alpha07 | 122 | 10/5/2023 |
3.4.2-alpha06 | 119 | 10/5/2023 |
3.4.2-alpha05 | 122 | 10/5/2023 |
3.4.2-alpha04 | 112 | 10/5/2023 |
3.4.2-alpha03 | 115 | 10/4/2023 |
3.4.2-alpha02 | 117 | 10/4/2023 |
3.4.2-alpha01 | 119 | 10/3/2023 |
3.4.1 | 299 | 9/30/2023 |
3.4.0 | 157 | 9/30/2023 |
3.3.8 | 160 | 9/16/2023 |
3.3.7 | 209 | 9/14/2023 |
3.3.6 | 154 | 9/11/2023 |
3.3.5-alpha-07 | 145 | 9/4/2023 |
3.3.5-alpha-06 | 125 | 8/31/2023 |
3.3.5-alpha-05 | 117 | 8/25/2023 |
3.3.5-alpha-04 | 109 | 8/24/2023 |
3.3.5-alpha-03 | 127 | 8/22/2023 |
3.3.4 | 168 | 8/18/2023 |
3.3.3 | 216 | 8/14/2023 |
3.3.2 | 218 | 8/10/2023 |
3.3.1-alpha-05 | 157 | 8/8/2023 |
3.3.1-alpha-04 | 124 | 8/8/2023 |
3.3.1-alpha-03 | 148 | 8/4/2023 |
3.3.1-alpha-01 | 141 | 8/4/2023 |
3.3.0 | 169 | 8/4/2023 |
3.2.5-alpha-20 | 143 | 8/2/2023 |
3.2.5-alpha-18 | 162 | 7/10/2023 |
3.2.5-alpha-17 | 141 | 7/5/2023 |
3.2.5-alpha-16 | 207 | 7/3/2023 |
3.2.5-alpha-15 | 143 | 7/3/2023 |
3.2.5-alpha-14 | 155 | 6/27/2023 |
3.2.5-alpha-13 | 142 | 6/23/2023 |
3.2.5-alpha-10 | 128 | 6/20/2023 |
3.2.5-alpha-07 | 153 | 6/20/2023 |
3.2.5-alpha-06 | 148 | 5/18/2023 |
3.2.5-alpha-05 | 124 | 5/18/2023 |
3.2.5-alpha-04 | 149 | 5/16/2023 |
3.2.5-alpha-02 | 133 | 5/9/2023 |
3.2.3 | 379 | 4/24/2023 |
3.2.2 | 190 | 4/23/2023 |
3.2.1 | 179 | 4/22/2023 |
3.2.0 | 185 | 4/22/2023 |
3.1.0 | 204 | 4/17/2023 |
3.0.2 | 220 | 4/17/2023 |
3.0.0 | 212 | 4/16/2023 |
2.1.2 | 389 | 4/11/2023 |
2.1.1 | 395 | 4/5/2023 |
2.1.0 | 351 | 4/5/2023 |
2.0.4 | 330 | 3/28/2023 |
2.0.3 | 307 | 3/28/2023 |
2.0.2 | 329 | 3/27/2023 |
2.0.1 | 339 | 3/23/2023 |
2.0.0 | 348 | 3/22/2023 |
1.2.2 | 384 | 3/21/2023 |
1.2.1 | 362 | 3/21/2023 |
1.2.0 | 350 | 3/20/2023 |
1.1.11 | 301 | 3/20/2023 |
1.1.10 | 498 | 2/27/2023 |
1.1.9 | 407 | 2/27/2023 |
1.1.7 | 420 | 2/27/2023 |
1.1.6 | 485 | 2/19/2023 |
1.1.5 | 437 | 2/19/2023 |
1.1.4 | 438 | 2/14/2023 |
1.1.3 | 704 | 11/14/2022 |
1.1.2 | 683 | 11/9/2022 |
1.1.1 | 674 | 11/7/2022 |
1.1.0 | 698 | 10/31/2022 |
1.0.0 | 888 | 9/21/2022 |