User Tools

Site Tools


blog:spring2016:ahoover3:journal

This is an old revision of the document!


HPC Experience ][ Journal

January 29th, 2016

Today, Chris and I humored the idea and checked out the possibility of coding an application for the Leap Motion. We share an idea for gesture control on computers for a more user-friendly control experience. The Leap Motion is a simple device that has an array of 3 infrared cameras. this allows it to see a large spectrum above the desk in front of the computer. It is small and compact, and is perfect for our needs on this project. Next Monday, I plan to begin setup and download the necessary sdk files, which they provide for free for developers online.

February 1st, 2016

New month, new things brewing. Today I began the installation and setup of the Leap Motion and its sdk. The sdk gives helpful example codes and libraries that will help with the understanding of how to code and use the data that the leap motion collects in order to provide output. I have decided to use javascript to code what I want, since I would like to learn the language, and it is also very easy to display in a browser and manipulate in real time.

I plan to make some simple programs first in order to understand the ins and outs of the data and manipulations, and then go from there. After I have garnered an acceptable understanding, I want to start using the leap motion to recognize gestures and translate them to key emulations. This will allow me to start making gesture controls for the computer, which is the main end goal.

February 3rd, 2016

Today I went through the javascript tutorial for a simple leap motion app. It takes an image of a cat (how fitting) and moves it in respect to the hand in front of it. I learned that the leap service that is running creates a local websocket server that LeapJS connects to. This allows for real time data transfer to and from the browser, which is crucial to smooth performance of the Leap Motion. Using the websocket, the service sends a data frame roughly every 10ms. The deviceFrame object is not used directly by the browser, but instead creates an animation loop using the controller's animation frames.

You can access the movements of fingers and bones through their names, like thumb, pinky, carpal, proximal, medial and distal. Important Orientation Information

February 5th, 2016

I was able to find a very useful file in the sdk named “sample.html”. This was very useful in showing just what The leap motion sees from a data standpoint, and depicts the output of a frame.

This is a sample frame collected by the leap:

Frame data:

Frame ID: 32565

Timestamp: 2003436343 µs

Hands: 1

Fingers: 5

Tools: 0

Gestures: 1

Translation: (8.7, 2.0, -0.2) mm

Rotation axis: (-0.36, 0.91, 0.20)

Rotation angle: 0.03 radians

Scale factor: 1.01

Hand data:

Hand ID: 13

Type: right hand

Direction: (-0.25, 0.43, -0.87)

Palm position: (70.7, 178.1, -6.3) mm

Grab strength: 0.0322437

Pinch strength: 0

Confidence: 0.892863

Arm direction: (-0.5, 0.3, -0.8)

Arm center: (157.6, 116.2, 147.2)

Arm up vector: (0.1, 0.9, 0.3)

Translation: (8.7, 2.0, -0.2) mm

Rotation axis: (-0.4, 0.9, 0.2)

Rotation angle: 0.03 radians

Scale factor: 1.01

Fingers IDs: 130, 131, 132, 133, 134

Finger and tool data:

Pointable ID: 130

Type: Thumb

Belongs to hand with ID: 13

Classified as a finger

Length: 51.4 mm

Width: 20.0 mm

Direction: (-0.76, 0.14, -0.63)

Extended?: true

Metacarpal bone

Center: (64.2, 148.2, 46.0)

Direction: (-0.6, 0.4, -0.7)

Up vector: (-0.6, 0.3, 0.8)

Proximal phalanx bone

Center: (42.3, 153.2, 35.9)

Direction: (-0.9, 0.2, -0.4)

Up vector: (-0.4, 0.2, 0.9)

Intermediate phalanx bone

Center: (7.6, 160.7, 15.2)

Direction: (-0.8, 0.1, -0.6)

Up vector: (-0.6, 0.2, 0.8)

Distal phalanx bone

Center: (-15.9, 165.7, 0.8)

Direction: (-0.9, 0.2, -0.3)

Up vector: (-0.3, 0.2, 0.9)

Tip position: (-20.4, 165.3, -2.4) mm

Pointable ID: 131

Type: Index finger

Belongs to hand with ID: 13

Classified as a finger

Length: 58.0 mm

Width: 19.1 mm

Direction: (-0.35, -0.26, -0.90)

Extended?: true

Metacarpal bone

Center: (56.5, 180.6, 11.4)

Direction: (-0.4, 0.3, -0.9)

Up vector: (0.1, 1.0, 0.3)

Proximal phalanx bone

Center: (33.4, 194.6, -39.2)

Direction: (-0.4, 0.2, -0.9)

Up vector: (0.0, 1.0, 0.2)

Intermediate phalanx bone

Center: (21.5, 194.8, -69.4)

Direction: (-0.3, -0.3, -0.9)

Up vector: (-0.1, 1.0, -0.2)

Distal phalanx bone

Center: (15.0, 187.0, -86.7)

Direction: (-0.3, -0.6, -0.8)

Up vector: (-0.2, 0.8, -0.5)

Tip position: (13.9, 182.5, -89.2) mm

Pointable ID: 132

Type: Middle finger

Belongs to hand with ID: 13

Classified as a finger

Length: 66.1 mm

Width: 18.8 mm

Direction: (-0.32, -0.26, -0.91)

Extended?: true

Metacarpal bone

Center: (72.5, 182.5, 6.1)

Direction: (-0.3, 0.3, -0.9)

Up vector: (0.2, 0.9, 0.2)

Proximal phalanx bone

Center: (56.0, 196.3, -47.9)

Direction: (-0.3, 0.2, -1.0)

Up vector: (0.2, 1.0, 0.1)

Intermediate phalanx bone

Center: (45.2, 196.4, -83.3)

Direction: (-0.3, -0.3, -0.9)

Up vector: (0.1, 1.0, -0.3)

Distal phalanx bone

Center: (37.5, 187.7, -103.2)

Direction: (-0.3, -0.5, -0.8)

Up vector: (-0.0, 0.8, -0.6)

Tip position: (35.6, 183.5, -106.0) mm

Pointable ID: 133

Type: Ring finger

Belongs to hand with ID: 13

Classified as a finger

Length: 63.6 mm

Width: 17.8 mm

Direction: (-0.30, -0.24, -0.92)

Extended?: true

Metacarpal bone

Center: (89.1, 180.5, 3.3)

Direction: (-0.1, 0.3, -0.9)

Up vector: (0.3, 0.9, 0.2)

Proximal phalanx bone

Center: (80.1, 193.0, -47.2)

Direction: (-0.2, 0.2, -1.0)

Up vector: (0.3, 1.0, 0.1)

Intermediate phalanx bone

Center: (71.5, 193.2, -81.1)

Direction: (-0.3, -0.2, -0.9)

Up vector: (0.2, 0.9, -0.3)

Distal phalanx bone

Center: (64.1, 185.0, -100.8)

Direction: (-0.3, -0.5, -0.8)

Up vector: (0.1, 0.8, -0.6)

Tip position: (62.2, 181.2, -103.6) mm

Pointable ID: 134

Type: Pinky finger

Belongs to hand with ID: 13

Classified as a finger

Length: 49.9 mm

Width: 15.8 mm

Direction: (-0.08, -0.26, -0.96)

Extended?: true

Metacarpal bone

Center: (104.4, 172.7, 1.0)

Direction: (-0.0, 0.3, -0.9)

Up vector: (0.5, 0.8, 0.3)

Proximal phalanx bone

Center: (106.9, 184.3, -43.2)

Direction: (0.2, 0.1, -1.0)

Up vector: (0.5, 0.9, 0.2)

Intermediate phalanx bone

Center: (108.9, 184.4, -69.5)

Direction: (-0.1, -0.3, -1.0)

Up vector: (0.5, 0.8, -0.3)

Distal phalanx bone

Center: (105.9, 177.3, -85.6)

Direction: (-0.3, -0.5, -0.8)

Up vector: (0.4, 0.7, -0.6)

Tip position: (103.3, 174.9, -87.8) mm

Gesture data:

Gesture ID: 1, type: swipe, state: start, hand IDs: 13, pointable IDs: 132, duration: 0 µs, start position: (-44.9, 154.0, -86.2) mm, current position: (35.9, 185.0, -107.1) mm, direction: (0.9, 0.3, -0.2), speed: 216.7 mm/s

/ There is a lot of data to interpret, and discerning what is going to be useful to my implementation and what isn't is going to be difficult. ====February 8th, 2016==== ======Systems Programming Journal====== ====January 21st, 2016==== * unistd equates to unix standard * header files are a good source of documentation * asm-generic/errno-base.h: gives error code names * apropos is really useful * man 3 getopt - play with it Day 2: implementing cat2.c, the updated version. We are using the read function instead of read, open for fopen, and write instead of printf for more universality. These are system calls. posix standard allows for universal system error codes, among other things. It defines system behaviors. fopen returns FILE* (which is a struct), but open returns an int, which is known as a file descriptor. fdopen takes a file descriptor and creates a file pointer in order to cross between the two. For next time * what does the system call to chmod do? * command line arguments * -e, -n, help and version implementation * user include directory * look at getopt; see above ====January 26th, 2016==== Continuing the making of cat2.c implementing getopt so that we can use: * -n –number * -E –show-ends * –help * –version ====January 28th, 2016==== Moving on from cat into the “who” command! /var/log/wtmp* → shows login data into lab 46. apropos utmp → u stands for user. See section 5 for configuration items. The header files are located within this file. (man 5 utmp) Manual page utmp(5) line 26: shows the ut_type translations. when logging in, ssh calls the login command, and login makes note of the login. POSIX Portable Operating System Interface, a set of formal descriptions that provide a standard for the design of operating systems, especially ones that are compatible with Unix. Origin 1980s: from the initial letters of portable operating system + -ix suggested by Unix. Life before POSIX = madness. BSD - Berkeley Standard Distribution (from UC Berkeley) man gettimeofday, man ctime ====February 2nd, 2016==== Adjusted the time output to include month, day hour and min using the tm struct. Chmod (change mode) section 2 . we are using the chmod files in order to implement the + & - in our own implementation of who. (who2) %o prints out in octal stat man page including sys/types.h & sys/stat.h Today we created who2.c as a more functional and closer looking version to the actual who command. Our first project is to create a version of chmod command. * include sys/stat.h ====February 4th, 2016==== Today, we are taking on the program of “ls”. In order to do this, we use man pages such as closedir, opendir, readdir, scandir. When printing out, we use the attributes of the directory which are name, inode, type, etc. In scandir, we begin to see the insane (yet still understandable) use of double and even triple pointers. woot. Alphasort helps us put our results in alphabetical order. : we are using the extra libraries of <sys/types.h> and <dirent.h> Section 2 stat man page. displaying file permissions is tedious as all hell. At least in the way that we did it.

blog/spring2016/ahoover3/journal.1454948556.txt.gz · Last modified: 2016/02/08 16:22 by ahoover3