UKRAINIAN CATHOLIC UNIVERSITY
BACHELOR THESIS
Development of analytical system for sport fencing
Author: Supervisor: Oleh SMOLKIN Oles DOBOSEVYCH
A thesis submitted in fulfillment of the requirements for the degree of Bachelor of Science in the
Department of Computer Sciences Faculty of Applied Sciences
Lviv 2019 i
Declaration of Authorship
I, Oleh SMOLKIN, declare that this thesis titled, “Development of analytical system for sport fencing” and the work presented in it are my own. I confirm that:
• This work was done wholly or mainly while in candidature for a research de- gree at this University.
• Where any part of this thesis has previously been submitted for a degree or any other qualification at this University or any other institution, this has been clearly stated.
• Where I have consulted the published work of others, this is always clearly attributed.
• Where I have quoted from the work of others, the source is always given. With the exception of such quotations, this thesis is entirely my own work.
• I have acknowledged all main sources of help.
• Where the thesis is based on work done by myself jointly with others, I have made clear exactly what was done by others and what I have contributed my- self.
Signed:
Date: ii
“The First Sword of Braavos does not run.”
Syrio Forel iii
UKRAINIAN CATHOLIC UNIVERSITY
Faculty of Applied Sciences
Bachelor of Science
Development of analytical system for sport fencing
by Oleh SMOLKIN Abstract
Fencing is an extremely fast sport. 40ms - time that is needed for hit registration. It‘s 10 times faster than a blink of an eye, so it‘s impossible to measure fencer’s progress objectively even for a coach. We are the first who proposed to store and analyze fencers data. Our solution is a small device, which connects to the fencer exactly in the same way as to existing scoring equipment. The device sends information to a smartphone via Bluetooth. Also, it contains a bunch of sensors that allow measuring speed, reaction, and tech- nic of the fencer. All data is gathered in the cloud, so we can process it and provide coach and fencers with analytics. Gamification will make the training process more attractive to children. We alread have a prototype that is actively tested in local fencing clubs. iv Acknowledgements
First of all, I want to sincerely thank Oles Dobosevych, who was always ready to help and gave advice on any question related to the project and just inspired me to work hard during the last four years. Thanks to Oleh Farenyuk who regularly consults on all hardware related issues. Also, want to thank team members who help to bring this project to life. Yarka Lyba with whom we developed and continuously improved all business-related is- sues. Victor Yezhov, Max Komarenskii, Nazar Bachinskiy who work on the devel- opment of application and hardware. Finally, I want to thank my family, who everyday supports me. v
Contents
Declaration of Authorshipi
Abstract iii
Acknowledgements iv
Contentsv
List of Figures vii
List of Abbreviations viii
List of Symbols ix
1 Introduction1 1.1 Motivation...... 1 1.2 Fencing history...... 1
2 Related works3 2.1 Fencing equipment...... 3 2.2 Sport analytics applications...... 3 2.2.1 Nike Run Club...... 3 2.2.2 Strava...... 3 2.2.3 Garmin...... 4
3 Background information5 3.1 Bluetooth...... 5 3.2 Madgwick filter...... 5
4 Proposed approach7 4.1 Business analysis...... 7 4.1.1 Market...... 7 4.1.2 Business model...... 8 4.1.3 Market acquisition...... 8 4.2 Analytic...... 8 4.2.1 Reaction...... 9 4.2.2 Speed...... 9 4.2.3 Bout dynamic...... 9 4.2.4 Hand technique...... 9 4.3 Technologies...... 9 4.3.1 Architecture...... 9 4.3.2 Hardware...... 10 4.3.3 Application...... 11 Authorization...... 11 vi
Profile...... 11 Workouts...... 11 Bluetooth connection...... 11 Bout...... 12 Analytics...... 12 Settings...... 12 4.3.4 Backend...... 13
5 Results 14
6 Conclusions and future work 15
Bibliography 16 vii
List of Figures
4.1 Market estimation...... 7 4.2 System architecture...... 10 4.3 Workouts screen...... 11 4.4 Bluetooth connection wireframes...... 12 viii
List of Abbreviations
USFA United-States Fencing Association API Application-Programming Interface REST Representational-State Transfer NRC Nike-Run Club IMU Inertial-Measurement Unit LED Light-Emitting Diode DC Direct-Current PWM Pulse-Modulation UUID Universally Unique IDentifier ix
List of Symbols
V volts mAh milliampere hour 1
Chapter 1
Introduction
1.1 Motivation
Development of science and technologies has had a huge influence on sport in many areas. The main directions are bringing technologies for increasing physical perfor- mance of the athlete, improvement of objectiveness of the refereeing system and of course sports analytic. Sports analytic already shows impressive performance in a lot of team sports such as basketball, football, baseball and much more. In this case mostly are used computer vision algorithms, which allow tracking interaction between athletes and provide insights into team tactics and strategy. However, it’s still not such popular in individual sports and in particular combats, where it isn’t such a problem to analyze whole picture and statistics, but rather monitor small details of athlete technique. Some solutions introduce devices which allow tracking correctness of athlete moves in such sports as boxing, tennis, swimming, etc. In most cases, they just use a kind of wearable hardware solution, which allows getting a limited amount of data. Fencing is a unique sport because it connected with electronics for many years, so it’s much easier to integrate more sensors. Fencer needs to be connected to scor- ing equipment to have the ability to determine who hits first during a bout. Inside existing scoreboards 40 ms is a hardcoded duration to differentiate clear hit. If the difference between opponents hits is more than 40 ms, clear hit registered, other- wise - double. This time is ten times faster than a blink of an eye, so even coaches can‘t objectively estimate the performance of an athlete. If coach see clear metrics of speed, reaction and other athletes qualities he can plan training program more effectively. Introduction of metrics for performance estimation allows easier track athlete progress during the time. Another problem that most clubs still use wire scoring systems, which are pretty expensive and very complicated in installation. Therefore commonly clubs have only four pistes, so in the same time only eight fencers can practice while other twenty need to wait. This problem is especial crucial with kids groups, when in the same time can practice up to forty children.
1.2 Fencing history
Fencing history can be traced back to the Middle Ages when the art of using a sword was one of the essential military skills. With the development of sword fight- ing technique, fencing masters produced books about their systems. Accumulated knowledge formed the first fencing schools. Italian and French schools, which were founded in the 18th century set basics of modern fencing. Chapter 1. Introduction 2
Fencing developed from military academy classes more into the sport in An- gelo’s School of Arms in London. Domenico Angelo set up rules of posture and footwork which are used nowadays. In 1896 fencing became part of first Olympics games. [CENTRE, 2017] Since 1990 in fencing rules distinguish three kinds corre- sponding to weapon: epee, foil, and saber. The epee is a thrusting weapon with the entire body as the valid target. The foil is also a thrusting weapon, but with the torso as an only valid target. The saber cutting and thrusting weapon that targets the entire upper-body, except the weapon hand. At the earliest competitions, referees paint the tip of epee to register the hit, so a fencer gets a score if he marks jacket of an opponent with paint. Therefore fencers have white equipment nowadays. First electronics scoring apparatus was used on epee competitions in 1933. Epee has button at the tip of blade, epee-fencer need to hit opponent and push button on curtain level. Foil and saber were electrified only in the second half of the 20th century. Foils and saber fencers need to wear electric jacket, so hit is registered, when fencer with his weapon close the circuit on opponent jacket. Modern scoring systems also show score, bout time, info about period, penalty card and other specific functionality. [CENTRE, 2015] Wireless scoring equipment was first-time officially used on international com- petitions in 2006. 3
Chapter 2
Related works
2.1 Fencing equipment
Fencing is connected with electronics from 1930. In epee it uses button on the tip of blade to registrate hit. Epee is connected to scoring equipment with wire which is weared under fencer jacket. At the market already exists wireless scoring equipment. The main providers are StM, Leon Paul and Favero. All existing solutions have pretty similar functionality. They all contain a pair of hardware transmitters which connect to fencer and send information to hardware scoreboard. All scoreboards are limited with the standard functionality of hit registration. StM solution transmits data via Bluetooth and also is compatible with an existing scoreboard. Leon Paul presents themselves as the most accurate system, but because it works with radio transmitter it can‘t be scal- able to use with external devices. Favero is the cheapest solutions and also includes “training mode” - simple ability to signal hit without delay after the previous hit. The main disadvantages that all systems are pretty expensive and provide lim- ited functionality.
2.2 Sport analytics applications
At this moment fencers haven‘t any application for analytic, so we investigated the best solutions for other sports.
2.2.1 Nike Run Club NRC is most downloaded run tracking application on Play Store. It use GPS data to track position of runner and provide statistic about speed, pace per each kilometer, route of run. All data about runs is stored and user can track his/her progress during the time. It also has levels, achievements and challenges for motivation of user and you can share progress with your friends . It builds personal plan based on profile data and gathered statistics.
2.2.2 Strava Strava is more multifunctional application and oriented not only on runners but also on swimmers, cyclist and even for gym workouts. It also gathered data about speed, pace and burned calories. It‘s more concentrated on building global community. Also it has some interesting features such as visualization of gathered data during all workouts. Chapter 2. Related works 4
2.2.3 Garmin Garmin is wearable fitness watches. As the most fitness trackers it allows to gather data about hear-rate, GPS location. In addition new version of device use IMU sen- sors for tracking technique of swimmers. 5
Chapter 3
Background information
3.1 Bluetooth
Bluetooth is a wireless technology which allows to transfer data on short distances. It was developed in the 1990s by telecommunications company Ericsson. The first purpose of technology use was for the development of wireless headsets. Communication implemented with master//slave architecture with ability of master connect up to seven slaves. In 2010 Bluetooth 4.0 was introduced. The new version implemented Bluetooth Low Energy protocol, which significantly reduced power consumption and made Bluetooth great again. Also, it increased bandwidth range to up to 100 meters with the stable signal up to 10 meters. [S.L., 2015] Disconnected devices broadcast advertisement packets. For latency reduction, packets are broadcast on three different frequencies. Client can read server data by accessing of characteristics UUID. Curtain charac- teristic contains curtain type of data, for example, heart rate or charge level. Similar characteristics are combined into services.
3.2 Madgwick filter
Madgwick filter is the state-of-the-art approach for correction of space orientation with inertial sensors. Euler angles are used In the most cases for description of ori- entation. Angles are represented as three by three matrix. Gimbal lock is the main problem of Euler angles. Matrix representation can be the same for different states. Also matrices is more calculation expensive. Madgwick proposed to use quaternions for position representation. The quater- nions are four dimensional complex numbers. It is represented in the form:
a + b ∗ i + c ∗ j + d ∗ k
With property: i2 = j2 = k2 = i ∗ j ∗ k = −1 This property allows easy represent spatial rotation, which make it useful for orientation estimation. [Madgwick, 2010] So first step is to read data from sensors and represent it as quaternions. Next step is to calculate offset of accelerometer through gradient step:
I W I T I W I W I ∇ f W ˆqest,t, ˆg, ˆat+1 = J W ˆqest,t, ˆg f W ˆqest,t, ˆg, ˆat+1 . Chapter 3. Background information 6