Professional Documents
Culture Documents
RED UAS Paper DiogoPeres
RED UAS Paper DiogoPeres
Diogo Peres(1) (2), António Raimundo (1) (2), Nuno Santos(1) (2), Pedro Sebastião(1) (2), Nuno Souto(1) (2) , Alexandre Almeida(1) (2)
(1)
ISCTE-Instituto Universitário de Lisboa, DCTI, Avenida das Forças Armadas, 1649-026 Lisboa
(2 )
Instituto de Telecomunicações, Av. Rovisco Pais 1, 1049-001Lisboa
email: drbps@iscte.pt; aslro@iscte.pt; nmass@iscte.pt;
pedro.sebastiao@iscte.pt; nuno.souto@iscte.pt; alexandre.almeida@iscte.pt
vehicle and communicate with the server. The server The camera was used so the application could receive video
communicates also with the mobile application to exchange feedback and allow the user to see were it’s going in case the
the messages coming from and to the vehicle vehicle is out off line of sight. The raspberry pi was placed
in the vehicle and connected to the controller board and had
Raspberry Pi Mobile a 3G/4G dongle to be able to connect to the internet.
Controller Application
MAVProxy
Board 4. SETTING UP
Java Program Server To communicate and prepare the hardware to deal with the
different types of vehicles and communicate between
different units it was used several software programs.
Figure 1 - Technical Architecture
1) Mission Planner
1) Controller Board
To make the controller board functional it was needed to
Controller boards for UVs are generally referred as flight load a firmware. There are several GCS available in the
controllers because they are mostly used for aerial vehicles, market capable of doing it. For this paper, it was chosen
responsible for managing the flight of multi-rotor aircrafts Mission Planner for being a simple, free and widely used
and airplanes. Its purpose is to stabilize the aircraft during GCS that is available for Windows. After installing it, the
flight, to do so, it takes the signals from on-board controller board should be connected to the computer with
gyroscopes and passes them to the processor, which the help of a micro USB cable and installed the firmware
processes signals according to the user’s selected firmware according to the type of vehicle pretended (ArduRover for
(corresponding to its type of vehicle) and passes the control cars and boats, ArduPlane for fixed-wings, ArduCopter for
signals to the installed ESCs to make fine adjustments to the Helicopters, ArduCopter Quad for quadcopters, ArduCopter
motors rotational speed which in-turn stabilizes the aircraft. Hexa for hexacopters, etc) [2].
Controllers boards also uses signals from radio or other
sources like Bluetooth or Wi-Fi modules and passes these 2) MAVLink
signals (e.g. aileron, elevator, throttle and rudder) together
with stabilization signals to the processor, which once Micro Air Vehicle Link (MAVLink) is a communication
processed send them to the ESCs to turn and control the protocol used mostly for communications between a GCS
vehicle orientation. There are several controller boards and UVs. It can be used to transmit the altitude of the
available in the market, although, it was necessary a vehicle, speed, battery status, its GPS location, and other
controller board with advance functionalities like GPS and information. MAVLink can pack C-structs over serial
auto guide. One of the most known flight controller is channels with high efficiency and send these packets to the
Ardupilot Mega (APM), and its evolution Pixhawk which GCS. It was extensively tested on various controller boards
was chosen as the main controller to be used because it has a like the PX4, Pixhawk and APM. In other words the
better performance, uses an open-source software and is also MAVLink message is just a stream of bytes encoded by the
suitable for most types of radio control vehicles: fixed GCS to send to the controller board or vice-versa. The
wings, copters, cars and boats, depending on the firmware stream of bytes can be sent by USB serial or telemetry (both
loaded cannot be used at the same time, if the both are plugged in,
To communicate with external systems such as ground USB is given preference and Telemetry is ignored).
control stations this controller board uses a messaging
protocol called MAVLink. Table 1 – MAVLink Message packet structure
2) Raspberry Pi Content STX LEN SEQ SYS COMP MSG PAYLOAD CKA CKB
corresponds to the message’s ID, which allows to decode the security. The application redirects to the server all the
payload correctly. The Payload, as shown in Table 1 is the packages that are coming from MAVProxy and vice-versa
actual data and the last two bytes are the checksum which (Figure 1).
the software uses to check if the message is valid and not
corrupted. A MAVLink message has a minimum length of 8 5. MOBILE APPLICATION
bytes, typically for acknowledgement packets (ACK)
without payload and a maximum length of 263 for full The mobile application was developed in android studio. It
payload [3]. was opted for Android because it has many users on a global
scale, it’s free and is a native technology, having a better
3) MAVProxy performance in the devices using android. The minimum
version targeted was android Jelly Bean 4.1.xx since it will
MAVProxy is a command line GCS with the ability to run on 97,5% of android phones (considering the time that
forward the messages from the UV controller board over the the paper was written).
network via UDP to other GCSs or devices. It is written To be able to decode the MAVLink messages it was used a
100% in Python and it’s an open source software. This library called “MAVLink Java” which decodes the bytes
software will be used in the Raspberry Pi to be able to read with the help of xml files and generates Java code.
the messages coming from the controller board and forward The mobile application called ‘Mobile Control Station’ starts
them through the network to other devices. in a login screen which receives a username and a password
to authenticate in the server. If the server responds with a
4) SITL successful message the user is redirected to a main screen
with the vehicle list, displaying the vehicles ready to be
To help the tasks of this work it was used a program to controlled, so the user can select one.
simulate the controller board in the vehicle (able to simulate The main screen has two tabs at the top. In the first one it’s
APM or Pixhawk). The simulator is called SITL (Software possible to manually control the vehicle by using two
In The Loop) and is based on Arducopter, allowing to run joysticks and in the other tab, called mission tab, it’s
Plane, Copter or Rover without any hardware. SITL is possible to monitor and control the vehicle by sending
especially useful since some malfunctions in the program waypoints.
while in the development phase can cause the vehicle to The main screen has also a menu with five options that will
crash. With SITL, the program can be first tested in the be explained later.
simulator and then, when stable, passed to the real vehicle.
This simulator can be run either on Windows or Linux.
Since SITL will emulate the controller board it will be still A. Controller Screen
needed a way to communicate with it, to do this it will be
installed MAVProxy alongside with SITL. The controller tab redirects to a controller screen which is
used to check the vehicle information’s and manually
5) Server control it.
One of the main challenges of this work was to deal with the
network address translation (NAT). The public IP of a
device changes according to the network that it’s in and due
to this fact the application doesn’t know the IP of its vehicles
and vice-versa. To overcome this problem the
communications were done using a server.
Each time a vehicle or an application is turned on, it will
connect to a server that will authenticate the device and
register its IP, the server will also redirect the messages from
the application to its vehicles and vice versa.
The server stores the user information such as the username,
password and the UV’s corresponding to each user.
1) UV’s selection
The last graph displays the RTT over time and the packet
loss. The RTT is calculated with the equation (1). To get the
packet loss it’s necessary to calculate the timeout for a
packet, which is calculated as
̂ + 4 × 𝐷𝑒𝑣
𝑇𝑖𝑚𝑒𝑜𝑢𝑡 = 𝑅𝑇𝑇 (2)
and
̂ | (3)
𝐷𝑒𝑣𝑛𝑒𝑤 = (1−∝) 𝐷𝑒𝑣𝑜𝑙𝑑 + ∝ |𝑁𝑒𝑤𝑅𝑇𝑇𝑛𝑒𝑤𝑠𝑎𝑚𝑝𝑙𝑒 − 𝑅𝑇𝑇 Figure 6 – Multi vehicle monitoring
6
It was tested three types of firmware. Rover, Copter and For future work, it could be developed a firmware to the
Plane. Tested both on controlling and monitoring. The Plane controller board able to deal with a 3D vehicle, so that it
firmware was only tested in the simulator since it was not wasn’t necessary to have three separated units together.
constructed a fixed-wing. Another suggestion is to improve the delay, i.e., minimizing
The car, boat and copter were tested in simulation and with the delay time in the video streaming.
real vehicles.
The modes tested where: ACKNOWLEDGEMENTS
• Guided (Copter, Plane and Rover);
• Auto (Copter, Plane and Rover); The authors would like to thank Instituto de Telecomu-
• Stabilize (Copter and Plane); nicações, (Portuguese R&D Centre) and ISCTE-University
• Position Hold (Copter); Institute of Lisbon, by providing funds for the acquisition of
• Manual (Rover); all the material needed to carry out this project. Without
• RTL (Copter and Plane); these funds the work would not be possible.
The application was continuously being tested to ensure all
the bugs were tested and maximize the application’s REFERENCES
performance.
The statistics screen allowed to gather information. One of [1] C. E. Nehme, "Modeling human supervisory control in
the information collected was the average RTT for the heterogeneous unmanned vehicle systems,"
controller messages, which was tested several times using Massachusetts, 2009.
different scenarios, to construct Table 2. It was tested with
[2] "Mission Planner Overview" [Online]. Available:
and without video feedback, the RTT increase with video
http://ardupilot.org/planner/docs/mission-planner-
because the video streaming requires more processing
overview.html. [Accessed 12 August 2016].
power, has a higher bit rate than the controlling messages
(MAVLink) and requires more Bandwidth. [3] "MAVLink Micro Air Vehicle Communication
Protocol," [Online]. Available:
Table 2 – Controlling messages RTT http://qgroundcontrol.org/mavlink/start. [Accessed 29
August 2016].
Video 1 vehicle 2 vehicles 3 vehicles [4] Szablewski, D. (Ed.),“HTML5 live video streaming via
Feedback [ms] [ms] [ms] websockets,” 11 September 2013. [Online]. Available:
No 127 134 142 http://phoboslab.org/log/2013/09/html5-live-video-
Yes 172 188 210 streaming-via-websockets. [Accessed em 6 December
2016].
The approached used to have video feedback was video
streaming via websockets. First a multimedia framework
called ffmpeg need to be installed in the raspberry pi in order
to handle the video coming from the camera. This
framework will encode the video to MPEG and send it to the
server via HTTP. The server will need to have installed a
JavaScript framework called nodejs to run a nodejs script
that will distribute the MPEG stream via Websockets to the
connected clients that will decode it to reproduce the video
[4].
To test the connection a HTML and Javascript files were
downloaded from jsmpeg project in GitHub. These files
were loaded and placed in a webview in the application.
They connect the application to the server via a websocket
and display the image in the webview.