肉体言語 Tython

18,886 views

Published on

社内勉強会にて発表した「肉体言語 Tython」の資料です。

Kinect を使ったプログラミング言語を作りました。

https://github.com/gongo/Tython

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
18,886
On SlideShare
0
From Embeds
0
Number of Embeds
13,635
Actions
Shares
0
Downloads
7
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

肉体言語 Tython

  1. 1. TythonWataru MIYAGUNI 2011-05-13 Fri . . . . . .
  2. 2. OutlineIntroductionTython StructureTython Test EnvironmentConclusion . . . . . .
  3. 3. IntroductionTython . . . . . .
  4. 4. What ?Body.... Muscle Language . . . . . .
  5. 5. Muscle Language - -• - . . . . . .
  6. 6. Example ( ) . . . . . .
  7. 7. Tython is …• Interface • Not use keyboard • Not use mouse • Use own body ! muscle !• Programming Style • Exercise • No experience welcome ! . . . . . .
  8. 8. DemoYouTube - Tython Hello, World! . . . . . .
  9. 9. ’Hello, World’ source code . . . . . .
  10. 10. Number of typing191 shots . . . . . .
  11. 11. Takes for success90 minutes . . . . . .
  12. 12. ImpressionExercise!! • • • . . . . . .
  13. 13. LicenseMAHALO License (based on MIT License)Copyright (c) 2011 Wataru MIYAGUNI( ) • • ( ) .(https://github.com/gongo/Tython/raw/development/LICENSE ) . . . . . .
  14. 14. Tython StructureTython . . . . . .
  15. 15. Structure diagram . . . . . .
  16. 16. Tython Detector• Kinect• . . . . . .
  17. 17. Detector Vector − · − = |− ||− | cos θ → → a b → → a b →·− − → .. . cos θ = a b →||→| − − |a b − → − · b = x x +y y +z z →a 1 2 1 2 1 2 −| = → |a x 2+y 2+z 2 1 1 1 . . . . . .
  18. 18. PoseDetector• Kinect ( ) xyz• ( ) Detect . . . . . .
  19. 19. Tythoh PoseDetector SampleTython / src / Detector / OwataPoseDetector.cc . . . . . .
  20. 20. CommandDetector• PoseDetector • ->• Detect . . . . . .
  21. 21. Tython CommandDetector SampleTython / src / Detector / LeftJabCommandDetector.cc . . . . . .
  22. 22. InputMethodDetector Detector Command input string LeftJab “a” RightStraight “@” RightUpper “g” LeftHook ““ Detector Detector Command Thanks . . . . . .
  23. 23. InputMethod SampleTython / src / InputMethod / DefaultInputMethod.cc . . . . . .
  24. 24. Others (Like Typhon)• Compiler • Typhon Typhon Middle language explain aa#{NUM}g pushNUM add to stack a@a#{NUM}g copyNUM copy stack value .. .. • Typhon string binary decimal aa@a@ +0101 5 @@a@a -1010 -10• VM (Virtual Machine) Typhon . . . . . .
  25. 25. Source Code Readinghttps://github.com/gongo/Tython/tree/development . . . . . .
  26. 26. Future (Other Language).NET Framework . . . . . .
  27. 27. IronPython + Tython = ?IronTython . . . . . .
  28. 28. Future (LocusDetector) . . . . . .
  29. 29. LocusDetector Example . . . . . .
  30. 30. Future (Partner)( ) . . . . . .
  31. 31. Partner Example . . . . . .
  32. 32. Tython Test EnvironmentTython . . . . . .
  33. 33. Using Testing Framework• GoogleTest • Google C++ Testing Framework http://code.google.com/p/googletest/ • Google Test http://opencv.jp/googletestdocs/ . . . . . .
  34. 34. GoogleTest Sample 1 ASSERTTEST_F(VectorTest, TestDot) { Vector vec1(3.0f, 0.0f, 0.0f); Vector vec2(0.0f, 1.0f, 0.0f); Vector vec3(1.0f, 1.0f, 1.0f); Vector vec4(-12.0f, 0.0f, 0.0f); ASSERT_EQ( 1.0f, vec1.dot(vec1)); // ( ) ASSERT_EQ( 0.0f, vec1.dot(vec2)); // ASSERT_LT( 0.0f, vec1.dot(vec3)); // ASSERT_EQ(-1.0f, vec1.dot(vec4)); // ( ) ASSERT_GT( 0.0f, vec3.dot(vec4)); //} . . . . . .
  35. 35. GoogleTest Sample 2/** * * 1. push 7 #=> aaaaaag * 2. push 2 #=> aaa@a@g * 3. add #=> @aaa stack top 2+7 = 9 * 4. num_out #=> @ a@ stack top */insns = compiler->compile("aaaaaagaaa@a@g@aaa@ a@");testing::internal::CaptureStdout();object->run(insns);ASSERT_STREQ("9", testing::internal::GetCapturedStdout().c_str()); . . . . . .
  36. 36. Problem about testing …1.. PoseDetector • • (Kinect)2.. CommandDetector • hogehoge • sleep() • • 1,2 • Kinect (30 ) • . . . . . .
  37. 37. GoogleMock • Google C++ Mocking Framework http://code.google.com/p/googlemock/ • Google Mock http://opencv.jp/googlemockdocs/ . . . . . .
  38. 38. How?• Tython / test / CommandDetectorTest.cc• Tython / test / LeftJabCommandDetectorTest.cc . . . . . .
  39. 39. Coveragehttp://gongo.github.com/hago/30_tython_coverage/index.html . . . . . .
  40. 40. Conclusion• Kinect • •• • • ( o )• TDD • Kinect • . . . . . .
  41. 41. Finish!! GKD(Gongo Kinect Diet) . . . . . .

×