# HG changeset patch # User Robert McIntyre # Date 1342887527 18000 # Node ID 4f5a5d5f161365c5bd78b2295786e5c8bb3cf989 # Parent 0efa36180e8a8d7147d3ae77a7521251d6e680ff added time dialation display for test suite. diff -r 0efa36180e8a -r 4f5a5d5f1613 org/body.org --- a/org/body.org Sat Jul 21 10:03:02 2012 -0500 +++ b/org/body.org Sat Jul 21 11:18:47 2012 -0500 @@ -579,11 +579,14 @@ (ns cortex.test.body (:use (cortex world util body)) (:import - (com.aurellem.capture Capture RatchetTimer) + (com.aurellem.capture Capture RatchetTimer IsoTimer) (com.jme3.math Quaternion Vector3f ColorRGBA) java.io.File)) #+end_src +#+results: test-header +: java.io.File + * Source - [[../src/cortex/body.clj][cortex.body]] - [[../src/cortex/test/body.clj][cortex.test.body]] diff -r 0efa36180e8a -r 4f5a5d5f1613 org/hearing.org --- a/org/hearing.org Sat Jul 21 10:03:02 2012 -0500 +++ b/org/hearing.org Sat Jul 21 11:18:47 2012 -0500 @@ -1027,8 +1027,8 @@ hearing. When you play a sound, the bar should display a waveform. Keys: - : play sound" - + : play sound + l : play hymn" ([] (test-worm-hearing false)) ([record?] (let [the-worm (doto (worm) (body!)) @@ -1051,14 +1051,17 @@ (if value (.play hymn)))}) (fn [world] (light-up-everything world) + (let [timer (IsoTimer. 60)] + (.setTimer world timer) + (display-dilated-time world timer)) (if record? (do (com.aurellem.capture.Capture/captureVideo world - (File."/home/r/proj/cortex/render/worm-audio/frames")) + (File. "/home/r/proj/cortex/render/worm-audio/frames")) (com.aurellem.capture.Capture/captureAudio world - (File."/home/r/proj/cortex/render/worm-audio/audio.wav"))))) + (File. "/home/r/proj/cortex/render/worm-audio/audio.wav"))))) (fn [world tpf] (hearing-display @@ -1067,6 +1070,9 @@ (File. "/home/r/proj/cortex/render/worm-audio/hearing-data")))))))) #+end_src +#+results: test-hearing-2 +: #'cortex.test.hearing/test-worm-hearing + In this test, I load the worm with its newly formed ear and let it hear sounds. The sound the worm is hearing is localized to the origin of the world, and you can see that as the worm moves farther away from @@ -1170,9 +1176,13 @@ (:import java.io.File) (:import com.jme3.scene.Node com.jme3.system.AppSettings - com.jme3.math.Vector3f)) + com.jme3.math.Vector3f) + (:import (com.aurellem.capture Capture IsoTimer RatchetTimer))) #+end_src +#+results: test-header +: com.aurellem.capture.RatchetTimer + * Source Listing - [[../src/cortex/hearing.clj][cortex.hearing]] - [[../src/cortex/test/hearing.clj][cortex.test.hearing]] diff -r 0efa36180e8a -r 4f5a5d5f1613 org/movement.org --- a/org/movement.org Sat Jul 21 10:03:02 2012 -0500 +++ b/org/movement.org Sat Jul 21 11:18:47 2012 -0500 @@ -185,6 +185,8 @@ #+name: test-movement #+begin_src clojure +(in-ns 'cortex.test.movement) + (defn test-worm-movement "Testing movement: You should see the worm suspended in mid air and a display on the @@ -217,13 +219,16 @@ (if value (swap! muscle-exertion (fn [v] (- v 20)))))}) (fn [world] + + (let [timer (RatchetTimer. 60)] + (.setTimer world timer) + (display-dilated-time world timer)) (if record? (Capture/captureVideo world (File. "/home/r/proj/cortex/render/worm-muscles/main-view"))) (light-up-everything world) (enable-debug world) - (.setTimer world (RatchetTimer. 60)) (set-gravity world (Vector3f. 0 0 0)) (.setLocation (.getCamera world) (Vector3f. -4.912815, 2.004171, 0.15710819)) @@ -237,6 +242,9 @@ (File. "/home/r/proj/cortex/render/worm-muscles/muscles")))))))) #+end_src +#+results: test-movement +: #'cortex.test.movement/test-worm-movement + * Video Demonstration #+begin_html diff -r 0efa36180e8a -r 4f5a5d5f1613 org/proprioception.org --- a/org/proprioception.org Sat Jul 21 10:03:02 2012 -0500 +++ b/org/proprioception.org Sat Jul 21 11:18:47 2012 -0500 @@ -272,11 +272,13 @@ [root standard-debug-controls (fn [world] + (let [timer (RatchetTimer. 60)] + (.setTimer world timer) + (display-dilated-time world timer)) (if record? (Capture/captureVideo world (File. "/home/r/proj/cortex/render/proprio/main-view"))) - (.setTimer world (com.aurellem.capture.RatchetTimer. 60)) (set-gravity world (Vector3f. 0 0 0)) (enable-debug world) (light-up-everything world)) @@ -363,7 +365,7 @@ #+name: test-proprioception-header #+begin_src clojure (ns cortex.test.proprioception - (:import (com.aurellem.capture Capture RatchetTimer)) + (:import (com.aurellem.capture Capture RatchetTimer IsoTimer)) (:use (cortex util world proprioception body)) (:import java.io.File) (:import com.jme3.bullet.control.RigidBodyControl) @@ -371,6 +373,9 @@ (:import (com.jme3.math Vector3f Quaternion ColorRGBA))) #+end_src +#+results: test-proprioception-header +: com.jme3.math.ColorRGBA + * Source Listing - [[../src/cortex/proprioception.clj][cortex.proprioception]] - [[../src/cortex/test/touch.clj][cortex.test.proprioception]] diff -r 0efa36180e8a -r 4f5a5d5f1613 org/touch.org --- a/org/touch.org Sat Jul 21 10:03:02 2012 -0500 +++ b/org/touch.org Sat Jul 21 11:18:47 2012 -0500 @@ -552,6 +552,9 @@ standard-debug-controls (fn [world] + (let [timer (IsoTimer. 60)] + (.setTimer world timer) + (display-dilated-time world timer)) (if record? (Capture/captureVideo world @@ -566,6 +569,9 @@ (File. "/home/r/proj/cortex/render/touch-cube/touch/")))))))) #+end_src +#+results: test-touch-1 +: #'cortex.test.touch/test-basic-touch + ** Basic Touch Demonstration #+begin_html @@ -656,6 +662,9 @@ standard-debug-controls (fn [world] + (let [timer (IsoTimer. 60)] + (.setTimer world timer) + (display-dilated-time world timer)) (if record? (Capture/captureVideo world @@ -670,6 +679,9 @@ (File. "/home/r/proj/cortex/render/worm-touch/touch/")))))))) #+end_src +#+results: test-touch-2 +: #'cortex.test.touch/test-worm-touch + ** Worm Touch Demonstration #+begin_html
@@ -747,11 +759,14 @@ (ns cortex.test.touch (:use (cortex world util sense body touch)) (:use cortex.test.body) - (:import com.aurellem.capture.Capture) + (:import (com.aurellem.capture Capture IsoTimer)) (:import java.io.File) (:import (com.jme3.math Vector3f ColorRGBA))) #+end_src +#+results: test-touch-header +: com.jme3.math.ColorRGBA + * Source Listing - [[../src/cortex/touch.clj][cortex.touch]] - [[../src/cortex/test/touch.clj][cortex.test.touch]] diff -r 0efa36180e8a -r 4f5a5d5f1613 org/vision.org --- a/org/vision.org Sat Jul 21 10:03:02 2012 -0500 +++ b/org/vision.org Sat Jul 21 11:18:47 2012 -0500 @@ -492,13 +492,19 @@ (if record? (File. "/home/r/proj/cortex/render/vision/2"))) BufferedImage!)) + (let [timer (RatchetTimer. 60)] + (.setTimer world timer) + (display-dilated-time world timer)) ;; This is here to restore the main view - ;; after the other views have completed processing + ;; after the other views have completed processing (add-camera! world (.getCamera world) no-op))) (fn [world tpf] (.rotate candy (* tpf 0.2) 0 0)))))) #+end_src +#+results: test-1 +: #'cortex.test.vision/test-pipeline + #+begin_html