diff org/test-creature.org @ 188:22548d48cc85

added debug for vision
author Robert McIntyre <rlm@mit.edu>
date Sat, 04 Feb 2012 10:00:37 -0700
parents cfb71209ddc6
children facc2ef3fe5c
line wrap: on
line diff
     1.1 --- a/org/test-creature.org	Sat Feb 04 09:42:19 2012 -0700
     1.2 +++ b/org/test-creature.org	Sat Feb 04 10:00:37 2012 -0700
     1.3 @@ -109,20 +109,6 @@
     1.4  ;; higher level --- sense/effector
     1.5  ;; these are the functions that provide world i/o, chinese-room style
     1.6  
     1.7 -
     1.8 -(defn debug-vision-window
     1.9 -  "creates function that offers a debug view of sensor data"
    1.10 -  []
    1.11 -  (let [vi (view-image)]
    1.12 -    (fn 
    1.13 -      [[coords sensor-data]]
    1.14 -      (let [image (points->image coords)]
    1.15 -        (dorun
    1.16 -         (for [i (range (count coords))]
    1.17 -           (.setRGB image ((coords i) 0) ((coords i) 1)
    1.18 -                   (sensor-data i))))
    1.19 -        (vi image)))))
    1.20 -
    1.21  (defn debug-hearing-window
    1.22    "view audio data"
    1.23    [height]
    1.24 @@ -135,7 +121,7 @@
    1.25             (dorun
    1.26              (for [y (range height)]
    1.27                (let [raw-sensor (sensor-data x)]
    1.28 -                (.setRGB image x y (gray-scale raw-sensor)))))))
    1.29 +                (.setRGB image x y (gray raw-sensor)))))))
    1.30  
    1.31          (vi image)))))
    1.32          
    1.33 @@ -150,9 +136,9 @@
    1.34                       (load-blender-model thing)
    1.35                     (body!))
    1.36          touch (touch! creature)
    1.37 -        touch-view (view-touch)
    1.38 -        vision-data (vision! creature)
    1.39 -        vision-debug (map (fn [_] (debug-vision-window)) vision-data)
    1.40 +        touch-display (view-touch)
    1.41 +        vision (vision! creature)
    1.42 +        vision-display (view-vision)
    1.43          me (sphere 0.5 :color ColorRGBA/Blue :physical? false)
    1.44          hearing-senses (hearing! creature)
    1.45          hearing-windows (map (fn [_] (debug-hearing-window 50))
    1.46 @@ -222,12 +208,11 @@
    1.47            
    1.48            (prop-debug (prop))
    1.49            
    1.50 -          (touch-view (map #(% (.getRootNode world)) touch))
    1.51 +          (touch-display (map #(% (.getRootNode world)) touch))
    1.52 +
    1.53 +          (vision-display (map #(% world) vision))
    1.54            
    1.55            (dorun
    1.56 -           (map #(%1 (%2 world))
    1.57 -                vision-debug vision-data))
    1.58 -          (dorun
    1.59             (map #(%1 (%2 world)) hearing-windows hearing-senses))
    1.60            
    1.61