Final project outline - Fly like an Eagle

Abstract: 

A game that utilizes google earth to allow game players to fly around the planet like a bird, as the method for locomotion is flapping and tilting.

Purpose: 

To give myself something I’ve always wanted - the feeling of bird flight. Also, to show players what climate change impact look like from a ‘first hand’ perspective. Finally to pull players out of their comfort zone by having them perform a humiliating task in a non-humiliating manner - since no matter who you are you will look silly while playing. This allows people from various background to more easily connect over a shared experience that is at once light, fun, engaging, and stimulating of dialogue (hopefully surrounding critical issues pertaining to our planet and societies).

Description:

After some research and talking to classmates I believe I have found the parameters of my project - Fly like an Eagle. At first I believed I had to use Unity and a 3rd party tool called PlexEarth in order to turn Google Earth into a game. Yet in ICM Dom Chang alerted me to the flight simulator within Google Earth itself. A cursory youtube search immediately revealed the method for modding the program. It’s actually pretty straightforward for the most part - Google Earth has good clear organization for the various elements and objects in the application.  I was also just alerted today to something we will do in animation quite soon - using Kinect and Unity (and After Effects?) to create 3D characters mapped to an individuals actions.  Combining these via p5.js to display a bird flying throughout planet earth is my immediate intention. To keep people playing is the next task. Of course, kids and adults will be excited by just flying around using their flappng arms as locomotion - seeing new sights and pretending to be a bird. That alone is something many minds have pined after for millennia. However for those that this is not enough - albeit we are living in an age of minimal attention span - I would like to give them something to latch on to and purposefully explore: areas affected by climate change was my main thought - through a time toggle button, and proposed to me was to fly along bird migratory routes, find a place from a photo or name, race a friend to place, or find your friend in another area like hide and go seek. There are likely many more concepts to explore, but these are a few great ones. 

Technical Plan:

Raspberry pi/p5.js 

  • Load:
    • google earth 
    • On screen notations
      • Time played
      • altitude
      • Location
    • Input from Arduino
    • Input from Kinect
    • Display character
  • Managing on screen controls
  • Voice control that listens to a place input and finds a lat/long to send the user to 
    • “Seattle” - screen rapidly shifts to Seattle

Hacking google earth/ things to modify

  • eagle file (plane/bird object)
    • approach function 
    • cruise function
    • thrust input 
    • turn input
    • speed/weight
  • key inputs (for testing)
  • Add file - sensor inputs 
    • Non-joystick or keyboard
    • From Arduino
  • Modify display allowing user to choose eagle from list 

Arduino/Raspberry pi

  • Accelerometer(s) on person
  • Distance sensor(s)(?) to track 
  • Big ground step-buttons
    • Start game
    • Stop game
    • toggle game type

Kinect

  • Capture actions
  • Map movements to bird visual character

Rough Visual Outline

visual outline eagle-flight-game.jpg

Video showing physical action

Initial getting hooked up to the Kinect.

Some more video - of a screengrab - to show that I've got a ball to move around the screen based on whether or not your head is ahead of your hips. And whether or not it's to the left or right of center. This allows the object to move around in a manageable manner. Also, I show a closer look of the bird shape that more directly mimics the motion of your body in space.

 

Source code - http://alpha.editor.p5js.org/samchasan/sketches/H1idZsDkf

http://alpha.editor.p5js.org/samchasan/sketches/SyOkvbKJf

Play Testing / notes:

  • People love the idea of going through time, and flapping as locomotion
  • Idea proposed of going forward in time, or going through a portal to transport in time
  • Just flying less compelling
  • Accelerometer on hand to switch between gas/brake - more natural than clicking a button
  • General feedback is delight.
  • Aesthetics - wings, jacket, helmet, sunglasses as props can go a long way
  • Audio response/feedback can go a long way - cah! to get birds to spread around, for example. 

Hello World!

I soldered up a accelerometer + gyrometer, hooked it up to an arduino, and got this code. I'm still very unclear about the next steps, but at least that is now taken care of... 

Screen Shot 2017-11-13 at 4.29.00 PM.png

Google Earth files to edit

%
% F-16.
%

model_name = 'F-16 Fighting Falcon'

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Minimum eyepoint distance to objects.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
d_E_min = 4

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Approach speed, power and flap setting.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
V_approach = 130
D_F_approach = .4
D_P_approach = .1

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Cruise speed, power and flap setting.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
V_cruise = 330
D_F_cruise = 0
D_P_cruise = .4

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Constants for terrain elevation filters.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
spring_e_T = 80
damper_e_T = 15

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Spring/damper constants for camera rotation.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Critical damping: spring = damper^2/4.
spring_vertical = 80
damper_vertical = 15
spring_horizontal = 80
damper_horizontal = 15

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Collision vertices.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
p_v = [
  % Main gear.
  [ -9.27 -1.18 .05 ]
  [ -9.27  1.18 .05 ]
  % Nose gear.
  [ -5.26  0    .05 ]
  % Top of vertical stabilizer.
  [ -14.88 0 -5.19 ]
  % A point on the belly for gear-up landings.
  [ -8.4 0 -1.3 ]
  % Nose
  [ 0 0 -1.6 ]
  % Main wingtips.
  [ -10.91 -5.04 -1.75 ]
  [ -10.91  5.04 -1.75 ]
  % Elevator wingtips.
  [ -14.19 -2.82 -1.53 ]
  [ -14.19  2.82 -1.53 ]
]

% Main and nose gear (first 3 vertices) go away when gear is up.
first_fixed = 3

% Spring/damper format:
% [ C_0 C_s C_d f F_max ]
spring_damper = [
  [ 2500 500e3 100e3 .05 800e3 ]
  [ 2500 500e3 100e3 .05 800e3 ]
  [ 1500 500e3 100e3 .05 800e3 ]
]

% Contact patch format:
% [ C_r_0 C_r C_b C_y K_s K_d C_max_x C_max_y b dalpha_dDR ]
contact_patch = [
  [ 81 .003 64e3 6e4  180e3 100e3 .8 .5 1.4 0   ]
  [ 81 .003 64e3 6e4  180e3 100e3 .8 .5 1.4 0   ]
  [ 81 .003 64e3 6e4  180e3 100e3 .8 .1 1.4 .3  ]
]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Power plant.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Jet engine:  power lever controls thrust.
P_max = 130e7
F_max = 130e3
P_ratio_reverse = 0
P_ratio_alpha = 1.2
p_T_v = [ [ -14.5 0 -1.83 ] ]
d_T_v = [ [ 1 0 0 ] ]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Eye point.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
p_E_v = [ -3.66 0 -2.71 ]

% Reference values.

b = 9.2
c_bar = 3.45

% collision model values, leave at 1 for now.
d_ref = 1
v_ref = 1
F_ref = 1

% Mass/cm/inertia.

m = 12000

J = [
  [ 12800 0     1330  ]
  [ 0     57600 0     ]
  [ 1330  0     85500 ]
]

% CM @ 0.35 c_bar

p_CM_v = [ -8.4 0 -1.83 ]
p_AC_v = [ -8.4 0 -1.83 ]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Aerodynamics
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Forces.
alpha_z_0_deg = -.3
dalpha_z_deg_dDF = -6
C_D_0 = 0.0188809
dC_D_dDG = .02
dC_D_dDF = .03
dC_L_dalpha_deg = .06
dC_L_dS = -1.2
C_L_max_0 = 1.1
dC_L_max_dDF = .2
d2C_D_dC_L2 = 0.264818
d2C_D_dC_Y2 = .8
dC_Y_dDR = 0
dC_Y_dbeta_deg = .008
dC_Y_dp_hat = 0
dC_Y_dr_hat = 0

% Moments.
% Pitch.
C_m_0 = 0
dC_m_dDE = .2
dC_m_dDE_T = .06
dC_m_dDF = 0
dC_m_dDG = 0
dC_m_dS = -.15
dC_m_dq_hat = -18
dC_m_dalpha_deg = -.008
d2C_m_dbeta2 = 0
% Roll.
dC_l_dDA = .008
dC_l_dDR = 0
dC_l_dbeta_deg = 0
dC_l_dp_hat_0 = -.15
dC_l_dr_hat_0 = 0
ddC_l_dp_hat_0_dS = 2
ddC_l_dr_hat_0_dS = 1
dC_l_dp_hat_max = .01
% Yaw.
dC_n_dDA = -.01
dC_n_dDR = .03
dC_n_dbeta_deg = 0.0015
dC_n_dp_hat = 0
dC_n_dr_hat = -3


% Quadratic axis damping terms.
d2C_m_dq_hat2 = -5
d2C_l_dp_hat2 = -5
d2C_n_dr_hat2 = -1
%
% Joystick controls for typical PC joystick.
%
% Controller axes are numbered from A0 to A[n-1], (n is the number of axes).
% Controller buttons are number from B0 to B[m-1], (m is the number of
% buttons).
%
% Variable names are:
%   DF, DG:  Flaps, gear (0 = retracted, 1 = extended)
%   DA, DE, DR:  Aileron, elevator, rudder (-1..1).
%   DE_T:  Elevator trim (-1..1).
%   DP_i:  i-th power lever (counting from 0; (0..1)).
%   DB_i:  i-th wheel brake (counting from 0 (left brake); (0..1))
%
% Manipulators are:
% Axes:
%   set(var, value, offset):  Set var to "(axis position) * value + offset"
%     Axis position is between 0 and 1
%
% Buttons:
%   set(var, value):  Set var to value.
%   add(var, delta, min, max):  Add delta to var, keep it between min and max.
%   toggle(var):  Set var to 0 if it's 1 or to 1 otherwise.
%   toggle(var, min, max, step) Change var between min and max adding step.
%

%
% The controllers_supported section defines controllers supported by this
% configuration file.  The block consists of the sequence of "controller"
% expressions.  Controllers mapped by the Flight Simulator have to match at
% least one of the "Controller" expressions.  The expression consists of five
% parts (controller name, minimal number of buttons, maximal number of buttons,
% minimal number of axes, maximal number of axes).  The controller name is a
% regular expression that has to match the product name reported by the USB
% layer.  All conditions have to be fulfilled for the configuration file to be
% used.
%

%
% Generic controls for a single-engine aircraft.  Supports elevator, aileron,
% power and rudder and one POV to set the horizontal angle if present.
%

controllers_supported = [
  Controller('*', 0, 100, 0, 100)
]

button_press = [
]

axes = [
  A1  set(DE, 1.0, 0.0)
  A0  set(DA, 1.0, 0.0)
  A2  set(DP_0, -0.5, 0.5)
  A3  set(DR, 1.0, 0.0)
]

povs = [
  P0  set(HAngle, 1.0, 0.0)
]