diff org/test-creature.org @ 143:d0f4b473ab4f

debugging worm proprioception
author Robert McIntyre <rlm@mit.edu>
date Thu, 02 Feb 2012 02:30:22 -0700
parents ffbab4199c0d
children 7a49b81ca1bf
line wrap: on
line diff
     1.1 --- a/org/test-creature.org	Thu Feb 02 02:03:19 2012 -0700
     1.2 +++ b/org/test-creature.org	Thu Feb 02 02:30:22 2012 -0700
     1.3 @@ -1156,66 +1156,75 @@
     1.4          ;; dream
     1.5  
     1.6          ]
     1.7 -  (world
     1.8 -   (nodify [creature
     1.9 -            (box 10 2 10 :position (Vector3f. 0 -9 0)
    1.10 -                 :color ColorRGBA/Gray :mass 0)
    1.11 -            x-axis y-axis z-axis
    1.12 -            me
    1.13 -            ])
    1.14 -   (merge standard-debug-controls
    1.15 -          {"key-return"
    1.16 -           (fn [_ value]
    1.17 -             (if value
    1.18 -               (do
    1.19 -                 (println-repl "play-sound")
    1.20 -                 (.play bell))))})
    1.21 -   (fn [world]
    1.22 -     (light-up-everything world)
    1.23 -     (enable-debug world)
    1.24 -     (dorun (map #(% world) init-vision-fns))
    1.25 -     (dorun (map #(% world) init-hearing-fns))
    1.26 -     
    1.27 -     (add-eye world
    1.28 -              (attach-eye creature (test-eye))
    1.29 -              (comp (view-image) BufferedImage!))
    1.30 -     
    1.31 -     (add-eye world (.getCamera world) no-op)
    1.32 -     ;;(set-gravity world (Vector3f. 0 0 0))
    1.33 -     ;;(com.aurellem.capture.Capture/captureVideo
    1.34 -     ;; world (file-str "/home/r/proj/ai-videos/hand"))
    1.35 -     ;;(.setTimer world (RatchetTimer. 60))
    1.36 -     (speed-up world)
    1.37 -     ;;(set-gravity world (Vector3f. 0 0 0))
    1.38 -     )
    1.39 -   (fn [world tpf]
    1.40 -     ;;(dorun 
    1.41 -     ;; (map #(%1 %2) touch-nerves (repeat (.getRootNode world))))
    1.42 -     
    1.43 -     (prop-debug (prop))
    1.44 -     
    1.45 -     (dorun
    1.46 -      (map #(%1 (%2 (.getRootNode world)))
    1.47 -           touch-debug-windows touch-nerves))
    1.48 -     
    1.49 -     (dorun
    1.50 -      (map #(%1 (%2))
    1.51 -           vision-debug vision-data))
    1.52 -     (dorun
    1.53 -      (map #(%1 (%2)) hearing-windows hearing-senses))
    1.54 -     
    1.55 -     
    1.56 -     ;;(println-repl (vision-data))
    1.57 -     (.setLocalTranslation me (.getLocation (.getCamera world)))
    1.58 -     
    1.59 -
    1.60 -     )
    1.61 +    
    1.62 +    
    1.63 +    (apply
    1.64 +     world
    1.65 +     (with-movement
    1.66 +       (.getChild creature "worm-21")
    1.67 +       ["key-r" "key-t"
    1.68 +        "key-f" "key-g"
    1.69 +        "key-v" "key-b"]
    1.70 +       [10 10 10 10 1 1]
    1.71 +       [(nodify [creature
    1.72 +                 (box 10 2 10 :position (Vector3f. 0 -9 0)
    1.73 +                      :color ColorRGBA/Gray :mass 0)
    1.74 +                 x-axis y-axis z-axis
    1.75 +                 me
    1.76 +                 ])
    1.77 +        (merge standard-debug-controls
    1.78 +               {"key-return"
    1.79 +                (fn [_ value]
    1.80 +                  (if value
    1.81 +                    (do
    1.82 +                      (println-repl "play-sound")
    1.83 +                      (.play bell))))})
    1.84 +        (fn [world]
    1.85 +          (light-up-everything world)
    1.86 +          (enable-debug world)
    1.87 +          (dorun (map #(% world) init-vision-fns))
    1.88 +          (dorun (map #(% world) init-hearing-fns))
    1.89 +          
    1.90 +          (add-eye world
    1.91 +                   (attach-eye creature (test-eye))
    1.92 +                   (comp (view-image) BufferedImage!))
    1.93 +          
    1.94 +          (add-eye world (.getCamera world) no-op)
    1.95 +          (set-gravity world (Vector3f. 0 0 0))
    1.96 +          ;;(com.aurellem.capture.Capture/captureVideo
    1.97 +          ;; world (file-str "/home/r/proj/ai-videos/hand"))
    1.98 +          ;;(.setTimer world (RatchetTimer. 60))
    1.99 +          (speed-up world)
   1.100 +          ;;(set-gravity world (Vector3f. 0 0 0))
   1.101 +          )
   1.102 +        (fn [world tpf]
   1.103 +          ;;(dorun 
   1.104 +          ;; (map #(%1 %2) touch-nerves (repeat (.getRootNode world))))
   1.105 +          
   1.106 +          (prop-debug (prop))
   1.107 +          
   1.108 +          (dorun
   1.109 +           (map #(%1 (%2 (.getRootNode world)))
   1.110 +                touch-debug-windows touch-nerves))
   1.111 +          
   1.112 +          (dorun
   1.113 +           (map #(%1 (%2))
   1.114 +                vision-debug vision-data))
   1.115 +          (dorun
   1.116 +           (map #(%1 (%2)) hearing-windows hearing-senses))
   1.117 +          
   1.118 +          
   1.119 +          ;;(println-repl (vision-data))
   1.120 +          (.setLocalTranslation me (.getLocation (.getCamera world)))
   1.121 +          
   1.122 +          
   1.123 +          )]
   1.124     ;;(let [timer (atom 0)]
   1.125     ;;  (fn [_ _]
   1.126     ;;    (swap! timer inc)
   1.127     ;;    (if (= (rem @timer 60) 0)
   1.128     ;;      (println-repl (float (/ @timer 60))))))
   1.129 -   )))
   1.130 +   ))))
   1.131  
   1.132  
   1.133