GSoC/2020/StatusReports/KitaeKim: Difference between revisions

From KDE Community Wiki
< GSoC‎ | 2020‎ | StatusReports
Line 9: Line 9:
'''Mentors:''' Tomaz Canabrava, Eike Hein, Patrick José Pereira, Sung Jae Cho
'''Mentors:''' Tomaz Canabrava, Eike Hein, Patrick José Pereira, Sung Jae Cho


== Work reports ==
== Progress Reports ==
=== Community Bonding Period ===


=== Work report 01 ===
The first thing i did during this period is studying about MAVLink protocol. I studied about it before GSoC begins but i felt that i need to study about it more.


==== Brief description ====
Through this, i got familiarized much more with the protocol and become able to think clearly what i should implement.


Period: 04.17 ~ 06.14
The MAVLink protocol packet is structured in this way:


Topics:
[[File:A mavlink packet structure.png|frame|center]]<ref>https://mavlink.io/en/</ref>
# Command queue
# Bug fix
# Heartbeat
# Multi-vehicle support
# Plugin for GUI


The command protocol, one of MAVLink subprotocols, specifies that commands must be acknowledged by ack message.
The protocol uses sub-protocols to extend it's functionality. The sub-protocols are identified using 'MSG ID' section of the packet.
So i implemented command queue to store commands and send repeatedly until it gets acknowledged.


I found minor bug in Kirogi's plugin system. Kirogi used deprecated function to load plugins.
The sub-protocols uses 'PAYLOAD' section to transport information for the sub-protocol. (e.g., arguments for the sub-protocol)


I'm trying to support all functionalities of heartbeat protocol. this is still WIP.
The thing i need to focus on about the protocol during phase 1 is:


And i'm also trying to make Kirogi support multiple vehicles at the same time. (the protocol supports up to 255 vehicles)
# '''Heartbeat Protocol:''' It is used to identify existence of system along with its system id, component id, vehicle type, component type, flight mode and flight stack. This allows us to discover system connected to the network and notice when they have been disconnected and handle incoming messages appropriately based on type of vehicle and route messages to system on different interface.
# '''Message Channel:''' It is used by helper functions provided by MAVLink library. The MAVLink library manages buffers per channels internally.<ref>mavlink_helpers.h</ref> So we need to manage channels to manage multiple vehicles. It seems one channel per one connection is suffice.


Most challenging thing in this period was GUI element plugin. I need to load GUI elements for Mission Planner, Vehicle Configuration in runtime. It seemed easy at first glance but i felt that most ways to approach makes codebase dirty.
The protocol can control up to 255 vehicles at the same time because 'SYS ID' section of the packet is 1 byte size.
Tomaz and Patrick implemented POC for that and waiting for review. So i will try to find best way to implement it and help them.  


==== Accepted commits ====
So i will implement vehicle manager for managing multiple vehicles during the phase 1. The vehicle manager should be able to identify vehicles based on the heartbeat message, manage vehicle's channel and parse incoming messages based on the vehicle's channel.
* d63efbf54e1726d0ea07d25dc5c76295f0c7a04a
* b19d034b204c73849793fd824270cd897911cea6
* 15b48b52ef3e80bf3d2e14031623bbd11c9b2c6c
* 0d9d7fe32a6c0eaed32770b50de5e36496caad06


==== Personal commits ====
Second thing i did during this period is reading code of Kirogi and QGroundControl in comparison. QGroundControl is the most famous GCS for the MAVLink out there.
* 2f70d1a2b563ae70e9cba016fba1c15e9e0137eb
 
* 2dbaa3d96288b7768094fc84203d2d44e7b26689
Through this i learned about MAVLink protocol much more and the way the QGroundControl supports the protocol.
* 2307ac6929597c3d5b8902bf861e5cdc4bd712a3
 
* f9aabb2f86ef57468e02bf4eb555321674e3facb
The QGroundControl has MultiVehicleManager and LinkManager class which are used to manage vehicles and links.
* 44f77d7e259e00778b58c2f1f0cb48d89a8b3142
 
* ...
The MultiVehicleManager creates vehicle object when incoming message has unknown system id just like what i wrote on the proposal. The vehicle object contains information for the vehicle like system id.
 
The link in QGroundControl contains actual interface like QSerialPort and information for that like port number.
 
The LinkManager creates link object when user wants to create new one. One thing interesting is that the link class inherits QThread so that it can run on new thread by creating it.
 
Both has pointer to toolbox which contains pointer to MultiVehicleManager, LinkManager, MAVLinkProtocol and name a few. So they can reference each other when needed.
 
The link passes incoming message to MAVLinkProtocol class. It dose MAVLink-specific jobs like parsing or checking packet sequence and lost using 'SEQ' section of packet. It passes the parsed message to every component like vehicle object and LinkManager. This looks quite inefficient because the signal passes message parameter not an reference and every components need to process message to check if it need to be received by the component. (TODO: Wrute more clear sentence.)


== Related Links ==
== Related Links ==

Revision as of 13:55, 28 June 2020

Imporove MAVLink integration of Kirogi

The Kirogi is Ground Control Station(GCS) for controlling Unmanned Vehicles like drones developed recently.

It's comparatively young project so it dose not support all standards of MAVLink protocol which is the famous protocol between GCS and UAVs yet.

My goal is to imporove MAVLink protocol integration of Kirogi so that it supports all functionalities of the MAVLink protocol.

Mentors: Tomaz Canabrava, Eike Hein, Patrick José Pereira, Sung Jae Cho

Progress Reports

Community Bonding Period

The first thing i did during this period is studying about MAVLink protocol. I studied about it before GSoC begins but i felt that i need to study about it more.

Through this, i got familiarized much more with the protocol and become able to think clearly what i should implement.

The MAVLink protocol packet is structured in this way:

[1]

The protocol uses sub-protocols to extend it's functionality. The sub-protocols are identified using 'MSG ID' section of the packet.

The sub-protocols uses 'PAYLOAD' section to transport information for the sub-protocol. (e.g., arguments for the sub-protocol)

The thing i need to focus on about the protocol during phase 1 is:

  1. Heartbeat Protocol: It is used to identify existence of system along with its system id, component id, vehicle type, component type, flight mode and flight stack. This allows us to discover system connected to the network and notice when they have been disconnected and handle incoming messages appropriately based on type of vehicle and route messages to system on different interface.
  2. Message Channel: It is used by helper functions provided by MAVLink library. The MAVLink library manages buffers per channels internally.[2] So we need to manage channels to manage multiple vehicles. It seems one channel per one connection is suffice.

The protocol can control up to 255 vehicles at the same time because 'SYS ID' section of the packet is 1 byte size.

So i will implement vehicle manager for managing multiple vehicles during the phase 1. The vehicle manager should be able to identify vehicles based on the heartbeat message, manage vehicle's channel and parse incoming messages based on the vehicle's channel.

Second thing i did during this period is reading code of Kirogi and QGroundControl in comparison. QGroundControl is the most famous GCS for the MAVLink out there.

Through this i learned about MAVLink protocol much more and the way the QGroundControl supports the protocol.

The QGroundControl has MultiVehicleManager and LinkManager class which are used to manage vehicles and links.

The MultiVehicleManager creates vehicle object when incoming message has unknown system id just like what i wrote on the proposal. The vehicle object contains information for the vehicle like system id.

The link in QGroundControl contains actual interface like QSerialPort and information for that like port number.

The LinkManager creates link object when user wants to create new one. One thing interesting is that the link class inherits QThread so that it can run on new thread by creating it.

Both has pointer to toolbox which contains pointer to MultiVehicleManager, LinkManager, MAVLinkProtocol and name a few. So they can reference each other when needed.

The link passes incoming message to MAVLinkProtocol class. It dose MAVLink-specific jobs like parsing or checking packet sequence and lost using 'SEQ' section of packet. It passes the parsed message to every component like vehicle object and LinkManager. This looks quite inefficient because the signal passes message parameter not an reference and every components need to process message to check if it need to be received by the component. (TODO: Wrute more clear sentence.)

Related Links

Project Proposal

Improve MAVLink integration of Kirogi

GitLab Personal Repository

Kitae Kim / Kirogi

  1. https://mavlink.io/en/
  2. mavlink_helpers.h