Giter Site home page Giter Site logo

proto3 / mavkit Goto Github PK

View Code? Open in Web Editor NEW
26.0 4.0 18.0 937 KB

A simple tool to send and receive mavlink packets from udp, tcp, serial, files...

License: GNU General Public License v3.0

CMake 3.19% C++ 96.37% C 0.43%
mavlink serial udp proxy tcp toolbox

mavkit's Introduction

MAVKit

Introduction

MAVkit is a C++ toolbox for MAVLink 2.0 in command line.

It can display, redirect, broadcast, log, replay data from and to different types of interface (Serial, UDP, TCP, File).

MAVkit is also a framework for MAVLink programmers. It is built on a modular architecture where each module can be used independently inside other projects. In that case, it provides a simple MAVLink block that can be replaced according to communication hardware.

Designed with low latency in mind, it keeps IO buffers safe from overflows (leading to data loss) by using a dual thread processing loop per interface (fast read and process).

Build

Submodule update

Note : Be sure to use the following recursive command, there is two submodule levels in mavlink.

git submodule update --init --recursive

Compilation

Dependencies : Boost + MAVLink usual dependencies

mkdir build
cd build
cmake ..
make

How it works ?

Mavkit is organised in modules called messengers. A messenger can receive and send messages to others in a fully concurrent way.

Each messenger can be either a serial link, an UDP socket, a log file,...

you have to specify at least one messenger (the first) for the role of master. This particular one will be duplex connected to every other messenger created then. On the contrary, secondary messengers won't be connected between them.

Here is an example of two MAVkit instances, composed of respectively 4 and 2 messengers and linked between them through UDP. Note that masters are connected to all other messengers, while those are not linked between them.

How to use it ?

Once you've built it, you can run MAVKit from command line by specifying messengers one after the other.

The first messenger will take on the role of master.

Serial

Arguments :

  • device -> path of a tty device.
  • baudrate -> baudrate.

ex : --tty /dev/ttyUSB0 57600

UDP server

Arguments :

  • port -> listening port.

ex : --udp_server 14550

UDP client

Arguments :

  • IP address -> target IP address.
  • port -> target port.

--udp_client 192.168.1.10 14550

TCP server

Arguments :

  • port -> listening port.

ex : --tcp_server 14550

TCP client

Arguments :

  • IP address -> target IP address.
  • port -> target port.

--tcp_client 192.168.1.10 14550

Logger

Save received messages in .raw and .ts file (.raw contains the mavlink raw data, .ts contains timestamp for each message).

No arguments.

--log

File

Replay content of .raw and .ts files.

Arguments :

  • file prefix -> logs are made of two files (.raw and .ts), both should be located on the same place for mavkit to find them. Example : dir/log will look for dir/log.raw and dir/log.ts files.
  • speed multiplier -> floating point multiplier for the reading speed.
  • starting time -> time to start in the file in seconds.

ex : --file ../myLog 2.0 50

display

Output messages to stdout.

No arguments.

--display


You can combine almost as many messengers as you want in command line.

Example :

./mavkit --tty 57600 /dev/ttyACM0 --udp_server 14550 --display --log --tcp_client 127.0.0.1 14551

mavkit's People

Contributors

proto3 avatar statkus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mavkit's Issues

Wrong arguments order according to documentation

In Readme.md it is specified that for option --tty the baudrate shall be put after the path of the serial port, but with the current executable the baudrate shall be put before the path of the serial port to work properly.

UDP client don't work

I'm using jmavsim/PX4 INFO [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 14570 remote port 14550

I wannna read the mavlinks messages with this command but nothing happens
./mavkit --udp_client 192.168.1.10 14550 --display

Mavlink submodule is outdated

Coucou poulet,

It seems that the mavlink submodule is outdated and does not benefit from the last evolutions of the MAVLink v2.0 protocol.

Bisous

Installation error on MavlinkTCP

[ 25%] Building CXX object CMakeFiles/mavkit.dir/src/mavkit/MavlinkTCP.cpp.o
/Users/dronfies/desarrollo/mavlink/MAVkit/src/mavkit/MavlinkTCP.cpp:190:45: error: use of undeclared identifier 'MSG_NOSIGNAL'
bytes_sent = sendto(sock, buf, len, MSG_NOSIGNAL, (struct sockaddr*)&gcAddr, sizeof(struct sockaddr_in));

Pass null as MSG_NOSIGNAL and compile

Updates

Hi !
Just found out MAVKit. Very good job with this :)
Are there any known issues in the master branch ?

My goal is to add an handle message function in the MessengerInterfaces so I can have rules to redirect messages to certains listeners based on the msg id.

Installation error on MavlinkSerial

[ 50%] Building CXX object CMakeFiles/mavkit.dir/src/mavkit/MavlinkSerial.cpp.o
/Users/dronfies/desarrollo/mavlink/MAVkit/src/mavkit/MavlinkSerial.cpp:96:28: error: use of undeclared identifier 'B460800'
baudrate_val = B460800;
^
/Users/dronfies/desarrollo/mavlink/MAVkit/src/mavkit/MavlinkSerial.cpp:99:28: error: use of undeclared identifier 'B921600'
baudrate_val = B921600;

I delete those two lines and compile

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.