![]() |
VOOZH | about |
dotnet add package Asv.Mavlink --version 4.2.0
NuGet\Install-Package Asv.Mavlink -Version 4.2.0
<PackageReference Include="Asv.Mavlink" Version="4.2.0" />
<PackageVersion Include="Asv.Mavlink" Version="4.2.0" />Directory.Packages.props
<PackageReference Include="Asv.Mavlink" />Project file
paket add Asv.Mavlink --version 4.2.0
#r "nuget: Asv.Mavlink, 4.2.0"
#:package Asv.Mavlink@4.2.0
#addin nuget:?package=Asv.Mavlink&version=4.2.0Install as a Cake Addin
#tool nuget:?package=Asv.Mavlink&version=4.2.0Install as a Cake Tool
The asv-mavlink library provides a robust interface for communication with MAVLink compatible vehicles and payloads. This library is designed to facilitate the interaction with drones and other devices using the MAVLink protocol, enabling users to send commands, receive telemetry data, and perform various operations.
Additionally, the library includes a CLI utility Asv.Mavlink.Shell for simulating, testing and code generation.
This library is part of the open-source cross-platform application for drones Asv Drones.
To install the asv-mavlink library, you can use the following command:
dotnet add package Asv.Mavlink --version <Version>
Documentation can be found here
This command starts a virtual ADS-B receiver that sends ADSB_VEHICLE packets at a specified rate for every vehicle defined in the configuration file.
Asv.Mavlink.Shell.exe adsb --cfg=adsb.json
Here's an example of ADSB utility being used with Asv.Drones.
Here's an example of ADSB utility being used with Mission Planner
Generate C# code for packet serialization\deserialization
Asv.Mavlink.Shell.exe gen -t=[mavlink-xml-file] -i=[mavlink-xml-folder] -o=[output-folder] -e=cs [path-to-liquid-template]/csharp.tpl
/// <summary>
/// HEARTBEAT
/// </summary>
public class HeartbeatPayload : IPayload
{
public byte GetMaxByteSize() => 9; // Sum of byte sized of all fields (include extended)
public byte GetMinByteSize() => 9; // of byte sized of fields (exclude extended)
public int GetByteSize()
{
var sum = 0;
sum+=4; //CustomMode
sum+= 1; // Type
sum+= 1; // Autopilot
sum+= 1; // BaseMode
sum+= 1; // SystemStatus
sum+=1; //MavlinkVersion
return (byte)sum;
}
public void Deserialize(ref ReadOnlySpan<byte> buffer)
{
CustomMode = BinSerialize.ReadUInt(ref buffer);
Type = (MavType)BinSerialize.ReadByte(ref buffer);
Autopilot = (MavAutopilot)BinSerialize.ReadByte(ref buffer);
BaseMode = (MavModeFlag)BinSerialize.ReadByte(ref buffer);
SystemStatus = (MavState)BinSerialize.ReadByte(ref buffer);
MavlinkVersion = (byte)BinSerialize.ReadByte(ref buffer);
}
public void Serialize(ref Span<byte> buffer)
{
BinSerialize.WriteUInt(ref buffer,CustomMode);
BinSerialize.WriteByte(ref buffer,(byte)Type);
BinSerialize.WriteByte(ref buffer,(byte)Autopilot);
BinSerialize.WriteByte(ref buffer,(byte)BaseMode);
BinSerialize.WriteByte(ref buffer,(byte)SystemStatus);
BinSerialize.WriteByte(ref buffer,(byte)MavlinkVersion);
/* PayloadByteSize = 9 */;
}
...
}
This command provides a tree representation of all available files and directories on the drone's FTP server. It allows users to see the entire file structure in a hierarchical format, making it easy to browse and understand the file layout without navigating through individual folders.
Asv.Mavlink.Shell.exe ftp-tree -cs tcp://127.0.0.1:5760
You may also use some parameters in the command.
Usage: ftp-tree [options...] [-h|--help] [--version]
Tree representation of all available files and directories on the drones FTP server
Options:
-cs|--connection <string> The address of the connection to the mavlink device (Required)
This command is a file manager for interacting with a drone's file system via FTP. It allows users to browse directories, view files, and perform various file operations (e.g., download, rename, remove, etc.) in an interactive console environment. The tool is designed for MAVLink-based systems and provides an intuitive way to manage the drone’s files and directories.
Asv.Mavlink.Shell.exe ftp-browser -cs tcp://127.0.0.1:5760
Usage: ftp-browser [options...] [-h|--help] [--version]
File manager for interacting with a drones file system via FTP
Options:
-cs|--connection <string> The address of the connection to the mavlink device (Required)
This command extracts SDR (Software Defined Radio) data from a binary file and exports it into a CSV format. The SDR data is deserialized using the AsvSdrRecordDataLlzPayload class, and each record is written as a row in the CSV file with specific data fields such as altitude, signal strength, and power levels.
Asv.Mavlink.Shell.exe export-sdr
You may also use some parameters in the command.
Usage: export-sdr [options...] [-h|--help] [--version]
Export sdt data to csv format
Options:
-i|--input-file <string> Input file (Required)
-o|--output-file <string> Output file (Default: @"out.csv")
This command listens to incoming MAVLink packets and displays statistics on the received messages. It allows monitoring of the communication between a ground station and an unmanned vehicle, showing information like the frequency of each type of message and the last few received packets.
Asv.Mavlink.Shell.exe mavlink
You may also use some parameters in the command.
Usage: mavlink [options...] [-h|--help] [--version]
Listen MAVLink packages and print statistic
Options:
-cs|--connection <string> Connection string. Default "tcp://127.0.0.1:5760" (Default: null)
This command is used to connect a vehicle with multiple ground stations, creating a hub that routes MAVLink messages between them. It provides flexible filtering options to log specific MAVLink messages, and can output the filtered data to a file. It supports multiple connections (UDP or serial) and can operate in silent mode (without printing to the console).
Asv.Mavlink.Shell.exe proxy -l tcp://127.0.0.1:5762 -l tcp://127.0.0.1:7341 -o out.txt
You may also use some parameters in the command.
Usage: proxy [options...] [-h|--help] [--version]
Used for connecting vehicle and several ground station
Example: proxy -l udp://192.168.0.140:14560 -l udp://192.168.0.140:14550 -o out.txt
Options:
-l|--links <string[]> Add connection to hub. Can be used multiple times. Example: udp://192.168.0.140:45560 or serial://COM5?br=57600 (Required)
-o|--output-file <string> Write filtered message to file (Default: null)
-silent|--silent Disable print filtered message to screen (Optional)
-sys|--sys-ids <int[]> Filter for logging: system id field (Example: -sys 1 -sys 255) (Default: null)
-id|--msg-ids <int[]> Filter for logging: message id field (Example: -id 1 -mid 255) (Default: null)
-name|--name-pattern <string> Filter for logging: regex message name filter (Example: -name MAV_CMD_D) (Default: null)
-txt|--text-pattern <string> Filter for logging: regex json text filter (Example: -txt MAV_CMD_D) (Default: null)
-from|--directions <int[]> Filter for packet direction: select only input packets from the specified direction (Default: null)
This command benchmarks the serialization and deserialization performance of MAVLink packets. It uses BenchmarkDotNet to measure the efficiency of the serialization process, focusing on how MAVLink packets are serialized and deserialized using spans.### Features:
Asv.Mavlink.Shell.exe benchmark-serialization
This command shows info about the mavlink device and all other mavlink devices that are connected to it.
Asv.Mavlink.Shell.exe devices-info -cs "tcp://127.0.0.1:7341"
You may also use some parameters in the command to customise the output
Usage: devices-info [options...] [-h|--help] [--version]
Command that shows info about devices in the mavlink network
Options:
-cs|--connection-string <string> The address of the connection to the mavlink device (Required)
-i|--iterations <uint?> States how many iterations should the program work through (Default: null)
-dt|--devices-timeout <uint> (in seconds) States the lifetime of a mavlink device that shows no Heartbeat (Default: 10)
-r|--refresh-rate <uint> (in ms) States how fast should the console be refreshed (Default: 3000)
Full possible command with all the parameters
Asv.Mavlink.Shell.exe devices-info -cs "tcp://127.0.0.1:7341" -i 400 -dt 20 -r 1000
Asv.Mavlink.Shell.exe packetviewer --connection tcp://127.0.0.1:5762
This command starts the console implementation of packet viewer.
Packet Viewer sets up the Mavlink router and waits for a connection using parameters provided in the command line. Launch a real drone or simulator to connect and start receiving packets from it. Once the connection is established, the packets will be displayed in the "Packets" section below.
It provides the following actions:
By default, the viewer has no filters enabled and displays all received packets.
This command generates fake diagnostic with customizable frequency.
Asv.Mavlink.Shell.exe generate-diagnostics
The program generates a default configuration file by default, but you can provide a custom configuration. Simply pass the path to your configuration file as a command-line parameter.
Note: config is a json file.
Asv.Mavlink.Shell.exe generate-diagnostics -cfg "path/to/your/cfg.json"
All the possible parameters for the command:
Usage: generate-diagnostics [options...] [-h|--help] [--version]
Command creates fake diagnostics data from file and opens a mavlink connection.
Options:
-cfg|--cfg-path <string?> location of the config file for the generator (Default: null)
-r|--refresh-rate <uint> (in ms) States how fast should the console be refreshed (Default: 2000)
Full command with all the parameters
Asv.Mavlink.Shell.exe generate-diagnostics -cfg "path/to/your/cfg.json" -r 3000
This command creates Diagnostic client and prints all diagnostics that the client retrieves.
Asv.Mavlink.Shell.exe test-diagnostics -cs tcp://127.0.0.1:7342?srv=true -tsid 1 -tcid 241 -r 3000
All the possible parameters for the command:
Command creates diagnostic client that retrieves diagnostic data.
Options:
-cs|--connection-string <string> The address of the connection to the mavlink diagnostic server (Required)
-tsid|--target-system-id <byte> Server's system id (Required)
-tcid|--target-component-id <byte> Server's component id (Required)
-r|--refresh-rate <uint> (in ms) States how fast should the console be refreshed (Default: 1000)
This command creates ftp server and opens connection to it.
Asv.Mavlink.Shell.exe run-ftp-server
The program generates a default configuration file by default, but you can provide a custom configuration. Simply pass the path to your configuration file as a command-line parameter.
Note: config is a json file.
Asv.Mavlink.Shell.exe run-ftp-server -cfg "path/to/your/cfg.json"
All the possible parameters for the command:
Usage: run-ftp-server [options...] [-h|--help] [--version]
Command creates virtual ftp server.
Options:
-cfg|--cfg-path <string?> location of the config file (Default: null)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
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.Sdr
Mavlink library for .NET 6.0, .NET 7.0 for controlling SDR payload |
|
|
Asv.Mavlink.Gbs
Mavlink library for .NET 6.0, .NET 7.0 for controlling ground base station with RTK support |
|
|
Asv.Drones.Api
Package Description |
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 |
|---|---|---|
| 4.2.0 | 417 | 4/2/2026 |
| 4.1.0 | 289 | 3/23/2026 |
| 4.0.19 | 148 | 3/23/2026 |
| 4.0.18 | 1,380 | 11/29/2025 |
| 4.0.17 | 1,003 | 8/29/2025 |
| 4.0.16 | 495 | 7/4/2025 |
| 4.0.15 | 239 | 7/4/2025 |
| 4.0.14 | 265 | 7/3/2025 |
| 4.0.13 | 260 | 7/3/2025 |
| 4.0.12 | 287 | 7/2/2025 |
| 4.0.10 | 276 | 6/29/2025 |
| 4.0.9 | 263 | 6/29/2025 |
| 4.0.8 | 221 | 6/28/2025 |
| 4.0.7 | 215 | 6/27/2025 |
| 4.0.6 | 202 | 6/27/2025 |
| 4.0.5 | 235 | 6/27/2025 |
| 4.0.4 | 256 | 6/26/2025 |
| 4.0.3 | 315 | 6/23/2025 |
| 4.0.2 | 285 | 6/22/2025 |
| 4.0.1 | 265 | 6/19/2025 |