menggproject nitin guleria

44
University of Toronto Masters of Engineering Project Absement (time integral of distance), Integral Kinematics based Applications for Wearables Author: Nitin Guleria Supervisor: Dr. Steve Mann A project submitted in fulfillment of the requirements for the degree of Masters of Engineering in the field of Computer Engineering The Edward S. Rogers Sr. Department of Electrical and Computer Engineering

Upload: nitin-guleria

Post on 24-Sep-2015

252 views

Category:

Documents


4 download

DESCRIPTION

about a project

TRANSCRIPT

  • University of Toronto

    Masters of Engineering Project

    Absement (time integral of distance),Integral Kinematics based Applications

    for Wearables

    Author:

    Nitin Guleria

    Supervisor:

    Dr. Steve Mann

    A project submitted in fulfillment of the requirements

    for the degree of Masters of Engineering

    in the

    field of Computer Engineering

    The Edward S. Rogers Sr. Department of Electrical and Computer Engineering

  • UNIVERSITY OF TORONTO

    Abstract

    Faculty of Applied Science and Engineering

    Department of Electrical and Computer Engineering

    Masters of Computer Engineering

    Absement (time integral of distance), Integral Kinematics based Mobile

    Application

    by Nitin Guleria

  • ii

    The objective of the project is to develop fitness system based application for mobile

    and wearables using the concept of Integral Kinematics and Integral Kinesiology, i.e.

    Absement (time integral of distance) for different systems such as wearables and mobile

    phones. Other competing fitness systems and approaches rely on parameters such as

    distance and its time derivatives such as velocity, acceleration etc. The Mannfit sys-

    tem proposes a new paradigm for fitness based on the time integrals of distance i.e.

    absement. Rather than increasing distance, velocity or acceleration, the goal is to re-

    duce absement to maintain stability and control. The main goal is to introduce and

    spread the importance of this new field of Integral Kinematics (absement, etc.) for the

    fitness industry.Three simple applications were made that demonstrate the concept of

    Integral Kinematics using absement. The first application showcases the concept of an

    absement bar (destabilizing bar) which may be used directly for pull-ups, or may have

    rings attached to it for other exercises. The goal of this exercise was to keep the bar

    stable and not to allow the bar to move significantly. When the user does pull-ups, dips,

    leg-raises, etc. on the bar, their stability was measured using the tilt on the bar, as

    well as the downward force on the bar. This was recorded in a mobile app connected

    to it. A virtual bucket filled up in the mobile app as the user tilts the bar. Then, the

    user was given a score (absement) based on his/her stability. The second application

    was for a destabilizing plate (wobble board) upon which exercises like push ups were

    performed. A user placed his or her phone in the center of the plate (wobble board).

    Then, he/she placed his/her hands on the wobble board and started doing the push-ups.

    When the wobble board wobbled from its initial position, a virtual bucket started to

    fill in the mobile app and user was given a score on keeping the bucket from filling (i.e.

    minimizing absement). The third was a car racing game for absemental fitness systems.

    Various other wearables such as Muse, Myo, Moverio and Meta Glasses were utilized for

    measuring the users performance based on different kind of sensor technologies.

  • Acknowledgements

    Id like to extend my deepest appreciation to a lot of people who made this project

    possible.

    It is difficult to overstate my gratitude to my project Supervisor Dr. Steve Mann.

    With his enthusiasm and his great vision to bring the concept of integral kinematics to

    practicality on a mobile device, he helped me in making the process of creativity and

    coding, fun. He was source of constant encouragement and inspiration with his sound

    advice and never ending quest for questioning the very fundamentals of science.

    I would like to thank Professor Mohamed AbdelRazik and Professor Matt Medland for

    providing the financial support as teaching assistantships as well as wonderful exposure

    to the undergraduate education and entrepreneurial spirit at University of Toronto.

    I would like to thank many people in the Humanistic Intelligence Research Lab especially

    the driving force of the lab, Ryan Janzen and Mir Adnan Ali for providing constructive

    feedback, clarifying concepts and for help with overcoming difficulties. Also, Malcom

    Smith for sharing experiences, providing suggestions and encouragement.

    I am indebted to many students and friends for providing a fun and creative environ-

    ment in the lab and help their diverse skills, ideas and insights. I would especially like

    to thank Pete Scourboutakos, Rifdhan Nazeer,Arkin Ai, David Cheong, Arjun Subra-

    manian, Tobias Chen, Hang Wu, Abhinav Rajaseshan, Sarthak Bansal and Celine Wei

    for project participation and feedback.

    I am grateful to people at Meta, Thalmic, Muse and Epson corporations for providing

    the wearables for experimentation and having fun with their emerging wearables.

    Finally, and most importantly, I wish to thank my parents and family whose belief,

    support and well wishes made this experiment come to life for me.

    iii

  • Contents

    Abstract i

    Acknowledgements iii

    List of Figures vi

    List of Tables vii

    Abbreviations viii

    1 Introduction 1

    1.1 Absement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    1.1.1 Integral Kinematics . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    1.1.2 Related Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    1.2 Feedback Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    2 Basic Prototype and Mobile Applications 5

    2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    2.2 Basic Embodiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    2.3 Mobile Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    2.3.1 Fitness based on arduino hardware on destabilizing rings . . . . . 7

    2.3.2 Fitness based on a Mobile device without Arduino . . . . . . . . . 8

    2.3.3 Wobble Board based mobile application . . . . . . . . . . . . . . . 9

    3 Player Concentration using Muse and Moverio Applications 10

    3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    3.2 Neural Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    3.2.1 Data collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    3.2.2 Details of the algorithm . . . . . . . . . . . . . . . . . . . . . . . . 11

    3.3 Epson Moverio Android App . . . . . . . . . . . . . . . . . . . . . . . . . 12

    4 Myo and Meta Spaceglasses 13

    4.1 Myo and Meta Spaceglasses . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    4.2 Games for Mannfit on Spaceglasses . . . . . . . . . . . . . . . . . . . . . . 13

    5 Results 15

    5.1 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    iv

  • Contents v

    6 Conclusion 17

    6.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    6.1.1 Future works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    A Mannfit Mobile Application with Arduino Set Up 19

    A.1 Public Github Repository Url . . . . . . . . . . . . . . . . . . . . . . . . . 19

    A.2 Equipment parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    A.3 Important Code Snippets from android app with Arduino . . . . . . . . . 19

    A.3.1 Initial communication setup between arduino and android . . . . . 19

    A.3.2 Network Communication with Arduino from android . . . . . . . . 20

    B Mannfit Mobile Application without Arduino for Rings 23

    B.1 Public Github Repository Url . . . . . . . . . . . . . . . . . . . . . . . . . 23

    B.2 Equipment parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    B.3 Important Code Snippets from android app without Arduino . . . . . . . 23

    B.3.1 Basic Absement calculation based on gyroscope rotation . . . . . . 23

    C Mannfit Mobile Application wobble Board Set Up 25

    C.1 Public Github Repository Url . . . . . . . . . . . . . . . . . . . . . . . . . 25

    C.2 Equipment parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    C.3 Important Code Snippets from android app for Wobble Board . . . . . . 25

    C.3.1 OpenGl ES code for the bubble centering . . . . . . . . . . . . . . 25

    C.3.2 Fill the bucket as the bubble gets displaced from the center . . . . 27

    D Muse Application Running On Moverio bt-200 Set Up 29

    D.1 Public Github Repository Url . . . . . . . . . . . . . . . . . . . . . . . . . 29

    D.2 Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

    D.3 Important Code Snippets . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

    D.3.1 Basic neural networks classifier . . . . . . . . . . . . . . . . . . . . 29

    E Meta Spaceglasses 32

    E.1 Source Code Rar file Url . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    E.2 Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    E.3 Important Code Snippets . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    E.3.1 Gyroscope movement and songs pitch modulation based on Dis-tance in BoatMovement.cs . . . . . . . . . . . . . . . . . . . . . . . 32

    Bibliography 35

  • List of Figures

    1.1 Derivatives of Displacement . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    1.2 Fitness rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    1.3 Kinematics graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    1.4 A Wearable device/Computer . . . . . . . . . . . . . . . . . . . . . . . . . 4

    2.1 A Wearable device or Computer Feedback loop . . . . . . . . . . . . . . . 5

    2.2 Ball Valve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    2.3 Valve Absement metaphor or reality . . . . . . . . . . . . . . . . . . . . . 7

    2.4 Mobile Application: Bucket filling . . . . . . . . . . . . . . . . . . . . . . 7

    2.5 A simple potentiometer circuit attached . . . . . . . . . . . . . . . . . . . 7

    2.6 Mobile Application: Phone attached to Mannfit . . . . . . . . . . . . . . . 8

    2.7 Mobile Application: Wobble board . . . . . . . . . . . . . . . . . . . . . . 9

    3.1 Muse Application: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    3.2 Muse Headband . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    3.3 Epson Moverio bt-200 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    3.4 Muse Mobile Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    4.1 Myo Arm Band . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    4.2 Meta spaceglasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

    4.3 Car game for spaceglasses . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    4.4 Screenshot of EA Sports game real racing 3 . . . . . . . . . . . . . . . . . 14

    4.5 Screenshots from Meta app . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    4.6 Screenshot from Meta app . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

    5.1 Results on Mannfit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    vi

  • List of Tables

    1.1 Time Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    A.1 List of items for Mannfit android Mobile Application with Arduino . . . . 19

    B.1 List of items for Mannfit android Mobile Application without Arduino . . 23

    C.1 List of items for Mannfit android Mobile Application with WobbleBoard . 25

    D.1 List of items for Mannfit Epson Moverio and Muse for player concentra-tion detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

    E.1 List of items for Mannfit on meta Spaceglasses platform . . . . . . . . . . 32

    vii

  • Abbreviations

    IMU Inertial Measurement Unit

    ANN Artificial Neural Network

    viii

  • Chapter 1

    Introduction

    1.1 Absement

    Figure 1.1: Kinematics generally only considers positive derivatives of displacement,i.e. it often fails to consider also the negative derivatives (integrals) of displacement.

    Figure from [1]

    Concepts like distance, speed, and acceleration appear commonly in sport and fitness.

    Speed is the time-derivative of distance and is thus measured in units of distance divided

    by time (e.g. metres per second or kilometers per hour). Kinematics is the study of

    classical mechanics and the word kinematics comes from the Greek word kinema which

    means movement. Typically the study of kinematics involves displacement (and its

    magnitude, distance), and its time-derivatives: velocity (and its magnitude, speed),

    acceleration, etc., which form an ordered list of derivatives of displacement, as shown

    1

  • Chapter 1. Introduction 2

    in Fig. 1.1. In this context ,the traditional kinematics are referred to as differential

    kinematics. A more complete two-sided conceptualization of kinematics is proposed

    that includes also the time-integrals of displacement. See Fig. 1.3

    Figure 1.2: The study of integral kinematics originated with water flow. The hy-draulophone (underwater pipe organ) exhibits the phenomenon of absement. Thetwo-stage hydraulophone exhibits the phenomenon of absity (the double integral of

    displacement).

    Figure 1.3: Two-sided Kinematics (differential AND integral) of an object (e.g. ballvalve T-handle) undergoing motion. The amount of water flowing through the valve(instrumented with an angle sensor) is the absement of the tilt. Tilt is the distance ofone end from center position, approximately proportional to angle (for small angles).We integrate the absolute value of angle, distance. The bar swings freely through an

    angle of pi /6

  • Chapter 1. Introduction 3

    1.1.1 Integral Kinematics

    The concept of absement was introduced, the time-integral of displacement, and demon-

    strated and how it arises in flow-based processes such as water-based musical instru-

    ments. [2] . See Fig 1.2. Others have also built upon the concept of integrated kine-

    matics and applied it to the field of electrical engineering [3]. More recently, concepts of

    integral kinematics, such as absement (the time-integral of displacement) have entered

    the mainstream high school curriculum and are being explored in science fairs and the

    like [4].

    1.1.2 Related Concepts

    A number of related concepts, also include: momentement, as in the following ordered

    list (each being the time derivative of the one before it): momentement; momentum;

    force; yank; tug; snatch; shake, and also actergy (or total action or Hamiltonian action),

    as shown in the table below:

    Unit First Integral Second Integral

    Power Energy Actergy(Total Action)

    Watt Watt Second(Joules) Joule second

    Strength Endurance Longevity

    Table 1.1: Time Integrals

    where, power is roughly analogous to strength (i.e. short term burst mode output), en-

    ergy is roughly analogous to endurance (i.e. longer-term output), and the new concept,

    actergy, as measured in Joules seconds, is roughly analogous to longevity (i.e. overall

    health) on a much longer time-scale. Integral Kinesiology as the use of integral kine-

    matics in the study of human movement is introduced, towards the goal of long-term

    health and wellness, based on developing lean muscle mass and combining strength, en-

    durance, and fine control, with stability and absemental stability. Next, we review the

    requirements of a wearable computer/device for building such a system.

    1.2 Feedback Loop

    A wearable system [5] should have the aspects mentioned in Fig. 2.1

  • Chapter 1. Introduction 4

    Figure 1.4: Feedback loop of a wearable device/ computer with a human.

    While individual embodiments of wearable computing may use some mixture of these

    concepts, the signal path depicted in Fig 2.1 provides a general framework for comparison

    and study of these systems. Each signal path typically , in fact, include multiple signals,

    hence multiple parallel signal paths are depicted in this figure to make this plurality of

    signals explicit. These features of a feedback loop can enable a user to have an effortless

    experience during the fitness routine.

  • Chapter 2

    Basic Prototype and Mobile

    Applications

    2.1 Introduction

    Figure 2.1: Feedback loop of a wearable device or computer with a human.

    Most sports, fitness training and evaluation is based on differential kinematics. Here

    integral kinematics[6] is explored as a mobile application prototype. In order to do this,

    an apparatus was constructed that required steadiness rather than speed. In particular,

    an existing stability-demanding apparatus, fitness rings was taken and modified by an

    5

  • Chapter 2. Mobile Applications 6

    even greater challenge by incorporation of a destabilizing bar, hung from a single chain.

    A pair of rings were hung to this fitness system, as shown in Fig 2.1.

    2.2 Basic Embodiment

    Figure 2.2: Ball Valves: (1) Ball valve in the closed position. Figure adapted from[7] (2) Ball valve in the open position. Figure adapted from [8] (3-5) Ball Valve withT-handle: (3) T-handle ball valve in the closed position. (4) T-handle ball valve in apartially open position. (5, rightmost) View looking into the end of the valve when it

    is partially open.

    A ball valve is a valve that controls the flow of water using a ball that has a hole drilled

    through the ball. When the ball is turned so the hole is at a right angle (90 degrees)

    from the flow pipe, the water is shut off, as shown in Fig 2.2 (leftmost). When the ball

    is turned so the hole runs along the pipe, the valve is turned on, as shown rightmost in

    Fig 2.2.

    A simple implementation of the MannFit system is based on a bar attached to a ball

    valve, or a ball valve metaphor (e.g. a simulated ball valve running on a smartphone).

    When the bar is straight across, the valve is closed and no fluid flows through the valve.

    When the bar tips away from the horizontal, fluid flows through the ball valve to a

    greater degree when there is a greater tilt.

    A long metal bar attached to the ball valve, together with a flow sensor or virtual flow

    sensor (e.g. tilt sensor), is shown in Fig 2.3. Doing exercises like pull ups, dips, leg

    raises, etc from the bar creates an absemental fluid flow metaphor or reality.

    2.3 Mobile Application

    An Android smartphone app was written for simulating a bucket that fills when the bar

    tilts away from horizontal. See Fig 2.4. The participant attempts to stop (or minimize)

  • Chapter 2. Mobile Applications 7

    Figure 2.3: Valve Absement metaphor or reality: Rings supported by the ball valve:creates a fluid minimization reality or metaphor. Real water (or any liquid such as agreen slime) drips down on the participant when the bar deviates from horizontal. Themore the bar deviates from horizontal, the greater the fluid flow. A goal is to minimize

    total accumulated fluid flow while performing the exercises.

    Figure 2.4: Screen captures of MannFit app, with virtual bucket as time-integratorrunning on smartphone. (rightmost) Simplified version with simply a bar hanging from

    a chain (no rings) and the smartphone attached to the bar

    the filling of the virtual bucket by keeping the bar straight.

    2.3.1 Fitness based on arduino hardware on destabilizing rings

    Figure 2.5: A simple potentiometer circuit [9]

  • Chapter 2. Mobile Applications 8

    The hardware and the devices used for the project are listed in the table in Appendix

    A.

    The arduino based Mannfit application utilizes a wifi shield on it to transmit the tilt

    data. The tilt calcuation based on a potentiometer circuit connected wirelessly to a

    mobile phone via arduino.

    This potentiometer circuit acts as an arduino input for the tilt or angle measurements of

    the tilting rings or bars. Absement was measured as an integral of the net displacement

    of the bar with time in an android mobile app. Also, a weight cell was added to calculate

    the force exerted by the user on the equipment.

    Figure 2.6: Mobile phone directly attached to the Mannfit rings. User attaches theirphone in the provided slot and carries out L seat Pull ups.

    2.3.2 Fitness based on a Mobile device without Arduino

    In this version of the mobile application, instead of using the Arduino, the IMU of the

    mobile phone is used for measuring the instability of the user on the fitness rings. As

    the user tilts the bars, the phone tilts as well. The gyroscope inside the phone is then

    used to measure the net displacement of the user from the horizontal stable position of

    the bar.

    The amount of water in the bucket (virtual) or the amount of real liquid that pours out

    of the valve (Fig 2.3) is equal to the absement of the distance of deviation.

  • Chapter 2. Mobile Applications 9

    Moreover, in actual embodiment, the smart phone functions as the tilt sensor, and the

    valve is entirely virtual, as shown in Fig 2.4, where the IMU becomes the tilt sensor. The

    user attempts to stabilize the bar, thus spilling least amount of water, whose amount is

    used for calculating score. The source code, device specifications and github repository

    have been described in Appendix B

    2.3.3 Wobble Board based mobile application

    Figure 2.7: Example with multidimensional Integral Kinematics in the form of pushups on wobble board which must not touch the floor along any of its perimeter (sensed,

    along with time-integrated tilt), while feet are balanced on a fitness ball.

    Finally, the concept is extended to more dimensions. A wobble board is used instead of

    the bar. The board pivots on a point that touches the ground.It increases the instability

    of the board. The smartphone app senses tilt angle and the magnitude is represented as

    a radius. The time integral of the radius is the variable of interest. In another example,

    the feet are balanced on a fitness ball while the hands are balanced on the board. The

    user does 3 sets of 25 or more MannUps (fitness ball + wobble board pushups) while

    trying to minimize the integrated radius (i.e. stay straight).The source code, device

    specifications and github repository have been described in Appendix C.

  • Chapter 3

    Player Concentration using Muse

    and Moverio Applications

    Figure 3.1: Muse Application on Mannfit

    10

  • Chapter 3. Muse and Moverio Applications 11

    3.1 Introduction

    An android application was made to measure concentration of the user by using the Muse

    wearable EEG headband. Epson Moverio BT-200 was used to display the concentration

    of the user in the form of a head mounted display.

    3.2 Neural Networks

    Figure 3.2: Muse Headband Figure 3.3: Epson Moverio BT-200

    3.2.1 Data collection

    The neural net was initially trained based on Hang Wus information, He trained the

    neural network on himself for a duration of one hour every day for a week. This includes

    30 minutes of morning session and 30 minutes of evening session. A total of 514800 data

    points were collected. 8000 points with high quality were manually selected by him.

    3.2.2 Details of the algorithm

    The neural network includes 43 inputs and 2 outputs. It is a two layer perceptron with

    20 hidden nodes each. The method called Scaled Conjugated gradient backpropagation

    was used. The training time of the algorithm is less than 1s each time. This allowed

    the design of a real-time training algorithm which trained with the users data even

    when the algorithm had ran once already. Auto-correlation was used to test the desired

    output and the experimental output of the dataset provided. The correlation obtained

    was 97.8 percent.

  • Chapter 3. Muse and Moverio Applications 12

    3.3 Epson Moverio Android App

    The mobile version shown in figure 3.4 incorporates the classification algorithm, which

    read the EEG data, classified the data and displayed the results. This application

    currently classify only Wu Hangs states accurately.

    The output of this app is displayed on Epson Moverio bt-200. Both devices support

    the same android platform, Epson Moverio bt-200( figure 3.3) was used to visualize the

    results. Users can work out hands free on this device utilizing the augmented reality

    display.

    Figure 3.4: Muse Mobile Application

  • Chapter 4

    Myo and Meta Spaceglasses

    4.1 Myo and Meta Spaceglasses

    Figure 4.1: Myo Arm Band Figure 4.2: Meta Spaceglasses

    A car game was designed using Myo Arm band (Figure 4.1) gestures to start the car and

    the game could be viewed while working out using Meta spaceglasses(Fig. 4.2) doing

    pull ups on Mannfit as well as driving the car(Fig. 4.3). As the user tilts on the Mannfit

    rings, the car runs off the track. The user uses the bar on the Mannfit as a steering

    wheel and turns the car around. In this embodiment, the goal is synthesis of fitness

    with gaming based on absemental systems. The car game helps the user to focus on the

    game as well exercise thus providing strength as well as a gaming experience.

    4.2 Games for Mannfit on Spaceglasses

    Different applications were developed in unity3d embodying the concept of absement

    similar to the android mobile phone application developed earlier. The two games of

    13

  • Chapter 4. Myo and Meta Spaceglasses 14

    Figure 4.3: Car game for spaceglassesFigure 4.4: Screen shot of EA Sports

    game real racing 3

    pull ups on fitness rings(Fig. 4.5) and push ups on the wobble board(Fig. 4.6) were

    developed in Unity3D game engine. The car racing game used for the purpose of demos

    was real racing 3 by EA Sports. The absement of the user was the deviation of the car

    from the main track into the green grasslands. The source code, device specifications

    and github repository have been described in Appendix E.

    Figure 4.5: Screenshots from MetaApp for rings

    Figure 4.6: Screenshot from MetaApp for wobble board

  • Chapter 5

    Results

    5.1 Results

    Figure 5.1: Results: Unlike traditional sports metrics which have a goal of maximumspeed or acceleration, here the goal of this game is to obtain the lowest absement(lowest time-integrated distance from the stable position) during each cycle (repetition)of the periodic exercise (here, leg-raises). The integral is reset at the beginning of eachrepetition, and grows as distance (from stable point) is integrated. The goal is tominimize the height of each peak. Average absement (average height over all peaksfor each player) were: Arkin: 5.2;Arzhang: 3.56; Pete: 2.34; Steve: 2.07. Here Stevewon this match. These numbers were consistent with the amount of experience eachof the players previously had with the fitness rings (e.g. Steve having been the most

    experienced on the rings, then Pete, etc.).

    Participants were invited to perform standard fitness activities, such as dips, leg-raises,

    and sustained (held) leg-raises (the L-seat static holding of position ), while sensors in

    15

  • Chapter 5. Results 16

    the destabilizing bar provided data to a National Instruments analog to digital converter,

    with a microcontroller simultaneously sending the data to Android and Ios smartphone

    apps, as well as to a portable computer doing real time analysis and display, as well as

    a data logger for fitness training.

    See Fig 5.1 for results. Note that while traditional sports and fitness metrics are based

    on maximizing speed or acceleration (i.e. maximizing derivatives of distance), the goal

    here is minimizing absement (i.e. minimizing the integral of distance from a central

    resting point). Absement is being used as a feedback mechanism for a variety of fitness

    tasks, to create a fun and playful yet effective fitness training program.

  • Chapter 6

    Conclusion

    6.1 Conclusion

    The MannFit system, based on Integral Kinematics, was presented and successfully

    demonstrated through examples such as fitness rings equipped with an instrumented

    destabilizing bar or a wobble board similarly equipped. It was found that experienced

    users of fitness rings were able to maintain low absement (time-integrated distance from a

    central mean position) values. It was found that an absement-based feedback mechanism

    was useful in training, to help develop stability and control. This work suggests that

    we should consider two-sided kinematics (i.e. both Differential Kinematics and Integral

    Kinematics) in sport, fitness, and gaming, not just the traditional one-sided (differential-

    only) kinematics.

    6.1.1 Future works

    In other embodiments the metaphor (or reality) of the app could be that of air flow into

    an inflatable toy. Tilting the bar inflates the toys belly, giving the toy a fat belly. The

    goal can be to keep the toy slender (not fat) by holding the bar straight (level) while

    performing the exercises (pull ups, dips, leg-raises, etc.).

    Also, an integration of various wearables could be carried out with a common backend

    using various platforms such as IBM BlueMix or a custom cloud computing implementa-

    tion. Also, analysis of EMG data of Myo arm band could be correlated with the EEG of

    17

  • Chapter 6. Conclusion 18

    Muse headband. This integration of wearables for integral kineseology will make fitness

    a wholesome experience to the user.

    In the muse application, the complete version of the project could automatically train

    the ANN in the back-end while still performing the classification algorithm, thus it could

    be more adaptive training could be done on the portable device such that it learned and

    evolved over time automatically, and it could achieve a better classification accuracy

    over time. Different wearables could be used to provide user with multiple feedbacks of

    different parts of the body resulting in a better qualitative and quantitative experience.

  • Appendix A

    Mannfit Mobile Application with

    Arduino Set Up

    A.1 Public Github Repository Url

    https://github.com/gulerianitin/Action-Fitness

    A.2 Equipment parts

    Part of Equipment Specifications

    Android PhoneSamsung Galaxy S5 ,Galaxy S2, Nexus 4,Android 4.0.4(No external libraries)

    Arduino Arduino Uno-R3 Board with Wifi Shield

    Voltage Divider Simple Voltage divider circuit

    Rings Mannfit Rings , tilt bar, chains

    Table A.1: List of items for Mannfit android Mobile Application with Arduino

    A.3 Important Code Snippets from android app with Ar-

    duino

    A.3.1 Initial communication setup between arduino and android

    19

  • Appendix A. Mobile Application Arduino 20

    // Open socket for network communication

    Thread openSocketThread = new Thread(new Runnable() {

    @Override

    public void run() {

    Log.d("information", "Opening socket for Arduino

    communication");

    try {

    socket = new Socket(arduinoIP, 7);

    dataOutputStream = new

    DataOutputStream(socket.getOutputStream());

    dataInputStream = new

    DataInputStream(socket.getInputStream());

    } catch (UnknownHostException e) {

    Log.d("error", "Error opening socket: unknown host

    exception");

    e.printStackTrace();

    } catch (IOException e) {

    Log.d("error", "Error opening socket: input/output

    exception");

    e.printStackTrace();

    }

    };

    });

    openSocketThread.start();

    A.3.2 Network Communication with Arduino from android

    // Get new data from Arduino and perform handshake

    Thread networkCommunicationThread = new Thread(

    new Runnable() {

  • Appendix A. Mobile Application Arduino 21

    @Override

    public void run() {

    try {

    // Check if network connection is working

    if ((socket == null || dataInputStream ==

    null || dataInputStream == null) && running) {

    Log.d("error", "Error: sockets and/or I/O

    streams are null - check Arduinos IP");

    //running = false;

    //error = true;

    return;

    }

    // Write byte to socket

    dataOutputStream.writeByte(48);

    // Read bytes from socket

    angleRead =

    dataInputStream.readUnsignedByte();

    Log.d("information", "Read byte: " +

    angleRead);

    weightRead =

    dataInputStream.readUnsignedByte();

    Log.d("information", "Read byte: " +

    weightRead);

    } catch (UnknownHostException e) {

    Log.d("error", "Error: unknown host exception

    during Arduino I/O");

    e.printStackTrace();

    } catch (IOException e) {

    Log.d("error", "Error: inout/output exception

    during Arduino I/O");

    e.printStackTrace();

    }

    };

    });

  • Appendix A. Mobile Application Arduino 22

    networkCommunicationThread.start();

  • Appendix B

    Mannfit Mobile Application

    without Arduino for Rings

    B.1 Public Github Repository Url

    https://github.com/gulerianitin/ActionFitnessMobile/tree/master/src/com/actionfitness/

    rings

    B.2 Equipment parts

    Part of Equipment Specifications

    Android PhoneSamsung Galaxy S5 ,Galaxy S2, Nexus 4,Android 4.0.4(No externallibraries)

    Rings Mannfit Rings , tilt bar, chains

    Table B.1: List of items for Mannfit android Mobile Application without Arduino

    B.3 Important Code Snippets from android app without

    Arduino

    B.3.1 Basic Absement calculation based on gyroscope rotation

    if (centerSet) {

    23

  • Appendix B. Mobile Application without Arduino 24

    // Increase fill amount as required

    currentPercent += Math.abs(currentOffset * 0.01);

    fillingWater.getLayoutParams().height = (int) (360 *

    ((double) Math

    .round(currentPercent * 10) / 1000));

    // Check for overflow

    if (currentPercent >= 100) {

    currentPercent = 100;

    }

    // Save latest data to lists and logs

    angleList.add(currentPercent);

    // Update status information (percent full, time

    // elapsed)

    runningTime = SystemClock.elapsedRealtime()

    - startTime;

    percentFullBox.setText("Bucket: "

    + ((double) Math

    .round(currentPercent * 10) / 10)

    + "% | "

    + "Time: "

    + ((double) Math

    .round(runningTime / 100) / 10)

    + " s");

    // Check if the user has lost

    if (currentPercent == 100 && !overflowed) {

    overflowed = true;

    running = false;

    startStopButton.setText("View Results");

    if (activityrunning) {

    overflowPopup();

    }

    }

  • Appendix C

    Mannfit Mobile Application

    wobble Board Set Up

    C.1 Public Github Repository Url

    https://github.com/gulerianitin/ActionFitnessMobile/tree\/master/src/com/

    actionfitness/wheel

    C.2 Equipment parts

    Part of Equipment Specifications

    Android PhoneSamsung Galaxy S5 ,Galaxy S2, Nexus 4,Android 4.0.4(No external libraries)

    Wobble Board Wobble Board on the floor

    Table C.1: List of Items required for WobbbleBoard

    C.3 Important Code Snippets from android app for Wob-

    ble Board

    C.3.1 OpenGl ES code for the bubble centering

    if(WheelActivity.startButtonClicked)

    25

  • Appendix C. Mobile Application Wobble board 26

    {//sensor data

    sensor_x=event.values[2]/4;//roll

    sensor_y=event.values[1]/4;//pitch

    // sensor_z=event.values[0]/2;//yaw

    }

    //center the bubble when started

    if(WheelActivity.startButtonClicked && offsetNotSet)

    {

    sensor_offsetx=sensor_x;

    sensor_offsety=sensor_y;

    Log.d(TAG,"sensor x and sensor y: "+sensor_offsetx+sensor_offsety);

    offsetNotSet=false;

    }

    sensor_x-=sensor_offsetx;

    sensor_y-=sensor_offsety;

    //make the bubble stay inside the toilet x2+y2>r2 x=x/sqrt(x2+y2)

    if(((sensor_x*sensor_x+sensor_y*sensor_y)>(wheel.radius*we.radius)))

    {

    temp_x=((wheel.radius*sensor_x)/( (float)

    Math.sqrt(sensor_x*sensor_x+sensor_y*sensor_y)));

    temp_y= ((wheel.radius*sensor_y)/((float)

    Math.sqrt(sensor_x*sensor_x+sensor_y*sensor_y)));

    sensor_x=temp_x;

    sensor_y=temp_y;

    }

    //set the score

    score=(float)

    Math.sqrt(sensor_x*sensor_x+sensor_y*sensor_y)*calibrateScore;

    }

  • Appendix C. Mobile Application Wobble board 27

    };

    C.3.2 Fill the bucket as the bubble gets displaced from the center

    public void changeWaterRadius(){

    int waterVertices=0;

    if((score>scoreThreshold) && waterRadius

  • Appendix C. Mobile Application Wobble board 28

    // garbage collector wont throw this away

    waterByteBuff.order(ByteOrder.nativeOrder());

    waterBuff = waterByteBuff.asFloatBuffer();

    waterBuff.put(waterCircleVertices);

    waterBuff.position(0);

    }

  • Appendix D

    Muse Application Running On

    Moverio bt-200 Set Up

    D.1 Public Github Repository Url

    https://github.com/gulerianitin/MuseDrowsiness/blob/master/TestLibMuseAndroid/

    app/src/main/java/com/interaxon/test/libmuse/MainActivity.java

    D.2 Devices

    Device Features

    Epson Moverio(head mounted display) bt-200,running android 4.0.3

    Muse(brain sensing headband) Version 2.0 with Android(v4.0.3)

    Table D.1: Devices for Concentration detection

    D.3 Important Code Snippets

    D.3.1 Basic neural networks classifier

    //based on Matlab Code provided by Hang Wu

    private double[][] yOutput(double[][] x1){

    29

  • Appendix D. Muse Concentration Application 30

    //update x1 in a thread showcasing progressbar

    //hangs program code starts

    // ===== NEURAL NETWORK CONSTANTS initialization code=====

    //--- Input 1---

    // x1_step1_xoffset,x1_step1_gain,x1_step1_ymin

    // implement this, if (x1==nan){x1=0}

    // double[][] x1=new double[43][1];//m =43 n=0

    //for (int i = 0; i < 43; i++) {

    // if(x1[i][0]==NAN){

    // x1[i][0] = 1;}

    //}

    double[][] x1_step1_xoffset=new double[43][1];//m =43 n=0

    for (int i = 0; i < 43; i++) {

    x1_step1_xoffset[i][0] = x1_step_offset[i];

    }

    double[][] x1_step1_gain=new double[43][1];//m =43 n=0

    for (int i = 0; i < 43; i++) {

    x1_step1_gain[i][0] = x1_step_gain[i];

    }

    double[][] x1_step1_ymin=new double[43][1];//m =43 n=0

    for (int i = 0; i < 43; i++) {

    x1_step1_ymin[i][0] = -1;

    }

    //layer1

    //layer2

    //already declared

    //======Simulation=======

    //dimension declared

    //Input 1

  • Appendix D. Muse Concentration Application 31

    xp1=mapminmax_apply(x1,x1_step1_gain,x1_step1_xoffset,x1_step1_ymin);

    //Layer1

    //not using repmat since b1 is the same as repmat(b1,1,1),

    // a1 = tansig_apply(repmat(b1,1,Q) + IW1_1*xp1)

    a1= tansig_apply(Matrix.add(b1, Matrix.multiply(IW1_1,xp1)));

    //Layer2

    //a2 = softmax_apply(repmat(b2,1,Q) + LW2_1*a1); not using repmat

    a2= softmax_apply(Matrix.add(b2, Matrix.multiply(LW2_1,a1)));

    //Output1

    // y1=a2;

    // y1= mean(y1,2); same as a2 in this case hence a2 is the answer

    //testing

    double[][] bar =new double[43][1];

    Matrix.printMatrix(xp1);

    //hangs program code ends

    return a2;

    }

  • Appendix E

    Meta Spaceglasses

    E.1 Source Code Rar file Url

    https://adminmailutoronto-my.sharepoint.com/personal/nitin_guleria_mail_utoronto_

    ca/_layouts/15/guestaccess.aspx?guestaccesstoken=a11ocG%2bJgVkJuLWK5YLFgJkABAtiBS0dqjmyxy%

    2fEUlE%3d&docid=0c265f114686744569f730c554c6f5876

    E.2 Devices

    Device Features

    Meta 1Using meta1 developer kit Unity 5 - 32bitmeta SDK build 1.2.1(both downloaded from Meta Dev Center)

    Table E.1: Features for Meta Spaceglasses platform

    E.3 Important Code Snippets

    E.3.1 Gyroscope movement and songs pitch modulation based on Dis-

    tance in BoatMovement.cs

    //gyroscope code for getting output in x,z plane from angle;

    Quaternion gyroanglesQuat= Input.gyro.attitude;

    Matrix4x4

    quatMatrix=Matrix4x4.TRS(Vector3.zero,gyroanglesQuat,Vector3.one);

    32

  • Appendix E. Meta Spaceglasses 33

    Matrix4x4 scaleMatrix=Matrix4x4.TRS

    (Vector3.zero,Quaternion.identity,new Vector3(1,1,0));//change here for xy

    plane

    Matrix4x4 scaled_Matrix=scaleMatrix*quatMatrix;

    OutVector=scaled_Matrix.MultiplyVector(Vector3.forward);

    forceVector=new Vector3(OutVector.x,0.275f,OutVector.y);

    boatObject.transform.position= forceVector;

    }

    if (firstsensorReading) {

    initialBoatPos = boatObject.transform.localPosition;

    firstsensorReading = false;

    }

    //calculate score

    float relativeBoatpos = (boatObject.transform.localPosition

    - initialBoatPos).magnitude * 100f;

    //min 5.7 max 45

    //instability is

    overallInstability += (int)relativeBoatpos;

    int score = 0;

    if (relativeBoatpos > 5 && relativeBoatpos 10 && relativeBoatpos 15 && relativeBoatpos 20 && relativeBoatpos 25 && relativeBoatpos

  • Appendix E. Meta Spaceglasses 34

    } else if (relativeBoatpos > 30 && relativeBoatpos 35 && relativeBoatpos 40 && relativeBoatpos < 43) {

    GetComponent().pitch = 0.79f;

    score = 0;

    }else if(relativeBoatpos>=43)

    {

    if(GetComponent().pitch>0.0)

    GetComponent().pitch-=0.1f;

    if(GetComponent().pitch

  • Bibliography

    [1] Kinematics and musical instruments by glogger - own work. licensed under cc by-sa

    3.0 via wikimedia commons -. URL http://commons.wikimedia.org/wiki/File:

    Kinematics_and_musical_instruments.svg#/media/File:Kinematics_and_

    musical_instruments.svg.

    [2] R. Janzen S. Mann and M. Post. Hydraulophone design considerations: Absement,

    displacement, and velocity-sensitive music keyboard in which each key is a water jet.

    Proc. ACM International Conference on Multimedia, October 23-27, Santa Barbara,

    USA., 2006, pp. 519528.

    [3] D. Jeltsema. Memory elements: A paradigm shift in lagrangian modeling of elec-

    trical circuits. 7th Vienna Conference on Mathematical Modelling,Nr. 448, Vienna,

    Austria, February 2012.

    [4] R. Bell. 14-year-old from oro-medonte sets her sights on isaac newtons theories.

    Orillia Packet and Times, March 26 2013.

    [5] Steve Mann. Intelligent Image Processing. John Wiley and Sons, November 2 2001.

    ISBN: 0-471-40637-6.

    [6] Mir Adnan Ali Pete Scourboutakos Nitin Guleria Steve Mann, Ryan Janzen. Integral

    kinematics (time-integrals of distance, energy, etc.) and integral kinesiology. Proc.

    IEEE GEM, 2014.

    [7] Ball valve in closed position. . URL http://www.franklinvalve.com/DURASEAL/

    advantages.html.

    [8] Ball valve in open position. . URL http://www.tpub.com/fireman/69.htm.

    [9] Potentiometer diagram. URL http://sub.allaboutcircuits.com/images/05106.

    png.

    35

    AbstractAcknowledgementsList of FiguresList of TablesAbbreviations1 Introduction1.1 Absement1.1.1 Integral Kinematics1.1.2 Related Concepts

    1.2 Feedback Loop

    2 Basic Prototype and Mobile Applications2.1 Introduction2.2 Basic Embodiment2.3 Mobile Application2.3.1 Fitness based on arduino hardware on destabilizing rings 2.3.2 Fitness based on a Mobile device without Arduino 2.3.3 Wobble Board based mobile application

    3 Player Concentration using Muse and Moverio Applications3.1 Introduction3.2 Neural Networks3.2.1 Data collection3.2.2 Details of the algorithm

    3.3 Epson Moverio Android App

    4 Myo and Meta Spaceglasses4.1 Myo and Meta Spaceglasses4.2 Games for Mannfit on Spaceglasses

    5 Results5.1 Results

    6 Conclusion6.1 Conclusion6.1.1 Future works

    A Mannfit Mobile Application with Arduino Set UpA.1 Public Github Repository UrlA.2 Equipment partsA.3 Important Code Snippets from android app with ArduinoA.3.1 Initial communication setup between arduino and androidA.3.2 Network Communication with Arduino from android

    B Mannfit Mobile Application without Arduino for RingsB.1 Public Github Repository UrlB.2 Equipment partsB.3 Important Code Snippets from android app without ArduinoB.3.1 Basic Absement calculation based on gyroscope rotation

    C Mannfit Mobile Application wobble Board Set UpC.1 Public Github Repository UrlC.2 Equipment partsC.3 Important Code Snippets from android app for Wobble BoardC.3.1 OpenGl ES code for the bubble centeringC.3.2 Fill the bucket as the bubble gets displaced from the center

    D Muse Application Running On Moverio bt-200 Set UpD.1 Public Github Repository UrlD.2 Devices D.3 Important Code SnippetsD.3.1 Basic neural networks classifier

    E Meta SpaceglassesE.1 Source Code Rar file UrlE.2 Devices E.3 Important Code SnippetsE.3.1 Gyroscope movement and song's pitch modulation based on Distance in BoatMovement.cs

    Bibliography